diff --git a/bugs.po b/bugs.po index 1c81ad8567..4269ebaa0d 100644 --- a/bugs.po +++ b/bugs.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-27 00:17+0000\n" +"POT-Creation-Date: 2023-11-05 09:50+0000\n" "PO-Revision-Date: 2022-08-31 12:34+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -117,9 +117,10 @@ msgstr "給有意成為 Python 說明文件貢獻者的綜合指南。" #: ../../bugs.rst:41 msgid "" -"`Documentation Translations `_" -msgstr "`說明文件翻譯 `_" +"`Documentation Translations `_" +msgstr "" +"`說明文件翻譯 `_" #: ../../bugs.rst:42 msgid "" diff --git a/c-api/call.po b/c-api/call.po index d125073afb..737b538f4d 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -166,8 +166,8 @@ msgid "" ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " "positional arguments from *nargsf*, use :c:func:`PyVectorcall_NARGS`." msgstr "" -":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` 旗標。如果要從 *nargsf* 獲得實際的位" -"置引數數量,請使用 :c:func:`PyVectorcall_NARGS`。" +":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` 旗標。如果要從 *nargsf* 獲得實際的" +"位置引數數量,請使用 :c:func:`PyVectorcall_NARGS`。" #: ../../c-api/call.rst:94 msgid "*kwnames* is a tuple containing the names of the keyword arguments;" @@ -210,11 +210,11 @@ msgid "" "include a prepended *self* argument) very efficiently." msgstr "" "當可以以幾乎無代價的方式(無需佔據額外的記憶體)來達成,那麼會推薦呼叫者使" -"用 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。這樣做會讓如 bound method(繫結方" -"法)之類的可呼叫函式非常有效地繼續向前呼叫(這類函式包含一個在首位的 *self* " -"引數)。" +"用 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。這樣做會讓如 bound method(繫結" +"方法)之類的可呼叫函式非常有效地繼續向前呼叫(這類函式包含一個在首位的 " +"*self* 引數)。" -#: ../../c-api/call.rst:111 +#: ../../c-api/call.rst:113 msgid "" "To call an object that implements vectorcall, use a :ref:`call API ` function as with any other callable. :c:func:`PyObject_Vectorcall` " @@ -223,7 +223,7 @@ msgstr "" "要呼叫一個實作了 vectorcall 的物件,請就像其他可呼叫物件一樣使用\\ :ref:`呼" "叫 API` 中的函式。:c:func:`PyObject_Vectorcall` 通常是最有效率的。" -#: ../../c-api/call.rst:118 +#: ../../c-api/call.rst:120 msgid "" "In CPython 3.8, the vectorcall API and related functions were available " "provisionally under names with a leading underscore: " @@ -242,11 +242,11 @@ msgstr "" "``_PyObject_FastCallDict`` 名稱提供。這些舊名稱仍有被定義,做為不帶底線的新名" "稱的別名。" -#: ../../c-api/call.rst:130 +#: ../../c-api/call.rst:132 msgid "Recursion Control" msgstr "遞迴控制" -#: ../../c-api/call.rst:132 +#: ../../c-api/call.rst:134 msgid "" "When using *tp_call*, callees do not need to worry about :ref:`recursion " "`: CPython uses :c:func:`Py_EnterRecursiveCall` and :c:func:" @@ -256,7 +256,7 @@ msgstr "" "使用 *tp_call* 的呼叫會使用 :c:func:`Py_EnterRecursiveCall` 和 :c:func:" "`Py_LeaveRecursiveCall`。" -#: ../../c-api/call.rst:137 +#: ../../c-api/call.rst:139 msgid "" "For efficiency, this is not the case for calls done using vectorcall: the " "callee should use *Py_EnterRecursiveCall* and *Py_LeaveRecursiveCall* if " @@ -265,11 +265,11 @@ msgstr "" "為保證效率,這不適用於使用 vectorcall 的呼叫:被呼叫方在需要時應當使用 " "*Py_EnterRecursiveCall* 和 *Py_LeaveRecursiveCall*。" -#: ../../c-api/call.rst:143 +#: ../../c-api/call.rst:145 msgid "Vectorcall Support API" msgstr "Vectorcall 支援 API" -#: ../../c-api/call.rst:147 +#: ../../c-api/call.rst:149 msgid "" "Given a vectorcall *nargsf* argument, return the actual number of arguments. " "Currently equivalent to::" @@ -278,13 +278,13 @@ msgstr "" "\n" "::" -#: ../../c-api/call.rst:153 +#: ../../c-api/call.rst:155 msgid "" "However, the function ``PyVectorcall_NARGS`` should be used to allow for " "future extensions." msgstr "然而,應使用 ``PyVectorcall_NARGS`` 函式以便將來需要擴充。" -#: ../../c-api/call.rst:160 +#: ../../c-api/call.rst:162 msgid "" "If *op* does not support the vectorcall protocol (either because the type " "does not or because the specific instance does not), return *NULL*. " @@ -295,7 +295,7 @@ msgstr "" "*NULL*。否則,回傳儲存在 *op* 中的 vectorcall 函式指標。這個函式不會引發例" "外。" -#: ../../c-api/call.rst:165 +#: ../../c-api/call.rst:167 msgid "" "This is mostly useful to check whether or not *op* supports vectorcall, " "which can be done by checking ``PyVectorcall_Function(op) != NULL``." @@ -303,7 +303,7 @@ msgstr "" "這大多在檢查 *op* 是否支援 vectorcall 時能派上用場,可以透過檢查 " "``PyVectorcall_Function(op) != NULL`` 來達成。" -#: ../../c-api/call.rst:172 +#: ../../c-api/call.rst:174 msgid "" "Call *callable*'s :c:type:`vectorcallfunc` with positional and keyword " "arguments given in a tuple and dict, respectively." @@ -311,7 +311,7 @@ msgstr "" "呼叫 *callable* 的 :c:type:`vectorcallfunc`,其位置引數和關鍵字引數分別以 " "tuple 和 dict 格式給定。" -#: ../../c-api/call.rst:175 +#: ../../c-api/call.rst:177 msgid "" "This is a specialized function, intended to be put in the :c:member:" "`~PyTypeObject.tp_call` slot or be used in an implementation of ``tp_call``. " @@ -319,14 +319,14 @@ msgid "" "not fall back to ``tp_call``." msgstr "" "這是一個專門函式,其目的是被放入 :c:member:`~PyTypeObject.tp_call` 擴充槽或是" -"用於 ``tp_call`` 的實作。它不會檢查 :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` 旗標" -"並且它不會退回 (fall back) 使用 ``tp_call``。" +"用於 ``tp_call`` 的實作。它不會檢查 :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` 旗" +"標並且它不會退回 (fall back) 使用 ``tp_call``。" -#: ../../c-api/call.rst:186 +#: ../../c-api/call.rst:188 msgid "Object Calling API" msgstr "物件呼叫 API" -#: ../../c-api/call.rst:188 +#: ../../c-api/call.rst:190 msgid "" "Various functions are available for calling a Python object. Each converts " "its arguments to a convention supported by the called object – either " @@ -337,133 +337,133 @@ msgstr "" "的慣用形式 – 可以是 *tp_call* 或 vectorcall。為了儘可能減少轉換的進行,請選擇" "一個適合你所擁有資料格式的函式。" -#: ../../c-api/call.rst:194 +#: ../../c-api/call.rst:196 msgid "" "The following table summarizes the available functions; please see " "individual documentation for details." msgstr "下表總結了可用的函式;請參閱各個說明文件以瞭解詳情。" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "Function" msgstr "函式" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "callable" msgstr "callable" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "args" msgstr "args" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "kwargs" msgstr "kwargs" -#: ../../c-api/call.rst:200 +#: ../../c-api/call.rst:202 msgid ":c:func:`PyObject_Call`" msgstr ":c:func:`PyObject_Call`" -#: ../../c-api/call.rst:200 ../../c-api/call.rst:202 ../../c-api/call.rst:204 -#: ../../c-api/call.rst:206 ../../c-api/call.rst:208 ../../c-api/call.rst:212 -#: ../../c-api/call.rst:220 ../../c-api/call.rst:222 +#: ../../c-api/call.rst:202 ../../c-api/call.rst:204 ../../c-api/call.rst:206 +#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 ../../c-api/call.rst:214 +#: ../../c-api/call.rst:222 ../../c-api/call.rst:224 msgid "``PyObject *``" msgstr "``PyObject *``" -#: ../../c-api/call.rst:200 +#: ../../c-api/call.rst:202 msgid "tuple" msgstr "tuple" -#: ../../c-api/call.rst:200 ../../c-api/call.rst:222 +#: ../../c-api/call.rst:202 ../../c-api/call.rst:224 msgid "dict/``NULL``" msgstr "dict/``NULL``" -#: ../../c-api/call.rst:202 +#: ../../c-api/call.rst:204 msgid ":c:func:`PyObject_CallNoArgs`" msgstr ":c:func:`PyObject_CallNoArgs`" -#: ../../c-api/call.rst:202 ../../c-api/call.rst:204 ../../c-api/call.rst:206 -#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 ../../c-api/call.rst:212 -#: ../../c-api/call.rst:214 ../../c-api/call.rst:216 ../../c-api/call.rst:218 +#: ../../c-api/call.rst:204 ../../c-api/call.rst:206 ../../c-api/call.rst:208 +#: ../../c-api/call.rst:210 ../../c-api/call.rst:212 ../../c-api/call.rst:214 +#: ../../c-api/call.rst:216 ../../c-api/call.rst:218 ../../c-api/call.rst:220 msgid "---" msgstr "---" -#: ../../c-api/call.rst:204 +#: ../../c-api/call.rst:206 msgid ":c:func:`PyObject_CallOneArg`" msgstr ":c:func:`PyObject_CallOneArg`" -#: ../../c-api/call.rst:204 ../../c-api/call.rst:218 +#: ../../c-api/call.rst:206 ../../c-api/call.rst:220 msgid "1 object" msgstr "一個物件" -#: ../../c-api/call.rst:206 +#: ../../c-api/call.rst:208 msgid ":c:func:`PyObject_CallObject`" msgstr ":c:func:`PyObject_CallObject`" -#: ../../c-api/call.rst:206 +#: ../../c-api/call.rst:208 msgid "tuple/``NULL``" msgstr "tuple/``NULL``" -#: ../../c-api/call.rst:208 +#: ../../c-api/call.rst:210 msgid ":c:func:`PyObject_CallFunction`" msgstr ":c:func:`PyObject_CallFunction`" -#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 +#: ../../c-api/call.rst:210 ../../c-api/call.rst:212 msgid "format" msgstr "format" -#: ../../c-api/call.rst:210 +#: ../../c-api/call.rst:212 msgid ":c:func:`PyObject_CallMethod`" msgstr ":c:func:`PyObject_CallMethod`" -#: ../../c-api/call.rst:210 +#: ../../c-api/call.rst:212 msgid "obj + ``char*``" msgstr "物件 + ``char*``" -#: ../../c-api/call.rst:212 +#: ../../c-api/call.rst:214 msgid ":c:func:`PyObject_CallFunctionObjArgs`" msgstr ":c:func:`PyObject_CallFunctionObjArgs`" -#: ../../c-api/call.rst:212 ../../c-api/call.rst:214 +#: ../../c-api/call.rst:214 ../../c-api/call.rst:216 msgid "variadic" msgstr "可變引數" -#: ../../c-api/call.rst:214 +#: ../../c-api/call.rst:216 msgid ":c:func:`PyObject_CallMethodObjArgs`" msgstr ":c:func:`PyObject_CallMethodObjArgs`" -#: ../../c-api/call.rst:214 ../../c-api/call.rst:216 ../../c-api/call.rst:218 +#: ../../c-api/call.rst:216 ../../c-api/call.rst:218 ../../c-api/call.rst:220 msgid "obj + name" msgstr "物件 + 名稱" -#: ../../c-api/call.rst:216 +#: ../../c-api/call.rst:218 msgid ":c:func:`PyObject_CallMethodNoArgs`" msgstr ":c:func:`PyObject_CallMethodNoArgs`" -#: ../../c-api/call.rst:218 +#: ../../c-api/call.rst:220 msgid ":c:func:`PyObject_CallMethodOneArg`" msgstr ":c:func:`PyObject_CallMethodOneArg`" -#: ../../c-api/call.rst:220 +#: ../../c-api/call.rst:222 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../c-api/call.rst:220 ../../c-api/call.rst:222 ../../c-api/call.rst:224 +#: ../../c-api/call.rst:222 ../../c-api/call.rst:224 ../../c-api/call.rst:226 msgid "vectorcall" msgstr "vectorcall" -#: ../../c-api/call.rst:222 +#: ../../c-api/call.rst:224 msgid ":c:func:`PyObject_VectorcallDict`" msgstr ":c:func:`PyObject_VectorcallDict`" -#: ../../c-api/call.rst:224 +#: ../../c-api/call.rst:226 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../c-api/call.rst:224 +#: ../../c-api/call.rst:226 msgid "arg + name" msgstr "引數 + 名稱" -#: ../../c-api/call.rst:230 +#: ../../c-api/call.rst:232 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*, and named arguments given by the dictionary *kwargs*." @@ -471,7 +471,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶由 tuple *args* 所給定的引數及由" "字典 *kwargs* 所給定的關鍵字引數。" -#: ../../c-api/call.rst:233 +#: ../../c-api/call.rst:235 msgid "" "*args* must not be *NULL*; use an empty tuple if no arguments are needed. If " "no named arguments are needed, *kwargs* can be *NULL*." @@ -479,22 +479,22 @@ msgstr "" "*args* 必須不為 *NULL*;如果不需要引數,請使用一個空 tuple。如果不需要關鍵字" "引數,則 *kwargs* 可以為 *NULL*。" -#: ../../c-api/call.rst:236 ../../c-api/call.rst:248 ../../c-api/call.rst:259 -#: ../../c-api/call.rst:270 ../../c-api/call.rst:282 ../../c-api/call.rst:302 -#: ../../c-api/call.rst:321 ../../c-api/call.rst:335 ../../c-api/call.rst:344 -#: ../../c-api/call.rst:356 ../../c-api/call.rst:369 ../../c-api/call.rst:403 +#: ../../c-api/call.rst:238 ../../c-api/call.rst:250 ../../c-api/call.rst:261 +#: ../../c-api/call.rst:272 ../../c-api/call.rst:284 ../../c-api/call.rst:304 +#: ../../c-api/call.rst:323 ../../c-api/call.rst:337 ../../c-api/call.rst:346 +#: ../../c-api/call.rst:358 ../../c-api/call.rst:371 ../../c-api/call.rst:405 msgid "" "Return the result of the call on success, or raise an exception and return " "*NULL* on failure." msgstr "成功時回傳結果,或在失敗時引發一個例外並回傳 *NULL*。" -#: ../../c-api/call.rst:239 +#: ../../c-api/call.rst:241 msgid "" "This is the equivalent of the Python expression: ``callable(*args, " "**kwargs)``." msgstr "這等價於 Python 運算式 ``callable(*args, **kwargs)``。" -#: ../../c-api/call.rst:245 +#: ../../c-api/call.rst:247 msgid "" "Call a callable Python object *callable* without any arguments. It is the " "most efficient way to call a callable Python object without any argument." @@ -502,7 +502,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable* 並不附帶任何引數。這是不帶引數呼叫 " "Python 可呼叫物件的最有效方式。" -#: ../../c-api/call.rst:256 +#: ../../c-api/call.rst:258 msgid "" "Call a callable Python object *callable* with exactly 1 positional argument " "*arg* and no keyword arguments." @@ -510,7 +510,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable* 並附帶正好一個位置引數 *arg* 而沒有關" "鍵字引數。" -#: ../../c-api/call.rst:267 +#: ../../c-api/call.rst:269 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*. If no arguments are needed, then *args* can be *NULL*." @@ -518,11 +518,11 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶由 tuple *args* 所給定的引數。如" "果不需要傳入引數,則 *args* 可以為 *NULL*。" -#: ../../c-api/call.rst:273 ../../c-api/call.rst:285 +#: ../../c-api/call.rst:275 ../../c-api/call.rst:287 msgid "This is the equivalent of the Python expression: ``callable(*args)``." msgstr "這等價於 Python 運算式 ``callable(*args)``。" -#: ../../c-api/call.rst:278 +#: ../../c-api/call.rst:280 msgid "" "Call a callable Python object *callable*, with a variable number of C " "arguments. The C arguments are described using a :c:func:`Py_BuildValue` " @@ -533,7 +533,7 @@ msgstr "" "用 :c:func:`Py_BuildValue` 風格的格式字串來描述。格式可以為 *NULL*,表示沒有" "提供任何引數。" -#: ../../c-api/call.rst:287 +#: ../../c-api/call.rst:289 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallFunctionObjArgs` is a faster alternative." @@ -541,11 +541,11 @@ msgstr "" "注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:" "`PyObject_CallFunctionObjArgs` 是另一個更快速的選擇。" -#: ../../c-api/call.rst:290 +#: ../../c-api/call.rst:292 msgid "The type of *format* was changed from ``char *``." msgstr "這個 *format* 的型別已從 ``char *`` 更改。" -#: ../../c-api/call.rst:296 +#: ../../c-api/call.rst:298 msgid "" "Call the method named *name* of object *obj* with a variable number of C " "arguments. The C arguments are described by a :c:func:`Py_BuildValue` " @@ -554,17 +554,17 @@ msgstr "" "呼叫 *obj* 物件中名為 *name* 的 method 並附帶數量可變的 C 引數。這些 C 引數" "由 :c:func:`Py_BuildValue` 格式字串來描述,並應當生成一個 tuple。" -#: ../../c-api/call.rst:300 +#: ../../c-api/call.rst:302 msgid "The format can be *NULL*, indicating that no arguments are provided." msgstr "格式可以為 *NULL*,表示沒有提供任何引數。" -#: ../../c-api/call.rst:305 +#: ../../c-api/call.rst:307 msgid "" "This is the equivalent of the Python expression: ``obj.name(arg1, " "arg2, ...)``." msgstr "這等價於 Python 運算式 ``obj.name(arg1, arg2, ...)``。" -#: ../../c-api/call.rst:308 +#: ../../c-api/call.rst:310 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallMethodObjArgs` is a faster alternative." @@ -572,11 +572,11 @@ msgstr "" "注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:" "`PyObject_CallMethodObjArgs` 是另一個更快速的選擇。" -#: ../../c-api/call.rst:311 +#: ../../c-api/call.rst:313 msgid "The types of *name* and *format* were changed from ``char *``." msgstr "*name* 和 *format* 的型別已從 ``char *`` 更改。" -#: ../../c-api/call.rst:317 +#: ../../c-api/call.rst:319 msgid "" "Call a callable Python object *callable*, with a variable number of :c:expr:" "`PyObject *` arguments. The arguments are provided as a variable number of " @@ -585,13 +585,13 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶數量可變的 :c:expr:`PyObject *` " "引數。這些引數是以位置在 *NULL* 後面、數量可變的參數來提供。" -#: ../../c-api/call.rst:324 +#: ../../c-api/call.rst:326 msgid "" "This is the equivalent of the Python expression: ``callable(arg1, " "arg2, ...)``." msgstr "這等價於 Python 運算式 ``callable(arg1, arg2, ...)``。" -#: ../../c-api/call.rst:330 +#: ../../c-api/call.rst:332 msgid "" "Call a method of the Python object *obj*, where the name of the method is " "given as a Python string object in *name*. It is called with a variable " @@ -602,7 +602,7 @@ msgstr "" "Python 字串物件給定。被呼叫時會附帶數量可變的 :c:expr:`PyObject *` 引數。這些" "引數是以位置在 *NULL* 後面、且數量可變的參數來提供。" -#: ../../c-api/call.rst:341 +#: ../../c-api/call.rst:343 msgid "" "Call a method of the Python object *obj* without arguments, where the name " "of the method is given as a Python string object in *name*." @@ -610,7 +610,7 @@ msgstr "" "不附帶任何引數地呼叫 Python 物件 *obj* 中的一個 method,其中 method 名稱由 " "*name* 中的 Python 字串物件給定。" -#: ../../c-api/call.rst:352 +#: ../../c-api/call.rst:354 msgid "" "Call a method of the Python object *obj* with a single positional argument " "*arg*, where the name of the method is given as a Python string object in " @@ -619,7 +619,7 @@ msgstr "" "附帶一個位置引數 *arg* 地呼叫 Python 物件 *obj* 中的一個 method,其中 method " "名稱由 *name* 中的 Python 字串物件給定。" -#: ../../c-api/call.rst:364 +#: ../../c-api/call.rst:366 msgid "" "Call a callable Python object *callable*. The arguments are the same as for :" "c:type:`vectorcallfunc`. If *callable* supports vectorcall_, this directly " @@ -629,7 +629,7 @@ msgstr "" "的相同。如果 *callable* 支援 vectorcall_,則它會直接呼叫存放在 *callable* 中" "的 vectorcall 函式。" -#: ../../c-api/call.rst:376 +#: ../../c-api/call.rst:378 msgid "" "Call *callable* with positional arguments passed exactly as in the " "vectorcall_ protocol, but with keyword arguments passed as a dictionary " @@ -638,7 +638,7 @@ msgstr "" "附帶與在 vectorcall_ 協定中傳入的相同位置引數來呼叫 *callable*,但會加上以字" "典 *kwdict* 格式傳入的關鍵字引數。*args* 陣列將只包含位置引數。" -#: ../../c-api/call.rst:380 +#: ../../c-api/call.rst:382 msgid "" "Regardless of which protocol is used internally, a conversion of arguments " "needs to be done. Therefore, this function should only be used if the caller " @@ -648,7 +648,7 @@ msgstr "" "無論內部使用了哪一種協定,都會需要進行引數的轉換。因此,此函式應該只有在呼叫" "方已經擁有一個要作為關鍵字引數的字典、但沒有作為位置引數的 tuple 時才被使用。" -#: ../../c-api/call.rst:390 +#: ../../c-api/call.rst:392 msgid "" "Call a method using the vectorcall calling convention. The name of the " "method is given as a Python string *name*. The object whose method is called " @@ -666,19 +666,19 @@ msgstr "" "加上 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。關鍵字引數可以像在 :c:func:" "`PyObject_Vectorcall` 中一樣被傳入。" -#: ../../c-api/call.rst:399 +#: ../../c-api/call.rst:401 msgid "" "If the object has the :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " "will call the unbound method object with the full *args* vector as arguments." msgstr "" -"如果物件具有 :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` 特性,這將以完整的 *args* " -"向量作為引數來呼叫 unbound method(未繫結方法)物件。" +"如果物件具有 :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` 特性,這將以完整的 " +"*args* 向量作為引數來呼叫 unbound method(未繫結方法)物件。" -#: ../../c-api/call.rst:410 +#: ../../c-api/call.rst:412 msgid "Call Support API" msgstr "呼叫支援 API" -#: ../../c-api/call.rst:414 +#: ../../c-api/call.rst:416 msgid "" "Determine if the object *o* is callable. Return ``1`` if the object is " "callable and ``0`` otherwise. This function always succeeds." diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 023dd83533..5c6767c7db 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-31 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,31 +125,40 @@ msgstr "" msgid "" "The function is called with a single argument *obj* that identifies the " "context in which the unraisable exception occurred. If possible, the repr of " -"*obj* will be printed in the warning message." +"*obj* will be printed in the warning message. If *obj* is ``NULL``, only the " +"traceback is printed." msgstr "" -#: ../../c-api/exceptions.rst:92 +#: ../../c-api/exceptions.rst:93 msgid "An exception must be set when calling this function." msgstr "" -#: ../../c-api/exceptions.rst:96 +#: ../../c-api/exceptions.rst:95 +msgid "Print a traceback. Print only traceback if *obj* is ``NULL``." +msgstr "" + +#: ../../c-api/exceptions.rst:98 +msgid "Use :func:`sys.unraisablehook`." +msgstr "" + +#: ../../c-api/exceptions.rst:104 msgid "" "Print the standard traceback display of ``exc`` to ``sys.stderr``, including " "chained exceptions and notes." msgstr "" -#: ../../c-api/exceptions.rst:102 +#: ../../c-api/exceptions.rst:110 msgid "Raising exceptions" msgstr "" -#: ../../c-api/exceptions.rst:104 +#: ../../c-api/exceptions.rst:112 msgid "" "These functions help you set the current thread's error indicator. For " "convenience, some of these functions will always return a ``NULL`` pointer " "for use in a ``return`` statement." msgstr "" -#: ../../c-api/exceptions.rst:111 +#: ../../c-api/exceptions.rst:119 msgid "" "This is the most common way to set the error indicator. The first argument " "specifies the exception type; it is normally one of the standard exceptions, " @@ -158,13 +167,13 @@ msgid "" "error message; it is decoded from ``'utf-8'``." msgstr "" -#: ../../c-api/exceptions.rst:120 +#: ../../c-api/exceptions.rst:128 msgid "" "This function is similar to :c:func:`PyErr_SetString` but lets you specify " "an arbitrary Python object for the \"value\" of the exception." msgstr "" -#: ../../c-api/exceptions.rst:126 +#: ../../c-api/exceptions.rst:134 msgid "" "This function sets the error indicator and returns ``NULL``. *exception* " "should be a Python exception class. The *format* and subsequent parameters " @@ -172,31 +181,31 @@ msgid "" "c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." msgstr "" -#: ../../c-api/exceptions.rst:135 +#: ../../c-api/exceptions.rst:143 msgid "" "Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument " "rather than a variable number of arguments." msgstr "" -#: ../../c-api/exceptions.rst:143 +#: ../../c-api/exceptions.rst:151 msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``." msgstr "" -#: ../../c-api/exceptions.rst:148 +#: ../../c-api/exceptions.rst:156 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where " "*message* indicates that a built-in operation was invoked with an illegal " "argument. It is mostly for internal use." msgstr "" -#: ../../c-api/exceptions.rst:155 +#: ../../c-api/exceptions.rst:163 msgid "" "This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns " "``NULL`` so an object allocation function can write ``return " "PyErr_NoMemory();`` when it runs out of memory." msgstr "" -#: ../../c-api/exceptions.rst:164 +#: ../../c-api/exceptions.rst:172 msgid "" "This is a convenience function to raise an exception when a C library " "function has returned an error and set the C variable :c:data:`errno`. It " @@ -210,7 +219,7 @@ msgid "" "``return PyErr_SetFromErrno(type);`` when the system call returns an error." msgstr "" -#: ../../c-api/exceptions.rst:178 +#: ../../c-api/exceptions.rst:186 msgid "" "Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that " "if *filenameObject* is not ``NULL``, it is passed to the constructor of " @@ -218,21 +227,21 @@ msgid "" "is used to define the :attr:`!filename` attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:187 +#: ../../c-api/exceptions.rst:195 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a " "second filename object, for raising errors when a function that takes two " "filenames fails." msgstr "" -#: ../../c-api/exceptions.rst:196 +#: ../../c-api/exceptions.rst:204 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename " "is given as a C string. *filename* is decoded from the :term:`filesystem " "encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:203 +#: ../../c-api/exceptions.rst:211 msgid "" "This is a convenience function to raise :exc:`WindowsError`. If called with " "*ierr* of ``0``, the error code returned by a call to :c:func:`!" @@ -245,19 +254,19 @@ msgid "" "returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:212 ../../c-api/exceptions.rst:220 -#: ../../c-api/exceptions.rst:231 ../../c-api/exceptions.rst:241 -#: ../../c-api/exceptions.rst:249 ../../c-api/exceptions.rst:259 +#: ../../c-api/exceptions.rst:220 ../../c-api/exceptions.rst:228 +#: ../../c-api/exceptions.rst:239 ../../c-api/exceptions.rst:249 +#: ../../c-api/exceptions.rst:257 ../../c-api/exceptions.rst:267 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../c-api/exceptions.rst:217 +#: ../../c-api/exceptions.rst:225 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter " "specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:225 +#: ../../c-api/exceptions.rst:233 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior " "that if *filename* is not ``NULL``, it is decoded from the filesystem " @@ -266,7 +275,7 @@ msgid "" "attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:236 +#: ../../c-api/exceptions.rst:244 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErr`, with the additional " "behavior that if *filename* is not ``NULL``, it is passed to the constructor " @@ -274,19 +283,19 @@ msgid "" "filename` attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:246 +#: ../../c-api/exceptions.rst:254 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " "accepts a second filename object." msgstr "" -#: ../../c-api/exceptions.rst:256 +#: ../../c-api/exceptions.rst:264 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " "parameter specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:264 +#: ../../c-api/exceptions.rst:272 msgid "" "This is a convenience function to raise :exc:`ImportError`. *msg* will be " "set as the exception's message string. *name* and *path*, both of which can " @@ -294,13 +303,13 @@ msgid "" "``path`` attributes." msgstr "" -#: ../../c-api/exceptions.rst:274 +#: ../../c-api/exceptions.rst:282 msgid "" "Much like :c:func:`PyErr_SetImportError` but this function allows for " "specifying a subclass of :exc:`ImportError` to raise." msgstr "" -#: ../../c-api/exceptions.rst:282 +#: ../../c-api/exceptions.rst:290 msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " @@ -308,19 +317,19 @@ msgid "" "is a :exc:`SyntaxError`." msgstr "" -#: ../../c-api/exceptions.rst:292 +#: ../../c-api/exceptions.rst:300 msgid "" "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:300 +#: ../../c-api/exceptions.rst:308 msgid "" "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " "omitted." msgstr "" -#: ../../c-api/exceptions.rst:306 +#: ../../c-api/exceptions.rst:314 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " @@ -328,11 +337,11 @@ msgid "" "use." msgstr "" -#: ../../c-api/exceptions.rst:313 +#: ../../c-api/exceptions.rst:321 msgid "Issuing warnings" msgstr "" -#: ../../c-api/exceptions.rst:315 +#: ../../c-api/exceptions.rst:323 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -348,7 +357,7 @@ msgid "" "return an error value)." msgstr "" -#: ../../c-api/exceptions.rst:330 +#: ../../c-api/exceptions.rst:338 msgid "" "Issue a warning message. The *category* argument is a warning category (see " "below) or ``NULL``; the *message* argument is a UTF-8 encoded string. " @@ -358,7 +367,7 @@ msgid "" "`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" -#: ../../c-api/exceptions.rst:337 +#: ../../c-api/exceptions.rst:345 msgid "" "Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:" "`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default " @@ -367,14 +376,14 @@ msgid "" "enumerated at :ref:`standardwarningcategories`." msgstr "" -#: ../../c-api/exceptions.rst:343 +#: ../../c-api/exceptions.rst:351 msgid "" "For information about warning control, see the documentation for the :mod:" "`warnings` module and the :option:`-W` option in the command line " "documentation. There is no C API for warning control." msgstr "" -#: ../../c-api/exceptions.rst:350 +#: ../../c-api/exceptions.rst:358 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." @@ -382,31 +391,31 @@ msgid "" "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" -#: ../../c-api/exceptions.rst:361 +#: ../../c-api/exceptions.rst:369 msgid "" "Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and " "*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:368 +#: ../../c-api/exceptions.rst:376 msgid "" "Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" "`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" "encoded string." msgstr "" -#: ../../c-api/exceptions.rst:377 +#: ../../c-api/exceptions.rst:385 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" "`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`." msgstr "" -#: ../../c-api/exceptions.rst:384 +#: ../../c-api/exceptions.rst:392 msgid "Querying the error indicator" msgstr "" -#: ../../c-api/exceptions.rst:388 +#: ../../c-api/exceptions.rst:396 msgid "" "Test whether the error indicator is set. If set, return the exception " "*type* (the first argument to the last call to one of the ``PyErr_Set*`` " @@ -415,11 +424,11 @@ msgid "" "`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:394 +#: ../../c-api/exceptions.rst:402 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/exceptions.rst:398 +#: ../../c-api/exceptions.rst:406 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -427,14 +436,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: ../../c-api/exceptions.rst:406 +#: ../../c-api/exceptions.rst:414 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " "violation will occur if no exception has been raised." msgstr "" -#: ../../c-api/exceptions.rst:413 +#: ../../c-api/exceptions.rst:421 msgid "" "Return true if the *given* exception matches the exception type in *exc*. " "If *exc* is a class object, this also returns true when *given* is an " @@ -442,43 +451,43 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:421 +#: ../../c-api/exceptions.rst:429 msgid "" "Return the exception currently being raised, clearing the error indicator at " "the same time." msgstr "" -#: ../../c-api/exceptions.rst:424 +#: ../../c-api/exceptions.rst:432 msgid "" "This function is used by code that needs to catch exceptions, or code that " "needs to save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:427 ../../c-api/exceptions.rst:471 +#: ../../c-api/exceptions.rst:435 ../../c-api/exceptions.rst:479 msgid "For example::" msgstr "" -#: ../../c-api/exceptions.rst:437 +#: ../../c-api/exceptions.rst:445 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " "handled." msgstr "" -#: ../../c-api/exceptions.rst:445 +#: ../../c-api/exceptions.rst:453 msgid "" "Set *exc* as the exception currently being raised, clearing the existing " "exception if one is set." msgstr "" -#: ../../c-api/exceptions.rst:450 +#: ../../c-api/exceptions.rst:458 msgid "This call steals a reference to *exc*, which must be a valid exception." msgstr "" -#: ../../c-api/exceptions.rst:459 +#: ../../c-api/exceptions.rst:467 msgid "Use :c:func:`PyErr_GetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:461 +#: ../../c-api/exceptions.rst:469 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -487,17 +496,17 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:468 +#: ../../c-api/exceptions.rst:476 msgid "" "This function is normally only used by legacy code that needs to catch " "exceptions or save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:487 +#: ../../c-api/exceptions.rst:495 msgid "Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:489 +#: ../../c-api/exceptions.rst:497 msgid "" "Set the error indicator from the three objects, *type*, *value*, and " "*traceback*, clearing the existing exception if one is set. If the objects " @@ -510,20 +519,20 @@ msgid "" "don't use this function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:503 +#: ../../c-api/exceptions.rst:511 msgid "" "This function is normally only used by legacy code that needs to save and " "restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save " "the current error indicator." msgstr "" -#: ../../c-api/exceptions.rst:512 +#: ../../c-api/exceptions.rst:520 msgid "" "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" "normalization." msgstr "" -#: ../../c-api/exceptions.rst:515 +#: ../../c-api/exceptions.rst:523 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -533,14 +542,14 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:523 +#: ../../c-api/exceptions.rst:531 msgid "" "This function *does not* implicitly set the ``__traceback__`` attribute on " "the exception value. If setting the traceback appropriately is desired, the " "following additional snippet is needed::" msgstr "" -#: ../../c-api/exceptions.rst:534 +#: ../../c-api/exceptions.rst:542 msgid "" "Retrieve the active exception instance, as would be returned by :func:`sys." "exception`. This refers to an exception that was *already caught*, not to an " @@ -548,7 +557,7 @@ msgid "" "or ``NULL``. Does not modify the interpreter's exception state." msgstr "" -#: ../../c-api/exceptions.rst:541 +#: ../../c-api/exceptions.rst:549 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -556,14 +565,14 @@ msgid "" "clear the exception state." msgstr "" -#: ../../c-api/exceptions.rst:550 +#: ../../c-api/exceptions.rst:558 msgid "" "Set the active exception, as known from ``sys.exception()``. This refers to " "an exception that was *already caught*, not to an exception that was freshly " "raised. To clear the exception state, pass ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:557 +#: ../../c-api/exceptions.rst:565 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -571,7 +580,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:566 +#: ../../c-api/exceptions.rst:574 msgid "" "Retrieve the old-style representation of the exception info, as known from :" "func:`sys.exc_info`. This refers to an exception that was *already caught*, " @@ -581,7 +590,7 @@ msgid "" "using :c:func:`PyErr_GetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:575 +#: ../../c-api/exceptions.rst:583 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -589,7 +598,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:585 +#: ../../c-api/exceptions.rst:593 msgid "" "Set the exception info, as known from ``sys.exc_info()``. This refers to an " "exception that was *already caught*, not to an exception that was freshly " @@ -599,7 +608,7 @@ msgid "" "`PyErr_SetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:594 +#: ../../c-api/exceptions.rst:602 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -607,22 +616,22 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:601 +#: ../../c-api/exceptions.rst:609 msgid "" "The ``type`` and ``traceback`` arguments are no longer used and can be NULL. " "The interpreter now derives them from the exception instance (the ``value`` " "argument). The function still steals references of all three arguments." msgstr "" -#: ../../c-api/exceptions.rst:609 +#: ../../c-api/exceptions.rst:617 msgid "Signal Handling" msgstr "" -#: ../../c-api/exceptions.rst:619 +#: ../../c-api/exceptions.rst:627 msgid "This function interacts with Python's signal handling." msgstr "" -#: ../../c-api/exceptions.rst:621 +#: ../../c-api/exceptions.rst:629 msgid "" "If the function is called from the main thread and under the main Python " "interpreter, it checks whether a signal has been sent to the processes and " @@ -630,7 +639,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: ../../c-api/exceptions.rst:626 +#: ../../c-api/exceptions.rst:634 msgid "" "The function attempts to handle all pending signals, and then returns ``0``. " "However, if a Python signal handler raises an exception, the error indicator " @@ -639,44 +648,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: ../../c-api/exceptions.rst:632 +#: ../../c-api/exceptions.rst:640 msgid "" "If the function is called from a non-main thread, or under a non-main Python " "interpreter, it does nothing and returns ``0``." msgstr "" -#: ../../c-api/exceptions.rst:635 +#: ../../c-api/exceptions.rst:643 msgid "" "This function can be called by long-running C code that wants to be " "interruptible by user requests (such as by pressing Ctrl-C)." msgstr "" -#: ../../c-api/exceptions.rst:639 +#: ../../c-api/exceptions.rst:647 msgid "" "The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:650 +#: ../../c-api/exceptions.rst:658 msgid "" "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: ../../c-api/exceptions.rst:654 ../../c-api/exceptions.rst:681 +#: ../../c-api/exceptions.rst:662 ../../c-api/exceptions.rst:689 msgid "" "This function is async-signal-safe. It can be called without the :term:" "`GIL` and from a C signal handler." msgstr "" -#: ../../c-api/exceptions.rst:664 +#: ../../c-api/exceptions.rst:672 msgid "" "Simulate the effect of a signal arriving. The next time :c:func:" "`PyErr_CheckSignals` is called, the Python signal handler for the given " "signal number will be called." msgstr "" -#: ../../c-api/exceptions.rst:668 +#: ../../c-api/exceptions.rst:676 msgid "" "This function can be called by C code that sets up its own signal handling " "and wants Python signal handlers to be invoked as expected when an " @@ -684,27 +693,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:673 +#: ../../c-api/exceptions.rst:681 msgid "" "If the given signal isn't handled by Python (it was set to :py:const:`signal." "SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." msgstr "" -#: ../../c-api/exceptions.rst:676 +#: ../../c-api/exceptions.rst:684 msgid "" "If *signum* is outside of the allowed range of signal numbers, ``-1`` is " "returned. Otherwise, ``0`` is returned. The error indicator is never " "changed by this function." msgstr "" -#: ../../c-api/exceptions.rst:689 +#: ../../c-api/exceptions.rst:697 msgid "" "This utility function specifies a file descriptor to which the signal number " "is written as a single byte whenever a signal is received. *fd* must be non-" "blocking. It returns the previous such file descriptor." msgstr "" -#: ../../c-api/exceptions.rst:693 +#: ../../c-api/exceptions.rst:701 msgid "" "The value ``-1`` disables the feature; this is the initial state. This is " "equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error " @@ -712,15 +721,15 @@ msgid "" "be called from the main thread." msgstr "" -#: ../../c-api/exceptions.rst:698 +#: ../../c-api/exceptions.rst:706 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../c-api/exceptions.rst:703 +#: ../../c-api/exceptions.rst:711 msgid "Exception Classes" msgstr "例外類別" -#: ../../c-api/exceptions.rst:707 +#: ../../c-api/exceptions.rst:715 msgid "" "This utility function creates and returns a new exception class. The *name* " "argument must be the name of the new exception, a C string of the form " @@ -729,7 +738,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:713 +#: ../../c-api/exceptions.rst:721 msgid "" "The :attr:`__module__` attribute of the new class is set to the first part " "(up to the last dot) of the *name* argument, and the class name is set to " @@ -739,31 +748,31 @@ msgid "" "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:722 +#: ../../c-api/exceptions.rst:730 msgid "" "Same as :c:func:`PyErr_NewException`, except that the new exception class " "can easily be given a docstring: If *doc* is non-``NULL``, it will be used " "as the docstring for the exception class." msgstr "" -#: ../../c-api/exceptions.rst:730 +#: ../../c-api/exceptions.rst:738 msgid "Exception Objects" msgstr "例外物件" -#: ../../c-api/exceptions.rst:734 +#: ../../c-api/exceptions.rst:742 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through :attr:`__traceback__`. If there is no " "traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:741 +#: ../../c-api/exceptions.rst:749 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:747 +#: ../../c-api/exceptions.rst:755 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -771,41 +780,41 @@ msgid "" "this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:755 +#: ../../c-api/exceptions.rst:763 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This steals a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:762 +#: ../../c-api/exceptions.rst:770 msgid "" "Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " "accessible from Python through :attr:`__cause__`." msgstr "" -#: ../../c-api/exceptions.rst:769 +#: ../../c-api/exceptions.rst:777 msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " "exception instance or ``None``. This steals a reference to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:773 +#: ../../c-api/exceptions.rst:781 msgid "" ":attr:`__suppress_context__` is implicitly set to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:778 +#: ../../c-api/exceptions.rst:786 msgid "Return :attr:`~BaseException.args` of exception *ex*." msgstr "" -#: ../../c-api/exceptions.rst:783 +#: ../../c-api/exceptions.rst:791 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "" -#: ../../c-api/exceptions.rst:787 +#: ../../c-api/exceptions.rst:795 msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " @@ -817,72 +826,72 @@ msgid "" "if there is nothing to reraise." msgstr "" -#: ../../c-api/exceptions.rst:801 +#: ../../c-api/exceptions.rst:809 msgid "Unicode Exception Objects" msgstr "" -#: ../../c-api/exceptions.rst:803 +#: ../../c-api/exceptions.rst:811 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:807 +#: ../../c-api/exceptions.rst:815 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:814 +#: ../../c-api/exceptions.rst:822 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:820 +#: ../../c-api/exceptions.rst:828 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:826 +#: ../../c-api/exceptions.rst:834 msgid "" "Get the *start* attribute of the given exception object and place it into " "*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:834 +#: ../../c-api/exceptions.rst:842 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:841 +#: ../../c-api/exceptions.rst:849 msgid "" "Get the *end* attribute of the given exception object and place it into " "*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:849 +#: ../../c-api/exceptions.rst:857 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:856 +#: ../../c-api/exceptions.rst:864 msgid "Return the *reason* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:862 +#: ../../c-api/exceptions.rst:870 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:869 +#: ../../c-api/exceptions.rst:877 msgid "Recursion Control" msgstr "" -#: ../../c-api/exceptions.rst:871 +#: ../../c-api/exceptions.rst:879 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -892,44 +901,44 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:880 +#: ../../c-api/exceptions.rst:888 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:882 +#: ../../c-api/exceptions.rst:890 msgid "" "If :c:macro:`USE_STACKCHECK` is defined, this function checks if the OS " "stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it " "sets a :exc:`MemoryError` and returns a nonzero value." msgstr "" -#: ../../c-api/exceptions.rst:886 +#: ../../c-api/exceptions.rst:894 msgid "" "The function then checks if the recursion limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:890 +#: ../../c-api/exceptions.rst:898 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:894 ../../c-api/exceptions.rst:902 +#: ../../c-api/exceptions.rst:902 ../../c-api/exceptions.rst:910 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:899 +#: ../../c-api/exceptions.rst:907 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:905 +#: ../../c-api/exceptions.rst:913 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -938,13 +947,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:913 +#: ../../c-api/exceptions.rst:921 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:916 +#: ../../c-api/exceptions.rst:924 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -952,30 +961,30 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:922 +#: ../../c-api/exceptions.rst:930 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:926 +#: ../../c-api/exceptions.rst:934 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:931 +#: ../../c-api/exceptions.rst:939 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:938 +#: ../../c-api/exceptions.rst:946 msgid "Standard Exceptions" msgstr "" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:948 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" @@ -983,451 +992,451 @@ msgid "" "all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1134 -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1009 ../../c-api/exceptions.rst:1142 +#: ../../c-api/exceptions.rst:1187 msgid "C Name" msgstr "" -#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1009 ../../c-api/exceptions.rst:1187 msgid "Python Name" msgstr "" -#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1134 -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1009 ../../c-api/exceptions.rst:1142 +#: ../../c-api/exceptions.rst:1187 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:1003 +#: ../../c-api/exceptions.rst:1011 msgid ":c:data:`PyExc_BaseException`" msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:1003 +#: ../../c-api/exceptions.rst:1011 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1003 ../../c-api/exceptions.rst:1005 -#: ../../c-api/exceptions.rst:1007 ../../c-api/exceptions.rst:1053 -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1011 ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1015 ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1073 msgid "[1]_" msgstr "[1]_" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1013 msgid ":c:data:`PyExc_Exception`" msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1013 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1015 msgid ":c:data:`PyExc_ArithmeticError`" msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1015 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1017 msgid ":c:data:`PyExc_AssertionError`" msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1017 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1019 msgid ":c:data:`PyExc_AttributeError`" msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1019 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1021 msgid ":c:data:`PyExc_BlockingIOError`" msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1021 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1023 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1023 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1017 +#: ../../c-api/exceptions.rst:1025 msgid ":c:data:`PyExc_BufferError`" msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:1017 +#: ../../c-api/exceptions.rst:1025 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1027 msgid ":c:data:`PyExc_ChildProcessError`" msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1027 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1021 +#: ../../c-api/exceptions.rst:1029 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1021 +#: ../../c-api/exceptions.rst:1029 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1031 msgid ":c:data:`PyExc_ConnectionError`" msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1031 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1033 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1033 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1035 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1037 msgid ":c:data:`PyExc_EOFError`" msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1037 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1039 msgid ":c:data:`PyExc_FileExistsError`" msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1039 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1041 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1041 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1043 msgid ":c:data:`PyExc_FloatingPointError`" msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1043 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1045 msgid ":c:data:`PyExc_GeneratorExit`" msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1045 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1047 msgid ":c:data:`PyExc_ImportError`" msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1047 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1049 msgid ":c:data:`PyExc_IndentationError`" msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1049 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1051 msgid ":c:data:`PyExc_IndexError`" msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1051 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1053 msgid ":c:data:`PyExc_InterruptedError`" msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1053 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1055 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1055 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1057 msgid ":c:data:`PyExc_KeyError`" msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1057 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1059 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1059 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1061 msgid ":c:data:`PyExc_LookupError`" msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1061 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1063 msgid ":c:data:`PyExc_MemoryError`" msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1063 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1065 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1065 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1067 msgid ":c:data:`PyExc_NameError`" msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1067 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1069 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1069 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1071 msgid ":c:data:`PyExc_NotImplementedError`" msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1071 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1073 msgid ":c:data:`PyExc_OSError`" msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1073 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1075 msgid ":c:data:`PyExc_OverflowError`" msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1075 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1077 msgid ":c:data:`PyExc_PermissionError`" msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1077 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1079 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1079 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1081 msgid ":c:data:`PyExc_RecursionError`" msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1081 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1083 msgid ":c:data:`PyExc_ReferenceError`" msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1083 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1085 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1085 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1087 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1087 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1089 msgid ":c:data:`PyExc_StopIteration`" msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1091 msgid ":c:data:`PyExc_SyntaxError`" msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1091 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1093 msgid ":c:data:`PyExc_SystemError`" msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1095 msgid ":c:data:`PyExc_SystemExit`" msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1097 msgid ":c:data:`PyExc_TabError`" msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1099 msgid ":c:data:`PyExc_TimeoutError`" msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1099 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1101 msgid ":c:data:`PyExc_TypeError`" msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1103 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1103 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1105 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1105 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1107 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1107 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1109 msgid ":c:data:`PyExc_UnicodeError`" msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1109 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1111 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1111 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1113 msgid ":c:data:`PyExc_ValueError`" msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1113 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1115 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1115 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1110 +#: ../../c-api/exceptions.rst:1118 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1447,58 +1456,58 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1120 +#: ../../c-api/exceptions.rst:1128 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr "" ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`\\ 。" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1131 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`\\ 。" -#: ../../c-api/exceptions.rst:1126 +#: ../../c-api/exceptions.rst:1134 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1144 msgid ":c:data:`PyExc_EnvironmentError`" msgstr ":c:data:`PyExc_EnvironmentError`" -#: ../../c-api/exceptions.rst:1138 +#: ../../c-api/exceptions.rst:1146 msgid ":c:data:`PyExc_IOError`" msgstr ":c:data:`PyExc_IOError`" -#: ../../c-api/exceptions.rst:1140 +#: ../../c-api/exceptions.rst:1148 msgid ":c:data:`PyExc_WindowsError`" msgstr ":c:data:`PyExc_WindowsError`" -#: ../../c-api/exceptions.rst:1140 +#: ../../c-api/exceptions.rst:1148 msgid "[2]_" msgstr "[2]_" -#: ../../c-api/exceptions.rst:1143 +#: ../../c-api/exceptions.rst:1151 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1146 ../../c-api/exceptions.rst:1207 +#: ../../c-api/exceptions.rst:1154 ../../c-api/exceptions.rst:1215 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1149 +#: ../../c-api/exceptions.rst:1157 msgid "This is a base class for other standard exceptions." msgstr "" -#: ../../c-api/exceptions.rst:1152 +#: ../../c-api/exceptions.rst:1160 msgid "" "Only defined on Windows; protect code that uses this by testing that the " "preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1158 +#: ../../c-api/exceptions.rst:1166 msgid "Standard Warning Categories" msgstr "" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1168 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " @@ -1506,393 +1515,393 @@ msgid "" "here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1189 msgid ":c:data:`PyExc_Warning`" msgstr ":c:data:`PyExc_Warning`" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1189 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1189 msgid "[3]_" msgstr "[3]_" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1191 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1191 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1193 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr ":c:data:`PyExc_DeprecationWarning`" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1193 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1195 msgid ":c:data:`PyExc_FutureWarning`" msgstr ":c:data:`PyExc_FutureWarning`" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1195 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1197 msgid ":c:data:`PyExc_ImportWarning`" msgstr ":c:data:`PyExc_ImportWarning`" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1197 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1199 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr ":c:data:`PyExc_PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1199 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1193 +#: ../../c-api/exceptions.rst:1201 msgid ":c:data:`PyExc_ResourceWarning`" msgstr ":c:data:`PyExc_ResourceWarning`" -#: ../../c-api/exceptions.rst:1193 +#: ../../c-api/exceptions.rst:1201 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1203 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr ":c:data:`PyExc_RuntimeWarning`" -#: ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1203 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1205 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr ":c:data:`PyExc_SyntaxWarning`" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1205 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:1207 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr ":c:data:`PyExc_UnicodeWarning`" -#: ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:1207 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1201 +#: ../../c-api/exceptions.rst:1209 msgid ":c:data:`PyExc_UserWarning`" msgstr ":c:data:`PyExc_UserWarning`" -#: ../../c-api/exceptions.rst:1201 +#: ../../c-api/exceptions.rst:1209 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1204 +#: ../../c-api/exceptions.rst:1212 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1210 +#: ../../c-api/exceptions.rst:1218 msgid "This is a base class for other standard warning categories." msgstr "" -#: ../../c-api/exceptions.rst:162 +#: ../../c-api/exceptions.rst:170 msgid "strerror()" msgstr "strerror()" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 -#: ../../c-api/exceptions.rst:660 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 +#: ../../c-api/exceptions.rst:668 msgid "module" msgstr "module(模組)" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 -#: ../../c-api/exceptions.rst:660 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 +#: ../../c-api/exceptions.rst:668 msgid "signal" msgstr "signal(訊號)" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 msgid "SIGINT" msgstr "SIGINT" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 -#: ../../c-api/exceptions.rst:660 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 +#: ../../c-api/exceptions.rst:668 msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BaseException" msgstr "PyExc_BaseException" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_Exception" msgstr "PyExc_Exception" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ArithmeticError" msgstr "PyExc_ArithmeticError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_AssertionError" msgstr "PyExc_AssertionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_AttributeError" msgstr "PyExc_AttributeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BlockingIOError" msgstr "PyExc_BlockingIOError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BrokenPipeError" msgstr "PyExc_BrokenPipeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BufferError" msgstr "PyExc_BufferError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ChildProcessError" msgstr "PyExc_ChildProcessError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionAbortedError" msgstr "PyExc_ConnectionAbortedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionError" msgstr "PyExc_ConnectionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionRefusedError" msgstr "PyExc_ConnectionRefusedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionResetError" msgstr "PyExc_ConnectionResetError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_EOFError" msgstr "PyExc_EOFError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_FileExistsError" msgstr "PyExc_FileExistsError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_FileNotFoundError" msgstr "PyExc_FileNotFoundError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_FloatingPointError" msgstr "PyExc_FloatingPointError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_GeneratorExit" msgstr "PyExc_GeneratorExit" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ImportError" msgstr "PyExc_ImportError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_IndentationError" msgstr "PyExc_IndentationError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_IndexError" msgstr "PyExc_IndexError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_InterruptedError" msgstr "PyExc_InterruptedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_IsADirectoryError" msgstr "PyExc_IsADirectoryError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_KeyError" msgstr "PyExc_KeyError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_KeyboardInterrupt" msgstr "PyExc_KeyboardInterrupt" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_LookupError" msgstr "PyExc_LookupError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_MemoryError" msgstr "PyExc_MemoryError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ModuleNotFoundError" msgstr "PyExc_ModuleNotFoundError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_NameError" msgstr "PyExc_NameError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_NotADirectoryError" msgstr "PyExc_NotADirectoryError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_NotImplementedError" msgstr "PyExc_NotImplementedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_OSError" msgstr "PyExc_OSError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_OverflowError" msgstr "PyExc_OverflowError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_PermissionError" msgstr "PyExc_PermissionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ProcessLookupError" msgstr "PyExc_ProcessLookupError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_RecursionError" msgstr "PyExc_RecursionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ReferenceError" msgstr "PyExc_ReferenceError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_RuntimeError" msgstr "PyExc_RuntimeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_StopAsyncIteration" msgstr "PyExc_StopAsyncIteration" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_StopIteration" msgstr "PyExc_StopIteration" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_SyntaxError" msgstr "PyExc_SyntaxError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_SystemError" msgstr "PyExc_SystemError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_SystemExit" msgstr "PyExc_SystemExit" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_TabError" msgstr "PyExc_TabError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_TimeoutError" msgstr "PyExc_TimeoutError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_TypeError" msgstr "PyExc_TypeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnboundLocalError" msgstr "PyExc_UnboundLocalError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeDecodeError" msgstr "PyExc_UnicodeDecodeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeEncodeError" msgstr "PyExc_UnicodeEncodeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeError" msgstr "PyExc_UnicodeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeTranslateError" msgstr "PyExc_UnicodeTranslateError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ValueError" msgstr "PyExc_ValueError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ZeroDivisionError" msgstr "PyExc_ZeroDivisionError" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1136 msgid "PyExc_EnvironmentError" msgstr "PyExc_EnvironmentError" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1136 msgid "PyExc_IOError" msgstr "PyExc_IOError" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1136 msgid "PyExc_WindowsError" msgstr "PyExc_WindowsError" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_Warning" msgstr "PyExc_Warning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_BytesWarning" msgstr "PyExc_BytesWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_DeprecationWarning" msgstr "PyExc_DeprecationWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_FutureWarning" msgstr "PyExc_FutureWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_ImportWarning" msgstr "PyExc_ImportWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_PendingDeprecationWarning" msgstr "PyExc_PendingDeprecationWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_ResourceWarning" msgstr "PyExc_ResourceWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_RuntimeWarning" msgstr "PyExc_RuntimeWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_SyntaxWarning" msgstr "PyExc_SyntaxWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_UnicodeWarning" msgstr "PyExc_UnicodeWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_UserWarning" msgstr "PyExc_UserWarning" diff --git a/c-api/memory.po b/c-api/memory.po index 9a8b640b46..e2929793b8 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-01 00:03+0000\n" +"POT-Creation-Date: 2023-10-17 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -557,19 +557,19 @@ msgid "" "following fields:" msgstr "" -#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658 msgid "Field" msgstr "" -#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658 msgid "Meaning" msgstr "" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660 msgid "``void *ctx``" msgstr "``void *ctx``" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660 msgid "user context passed as first argument" msgstr "" @@ -938,119 +938,119 @@ msgstr "" msgid "" "Python has a *pymalloc* allocator optimized for small objects (smaller or " "equal to 512 bytes) with a short lifetime. It uses memory mappings called " -"\"arenas\" with a fixed size of 256 KiB. It falls back to :c:func:" -"`PyMem_RawMalloc` and :c:func:`PyMem_RawRealloc` for allocations larger than " -"512 bytes." +"\"arenas\" with a fixed size of either 256 KiB on 32-bit platforms or 1 MiB " +"on 64-bit platforms. It falls back to :c:func:`PyMem_RawMalloc` and :c:func:" +"`PyMem_RawRealloc` for allocations larger than 512 bytes." msgstr "" -#: ../../c-api/memory.rst:632 +#: ../../c-api/memory.rst:633 msgid "" "*pymalloc* is the :ref:`default allocator ` of " "the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:" "`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" -#: ../../c-api/memory.rst:636 +#: ../../c-api/memory.rst:637 msgid "The arena allocator uses the following functions:" msgstr "" -#: ../../c-api/memory.rst:638 +#: ../../c-api/memory.rst:639 msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," msgstr "" -#: ../../c-api/memory.rst:639 +#: ../../c-api/memory.rst:640 msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," msgstr "" -#: ../../c-api/memory.rst:640 +#: ../../c-api/memory.rst:641 msgid ":c:func:`malloc` and :c:func:`free` otherwise." msgstr "" -#: ../../c-api/memory.rst:642 +#: ../../c-api/memory.rst:643 msgid "" "This allocator is disabled if Python is configured with the :option:`--" "without-pymalloc` option. It can also be disabled at runtime using the :" "envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)." msgstr "" -#: ../../c-api/memory.rst:647 +#: ../../c-api/memory.rst:648 msgid "Customize pymalloc Arena Allocator" msgstr "" -#: ../../c-api/memory.rst:653 +#: ../../c-api/memory.rst:654 msgid "" "Structure used to describe an arena allocator. The structure has three " "fields:" msgstr "" -#: ../../c-api/memory.rst:661 +#: ../../c-api/memory.rst:662 msgid "``void* alloc(void *ctx, size_t size)``" msgstr "``void* alloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:661 +#: ../../c-api/memory.rst:662 msgid "allocate an arena of size bytes" msgstr "" -#: ../../c-api/memory.rst:663 +#: ../../c-api/memory.rst:664 msgid "``void free(void *ctx, void *ptr, size_t size)``" msgstr "``void free(void *ctx, void *ptr, size_t size)``" -#: ../../c-api/memory.rst:663 +#: ../../c-api/memory.rst:664 msgid "free an arena" msgstr "" -#: ../../c-api/memory.rst:668 +#: ../../c-api/memory.rst:669 msgid "Get the arena allocator." msgstr "" -#: ../../c-api/memory.rst:672 +#: ../../c-api/memory.rst:673 msgid "Set the arena allocator." msgstr "" -#: ../../c-api/memory.rst:676 +#: ../../c-api/memory.rst:677 msgid "tracemalloc C API" msgstr "" -#: ../../c-api/memory.rst:682 +#: ../../c-api/memory.rst:683 msgid "Track an allocated memory block in the :mod:`tracemalloc` module." msgstr "" -#: ../../c-api/memory.rst:684 +#: ../../c-api/memory.rst:685 msgid "" "Return ``0`` on success, return ``-1`` on error (failed to allocate memory " "to store the trace). Return ``-2`` if tracemalloc is disabled." msgstr "" -#: ../../c-api/memory.rst:687 +#: ../../c-api/memory.rst:688 msgid "If memory block is already tracked, update the existing trace." msgstr "" -#: ../../c-api/memory.rst:691 +#: ../../c-api/memory.rst:692 msgid "" "Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " "nothing if the block was not tracked." msgstr "" -#: ../../c-api/memory.rst:694 +#: ../../c-api/memory.rst:695 msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." msgstr "" -#: ../../c-api/memory.rst:700 +#: ../../c-api/memory.rst:701 msgid "Examples" msgstr "範例" -#: ../../c-api/memory.rst:702 +#: ../../c-api/memory.rst:703 msgid "" "Here is the example from section :ref:`memoryoverview`, rewritten so that " "the I/O buffer is allocated from the Python heap by using the first function " "set::" msgstr "" -#: ../../c-api/memory.rst:715 +#: ../../c-api/memory.rst:716 msgid "The same code using the type-oriented function set::" msgstr "" -#: ../../c-api/memory.rst:727 +#: ../../c-api/memory.rst:728 msgid "" "Note that in the two examples above, the buffer is always manipulated via " "functions belonging to the same set. Indeed, it is required to use the same " @@ -1060,14 +1060,14 @@ msgid "" "different allocators operating on different heaps. ::" msgstr "" -#: ../../c-api/memory.rst:742 +#: ../../c-api/memory.rst:743 msgid "" "In addition to the functions aimed at handling raw memory blocks from the " "Python heap, objects in Python are allocated and released with :c:macro:" "`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Del`." msgstr "" -#: ../../c-api/memory.rst:746 +#: ../../c-api/memory.rst:747 msgid "" "These will be explained in the next chapter on defining and implementing new " "object types in C." diff --git a/c-api/set.po b/c-api/set.po index b347ab2d3b..828de9f04b 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-17 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -182,7 +182,10 @@ msgid "" msgstr "" #: ../../c-api/set.rst:166 -msgid "Empty an existing set of all elements." +msgid "" +"Empty an existing set of all elements. Return ``0`` on success. Return " +"``-1`` and raise :exc:`SystemError` if *set* is not an instance of :class:" +"`set` or its subtype." msgstr "" #: ../../c-api/set.rst:11 diff --git a/glossary.po b/glossary.po index e3237f4157..a1aa90ab1e 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -573,10 +573,12 @@ msgstr "context manager(情境管理器)" #: ../../glossary.rst:250 msgid "" "An object which controls the environment seen in a :keyword:`with` statement " -"by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." +"by defining :meth:`~object.__enter__` and :meth:`~object.__exit__` methods. " +"See :pep:`343`." msgstr "" "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" -"`__enter__` 和 :meth:`__exit__` method 來控制的。請參閱 :pep:`343`。" +"`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。請參閱 :pep:" +"`343`。" #: ../../glossary.rst:253 msgid "context variable" @@ -1444,14 +1446,14 @@ msgid "" "iterables include all sequence types (such as :class:`list`, :class:`str`, " "and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" "`file objects `, and objects of any classes you define with an :" -"meth:`__iter__` method or with a :meth:`__getitem__` method that implements :" -"term:`sequence` semantics." +"meth:`__iter__` method or with a :meth:`~object.__getitem__` method that " +"implements :term:`sequence` semantics." msgstr "" "一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" "是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像是 :" "class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物件," "只要那些 class 有 :meth:`__iter__` method 或是實作 :term:`sequence`\\ (序" -"列)語意的 :meth:`__getitem__` method,該物件就是可疊代物件。" +"列)語意的 :meth:`~object.__getitem__` method,該物件就是可疊代物件。" #: ../../glossary.rst:651 msgid "" @@ -2398,31 +2400,33 @@ msgstr "sequence(序列)" #: ../../glossary.rst:1089 msgid "" "An :term:`iterable` which supports efficient element access using integer " -"indices via the :meth:`__getitem__` special method and defines a :meth:" -"`__len__` method that returns the length of the sequence. Some built-in " +"indices via the :meth:`~object.__getitem__` special method and defines a :" +"meth:`__len__` method that returns the length of the sequence. Some built-in " "sequence types are :class:`list`, :class:`str`, :class:`tuple`, and :class:" -"`bytes`. Note that :class:`dict` also supports :meth:`__getitem__` and :meth:" -"`__len__`, but is considered a mapping rather than a sequence because the " -"lookups use arbitrary :term:`immutable` keys rather than integers." -msgstr "" -"一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`__getitem__` special " -"method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一個 :meth:" -"`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:`list`、:" -"class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :class:`dict` 也" -"支援 :meth:`__getitem__` 和 :meth:`__len__`,但它被視為對映 (mapping) 而不是" -"序列,因為其查找方式是使用任意的 :term:`immutable` 鍵,而不是整數。" +"`bytes`. Note that :class:`dict` also supports :meth:`~object.__getitem__` " +"and :meth:`__len__`, but is considered a mapping rather than a sequence " +"because the lookups use arbitrary :term:`immutable` keys rather than " +"integers." +msgstr "" +"一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`~object.__getitem__` " +"special method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一" +"個 :meth:`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:" +"`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :class:" +"`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`__len__`,但它被視為對映 " +"(mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` 鍵,而不是" +"整數。" #: ../../glossary.rst:1098 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " -"richer interface that goes beyond just :meth:`__getitem__` and :meth:" +"richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" "`__len__`, adding :meth:`count`, :meth:`index`, :meth:`__contains__`, and :" "meth:`__reversed__`. Types that implement this expanded interface can be " "registered explicitly using :func:`~abc.ABCMeta.register`." msgstr "" "抽象基底類別 (abstract base class) :class:`collections.abc.Sequence` 定義了一" -"個更加豐富的介面,並不僅止於 :meth:`__getitem__` 和 :meth:`__len__`,還增加" -"了 :meth:`count`、:meth:`index`、:meth:`__contains__` 和 :meth:" +"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` 和 :meth:`__len__`," +"還增加了 :meth:`count`、:meth:`index`、:meth:`__contains__` 和 :meth:" "`__reversed__`。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta.register` " "被明確地註冊。" diff --git a/howto/descriptor.po b/howto/descriptor.po index 4b624d303c..d78cea245b 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-11-05 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -689,11 +689,11 @@ msgid "" "it can be updated:" msgstr "" -#: ../../howto/descriptor.rst:948 +#: ../../howto/descriptor.rst:952 msgid "Pure Python Equivalents" msgstr "" -#: ../../howto/descriptor.rst:950 +#: ../../howto/descriptor.rst:954 msgid "" "The descriptor protocol is simple and offers exciting possibilities. " "Several use cases are so common that they have been prepackaged into built-" @@ -701,36 +701,36 @@ msgid "" "\\_\\_slots\\_\\_ are all based on the descriptor protocol." msgstr "" -#: ../../howto/descriptor.rst:957 +#: ../../howto/descriptor.rst:961 msgid "Properties" msgstr "" -#: ../../howto/descriptor.rst:959 +#: ../../howto/descriptor.rst:963 msgid "" "Calling :func:`property` is a succinct way of building a data descriptor " "that triggers a function call upon access to an attribute. Its signature " "is::" msgstr "" -#: ../../howto/descriptor.rst:964 +#: ../../howto/descriptor.rst:968 msgid "" "The documentation shows a typical use to define a managed attribute ``x``:" msgstr "" -#: ../../howto/descriptor.rst:988 +#: ../../howto/descriptor.rst:992 msgid "" "To see how :func:`property` is implemented in terms of the descriptor " "protocol, here is a pure Python equivalent:" msgstr "" -#: ../../howto/descriptor.rst:1091 +#: ../../howto/descriptor.rst:1095 msgid "" "The :func:`property` builtin helps whenever a user interface has granted " "attribute access and then subsequent changes require the intervention of a " "method." msgstr "" -#: ../../howto/descriptor.rst:1095 +#: ../../howto/descriptor.rst:1099 msgid "" "For instance, a spreadsheet class may grant access to a cell value through " "``Cell('b10').value``. Subsequent improvements to the program require the " @@ -740,23 +740,23 @@ msgid "" "descriptor:" msgstr "" -#: ../../howto/descriptor.rst:1112 +#: ../../howto/descriptor.rst:1116 msgid "" "Either the built-in :func:`property` or our :func:`Property` equivalent " "would work in this example." msgstr "" -#: ../../howto/descriptor.rst:1117 +#: ../../howto/descriptor.rst:1121 msgid "Functions and methods" msgstr "" -#: ../../howto/descriptor.rst:1119 +#: ../../howto/descriptor.rst:1123 msgid "" "Python's object oriented features are built upon a function based " "environment. Using non-data descriptors, the two are merged seamlessly." msgstr "" -#: ../../howto/descriptor.rst:1122 +#: ../../howto/descriptor.rst:1126 msgid "" "Functions stored in class dictionaries get turned into methods when invoked. " "Methods only differ from regular functions in that the object instance is " @@ -764,13 +764,13 @@ msgid "" "*self* but could be called *this* or any other variable name." msgstr "" -#: ../../howto/descriptor.rst:1127 +#: ../../howto/descriptor.rst:1131 msgid "" "Methods can be created manually with :class:`types.MethodType` which is " "roughly equivalent to:" msgstr "" -#: ../../howto/descriptor.rst:1144 +#: ../../howto/descriptor.rst:1148 msgid "" "To support automatic creation of methods, functions include the :meth:" "`__get__` method for binding methods during attribute access. This means " @@ -778,58 +778,58 @@ msgid "" "dotted lookup from an instance. Here's how it works:" msgstr "" -#: ../../howto/descriptor.rst:1160 +#: ../../howto/descriptor.rst:1164 msgid "" "Running the following class in the interpreter shows how the function " "descriptor works in practice:" msgstr "" -#: ../../howto/descriptor.rst:1169 +#: ../../howto/descriptor.rst:1173 msgid "" "The function has a :term:`qualified name` attribute to support introspection:" msgstr "" -#: ../../howto/descriptor.rst:1176 +#: ../../howto/descriptor.rst:1180 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" "`__get__`. Instead, it just returns the underlying function object::" msgstr "" -#: ../../howto/descriptor.rst:1182 +#: ../../howto/descriptor.rst:1186 msgid "" "Dotted access from a class calls :meth:`__get__` which just returns the " "underlying function unchanged::" msgstr "" -#: ../../howto/descriptor.rst:1188 +#: ../../howto/descriptor.rst:1192 msgid "" "The interesting behavior occurs during dotted access from an instance. The " "dotted lookup calls :meth:`__get__` which returns a bound method object::" msgstr "" -#: ../../howto/descriptor.rst:1195 +#: ../../howto/descriptor.rst:1199 msgid "" "Internally, the bound method stores the underlying function and the bound " "instance::" msgstr "" -#: ../../howto/descriptor.rst:1204 +#: ../../howto/descriptor.rst:1208 msgid "" "If you have ever wondered where *self* comes from in regular methods or " "where *cls* comes from in class methods, this is it!" msgstr "" -#: ../../howto/descriptor.rst:1209 +#: ../../howto/descriptor.rst:1213 msgid "Kinds of methods" msgstr "" -#: ../../howto/descriptor.rst:1211 +#: ../../howto/descriptor.rst:1215 msgid "" "Non-data descriptors provide a simple mechanism for variations on the usual " "patterns of binding functions into methods." msgstr "" -#: ../../howto/descriptor.rst:1214 +#: ../../howto/descriptor.rst:1218 msgid "" "To recap, functions have a :meth:`__get__` method so that they can be " "converted to a method when accessed as attributes. The non-data descriptor " @@ -837,55 +837,55 @@ msgid "" "f(*args)`` becomes ``f(*args)``." msgstr "" -#: ../../howto/descriptor.rst:1219 +#: ../../howto/descriptor.rst:1223 msgid "This chart summarizes the binding and its two most useful variants:" msgstr "" -#: ../../howto/descriptor.rst:1222 +#: ../../howto/descriptor.rst:1226 msgid "Transformation" msgstr "" -#: ../../howto/descriptor.rst:1222 +#: ../../howto/descriptor.rst:1226 msgid "Called from an object" msgstr "" -#: ../../howto/descriptor.rst:1222 +#: ../../howto/descriptor.rst:1226 msgid "Called from a class" msgstr "" -#: ../../howto/descriptor.rst:1225 +#: ../../howto/descriptor.rst:1229 msgid "function" msgstr "函式" -#: ../../howto/descriptor.rst:1225 +#: ../../howto/descriptor.rst:1229 msgid "f(obj, \\*args)" msgstr "f(obj, \\*args)" -#: ../../howto/descriptor.rst:1225 ../../howto/descriptor.rst:1227 +#: ../../howto/descriptor.rst:1229 ../../howto/descriptor.rst:1231 msgid "f(\\*args)" msgstr "f(\\*args)" -#: ../../howto/descriptor.rst:1227 +#: ../../howto/descriptor.rst:1231 msgid "staticmethod" msgstr "staticmethod" -#: ../../howto/descriptor.rst:1229 +#: ../../howto/descriptor.rst:1233 msgid "classmethod" msgstr "classmethod" -#: ../../howto/descriptor.rst:1229 +#: ../../howto/descriptor.rst:1233 msgid "f(type(obj), \\*args)" msgstr "f(type(obj), \\*args)" -#: ../../howto/descriptor.rst:1229 +#: ../../howto/descriptor.rst:1233 msgid "f(cls, \\*args)" msgstr "f(cls, \\*args)" -#: ../../howto/descriptor.rst:1234 +#: ../../howto/descriptor.rst:1238 msgid "Static methods" msgstr "" -#: ../../howto/descriptor.rst:1236 +#: ../../howto/descriptor.rst:1240 msgid "" "Static methods return the underlying function without changes. Calling " "either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object." @@ -894,13 +894,13 @@ msgid "" "a class." msgstr "" -#: ../../howto/descriptor.rst:1242 +#: ../../howto/descriptor.rst:1246 msgid "" "Good candidates for static methods are methods that do not reference the " "``self`` variable." msgstr "" -#: ../../howto/descriptor.rst:1245 +#: ../../howto/descriptor.rst:1249 msgid "" "For instance, a statistics package may include a container class for " "experimental data. The class provides normal methods for computing the " @@ -912,19 +912,19 @@ msgid "" "``s.erf(1.5) --> .9332`` or ``Sample.erf(1.5) --> .9332``." msgstr "" -#: ../../howto/descriptor.rst:1254 +#: ../../howto/descriptor.rst:1258 msgid "" "Since static methods return the underlying function with no changes, the " "example calls are unexciting:" msgstr "" -#: ../../howto/descriptor.rst:1271 +#: ../../howto/descriptor.rst:1275 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`staticmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1291 +#: ../../howto/descriptor.rst:1295 msgid "" "The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " "that refers to the underlying function. Also it carries forward the " @@ -932,18 +932,18 @@ msgid "" "``__name__``, ``__qualname__``, ``__doc__``, and ``__annotations__``." msgstr "" -#: ../../howto/descriptor.rst:1359 +#: ../../howto/descriptor.rst:1363 msgid "Class methods" msgstr "" -#: ../../howto/descriptor.rst:1361 +#: ../../howto/descriptor.rst:1365 msgid "" "Unlike static methods, class methods prepend the class reference to the " "argument list before calling the function. This format is the same for " "whether the caller is an object or a class:" msgstr "" -#: ../../howto/descriptor.rst:1379 +#: ../../howto/descriptor.rst:1383 msgid "" "This behavior is useful whenever the method only needs to have a class " "reference and does not rely on data stored in a specific instance. One use " @@ -952,17 +952,17 @@ msgid "" "of keys. The pure Python equivalent is:" msgstr "" -#: ../../howto/descriptor.rst:1396 +#: ../../howto/descriptor.rst:1400 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "" -#: ../../howto/descriptor.rst:1406 +#: ../../howto/descriptor.rst:1410 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1484 +#: ../../howto/descriptor.rst:1488 msgid "" "The code path for ``hasattr(type(self.f), '__get__')`` was added in Python " "3.9 and makes it possible for :func:`classmethod` to support chained " @@ -970,7 +970,7 @@ msgid "" "together. In Python 3.11, this functionality was deprecated." msgstr "" -#: ../../howto/descriptor.rst:1502 +#: ../../howto/descriptor.rst:1506 msgid "" "The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " "``__wrapped__`` attribute that refers to the underlying function. Also it " @@ -979,30 +979,30 @@ msgid "" "``__annotations__``." msgstr "" -#: ../../howto/descriptor.rst:1510 +#: ../../howto/descriptor.rst:1514 msgid "Member objects and __slots__" msgstr "" -#: ../../howto/descriptor.rst:1512 +#: ../../howto/descriptor.rst:1516 msgid "" "When a class defines ``__slots__``, it replaces instance dictionaries with a " "fixed-length array of slot values. From a user point of view that has " "several effects:" msgstr "" -#: ../../howto/descriptor.rst:1516 +#: ../../howto/descriptor.rst:1520 msgid "" "1. Provides immediate detection of bugs due to misspelled attribute " "assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" -#: ../../howto/descriptor.rst:1532 +#: ../../howto/descriptor.rst:1536 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" msgstr "" -#: ../../howto/descriptor.rst:1567 +#: ../../howto/descriptor.rst:1571 msgid "" "3. Saves memory. On a 64-bit Linux build, an instance with two attributes " "takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " @@ -1010,19 +1010,19 @@ msgid "" "only matters when a large number of instances are going to be created." msgstr "" -#: ../../howto/descriptor.rst:1572 +#: ../../howto/descriptor.rst:1576 msgid "" "4. Improves speed. Reading instance variables is 35% faster with " "``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." msgstr "" -#: ../../howto/descriptor.rst:1575 +#: ../../howto/descriptor.rst:1579 msgid "" "5. Blocks tools like :func:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" -#: ../../howto/descriptor.rst:1597 +#: ../../howto/descriptor.rst:1601 msgid "" "It is not possible to create an exact drop-in pure Python version of " "``__slots__`` because it requires direct access to C structures and control " @@ -1032,36 +1032,36 @@ msgid "" "managed by member descriptors:" msgstr "" -#: ../../howto/descriptor.rst:1642 +#: ../../howto/descriptor.rst:1646 msgid "" "The :meth:`type.__new__` method takes care of adding member objects to class " "variables:" msgstr "" -#: ../../howto/descriptor.rst:1658 +#: ../../howto/descriptor.rst:1662 msgid "" "The :meth:`object.__new__` method takes care of creating instances that have " "slots instead of an instance dictionary. Here is a rough simulation in pure " "Python:" msgstr "" -#: ../../howto/descriptor.rst:1693 +#: ../../howto/descriptor.rst:1697 msgid "" "To use the simulation in a real class, just inherit from :class:`Object` and " "set the :term:`metaclass` to :class:`Type`:" msgstr "" -#: ../../howto/descriptor.rst:1707 +#: ../../howto/descriptor.rst:1711 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" -#: ../../howto/descriptor.rst:1728 +#: ../../howto/descriptor.rst:1732 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" -#: ../../howto/descriptor.rst:1740 +#: ../../howto/descriptor.rst:1744 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" diff --git a/howto/enum.po b/howto/enum.po index d581267153..18448fd07a 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -375,68 +375,68 @@ msgid "" "__repr__` omits the inherited class' name. For example::" msgstr "" -#: ../../howto/enum.rst:499 +#: ../../howto/enum.rst:500 msgid "" "Use the :func:`!dataclass` argument ``repr=False`` to use the standard :func:" "`repr`." msgstr "" -#: ../../howto/enum.rst:502 +#: ../../howto/enum.rst:503 msgid "" "Only the dataclass fields are shown in the value area, not the dataclass' " "name." msgstr "" -#: ../../howto/enum.rst:508 +#: ../../howto/enum.rst:509 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:510 +#: ../../howto/enum.rst:511 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:517 +#: ../../howto/enum.rst:518 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -#: ../../howto/enum.rst:523 +#: ../../howto/enum.rst:524 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:526 +#: ../../howto/enum.rst:527 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`__reduce_ex__` in the enumeration class. The default method is by-" "value, but enums with complicated values may want to use by-name::" msgstr "" -#: ../../howto/enum.rst:535 +#: ../../howto/enum.rst:537 msgid "" "Using by-name for flags is not recommended, as unnamed aliases will not " "unpickle." msgstr "" -#: ../../howto/enum.rst:540 +#: ../../howto/enum.rst:542 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:542 +#: ../../howto/enum.rst:544 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:552 +#: ../../howto/enum.rst:554 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: ../../howto/enum.rst:555 +#: ../../howto/enum.rst:557 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -448,14 +448,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:571 +#: ../../howto/enum.rst:573 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -#: ../../howto/enum.rst:575 +#: ../../howto/enum.rst:577 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -464,14 +464,14 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:585 +#: ../../howto/enum.rst:587 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: ../../howto/enum.rst:589 +#: ../../howto/enum.rst:591 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -479,7 +479,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:596 +#: ../../howto/enum.rst:598 msgid "The complete signature is::" msgstr "" @@ -487,7 +487,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../howto/enum.rst:608 +#: ../../howto/enum.rst:610 msgid "What the new enum class will record as its name." msgstr "" @@ -495,21 +495,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../howto/enum.rst:610 +#: ../../howto/enum.rst:612 msgid "" "The enum members. This can be a whitespace- or comma-separated string " "(values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../howto/enum.rst:615 +#: ../../howto/enum.rst:617 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:619 +#: ../../howto/enum.rst:621 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:623 +#: ../../howto/enum.rst:625 msgid "or a mapping::" msgstr "" @@ -517,7 +517,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../howto/enum.rst:627 +#: ../../howto/enum.rst:629 msgid "name of module where new enum class can be found." msgstr "" @@ -525,7 +525,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../howto/enum.rst:629 +#: ../../howto/enum.rst:631 msgid "where in module new enum class can be found." msgstr "" @@ -533,7 +533,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../howto/enum.rst:631 +#: ../../howto/enum.rst:633 msgid "type to mix in to new enum class." msgstr "" @@ -541,23 +541,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../howto/enum.rst:633 +#: ../../howto/enum.rst:635 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:635 +#: ../../howto/enum.rst:637 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:640 +#: ../../howto/enum.rst:642 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:643 +#: ../../howto/enum.rst:645 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:645 +#: ../../howto/enum.rst:647 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -565,22 +565,22 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:666 +#: ../../howto/enum.rst:668 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:679 +#: ../../howto/enum.rst:681 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:690 +#: ../../howto/enum.rst:692 msgid "StrEnum" msgstr "" -#: ../../howto/enum.rst:692 +#: ../../howto/enum.rst:694 msgid "" "The second variation of :class:`Enum` that is provided is also a subclass " "of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " @@ -588,11 +588,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:701 +#: ../../howto/enum.rst:703 msgid "IntFlag" msgstr "" -#: ../../howto/enum.rst:703 +#: ../../howto/enum.rst:705 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -602,60 +602,60 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:711 +#: ../../howto/enum.rst:713 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:714 +#: ../../howto/enum.rst:716 msgid "" "Bit-wise operations that result in invalid :class:`IntFlag` values will lose " "the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" -#: ../../howto/enum.rst:721 +#: ../../howto/enum.rst:723 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:737 +#: ../../howto/enum.rst:739 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:754 +#: ../../howto/enum.rst:756 msgid "" "Named combinations are considered aliases. Aliases do not show up during " "iteration, but can be returned from by-value lookups." msgstr "" -#: ../../howto/enum.rst:759 +#: ../../howto/enum.rst:761 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: ../../howto/enum.rst:767 +#: ../../howto/enum.rst:769 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" -#: ../../howto/enum.rst:778 +#: ../../howto/enum.rst:780 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:784 +#: ../../howto/enum.rst:786 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:793 +#: ../../howto/enum.rst:795 msgid "Flag" msgstr "" -#: ../../howto/enum.rst:795 +#: ../../howto/enum.rst:797 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -665,29 +665,29 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:804 +#: ../../howto/enum.rst:806 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: ../../howto/enum.rst:818 +#: ../../howto/enum.rst:820 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags will not::" msgstr "" -#: ../../howto/enum.rst:830 +#: ../../howto/enum.rst:832 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:844 +#: ../../howto/enum.rst:846 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:854 +#: ../../howto/enum.rst:856 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -698,42 +698,42 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:864 +#: ../../howto/enum.rst:866 msgid "Others" msgstr "" -#: ../../howto/enum.rst:866 +#: ../../howto/enum.rst:868 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:872 +#: ../../howto/enum.rst:874 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: ../../howto/enum.rst:875 +#: ../../howto/enum.rst:877 msgid "Some rules:" msgstr "" -#: ../../howto/enum.rst:877 +#: ../../howto/enum.rst:879 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before :class:" "`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " "above." msgstr "" -#: ../../howto/enum.rst:880 +#: ../../howto/enum.rst:882 msgid "" "Mix-in types must be subclassable. For example, :class:`bool` and :class:" "`range` are not subclassable and will throw an error during Enum creation if " "used as the mix-in type." msgstr "" -#: ../../howto/enum.rst:883 +#: ../../howto/enum.rst:885 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -741,169 +741,169 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:887 +#: ../../howto/enum.rst:889 msgid "" "When another data type is mixed in, the :attr:`value` attribute is *not the " "same* as the enum member itself, although it is equivalent and will compare " "equal." msgstr "" -#: ../../howto/enum.rst:890 +#: ../../howto/enum.rst:892 msgid "" "A ``data type`` is a mixin that defines :meth:`__new__`, or a :class:" "`~dataclasses.dataclass`" msgstr "" -#: ../../howto/enum.rst:892 +#: ../../howto/enum.rst:894 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " "``%h`` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../howto/enum.rst:895 +#: ../../howto/enum.rst:897 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:900 +#: ../../howto/enum.rst:902 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" "`__str__` method has been reset to their data types' :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:908 +#: ../../howto/enum.rst:910 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:910 +#: ../../howto/enum.rst:912 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:914 +#: ../../howto/enum.rst:916 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:941 +#: ../../howto/enum.rst:943 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly." msgstr "" -#: ../../howto/enum.rst:946 +#: ../../howto/enum.rst:948 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:949 +#: ../../howto/enum.rst:951 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:951 +#: ../../howto/enum.rst:953 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:954 +#: ../../howto/enum.rst:956 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../howto/enum.rst:960 +#: ../../howto/enum.rst:962 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:962 +#: ../../howto/enum.rst:964 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:963 +#: ../../howto/enum.rst:965 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:965 +#: ../../howto/enum.rst:967 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:967 +#: ../../howto/enum.rst:969 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../howto/enum.rst:970 +#: ../../howto/enum.rst:972 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:972 +#: ../../howto/enum.rst:974 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:978 +#: ../../howto/enum.rst:980 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:981 +#: ../../howto/enum.rst:983 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../howto/enum.rst:984 +#: ../../howto/enum.rst:986 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:985 +#: ../../howto/enum.rst:987 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:987 +#: ../../howto/enum.rst:989 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:1005 +#: ../../howto/enum.rst:1007 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:1010 +#: ../../howto/enum.rst:1012 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:1012 +#: ../../howto/enum.rst:1014 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:1019 +#: ../../howto/enum.rst:1021 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:1021 +#: ../../howto/enum.rst:1023 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -913,22 +913,22 @@ msgid "" "strongly recommended." msgstr "" -#: ../../howto/enum.rst:1032 +#: ../../howto/enum.rst:1034 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:1034 +#: ../../howto/enum.rst:1036 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:1046 +#: ../../howto/enum.rst:1048 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:1048 +#: ../../howto/enum.rst:1050 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -937,137 +937,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1057 +#: ../../howto/enum.rst:1059 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1061 +#: ../../howto/enum.rst:1063 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1063 +#: ../../howto/enum.rst:1065 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1074 +#: ../../howto/enum.rst:1076 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1076 +#: ../../howto/enum.rst:1078 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1094 +#: ../../howto/enum.rst:1096 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1096 +#: ../../howto/enum.rst:1098 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1107 +#: ../../howto/enum.rst:1109 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1109 +#: ../../howto/enum.rst:1111 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1110 +#: ../../howto/enum.rst:1112 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1113 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1118 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1125 +#: ../../howto/enum.rst:1127 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1130 +#: ../../howto/enum.rst:1132 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1141 +#: ../../howto/enum.rst:1143 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1147 +#: ../../howto/enum.rst:1149 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1156 +#: ../../howto/enum.rst:1158 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1159 +#: ../../howto/enum.rst:1161 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1160 +#: ../../howto/enum.rst:1162 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1161 +#: ../../howto/enum.rst:1163 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1162 +#: ../../howto/enum.rst:1164 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1164 +#: ../../howto/enum.rst:1166 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1167 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1166 +#: ../../howto/enum.rst:1168 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1168 +#: ../../howto/enum.rst:1170 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1176 +#: ../../howto/enum.rst:1178 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1178 +#: ../../howto/enum.rst:1180 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1183 +#: ../../howto/enum.rst:1185 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1185 +#: ../../howto/enum.rst:1187 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1078,11 +1078,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1194 +#: ../../howto/enum.rst:1196 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1196 +#: ../../howto/enum.rst:1198 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1091,11 +1091,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1202 +#: ../../howto/enum.rst:1204 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1204 +#: ../../howto/enum.rst:1206 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1104,37 +1104,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1210 +#: ../../howto/enum.rst:1212 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1212 +#: ../../howto/enum.rst:1214 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1218 +#: ../../howto/enum.rst:1220 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1220 +#: ../../howto/enum.rst:1222 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1226 +#: ../../howto/enum.rst:1228 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1236 +#: ../../howto/enum.rst:1238 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1239 +#: ../../howto/enum.rst:1241 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1142,155 +1142,155 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1246 +#: ../../howto/enum.rst:1248 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1248 +#: ../../howto/enum.rst:1250 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1251 +#: ../../howto/enum.rst:1253 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1252 +#: ../../howto/enum.rst:1254 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1253 +#: ../../howto/enum.rst:1255 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1254 +#: ../../howto/enum.rst:1256 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1257 +#: ../../howto/enum.rst:1259 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1263 +#: ../../howto/enum.rst:1265 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1265 +#: ../../howto/enum.rst:1267 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1277 +#: ../../howto/enum.rst:1279 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1279 +#: ../../howto/enum.rst:1281 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1289 +#: ../../howto/enum.rst:1291 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1305 +#: ../../howto/enum.rst:1307 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1307 +#: ../../howto/enum.rst:1309 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1319 +#: ../../howto/enum.rst:1321 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1321 +#: ../../howto/enum.rst:1323 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1338 +#: ../../howto/enum.rst:1340 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1348 +#: ../../howto/enum.rst:1350 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1367 +#: ../../howto/enum.rst:1369 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1373 +#: ../../howto/enum.rst:1375 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly -- e.g.::" msgstr "" -#: ../../howto/enum.rst:1380 +#: ../../howto/enum.rst:1382 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1382 +#: ../../howto/enum.rst:1384 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1416 +#: ../../howto/enum.rst:1418 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1418 +#: ../../howto/enum.rst:1420 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1443 +#: ../../howto/enum.rst:1446 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1449 +#: ../../howto/enum.rst:1452 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1451 +#: ../../howto/enum.rst:1454 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1480 +#: ../../howto/enum.rst:1483 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1482 +#: ../../howto/enum.rst:1485 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1501 +#: ../../howto/enum.rst:1504 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1503 +#: ../../howto/enum.rst:1506 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/howto/regex.po b/howto/regex.po index e9df685f6d..79836d436a 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -455,6 +455,12 @@ msgstr "" #: ../../howto/regex.rst:248 msgid "" +"The simplest case ``{m}`` matches the preceding item exactly *m* times. For " +"example, ``a/{2}b`` will only match ``'a//b'``." +msgstr "" + +#: ../../howto/regex.rst:251 +msgid "" "Readers of a reductionist bent may notice that the three other quantifiers " "can all be expressed using this notation. ``{0,}`` is the same as ``*``, " "``{1,}`` is equivalent to ``+``, and ``{0,1}`` is the same as ``?``. It's " @@ -462,11 +468,11 @@ msgid "" "shorter and easier to read." msgstr "" -#: ../../howto/regex.rst:256 +#: ../../howto/regex.rst:259 msgid "Using Regular Expressions" msgstr "" -#: ../../howto/regex.rst:258 +#: ../../howto/regex.rst:261 msgid "" "Now that we've looked at some simple regular expressions, how do we actually " "use them in Python? The :mod:`re` module provides an interface to the " @@ -474,25 +480,25 @@ msgid "" "perform matches with them." msgstr "" -#: ../../howto/regex.rst:265 +#: ../../howto/regex.rst:268 msgid "Compiling Regular Expressions" msgstr "" -#: ../../howto/regex.rst:267 +#: ../../howto/regex.rst:270 msgid "" "Regular expressions are compiled into pattern objects, which have methods " "for various operations such as searching for pattern matches or performing " "string substitutions. ::" msgstr "" -#: ../../howto/regex.rst:276 +#: ../../howto/regex.rst:279 msgid "" ":func:`re.compile` also accepts an optional *flags* argument, used to enable " "various special features and syntax variations. We'll go over the available " "settings later, but for now a single example will do::" msgstr "" -#: ../../howto/regex.rst:282 +#: ../../howto/regex.rst:285 msgid "" "The RE is passed to :func:`re.compile` as a string. REs are handled as " "strings because regular expressions aren't part of the core Python language, " @@ -503,17 +509,17 @@ msgid "" "`socket` or :mod:`zlib` modules." msgstr "" -#: ../../howto/regex.rst:289 +#: ../../howto/regex.rst:292 msgid "" "Putting REs in strings keeps the Python language simpler, but has one " "disadvantage which is the topic of the next section." msgstr "" -#: ../../howto/regex.rst:296 +#: ../../howto/regex.rst:299 msgid "The Backslash Plague" msgstr "" -#: ../../howto/regex.rst:298 +#: ../../howto/regex.rst:301 msgid "" "As stated earlier, regular expressions use the backslash character " "(``'\\'``) to indicate special forms or to allow special characters to be " @@ -521,7 +527,7 @@ msgid "" "usage of the same character for the same purpose in string literals." msgstr "" -#: ../../howto/regex.rst:303 +#: ../../howto/regex.rst:306 msgid "" "Let's say you want to write a RE that matches the string ``\\section``, " "which might be found in a LaTeX file. To figure out what to write in the " @@ -533,39 +539,39 @@ msgid "" "*again*." msgstr "" -#: ../../howto/regex.rst:312 +#: ../../howto/regex.rst:315 msgid "Characters" msgstr "" -#: ../../howto/regex.rst:312 +#: ../../howto/regex.rst:315 msgid "Stage" msgstr "" -#: ../../howto/regex.rst:314 +#: ../../howto/regex.rst:317 msgid "``\\section``" msgstr "``\\section``" -#: ../../howto/regex.rst:314 +#: ../../howto/regex.rst:317 msgid "Text string to be matched" msgstr "" -#: ../../howto/regex.rst:316 +#: ../../howto/regex.rst:319 msgid "``\\\\section``" msgstr "``\\\\section``" -#: ../../howto/regex.rst:316 +#: ../../howto/regex.rst:319 msgid "Escaped backslash for :func:`re.compile`" msgstr "" -#: ../../howto/regex.rst:318 ../../howto/regex.rst:345 +#: ../../howto/regex.rst:321 ../../howto/regex.rst:348 msgid "``\"\\\\\\\\section\"``" msgstr "``\"\\\\\\\\section\"``" -#: ../../howto/regex.rst:318 +#: ../../howto/regex.rst:321 msgid "Escaped backslashes for a string literal" msgstr "" -#: ../../howto/regex.rst:321 +#: ../../howto/regex.rst:324 msgid "" "In short, to match a literal backslash, one has to write ``'\\\\\\\\'`` as " "the RE string, because the regular expression must be ``\\\\``, and each " @@ -574,7 +580,7 @@ msgid "" "repeated backslashes and makes the resulting strings difficult to understand." msgstr "" -#: ../../howto/regex.rst:327 +#: ../../howto/regex.rst:330 msgid "" "The solution is to use Python's raw string notation for regular expressions; " "backslashes are not handled in any special way in a string literal prefixed " @@ -584,7 +590,7 @@ msgid "" "raw string notation." msgstr "" -#: ../../howto/regex.rst:333 +#: ../../howto/regex.rst:336 msgid "" "In addition, special escape sequences that are valid in regular expressions, " "but not valid as Python string literals, now result in a :exc:" @@ -593,39 +599,39 @@ msgid "" "backslashes isn't used." msgstr "" -#: ../../howto/regex.rst:341 +#: ../../howto/regex.rst:344 msgid "Regular String" msgstr "" -#: ../../howto/regex.rst:341 +#: ../../howto/regex.rst:344 msgid "Raw string" msgstr "" -#: ../../howto/regex.rst:343 +#: ../../howto/regex.rst:346 msgid "``\"ab*\"``" msgstr "``\"ab*\"``" -#: ../../howto/regex.rst:343 +#: ../../howto/regex.rst:346 msgid "``r\"ab*\"``" msgstr "``r\"ab*\"``" -#: ../../howto/regex.rst:345 +#: ../../howto/regex.rst:348 msgid "``r\"\\\\section\"``" msgstr "``r\"\\\\section\"``" -#: ../../howto/regex.rst:347 +#: ../../howto/regex.rst:350 msgid "``\"\\\\w+\\\\s+\\\\1\"``" msgstr "``\"\\\\w+\\\\s+\\\\1\"``" -#: ../../howto/regex.rst:347 +#: ../../howto/regex.rst:350 msgid "``r\"\\w+\\s+\\1\"``" msgstr "``r\"\\w+\\s+\\1\"``" -#: ../../howto/regex.rst:352 +#: ../../howto/regex.rst:355 msgid "Performing Matches" msgstr "" -#: ../../howto/regex.rst:354 +#: ../../howto/regex.rst:357 msgid "" "Once you have an object representing a compiled regular expression, what do " "you do with it? Pattern objects have several methods and attributes. Only " @@ -633,51 +639,51 @@ msgid "" "for a complete listing." msgstr "" -#: ../../howto/regex.rst:360 ../../howto/regex.rst:414 -#: ../../howto/regex.rst:1062 +#: ../../howto/regex.rst:363 ../../howto/regex.rst:417 +#: ../../howto/regex.rst:1065 msgid "Method/Attribute" msgstr "" -#: ../../howto/regex.rst:360 ../../howto/regex.rst:414 -#: ../../howto/regex.rst:1062 +#: ../../howto/regex.rst:363 ../../howto/regex.rst:417 +#: ../../howto/regex.rst:1065 msgid "Purpose" msgstr "" -#: ../../howto/regex.rst:362 +#: ../../howto/regex.rst:365 msgid "``match()``" msgstr "``match()``" -#: ../../howto/regex.rst:362 +#: ../../howto/regex.rst:365 msgid "Determine if the RE matches at the beginning of the string." msgstr "" -#: ../../howto/regex.rst:365 +#: ../../howto/regex.rst:368 msgid "``search()``" msgstr "``search()``" -#: ../../howto/regex.rst:365 +#: ../../howto/regex.rst:368 msgid "Scan through a string, looking for any location where this RE matches." msgstr "" -#: ../../howto/regex.rst:368 +#: ../../howto/regex.rst:371 msgid "``findall()``" msgstr "``findall()``" -#: ../../howto/regex.rst:368 +#: ../../howto/regex.rst:371 msgid "Find all substrings where the RE matches, and returns them as a list." msgstr "" -#: ../../howto/regex.rst:371 +#: ../../howto/regex.rst:374 msgid "``finditer()``" msgstr "``finditer()``" -#: ../../howto/regex.rst:371 +#: ../../howto/regex.rst:374 msgid "" "Find all substrings where the RE matches, and returns them as an :term:" "`iterator`." msgstr "" -#: ../../howto/regex.rst:375 +#: ../../howto/regex.rst:378 msgid "" ":meth:`~re.Pattern.match` and :meth:`~re.Pattern.search` return ``None`` if " "no match can be found. If they're successful, a :ref:`match object `, so you should store the result in a variable for later use. ::" msgstr "" -#: ../../howto/regex.rst:409 +#: ../../howto/regex.rst:412 msgid "" "Now you can query the :ref:`match object ` for information " "about the matching string. Match object instances also have several methods " "and attributes; the most important ones are:" msgstr "" -#: ../../howto/regex.rst:416 +#: ../../howto/regex.rst:419 msgid "``group()``" msgstr "``group()``" -#: ../../howto/regex.rst:416 +#: ../../howto/regex.rst:419 msgid "Return the string matched by the RE" msgstr "" -#: ../../howto/regex.rst:418 +#: ../../howto/regex.rst:421 msgid "``start()``" msgstr "``start()``" -#: ../../howto/regex.rst:418 +#: ../../howto/regex.rst:421 msgid "Return the starting position of the match" msgstr "" -#: ../../howto/regex.rst:420 +#: ../../howto/regex.rst:423 msgid "``end()``" msgstr "``end()``" -#: ../../howto/regex.rst:420 +#: ../../howto/regex.rst:423 msgid "Return the ending position of the match" msgstr "" -#: ../../howto/regex.rst:422 +#: ../../howto/regex.rst:425 msgid "``span()``" msgstr "``span()``" -#: ../../howto/regex.rst:422 +#: ../../howto/regex.rst:425 msgid "Return a tuple containing the (start, end) positions of the match" msgstr "" -#: ../../howto/regex.rst:426 +#: ../../howto/regex.rst:429 msgid "Trying these methods will soon clarify their meaning::" msgstr "" -#: ../../howto/regex.rst:435 +#: ../../howto/regex.rst:438 msgid "" ":meth:`~re.Match.group` returns the substring that was matched by the RE. :" "meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting and " @@ -768,20 +774,20 @@ msgid "" "case. ::" msgstr "" -#: ../../howto/regex.rst:452 +#: ../../howto/regex.rst:455 msgid "" "In actual programs, the most common style is to store the :ref:`match object " "` in a variable, and then check if it was ``None``. This " "usually looks like::" msgstr "" -#: ../../howto/regex.rst:463 +#: ../../howto/regex.rst:466 msgid "" "Two pattern methods return all of the matches for a pattern. :meth:`~re." "Pattern.findall` returns a list of matching strings::" msgstr "" -#: ../../howto/regex.rst:470 +#: ../../howto/regex.rst:473 msgid "" "The ``r`` prefix, making the literal a raw string literal, is needed in this " "example because escape sequences in a normal \"cooked\" string literal that " @@ -790,7 +796,7 @@ msgid "" "`SyntaxError`. See :ref:`the-backslash-plague`." msgstr "" -#: ../../howto/regex.rst:476 +#: ../../howto/regex.rst:479 msgid "" ":meth:`~re.Pattern.findall` has to create the entire list before it can be " "returned as the result. The :meth:`~re.Pattern.finditer` method returns a " @@ -798,11 +804,11 @@ msgid "" "`iterator`::" msgstr "" -#: ../../howto/regex.rst:492 +#: ../../howto/regex.rst:495 msgid "Module-Level Functions" msgstr "" -#: ../../howto/regex.rst:494 +#: ../../howto/regex.rst:497 msgid "" "You don't have to create a pattern object and call its methods; the :mod:" "`re` module also provides top-level functions called :func:`~re.match`, :" @@ -812,7 +818,7 @@ msgid "" "``None`` or a :ref:`match object ` instance. ::" msgstr "" -#: ../../howto/regex.rst:506 +#: ../../howto/regex.rst:509 msgid "" "Under the hood, these functions simply create a pattern object for you and " "call the appropriate method on it. They also store the compiled object in a " @@ -820,7 +826,7 @@ msgid "" "again and again." msgstr "" -#: ../../howto/regex.rst:511 +#: ../../howto/regex.rst:514 msgid "" "Should you use these module-level functions, or should you get the pattern " "and call its methods yourself? If you're accessing a regex within a loop, " @@ -828,11 +834,11 @@ msgid "" "not much difference thanks to the internal cache." msgstr "" -#: ../../howto/regex.rst:519 +#: ../../howto/regex.rst:522 msgid "Compilation Flags" msgstr "" -#: ../../howto/regex.rst:523 +#: ../../howto/regex.rst:526 msgid "" "Compilation flags let you modify some aspects of how regular expressions " "work. Flags are available in the :mod:`re` module under two names, a long " @@ -844,72 +850,72 @@ msgid "" "example." msgstr "" -#: ../../howto/regex.rst:531 +#: ../../howto/regex.rst:534 msgid "" "Here's a table of the available flags, followed by a more detailed " "explanation of each one." msgstr "" -#: ../../howto/regex.rst:535 +#: ../../howto/regex.rst:538 msgid "Flag" msgstr "" -#: ../../howto/regex.rst:535 +#: ../../howto/regex.rst:538 msgid "Meaning" msgstr "" -#: ../../howto/regex.rst:537 +#: ../../howto/regex.rst:540 msgid ":const:`ASCII`, :const:`A`" msgstr ":const:`ASCII`, :const:`A`" -#: ../../howto/regex.rst:537 +#: ../../howto/regex.rst:540 msgid "" "Makes several escapes like ``\\w``, ``\\b``, ``\\s`` and ``\\d`` match only " "on ASCII characters with the respective property." msgstr "" -#: ../../howto/regex.rst:541 +#: ../../howto/regex.rst:544 msgid ":const:`DOTALL`, :const:`S`" msgstr ":const:`DOTALL`, :const:`S`" -#: ../../howto/regex.rst:541 +#: ../../howto/regex.rst:544 msgid "Make ``.`` match any character, including newlines." msgstr "" -#: ../../howto/regex.rst:544 +#: ../../howto/regex.rst:547 msgid ":const:`IGNORECASE`, :const:`I`" msgstr ":const:`IGNORECASE`, :const:`I`" -#: ../../howto/regex.rst:544 +#: ../../howto/regex.rst:547 msgid "Do case-insensitive matches." msgstr "" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:549 msgid ":const:`LOCALE`, :const:`L`" msgstr ":const:`LOCALE`, :const:`L`" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:549 msgid "Do a locale-aware match." msgstr "" -#: ../../howto/regex.rst:548 +#: ../../howto/regex.rst:551 msgid ":const:`MULTILINE`, :const:`M`" msgstr ":const:`MULTILINE`, :const:`M`" -#: ../../howto/regex.rst:548 +#: ../../howto/regex.rst:551 msgid "Multi-line matching, affecting ``^`` and ``$``." msgstr "" -#: ../../howto/regex.rst:551 +#: ../../howto/regex.rst:554 msgid ":const:`VERBOSE`, :const:`X` (for 'extended')" msgstr "" -#: ../../howto/regex.rst:551 +#: ../../howto/regex.rst:554 msgid "" "Enable verbose REs, which can be organized more cleanly and understandably." msgstr "" -#: ../../howto/regex.rst:560 +#: ../../howto/regex.rst:563 msgid "" "Perform case-insensitive matching; character class and literal strings will " "match letters by ignoring case. For example, ``[A-Z]`` will match lowercase " @@ -925,13 +931,13 @@ msgid "" "also set the :const:`LOCALE` flag." msgstr "" -#: ../../howto/regex.rst:578 +#: ../../howto/regex.rst:581 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale instead of the Unicode database." msgstr "" -#: ../../howto/regex.rst:581 +#: ../../howto/regex.rst:584 msgid "" "Locales are a feature of the C library intended to help in writing programs " "that take account of language differences. For example, if you're " @@ -950,13 +956,13 @@ msgid "" "patterns, and it is able to handle different locales/languages." msgstr "" -#: ../../howto/regex.rst:603 +#: ../../howto/regex.rst:606 msgid "" "(``^`` and ``$`` haven't been explained yet; they'll be introduced in " "section :ref:`more-metacharacters`.)" msgstr "" -#: ../../howto/regex.rst:606 +#: ../../howto/regex.rst:609 msgid "" "Usually ``^`` matches only at the beginning of the string, and ``$`` matches " "only at the end of the string and immediately before the newline (if any) at " @@ -967,20 +973,20 @@ msgid "" "(immediately preceding each newline)." msgstr "" -#: ../../howto/regex.rst:619 +#: ../../howto/regex.rst:622 msgid "" "Makes the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" -#: ../../howto/regex.rst:627 +#: ../../howto/regex.rst:630 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` perform ASCII-" "only matching instead of full Unicode matching. This is only meaningful for " "Unicode patterns, and is ignored for byte patterns." msgstr "" -#: ../../howto/regex.rst:636 +#: ../../howto/regex.rst:639 msgid "" "This flag allows you to write regular expressions that are more readable by " "granting you more flexibility in how you can format them. When this flag " @@ -992,45 +998,45 @@ msgid "" "preceded by an unescaped backslash." msgstr "" -#: ../../howto/regex.rst:645 +#: ../../howto/regex.rst:648 msgid "" "For example, here's a RE that uses :const:`re.VERBOSE`; see how much easier " "it is to read? ::" msgstr "" -#: ../../howto/regex.rst:658 +#: ../../howto/regex.rst:661 msgid "Without the verbose setting, the RE would look like this::" msgstr "" -#: ../../howto/regex.rst:664 +#: ../../howto/regex.rst:667 msgid "" "In the above example, Python's automatic concatenation of string literals " "has been used to break up the RE into smaller pieces, but it's still more " "difficult to understand than the version using :const:`re.VERBOSE`." msgstr "" -#: ../../howto/regex.rst:670 +#: ../../howto/regex.rst:673 msgid "More Pattern Power" msgstr "" -#: ../../howto/regex.rst:672 +#: ../../howto/regex.rst:675 msgid "" "So far we've only covered a part of the features of regular expressions. In " "this section, we'll cover some new metacharacters, and how to use groups to " "retrieve portions of the text that was matched." msgstr "" -#: ../../howto/regex.rst:680 +#: ../../howto/regex.rst:683 msgid "More Metacharacters" msgstr "" -#: ../../howto/regex.rst:682 +#: ../../howto/regex.rst:685 msgid "" "There are some metacharacters that we haven't covered yet. Most of them " "will be covered in this section." msgstr "" -#: ../../howto/regex.rst:685 +#: ../../howto/regex.rst:688 msgid "" "Some of the remaining metacharacters to be discussed are :dfn:`zero-width " "assertions`. They don't cause the engine to advance through the string; " @@ -1042,11 +1048,11 @@ msgid "" "of times." msgstr "" -#: ../../howto/regex.rst:701 +#: ../../howto/regex.rst:704 msgid "``|``" msgstr "``|``" -#: ../../howto/regex.rst:694 +#: ../../howto/regex.rst:697 msgid "" "Alternation, or the \"or\" operator. If *A* and *B* are regular " "expressions, ``A|B`` will match any string that matches either *A* or *B*. " @@ -1056,17 +1062,17 @@ msgid "" "``'ervo'``." msgstr "" -#: ../../howto/regex.rst:700 +#: ../../howto/regex.rst:703 msgid "" "To match a literal ``'|'``, use ``\\|``, or enclose it inside a character " "class, as in ``[|]``." msgstr "" -#: ../../howto/regex.rst:716 +#: ../../howto/regex.rst:719 msgid "``^``" msgstr "``^``" -#: ../../howto/regex.rst:704 +#: ../../howto/regex.rst:707 msgid "" "Matches at the beginning of lines. Unless the :const:`MULTILINE` flag has " "been set, this will only match at the beginning of the string. In :const:" @@ -1074,37 +1080,37 @@ msgid "" "the string." msgstr "" -#: ../../howto/regex.rst:708 +#: ../../howto/regex.rst:711 msgid "" "For example, if you wish to match the word ``From`` only at the beginning of " "a line, the RE to use is ``^From``. ::" msgstr "" -#: ../../howto/regex.rst:716 +#: ../../howto/regex.rst:719 msgid "To match a literal ``'^'``, use ``\\^``." msgstr "" -#: ../../howto/regex.rst:730 +#: ../../howto/regex.rst:733 msgid "``$``" msgstr "``$``" -#: ../../howto/regex.rst:719 +#: ../../howto/regex.rst:722 msgid "" "Matches at the end of a line, which is defined as either the end of the " "string, or any location followed by a newline character. ::" msgstr "" -#: ../../howto/regex.rst:729 +#: ../../howto/regex.rst:732 msgid "" "To match a literal ``'$'``, use ``\\$`` or enclose it inside a character " "class, as in ``[$]``." msgstr "" -#: ../../howto/regex.rst:736 +#: ../../howto/regex.rst:739 msgid "``\\A``" msgstr "``\\A``" -#: ../../howto/regex.rst:733 +#: ../../howto/regex.rst:736 msgid "" "Matches only at the start of the string. When not in :const:`MULTILINE` " "mode, ``\\A`` and ``^`` are effectively the same. In :const:`MULTILINE` " @@ -1113,19 +1119,19 @@ msgid "" "newline character." msgstr "" -#: ../../howto/regex.rst:739 +#: ../../howto/regex.rst:742 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../howto/regex.rst:739 +#: ../../howto/regex.rst:742 msgid "Matches only at the end of the string." msgstr "" -#: ../../howto/regex.rst:774 +#: ../../howto/regex.rst:777 msgid "``\\b``" msgstr "``\\b``" -#: ../../howto/regex.rst:742 +#: ../../howto/regex.rst:745 msgid "" "Word boundary. This is a zero-width assertion that matches only at the " "beginning or end of a word. A word is defined as a sequence of alphanumeric " @@ -1133,13 +1139,13 @@ msgid "" "alphanumeric character." msgstr "" -#: ../../howto/regex.rst:747 +#: ../../howto/regex.rst:750 msgid "" "The following example matches ``class`` only when it's a complete word; it " "won't match when it's contained inside another word. ::" msgstr "" -#: ../../howto/regex.rst:758 +#: ../../howto/regex.rst:761 msgid "" "There are two subtleties you should remember when using this special " "sequence. First, this is the worst collision between Python's string " @@ -1150,28 +1156,28 @@ msgid "" "previous RE, but omits the ``'r'`` in front of the RE string. ::" msgstr "" -#: ../../howto/regex.rst:772 +#: ../../howto/regex.rst:775 msgid "" "Second, inside a character class, where there's no use for this assertion, " "``\\b`` represents the backspace character, for compatibility with Python's " "string literals." msgstr "" -#: ../../howto/regex.rst:779 +#: ../../howto/regex.rst:782 msgid "``\\B``" msgstr "``\\B``" -#: ../../howto/regex.rst:777 +#: ../../howto/regex.rst:780 msgid "" "Another zero-width assertion, this is the opposite of ``\\b``, only matching " "when the current position is not at a word boundary." msgstr "" -#: ../../howto/regex.rst:782 +#: ../../howto/regex.rst:785 msgid "Grouping" msgstr "" -#: ../../howto/regex.rst:784 +#: ../../howto/regex.rst:787 msgid "" "Frequently you need to obtain more information than just whether the RE " "matched or not. Regular expressions are often used to dissect strings by " @@ -1180,14 +1186,14 @@ msgid "" "name and a value, separated by a ``':'``, like this:" msgstr "" -#: ../../howto/regex.rst:797 +#: ../../howto/regex.rst:800 msgid "" "This can be handled by writing a regular expression which matches an entire " "header line, and has one group which matches the header name, and another " "group which matches the header's value." msgstr "" -#: ../../howto/regex.rst:801 +#: ../../howto/regex.rst:804 msgid "" "Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and " "``')'`` have much the same meaning as they do in mathematical expressions; " @@ -1197,7 +1203,7 @@ msgid "" "repetitions of ``ab``. ::" msgstr "" -#: ../../howto/regex.rst:812 +#: ../../howto/regex.rst:815 msgid "" "Groups indicated with ``'('``, ``')'`` also capture the starting and ending " "index of the text that they match; this can be retrieved by passing an " @@ -1209,27 +1215,27 @@ msgid "" "they match. ::" msgstr "" -#: ../../howto/regex.rst:828 +#: ../../howto/regex.rst:831 msgid "" "Subgroups are numbered from left to right, from 1 upward. Groups can be " "nested; to determine the number, just count the opening parenthesis " "characters, going from left to right. ::" msgstr "" -#: ../../howto/regex.rst:841 +#: ../../howto/regex.rst:844 msgid "" ":meth:`~re.Match.group` can be passed multiple group numbers at a time, in " "which case it will return a tuple containing the corresponding values for " "those groups. ::" msgstr "" -#: ../../howto/regex.rst:847 +#: ../../howto/regex.rst:850 msgid "" "The :meth:`~re.Match.groups` method returns a tuple containing the strings " "for all the subgroups, from 1 up to however many there are. ::" msgstr "" -#: ../../howto/regex.rst:853 +#: ../../howto/regex.rst:856 msgid "" "Backreferences in a pattern allow you to specify that the contents of an " "earlier capturing group must also be found at the current location in the " @@ -1240,11 +1246,11 @@ msgid "" "when incorporating backreferences in a RE." msgstr "" -#: ../../howto/regex.rst:861 +#: ../../howto/regex.rst:864 msgid "For example, the following RE detects doubled words in a string. ::" msgstr "" -#: ../../howto/regex.rst:867 +#: ../../howto/regex.rst:870 msgid "" "Backreferences like this aren't often useful for just searching through a " "string --- there are few text formats which repeat data in this way --- but " @@ -1252,11 +1258,11 @@ msgid "" "substitutions." msgstr "" -#: ../../howto/regex.rst:873 +#: ../../howto/regex.rst:876 msgid "Non-capturing and Named Groups" msgstr "" -#: ../../howto/regex.rst:875 +#: ../../howto/regex.rst:878 msgid "" "Elaborate REs may use many groups, both to capture substrings of interest, " "and to group and structure the RE itself. In complex REs, it becomes " @@ -1265,7 +1271,7 @@ msgid "" "expression extensions, so we'll look at that first." msgstr "" -#: ../../howto/regex.rst:881 +#: ../../howto/regex.rst:884 msgid "" "Perl 5 is well known for its powerful additions to standard regular " "expressions. For these new features the Perl developers couldn't choose new " @@ -1276,7 +1282,7 @@ msgid "" "wouldn't have escaped it by writing ``\\&`` or ``[&]``." msgstr "" -#: ../../howto/regex.rst:888 +#: ../../howto/regex.rst:891 msgid "" "The solution chosen by the Perl developers was to use ``(?...)`` as the " "extension syntax. ``?`` immediately after a parenthesis was a syntax error " @@ -1287,20 +1293,20 @@ msgid "" "capturing group containing the subexpression ``foo``)." msgstr "" -#: ../../howto/regex.rst:896 +#: ../../howto/regex.rst:899 msgid "" "Python supports several of Perl's extensions and adds an extension syntax to " "Perl's extension syntax. If the first character after the question mark is " "a ``P``, you know that it's an extension that's specific to Python." msgstr "" -#: ../../howto/regex.rst:901 +#: ../../howto/regex.rst:904 msgid "" "Now that we've looked at the general extension syntax, we can return to the " "features that simplify working with groups in complex REs." msgstr "" -#: ../../howto/regex.rst:904 +#: ../../howto/regex.rst:907 msgid "" "Sometimes you'll want to use a group to denote a part of a regular " "expression, but aren't interested in retrieving the group's contents. You " @@ -1308,7 +1314,7 @@ msgid "" "where you can replace the ``...`` with any other regular expression. ::" msgstr "" -#: ../../howto/regex.rst:916 +#: ../../howto/regex.rst:919 msgid "" "Except for the fact that you can't retrieve the contents of what the group " "matched, a non-capturing group behaves exactly the same as a capturing " @@ -1321,13 +1327,13 @@ msgid "" "groups; neither form is any faster than the other." msgstr "" -#: ../../howto/regex.rst:925 +#: ../../howto/regex.rst:928 msgid "" "A more significant feature is named groups: instead of referring to them by " "numbers, groups can be referenced by a name." msgstr "" -#: ../../howto/regex.rst:928 +#: ../../howto/regex.rst:931 msgid "" "The syntax for a named group is one of the Python-specific extensions: ``(?" "P...)``. *name* is, obviously, the name of the group. Named groups " @@ -1339,26 +1345,26 @@ msgid "" "ways::" msgstr "" -#: ../../howto/regex.rst:943 +#: ../../howto/regex.rst:946 msgid "" "Additionally, you can retrieve named groups as a dictionary with :meth:`~re." "Match.groupdict`::" msgstr "" -#: ../../howto/regex.rst:950 +#: ../../howto/regex.rst:953 msgid "" "Named groups are handy because they let you use easily remembered names, " "instead of having to remember numbers. Here's an example RE from the :mod:" "`imaplib` module::" msgstr "" -#: ../../howto/regex.rst:961 +#: ../../howto/regex.rst:964 msgid "" "It's obviously much easier to retrieve ``m.group('zonem')``, instead of " "having to remember to retrieve group 9." msgstr "" -#: ../../howto/regex.rst:964 +#: ../../howto/regex.rst:967 msgid "" "The syntax for backreferences in an expression such as ``(...)\\1`` refers " "to the number of the group. There's naturally a variant that uses the group " @@ -1369,22 +1375,22 @@ msgid "" "P\\w+)\\s+(?P=word)\\b``::" msgstr "" -#: ../../howto/regex.rst:977 +#: ../../howto/regex.rst:980 msgid "Lookahead Assertions" msgstr "" -#: ../../howto/regex.rst:979 +#: ../../howto/regex.rst:982 msgid "" "Another zero-width assertion is the lookahead assertion. Lookahead " "assertions are available in both positive and negative form, and look like " "this:" msgstr "" -#: ../../howto/regex.rst:987 +#: ../../howto/regex.rst:990 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../howto/regex.rst:983 +#: ../../howto/regex.rst:986 msgid "" "Positive lookahead assertion. This succeeds if the contained regular " "expression, represented here by ``...``, successfully matches at the current " @@ -1393,18 +1399,18 @@ msgid "" "is tried right where the assertion started." msgstr "" -#: ../../howto/regex.rst:992 +#: ../../howto/regex.rst:995 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../howto/regex.rst:990 +#: ../../howto/regex.rst:993 msgid "" "Negative lookahead assertion. This is the opposite of the positive " "assertion; it succeeds if the contained expression *doesn't* match at the " "current position in the string." msgstr "" -#: ../../howto/regex.rst:994 +#: ../../howto/regex.rst:997 msgid "" "To make this concrete, let's look at a case where a lookahead is useful. " "Consider a simple pattern to match a filename and split it apart into a base " @@ -1412,15 +1418,15 @@ msgid "" "``news`` is the base name, and ``rc`` is the filename's extension." msgstr "" -#: ../../howto/regex.rst:999 +#: ../../howto/regex.rst:1002 msgid "The pattern to match this is quite simple:" msgstr "" -#: ../../howto/regex.rst:1001 +#: ../../howto/regex.rst:1004 msgid "``.*[.].*$``" msgstr "``.*[.].*$``" -#: ../../howto/regex.rst:1003 +#: ../../howto/regex.rst:1006 msgid "" "Notice that the ``.`` needs to be treated specially because it's a " "metacharacter, so it's inside a character class to only match that specific " @@ -1430,24 +1436,24 @@ msgid "" "``printers.conf``." msgstr "" -#: ../../howto/regex.rst:1010 +#: ../../howto/regex.rst:1013 msgid "" "Now, consider complicating the problem a bit; what if you want to match " "filenames where the extension is not ``bat``? Some incorrect attempts:" msgstr "" -#: ../../howto/regex.rst:1013 +#: ../../howto/regex.rst:1016 msgid "" "``.*[.][^b].*$`` The first attempt above tries to exclude ``bat`` by " "requiring that the first character of the extension is not a ``b``. This is " "wrong, because the pattern also doesn't match ``foo.bar``." msgstr "" -#: ../../howto/regex.rst:1017 +#: ../../howto/regex.rst:1020 msgid "``.*[.]([^b]..|.[^a].|..[^t])$``" msgstr "``.*[.]([^b]..|.[^a].|..[^t])$``" -#: ../../howto/regex.rst:1019 +#: ../../howto/regex.rst:1022 msgid "" "The expression gets messier when you try to patch up the first solution by " "requiring one of the following cases to match: the first character of the " @@ -1458,18 +1464,18 @@ msgid "" "pattern again in an effort to fix it." msgstr "" -#: ../../howto/regex.rst:1027 +#: ../../howto/regex.rst:1030 msgid "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" msgstr "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" -#: ../../howto/regex.rst:1029 +#: ../../howto/regex.rst:1032 msgid "" "In the third attempt, the second and third letters are all made optional in " "order to allow matching extensions shorter than three characters, such as " "``sendmail.cf``." msgstr "" -#: ../../howto/regex.rst:1033 +#: ../../howto/regex.rst:1036 msgid "" "The pattern's getting really complicated now, which makes it hard to read " "and understand. Worse, if the problem changes and you want to exclude both " @@ -1477,11 +1483,11 @@ msgid "" "complicated and confusing." msgstr "" -#: ../../howto/regex.rst:1038 +#: ../../howto/regex.rst:1041 msgid "A negative lookahead cuts through all this confusion:" msgstr "" -#: ../../howto/regex.rst:1040 +#: ../../howto/regex.rst:1043 msgid "" "``.*[.](?!bat$)[^.]*$`` The negative lookahead means: if the expression " "``bat`` doesn't match at this point, try the rest of the pattern; if " @@ -1491,61 +1497,61 @@ msgid "" "the pattern works when there are multiple dots in the filename." msgstr "" -#: ../../howto/regex.rst:1047 +#: ../../howto/regex.rst:1050 msgid "" "Excluding another filename extension is now easy; simply add it as an " "alternative inside the assertion. The following pattern excludes filenames " "that end in either ``bat`` or ``exe``:" msgstr "" -#: ../../howto/regex.rst:1051 +#: ../../howto/regex.rst:1054 msgid "``.*[.](?!bat$|exe$)[^.]*$``" msgstr "``.*[.](?!bat$|exe$)[^.]*$``" -#: ../../howto/regex.rst:1055 +#: ../../howto/regex.rst:1058 msgid "Modifying Strings" msgstr "" -#: ../../howto/regex.rst:1057 +#: ../../howto/regex.rst:1060 msgid "" "Up to this point, we've simply performed searches against a static string. " "Regular expressions are also commonly used to modify strings in various " "ways, using the following pattern methods:" msgstr "" -#: ../../howto/regex.rst:1064 +#: ../../howto/regex.rst:1067 msgid "``split()``" msgstr "``split()``" -#: ../../howto/regex.rst:1064 +#: ../../howto/regex.rst:1067 msgid "Split the string into a list, splitting it wherever the RE matches" msgstr "" -#: ../../howto/regex.rst:1067 +#: ../../howto/regex.rst:1070 msgid "``sub()``" msgstr "``sub()``" -#: ../../howto/regex.rst:1067 +#: ../../howto/regex.rst:1070 msgid "" "Find all substrings where the RE matches, and replace them with a different " "string" msgstr "" -#: ../../howto/regex.rst:1070 +#: ../../howto/regex.rst:1073 msgid "``subn()``" msgstr "``subn()``" -#: ../../howto/regex.rst:1070 +#: ../../howto/regex.rst:1073 msgid "" "Does the same thing as :meth:`!sub`, but returns the new string and the " "number of replacements" msgstr "" -#: ../../howto/regex.rst:1077 +#: ../../howto/regex.rst:1080 msgid "Splitting Strings" msgstr "" -#: ../../howto/regex.rst:1079 +#: ../../howto/regex.rst:1082 msgid "" "The :meth:`~re.Pattern.split` method of a pattern splits a string apart " "wherever the RE matches, returning a list of the pieces. It's similar to " @@ -1555,7 +1561,7 @@ msgid "" "module-level :func:`re.split` function, too." msgstr "" -#: ../../howto/regex.rst:1090 +#: ../../howto/regex.rst:1093 msgid "" "Split *string* by the matches of the regular expression. If capturing " "parentheses are used in the RE, then their contents will also be returned as " @@ -1563,7 +1569,7 @@ msgid "" "splits are performed." msgstr "" -#: ../../howto/regex.rst:1095 +#: ../../howto/regex.rst:1098 msgid "" "You can limit the number of splits made, by passing a value for *maxsplit*. " "When *maxsplit* is nonzero, at most *maxsplit* splits will be made, and the " @@ -1572,7 +1578,7 @@ msgid "" "characters. ::" msgstr "" -#: ../../howto/regex.rst:1107 +#: ../../howto/regex.rst:1110 msgid "" "Sometimes you're not only interested in what the text between delimiters is, " "but also need to know what the delimiter was. If capturing parentheses are " @@ -1580,17 +1586,17 @@ msgid "" "Compare the following calls::" msgstr "" -#: ../../howto/regex.rst:1119 +#: ../../howto/regex.rst:1122 msgid "" "The module-level function :func:`re.split` adds the RE to be used as the " "first argument, but is otherwise the same. ::" msgstr "" -#: ../../howto/regex.rst:1131 +#: ../../howto/regex.rst:1134 msgid "Search and Replace" msgstr "" -#: ../../howto/regex.rst:1133 +#: ../../howto/regex.rst:1136 msgid "" "Another common task is to find all the matches for a pattern, and replace " "them with a different string. The :meth:`~re.Pattern.sub` method takes a " @@ -1598,40 +1604,40 @@ msgid "" "string to be processed." msgstr "" -#: ../../howto/regex.rst:1140 +#: ../../howto/regex.rst:1143 msgid "" "Returns the string obtained by replacing the leftmost non-overlapping " "occurrences of the RE in *string* by the replacement *replacement*. If the " "pattern isn't found, *string* is returned unchanged." msgstr "" -#: ../../howto/regex.rst:1144 +#: ../../howto/regex.rst:1147 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. The default value " "of 0 means to replace all occurrences." msgstr "" -#: ../../howto/regex.rst:1148 +#: ../../howto/regex.rst:1151 msgid "" "Here's a simple example of using the :meth:`~re.Pattern.sub` method. It " "replaces colour names with the word ``colour``::" msgstr "" -#: ../../howto/regex.rst:1157 +#: ../../howto/regex.rst:1160 msgid "" "The :meth:`~re.Pattern.subn` method does the same work, but returns a 2-" "tuple containing the new string value and the number of replacements that " "were performed::" msgstr "" -#: ../../howto/regex.rst:1166 +#: ../../howto/regex.rst:1169 msgid "" "Empty matches are replaced only when they're not adjacent to a previous " "empty match. ::" msgstr "" -#: ../../howto/regex.rst:1173 +#: ../../howto/regex.rst:1176 msgid "" "If *replacement* is a string, any backslash escapes in it are processed. " "That is, ``\\n`` is converted to a single newline character, ``\\r`` is " @@ -1642,13 +1648,13 @@ msgid "" "string." msgstr "" -#: ../../howto/regex.rst:1180 +#: ../../howto/regex.rst:1183 msgid "" "This example matches the word ``section`` followed by a string enclosed in " "``{``, ``}``, and changes ``section`` to ``subsection``::" msgstr "" -#: ../../howto/regex.rst:1187 +#: ../../howto/regex.rst:1190 msgid "" "There's also a syntax for referring to named groups as defined by the ``(?" "P...)`` syntax. ``\\g`` will use the substring matched by the " @@ -1660,7 +1666,7 @@ msgid "" "but use all three variations of the replacement string. ::" msgstr "" -#: ../../howto/regex.rst:1204 +#: ../../howto/regex.rst:1207 msgid "" "*replacement* can also be a function, which gives you even more control. If " "*replacement* is a function, the function is called for every non-" @@ -1669,13 +1675,13 @@ msgid "" "this information to compute the desired replacement string and return it." msgstr "" -#: ../../howto/regex.rst:1210 +#: ../../howto/regex.rst:1213 msgid "" "In the following example, the replacement function translates decimals into " "hexadecimal::" msgstr "" -#: ../../howto/regex.rst:1222 +#: ../../howto/regex.rst:1225 msgid "" "When using the module-level :func:`re.sub` function, the pattern is passed " "as the first argument. The pattern may be provided as an object or as a " @@ -1685,11 +1691,11 @@ msgid "" "x'``." msgstr "" -#: ../../howto/regex.rst:1230 +#: ../../howto/regex.rst:1233 msgid "Common Problems" msgstr "" -#: ../../howto/regex.rst:1232 +#: ../../howto/regex.rst:1235 msgid "" "Regular expressions are a powerful tool for some applications, but in some " "ways their behaviour isn't intuitive and at times they don't behave the way " @@ -1697,11 +1703,11 @@ msgid "" "pitfalls." msgstr "" -#: ../../howto/regex.rst:1238 +#: ../../howto/regex.rst:1241 msgid "Use String Methods" msgstr "" -#: ../../howto/regex.rst:1240 +#: ../../howto/regex.rst:1243 msgid "" "Sometimes using the :mod:`re` module is a mistake. If you're matching a " "fixed string, or a single character class, and you're not using any :mod:" @@ -1713,7 +1719,7 @@ msgid "" "engine." msgstr "" -#: ../../howto/regex.rst:1248 +#: ../../howto/regex.rst:1251 msgid "" "One example might be replacing a single fixed string with another one; for " "example, you might replace ``word`` with ``deed``. :func:`re.sub` seems " @@ -1726,7 +1732,7 @@ msgid "" "meth:`!replace`'s abilities.)" msgstr "" -#: ../../howto/regex.rst:1257 +#: ../../howto/regex.rst:1260 msgid "" "Another common task is deleting every occurrence of a single character from " "a string or replacing it with another single character. You might do this " @@ -1735,17 +1741,17 @@ msgid "" "operation can be." msgstr "" -#: ../../howto/regex.rst:1263 +#: ../../howto/regex.rst:1266 msgid "" "In short, before turning to the :mod:`re` module, consider whether your " "problem can be solved with a faster and simpler string method." msgstr "" -#: ../../howto/regex.rst:1268 +#: ../../howto/regex.rst:1271 msgid "match() versus search()" msgstr "" -#: ../../howto/regex.rst:1270 +#: ../../howto/regex.rst:1273 msgid "" "The :func:`~re.match` function only checks if the RE matches at the " "beginning of the string while :func:`~re.search` will scan forward through " @@ -1755,13 +1761,13 @@ msgid "" "report it. ::" msgstr "" -#: ../../howto/regex.rst:1281 +#: ../../howto/regex.rst:1284 msgid "" "On the other hand, :func:`~re.search` will scan forward through the string, " "reporting the first match it finds. ::" msgstr "" -#: ../../howto/regex.rst:1289 +#: ../../howto/regex.rst:1292 msgid "" "Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``." "*`` to the front of your RE. Resist this temptation and use :func:`re." @@ -1773,18 +1779,18 @@ msgid "" "starting character, only trying the full match if a ``'C'`` is found." msgstr "" -#: ../../howto/regex.rst:1298 +#: ../../howto/regex.rst:1301 msgid "" "Adding ``.*`` defeats this optimization, requiring scanning to the end of " "the string and then backtracking to find a match for the rest of the RE. " "Use :func:`re.search` instead." msgstr "" -#: ../../howto/regex.rst:1304 +#: ../../howto/regex.rst:1307 msgid "Greedy versus Non-Greedy" msgstr "" -#: ../../howto/regex.rst:1306 +#: ../../howto/regex.rst:1309 msgid "" "When repeating a regular expression, as in ``a*``, the resulting action is " "to consume as much of the pattern as possible. This fact often bites you " @@ -1793,7 +1799,7 @@ msgid "" "HTML tag doesn't work because of the greedy nature of ``.*``. ::" msgstr "" -#: ../../howto/regex.rst:1320 +#: ../../howto/regex.rst:1323 msgid "" "The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest " "of the string. There's still more left in the RE, though, and the ``>`` " @@ -1803,7 +1809,7 @@ msgid "" "``''``, which isn't what you want." msgstr "" -#: ../../howto/regex.rst:1327 +#: ../../howto/regex.rst:1330 msgid "" "In this case, the solution is to use the non-greedy quantifiers ``*?``, ``+?" "``, ``??``, or ``{m,n}?``, which match as *little* text as possible. In the " @@ -1812,7 +1818,7 @@ msgid "" "retrying the ``'>'`` at every step. This produces just the right result::" msgstr "" -#: ../../howto/regex.rst:1336 +#: ../../howto/regex.rst:1339 msgid "" "(Note that parsing HTML or XML with regular expressions is painful. Quick-" "and-dirty patterns will handle common cases, but HTML and XML have special " @@ -1822,11 +1828,11 @@ msgid "" "such tasks.)" msgstr "" -#: ../../howto/regex.rst:1344 +#: ../../howto/regex.rst:1347 msgid "Using re.VERBOSE" msgstr "" -#: ../../howto/regex.rst:1346 +#: ../../howto/regex.rst:1349 msgid "" "By now you've probably noticed that regular expressions are a very compact " "notation, but they're not terribly readable. REs of moderate complexity can " @@ -1834,14 +1840,14 @@ msgid "" "making them difficult to read and understand." msgstr "" -#: ../../howto/regex.rst:1351 +#: ../../howto/regex.rst:1354 msgid "" "For such REs, specifying the :const:`re.VERBOSE` flag when compiling the " "regular expression can be helpful, because it allows you to format the " "regular expression more clearly." msgstr "" -#: ../../howto/regex.rst:1355 +#: ../../howto/regex.rst:1358 msgid "" "The ``re.VERBOSE`` flag has several effects. Whitespace in the regular " "expression that *isn't* inside a character class is ignored. This means " @@ -1852,15 +1858,15 @@ msgid "" "quoted strings, this enables REs to be formatted more neatly::" msgstr "" -#: ../../howto/regex.rst:1372 +#: ../../howto/regex.rst:1375 msgid "This is far more readable than::" msgstr "" -#: ../../howto/regex.rst:1378 +#: ../../howto/regex.rst:1381 msgid "Feedback" msgstr "" -#: ../../howto/regex.rst:1380 +#: ../../howto/regex.rst:1383 msgid "" "Regular expressions are a complicated topic. Did this document help you " "understand them? Were there parts that were unclear, or Problems you " @@ -1868,7 +1874,7 @@ msgid "" "improvements to the author." msgstr "" -#: ../../howto/regex.rst:1385 +#: ../../howto/regex.rst:1388 msgid "" "The most complete book on regular expressions is almost certainly Jeffrey " "Friedl's Mastering Regular Expressions, published by O'Reilly. " diff --git a/library/abc.po b/library/abc.po index d6810e2883..36c2de8375 100644 --- a/library/abc.po +++ b/library/abc.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2022-11-16 03:29+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,8 +51,8 @@ msgid "" msgstr "" ":mod:`collections` 模組中有一些衍生自 ABC 的具體類別;當然這些類別還可以進一" "步衍生出其他類別。此外,:mod:`collections.abc` 子模組中有一些 ABC 可被用於測" -"試一個類別或實例是否提供特定介面,例如它是否\\ :term:`可雜湊 (hashable) ` 或它是否為對映 " -"(mapping)。" +"試一個類別或實例是否提供特定介面,例如它是否\\ :term:`可雜湊 (hashable) " +"` 或它是否為對映 (mapping)。" #: ../../library/abc.rst:27 msgid "" @@ -205,13 +205,13 @@ msgid "" "Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``, " "even though it does not define an :meth:`~iterator.__iter__` method (it uses " "the old-style iterable protocol, defined in terms of :meth:`__len__` and :" -"meth:`__getitem__`). Note that this will not make ``get_iterator`` " +"meth:`~object.__getitem__`). Note that this will not make ``get_iterator`` " "available as a method of ``Foo``, so it is provided separately." msgstr "" "最後,即使 ``Foo`` 沒有定義 :meth:`~iterator.__iter__` 方法(它使用了以 :" -"meth:`__len__` 和 :meth:`__getitem__` 所定義的舊式可疊代物件協定),最末一行" -"使其成為 ``MyIterable`` 的一個虛擬子類別。請注意這不會使 ``get_iterator`` 成" -"為 ``Foo`` 的一個可用方法,所以它是需要被另外提供的。" +"meth:`__len__` 和 :meth:`~object.__getitem__` 所定義的舊式可疊代物件協定)," +"最末一行使其成為 ``MyIterable`` 的一個虛擬子類別。請注意這不會使 " +"``get_iterator`` 成為 ``Foo`` 的一個可用方法,所以它是需要被另外提供的。" #: ../../library/abc.rst:163 msgid "The :mod:`abc` module also provides the following decorator:" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 372e08e38e..ff4ea8f2f0 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-30 00:03+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -258,8 +258,8 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:176 -#: ../../library/asyncio-eventloop.rst:1236 -#: ../../library/asyncio-eventloop.rst:1643 +#: ../../library/asyncio-eventloop.rst:1242 +#: ../../library/asyncio-eventloop.rst:1660 msgid "Example::" msgstr "" "範例:\n" @@ -540,8 +540,8 @@ msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:412 -#: ../../library/asyncio-eventloop.rst:1152 -#: ../../library/asyncio-eventloop.rst:1168 +#: ../../library/asyncio-eventloop.rst:1156 +#: ../../library/asyncio-eventloop.rst:1172 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." @@ -652,7 +652,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:482 #: ../../library/asyncio-eventloop.rst:597 -#: ../../library/asyncio-eventloop.rst:821 +#: ../../library/asyncio-eventloop.rst:825 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." @@ -667,7 +667,7 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:490 -#: ../../library/asyncio-eventloop.rst:915 +#: ../../library/asyncio-eventloop.rst:919 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " @@ -675,9 +675,9 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:494 -#: ../../library/asyncio-eventloop.rst:738 -#: ../../library/asyncio-eventloop.rst:832 -#: ../../library/asyncio-eventloop.rst:919 +#: ../../library/asyncio-eventloop.rst:742 +#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:923 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " @@ -695,18 +695,20 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:508 -#: ../../library/asyncio-eventloop.rst:750 +#: ../../library/asyncio-eventloop.rst:754 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "新增 :class:`ProactorEventLoop` 中的 SSL/TLS 支援。" #: ../../library/asyncio-eventloop.rst:512 msgid "" -"The socket option :py:const:`~socket.TCP_NODELAY` is set by default for all " -"TCP connections." +"The socket option :ref:`socket.TCP_NODELAY ` is set " +"by default for all TCP connections." msgstr "" +"所有 TCP 連線都預設有 :ref:`socket.TCP_NODELAY ` " +"socket 選項。" #: ../../library/asyncio-eventloop.rst:517 -#: ../../library/asyncio-eventloop.rst:842 +#: ../../library/asyncio-eventloop.rst:846 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" @@ -730,11 +732,11 @@ msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" msgstr "更多資訊請見: https://datatracker.ietf.org/doc/html/rfc6555" #: ../../library/asyncio-eventloop.rst:536 -#: ../../library/asyncio-eventloop.rst:658 -#: ../../library/asyncio-eventloop.rst:764 -#: ../../library/asyncio-eventloop.rst:799 -#: ../../library/asyncio-eventloop.rst:846 -#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:660 +#: ../../library/asyncio-eventloop.rst:768 +#: ../../library/asyncio-eventloop.rst:803 +#: ../../library/asyncio-eventloop.rst:850 +#: ../../library/asyncio-eventloop.rst:931 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" @@ -765,15 +767,15 @@ msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:561 -#: ../../library/asyncio-eventloop.rst:681 -#: ../../library/asyncio-eventloop.rst:813 +#: ../../library/asyncio-eventloop.rst:685 +#: ../../library/asyncio-eventloop.rst:817 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" #: ../../library/asyncio-eventloop.rst:564 -#: ../../library/asyncio-eventloop.rst:640 +#: ../../library/asyncio-eventloop.rst:642 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" @@ -804,8 +806,8 @@ msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows and some " -"Unixes. If the :py:const:`~socket.SO_REUSEPORT` constant is not defined then " -"this capability is unsupported." +"Unixes. If the :ref:`socket.SO_REUSEPORT ` constant " +"is not defined then this capability is unsupported." msgstr "" #: ../../library/asyncio-eventloop.rst:587 @@ -836,115 +838,115 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:608 msgid "" -"The *reuse_address* parameter is no longer supported, as using :py:const:" -"`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " -"Explicitly passing ``reuse_address=True`` will raise an exception." +"The *reuse_address* parameter is no longer supported, as using :ref:`socket." +"SO_REUSEADDR ` poses a significant security concern " +"for UDP. Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:613 +#: ../../library/asyncio-eventloop.rst:614 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " "randomly distributed among the sockets." msgstr "" -#: ../../library/asyncio-eventloop.rst:617 +#: ../../library/asyncio-eventloop.rst:618 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " -"similar functionality. With *reuse_port*, :py:const:`~sockets.SO_REUSEPORT` " -"is used instead, which specifically prevents processes with differing UIDs " -"from assigning sockets to the same socket address." +"similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT ` is used instead, which specifically prevents processes with " +"differing UIDs from assigning sockets to the same socket address." msgstr "" -#: ../../library/asyncio-eventloop.rst:623 +#: ../../library/asyncio-eventloop.rst:625 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:626 +#: ../../library/asyncio-eventloop.rst:628 msgid "" "The *reuse_address* parameter, disabled since Python 3.9.0, 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" -#: ../../library/asyncio-eventloop.rst:635 +#: ../../library/asyncio-eventloop.rst:637 msgid "Create a Unix connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:637 +#: ../../library/asyncio-eventloop.rst:639 msgid "" "The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :" "py:const:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:642 +#: ../../library/asyncio-eventloop.rst:644 msgid "" "*path* is the name of a Unix domain socket and is required, unless a *sock* " "parameter is specified. Abstract Unix sockets, :class:`str`, :class:" "`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:647 +#: ../../library/asyncio-eventloop.rst:649 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:650 -#: ../../library/asyncio-eventloop.rst:790 -#: ../../library/asyncio-eventloop.rst:1219 +#: ../../library/asyncio-eventloop.rst:652 +#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:1225 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncio-eventloop.rst:652 +#: ../../library/asyncio-eventloop.rst:654 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:662 +#: ../../library/asyncio-eventloop.rst:664 msgid "Creating network servers" msgstr "" -#: ../../library/asyncio-eventloop.rst:674 +#: ../../library/asyncio-eventloop.rst:678 msgid "" "Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: ../../library/asyncio-eventloop.rst:677 +#: ../../library/asyncio-eventloop.rst:681 msgid "Returns a :class:`Server` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:679 +#: ../../library/asyncio-eventloop.rst:683 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:684 +#: ../../library/asyncio-eventloop.rst:688 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: ../../library/asyncio-eventloop.rst:687 +#: ../../library/asyncio-eventloop.rst:691 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: ../../library/asyncio-eventloop.rst:690 +#: ../../library/asyncio-eventloop.rst:694 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "" -#: ../../library/asyncio-eventloop.rst:693 +#: ../../library/asyncio-eventloop.rst:697 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -#: ../../library/asyncio-eventloop.rst:697 +#: ../../library/asyncio-eventloop.rst:701 msgid "" "The *port* parameter can be set to specify which port the server should " "listen on. If ``0`` or ``None`` (the default), a random unused port will be " @@ -952,63 +954,63 @@ msgid "" "different random port will be selected for each interface)." msgstr "" -#: ../../library/asyncio-eventloop.rst:702 +#: ../../library/asyncio-eventloop.rst:706 msgid "" "*family* can be set to either :const:`socket.AF_INET` or :const:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :const:`~socket.AF_UNSPEC`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:707 +#: ../../library/asyncio-eventloop.rst:711 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:709 +#: ../../library/asyncio-eventloop.rst:713 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:714 +#: ../../library/asyncio-eventloop.rst:718 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:718 +#: ../../library/asyncio-eventloop.rst:722 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: ../../library/asyncio-eventloop.rst:721 +#: ../../library/asyncio-eventloop.rst:725 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:724 +#: ../../library/asyncio-eventloop.rst:728 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " "will automatically be set to ``True`` on Unix." msgstr "" -#: ../../library/asyncio-eventloop.rst:729 +#: ../../library/asyncio-eventloop.rst:733 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:734 +#: ../../library/asyncio-eventloop.rst:738 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " "seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:742 +#: ../../library/asyncio-eventloop.rst:746 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -1016,46 +1018,46 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:754 +#: ../../library/asyncio-eventloop.rst:758 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: ../../library/asyncio-eventloop.rst:758 +#: ../../library/asyncio-eventloop.rst:762 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " -"option :py:const:`~socket.TCP_NODELAY` is set by default for all TCP " -"connections." +"option :ref:`socket.TCP_NODELAY ` is set by default " +"for all TCP connections." msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 :" -"py:const:`~socket.TCP_NODELAY` socket 選項。" +"ref:`socket.TCP_NODELAY ` socket 選項。" -#: ../../library/asyncio-eventloop.rst:768 +#: ../../library/asyncio-eventloop.rst:772 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:779 +#: ../../library/asyncio-eventloop.rst:783 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." "AF_UNIX` socket family." msgstr "" -#: ../../library/asyncio-eventloop.rst:782 +#: ../../library/asyncio-eventloop.rst:786 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " "and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:787 +#: ../../library/asyncio-eventloop.rst:791 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:798 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -1063,63 +1065,63 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。\\ *path* 參數現在可為" "一個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:806 +#: ../../library/asyncio-eventloop.rst:810 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:808 +#: ../../library/asyncio-eventloop.rst:812 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "" -#: ../../library/asyncio-eventloop.rst:811 -#: ../../library/asyncio-eventloop.rst:901 +#: ../../library/asyncio-eventloop.rst:815 +#: ../../library/asyncio-eventloop.rst:905 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:816 +#: ../../library/asyncio-eventloop.rst:820 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:825 +#: ../../library/asyncio-eventloop.rst:829 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:828 +#: ../../library/asyncio-eventloop.rst:832 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:840 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:850 +#: ../../library/asyncio-eventloop.rst:854 msgid "Transferring files" msgstr "" -#: ../../library/asyncio-eventloop.rst:855 +#: ../../library/asyncio-eventloop.rst:859 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:858 +#: ../../library/asyncio-eventloop.rst:862 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: ../../library/asyncio-eventloop.rst:860 +#: ../../library/asyncio-eventloop.rst:864 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:862 -#: ../../library/asyncio-eventloop.rst:1107 +#: ../../library/asyncio-eventloop.rst:866 +#: ../../library/asyncio-eventloop.rst:1111 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1128,35 +1130,35 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:869 +#: ../../library/asyncio-eventloop.rst:873 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " "SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:873 +#: ../../library/asyncio-eventloop.rst:877 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:880 +#: ../../library/asyncio-eventloop.rst:884 msgid "TLS Upgrade" msgstr "" -#: ../../library/asyncio-eventloop.rst:887 +#: ../../library/asyncio-eventloop.rst:891 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: ../../library/asyncio-eventloop.rst:889 +#: ../../library/asyncio-eventloop.rst:893 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " "protocol and *protocol*-facing transport." msgstr "" -#: ../../library/asyncio-eventloop.rst:893 +#: ../../library/asyncio-eventloop.rst:897 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1164,80 +1166,80 @@ msgid "" "exchanges extra TLS session packets with *transport*." msgstr "" -#: ../../library/asyncio-eventloop.rst:898 +#: ../../library/asyncio-eventloop.rst:902 msgid "" "In some situations (e.g. when the passed transport is already closing) this " "may return ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:903 +#: ../../library/asyncio-eventloop.rst:907 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:907 +#: ../../library/asyncio-eventloop.rst:911 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:909 +#: ../../library/asyncio-eventloop.rst:913 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:912 +#: ../../library/asyncio-eventloop.rst:916 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:932 +#: ../../library/asyncio-eventloop.rst:936 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:936 +#: ../../library/asyncio-eventloop.rst:940 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: ../../library/asyncio-eventloop.rst:942 +#: ../../library/asyncio-eventloop.rst:946 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." msgstr "" -#: ../../library/asyncio-eventloop.rst:947 +#: ../../library/asyncio-eventloop.rst:951 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:951 -#: ../../library/asyncio-eventloop.rst:1206 +#: ../../library/asyncio-eventloop.rst:955 +#: ../../library/asyncio-eventloop.rst:1212 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:956 +#: ../../library/asyncio-eventloop.rst:960 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." msgstr "" -#: ../../library/asyncio-eventloop.rst:959 +#: ../../library/asyncio-eventloop.rst:963 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:964 +#: ../../library/asyncio-eventloop.rst:968 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:966 +#: ../../library/asyncio-eventloop.rst:970 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1246,72 +1248,72 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:975 +#: ../../library/asyncio-eventloop.rst:979 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:978 +#: ../../library/asyncio-eventloop.rst:982 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:980 -#: ../../library/asyncio-eventloop.rst:994 -#: ../../library/asyncio-eventloop.rst:1005 -#: ../../library/asyncio-eventloop.rst:1017 -#: ../../library/asyncio-eventloop.rst:1032 -#: ../../library/asyncio-eventloop.rst:1047 -#: ../../library/asyncio-eventloop.rst:1057 -#: ../../library/asyncio-eventloop.rst:1083 -#: ../../library/asyncio-eventloop.rst:1121 +#: ../../library/asyncio-eventloop.rst:984 +#: ../../library/asyncio-eventloop.rst:998 +#: ../../library/asyncio-eventloop.rst:1009 +#: ../../library/asyncio-eventloop.rst:1021 +#: ../../library/asyncio-eventloop.rst:1036 +#: ../../library/asyncio-eventloop.rst:1051 +#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:1087 +#: ../../library/asyncio-eventloop.rst:1125 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:982 +#: ../../library/asyncio-eventloop.rst:986 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:989 +#: ../../library/asyncio-eventloop.rst:993 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:992 +#: ../../library/asyncio-eventloop.rst:996 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:1000 +#: ../../library/asyncio-eventloop.rst:1004 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1003 +#: ../../library/asyncio-eventloop.rst:1007 msgid "Return a tuple of (received data, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1011 +#: ../../library/asyncio-eventloop.rst:1015 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1015 +#: ../../library/asyncio-eventloop.rst:1019 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1023 +#: ../../library/asyncio-eventloop.rst:1027 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1026 +#: ../../library/asyncio-eventloop.rst:1030 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1320,34 +1322,34 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1034 -#: ../../library/asyncio-eventloop.rst:1085 +#: ../../library/asyncio-eventloop.rst:1038 +#: ../../library/asyncio-eventloop.rst:1089 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1041 +#: ../../library/asyncio-eventloop.rst:1045 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1045 +#: ../../library/asyncio-eventloop.rst:1049 msgid "Return the number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1053 +#: ../../library/asyncio-eventloop.rst:1057 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1055 +#: ../../library/asyncio-eventloop.rst:1059 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1059 +#: ../../library/asyncio-eventloop.rst:1063 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1355,19 +1357,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1068 +#: ../../library/asyncio-eventloop.rst:1072 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1074 +#: ../../library/asyncio-eventloop.rst:1078 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1077 +#: ../../library/asyncio-eventloop.rst:1081 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1375,57 +1377,57 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1092 +#: ../../library/asyncio-eventloop.rst:1096 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:1097 +#: ../../library/asyncio-eventloop.rst:1101 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1100 +#: ../../library/asyncio-eventloop.rst:1104 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1102 +#: ../../library/asyncio-eventloop.rst:1106 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1105 +#: ../../library/asyncio-eventloop.rst:1109 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1114 +#: ../../library/asyncio-eventloop.rst:1118 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1118 +#: ../../library/asyncio-eventloop.rst:1122 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1127 +#: ../../library/asyncio-eventloop.rst:1131 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1132 +#: ../../library/asyncio-eventloop.rst:1136 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1136 +#: ../../library/asyncio-eventloop.rst:1140 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1138 +#: ../../library/asyncio-eventloop.rst:1142 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1433,67 +1435,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:1146 +#: ../../library/asyncio-eventloop.rst:1150 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:1150 +#: ../../library/asyncio-eventloop.rst:1154 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1155 +#: ../../library/asyncio-eventloop.rst:1159 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1157 +#: ../../library/asyncio-eventloop.rst:1161 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1161 -#: ../../library/asyncio-eventloop.rst:1177 +#: ../../library/asyncio-eventloop.rst:1165 +#: ../../library/asyncio-eventloop.rst:1181 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1166 +#: ../../library/asyncio-eventloop.rst:1170 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1171 +#: ../../library/asyncio-eventloop.rst:1175 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1173 +#: ../../library/asyncio-eventloop.rst:1177 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1182 +#: ../../library/asyncio-eventloop.rst:1186 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1187 +#: ../../library/asyncio-eventloop.rst:1191 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1192 +#: ../../library/asyncio-eventloop.rst:1196 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1196 +#: ../../library/asyncio-eventloop.rst:1202 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1198 +#: ../../library/asyncio-eventloop.rst:1204 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1501,46 +1503,46 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1203 +#: ../../library/asyncio-eventloop.rst:1209 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1209 +#: ../../library/asyncio-eventloop.rst:1215 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1214 +#: ../../library/asyncio-eventloop.rst:1220 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1216 +#: ../../library/asyncio-eventloop.rst:1222 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1223 +#: ../../library/asyncio-eventloop.rst:1229 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1227 +#: ../../library/asyncio-eventloop.rst:1233 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1231 +#: ../../library/asyncio-eventloop.rst:1237 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1233 +#: ../../library/asyncio-eventloop.rst:1239 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1278 +#: ../../library/asyncio-eventloop.rst:1284 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1548,17 +1550,17 @@ msgid "" "importing of main module `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1283 +#: ../../library/asyncio-eventloop.rst:1289 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1285 +#: ../../library/asyncio-eventloop.rst:1291 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1288 +#: ../../library/asyncio-eventloop.rst:1294 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1566,32 +1568,32 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1297 +#: ../../library/asyncio-eventloop.rst:1303 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1301 +#: ../../library/asyncio-eventloop.rst:1307 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1307 +#: ../../library/asyncio-eventloop.rst:1313 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1309 +#: ../../library/asyncio-eventloop.rst:1315 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1313 +#: ../../library/asyncio-eventloop.rst:1319 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1315 +#: ../../library/asyncio-eventloop.rst:1321 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1600,171 +1602,182 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1323 +#: ../../library/asyncio-eventloop.rst:1329 msgid "" "If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" "`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " "task or callback handle." msgstr "" -#: ../../library/asyncio-eventloop.rst:1329 +#: ../../library/asyncio-eventloop.rst:1335 msgid "" "The handler may be called in the :class:`~contextvars.Context` of the task " "or handle where the exception originated." msgstr "" -#: ../../library/asyncio-eventloop.rst:1334 +#: ../../library/asyncio-eventloop.rst:1340 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1341 +#: ../../library/asyncio-eventloop.rst:1347 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1343 +#: ../../library/asyncio-eventloop.rst:1349 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1347 +#: ../../library/asyncio-eventloop.rst:1353 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1352 +#: ../../library/asyncio-eventloop.rst:1358 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1354 +#: ../../library/asyncio-eventloop.rst:1360 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1357 +#: ../../library/asyncio-eventloop.rst:1363 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1358 +#: ../../library/asyncio-eventloop.rst:1364 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1359 +#: ../../library/asyncio-eventloop.rst:1365 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1360 +#: ../../library/asyncio-eventloop.rst:1366 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1361 +#: ../../library/asyncio-eventloop.rst:1367 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1362 +#: ../../library/asyncio-eventloop.rst:1368 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1363 +#: ../../library/asyncio-eventloop.rst:1369 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1364 +#: ../../library/asyncio-eventloop.rst:1370 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1366 +#: ../../library/asyncio-eventloop.rst:1372 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1366 +#: ../../library/asyncio-eventloop.rst:1372 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1370 +#: ../../library/asyncio-eventloop.rst:1376 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1375 +#: ../../library/asyncio-eventloop.rst:1381 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1379 +#: ../../library/asyncio-eventloop.rst:1385 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1381 +#: ../../library/asyncio-eventloop.rst:1387 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1387 +#: ../../library/asyncio-eventloop.rst:1393 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1391 +#: ../../library/asyncio-eventloop.rst:1397 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1396 +#: ../../library/asyncio-eventloop.rst:1402 +msgid "" +"This attribute can be used to set the minimum execution duration in seconds " +"that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " +"are logged." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1406 +msgid "Default value is 100 milliseconds." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1410 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1400 +#: ../../library/asyncio-eventloop.rst:1414 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1402 +#: ../../library/asyncio-eventloop.rst:1416 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1409 +#: ../../library/asyncio-eventloop.rst:1423 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1418 +#: ../../library/asyncio-eventloop.rst:1434 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1421 +#: ../../library/asyncio-eventloop.rst:1437 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1423 +#: ../../library/asyncio-eventloop.rst:1439 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1424 +#: ../../library/asyncio-eventloop.rst:1440 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1427 +#: ../../library/asyncio-eventloop.rst:1443 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1431 +#: ../../library/asyncio-eventloop.rst:1447 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1772,85 +1785,85 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1437 +#: ../../library/asyncio-eventloop.rst:1453 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1440 +#: ../../library/asyncio-eventloop.rst:1456 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1442 +#: ../../library/asyncio-eventloop.rst:1458 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1444 -#: ../../library/asyncio-eventloop.rst:1455 -#: ../../library/asyncio-eventloop.rst:1465 +#: ../../library/asyncio-eventloop.rst:1460 +#: ../../library/asyncio-eventloop.rst:1471 +#: ../../library/asyncio-eventloop.rst:1481 msgid "a file-like object" msgstr "" -#: ../../library/asyncio-eventloop.rst:1445 +#: ../../library/asyncio-eventloop.rst:1461 msgid "" "an existing file descriptor (a positive integer), for example those created " "with :meth:`os.pipe()`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1446 -#: ../../library/asyncio-eventloop.rst:1456 -#: ../../library/asyncio-eventloop.rst:1466 +#: ../../library/asyncio-eventloop.rst:1462 +#: ../../library/asyncio-eventloop.rst:1472 +#: ../../library/asyncio-eventloop.rst:1482 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1448 -#: ../../library/asyncio-eventloop.rst:1458 -#: ../../library/asyncio-eventloop.rst:1468 +#: ../../library/asyncio-eventloop.rst:1464 +#: ../../library/asyncio-eventloop.rst:1474 +#: ../../library/asyncio-eventloop.rst:1484 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1450 -#: ../../library/asyncio-eventloop.rst:1460 -#: ../../library/asyncio-eventloop.rst:1470 +#: ../../library/asyncio-eventloop.rst:1466 +#: ../../library/asyncio-eventloop.rst:1476 +#: ../../library/asyncio-eventloop.rst:1486 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1453 +#: ../../library/asyncio-eventloop.rst:1469 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1463 +#: ../../library/asyncio-eventloop.rst:1479 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1472 +#: ../../library/asyncio-eventloop.rst:1488 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1475 +#: ../../library/asyncio-eventloop.rst:1491 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1480 +#: ../../library/asyncio-eventloop.rst:1496 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1484 +#: ../../library/asyncio-eventloop.rst:1500 msgid "" "If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " "pipe, then the other side of this pipe should be registered with :meth:" @@ -1858,52 +1871,52 @@ msgid "" "the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1489 +#: ../../library/asyncio-eventloop.rst:1505 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1492 +#: ../../library/asyncio-eventloop.rst:1508 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1500 +#: ../../library/asyncio-eventloop.rst:1516 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1505 +#: ../../library/asyncio-eventloop.rst:1521 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1508 +#: ../../library/asyncio-eventloop.rst:1524 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1511 +#: ../../library/asyncio-eventloop.rst:1527 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1514 +#: ../../library/asyncio-eventloop.rst:1530 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1519 +#: ../../library/asyncio-eventloop.rst:1535 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1913,116 +1926,116 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1528 +#: ../../library/asyncio-eventloop.rst:1544 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1532 +#: ../../library/asyncio-eventloop.rst:1548 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1537 +#: ../../library/asyncio-eventloop.rst:1553 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "" -#: ../../library/asyncio-eventloop.rst:1544 +#: ../../library/asyncio-eventloop.rst:1560 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1549 +#: ../../library/asyncio-eventloop.rst:1565 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1555 +#: ../../library/asyncio-eventloop.rst:1571 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1558 +#: ../../library/asyncio-eventloop.rst:1574 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1562 +#: ../../library/asyncio-eventloop.rst:1578 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1564 +#: ../../library/asyncio-eventloop.rst:1580 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1571 +#: ../../library/asyncio-eventloop.rst:1587 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1573 +#: ../../library/asyncio-eventloop.rst:1589 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1577 +#: ../../library/asyncio-eventloop.rst:1593 msgid "Do not instantiate the :class:`Server` class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1581 +#: ../../library/asyncio-eventloop.rst:1597 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1594 +#: ../../library/asyncio-eventloop.rst:1610 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1597 +#: ../../library/asyncio-eventloop.rst:1613 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" -#: ../../library/asyncio-eventloop.rst:1602 +#: ../../library/asyncio-eventloop.rst:1618 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1605 +#: ../../library/asyncio-eventloop.rst:1621 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1608 +#: ../../library/asyncio-eventloop.rst:1624 msgid "" -"The server is closed asynchronously, use the :meth:`wait_closed` coroutine " -"to wait until the server is closed." +"The server is closed asynchronously; use the :meth:`wait_closed` coroutine " +"to wait until the server is closed (and no more connections are active)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1613 +#: ../../library/asyncio-eventloop.rst:1630 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1619 +#: ../../library/asyncio-eventloop.rst:1636 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1621 +#: ../../library/asyncio-eventloop.rst:1638 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1624 +#: ../../library/asyncio-eventloop.rst:1641 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -2031,98 +2044,100 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1635 +#: ../../library/asyncio-eventloop.rst:1652 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1639 +#: ../../library/asyncio-eventloop.rst:1656 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1661 +#: ../../library/asyncio-eventloop.rst:1678 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1667 -msgid "Wait until the :meth:`close` method completes." +#: ../../library/asyncio-eventloop.rst:1684 +msgid "" +"Wait until the :meth:`close` method completes and all active connections " +"have finished." msgstr "" -#: ../../library/asyncio-eventloop.rst:1671 +#: ../../library/asyncio-eventloop.rst:1689 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1674 +#: ../../library/asyncio-eventloop.rst:1692 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1684 +#: ../../library/asyncio-eventloop.rst:1702 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1686 +#: ../../library/asyncio-eventloop.rst:1704 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1689 +#: ../../library/asyncio-eventloop.rst:1707 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1695 +#: ../../library/asyncio-eventloop.rst:1713 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1697 +#: ../../library/asyncio-eventloop.rst:1715 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1712 +#: ../../library/asyncio-eventloop.rst:1730 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1717 +#: ../../library/asyncio-eventloop.rst:1735 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1719 +#: ../../library/asyncio-eventloop.rst:1737 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1723 +#: ../../library/asyncio-eventloop.rst:1741 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1729 +#: ../../library/asyncio-eventloop.rst:1747 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1731 +#: ../../library/asyncio-eventloop.rst:1749 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1737 +#: ../../library/asyncio-eventloop.rst:1755 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1739 +#: ../../library/asyncio-eventloop.rst:1757 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2130,71 +2145,71 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1749 +#: ../../library/asyncio-eventloop.rst:1767 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1751 +#: ../../library/asyncio-eventloop.rst:1769 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1775 +#: ../../library/asyncio-eventloop.rst:1793 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1782 +#: ../../library/asyncio-eventloop.rst:1800 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1784 +#: ../../library/asyncio-eventloop.rst:1802 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1812 +#: ../../library/asyncio-eventloop.rst:1830 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1819 +#: ../../library/asyncio-eventloop.rst:1837 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1821 +#: ../../library/asyncio-eventloop.rst:1839 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1859 +#: ../../library/asyncio-eventloop.rst:1877 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1863 +#: ../../library/asyncio-eventloop.rst:1881 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1871 +#: ../../library/asyncio-eventloop.rst:1889 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1873 +#: ../../library/asyncio-eventloop.rst:1891 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1875 +#: ../../library/asyncio-eventloop.rst:1893 msgid "" -"Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " -"the :meth:`loop.add_signal_handler` method::" +"Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." +"SIGTERM` using the :meth:`loop.add_signal_handler` method::" msgstr "" diff --git a/library/asyncio.po b/library/asyncio.po index c05bfecad4..8aaf1d8947 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-25 00:03+0000\n" "PO-Revision-Date: 2021-11-23 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -102,14 +102,14 @@ msgstr "" #: ../../library/asyncio.rst:48 msgid "" "create and manage :ref:`event loops `, which provide " -"asynchronous APIs for :meth:`networking `, running :meth:" -"`subprocesses `, handling :meth:`OS signals `, etc;" +"asynchronous APIs for :ref:`networking `, running :ref:" +"`subprocesses `, handling :ref:`OS signals " +"`, etc;" msgstr "" "建立與管理 :ref:`event loops(事件迴圈) `,它提供了能被" -"用於\\ :meth:`網路 `\\ 、執行\\ :meth:`子行程 `、處理\\ :meth:`作業系統訊號 `\\ 等" -"任務的非同步 API;" +"用於\\ :ref:`網路 `、執行\\ :ref:`子行程 " +"`、處理\\ :ref:`作業系統訊號 " +"`\\ 等任務的非同步 API;" #: ../../library/asyncio.rst:53 msgid "" diff --git a/library/bz2.po b/library/bz2.po index e031a1d32b..8fe1ff50cc 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,11 +99,11 @@ msgid "" "handling behavior, and line ending(s)." msgstr "" -#: ../../library/bz2.rst:59 ../../library/bz2.rst:125 +#: ../../library/bz2.rst:59 ../../library/bz2.rst:163 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: ../../library/bz2.rst:62 ../../library/bz2.rst:132 +#: ../../library/bz2.rst:62 ../../library/bz2.rst:170 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -153,7 +153,7 @@ msgid "" msgstr "" #: ../../library/bz2.rst:94 -msgid ":class:`BZ2File` also provides the following method:" +msgid ":class:`BZ2File` also provides the following methods:" msgstr "" #: ../../library/bz2.rst:98 @@ -171,99 +171,128 @@ msgid "" "*filename*)." msgstr "" -#: ../../library/bz2.rst:110 -msgid "Support for the :keyword:`with` statement was added." +#: ../../library/bz2.rst:111 +msgid "Return the file descriptor for the underlying file." +msgstr "" + +#: ../../library/bz2.rst:117 +msgid "Return whether the file was opened for reading." +msgstr "" + +#: ../../library/bz2.rst:123 +msgid "Return whether the file supports seeking." +msgstr "" + +#: ../../library/bz2.rst:129 +msgid "Return whether the file was opened for writing." msgstr "" -#: ../../library/bz2.rst:113 +#: ../../library/bz2.rst:135 msgid "" -"The :meth:`fileno`, :meth:`readable`, :meth:`seekable`, :meth:`writable`, :" -"meth:`read1` and :meth:`readinto` methods were added." +"Read up to *size* uncompressed bytes, while trying to avoid making multiple " +"reads from the underlying stream. Reads up to a buffer's worth of data if " +"size is negative." msgstr "" -#: ../../library/bz2.rst:117 +#: ../../library/bz2.rst:139 +msgid "Returns ``b''`` if the file is at EOF." +msgstr "" + +#: ../../library/bz2.rst:145 +msgid "Read bytes into *b*." +msgstr "" + +#: ../../library/bz2.rst:147 +msgid "Returns the number of bytes read (0 for EOF)." +msgstr "" + +#: ../../library/bz2.rst:152 +msgid "Support for the :keyword:`with` statement was added." +msgstr "" + +#: ../../library/bz2.rst:155 msgid "" "Support was added for *filename* being a :term:`file object` instead of an " "actual filename." msgstr "" -#: ../../library/bz2.rst:121 +#: ../../library/bz2.rst:159 msgid "" "The ``'a'`` (append) mode was added, along with support for reading multi-" "stream files." msgstr "" -#: ../../library/bz2.rst:128 +#: ../../library/bz2.rst:166 msgid "" "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " "``None``." msgstr "" -#: ../../library/bz2.rst:135 +#: ../../library/bz2.rst:173 msgid "" "The *buffering* parameter has been removed. It was ignored and deprecated " "since Python 3.0. Pass an open file object to control how the file is opened." msgstr "" -#: ../../library/bz2.rst:140 +#: ../../library/bz2.rst:178 msgid "The *compresslevel* parameter became keyword-only." msgstr "" -#: ../../library/bz2.rst:142 +#: ../../library/bz2.rst:180 msgid "" "This class is thread unsafe in the face of multiple simultaneous readers or " "writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` " "have always been." msgstr "" -#: ../../library/bz2.rst:149 +#: ../../library/bz2.rst:187 msgid "Incremental (de)compression" msgstr "" -#: ../../library/bz2.rst:153 +#: ../../library/bz2.rst:191 msgid "" "Create a new compressor object. This object may be used to compress data " "incrementally. For one-shot compression, use the :func:`compress` function " "instead." msgstr "" -#: ../../library/bz2.rst:157 ../../library/bz2.rst:245 +#: ../../library/bz2.rst:195 ../../library/bz2.rst:283 msgid "" "*compresslevel*, if given, must be an integer between ``1`` and ``9``. The " "default is ``9``." msgstr "" -#: ../../library/bz2.rst:162 +#: ../../library/bz2.rst:200 msgid "" "Provide data to the compressor object. Returns a chunk of compressed data if " "possible, or an empty byte string otherwise." msgstr "" -#: ../../library/bz2.rst:165 +#: ../../library/bz2.rst:203 msgid "" "When you have finished providing data to the compressor, call the :meth:" "`flush` method to finish the compression process." msgstr "" -#: ../../library/bz2.rst:171 +#: ../../library/bz2.rst:209 msgid "" "Finish the compression process. Returns the compressed data left in internal " "buffers." msgstr "" -#: ../../library/bz2.rst:174 +#: ../../library/bz2.rst:212 msgid "" "The compressor object may not be used after this method has been called." msgstr "" -#: ../../library/bz2.rst:179 +#: ../../library/bz2.rst:217 msgid "" "Create a new decompressor object. This object may be used to decompress data " "incrementally. For one-shot compression, use the :func:`decompress` function " "instead." msgstr "" -#: ../../library/bz2.rst:184 +#: ../../library/bz2.rst:222 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you " @@ -271,7 +300,7 @@ msgid "" "must use a new decompressor for each stream." msgstr "" -#: ../../library/bz2.rst:191 +#: ../../library/bz2.rst:229 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -279,7 +308,7 @@ msgid "" "output of any previous calls to :meth:`decompress`." msgstr "" -#: ../../library/bz2.rst:197 +#: ../../library/bz2.rst:235 msgid "" "If *max_length* is nonnegative, returns at most *max_length* bytes of " "decompressed data. If this limit is reached and further output can be " @@ -288,99 +317,99 @@ msgid "" "``b''`` to obtain more of the output." msgstr "" -#: ../../library/bz2.rst:204 +#: ../../library/bz2.rst:242 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -#: ../../library/bz2.rst:209 +#: ../../library/bz2.rst:247 msgid "" "Attempting to decompress data after the end of stream is reached raises an :" "exc:`EOFError`. Any data found after the end of the stream is ignored and " "saved in the :attr:`~.unused_data` attribute." msgstr "" -#: ../../library/bz2.rst:213 +#: ../../library/bz2.rst:251 msgid "Added the *max_length* parameter." msgstr "新增 *max_length* 參數。" -#: ../../library/bz2.rst:218 +#: ../../library/bz2.rst:256 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" -#: ../../library/bz2.rst:225 +#: ../../library/bz2.rst:263 msgid "Data found after the end of the compressed stream." msgstr "" -#: ../../library/bz2.rst:227 +#: ../../library/bz2.rst:265 msgid "" "If this attribute is accessed before the end of the stream has been reached, " "its value will be ``b''``." msgstr "" -#: ../../library/bz2.rst:232 +#: ../../library/bz2.rst:270 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new uncompressed input." msgstr "" -#: ../../library/bz2.rst:239 +#: ../../library/bz2.rst:277 msgid "One-shot (de)compression" msgstr "" -#: ../../library/bz2.rst:243 +#: ../../library/bz2.rst:281 msgid "Compress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:248 +#: ../../library/bz2.rst:286 msgid "For incremental compression, use a :class:`BZ2Compressor` instead." msgstr "" -#: ../../library/bz2.rst:253 +#: ../../library/bz2.rst:291 msgid "Decompress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:255 +#: ../../library/bz2.rst:293 msgid "" "If *data* is the concatenation of multiple compressed streams, decompress " "all of the streams." msgstr "" -#: ../../library/bz2.rst:258 +#: ../../library/bz2.rst:296 msgid "For incremental decompression, use a :class:`BZ2Decompressor` instead." msgstr "" -#: ../../library/bz2.rst:260 +#: ../../library/bz2.rst:298 msgid "Support for multi-stream inputs was added." msgstr "" -#: ../../library/bz2.rst:266 +#: ../../library/bz2.rst:304 msgid "Examples of usage" msgstr "用法範例" -#: ../../library/bz2.rst:268 +#: ../../library/bz2.rst:306 msgid "Below are some examples of typical usage of the :mod:`bz2` module." msgstr "" -#: ../../library/bz2.rst:270 +#: ../../library/bz2.rst:308 msgid "" "Using :func:`compress` and :func:`decompress` to demonstrate round-trip " "compression:" msgstr "" -#: ../../library/bz2.rst:288 +#: ../../library/bz2.rst:326 msgid "Using :class:`BZ2Compressor` for incremental compression:" msgstr "" -#: ../../library/bz2.rst:306 +#: ../../library/bz2.rst:344 msgid "" "The example above uses a very \"nonrandom\" stream of data (a stream of " "``b\"z\"`` chunks). Random data tends to compress poorly, while ordered, " "repetitive data usually yields a high compression ratio." msgstr "" -#: ../../library/bz2.rst:310 +#: ../../library/bz2.rst:348 msgid "Writing and reading a bzip2-compressed file in binary mode:" msgstr "" diff --git a/library/codecs.po b/library/codecs.po index c619a48de8..2ff557ff55 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-21 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -369,8 +369,8 @@ msgid "Value" msgstr "" #: ../../library/codecs.rst:330 ../../library/codecs.rst:373 -#: ../../library/codecs.rst:393 ../../library/codecs.rst:1327 -#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 +#: ../../library/codecs.rst:393 ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1398 ../../library/codecs.rst:1455 msgid "Meaning" msgstr "" @@ -637,7 +637,7 @@ msgid "" "function interfaces of the stateless encoder and decoder:" msgstr "" -#: ../../library/codecs.rst:525 +#: ../../library/codecs.rst:527 msgid "" "Encodes the object *input* and returns a tuple (output object, length " "consumed). For instance, :term:`text encoding` converts a string object to a " @@ -645,26 +645,26 @@ msgid "" "``iso-8859-1``)." msgstr "" -#: ../../library/codecs.rst:530 ../../library/codecs.rst:552 +#: ../../library/codecs.rst:532 ../../library/codecs.rst:554 msgid "" "The *errors* argument defines the error handling to apply. It defaults to " "``'strict'`` handling." msgstr "" -#: ../../library/codecs.rst:533 +#: ../../library/codecs.rst:535 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamWriter` for codecs which have to keep state in order to make encoding " "efficient." msgstr "" -#: ../../library/codecs.rst:537 +#: ../../library/codecs.rst:539 msgid "" "The encoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:543 +#: ../../library/codecs.rst:545 msgid "" "Decodes the object *input* and returns a tuple (output object, length " "consumed). For instance, for a :term:`text encoding`, decoding converts a " @@ -672,31 +672,31 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:548 +#: ../../library/codecs.rst:550 msgid "" "For text encodings and bytes-to-bytes codecs, *input* must be a bytes object " "or one which provides the read-only buffer interface -- for example, buffer " "objects and memory mapped files." msgstr "" -#: ../../library/codecs.rst:555 +#: ../../library/codecs.rst:557 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamReader` for codecs which have to keep state in order to make decoding " "efficient." msgstr "" -#: ../../library/codecs.rst:559 +#: ../../library/codecs.rst:561 msgid "" "The decoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:564 +#: ../../library/codecs.rst:566 msgid "Incremental Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:566 +#: ../../library/codecs.rst:568 msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" @@ -707,7 +707,7 @@ msgid "" "during method calls." msgstr "" -#: ../../library/codecs.rst:574 +#: ../../library/codecs.rst:576 msgid "" "The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" "`~IncrementalDecoder.decode` method is the same as if all the single inputs " @@ -715,36 +715,36 @@ msgid "" "encoder/decoder." msgstr "" -#: ../../library/codecs.rst:583 +#: ../../library/codecs.rst:585 msgid "IncrementalEncoder Objects" msgstr "IncrementalEncoder 物件" -#: ../../library/codecs.rst:585 +#: ../../library/codecs.rst:587 msgid "" "The :class:`IncrementalEncoder` class is used for encoding an input in " "multiple steps. It defines the following methods which every incremental " "encoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:592 +#: ../../library/codecs.rst:594 msgid "Constructor for an :class:`IncrementalEncoder` instance." msgstr "" -#: ../../library/codecs.rst:594 +#: ../../library/codecs.rst:596 msgid "" "All incremental encoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:598 +#: ../../library/codecs.rst:600 msgid "" "The :class:`IncrementalEncoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:602 +#: ../../library/codecs.rst:604 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -752,21 +752,21 @@ msgid "" "`IncrementalEncoder` object." msgstr "" -#: ../../library/codecs.rst:610 +#: ../../library/codecs.rst:612 msgid "" "Encodes *object* (taking the current state of the encoder into account) and " "returns the resulting encoded object. If this is the last call to :meth:" "`encode` *final* must be true (the default is false)." msgstr "" -#: ../../library/codecs.rst:617 +#: ../../library/codecs.rst:619 msgid "" "Reset the encoder to the initial state. The output is discarded: call ``." "encode(object, final=True)``, passing an empty byte or text string if " "necessary, to reset the encoder and to get the output." msgstr "" -#: ../../library/codecs.rst:624 +#: ../../library/codecs.rst:626 msgid "" "Return the current state of the encoder which must be an integer. The " "implementation should make sure that ``0`` is the most common state. (States " @@ -775,42 +775,42 @@ msgid "" "into an integer.)" msgstr "" -#: ../../library/codecs.rst:633 +#: ../../library/codecs.rst:635 msgid "" "Set the state of the encoder to *state*. *state* must be an encoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:640 +#: ../../library/codecs.rst:642 msgid "IncrementalDecoder Objects" msgstr "IncrementalDecoder 物件" -#: ../../library/codecs.rst:642 +#: ../../library/codecs.rst:644 msgid "" "The :class:`IncrementalDecoder` class is used for decoding an input in " "multiple steps. It defines the following methods which every incremental " "decoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:649 +#: ../../library/codecs.rst:651 msgid "Constructor for an :class:`IncrementalDecoder` instance." msgstr "" -#: ../../library/codecs.rst:651 +#: ../../library/codecs.rst:653 msgid "" "All incremental decoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:655 +#: ../../library/codecs.rst:657 msgid "" "The :class:`IncrementalDecoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:659 +#: ../../library/codecs.rst:661 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -818,7 +818,7 @@ msgid "" "`IncrementalDecoder` object." msgstr "" -#: ../../library/codecs.rst:667 +#: ../../library/codecs.rst:669 msgid "" "Decodes *object* (taking the current state of the decoder into account) and " "returns the resulting decoded object. If this is the last call to :meth:" @@ -829,11 +829,11 @@ msgid "" "(which might raise an exception)." msgstr "" -#: ../../library/codecs.rst:678 +#: ../../library/codecs.rst:680 msgid "Reset the decoder to the initial state." msgstr "" -#: ../../library/codecs.rst:683 +#: ../../library/codecs.rst:685 msgid "" "Return the current state of the decoder. This must be a tuple with two " "items, the first must be the buffer containing the still undecoded input. " @@ -848,59 +848,59 @@ msgid "" "bytes of the resulting string into an integer.)" msgstr "" -#: ../../library/codecs.rst:698 +#: ../../library/codecs.rst:700 msgid "" "Set the state of the decoder to *state*. *state* must be a decoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:703 +#: ../../library/codecs.rst:705 msgid "Stream Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:706 +#: ../../library/codecs.rst:708 msgid "" "The :class:`StreamWriter` and :class:`StreamReader` classes provide generic " "working interfaces which can be used to implement new encoding submodules " -"very easily. See :mod:`encodings.utf_8` for an example of how this is done." +"very easily. See :mod:`!encodings.utf_8` for an example of how this is done." msgstr "" -#: ../../library/codecs.rst:714 +#: ../../library/codecs.rst:716 msgid "StreamWriter Objects" msgstr "StreamWriter 物件" -#: ../../library/codecs.rst:716 +#: ../../library/codecs.rst:718 msgid "" "The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines " "the following methods which every stream writer must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:723 +#: ../../library/codecs.rst:725 msgid "Constructor for a :class:`StreamWriter` instance." msgstr "" -#: ../../library/codecs.rst:725 +#: ../../library/codecs.rst:727 msgid "" "All stream writers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:729 +#: ../../library/codecs.rst:731 msgid "" "The *stream* argument must be a file-like object open for writing text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:732 +#: ../../library/codecs.rst:734 msgid "" "The :class:`StreamWriter` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:736 +#: ../../library/codecs.rst:738 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -908,70 +908,70 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:742 +#: ../../library/codecs.rst:744 msgid "Writes the object's contents encoded to the stream." msgstr "" -#: ../../library/codecs.rst:747 +#: ../../library/codecs.rst:749 msgid "" "Writes the concatenated iterable of strings to the stream (possibly by " "reusing the :meth:`write` method). Infinite or very large iterables are not " "supported. The standard bytes-to-bytes codecs do not support this method." msgstr "" -#: ../../library/codecs.rst:755 ../../library/codecs.rst:850 +#: ../../library/codecs.rst:757 ../../library/codecs.rst:852 msgid "Resets the codec buffers used for keeping internal state." msgstr "" -#: ../../library/codecs.rst:757 +#: ../../library/codecs.rst:759 msgid "" "Calling this method should ensure that the data on the output is put into a " "clean state that allows appending of new fresh data without having to rescan " "the whole stream to recover state." msgstr "" -#: ../../library/codecs.rst:762 +#: ../../library/codecs.rst:764 msgid "" "In addition to the above methods, the :class:`StreamWriter` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:769 +#: ../../library/codecs.rst:771 msgid "StreamReader Objects" msgstr "StreamReader 物件" -#: ../../library/codecs.rst:771 +#: ../../library/codecs.rst:773 msgid "" "The :class:`StreamReader` class is a subclass of :class:`Codec` and defines " "the following methods which every stream reader must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:778 +#: ../../library/codecs.rst:780 msgid "Constructor for a :class:`StreamReader` instance." msgstr "" -#: ../../library/codecs.rst:780 +#: ../../library/codecs.rst:782 msgid "" "All stream readers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:784 +#: ../../library/codecs.rst:786 msgid "" "The *stream* argument must be a file-like object open for reading text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:787 +#: ../../library/codecs.rst:789 msgid "" "The :class:`StreamReader` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:791 +#: ../../library/codecs.rst:793 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -979,24 +979,24 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:795 +#: ../../library/codecs.rst:797 msgid "" "The set of allowed values for the *errors* argument can be extended with :" "func:`register_error`." msgstr "" -#: ../../library/codecs.rst:801 +#: ../../library/codecs.rst:803 msgid "Decodes data from the stream and returns the resulting object." msgstr "" -#: ../../library/codecs.rst:803 +#: ../../library/codecs.rst:805 msgid "" "The *chars* argument indicates the number of decoded code points or bytes to " "return. The :func:`read` method will never return more data than requested, " "but it might return less, if there is not enough available." msgstr "" -#: ../../library/codecs.rst:808 +#: ../../library/codecs.rst:810 msgid "" "The *size* argument indicates the approximate maximum number of encoded " "bytes or code points to read for decoding. The decoder can modify this " @@ -1005,13 +1005,13 @@ msgid "" "huge files in one step." msgstr "" -#: ../../library/codecs.rst:815 +#: ../../library/codecs.rst:817 msgid "" "The *firstline* flag indicates that it would be sufficient to only return " "the first line, if there are decoding errors on later lines." msgstr "" -#: ../../library/codecs.rst:819 +#: ../../library/codecs.rst:821 msgid "" "The method should use a greedy read strategy meaning that it should read as " "much data as is allowed within the definition of the encoding and the given " @@ -1019,68 +1019,68 @@ msgid "" "the stream, these should be read too." msgstr "" -#: ../../library/codecs.rst:827 +#: ../../library/codecs.rst:829 msgid "Read one line from the input stream and return the decoded data." msgstr "" -#: ../../library/codecs.rst:829 +#: ../../library/codecs.rst:831 msgid "" "*size*, if given, is passed as size argument to the stream's :meth:`read` " "method." msgstr "" -#: ../../library/codecs.rst:832 +#: ../../library/codecs.rst:834 msgid "" "If *keepends* is false line-endings will be stripped from the lines returned." msgstr "" -#: ../../library/codecs.rst:838 +#: ../../library/codecs.rst:840 msgid "" "Read all lines available on the input stream and return them as a list of " "lines." msgstr "" -#: ../../library/codecs.rst:841 +#: ../../library/codecs.rst:843 msgid "" "Line-endings are implemented using the codec's :meth:`decode` method and are " "included in the list entries if *keepends* is true." msgstr "" -#: ../../library/codecs.rst:844 +#: ../../library/codecs.rst:846 msgid "" "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" "`read` method." msgstr "" -#: ../../library/codecs.rst:852 +#: ../../library/codecs.rst:854 msgid "" "Note that no stream repositioning should take place. This method is " "primarily intended to be able to recover from decoding errors." msgstr "" -#: ../../library/codecs.rst:856 +#: ../../library/codecs.rst:858 msgid "" "In addition to the above methods, the :class:`StreamReader` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:862 +#: ../../library/codecs.rst:864 msgid "StreamReaderWriter Objects" msgstr "StreamReaderWriter 物件" -#: ../../library/codecs.rst:864 +#: ../../library/codecs.rst:866 msgid "" "The :class:`StreamReaderWriter` is a convenience class that allows wrapping " "streams which work in both read and write modes." msgstr "" -#: ../../library/codecs.rst:867 ../../library/codecs.rst:891 +#: ../../library/codecs.rst:869 ../../library/codecs.rst:893 msgid "" "The design is such that one can use the factory functions returned by the :" "func:`lookup` function to construct the instance." msgstr "" -#: ../../library/codecs.rst:873 +#: ../../library/codecs.rst:875 msgid "" "Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like " "object. *Reader* and *Writer* must be factory functions or classes providing " @@ -1089,42 +1089,42 @@ msgid "" "writers." msgstr "" -#: ../../library/codecs.rst:878 +#: ../../library/codecs.rst:880 msgid "" ":class:`StreamReaderWriter` instances define the combined interfaces of :" "class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " "other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:886 +#: ../../library/codecs.rst:888 msgid "StreamRecoder Objects" msgstr "StreamRecoder 物件" -#: ../../library/codecs.rst:888 +#: ../../library/codecs.rst:890 msgid "" "The :class:`StreamRecoder` translates data from one encoding to another, " "which is sometimes useful when dealing with different encoding environments." msgstr "" -#: ../../library/codecs.rst:897 +#: ../../library/codecs.rst:899 msgid "" "Creates a :class:`StreamRecoder` instance which implements a two-way " -"conversion: *encode* and *decode* work on the frontend — the data visible to " -"code calling :meth:`read` and :meth:`write`, while *Reader* and *Writer* " -"work on the backend — the data in *stream*." +"conversion: *encode* and *decode* work on the frontend — the data visible to " +"code calling :meth:`~StreamReader.read` and :meth:`~StreamWriter.write`, " +"while *Reader* and *Writer* work on the backend — the data in *stream*." msgstr "" -#: ../../library/codecs.rst:902 +#: ../../library/codecs.rst:905 msgid "" "You can use these objects to do transparent transcodings, e.g., from Latin-1 " "to UTF-8 and back." msgstr "" -#: ../../library/codecs.rst:905 +#: ../../library/codecs.rst:908 msgid "The *stream* argument must be a file-like object." msgstr "" -#: ../../library/codecs.rst:907 +#: ../../library/codecs.rst:910 msgid "" "The *encode* and *decode* arguments must adhere to the :class:`Codec` " "interface. *Reader* and *Writer* must be factory functions or classes " @@ -1132,24 +1132,24 @@ msgid "" "interface respectively." msgstr "" -#: ../../library/codecs.rst:912 +#: ../../library/codecs.rst:915 msgid "" "Error handling is done in the same way as defined for the stream readers and " "writers." msgstr "" -#: ../../library/codecs.rst:916 +#: ../../library/codecs.rst:919 msgid "" ":class:`StreamRecoder` instances define the combined interfaces of :class:" "`StreamReader` and :class:`StreamWriter` classes. They inherit all other " "methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:924 +#: ../../library/codecs.rst:927 msgid "Encodings and Unicode" msgstr "" -#: ../../library/codecs.rst:926 +#: ../../library/codecs.rst:929 msgid "" "Strings are stored internally as sequences of code points in range " "``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " @@ -1161,7 +1161,7 @@ msgid "" "which are collectivity referred to as :term:`text encodings `." msgstr "" -#: ../../library/codecs.rst:936 +#: ../../library/codecs.rst:939 msgid "" "The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps " "the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a " @@ -1172,7 +1172,7 @@ msgid "" "position 3: ordinal not in range(256)``." msgstr "" -#: ../../library/codecs.rst:944 +#: ../../library/codecs.rst:947 msgid "" "There's another group of encodings (the so called charmap encodings) that " "choose a different subset of all Unicode code points and how these code " @@ -1182,7 +1182,7 @@ msgid "" "that shows you which character is mapped to which byte value." msgstr "" -#: ../../library/codecs.rst:951 +#: ../../library/codecs.rst:954 msgid "" "All of these encodings can only encode 256 of the 1114112 code points " "defined in Unicode. A simple and straightforward way that can store each " @@ -1212,7 +1212,7 @@ msgid "" "normal character that will be decoded like any other." msgstr "" -#: ../../library/codecs.rst:977 +#: ../../library/codecs.rst:980 msgid "" "There's another encoding that is able to encode the full range of Unicode " "characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " @@ -1223,59 +1223,59 @@ msgid "" "which when concatenated give the Unicode character):" msgstr "" -#: ../../library/codecs.rst:986 +#: ../../library/codecs.rst:989 msgid "Range" msgstr "" -#: ../../library/codecs.rst:986 +#: ../../library/codecs.rst:989 msgid "Encoding" msgstr "" -#: ../../library/codecs.rst:988 +#: ../../library/codecs.rst:991 msgid "``U-00000000`` ... ``U-0000007F``" msgstr "``U-00000000`` ... ``U-0000007F``" -#: ../../library/codecs.rst:988 +#: ../../library/codecs.rst:991 msgid "0xxxxxxx" msgstr "0xxxxxxx" -#: ../../library/codecs.rst:990 +#: ../../library/codecs.rst:993 msgid "``U-00000080`` ... ``U-000007FF``" msgstr "``U-00000080`` ... ``U-000007FF``" -#: ../../library/codecs.rst:990 +#: ../../library/codecs.rst:993 msgid "110xxxxx 10xxxxxx" msgstr "110xxxxx 10xxxxxx" -#: ../../library/codecs.rst:992 +#: ../../library/codecs.rst:995 msgid "``U-00000800`` ... ``U-0000FFFF``" msgstr "``U-00000800`` ... ``U-0000FFFF``" -#: ../../library/codecs.rst:992 +#: ../../library/codecs.rst:995 msgid "1110xxxx 10xxxxxx 10xxxxxx" msgstr "1110xxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:994 +#: ../../library/codecs.rst:997 msgid "``U-00010000`` ... ``U-0010FFFF``" msgstr "``U-00010000`` ... ``U-0010FFFF``" -#: ../../library/codecs.rst:994 +#: ../../library/codecs.rst:997 msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:997 +#: ../../library/codecs.rst:1000 msgid "" "The least significant bit of the Unicode character is the rightmost x bit." msgstr "" -#: ../../library/codecs.rst:999 +#: ../../library/codecs.rst:1002 msgid "" "As UTF-8 is an 8-bit encoding no BOM is required and any ``U+FEFF`` " "character in the decoded string (even if it's the first character) is " "treated as a ``ZERO WIDTH NO-BREAK SPACE``." msgstr "" -#: ../../library/codecs.rst:1003 +#: ../../library/codecs.rst:1006 msgid "" "Without external information it's impossible to reliably determine which " "encoding was used for encoding a string. Each charmap encoding can decode " @@ -1301,7 +1301,7 @@ msgstr "" msgid "INVERTED QUESTION MARK" msgstr "" -#: ../../library/codecs.rst:1019 +#: ../../library/codecs.rst:1022 msgid "" "in iso-8859-1), this increases the probability that a ``utf-8-sig`` encoding " "can be correctly guessed from the byte sequence. So here the BOM is not used " @@ -1313,11 +1313,11 @@ msgid "" "the use of the BOM is discouraged and should generally be avoided." msgstr "" -#: ../../library/codecs.rst:1032 +#: ../../library/codecs.rst:1035 msgid "Standard Encodings" msgstr "" -#: ../../library/codecs.rst:1034 +#: ../../library/codecs.rst:1037 msgid "" "Python comes with a number of codecs built-in, either implemented as C " "functions or with dictionaries as mapping tables. The following table lists " @@ -1329,7 +1329,7 @@ msgid "" "alias for the ``'utf_8'`` codec." msgstr "" -#: ../../library/codecs.rst:1044 +#: ../../library/codecs.rst:1047 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1339,11 +1339,11 @@ msgid "" "Using alternative aliases for these encodings may result in slower execution." msgstr "" -#: ../../library/codecs.rst:1052 +#: ../../library/codecs.rst:1055 msgid "Optimization opportunity recognized for us-ascii." msgstr "" -#: ../../library/codecs.rst:1055 +#: ../../library/codecs.rst:1058 msgid "" "Many of the character sets support the same languages. They vary in " "individual characters (e.g. whether the EURO SIGN is supported or not), and " @@ -1351,504 +1351,504 @@ msgid "" "languages in particular, the following variants typically exist:" msgstr "" -#: ../../library/codecs.rst:1060 +#: ../../library/codecs.rst:1063 msgid "an ISO 8859 codeset" msgstr "" -#: ../../library/codecs.rst:1062 +#: ../../library/codecs.rst:1065 msgid "" "a Microsoft Windows code page, which is typically derived from an 8859 " "codeset, but replaces control characters with additional graphic characters" msgstr "" -#: ../../library/codecs.rst:1065 +#: ../../library/codecs.rst:1068 msgid "an IBM EBCDIC code page" msgstr "" -#: ../../library/codecs.rst:1067 +#: ../../library/codecs.rst:1070 msgid "an IBM PC code page, which is ASCII compatible" msgstr "" -#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 -#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 +#: ../../library/codecs.rst:1075 ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1398 ../../library/codecs.rst:1455 msgid "Codec" msgstr "" -#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 -#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 +#: ../../library/codecs.rst:1075 ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1398 ../../library/codecs.rst:1455 msgid "Aliases" msgstr "" -#: ../../library/codecs.rst:1072 +#: ../../library/codecs.rst:1075 msgid "Languages" msgstr "語言" -#: ../../library/codecs.rst:1074 +#: ../../library/codecs.rst:1077 msgid "ascii" msgstr "ascii" -#: ../../library/codecs.rst:1074 +#: ../../library/codecs.rst:1077 msgid "646, us-ascii" msgstr "646, us-ascii" -#: ../../library/codecs.rst:1074 ../../library/codecs.rst:1080 -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1077 ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1091 msgid "English" msgstr "英文" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1079 msgid "big5" msgstr "big5" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1079 msgid "big5-tw, csbig5" msgstr "big5-tw, csbig5" -#: ../../library/codecs.rst:1076 ../../library/codecs.rst:1078 -#: ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1079 ../../library/codecs.rst:1081 +#: ../../library/codecs.rst:1139 msgid "Traditional Chinese" msgstr "繁體中文" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1081 msgid "big5hkscs" msgstr "big5hkscs" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1081 msgid "big5-hkscs, hkscs" msgstr "big5-hkscs, hkscs" -#: ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1083 msgid "cp037" msgstr "cp037" -#: ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1083 msgid "IBM037, IBM039" msgstr "IBM037, IBM039" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1085 msgid "cp273" msgstr "cp273" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1085 msgid "273, IBM273, csIBM273" msgstr "273, IBM273, csIBM273" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1085 msgid "German" msgstr "德文" -#: ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1089 msgid "cp424" msgstr "cp424" -#: ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1089 msgid "EBCDIC-CP-HE, IBM424" msgstr "EBCDIC-CP-HE, IBM424" -#: ../../library/codecs.rst:1086 ../../library/codecs.rst:1106 -#: ../../library/codecs.rst:1116 ../../library/codecs.rst:1159 -#: ../../library/codecs.rst:1222 +#: ../../library/codecs.rst:1089 ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1119 ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1225 msgid "Hebrew" msgstr "希伯來文" -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1091 msgid "cp437" msgstr "cp437" -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1091 msgid "437, IBM437" msgstr "437, IBM437" -#: ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1093 msgid "cp500" msgstr "cp500" -#: ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1093 msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" -#: ../../library/codecs.rst:1090 ../../library/codecs.rst:1099 -#: ../../library/codecs.rst:1110 ../../library/codecs.rst:1146 -#: ../../library/codecs.rst:1153 ../../library/codecs.rst:1206 -#: ../../library/codecs.rst:1234 ../../library/codecs.rst:1262 +#: ../../library/codecs.rst:1093 ../../library/codecs.rst:1102 +#: ../../library/codecs.rst:1113 ../../library/codecs.rst:1149 +#: ../../library/codecs.rst:1156 ../../library/codecs.rst:1209 +#: ../../library/codecs.rst:1237 ../../library/codecs.rst:1265 msgid "Western Europe" msgstr "" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1096 msgid "cp720" msgstr "cp720" -#: ../../library/codecs.rst:1093 ../../library/codecs.rst:1120 -#: ../../library/codecs.rst:1161 ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1096 ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1164 ../../library/codecs.rst:1221 msgid "Arabic" msgstr "阿拉伯文" -#: ../../library/codecs.rst:1095 +#: ../../library/codecs.rst:1098 msgid "cp737" msgstr "cp737" -#: ../../library/codecs.rst:1095 ../../library/codecs.rst:1126 -#: ../../library/codecs.rst:1130 ../../library/codecs.rst:1155 -#: ../../library/codecs.rst:1220 ../../library/codecs.rst:1255 +#: ../../library/codecs.rst:1098 ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1133 ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1223 ../../library/codecs.rst:1258 msgid "Greek" msgstr "希臘文" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1100 msgid "cp775" msgstr "cp775" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1100 msgid "IBM775" msgstr "IBM775" -#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1163 -#: ../../library/codecs.rst:1213 ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1100 ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1216 ../../library/codecs.rst:1233 msgid "Baltic languages" msgstr "" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1102 msgid "cp850" msgstr "cp850" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1102 msgid "850, IBM850" msgstr "850, IBM850" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1104 msgid "cp852" msgstr "cp852" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1104 msgid "852, IBM852" msgstr "852, IBM852" -#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1148 -#: ../../library/codecs.rst:1209 ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1104 ../../library/codecs.rst:1151 +#: ../../library/codecs.rst:1212 ../../library/codecs.rst:1262 msgid "Central and Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1106 msgid "cp855" msgstr "cp855" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1106 msgid "855, IBM855" msgstr "855, IBM855" -#: ../../library/codecs.rst:1103 ../../library/codecs.rst:1150 -#: ../../library/codecs.rst:1215 ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1106 ../../library/codecs.rst:1153 +#: ../../library/codecs.rst:1218 ../../library/codecs.rst:1255 msgid "Bulgarian, Byelorussian, Macedonian, Russian, Serbian" msgstr "" -#: ../../library/codecs.rst:1106 +#: ../../library/codecs.rst:1109 msgid "cp856" msgstr "cp856" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1111 msgid "cp857" msgstr "cp857" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1111 msgid "857, IBM857" msgstr "857, IBM857" -#: ../../library/codecs.rst:1108 ../../library/codecs.rst:1140 -#: ../../library/codecs.rst:1157 ../../library/codecs.rst:1224 -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1111 ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1160 ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1267 msgid "Turkish" msgstr "土耳其文" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1113 msgid "cp858" msgstr "cp858" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1113 msgid "858, IBM858" msgstr "858, IBM858" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1115 msgid "cp860" msgstr "cp860" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1115 msgid "860, IBM860" msgstr "860, IBM860" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1115 msgid "Portuguese" msgstr "" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1117 msgid "cp861" msgstr "cp861" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1117 msgid "861, CP-IS, IBM861" msgstr "861, CP-IS, IBM861" -#: ../../library/codecs.rst:1114 ../../library/codecs.rst:1257 +#: ../../library/codecs.rst:1117 ../../library/codecs.rst:1260 msgid "Icelandic" msgstr "" -#: ../../library/codecs.rst:1116 +#: ../../library/codecs.rst:1119 msgid "cp862" msgstr "cp862" -#: ../../library/codecs.rst:1116 +#: ../../library/codecs.rst:1119 msgid "862, IBM862" msgstr "862, IBM862" -#: ../../library/codecs.rst:1118 +#: ../../library/codecs.rst:1121 msgid "cp863" msgstr "cp863" -#: ../../library/codecs.rst:1118 +#: ../../library/codecs.rst:1121 msgid "863, IBM863" msgstr "863, IBM863" -#: ../../library/codecs.rst:1118 +#: ../../library/codecs.rst:1121 msgid "Canadian" msgstr "" -#: ../../library/codecs.rst:1120 +#: ../../library/codecs.rst:1123 msgid "cp864" msgstr "cp864" -#: ../../library/codecs.rst:1120 +#: ../../library/codecs.rst:1123 msgid "IBM864" msgstr "IBM864" -#: ../../library/codecs.rst:1122 +#: ../../library/codecs.rst:1125 msgid "cp865" msgstr "cp865" -#: ../../library/codecs.rst:1122 +#: ../../library/codecs.rst:1125 msgid "865, IBM865" msgstr "865, IBM865" -#: ../../library/codecs.rst:1122 +#: ../../library/codecs.rst:1125 msgid "Danish, Norwegian" msgstr "" -#: ../../library/codecs.rst:1124 +#: ../../library/codecs.rst:1127 msgid "cp866" msgstr "cp866" -#: ../../library/codecs.rst:1124 +#: ../../library/codecs.rst:1127 msgid "866, IBM866" msgstr "866, IBM866" -#: ../../library/codecs.rst:1124 ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1127 ../../library/codecs.rst:1243 msgid "Russian" msgstr "俄羅斯文" -#: ../../library/codecs.rst:1126 +#: ../../library/codecs.rst:1129 msgid "cp869" msgstr "cp869" -#: ../../library/codecs.rst:1126 +#: ../../library/codecs.rst:1129 msgid "869, CP-GR, IBM869" msgstr "869, CP-GR, IBM869" -#: ../../library/codecs.rst:1128 +#: ../../library/codecs.rst:1131 msgid "cp874" msgstr "cp874" -#: ../../library/codecs.rst:1128 +#: ../../library/codecs.rst:1131 msgid "Thai" msgstr "泰文" -#: ../../library/codecs.rst:1130 +#: ../../library/codecs.rst:1133 msgid "cp875" msgstr "cp875" -#: ../../library/codecs.rst:1132 +#: ../../library/codecs.rst:1135 msgid "cp932" msgstr "cp932" -#: ../../library/codecs.rst:1132 +#: ../../library/codecs.rst:1135 msgid "932, ms932, mskanji, ms-kanji" msgstr "932, ms932, mskanji, ms-kanji" -#: ../../library/codecs.rst:1132 ../../library/codecs.rst:1167 -#: ../../library/codecs.rst:1169 ../../library/codecs.rst:1171 -#: ../../library/codecs.rst:1188 ../../library/codecs.rst:1191 -#: ../../library/codecs.rst:1196 ../../library/codecs.rst:1199 -#: ../../library/codecs.rst:1201 ../../library/codecs.rst:1269 -#: ../../library/codecs.rst:1272 ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1135 ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1172 ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1191 ../../library/codecs.rst:1194 +#: ../../library/codecs.rst:1199 ../../library/codecs.rst:1202 +#: ../../library/codecs.rst:1204 ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 ../../library/codecs.rst:1278 msgid "Japanese" msgstr "日文" -#: ../../library/codecs.rst:1134 +#: ../../library/codecs.rst:1137 msgid "cp949" msgstr "cp949" -#: ../../library/codecs.rst:1134 +#: ../../library/codecs.rst:1137 msgid "949, ms949, uhc" msgstr "949, ms949, uhc" -#: ../../library/codecs.rst:1134 ../../library/codecs.rst:1173 -#: ../../library/codecs.rst:1203 ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1137 ../../library/codecs.rst:1176 +#: ../../library/codecs.rst:1206 ../../library/codecs.rst:1241 msgid "Korean" msgstr "韓文" -#: ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1139 msgid "cp950" msgstr "cp950" -#: ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1139 msgid "950, ms950" msgstr "950, ms950" -#: ../../library/codecs.rst:1138 +#: ../../library/codecs.rst:1141 msgid "cp1006" msgstr "cp1006" -#: ../../library/codecs.rst:1138 +#: ../../library/codecs.rst:1141 msgid "Urdu" msgstr "" -#: ../../library/codecs.rst:1140 +#: ../../library/codecs.rst:1143 msgid "cp1026" msgstr "cp1026" -#: ../../library/codecs.rst:1140 +#: ../../library/codecs.rst:1143 msgid "ibm1026" msgstr "ibm1026" -#: ../../library/codecs.rst:1142 +#: ../../library/codecs.rst:1145 msgid "cp1125" msgstr "cp1125" -#: ../../library/codecs.rst:1142 +#: ../../library/codecs.rst:1145 msgid "1125, ibm1125, cp866u, ruscii" msgstr "1125, ibm1125, cp866u, ruscii" -#: ../../library/codecs.rst:1142 ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1145 ../../library/codecs.rst:1249 msgid "Ukrainian" msgstr "烏克蘭文" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1149 msgid "cp1140" msgstr "cp1140" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1149 msgid "ibm1140" msgstr "ibm1140" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1151 msgid "cp1250" msgstr "cp1250" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1151 msgid "windows-1250" msgstr "windows-1250" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "cp1251" msgstr "cp1251" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "windows-1251" msgstr "windows-1251" -#: ../../library/codecs.rst:1153 +#: ../../library/codecs.rst:1156 msgid "cp1252" msgstr "cp1252" -#: ../../library/codecs.rst:1153 +#: ../../library/codecs.rst:1156 msgid "windows-1252" msgstr "windows-1252" -#: ../../library/codecs.rst:1155 +#: ../../library/codecs.rst:1158 msgid "cp1253" msgstr "cp1253" -#: ../../library/codecs.rst:1155 +#: ../../library/codecs.rst:1158 msgid "windows-1253" msgstr "windows-1253" -#: ../../library/codecs.rst:1157 +#: ../../library/codecs.rst:1160 msgid "cp1254" msgstr "cp1254" -#: ../../library/codecs.rst:1157 +#: ../../library/codecs.rst:1160 msgid "windows-1254" msgstr "windows-1254" -#: ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1162 msgid "cp1255" msgstr "cp1255" -#: ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1162 msgid "windows-1255" msgstr "windows-1255" -#: ../../library/codecs.rst:1161 +#: ../../library/codecs.rst:1164 msgid "cp1256" msgstr "cp1256" -#: ../../library/codecs.rst:1161 +#: ../../library/codecs.rst:1164 msgid "windows-1256" msgstr "windows-1256" -#: ../../library/codecs.rst:1163 +#: ../../library/codecs.rst:1166 msgid "cp1257" msgstr "cp1257" -#: ../../library/codecs.rst:1163 +#: ../../library/codecs.rst:1166 msgid "windows-1257" msgstr "windows-1257" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1168 msgid "cp1258" msgstr "cp1258" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1168 msgid "windows-1258" msgstr "windows-1258" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1168 msgid "Vietnamese" msgstr "越南文" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1170 msgid "euc_jp" msgstr "euc_jp" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1170 msgid "eucjp, ujis, u-jis" msgstr "eucjp, ujis, u-jis" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1172 msgid "euc_jis_2004" msgstr "euc_jis_2004" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1172 msgid "jisx0213, eucjis2004" msgstr "jisx0213, eucjis2004" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1174 msgid "euc_jisx0213" msgstr "euc_jisx0213" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1174 msgid "eucjisx0213" msgstr "eucjisx0213" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1176 msgid "euc_kr" msgstr "euc_kr" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1176 msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" msgstr "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1180 msgid "gb2312" msgstr "gb2312" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1180 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" @@ -1856,446 +1856,446 @@ msgstr "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" -#: ../../library/codecs.rst:1177 ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1180 ../../library/codecs.rst:1189 msgid "Simplified Chinese" msgstr "簡體中文" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1185 msgid "gbk" msgstr "gbk" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1185 msgid "936, cp936, ms936" msgstr "936, cp936, ms936" -#: ../../library/codecs.rst:1182 ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1185 ../../library/codecs.rst:1187 msgid "Unified Chinese" msgstr "" -#: ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1187 msgid "gb18030" msgstr "gb18030" -#: ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1187 msgid "gb18030-2000" msgstr "gb18030-2000" -#: ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1189 msgid "hz" msgstr "" -#: ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1189 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "hzgb, hz-gb, hz-gb-2312" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "iso2022_jp" msgstr "iso2022_jp" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "csiso2022jp, iso2022jp, iso-2022-jp" -#: ../../library/codecs.rst:1191 +#: ../../library/codecs.rst:1194 msgid "iso2022_jp_1" msgstr "iso2022_jp_1" -#: ../../library/codecs.rst:1191 +#: ../../library/codecs.rst:1194 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "iso2022jp-1, iso-2022-jp-1" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022_jp_2" msgstr "iso2022_jp_2" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "iso2022jp-2, iso-2022-jp-2" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022_jp_2004" msgstr "iso2022_jp_2004" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "iso2022jp-2004, iso-2022-jp-2004" -#: ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1202 msgid "iso2022_jp_3" msgstr "iso2022_jp_3" -#: ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1202 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "iso2022jp-3, iso-2022-jp-3" -#: ../../library/codecs.rst:1201 +#: ../../library/codecs.rst:1204 msgid "iso2022_jp_ext" msgstr "iso2022_jp_ext" -#: ../../library/codecs.rst:1201 +#: ../../library/codecs.rst:1204 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "iso2022jp-ext, iso-2022-jp-ext" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 msgid "iso2022_kr" msgstr "iso2022_kr" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "csiso2022kr, iso2022kr, iso-2022-kr" -#: ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1209 msgid "latin_1" msgstr "latin_1" -#: ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1209 msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" msgstr "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" -#: ../../library/codecs.rst:1209 +#: ../../library/codecs.rst:1212 msgid "iso8859_2" msgstr "iso8859_2" -#: ../../library/codecs.rst:1209 +#: ../../library/codecs.rst:1212 msgid "iso-8859-2, latin2, L2" msgstr "iso-8859-2, latin2, L2" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1214 msgid "iso8859_3" msgstr "iso8859_3" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1214 msgid "iso-8859-3, latin3, L3" msgstr "iso-8859-3, latin3, L3" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1214 msgid "Esperanto, Maltese" msgstr "" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1216 msgid "iso8859_4" msgstr "iso8859_4" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1216 msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso8859_5" msgstr "iso8859_5" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso-8859-5, cyrillic" msgstr "iso-8859-5, cyrillic" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1221 msgid "iso8859_6" msgstr "iso8859_6" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1221 msgid "iso-8859-6, arabic" msgstr "iso-8859-6, arabic" -#: ../../library/codecs.rst:1220 +#: ../../library/codecs.rst:1223 msgid "iso8859_7" msgstr "iso8859_7" -#: ../../library/codecs.rst:1220 +#: ../../library/codecs.rst:1223 msgid "iso-8859-7, greek, greek8" msgstr "iso-8859-7, greek, greek8" -#: ../../library/codecs.rst:1222 +#: ../../library/codecs.rst:1225 msgid "iso8859_8" msgstr "iso8859_8" -#: ../../library/codecs.rst:1222 +#: ../../library/codecs.rst:1225 msgid "iso-8859-8, hebrew" msgstr "iso-8859-8, hebrew" -#: ../../library/codecs.rst:1224 +#: ../../library/codecs.rst:1227 msgid "iso8859_9" msgstr "iso8859_9" -#: ../../library/codecs.rst:1224 +#: ../../library/codecs.rst:1227 msgid "iso-8859-9, latin5, L5" msgstr "iso-8859-9, latin5, L5" -#: ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1229 msgid "iso8859_10" msgstr "iso8859_10" -#: ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1229 msgid "iso-8859-10, latin6, L6" msgstr "iso-8859-10, latin6, L6" -#: ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1229 msgid "Nordic languages" msgstr "" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1231 msgid "iso8859_11" msgstr "iso8859_11" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1231 msgid "iso-8859-11, thai" msgstr "iso-8859-11, thai" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1231 msgid "Thai languages" msgstr "" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1233 msgid "iso8859_13" msgstr "iso8859_13" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1233 msgid "iso-8859-13, latin7, L7" msgstr "iso-8859-13, latin7, L7" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1235 msgid "iso8859_14" msgstr "iso8859_14" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1235 msgid "iso-8859-14, latin8, L8" msgstr "iso-8859-14, latin8, L8" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1235 msgid "Celtic languages" msgstr "" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1237 msgid "iso8859_15" msgstr "iso8859_15" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1237 msgid "iso-8859-15, latin9, L9" msgstr "iso-8859-15, latin9, L9" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1239 msgid "iso8859_16" msgstr "iso8859_16" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1239 msgid "iso-8859-16, latin10, L10" msgstr "iso-8859-16, latin10, L10" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1239 msgid "South-Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1241 msgid "johab" msgstr "" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1241 msgid "cp1361, ms1361" msgstr "cp1361, ms1361" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1243 msgid "koi8_r" msgstr "koi8_r" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1245 msgid "koi8_t" msgstr "koi8_t" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1245 msgid "Tajik" msgstr "" -#: ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1249 msgid "koi8_u" msgstr "koi8_u" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1251 msgid "kz1048" msgstr "kz1048" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1251 msgid "kz_1048, strk1048_2002, rk1048" msgstr "kz_1048, strk1048_2002, rk1048" -#: ../../library/codecs.rst:1248 ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1251 ../../library/codecs.rst:1269 msgid "Kazakh" msgstr "" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "mac_cyrillic" msgstr "mac_cyrillic" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "maccyrillic" msgstr "" -#: ../../library/codecs.rst:1255 +#: ../../library/codecs.rst:1258 msgid "mac_greek" msgstr "mac_greek" -#: ../../library/codecs.rst:1255 +#: ../../library/codecs.rst:1258 msgid "macgreek" msgstr "" -#: ../../library/codecs.rst:1257 +#: ../../library/codecs.rst:1260 msgid "mac_iceland" msgstr "mac_iceland" -#: ../../library/codecs.rst:1257 +#: ../../library/codecs.rst:1260 msgid "maciceland" msgstr "" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "mac_latin2" msgstr "mac_latin2" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "maclatin2, maccentraleurope, mac_centeuro" -#: ../../library/codecs.rst:1262 +#: ../../library/codecs.rst:1265 msgid "mac_roman" msgstr "mac_roman" -#: ../../library/codecs.rst:1262 +#: ../../library/codecs.rst:1265 msgid "macroman, macintosh" msgstr "macroman, macintosh" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1267 msgid "mac_turkish" msgstr "mac_turkish" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1267 msgid "macturkish" msgstr "" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "ptcp154" msgstr "ptcp154" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "csptcp154, pt154, cp154, cyrillic-asian" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "shift_jis" msgstr "shift_jis" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "csshiftjis, shiftjis, sjis, s_jis" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shift_jis_2004" msgstr "shift_jis_2004" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "shiftjis2004, sjis_2004, sjis2004" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "shift_jisx0213" msgstr "shift_jisx0213" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "shiftjisx0213, sjisx0213, s_jisx0213" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1281 msgid "utf_32" msgstr "utf_32" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1281 msgid "U32, utf32" msgstr "U32, utf32" -#: ../../library/codecs.rst:1278 ../../library/codecs.rst:1280 -#: ../../library/codecs.rst:1282 ../../library/codecs.rst:1284 -#: ../../library/codecs.rst:1286 ../../library/codecs.rst:1288 -#: ../../library/codecs.rst:1290 ../../library/codecs.rst:1292 -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1281 ../../library/codecs.rst:1283 +#: ../../library/codecs.rst:1285 ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1289 ../../library/codecs.rst:1291 +#: ../../library/codecs.rst:1293 ../../library/codecs.rst:1295 +#: ../../library/codecs.rst:1297 msgid "all languages" msgstr "" -#: ../../library/codecs.rst:1280 +#: ../../library/codecs.rst:1283 msgid "utf_32_be" msgstr "utf_32_be" -#: ../../library/codecs.rst:1280 +#: ../../library/codecs.rst:1283 msgid "UTF-32BE" msgstr "UTF-32BE" -#: ../../library/codecs.rst:1282 +#: ../../library/codecs.rst:1285 msgid "utf_32_le" msgstr "utf_32_le" -#: ../../library/codecs.rst:1282 +#: ../../library/codecs.rst:1285 msgid "UTF-32LE" msgstr "UTF-32LE" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1287 msgid "utf_16" msgstr "utf_16" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1287 msgid "U16, utf16" msgstr "U16, utf16" -#: ../../library/codecs.rst:1286 +#: ../../library/codecs.rst:1289 msgid "utf_16_be" msgstr "utf_16_be" -#: ../../library/codecs.rst:1286 +#: ../../library/codecs.rst:1289 msgid "UTF-16BE" msgstr "UTF-16BE" -#: ../../library/codecs.rst:1288 +#: ../../library/codecs.rst:1291 msgid "utf_16_le" msgstr "utf_16_le" -#: ../../library/codecs.rst:1288 +#: ../../library/codecs.rst:1291 msgid "UTF-16LE" msgstr "UTF-16LE" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1293 msgid "utf_7" msgstr "utf_7" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1293 msgid "U7, unicode-1-1-utf-7" msgstr "U7, unicode-1-1-utf-7" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1295 msgid "utf_8" msgstr "utf_8" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1295 msgid "U8, UTF, utf8, cp65001" msgstr "U8, UTF, utf8, cp65001" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1297 msgid "utf_8_sig" msgstr "utf_8_sig" -#: ../../library/codecs.rst:1297 +#: ../../library/codecs.rst:1300 msgid "" "The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points " "(``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer " "decode byte sequences that correspond to surrogate code points." msgstr "" -#: ../../library/codecs.rst:1303 +#: ../../library/codecs.rst:1306 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "" -#: ../../library/codecs.rst:1308 +#: ../../library/codecs.rst:1311 msgid "Python Specific Encodings" msgstr "" -#: ../../library/codecs.rst:1310 +#: ../../library/codecs.rst:1313 msgid "" "A number of predefined codecs are specific to Python, so their codec names " "have no meaning outside Python. These are listed in the tables below based " @@ -2305,272 +2305,274 @@ msgid "" "asymmetric codecs, the stated meaning describes the encoding direction." msgstr "" -#: ../../library/codecs.rst:1318 +#: ../../library/codecs.rst:1321 msgid "Text Encodings" msgstr "" -#: ../../library/codecs.rst:1320 +#: ../../library/codecs.rst:1323 msgid "" "The following codecs provide :class:`str` to :class:`bytes` encoding and :" "term:`bytes-like object` to :class:`str` decoding, similar to the Unicode " "text encodings." msgstr "" -#: ../../library/codecs.rst:1329 +#: ../../library/codecs.rst:1332 msgid "idna" msgstr "idna" -#: ../../library/codecs.rst:1329 +#: ../../library/codecs.rst:1332 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." msgstr "" -#: ../../library/codecs.rst:1335 +#: ../../library/codecs.rst:1338 msgid "mbcs" msgstr "mbcs" -#: ../../library/codecs.rst:1335 +#: ../../library/codecs.rst:1338 msgid "ansi, dbcs" msgstr "ansi, dbcs" -#: ../../library/codecs.rst:1335 +#: ../../library/codecs.rst:1338 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1339 +#: ../../library/codecs.rst:1342 msgid "oem" msgstr "oem" -#: ../../library/codecs.rst:1339 +#: ../../library/codecs.rst:1342 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" -#: ../../library/codecs.rst:1345 +#: ../../library/codecs.rst:1348 msgid "palmos" msgstr "" -#: ../../library/codecs.rst:1345 +#: ../../library/codecs.rst:1348 msgid "Encoding of PalmOS 3.5." msgstr "" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1350 msgid "punycode" msgstr "" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1350 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr "" -#: ../../library/codecs.rst:1351 +#: ../../library/codecs.rst:1354 msgid "raw_unicode_escape" msgstr "raw_unicode_escape" -#: ../../library/codecs.rst:1351 +#: ../../library/codecs.rst:1354 msgid "" "Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " "other code points. Existing backslashes are not escaped in any way. It is " "used in the Python pickle protocol." msgstr "" -#: ../../library/codecs.rst:1361 +#: ../../library/codecs.rst:1364 msgid "undefined" msgstr "" -#: ../../library/codecs.rst:1361 +#: ../../library/codecs.rst:1364 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: ../../library/codecs.rst:1366 +#: ../../library/codecs.rst:1369 msgid "unicode_escape" msgstr "unicode_escape" -#: ../../library/codecs.rst:1366 +#: ../../library/codecs.rst:1369 msgid "" "Encoding suitable as the contents of a Unicode literal in ASCII-encoded " "Python source code, except that quotes are not escaped. Decode from Latin-1 " "source code. Beware that Python source code actually uses UTF-8 by default." msgstr "" -#: ../../library/codecs.rst:1378 +#: ../../library/codecs.rst:1381 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1385 +#: ../../library/codecs.rst:1388 msgid "Binary Transforms" msgstr "" -#: ../../library/codecs.rst:1387 +#: ../../library/codecs.rst:1390 msgid "" "The following codecs provide binary transforms: :term:`bytes-like object` " "to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " "(which only produces :class:`str` output)." msgstr "" -#: ../../library/codecs.rst:1395 +#: ../../library/codecs.rst:1398 msgid "Encoder / decoder" msgstr "" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid "base64_codec [#b64]_" msgstr "base64_codec [#b64]_" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid "base64, base_64" msgstr "base64, base_64" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: ../../library/codecs.rst:1402 +#: ../../library/codecs.rst:1405 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid "bz2_codec" msgstr "bz2_codec" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid "bz2" msgstr "bz2" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid "Compress the operand using bz2." msgstr "" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid "hex_codec" msgstr "hex_codec" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid "hex" msgstr "hex" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid "quopri_codec" msgstr "quopri_codec" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid "quopri, quotedprintable, quoted_printable" msgstr "quopri, quotedprintable, quoted_printable" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1423 msgid "uu_codec" msgstr "uu_codec" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1423 msgid "uu" msgstr "uu" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1423 msgid "Convert the operand using uuencode." msgstr "" -#: ../../library/codecs.rst:1420 -msgid ":meth:`uu.encode` / :meth:`uu.decode`" +#: ../../library/codecs.rst:1423 +#, fuzzy +msgid "" +":meth:`!uu.encode` / :meth:`!uu.decode` (Note: :mod:`uu` is deprecated.)" msgstr ":meth:`uu.encode` / :meth:`uu.decode`" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid "zlib_codec" msgstr "zlib_codec" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid "zip, zlib" msgstr "zip, zlib" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid "Compress the operand using gzip." msgstr "" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -#: ../../library/codecs.rst:1427 +#: ../../library/codecs.rst:1432 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: ../../library/codecs.rst:1431 +#: ../../library/codecs.rst:1436 msgid "Restoration of the binary transforms." msgstr "" -#: ../../library/codecs.rst:1434 +#: ../../library/codecs.rst:1439 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: ../../library/codecs.rst:1441 +#: ../../library/codecs.rst:1446 msgid "Text Transforms" msgstr "" -#: ../../library/codecs.rst:1443 +#: ../../library/codecs.rst:1448 msgid "" "The following codec provides a text transform: a :class:`str` to :class:" "`str` mapping. It is not supported by :meth:`str.encode` (which only " "produces :class:`bytes` output)." msgstr "" -#: ../../library/codecs.rst:1452 +#: ../../library/codecs.rst:1457 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1452 +#: ../../library/codecs.rst:1457 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1452 +#: ../../library/codecs.rst:1457 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1457 +#: ../../library/codecs.rst:1462 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1460 +#: ../../library/codecs.rst:1465 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1465 +#: ../../library/codecs.rst:1470 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1471 +#: ../../library/codecs.rst:1476 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2578,13 +2580,13 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1476 +#: ../../library/codecs.rst:1481 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party `idna module `_." msgstr "" -#: ../../library/codecs.rst:1479 +#: ../../library/codecs.rst:1484 msgid "" "These RFCs together define a protocol to support non-ASCII characters in " "domain names. A domain name containing non-ASCII characters (such as ``www." @@ -2598,7 +2600,7 @@ msgid "" "presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1490 +#: ../../library/codecs.rst:1495 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2615,14 +2617,14 @@ msgid "" "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1503 +#: ../../library/codecs.rst:1508 msgid "" "When receiving host names from the wire (such as in reverse name lookup), no " "automatic conversion to Unicode is performed: applications wishing to " "present such host names to the user should decode them to Unicode." msgstr "" -#: ../../library/codecs.rst:1507 +#: ../../library/codecs.rst:1512 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2630,49 +2632,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1515 +#: ../../library/codecs.rst:1520 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1521 +#: ../../library/codecs.rst:1526 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1527 +#: ../../library/codecs.rst:1532 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1531 +#: ../../library/codecs.rst:1536 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr "" -#: ../../library/codecs.rst:1536 +#: ../../library/codecs.rst:1541 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1538 +#: ../../library/codecs.rst:1543 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/codecs.rst:1540 +#: ../../library/codecs.rst:1545 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1543 +#: ../../library/codecs.rst:1548 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1549 +#: ../../library/codecs.rst:1554 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1555 +#: ../../library/codecs.rst:1560 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " diff --git a/library/collections.abc.po b/library/collections.abc.po index 9c36761182..ac7a5b7e47 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -430,9 +430,9 @@ msgstr "" msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " -"not detect classes that iterate with the :meth:`__getitem__` method. The " -"only reliable way to determine whether an object is :term:`iterable` is to " -"call ``iter(obj)``." +"not detect classes that iterate with the :meth:`~object.__getitem__` " +"method. The only reliable way to determine whether an object is :term:" +"`iterable` is to call ``iter(obj)``." msgstr "" #: ../../library/collections.abc.rst:200 @@ -463,9 +463,9 @@ msgstr "" msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " -"not detect classes that iterate with the :meth:`__getitem__` method. The " -"only reliable way to determine whether an object is :term:`iterable` is to " -"call ``iter(obj)``." +"not detect classes that iterate with the :meth:`~object.__getitem__` method. " +"The only reliable way to determine whether an object is :term:`iterable` is " +"to call ``iter(obj)``." msgstr "" #: ../../library/collections.abc.rst:231 @@ -499,11 +499,11 @@ msgstr "" msgid "" "Implementation note: Some of the mixin methods, such as :meth:`__iter__`, :" "meth:`__reversed__` and :meth:`index`, make repeated calls to the " -"underlying :meth:`__getitem__` method. Consequently, if :meth:`__getitem__` " -"is implemented with constant access speed, the mixin methods will have " -"linear performance; however, if the underlying method is linear (as it would " -"be with a linked list), the mixins will have quadratic performance and will " -"likely need to be overridden." +"underlying :meth:`~object.__getitem__` method. Consequently, if :meth:" +"`~object.__getitem__` is implemented with constant access speed, the mixin " +"methods will have linear performance; however, if the underlying method is " +"linear (as it would be with a linked list), the mixins will have quadratic " +"performance and will likely need to be overridden." msgstr "" #: ../../library/collections.abc.rst:272 diff --git a/library/collections.po b/library/collections.po index 78ac6d2647..8eef17b770 100644 --- a/library/collections.po +++ b/library/collections.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-02-18 14:48+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -934,24 +934,24 @@ msgstr "" #: ../../library/collections.rst:746 msgid "" -"This method is called by the :meth:`__getitem__` method of the :class:`dict` " -"class when the requested key is not found; whatever it returns or raises is " -"then returned or raised by :meth:`__getitem__`." +"This method is called by the :meth:`~object.__getitem__` method of the :" +"class:`dict` class when the requested key is not found; whatever it returns " +"or raises is then returned or raised by :meth:`~object.__getitem__`." msgstr "" -"在無法找到所要求的鍵時,此方法會被 :class:`dict` 類別的 :meth:`__getitem__` " -"方法呼叫。無論此方法回傳了值還是引發了例外,都會被 :meth:`__getitem__` 所傳" -"遞。" +"在無法找到所要求的鍵時,此方法會被 :class:`dict` 類別的 :meth:`~object." +"__getitem__` 方法呼叫。無論此方法回傳了值還是引發了例外,都會被 :meth:" +"`~object.__getitem__` 所傳遞。" #: ../../library/collections.rst:750 msgid "" "Note that :meth:`__missing__` is *not* called for any operations besides :" -"meth:`__getitem__`. This means that :meth:`get` will, like normal " +"meth:`~object.__getitem__`. This means that :meth:`get` will, like normal " "dictionaries, return ``None`` as a default rather than using :attr:" "`default_factory`." msgstr "" -"注意,\\ :meth:`__missing__` *不會*\\ 被 :meth:`__getitem__` 以外的其他方法呼" -"叫,這意味著 :meth:`get` 會像一般的 dict 那樣回傳 ``None`` 做為預設值,而非使" -"用 :attr:`default_factory`。" +"注意,\\ :meth:`__missing__` *不會*\\ 被 :meth:`~object.__getitem__` 以外的其" +"他方法呼叫,這意味著 :meth:`get` 會像一般的 dict 那樣回傳 ``None`` 做為預設" +"值,而非使用 :attr:`default_factory`。" #: ../../library/collections.rst:756 msgid ":class:`defaultdict` objects support the following instance variable:" diff --git a/library/contextlib.po b/library/contextlib.po index d304c5e28c..e31c9625e1 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -64,7 +64,8 @@ msgstr "" msgid "" "This function is a :term:`decorator` that can be used to define a factory " "function for :keyword:`with` statement context managers, without needing to " -"create a class or separate :meth:`__enter__` and :meth:`__exit__` methods." +"create a class or separate :meth:`~object.__enter__` and :meth:`~object." +"__exit__` methods." msgstr "" #: ../../library/contextlib.rst:50 @@ -418,8 +419,8 @@ msgstr "" #: ../../library/contextlib.rst:518 msgid "" -"The :meth:`__enter__` method returns the :class:`ExitStack` instance, and " -"performs no additional operations." +"The :meth:`~object.__enter__` method returns the :class:`ExitStack` " +"instance, and performs no additional operations." msgstr "" #: ../../library/contextlib.rst:521 @@ -457,9 +458,9 @@ msgstr "" #: ../../library/contextlib.rst:546 msgid "" -"Enters a new context manager and adds its :meth:`__exit__` method to the " -"callback stack. The return value is the result of the context manager's own :" -"meth:`__enter__` method." +"Enters a new context manager and adds its :meth:`~object.__exit__` method to " +"the callback stack. The return value is the result of the context manager's " +"own :meth:`~object.__enter__` method." msgstr "" #: ../../library/contextlib.rst:550 @@ -475,27 +476,29 @@ msgid "" msgstr "" #: ../../library/contextlib.rst:559 -msgid "Adds a context manager's :meth:`__exit__` method to the callback stack." +msgid "" +"Adds a context manager's :meth:`~object.__exit__` method to the callback " +"stack." msgstr "" #: ../../library/contextlib.rst:561 msgid "" "As ``__enter__`` is *not* invoked, this method can be used to cover part of " -"an :meth:`__enter__` implementation with a context manager's own :meth:" -"`__exit__` method." +"an :meth:`~object.__enter__` implementation with a context manager's own :" +"meth:`~object.__exit__` method." msgstr "" #: ../../library/contextlib.rst:565 msgid "" "If passed an object that is not a context manager, this method assumes it is " -"a callback with the same signature as a context manager's :meth:`__exit__` " -"method and adds it directly to the callback stack." +"a callback with the same signature as a context manager's :meth:`~object." +"__exit__` method and adds it directly to the callback stack." msgstr "" #: ../../library/contextlib.rst:569 msgid "" "By returning true values, these callbacks can suppress exceptions the same " -"way context manager :meth:`__exit__` methods can." +"way context manager :meth:`~object.__exit__` methods can." msgstr "" #: ../../library/contextlib.rst:572 @@ -648,7 +651,7 @@ msgstr "" msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " "useful in cleaning up an already allocated resource if later steps in the :" -"meth:`__enter__` implementation fail." +"meth:`~object.__enter__` implementation fail." msgstr "" #: ../../library/contextlib.rst:719 @@ -741,8 +744,8 @@ msgstr "" msgid "" "Note that there is one additional limitation when using context managers as " "function decorators: there's no way to access the return value of :meth:" -"`__enter__`. If that value is needed, then it is still necessary to use an " -"explicit ``with`` statement." +"`~object.__enter__`. If that value is needed, then it is still necessary to " +"use an explicit ``with`` statement." msgstr "" #: ../../library/contextlib.rst:880 diff --git a/library/difflib.po b/library/difflib.po index fd4440ff4a..3fd67c4ee7 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-04 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -72,7 +72,7 @@ msgid "" "``False`` when creating the :class:`SequenceMatcher`." msgstr "" -#: ../../library/difflib.rst:55 ../../library/difflib.rst:384 +#: ../../library/difflib.rst:55 ../../library/difflib.rst:386 msgid "The *autojunk* parameter." msgstr "*autojunk* 參數。" @@ -92,7 +92,7 @@ msgstr "" msgid "Code" msgstr "" -#: ../../library/difflib.rst:69 ../../library/difflib.rst:494 +#: ../../library/difflib.rst:69 ../../library/difflib.rst:496 msgid "Meaning" msgstr "" @@ -249,13 +249,13 @@ msgid "" "trailing newlines." msgstr "" -#: ../../library/difflib.rst:165 ../../library/difflib.rst:294 +#: ../../library/difflib.rst:165 ../../library/difflib.rst:297 msgid "" "For inputs that do not have trailing newlines, set the *lineterm* argument " "to ``\"\"`` so that the output will be uniformly newline free." msgstr "" -#: ../../library/difflib.rst:168 ../../library/difflib.rst:297 +#: ../../library/difflib.rst:168 msgid "" "The context diff format normally has a header for filenames and modification " "times. Any or all of these may be specified using strings for *fromfile*, " @@ -264,11 +264,11 @@ msgid "" "default to blanks." msgstr "" -#: ../../library/difflib.rst:191 ../../library/difflib.rst:318 +#: ../../library/difflib.rst:194 ../../library/difflib.rst:320 msgid "See :ref:`difflib-interface` for a more detailed example." msgstr "一個更詳盡的範例請見 :ref:`difflib-interface`\\ 。" -#: ../../library/difflib.rst:196 +#: ../../library/difflib.rst:199 msgid "" "Return a list of the best \"good enough\" matches. *word* is a sequence for " "which close matches are desired (typically a string), and *possibilities* is " @@ -276,37 +276,37 @@ msgid "" "strings)." msgstr "" -#: ../../library/difflib.rst:200 +#: ../../library/difflib.rst:203 msgid "" "Optional argument *n* (default ``3``) is the maximum number of close matches " "to return; *n* must be greater than ``0``." msgstr "" -#: ../../library/difflib.rst:203 +#: ../../library/difflib.rst:206 msgid "" "Optional argument *cutoff* (default ``0.6``) is a float in the range [0, 1]. " "Possibilities that don't score at least that similar to *word* are ignored." msgstr "" -#: ../../library/difflib.rst:206 +#: ../../library/difflib.rst:209 msgid "" "The best (no more than *n*) matches among the possibilities are returned in " "a list, sorted by similarity score, most similar first." msgstr "" -#: ../../library/difflib.rst:222 +#: ../../library/difflib.rst:225 msgid "" "Compare *a* and *b* (lists of strings); return a :class:`Differ`\\ -style " "delta (a :term:`generator` generating the delta lines)." msgstr "" -#: ../../library/difflib.rst:225 +#: ../../library/difflib.rst:228 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are filtering " "functions (or ``None``):" msgstr "" -#: ../../library/difflib.rst:228 +#: ../../library/difflib.rst:231 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk, or false if not. The default is ``None``. There " @@ -317,7 +317,7 @@ msgid "" "this usually works better than using this function." msgstr "" -#: ../../library/difflib.rst:236 +#: ../../library/difflib.rst:239 msgid "" "*charjunk*: A function that accepts a character (a string of length 1), and " "returns if the character is junk, or false if not. The default is module-" @@ -325,28 +325,28 @@ msgid "" "characters (a blank or tab; it's a bad idea to include newline in this!)." msgstr "" -#: ../../library/difflib.rst:257 +#: ../../library/difflib.rst:260 msgid "Return one of the two sequences that generated a delta." msgstr "" -#: ../../library/difflib.rst:259 +#: ../../library/difflib.rst:262 msgid "" "Given a *sequence* produced by :meth:`Differ.compare` or :func:`ndiff`, " "extract lines originating from file 1 or 2 (parameter *which*), stripping " "off line prefixes." msgstr "" -#: ../../library/difflib.rst:263 +#: ../../library/difflib.rst:266 msgid "Example:" msgstr "範例:" -#: ../../library/difflib.rst:280 +#: ../../library/difflib.rst:283 msgid "" "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " "generating the delta lines) in unified diff format." msgstr "" -#: ../../library/difflib.rst:283 +#: ../../library/difflib.rst:286 msgid "" "Unified diffs are a compact way of showing just the lines that have changed " "plus a few lines of context. The changes are shown in an inline style " @@ -354,7 +354,7 @@ msgid "" "set by *n* which defaults to three." msgstr "" -#: ../../library/difflib.rst:288 +#: ../../library/difflib.rst:291 msgid "" "By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) " "are created with a trailing newline. This is helpful so that inputs created " @@ -363,14 +363,23 @@ msgid "" "trailing newlines." msgstr "" -#: ../../library/difflib.rst:322 +#: ../../library/difflib.rst:300 +msgid "" +"The unified diff format normally has a header for filenames and modification " +"times. Any or all of these may be specified using strings for *fromfile*, " +"*tofile*, *fromfiledate*, and *tofiledate*. The modification times are " +"normally expressed in the ISO 8601 format. If not specified, the strings " +"default to blanks." +msgstr "" + +#: ../../library/difflib.rst:324 msgid "" "Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a sequence " "of delta lines (also bytes) in the format returned by *dfunc*. *dfunc* must " "be a callable, typically either :func:`unified_diff` or :func:`context_diff`." msgstr "" -#: ../../library/difflib.rst:327 +#: ../../library/difflib.rst:329 msgid "" "Allows you to compare data with unknown or inconsistent encoding. All inputs " "except *n* must be bytes objects, not str. Works by losslessly converting " @@ -380,42 +389,42 @@ msgid "" "unknown/inconsistent encodings as *a* and *b*." msgstr "" -#: ../../library/difflib.rst:338 +#: ../../library/difflib.rst:340 msgid "" "Return ``True`` for ignorable lines. The line *line* is ignorable if *line* " "is blank or contains a single ``'#'``, otherwise it is not ignorable. Used " "as a default for parameter *linejunk* in :func:`ndiff` in older versions." msgstr "" -#: ../../library/difflib.rst:345 +#: ../../library/difflib.rst:347 msgid "" "Return ``True`` for ignorable characters. The character *ch* is ignorable " "if *ch* is a space or tab, otherwise it is not ignorable. Used as a default " "for parameter *charjunk* in :func:`ndiff`." msgstr "" -#: ../../library/difflib.rst:353 +#: ../../library/difflib.rst:355 msgid "" "`Pattern Matching: The Gestalt Approach `_" msgstr "" -#: ../../library/difflib.rst:353 +#: ../../library/difflib.rst:355 msgid "" "Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. " "This was published in `Dr. Dobb's Journal `_ in " "July, 1988." msgstr "" -#: ../../library/difflib.rst:360 +#: ../../library/difflib.rst:362 msgid "SequenceMatcher Objects" msgstr "SequenceMatcher 物件" -#: ../../library/difflib.rst:362 +#: ../../library/difflib.rst:364 msgid "The :class:`SequenceMatcher` class has this constructor:" msgstr "" -#: ../../library/difflib.rst:367 +#: ../../library/difflib.rst:369 msgid "" "Optional argument *isjunk* must be ``None`` (the default) or a one-argument " "function that takes a sequence element and returns true if and only if the " @@ -424,26 +433,26 @@ msgid "" "ignored. For example, pass::" msgstr "" -#: ../../library/difflib.rst:375 +#: ../../library/difflib.rst:377 msgid "" "if you're comparing lines as sequences of characters, and don't want to " "synch up on blanks or hard tabs." msgstr "" -#: ../../library/difflib.rst:378 +#: ../../library/difflib.rst:380 msgid "" "The optional arguments *a* and *b* are sequences to be compared; both " "default to empty strings. The elements of both sequences must be :term:" "`hashable`." msgstr "" -#: ../../library/difflib.rst:381 +#: ../../library/difflib.rst:383 msgid "" "The optional argument *autojunk* can be used to disable the automatic junk " "heuristic." msgstr "" -#: ../../library/difflib.rst:387 +#: ../../library/difflib.rst:389 msgid "" "SequenceMatcher objects get three data attributes: *bjunk* is the set of " "elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of non-" @@ -453,19 +462,19 @@ msgid "" "`set_seqs` or :meth:`set_seq2`." msgstr "" -#: ../../library/difflib.rst:394 +#: ../../library/difflib.rst:396 msgid "The *bjunk* and *bpopular* attributes." msgstr "" -#: ../../library/difflib.rst:397 +#: ../../library/difflib.rst:399 msgid ":class:`SequenceMatcher` objects have the following methods:" msgstr "" -#: ../../library/difflib.rst:401 +#: ../../library/difflib.rst:403 msgid "Set the two sequences to be compared." msgstr "" -#: ../../library/difflib.rst:403 +#: ../../library/difflib.rst:405 msgid "" ":class:`SequenceMatcher` computes and caches detailed information about the " "second sequence, so if you want to compare one sequence against many " @@ -473,23 +482,23 @@ msgid "" "call :meth:`set_seq1` repeatedly, once for each of the other sequences." msgstr "" -#: ../../library/difflib.rst:411 +#: ../../library/difflib.rst:413 msgid "" "Set the first sequence to be compared. The second sequence to be compared " "is not changed." msgstr "" -#: ../../library/difflib.rst:417 +#: ../../library/difflib.rst:419 msgid "" "Set the second sequence to be compared. The first sequence to be compared " "is not changed." msgstr "" -#: ../../library/difflib.rst:423 +#: ../../library/difflib.rst:425 msgid "Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``." msgstr "" -#: ../../library/difflib.rst:425 +#: ../../library/difflib.rst:427 msgid "" "If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns " "``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo " @@ -501,7 +510,7 @@ msgid "" "that starts earliest in *b*." msgstr "" -#: ../../library/difflib.rst:438 +#: ../../library/difflib.rst:440 msgid "" "If *isjunk* was provided, first the longest matching block is determined as " "above, but with the additional restriction that no junk element appears in " @@ -510,7 +519,7 @@ msgid "" "junk except as identical junk happens to be adjacent to an interesting match." msgstr "" -#: ../../library/difflib.rst:445 +#: ../../library/difflib.rst:447 msgid "" "Here's the same example as before, but considering blanks to be junk. That " "prevents ``' abcd'`` from matching the ``' abcd'`` at the tail end of the " @@ -518,26 +527,26 @@ msgid "" "matches the leftmost ``'abcd'`` in the second sequence:" msgstr "" -#: ../../library/difflib.rst:454 +#: ../../library/difflib.rst:456 msgid "If no blocks match, this returns ``(alo, blo, 0)``." msgstr "" -#: ../../library/difflib.rst:456 +#: ../../library/difflib.rst:458 msgid "This method returns a :term:`named tuple` ``Match(a, b, size)``." msgstr "" -#: ../../library/difflib.rst:458 +#: ../../library/difflib.rst:460 msgid "Added default arguments." msgstr "新增預設引數。" -#: ../../library/difflib.rst:464 +#: ../../library/difflib.rst:466 msgid "" "Return list of triples describing non-overlapping matching subsequences. " "Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:" "j+n]``. The triples are monotonically increasing in *i* and *j*." msgstr "" -#: ../../library/difflib.rst:469 +#: ../../library/difflib.rst:471 msgid "" "The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It " "is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` " @@ -546,7 +555,7 @@ msgid "" "triples always describe non-adjacent equal blocks." msgstr "" -#: ../../library/difflib.rst:486 +#: ../../library/difflib.rst:488 msgid "" "Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " "of the form ``(tag, i1, i2, j1, j2)``. The first tuple has ``i1 == j1 == " @@ -554,104 +563,104 @@ msgid "" "tuple, and, likewise, *j1* equal to the previous *j2*." msgstr "" -#: ../../library/difflib.rst:491 +#: ../../library/difflib.rst:493 msgid "The *tag* values are strings, with these meanings:" msgstr "" -#: ../../library/difflib.rst:494 +#: ../../library/difflib.rst:496 msgid "Value" msgstr "" -#: ../../library/difflib.rst:496 +#: ../../library/difflib.rst:498 msgid "``'replace'``" msgstr "``'replace'``" -#: ../../library/difflib.rst:496 +#: ../../library/difflib.rst:498 msgid "``a[i1:i2]`` should be replaced by ``b[j1:j2]``." msgstr "" -#: ../../library/difflib.rst:499 +#: ../../library/difflib.rst:501 msgid "``'delete'``" msgstr "``'delete'``" -#: ../../library/difflib.rst:499 +#: ../../library/difflib.rst:501 msgid "``a[i1:i2]`` should be deleted. Note that ``j1 == j2`` in this case." msgstr "" -#: ../../library/difflib.rst:502 +#: ../../library/difflib.rst:504 msgid "``'insert'``" msgstr "``'insert'``" -#: ../../library/difflib.rst:502 +#: ../../library/difflib.rst:504 msgid "" "``b[j1:j2]`` should be inserted at ``a[i1:i1]``. Note that ``i1 == i2`` in " "this case." msgstr "" -#: ../../library/difflib.rst:506 +#: ../../library/difflib.rst:508 msgid "``'equal'``" msgstr "``'equal'``" -#: ../../library/difflib.rst:506 +#: ../../library/difflib.rst:508 msgid "``a[i1:i2] == b[j1:j2]`` (the sub-sequences are equal)." msgstr "" -#: ../../library/difflib.rst:510 +#: ../../library/difflib.rst:512 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/difflib.rst:527 +#: ../../library/difflib.rst:529 msgid "Return a :term:`generator` of groups with up to *n* lines of context." msgstr "" -#: ../../library/difflib.rst:529 +#: ../../library/difflib.rst:531 msgid "" "Starting with the groups returned by :meth:`get_opcodes`, this method splits " "out smaller change clusters and eliminates intervening ranges which have no " "changes." msgstr "" -#: ../../library/difflib.rst:533 +#: ../../library/difflib.rst:535 msgid "The groups are returned in the same format as :meth:`get_opcodes`." msgstr "" -#: ../../library/difflib.rst:538 +#: ../../library/difflib.rst:540 msgid "" "Return a measure of the sequences' similarity as a float in the range [0, 1]." msgstr "" -#: ../../library/difflib.rst:541 +#: ../../library/difflib.rst:543 msgid "" "Where T is the total number of elements in both sequences, and M is the " "number of matches, this is 2.0\\*M / T. Note that this is ``1.0`` if the " "sequences are identical, and ``0.0`` if they have nothing in common." msgstr "" -#: ../../library/difflib.rst:545 +#: ../../library/difflib.rst:547 msgid "" "This is expensive to compute if :meth:`get_matching_blocks` or :meth:" "`get_opcodes` hasn't already been called, in which case you may want to try :" "meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an upper bound." msgstr "" -#: ../../library/difflib.rst:552 +#: ../../library/difflib.rst:554 msgid "" "Caution: The result of a :meth:`ratio` call may depend on the order of the " "arguments. For instance::" msgstr "" -#: ../../library/difflib.rst:563 +#: ../../library/difflib.rst:565 msgid "Return an upper bound on :meth:`ratio` relatively quickly." msgstr "" -#: ../../library/difflib.rst:568 +#: ../../library/difflib.rst:570 msgid "Return an upper bound on :meth:`ratio` very quickly." msgstr "" -#: ../../library/difflib.rst:571 +#: ../../library/difflib.rst:573 msgid "" "The three methods that return the ratio of matching to total characters can " "give different results due to differing levels of approximation, although :" @@ -660,28 +669,28 @@ msgid "" "ratio`:" msgstr "" -#: ../../library/difflib.rst:588 +#: ../../library/difflib.rst:590 msgid "SequenceMatcher Examples" msgstr "SequenceMatcher 範例" -#: ../../library/difflib.rst:590 +#: ../../library/difflib.rst:592 msgid "This example compares two strings, considering blanks to be \"junk\":" msgstr "" -#: ../../library/difflib.rst:596 +#: ../../library/difflib.rst:598 msgid "" ":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the " "similarity of the sequences. As a rule of thumb, a :meth:`~SequenceMatcher." "ratio` value over 0.6 means the sequences are close matches:" msgstr "" -#: ../../library/difflib.rst:603 +#: ../../library/difflib.rst:605 msgid "" "If you're only interested in where the sequences match, :meth:" "`~SequenceMatcher.get_matching_blocks` is handy:" msgstr "" -#: ../../library/difflib.rst:612 +#: ../../library/difflib.rst:614 msgid "" "Note that the last tuple returned by :meth:`~SequenceMatcher." "get_matching_blocks` is always a dummy, ``(len(a), len(b), 0)``, and this is " @@ -689,29 +698,29 @@ msgid "" "is ``0``." msgstr "" -#: ../../library/difflib.rst:616 +#: ../../library/difflib.rst:618 msgid "" "If you want to know how to change the first sequence into the second, use :" "meth:`~SequenceMatcher.get_opcodes`:" msgstr "" -#: ../../library/difflib.rst:627 +#: ../../library/difflib.rst:629 msgid "" "The :func:`get_close_matches` function in this module which shows how simple " "code building on :class:`SequenceMatcher` can be used to do useful work." msgstr "" -#: ../../library/difflib.rst:631 +#: ../../library/difflib.rst:633 msgid "" "`Simple version control recipe `_ for a small application built with :class:`SequenceMatcher`." msgstr "" -#: ../../library/difflib.rst:639 +#: ../../library/difflib.rst:641 msgid "Differ Objects" msgstr "" -#: ../../library/difflib.rst:641 +#: ../../library/difflib.rst:643 msgid "" "Note that :class:`Differ`\\ -generated deltas make no claim to be " "**minimal** diffs. To the contrary, minimal diffs are often counter-" @@ -721,31 +730,31 @@ msgid "" "longer diff." msgstr "" -#: ../../library/difflib.rst:647 +#: ../../library/difflib.rst:649 msgid "The :class:`Differ` class has this constructor:" msgstr "" -#: ../../library/difflib.rst:653 +#: ../../library/difflib.rst:655 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are for filter " "functions (or ``None``):" msgstr "" -#: ../../library/difflib.rst:656 +#: ../../library/difflib.rst:658 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk. The default is ``None``, meaning that no line " "is considered junk." msgstr "" -#: ../../library/difflib.rst:660 +#: ../../library/difflib.rst:662 msgid "" "*charjunk*: A function that accepts a single character argument (a string of " "length 1), and returns true if the character is junk. The default is " "``None``, meaning that no character is considered junk." msgstr "" -#: ../../library/difflib.rst:664 +#: ../../library/difflib.rst:666 msgid "" "These junk-filtering functions speed up matching to find differences and do " "not cause any differing lines or characters to be ignored. Read the " @@ -753,17 +762,17 @@ msgid "" "*isjunk* parameter for an explanation." msgstr "" -#: ../../library/difflib.rst:670 +#: ../../library/difflib.rst:672 msgid "" ":class:`Differ` objects are used (deltas generated) via a single method:" msgstr "" -#: ../../library/difflib.rst:675 +#: ../../library/difflib.rst:677 msgid "" "Compare two sequences of lines, and generate the delta (a sequence of lines)." msgstr "" -#: ../../library/difflib.rst:677 +#: ../../library/difflib.rst:679 msgid "" "Each sequence must contain individual single-line strings ending with " "newlines. Such sequences can be obtained from the :meth:`~io.IOBase." @@ -772,11 +781,11 @@ msgid "" "IOBase.writelines` method of a file-like object." msgstr "" -#: ../../library/difflib.rst:688 +#: ../../library/difflib.rst:690 msgid "Differ Example" msgstr "" -#: ../../library/difflib.rst:690 +#: ../../library/difflib.rst:692 msgid "" "This example compares two texts. First we set up the texts, sequences of " "individual single-line strings ending with newlines (such sequences can also " @@ -784,45 +793,45 @@ msgid "" "objects):" msgstr "" -#: ../../library/difflib.rst:709 +#: ../../library/difflib.rst:711 msgid "Next we instantiate a Differ object:" msgstr "" -#: ../../library/difflib.rst:713 +#: ../../library/difflib.rst:715 msgid "" "Note that when instantiating a :class:`Differ` object we may pass functions " "to filter out line and character \"junk.\" See the :meth:`Differ` " "constructor for details." msgstr "" -#: ../../library/difflib.rst:717 +#: ../../library/difflib.rst:719 msgid "Finally, we compare the two:" msgstr "" -#: ../../library/difflib.rst:721 +#: ../../library/difflib.rst:723 msgid "``result`` is a list of strings, so let's pretty-print it:" msgstr "" -#: ../../library/difflib.rst:736 +#: ../../library/difflib.rst:738 msgid "As a single multi-line string it looks like this:" msgstr "" -#: ../../library/difflib.rst:755 +#: ../../library/difflib.rst:757 msgid "A command-line interface to difflib" msgstr "" -#: ../../library/difflib.rst:757 +#: ../../library/difflib.rst:759 msgid "" "This example shows how to use difflib to create a ``diff``-like utility." msgstr "" -#: ../../library/difflib.rst:762 +#: ../../library/difflib.rst:764 msgid "ndiff example" msgstr "" "ndiff 範例:\n" "\n" "::" -#: ../../library/difflib.rst:764 +#: ../../library/difflib.rst:766 msgid "This example shows how to use :func:`difflib.ndiff`." msgstr "" diff --git a/library/dis.po b/library/dis.po index 149873e707..5b4accee2c 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-18 00:04+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,69 +68,83 @@ msgid "" "shown by passing ``adaptive=True``." msgstr "" -#: ../../library/dis.rst:46 +#: ../../library/dis.rst:45 +msgid "" +"The argument of a jump is the offset of the target instruction relative to " +"the instruction that appears immediately after the jump instruction's :" +"opcode:`CACHE` entries." +msgstr "" + +#: ../../library/dis.rst:50 +msgid "" +"As a consequence, the presence of the :opcode:`CACHE` instructions is " +"transparent for forward jumps but needs to be taken into account when " +"reasoning about backward jumps." +msgstr "" + +#: ../../library/dis.rst:54 msgid "Example: Given the function :func:`!myfunc`::" msgstr "" -#: ../../library/dis.rst:51 +#: ../../library/dis.rst:59 msgid "" "the following command can be used to display the disassembly of :func:`!" "myfunc`:" msgstr "" -#: ../../library/dis.rst:64 +#: ../../library/dis.rst:72 msgid "(The \"2\" is a line number)." msgstr "" -#: ../../library/dis.rst:69 +#: ../../library/dis.rst:77 msgid "Command-line interface" msgstr "" -#: ../../library/dis.rst:71 +#: ../../library/dis.rst:79 msgid "The :mod:`dis` module can be invoked as a script from the command line:" msgstr "" -#: ../../library/dis.rst:77 +#: ../../library/dis.rst:85 msgid "The following options are accepted:" msgstr "" -#: ../../library/dis.rst:83 +#: ../../library/dis.rst:91 msgid "Display usage and exit." msgstr "" -#: ../../library/dis.rst:85 +#: ../../library/dis.rst:93 msgid "" "If :file:`infile` is specified, its disassembled code will be written to " "stdout. Otherwise, disassembly is performed on compiled source code recieved " "from stdin." msgstr "" -#: ../../library/dis.rst:89 +#: ../../library/dis.rst:97 msgid "Bytecode analysis" msgstr "" -#: ../../library/dis.rst:93 +#: ../../library/dis.rst:101 msgid "" "The bytecode analysis API allows pieces of Python code to be wrapped in a :" "class:`Bytecode` object that provides easy access to details of the compiled " "code." msgstr "" -#: ../../library/dis.rst:100 +#: ../../library/dis.rst:108 msgid "" "Analyse the bytecode corresponding to a function, generator, asynchronous " "generator, coroutine, method, string of source code, or a code object (as " "returned by :func:`compile`)." msgstr "" -#: ../../library/dis.rst:104 +#: ../../library/dis.rst:112 msgid "" "This is a convenience wrapper around many of the functions listed below, " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" -#: ../../library/dis.rst:108 ../../library/dis.rst:296 +#: ../../library/dis.rst:116 ../../library/dis.rst:304 msgid "" "If *first_line* is not ``None``, it indicates the line number that should be " "reported for the first source line in the disassembled code. Otherwise, the " @@ -138,71 +152,71 @@ msgid "" "code object." msgstr "" -#: ../../library/dis.rst:113 +#: ../../library/dis.rst:121 msgid "" "If *current_offset* is not ``None``, it refers to an instruction offset in " "the disassembled code. Setting this means :meth:`.dis` will display a " "\"current instruction\" marker against the specified opcode." msgstr "" -#: ../../library/dis.rst:117 +#: ../../library/dis.rst:125 msgid "" "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " "used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:120 +#: ../../library/dis.rst:128 msgid "" "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:125 +#: ../../library/dis.rst:133 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." msgstr "" -#: ../../library/dis.rst:130 +#: ../../library/dis.rst:138 msgid "The compiled code object." msgstr "" -#: ../../library/dis.rst:134 +#: ../../library/dis.rst:142 msgid "The first source line of the code object (if available)" msgstr "" -#: ../../library/dis.rst:138 +#: ../../library/dis.rst:146 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." msgstr "" -#: ../../library/dis.rst:143 +#: ../../library/dis.rst:151 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." msgstr "" -#: ../../library/dis.rst:146 ../../library/dis.rst:186 -#: ../../library/dis.rst:238 +#: ../../library/dis.rst:154 ../../library/dis.rst:194 +#: ../../library/dis.rst:246 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" -#: ../../library/dis.rst:149 ../../library/dis.rst:241 -#: ../../library/dis.rst:257 ../../library/dis.rst:284 -#: ../../library/dis.rst:305 +#: ../../library/dis.rst:157 ../../library/dis.rst:249 +#: ../../library/dis.rst:265 ../../library/dis.rst:292 +#: ../../library/dis.rst:313 msgid "Added the *show_caches* and *adaptive* parameters." msgstr "新增 *show_caches* 與 *adaptive* 參數。" -#: ../../library/dis.rst:152 +#: ../../library/dis.rst:160 msgid "Example:" msgstr "範例:" -#: ../../library/dis.rst:168 +#: ../../library/dis.rst:176 msgid "Analysis functions" msgstr "" -#: ../../library/dis.rst:170 +#: ../../library/dis.rst:178 msgid "" "The :mod:`dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " @@ -210,39 +224,39 @@ msgid "" "isn't useful:" msgstr "" -#: ../../library/dis.rst:176 +#: ../../library/dis.rst:184 msgid "" "Return a formatted multi-line string with detailed code object information " "for the supplied function, generator, asynchronous generator, coroutine, " "method, source code string or code object." msgstr "" -#: ../../library/dis.rst:180 +#: ../../library/dis.rst:188 msgid "" "Note that the exact contents of code info strings are highly implementation " "dependent and they may change arbitrarily across Python VMs or Python " "releases." msgstr "" -#: ../../library/dis.rst:192 +#: ../../library/dis.rst:200 msgid "" "Print detailed code object information for the supplied function, method, " "source code string or code object to *file* (or ``sys.stdout`` if *file* is " "not specified)." msgstr "" -#: ../../library/dis.rst:196 +#: ../../library/dis.rst:204 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." msgstr "" -#: ../../library/dis.rst:201 ../../library/dis.rst:232 -#: ../../library/dis.rst:254 ../../library/dis.rst:281 +#: ../../library/dis.rst:209 ../../library/dis.rst:240 +#: ../../library/dis.rst:262 ../../library/dis.rst:289 msgid "Added *file* parameter." msgstr "新增 *file* 參數。" -#: ../../library/dis.rst:207 +#: ../../library/dis.rst:215 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -258,127 +272,127 @@ msgid "" "disassembles the last traceback." msgstr "" -#: ../../library/dis.rst:220 ../../library/dis.rst:251 -#: ../../library/dis.rst:278 +#: ../../library/dis.rst:228 ../../library/dis.rst:259 +#: ../../library/dis.rst:286 msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." msgstr "" -#: ../../library/dis.rst:223 +#: ../../library/dis.rst:231 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" -#: ../../library/dis.rst:226 +#: ../../library/dis.rst:234 msgid "" "If *show_caches* is ``True``, this function will display inline cache " "entries used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:229 +#: ../../library/dis.rst:237 msgid "" "If *adaptive* is ``True``, this function will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:235 +#: ../../library/dis.rst:243 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" -#: ../../library/dis.rst:247 +#: ../../library/dis.rst:255 msgid "" "Disassemble the top-of-stack function of a traceback, using the last " "traceback if none was passed. The instruction causing the exception is " "indicated." msgstr "" -#: ../../library/dis.rst:264 +#: ../../library/dis.rst:272 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" msgstr "" -#: ../../library/dis.rst:267 +#: ../../library/dis.rst:275 msgid "the line number, for the first instruction of each line" msgstr "" -#: ../../library/dis.rst:268 +#: ../../library/dis.rst:276 msgid "the current instruction, indicated as ``-->``," msgstr "" -#: ../../library/dis.rst:269 +#: ../../library/dis.rst:277 msgid "a labelled instruction, indicated with ``>>``," msgstr "" -#: ../../library/dis.rst:270 +#: ../../library/dis.rst:278 msgid "the address of the instruction," msgstr "" -#: ../../library/dis.rst:271 +#: ../../library/dis.rst:279 msgid "the operation code name," msgstr "" -#: ../../library/dis.rst:272 +#: ../../library/dis.rst:280 msgid "operation parameters, and" msgstr "" -#: ../../library/dis.rst:273 +#: ../../library/dis.rst:281 msgid "interpretation of the parameters in parentheses." msgstr "" -#: ../../library/dis.rst:275 +#: ../../library/dis.rst:283 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." msgstr "" -#: ../../library/dis.rst:290 +#: ../../library/dis.rst:298 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." msgstr "" -#: ../../library/dis.rst:293 +#: ../../library/dis.rst:301 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." msgstr "" -#: ../../library/dis.rst:301 +#: ../../library/dis.rst:309 msgid "" "The *show_caches* and *adaptive* parameters work as they do in :func:`dis`." msgstr "" -#: ../../library/dis.rst:311 +#: ../../library/dis.rst:319 msgid "" "This generator function uses the ``co_lines`` method of the code object " "*code* to find the offsets which are starts of lines in the source code. " "They are generated as ``(offset, lineno)`` pairs." msgstr "" -#: ../../library/dis.rst:315 +#: ../../library/dis.rst:323 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: ../../library/dis.rst:318 +#: ../../library/dis.rst:326 msgid "" "The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno`` " "and ``co_lnotab`` attributes of the code object." msgstr "" -#: ../../library/dis.rst:325 +#: ../../library/dis.rst:333 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:331 +#: ../../library/dis.rst:339 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: ../../library/dis.rst:333 +#: ../../library/dis.rst:341 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -386,118 +400,122 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:340 +#: ../../library/dis.rst:348 msgid "Added *jump* parameter." msgstr "新增 *jump* 參數。" -#: ../../library/dis.rst:347 +#: ../../library/dis.rst:355 msgid "Python Bytecode Instructions" msgstr "" -#: ../../library/dis.rst:349 +#: ../../library/dis.rst:357 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: ../../library/dis.rst:354 +#: ../../library/dis.rst:362 msgid "Details for a bytecode operation" msgstr "" -#: ../../library/dis.rst:358 +#: ../../library/dis.rst:366 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: ../../library/dis.rst:364 +#: ../../library/dis.rst:372 msgid "human readable name for operation" msgstr "" -#: ../../library/dis.rst:369 +#: ../../library/dis.rst:377 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:374 +#: ../../library/dis.rst:382 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:379 +#: ../../library/dis.rst:387 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" -#: ../../library/dis.rst:385 +#: ../../library/dis.rst:393 msgid "start index of operation within bytecode sequence" msgstr "" -#: ../../library/dis.rst:390 +#: ../../library/dis.rst:398 msgid "line started by this opcode (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:395 +#: ../../library/dis.rst:403 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:400 +#: ../../library/dis.rst:408 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" -#: ../../library/dis.rst:407 +#: ../../library/dis.rst:415 msgid "Field ``positions`` is added." msgstr "" -#: ../../library/dis.rst:412 +#: ../../library/dis.rst:420 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" -#: ../../library/dis.rst:422 +#: ../../library/dis.rst:430 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: ../../library/dis.rst:425 +#: ../../library/dis.rst:433 msgid "**General instructions**" msgstr "" -#: ../../library/dis.rst:427 +#: ../../library/dis.rst:435 msgid "" "In the following, We will refer to the interpreter stack as ``STACK`` and " "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" -#: ../../library/dis.rst:433 +#: ../../library/dis.rst:441 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" -#: ../../library/dis.rst:439 +#: ../../library/dis.rst:447 msgid "Removes the top-of-stack item::" msgstr "" -#: ../../library/dis.rst:446 +#: ../../library/dis.rst:454 msgid "" "Removes the top two values from the stack. Equivalent to ``POP_TOP``; " "``POP_TOP``. Used to clean up at the end of loops, hence the name." msgstr "" -#: ../../library/dis.rst:455 +#: ../../library/dis.rst:463 +msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." +msgstr "" + +#: ../../library/dis.rst:471 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" -#: ../../library/dis.rst:466 +#: ../../library/dis.rst:482 msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: ../../library/dis.rst:475 +#: ../../library/dis.rst:491 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -505,91 +523,91 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: ../../library/dis.rst:480 +#: ../../library/dis.rst:496 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: ../../library/dis.rst:484 +#: ../../library/dis.rst:500 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: ../../library/dis.rst:491 +#: ../../library/dis.rst:507 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:493 +#: ../../library/dis.rst:509 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:499 +#: ../../library/dis.rst:515 msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "" -#: ../../library/dis.rst:504 +#: ../../library/dis.rst:520 msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:509 +#: ../../library/dis.rst:525 msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "" -#: ../../library/dis.rst:514 +#: ../../library/dis.rst:530 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:519 +#: ../../library/dis.rst:535 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:525 +#: ../../library/dis.rst:541 msgid "**Binary and in-place operations**" msgstr "" -#: ../../library/dis.rst:527 +#: ../../library/dis.rst:543 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" -#: ../../library/dis.rst:530 +#: ../../library/dis.rst:546 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:537 +#: ../../library/dis.rst:553 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" -#: ../../library/dis.rst:549 ../../library/dis.rst:558 -#: ../../library/dis.rst:568 ../../library/dis.rst:576 -#: ../../library/dis.rst:588 ../../library/dis.rst:676 -#: ../../library/dis.rst:686 ../../library/dis.rst:696 -#: ../../library/dis.rst:916 ../../library/dis.rst:927 -#: ../../library/dis.rst:1027 ../../library/dis.rst:1039 -#: ../../library/dis.rst:1051 +#: ../../library/dis.rst:565 ../../library/dis.rst:574 +#: ../../library/dis.rst:584 ../../library/dis.rst:592 +#: ../../library/dis.rst:604 ../../library/dis.rst:692 +#: ../../library/dis.rst:702 ../../library/dis.rst:712 +#: ../../library/dis.rst:932 ../../library/dis.rst:943 +#: ../../library/dis.rst:1043 ../../library/dis.rst:1055 +#: ../../library/dis.rst:1067 msgid "Implements::" msgstr "" -#: ../../library/dis.rst:599 +#: ../../library/dis.rst:615 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:603 +#: ../../library/dis.rst:619 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " @@ -597,39 +615,39 @@ msgid "" "resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:608 +#: ../../library/dis.rst:624 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: ../../library/dis.rst:611 +#: ../../library/dis.rst:627 msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: ../../library/dis.rst:612 +#: ../../library/dis.rst:628 msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: ../../library/dis.rst:616 +#: ../../library/dis.rst:632 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: ../../library/dis.rst:622 +#: ../../library/dis.rst:638 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: ../../library/dis.rst:625 +#: ../../library/dis.rst:641 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:632 +#: ../../library/dis.rst:648 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:640 +#: ../../library/dis.rst:656 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " @@ -637,13 +655,13 @@ msgid "" "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:647 ../../library/dis.rst:752 -#: ../../library/dis.rst:763 +#: ../../library/dis.rst:663 ../../library/dis.rst:768 +#: ../../library/dis.rst:779 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:653 +#: ../../library/dis.rst:669 msgid "" "Handles an exception raised during a :meth:`~generator.throw` or :meth:" "`~generator.close` call through the current frame. If ``STACK[-1]`` is an " @@ -651,35 +669,35 @@ msgid "" "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:663 +#: ../../library/dis.rst:679 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " "``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" -#: ../../library/dis.rst:672 +#: ../../library/dis.rst:688 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:681 +#: ../../library/dis.rst:697 msgid "Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:691 +#: ../../library/dis.rst:707 msgid "Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:702 +#: ../../library/dis.rst:718 msgid "Used to implement dict comprehensions." msgstr "" -#: ../../library/dis.rst:705 +#: ../../library/dis.rst:721 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" -#: ../../library/dis.rst:709 +#: ../../library/dis.rst:725 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -687,29 +705,29 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:717 +#: ../../library/dis.rst:733 msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:722 +#: ../../library/dis.rst:738 msgid "Returns with ``co_consts[consti]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:729 +#: ../../library/dis.rst:745 msgid "Yields ``STACK.pop()`` from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:731 +#: ../../library/dis.rst:747 msgid "oparg set to be the stack depth." msgstr "" -#: ../../library/dis.rst:734 +#: ../../library/dis.rst:750 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" -#: ../../library/dis.rst:740 +#: ../../library/dis.rst:756 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -717,39 +735,39 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:750 +#: ../../library/dis.rst:766 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:757 +#: ../../library/dis.rst:773 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "pops an additional value from the stack which is used to set ``f_lasti`` of " "the current frame." msgstr "" -#: ../../library/dis.rst:768 +#: ../../library/dis.rst:784 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: ../../library/dis.rst:776 +#: ../../library/dis.rst:792 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" -#: ../../library/dis.rst:784 +#: ../../library/dis.rst:800 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:787 +#: ../../library/dis.rst:803 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -757,7 +775,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:796 +#: ../../library/dis.rst:812 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -765,25 +783,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:803 +#: ../../library/dis.rst:819 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:810 +#: ../../library/dis.rst:826 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:818 +#: ../../library/dis.rst:834 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:824 +#: ../../library/dis.rst:840 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -792,11 +810,11 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: ../../library/dis.rst:835 +#: ../../library/dis.rst:851 msgid "Perform ``STACK.append(len(STACK[-1]))``." msgstr "" -#: ../../library/dis.rst:842 +#: ../../library/dis.rst:858 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -804,7 +822,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:852 +#: ../../library/dis.rst:868 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -813,20 +831,20 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:862 +#: ../../library/dis.rst:878 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:868 ../../library/dis.rst:1489 +#: ../../library/dis.rst:884 ../../library/dis.rst:1511 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:875 +#: ../../library/dis.rst:891 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`!co_names` of the :ref:`code object `. The " @@ -834,19 +852,19 @@ msgid "" "possible." msgstr "" -#: ../../library/dis.rst:882 +#: ../../library/dis.rst:898 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`!co_names` " "attribute of the :ref:`code object `." msgstr "" -#: ../../library/dis.rst:888 +#: ../../library/dis.rst:904 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:897 +#: ../../library/dis.rst:913 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -854,11 +872,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:902 +#: ../../library/dis.rst:918 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:904 +#: ../../library/dis.rst:920 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -867,50 +885,50 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:910 +#: ../../library/dis.rst:926 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:922 +#: ../../library/dis.rst:938 msgid "" "where *namei* is the index of name in :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:932 +#: ../../library/dis.rst:948 msgid "" "where *namei* is the index of name into :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:938 +#: ../../library/dis.rst:954 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:943 +#: ../../library/dis.rst:959 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:948 +#: ../../library/dis.rst:964 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:953 +#: ../../library/dis.rst:969 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:959 +#: ../../library/dis.rst:975 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:968 +#: ../../library/dis.rst:984 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -919,69 +937,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:979 +#: ../../library/dis.rst:995 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:989 +#: ../../library/dis.rst:1005 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:994 +#: ../../library/dis.rst:1010 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:999 +#: ../../library/dis.rst:1015 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:1003 +#: ../../library/dis.rst:1019 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:1010 +#: ../../library/dis.rst:1026 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:1019 +#: ../../library/dis.rst:1035 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1032 +#: ../../library/dis.rst:1048 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1044 +#: ../../library/dis.rst:1060 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1056 +#: ../../library/dis.rst:1072 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1063 +#: ../../library/dis.rst:1079 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1070 +#: ../../library/dis.rst:1086 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1073 +#: ../../library/dis.rst:1089 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -992,49 +1010,60 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1081 +#: ../../library/dis.rst:1097 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1088 +#: ../../library/dis.rst:1104 +msgid "" +"This opcode implements :func:`super`, both in its zero-argument and two-" +"argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " +"self).method()``, ``super(cls, self).attr``)." +msgstr "" + +#: ../../library/dis.rst:1108 +msgid "" +"It pops three values from the stack (from top of stack down): - ``self``: " +"the first argument to the current method - ``cls``: the class within which " +"the current method was defined - the global ``super``" +msgstr "" + +#: ../../library/dis.rst:1113 msgid "" -"This opcode implements :func:`super` (e.g. ``super().method()`` and " -"``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " -"``namei`` is shifted left by 2 bits instead of 1, and instead of expecting a " -"single receiver on the stack, it expects three objects (from top of stack " -"down): ``self`` (the first argument to the current method), ``cls`` (the " -"class within which the current method was defined), and the global ``super``." +"With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " +"except that ``namei`` is shifted left by 2 bits instead of 1." msgstr "" -#: ../../library/dis.rst:1095 +#: ../../library/dis.rst:1116 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" -"`LOAD_ATTR`." +"`LOAD_ATTR`, which results in pushing ``None`` and the loaded method. When " +"it is unset a single value is pushed to the stack." msgstr "" -#: ../../library/dis.rst:1098 +#: ../../library/dis.rst:1120 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1106 +#: ../../library/dis.rst:1128 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1112 +#: ../../library/dis.rst:1134 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1119 +#: ../../library/dis.rst:1141 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1126 +#: ../../library/dis.rst:1148 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1043,68 +1072,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1134 +#: ../../library/dis.rst:1156 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1141 +#: ../../library/dis.rst:1163 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1146 +#: ../../library/dis.rst:1168 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1153 +#: ../../library/dis.rst:1175 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1160 +#: ../../library/dis.rst:1182 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1163 ../../library/dis.rst:1176 +#: ../../library/dis.rst:1185 ../../library/dis.rst:1198 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1168 ../../library/dis.rst:1181 -#: ../../library/dis.rst:1194 ../../library/dis.rst:1208 +#: ../../library/dis.rst:1190 ../../library/dis.rst:1203 +#: ../../library/dis.rst:1216 ../../library/dis.rst:1230 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1173 +#: ../../library/dis.rst:1195 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1186 +#: ../../library/dis.rst:1208 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1189 ../../library/dis.rst:1203 +#: ../../library/dis.rst:1211 ../../library/dis.rst:1225 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1200 +#: ../../library/dis.rst:1222 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1213 +#: ../../library/dis.rst:1235 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1112,83 +1141,83 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1218 +#: ../../library/dis.rst:1240 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1223 +#: ../../library/dis.rst:1245 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1225 +#: ../../library/dis.rst:1247 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1231 +#: ../../library/dis.rst:1253 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1233 +#: ../../library/dis.rst:1255 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1239 +#: ../../library/dis.rst:1261 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1247 +#: ../../library/dis.rst:1269 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1255 +#: ../../library/dis.rst:1277 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1260 +#: ../../library/dis.rst:1282 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1265 +#: ../../library/dis.rst:1287 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1273 +#: ../../library/dis.rst:1295 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1276 +#: ../../library/dis.rst:1298 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1279 ../../library/dis.rst:1288 -#: ../../library/dis.rst:1310 ../../library/dis.rst:1321 +#: ../../library/dis.rst:1301 ../../library/dis.rst:1310 +#: ../../library/dis.rst:1332 ../../library/dis.rst:1343 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1285 +#: ../../library/dis.rst:1307 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1294 +#: ../../library/dis.rst:1316 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1198,94 +1227,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1307 +#: ../../library/dis.rst:1329 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1316 +#: ../../library/dis.rst:1338 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1327 +#: ../../library/dis.rst:1349 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1336 +#: ../../library/dis.rst:1358 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1339 +#: ../../library/dis.rst:1361 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1340 +#: ../../library/dis.rst:1362 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1341 +#: ../../library/dis.rst:1363 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1347 +#: ../../library/dis.rst:1369 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1352 +#: ../../library/dis.rst:1374 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1353 ../../library/dis.rst:1359 +#: ../../library/dis.rst:1375 ../../library/dis.rst:1381 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1354 +#: ../../library/dis.rst:1376 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1355 ../../library/dis.rst:1362 +#: ../../library/dis.rst:1377 ../../library/dis.rst:1384 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1357 +#: ../../library/dis.rst:1379 msgid "or:" msgstr "或:" -#: ../../library/dis.rst:1360 +#: ../../library/dis.rst:1382 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1361 +#: ../../library/dis.rst:1383 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1364 +#: ../../library/dis.rst:1386 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1367 +#: ../../library/dis.rst:1389 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1376 +#: ../../library/dis.rst:1398 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1297,70 +1326,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1391 +#: ../../library/dis.rst:1413 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1400 +#: ../../library/dis.rst:1422 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1409 +#: ../../library/dis.rst:1431 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1412 +#: ../../library/dis.rst:1434 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1414 +#: ../../library/dis.rst:1436 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1415 +#: ../../library/dis.rst:1437 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1416 +#: ../../library/dis.rst:1438 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1417 +#: ../../library/dis.rst:1439 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1419 +#: ../../library/dis.rst:1441 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1422 +#: ../../library/dis.rst:1444 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1430 +#: ../../library/dis.rst:1452 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1436 +#: ../../library/dis.rst:1458 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1465 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1448 +#: ../../library/dis.rst:1470 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1368,54 +1397,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1456 +#: ../../library/dis.rst:1478 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1460 +#: ../../library/dis.rst:1482 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1461 +#: ../../library/dis.rst:1483 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1463 +#: ../../library/dis.rst:1485 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1465 +#: ../../library/dis.rst:1487 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1467 +#: ../../library/dis.rst:1489 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1470 +#: ../../library/dis.rst:1492 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1500 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1482 +#: ../../library/dis.rst:1504 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1423,258 +1452,257 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1496 +#: ../../library/dis.rst:1518 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1498 +#: ../../library/dis.rst:1520 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1500 +#: ../../library/dis.rst:1522 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1502 +#: ../../library/dis.rst:1524 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1503 +#: ../../library/dis.rst:1525 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1504 +#: ../../library/dis.rst:1526 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1511 +#: ../../library/dis.rst:1533 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1520 +#: ../../library/dis.rst:1542 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1523 +#: ../../library/dis.rst:1545 msgid "" -"If the call raises :exc:`StopIteration`, pop both items, push the " -"exception's ``value`` attribute, and increment the bytecode counter by " -"*delta*." +"If the call raises :exc:`StopIteration`, pop the top value from the stack, " +"push the exception's ``value`` attribute, and increment the bytecode counter " +"by *delta*." msgstr "" -#: ../../library/dis.rst:1532 +#: ../../library/dis.rst:1554 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1536 +#: ../../library/dis.rst:1558 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1539 +#: ../../library/dis.rst:1561 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1565 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1573 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " -"functionality that is necessary but not performance critical." +"functionality that is not performance critical." msgstr "" -#: ../../library/dis.rst:1555 ../../library/dis.rst:1605 +#: ../../library/dis.rst:1577 ../../library/dis.rst:1631 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 +#: ../../library/dis.rst:1580 ../../library/dis.rst:1634 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 +#: ../../library/dis.rst:1580 ../../library/dis.rst:1634 msgid "Description" msgstr "" -#: ../../library/dis.rst:1560 +#: ../../library/dis.rst:1582 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1560 ../../library/dis.rst:1610 +#: ../../library/dis.rst:1582 ../../library/dis.rst:1636 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1584 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1584 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1587 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1587 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1568 +#: ../../library/dis.rst:1590 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1568 +#: ../../library/dis.rst:1590 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1571 +#: ../../library/dis.rst:1593 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1571 +#: ../../library/dis.rst:1593 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1573 +#: ../../library/dis.rst:1595 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1573 +#: ../../library/dis.rst:1595 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1576 +#: ../../library/dis.rst:1598 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1576 +#: ../../library/dis.rst:1598 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1578 +#: ../../library/dis.rst:1600 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1578 +#: ../../library/dis.rst:1600 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1580 +#: ../../library/dis.rst:1602 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1580 +#: ../../library/dis.rst:1602 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1583 +#: ../../library/dis.rst:1605 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1583 +#: ../../library/dis.rst:1605 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1608 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1608 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1589 +#: ../../library/dis.rst:1611 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1589 +#: ../../library/dis.rst:1611 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1601 +#: ../../library/dis.rst:1623 msgid "" -"Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " -"``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " -"implement functionality that is necessary but not performance critical." +"Calls an intrinsic function with two arguments. Used to implement " +"functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1610 +#: ../../library/dis.rst:1636 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1638 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1638 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1616 +#: ../../library/dis.rst:1642 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1616 +#: ../../library/dis.rst:1642 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1619 +#: ../../library/dis.rst:1645 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1619 +#: ../../library/dis.rst:1645 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1623 +#: ../../library/dis.rst:1649 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1623 +#: ../../library/dis.rst:1649 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1630 +#: ../../library/dis.rst:1656 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1632 +#: ../../library/dis.rst:1658 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1637 +#: ../../library/dis.rst:1663 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1644 +#: ../../library/dis.rst:1670 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1683,75 +1711,76 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1653 +#: ../../library/dis.rst:1679 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1657 +#: ../../library/dis.rst:1683 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1664 +#: ../../library/dis.rst:1690 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1670 +#: ../../library/dis.rst:1696 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1675 +#: ../../library/dis.rst:1701 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1682 +#: ../../library/dis.rst:1708 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1684 +#: ../../library/dis.rst:1710 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1687 +#: ../../library/dis.rst:1713 msgid "" -"The collections now contain pseudo instructions as well. These are opcodes " -"with values ``>= MIN_PSEUDO_OPCODE``." +"The collections now contain pseudo instructions and instrumented " +"instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " +"and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: ../../library/dis.rst:1693 +#: ../../library/dis.rst:1720 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1698 +#: ../../library/dis.rst:1725 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1703 +#: ../../library/dis.rst:1730 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1708 +#: ../../library/dis.rst:1735 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1715 +#: ../../library/dis.rst:1742 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1720 +#: ../../library/dis.rst:1747 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1759,34 +1788,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1728 +#: ../../library/dis.rst:1755 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1733 +#: ../../library/dis.rst:1760 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1738 +#: ../../library/dis.rst:1765 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1743 +#: ../../library/dis.rst:1770 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1748 +#: ../../library/dis.rst:1775 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1752 +#: ../../library/dis.rst:1779 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1428 +#: ../../library/dis.rst:1450 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1428 +#: ../../library/dis.rst:1450 msgid "slice" msgstr "slice(切片)" diff --git a/library/doctest.po b/library/doctest.po index 60db19b76a..64c365b17f 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -240,42 +240,59 @@ msgstr "" #: ../../library/doctest.rst:280 msgid "" -"In addition, if ``M.__test__`` exists and \"is true\", it must be a dict, " -"and each entry maps a (string) name to a function object, class object, or " -"string. Function and class object docstrings found from ``M.__test__`` are " -"searched, and strings are treated as if they were docstrings. In output, a " -"key ``K`` in ``M.__test__`` appears with name ::" +"In addition, there are cases when you want tests to be part of a module but " +"not part of the help text, which requires that the tests not be included in " +"the docstring. Doctest looks for a module-level variable called ``__test__`` " +"and uses it to locate other tests. If ``M.__test__`` exists and is truthy, " +"it must be a dict, and each entry maps a (string) name to a function object, " +"class object, or string. Function and class object docstrings found from ``M." +"__test__`` are searched, and strings are treated as if they were " +"docstrings. In output, a key ``K`` in ``M.__test__`` appears with name ``M." +"__test__.K``." msgstr "" -#: ../../library/doctest.rst:288 +#: ../../library/doctest.rst:289 +msgid "For example, place this block of code at the top of :file:`example.py`:" +msgstr "" + +#: ../../library/doctest.rst:303 +msgid "" +"The value of ``example.__test__[\"numbers\"]`` will be treated as a " +"docstring and all the tests inside it will be run. It is important to note " +"that the value can be mapped to a function, class object, or module; if so, :" +"mod:`!doctest` searches them recursively for docstrings, which are then " +"scanned for tests." +msgstr "" + +#: ../../library/doctest.rst:309 msgid "" "Any classes found are recursively searched similarly, to test docstrings in " "their contained methods and nested classes." msgstr "" -#: ../../library/doctest.rst:295 +#: ../../library/doctest.rst:316 msgid "How are Docstring Examples Recognized?" msgstr "" -#: ../../library/doctest.rst:297 +#: ../../library/doctest.rst:318 msgid "" "In most cases a copy-and-paste of an interactive console session works fine, " "but doctest isn't trying to do an exact emulation of any specific Python " "shell." msgstr "" -#: ../../library/doctest.rst:322 +#: ../../library/doctest.rst:343 msgid "" "Any expected output must immediately follow the final ``'>>> '`` or ``'... " "'`` line containing the code, and the expected output (if any) extends to " "the next ``'>>> '`` or all-whitespace line." msgstr "" -#: ../../library/doctest.rst:326 +#: ../../library/doctest.rst:347 msgid "The fine print:" msgstr "" -#: ../../library/doctest.rst:328 +#: ../../library/doctest.rst:349 msgid "" "Expected output cannot contain an all-whitespace line, since such a line is " "taken to signal the end of expected output. If expected output does contain " @@ -283,7 +300,7 @@ msgid "" "line is expected." msgstr "" -#: ../../library/doctest.rst:333 +#: ../../library/doctest.rst:354 msgid "" "All hard tab characters are expanded to spaces, using 8-column tab stops. " "Tabs in output generated by the tested code are not modified. Because any " @@ -298,20 +315,20 @@ msgid "" "`DocTestParser` class." msgstr "" -#: ../../library/doctest.rst:345 +#: ../../library/doctest.rst:366 msgid "" "Output to stdout is captured, but not output to stderr (exception tracebacks " "are captured via a different means)." msgstr "" -#: ../../library/doctest.rst:348 +#: ../../library/doctest.rst:369 msgid "" "If you continue a line via backslashing in an interactive session, or for " "any other reason use a backslash, you should use a raw docstring, which will " "preserve your backslashes exactly as you type them::" msgstr "" -#: ../../library/doctest.rst:358 +#: ../../library/doctest.rst:379 msgid "" "Otherwise, the backslash will be interpreted as part of the string. For " "example, the ``\\n`` above would be interpreted as a newline character. " @@ -319,21 +336,21 @@ msgid "" "use a raw string)::" msgstr "" -#: ../../library/doctest.rst:368 +#: ../../library/doctest.rst:389 msgid "The starting column doesn't matter::" msgstr "" -#: ../../library/doctest.rst:375 +#: ../../library/doctest.rst:396 msgid "" "and as many leading whitespace characters are stripped from the expected " "output as appeared in the initial ``'>>> '`` line that started the example." msgstr "" -#: ../../library/doctest.rst:382 +#: ../../library/doctest.rst:403 msgid "What's the Execution Context?" msgstr "" -#: ../../library/doctest.rst:384 +#: ../../library/doctest.rst:405 msgid "" "By default, each time :mod:`doctest` finds a docstring to test, it uses a " "*shallow copy* of :mod:`M`'s globals, so that running tests doesn't change " @@ -344,17 +361,17 @@ msgid "" "defined in other docstrings." msgstr "" -#: ../../library/doctest.rst:392 +#: ../../library/doctest.rst:413 msgid "" "You can force use of your own dict as the execution context by passing " "``globs=your_dict`` to :func:`testmod` or :func:`testfile` instead." msgstr "" -#: ../../library/doctest.rst:399 +#: ../../library/doctest.rst:420 msgid "What About Exceptions?" msgstr "" -#: ../../library/doctest.rst:401 +#: ../../library/doctest.rst:422 msgid "" "No problem, provided that the traceback is the only output produced by the " "example: just paste in the traceback. [#]_ Since tracebacks contain details " @@ -363,34 +380,34 @@ msgid "" "it accepts." msgstr "" -#: ../../library/doctest.rst:407 +#: ../../library/doctest.rst:428 msgid "Simple example::" msgstr "" "簡單範例:\n" "\n" "::" -#: ../../library/doctest.rst:414 +#: ../../library/doctest.rst:435 msgid "" "That doctest succeeds if :exc:`ValueError` is raised, with the ``list." "remove(x): x not in list`` detail as shown." msgstr "" -#: ../../library/doctest.rst:417 +#: ../../library/doctest.rst:438 msgid "" "The expected output for an exception must start with a traceback header, " "which may be either of the following two lines, indented the same as the " "first line of the example::" msgstr "" -#: ../../library/doctest.rst:424 +#: ../../library/doctest.rst:445 msgid "" "The traceback header is followed by an optional traceback stack, whose " "contents are ignored by doctest. The traceback stack is typically omitted, " "or copied verbatim from an interactive session." msgstr "" -#: ../../library/doctest.rst:428 +#: ../../library/doctest.rst:449 msgid "" "The traceback stack is followed by the most interesting part: the line(s) " "containing the exception type and detail. This is usually the last line of " @@ -398,20 +415,20 @@ msgid "" "multi-line detail::" msgstr "" -#: ../../library/doctest.rst:440 +#: ../../library/doctest.rst:461 msgid "" "The last three lines (starting with :exc:`ValueError`) are compared against " "the exception's type and detail, and the rest are ignored." msgstr "" -#: ../../library/doctest.rst:443 +#: ../../library/doctest.rst:464 msgid "" "Best practice is to omit the traceback stack, unless it adds significant " "documentation value to the example. So the last example is probably better " "as::" msgstr "" -#: ../../library/doctest.rst:453 +#: ../../library/doctest.rst:474 msgid "" "Note that tracebacks are treated very specially. In particular, in the " "rewritten example, the use of ``...`` is independent of doctest's :const:" @@ -420,11 +437,11 @@ msgid "" "transcript of a Monty Python skit." msgstr "" -#: ../../library/doctest.rst:459 +#: ../../library/doctest.rst:480 msgid "Some details you should read once, but won't need to remember:" msgstr "" -#: ../../library/doctest.rst:461 +#: ../../library/doctest.rst:482 msgid "" "Doctest can't guess whether your expected output came from an exception " "traceback or from ordinary printing. So, e.g., an example that expects " @@ -434,7 +451,7 @@ msgid "" "create real problems." msgstr "" -#: ../../library/doctest.rst:468 +#: ../../library/doctest.rst:489 msgid "" "Each line of the traceback stack (if present) must be indented further than " "the first line of the example, *or* start with a non-alphanumeric character. " @@ -443,14 +460,14 @@ msgid "" "course this does the right thing for genuine tracebacks." msgstr "" -#: ../../library/doctest.rst:474 +#: ../../library/doctest.rst:495 msgid "" "When the :const:`IGNORE_EXCEPTION_DETAIL` doctest option is specified, " "everything following the leftmost colon and any module information in the " "exception name is ignored." msgstr "" -#: ../../library/doctest.rst:478 +#: ../../library/doctest.rst:499 msgid "" "The interactive shell omits the traceback header line for some :exc:" "`SyntaxError`\\ s. But doctest uses the traceback header line to " @@ -459,13 +476,13 @@ msgid "" "need to manually add the traceback header line to your test example." msgstr "" -#: ../../library/doctest.rst:486 +#: ../../library/doctest.rst:507 msgid "" "For some exceptions, Python displays the position of the error using ``^`` " "markers and tildes::" msgstr "" -#: ../../library/doctest.rst:495 +#: ../../library/doctest.rst:516 msgid "" "Since the lines showing the position of the error come before the exception " "type and detail, they are not checked by doctest. For example, the " @@ -473,11 +490,11 @@ msgid "" "location::" msgstr "" -#: ../../library/doctest.rst:510 +#: ../../library/doctest.rst:531 msgid "Option Flags" msgstr "" -#: ../../library/doctest.rst:512 +#: ../../library/doctest.rst:533 msgid "" "A number of option flags control various aspects of doctest's behavior. " "Symbolic names for the flags are supplied as module constants, which can be :" @@ -487,17 +504,17 @@ msgid "" "option." msgstr "" -#: ../../library/doctest.rst:518 +#: ../../library/doctest.rst:539 msgid "The ``-o`` command line option." msgstr "" -#: ../../library/doctest.rst:521 +#: ../../library/doctest.rst:542 msgid "" "The first group of options define test semantics, controlling aspects of how " "doctest decides whether actual output matches an example's expected output:" msgstr "" -#: ../../library/doctest.rst:527 +#: ../../library/doctest.rst:548 msgid "" "By default, if an expected output block contains just ``1``, an actual " "output block containing just ``1`` or just ``True`` is considered to be a " @@ -509,7 +526,7 @@ msgid "" "not for several years." msgstr "" -#: ../../library/doctest.rst:539 +#: ../../library/doctest.rst:560 msgid "" "By default, if an expected output block contains a line containing only the " "string ````, then that line will match a blank line in the actual " @@ -518,7 +535,7 @@ msgid "" "`DONT_ACCEPT_BLANKLINE` is specified, this substitution is not allowed." msgstr "" -#: ../../library/doctest.rst:548 +#: ../../library/doctest.rst:569 msgid "" "When specified, all sequences of whitespace (blanks and newlines) are " "treated as equal. Any sequence of whitespace within the expected output " @@ -528,7 +545,7 @@ msgid "" "across multiple lines in your source." msgstr "" -#: ../../library/doctest.rst:559 +#: ../../library/doctest.rst:580 msgid "" "When specified, an ellipsis marker (``...``) in the expected output can " "match any substring in the actual output. This includes substrings that " @@ -537,14 +554,14 @@ msgid "" "matched too much!\" surprises that ``.*`` is prone to in regular expressions." msgstr "" -#: ../../library/doctest.rst:568 +#: ../../library/doctest.rst:589 msgid "" "When specified, doctests expecting exceptions pass so long as an exception " "of the expected type is raised, even if the details (message and fully " "qualified exception name) don't match." msgstr "" -#: ../../library/doctest.rst:572 +#: ../../library/doctest.rst:593 msgid "" "For example, an example expecting ``ValueError: 42`` will pass if the actual " "exception raised is ``ValueError: 3*14``, but will fail if, say, a :exc:" @@ -554,20 +571,20 @@ msgid "" "these variations will work with the flag specified:" msgstr "" -#: ../../library/doctest.rst:594 +#: ../../library/doctest.rst:615 msgid "" "Note that :const:`ELLIPSIS` can also be used to ignore the details of the " "exception message, but such a test may still fail based on whether the " "module name is present or matches exactly." msgstr "" -#: ../../library/doctest.rst:598 +#: ../../library/doctest.rst:619 msgid "" ":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating " "to the module containing the exception under test." msgstr "" -#: ../../library/doctest.rst:605 +#: ../../library/doctest.rst:626 msgid "" "When specified, do not run the example at all. This can be useful in " "contexts where doctest examples serve as both documentation and test cases, " @@ -576,32 +593,32 @@ msgid "" "might depend on resources which would be unavailable to the test driver." msgstr "" -#: ../../library/doctest.rst:611 +#: ../../library/doctest.rst:632 msgid "" "The SKIP flag can also be used for temporarily \"commenting out\" examples." msgstr "" -#: ../../library/doctest.rst:616 +#: ../../library/doctest.rst:637 msgid "A bitmask or'ing together all the comparison flags above." msgstr "" -#: ../../library/doctest.rst:618 +#: ../../library/doctest.rst:639 msgid "The second group of options controls how test failures are reported:" msgstr "" -#: ../../library/doctest.rst:623 +#: ../../library/doctest.rst:644 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "are displayed using a unified diff." msgstr "" -#: ../../library/doctest.rst:629 +#: ../../library/doctest.rst:650 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "will be displayed using a context diff." msgstr "" -#: ../../library/doctest.rst:635 +#: ../../library/doctest.rst:656 msgid "" "When specified, differences are computed by ``difflib.Differ``, using the " "same algorithm as the popular :file:`ndiff.py` utility. This is the only " @@ -611,7 +628,7 @@ msgid "" "mismatching column positions." msgstr "" -#: ../../library/doctest.rst:644 +#: ../../library/doctest.rst:665 msgid "" "When specified, display the first failing example in each doctest, but " "suppress output for all remaining examples. This will prevent doctest from " @@ -622,7 +639,7 @@ msgid "" "of failures reported; only the output is suppressed." msgstr "" -#: ../../library/doctest.rst:655 +#: ../../library/doctest.rst:676 msgid "" "When specified, exit after the first failing example and don't attempt to " "run the remaining examples. Thus, the number of failures reported will be at " @@ -630,23 +647,23 @@ msgid "" "first failure won't even produce debugging output." msgstr "" -#: ../../library/doctest.rst:660 +#: ../../library/doctest.rst:681 msgid "" "The doctest command line accepts the option ``-f`` as a shorthand for ``-o " "FAIL_FAST``." msgstr "" -#: ../../library/doctest.rst:668 +#: ../../library/doctest.rst:689 msgid "A bitmask or'ing together all the reporting flags above." msgstr "" -#: ../../library/doctest.rst:671 +#: ../../library/doctest.rst:692 msgid "" "There is also a way to register new option flag names, though this isn't " "useful unless you intend to extend :mod:`doctest` internals via subclassing:" msgstr "" -#: ../../library/doctest.rst:677 +#: ../../library/doctest.rst:698 msgid "" "Create a new option flag with a given name, and return the new flag's " "integer value. :func:`register_optionflag` can be used when subclassing :" @@ -655,35 +672,35 @@ msgid "" "be called using the following idiom::" msgstr "" -#: ../../library/doctest.rst:693 +#: ../../library/doctest.rst:714 msgid "Directives" msgstr "" -#: ../../library/doctest.rst:695 +#: ../../library/doctest.rst:716 msgid "" "Doctest directives may be used to modify the :ref:`option flags ` for an individual example. Doctest directives are special Python " "comments following an example's source code:" msgstr "" -#: ../../library/doctest.rst:706 +#: ../../library/doctest.rst:727 msgid "" "Whitespace is not allowed between the ``+`` or ``-`` and the directive " "option name. The directive option name can be any of the option flag names " "explained above." msgstr "" -#: ../../library/doctest.rst:710 +#: ../../library/doctest.rst:731 msgid "" "An example's doctest directives modify doctest's behavior for that single " "example. Use ``+`` to enable the named behavior, or ``-`` to disable it." msgstr "" -#: ../../library/doctest.rst:713 +#: ../../library/doctest.rst:734 msgid "For example, this test passes:" msgstr "" -#: ../../library/doctest.rst:722 +#: ../../library/doctest.rst:743 msgid "" "Without the directive it would fail, both because the actual output doesn't " "have two blanks before the single-digit list elements, and because the " @@ -691,26 +708,26 @@ msgid "" "a directive to do so:" msgstr "" -#: ../../library/doctest.rst:733 +#: ../../library/doctest.rst:754 msgid "" "Multiple directives can be used on a single physical line, separated by " "commas:" msgstr "" -#: ../../library/doctest.rst:742 +#: ../../library/doctest.rst:763 msgid "" "If multiple directive comments are used for a single example, then they are " "combined:" msgstr "" -#: ../../library/doctest.rst:752 +#: ../../library/doctest.rst:773 msgid "" "As the previous example shows, you can add ``...`` lines to your example " "containing only directives. This can be useful when an example is too long " "for a directive to comfortably fit on the same line:" msgstr "" -#: ../../library/doctest.rst:763 +#: ../../library/doctest.rst:784 msgid "" "Note that since all options are disabled by default, and directives apply " "only to the example they appear in, enabling options (via ``+`` in a " @@ -720,11 +737,11 @@ msgid "" "be useful." msgstr "" -#: ../../library/doctest.rst:773 +#: ../../library/doctest.rst:794 msgid "Warnings" msgstr "" -#: ../../library/doctest.rst:775 +#: ../../library/doctest.rst:796 msgid "" ":mod:`doctest` is serious about requiring exact matches in expected output. " "If even a single character doesn't match, the test fails. This will " @@ -734,51 +751,51 @@ msgid "" "test like ::" msgstr "" -#: ../../library/doctest.rst:784 +#: ../../library/doctest.rst:805 msgid "is vulnerable! One workaround is to do ::" msgstr "" -#: ../../library/doctest.rst:789 +#: ../../library/doctest.rst:810 msgid "instead. Another is to do ::" msgstr "" -#: ../../library/doctest.rst:795 +#: ../../library/doctest.rst:816 msgid "There are others, but you get the idea." msgstr "" -#: ../../library/doctest.rst:797 +#: ../../library/doctest.rst:818 msgid "Another bad idea is to print things that embed an object address, like" msgstr "" -#: ../../library/doctest.rst:807 +#: ../../library/doctest.rst:828 msgid "" "The :const:`ELLIPSIS` directive gives a nice approach for the last example:" msgstr "" -#: ../../library/doctest.rst:815 +#: ../../library/doctest.rst:836 msgid "" "Floating-point numbers are also subject to small output variations across " "platforms, because Python defers to the platform C library for float " "formatting, and C libraries vary widely in quality here. ::" msgstr "" -#: ../../library/doctest.rst:826 +#: ../../library/doctest.rst:847 msgid "" "Numbers of the form ``I/2.**J`` are safe across all platforms, and I often " "contrive doctest examples to produce numbers of that form::" msgstr "" -#: ../../library/doctest.rst:832 +#: ../../library/doctest.rst:853 msgid "" "Simple fractions are also easier for people to understand, and that makes " "for better documentation." msgstr "" -#: ../../library/doctest.rst:839 +#: ../../library/doctest.rst:860 msgid "Basic API" msgstr "" -#: ../../library/doctest.rst:841 +#: ../../library/doctest.rst:862 msgid "" "The functions :func:`testmod` and :func:`testfile` provide a simple " "interface to doctest that should be sufficient for most basic uses. For a " @@ -786,25 +803,25 @@ msgid "" "simple-testmod` and :ref:`doctest-simple-testfile`." msgstr "" -#: ../../library/doctest.rst:849 +#: ../../library/doctest.rst:870 msgid "" "All arguments except *filename* are optional, and should be specified in " "keyword form." msgstr "" -#: ../../library/doctest.rst:852 +#: ../../library/doctest.rst:873 msgid "" "Test examples in the file named *filename*. Return ``(failure_count, " "test_count)``." msgstr "" -#: ../../library/doctest.rst:855 +#: ../../library/doctest.rst:876 msgid "" "Optional argument *module_relative* specifies how the filename should be " "interpreted:" msgstr "" -#: ../../library/doctest.rst:858 +#: ../../library/doctest.rst:879 msgid "" "If *module_relative* is ``True`` (the default), then *filename* specifies an " "OS-independent module-relative path. By default, this path is relative to " @@ -814,20 +831,20 @@ msgid "" "absolute path (i.e., it may not begin with ``/``)." msgstr "" -#: ../../library/doctest.rst:865 +#: ../../library/doctest.rst:886 msgid "" "If *module_relative* is ``False``, then *filename* specifies an OS-specific " "path. The path may be absolute or relative; relative paths are resolved " "with respect to the current working directory." msgstr "" -#: ../../library/doctest.rst:869 +#: ../../library/doctest.rst:890 msgid "" "Optional argument *name* gives the name of the test; by default, or if " "``None``, ``os.path.basename(filename)`` is used." msgstr "" -#: ../../library/doctest.rst:872 +#: ../../library/doctest.rst:893 msgid "" "Optional argument *package* is a Python package or the name of a Python " "package whose directory should be used as the base directory for a module-" @@ -836,7 +853,7 @@ msgid "" "is an error to specify *package* if *module_relative* is ``False``." msgstr "" -#: ../../library/doctest.rst:878 +#: ../../library/doctest.rst:899 msgid "" "Optional argument *globs* gives a dict to be used as the globals when " "executing examples. A new shallow copy of this dict is created for the " @@ -844,7 +861,7 @@ msgid "" "``None``, a new empty dict is used." msgstr "" -#: ../../library/doctest.rst:883 +#: ../../library/doctest.rst:904 msgid "" "Optional argument *extraglobs* gives a dict merged into the globals used to " "execute examples. This works like :meth:`dict.update`: if *globs* and " @@ -857,27 +874,27 @@ msgid "" "tested." msgstr "" -#: ../../library/doctest.rst:892 +#: ../../library/doctest.rst:913 msgid "" "Optional argument *verbose* prints lots of stuff if true, and prints only " "failures if false; by default, or if ``None``, it's true if and only if ``'-" "v'`` is in ``sys.argv``." msgstr "" -#: ../../library/doctest.rst:896 +#: ../../library/doctest.rst:917 msgid "" "Optional argument *report* prints a summary at the end when true, else " "prints nothing at the end. In verbose mode, the summary is detailed, else " "the summary is very brief (in fact, empty if all tests passed)." msgstr "" -#: ../../library/doctest.rst:900 +#: ../../library/doctest.rst:921 msgid "" "Optional argument *optionflags* (default value 0) takes the :ref:`bitwise OR " "` of option flags. See section :ref:`doctest-options`." msgstr "" -#: ../../library/doctest.rst:904 +#: ../../library/doctest.rst:925 msgid "" "Optional argument *raise_on_error* defaults to false. If true, an exception " "is raised upon the first failure or unexpected exception in an example. " @@ -885,33 +902,33 @@ msgid "" "continue running examples." msgstr "" -#: ../../library/doctest.rst:909 ../../library/doctest.rst:1049 +#: ../../library/doctest.rst:930 ../../library/doctest.rst:1070 msgid "" "Optional argument *parser* specifies a :class:`DocTestParser` (or subclass) " "that should be used to extract tests from the files. It defaults to a " "normal parser (i.e., ``DocTestParser()``)." msgstr "" -#: ../../library/doctest.rst:913 ../../library/doctest.rst:1053 +#: ../../library/doctest.rst:934 ../../library/doctest.rst:1074 msgid "" "Optional argument *encoding* specifies an encoding that should be used to " "convert the file to unicode." msgstr "" -#: ../../library/doctest.rst:919 +#: ../../library/doctest.rst:940 msgid "" "All arguments are optional, and all except for *m* should be specified in " "keyword form." msgstr "" -#: ../../library/doctest.rst:922 +#: ../../library/doctest.rst:943 msgid "" "Test examples in docstrings in functions and classes reachable from module " "*m* (or module :mod:`__main__` if *m* is not supplied or is ``None``), " "starting with ``m.__doc__``." msgstr "" -#: ../../library/doctest.rst:926 +#: ../../library/doctest.rst:947 msgid "" "Also test examples reachable from dict ``m.__test__``, if it exists and is " "not ``None``. ``m.__test__`` maps names (strings) to functions, classes and " @@ -919,22 +936,22 @@ msgid "" "are searched directly, as if they were docstrings." msgstr "" -#: ../../library/doctest.rst:931 +#: ../../library/doctest.rst:952 msgid "" "Only docstrings attached to objects belonging to module *m* are searched." msgstr "" -#: ../../library/doctest.rst:933 +#: ../../library/doctest.rst:954 msgid "Return ``(failure_count, test_count)``." msgstr "" -#: ../../library/doctest.rst:935 +#: ../../library/doctest.rst:956 msgid "" "Optional argument *name* gives the name of the module; by default, or if " "``None``, ``m.__name__`` is used." msgstr "" -#: ../../library/doctest.rst:938 +#: ../../library/doctest.rst:959 msgid "" "Optional argument *exclude_empty* defaults to false. If true, objects for " "which no doctests are found are excluded from consideration. The default is " @@ -944,39 +961,39 @@ msgid "" "class:`DocTestFinder` constructor defaults to true." msgstr "" -#: ../../library/doctest.rst:945 +#: ../../library/doctest.rst:966 msgid "" "Optional arguments *extraglobs*, *verbose*, *report*, *optionflags*, " "*raise_on_error*, and *globs* are the same as for function :func:`testfile` " "above, except that *globs* defaults to ``m.__dict__``." msgstr "" -#: ../../library/doctest.rst:952 +#: ../../library/doctest.rst:973 msgid "" "Test examples associated with object *f*; for example, *f* may be a string, " "a module, a function, or a class object." msgstr "" -#: ../../library/doctest.rst:955 +#: ../../library/doctest.rst:976 msgid "" "A shallow copy of dictionary argument *globs* is used for the execution " "context." msgstr "" -#: ../../library/doctest.rst:957 +#: ../../library/doctest.rst:978 msgid "" "Optional argument *name* is used in failure messages, and defaults to " "``\"NoName\"``." msgstr "" -#: ../../library/doctest.rst:960 +#: ../../library/doctest.rst:981 msgid "" "If optional argument *verbose* is true, output is generated even if there " "are no failures. By default, output is generated only in case of an example " "failure." msgstr "" -#: ../../library/doctest.rst:963 +#: ../../library/doctest.rst:984 msgid "" "Optional argument *compileflags* gives the set of flags that should be used " "by the Python compiler when running the examples. By default, or if " @@ -984,16 +1001,16 @@ msgid "" "found in *globs*." msgstr "" -#: ../../library/doctest.rst:967 +#: ../../library/doctest.rst:988 msgid "" "Optional argument *optionflags* works as for function :func:`testfile` above." msgstr "" -#: ../../library/doctest.rst:973 +#: ../../library/doctest.rst:994 msgid "Unittest API" msgstr "" -#: ../../library/doctest.rst:975 +#: ../../library/doctest.rst:996 msgid "" "As your collection of doctest'ed modules grows, you'll want a way to run all " "their doctests systematically. :mod:`doctest` provides two functions that " @@ -1002,19 +1019,19 @@ msgid "" "discovery, include a :func:`load_tests` function in your test module::" msgstr "" -#: ../../library/doctest.rst:989 +#: ../../library/doctest.rst:1010 msgid "" "There are two main functions for creating :class:`unittest.TestSuite` " "instances from text files and modules with doctests:" msgstr "" -#: ../../library/doctest.rst:995 +#: ../../library/doctest.rst:1016 msgid "" "Convert doctest tests from one or more text files to a :class:`unittest." "TestSuite`." msgstr "" -#: ../../library/doctest.rst:998 +#: ../../library/doctest.rst:1019 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs the interactive examples in each file. If an example in " @@ -1023,21 +1040,21 @@ msgid "" "containing the test and a (sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:1004 +#: ../../library/doctest.rst:1025 msgid "Pass one or more paths (as strings) to text files to be examined." msgstr "" -#: ../../library/doctest.rst:1006 +#: ../../library/doctest.rst:1027 msgid "Options may be provided as keyword arguments:" msgstr "" -#: ../../library/doctest.rst:1008 +#: ../../library/doctest.rst:1029 msgid "" "Optional argument *module_relative* specifies how the filenames in *paths* " "should be interpreted:" msgstr "" -#: ../../library/doctest.rst:1011 +#: ../../library/doctest.rst:1032 msgid "" "If *module_relative* is ``True`` (the default), then each filename in " "*paths* specifies an OS-independent module-relative path. By default, this " @@ -1048,14 +1065,14 @@ msgid "" "``)." msgstr "" -#: ../../library/doctest.rst:1019 +#: ../../library/doctest.rst:1040 msgid "" "If *module_relative* is ``False``, then each filename in *paths* specifies " "an OS-specific path. The path may be absolute or relative; relative paths " "are resolved with respect to the current working directory." msgstr "" -#: ../../library/doctest.rst:1023 +#: ../../library/doctest.rst:1044 msgid "" "Optional argument *package* is a Python package or the name of a Python " "package whose directory should be used as the base directory for module-" @@ -1065,7 +1082,7 @@ msgid "" "``False``." msgstr "" -#: ../../library/doctest.rst:1030 +#: ../../library/doctest.rst:1051 msgid "" "Optional argument *setUp* specifies a set-up function for the test suite. " "This is called before running the tests in each file. The *setUp* function " @@ -1073,7 +1090,7 @@ msgid "" "test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1035 +#: ../../library/doctest.rst:1056 msgid "" "Optional argument *tearDown* specifies a tear-down function for the test " "suite. This is called after running the tests in each file. The *tearDown* " @@ -1081,14 +1098,14 @@ msgid "" "access the test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1040 ../../library/doctest.rst:1074 +#: ../../library/doctest.rst:1061 ../../library/doctest.rst:1095 msgid "" "Optional argument *globs* is a dictionary containing the initial global " "variables for the tests. A new copy of this dictionary is created for each " "test. By default, *globs* is a new empty dictionary." msgstr "" -#: ../../library/doctest.rst:1044 +#: ../../library/doctest.rst:1065 msgid "" "Optional argument *optionflags* specifies the default doctest options for " "the tests, created by or-ing together individual option flags. See section :" @@ -1096,17 +1113,17 @@ msgid "" "for a better way to set reporting options." msgstr "" -#: ../../library/doctest.rst:1056 +#: ../../library/doctest.rst:1077 msgid "" "The global ``__file__`` is added to the globals provided to doctests loaded " "from a text file using :func:`DocFileSuite`." msgstr "" -#: ../../library/doctest.rst:1062 +#: ../../library/doctest.rst:1083 msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`." msgstr "" -#: ../../library/doctest.rst:1064 +#: ../../library/doctest.rst:1085 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs each doctest in the module. If any of the doctests fail, " @@ -1115,42 +1132,42 @@ msgid "" "(sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:1070 +#: ../../library/doctest.rst:1091 msgid "" "Optional argument *module* provides the module to be tested. It can be a " "module object or a (possibly dotted) module name. If not specified, the " "module calling this function is used." msgstr "" -#: ../../library/doctest.rst:1078 +#: ../../library/doctest.rst:1099 msgid "" "Optional argument *extraglobs* specifies an extra set of global variables, " "which is merged into *globs*. By default, no extra globals are used." msgstr "" -#: ../../library/doctest.rst:1081 +#: ../../library/doctest.rst:1102 msgid "" "Optional argument *test_finder* is the :class:`DocTestFinder` object (or a " "drop-in replacement) that is used to extract doctests from the module." msgstr "" -#: ../../library/doctest.rst:1084 +#: ../../library/doctest.rst:1105 msgid "" "Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as " "for function :func:`DocFileSuite` above." msgstr "" -#: ../../library/doctest.rst:1087 +#: ../../library/doctest.rst:1108 msgid "This function uses the same search technique as :func:`testmod`." msgstr "" -#: ../../library/doctest.rst:1089 +#: ../../library/doctest.rst:1110 msgid "" ":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if " "*module* contains no docstrings instead of raising :exc:`ValueError`." msgstr "" -#: ../../library/doctest.rst:1094 +#: ../../library/doctest.rst:1115 msgid "" "Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` " "out of :class:`doctest.DocTestCase` instances, and :class:`DocTestCase` is a " @@ -1159,14 +1176,14 @@ msgid "" "questions about the exact details of :mod:`unittest` integration." msgstr "" -#: ../../library/doctest.rst:1100 +#: ../../library/doctest.rst:1121 msgid "" "Similarly, :func:`DocFileSuite` creates a :class:`unittest.TestSuite` out " "of :class:`doctest.DocFileCase` instances, and :class:`DocFileCase` is a " "subclass of :class:`DocTestCase`." msgstr "" -#: ../../library/doctest.rst:1104 +#: ../../library/doctest.rst:1125 msgid "" "So both ways of creating a :class:`unittest.TestSuite` run instances of :" "class:`DocTestCase`. This is important for a subtle reason: when you run :" @@ -1179,23 +1196,23 @@ msgid "" "through :mod:`unittest` to :mod:`doctest` test runners." msgstr "" -#: ../../library/doctest.rst:1114 +#: ../../library/doctest.rst:1135 msgid "" "For this reason, :mod:`doctest` also supports a notion of :mod:`doctest` " "reporting flags specific to :mod:`unittest` support, via this function:" msgstr "" -#: ../../library/doctest.rst:1120 +#: ../../library/doctest.rst:1141 msgid "Set the :mod:`doctest` reporting flags to use." msgstr "" -#: ../../library/doctest.rst:1122 +#: ../../library/doctest.rst:1143 msgid "" "Argument *flags* takes the :ref:`bitwise OR ` of option flags. See " "section :ref:`doctest-options`. Only \"reporting flags\" can be used." msgstr "" -#: ../../library/doctest.rst:1125 +#: ../../library/doctest.rst:1146 msgid "" "This is a module-global setting, and affects all future doctests run by " "module :mod:`unittest`: the :meth:`runTest` method of :class:`DocTestCase` " @@ -1209,17 +1226,17 @@ msgid "" "`doctest`'s :mod:`unittest` reporting flags are ignored." msgstr "" -#: ../../library/doctest.rst:1136 +#: ../../library/doctest.rst:1157 msgid "" "The value of the :mod:`unittest` reporting flags in effect before the " "function was called is returned by the function." msgstr "" -#: ../../library/doctest.rst:1143 +#: ../../library/doctest.rst:1164 msgid "Advanced API" msgstr "" -#: ../../library/doctest.rst:1145 +#: ../../library/doctest.rst:1166 msgid "" "The basic API is a simple wrapper that's intended to make doctest easy to " "use. It is fairly flexible, and should meet most users' needs; however, if " @@ -1227,85 +1244,85 @@ msgid "" "doctest's capabilities, then you should use the advanced API." msgstr "" -#: ../../library/doctest.rst:1150 +#: ../../library/doctest.rst:1171 msgid "" "The advanced API revolves around two container classes, which are used to " "store the interactive examples extracted from doctest cases:" msgstr "" -#: ../../library/doctest.rst:1153 +#: ../../library/doctest.rst:1174 msgid "" ":class:`Example`: A single Python :term:`statement`, paired with its " "expected output." msgstr "" -#: ../../library/doctest.rst:1156 +#: ../../library/doctest.rst:1177 msgid "" ":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted " "from a single docstring or text file." msgstr "" -#: ../../library/doctest.rst:1159 +#: ../../library/doctest.rst:1180 msgid "" "Additional processing classes are defined to find, parse, and run, and check " "doctest examples:" msgstr "" -#: ../../library/doctest.rst:1162 +#: ../../library/doctest.rst:1183 msgid "" ":class:`DocTestFinder`: Finds all docstrings in a given module, and uses a :" "class:`DocTestParser` to create a :class:`DocTest` from every docstring that " "contains interactive examples." msgstr "" -#: ../../library/doctest.rst:1166 +#: ../../library/doctest.rst:1187 msgid "" ":class:`DocTestParser`: Creates a :class:`DocTest` object from a string " "(such as an object's docstring)." msgstr "" -#: ../../library/doctest.rst:1169 +#: ../../library/doctest.rst:1190 msgid "" ":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and " "uses an :class:`OutputChecker` to verify their output." msgstr "" -#: ../../library/doctest.rst:1172 +#: ../../library/doctest.rst:1193 msgid "" ":class:`OutputChecker`: Compares the actual output from a doctest example " "with the expected output, and decides whether they match." msgstr "" -#: ../../library/doctest.rst:1175 +#: ../../library/doctest.rst:1196 msgid "" "The relationships among these processing classes are summarized in the " "following diagram::" msgstr "" -#: ../../library/doctest.rst:1191 +#: ../../library/doctest.rst:1212 msgid "DocTest Objects" msgstr "DocTest 物件" -#: ../../library/doctest.rst:1196 +#: ../../library/doctest.rst:1217 msgid "" "A collection of doctest examples that should be run in a single namespace. " "The constructor arguments are used to initialize the attributes of the same " "names." msgstr "" -#: ../../library/doctest.rst:1200 +#: ../../library/doctest.rst:1221 msgid "" ":class:`DocTest` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1206 +#: ../../library/doctest.rst:1227 msgid "" "A list of :class:`Example` objects encoding the individual interactive " "Python examples that should be run by this test." msgstr "" -#: ../../library/doctest.rst:1212 +#: ../../library/doctest.rst:1233 msgid "" "The namespace (aka globals) that the examples should be run in. This is a " "dictionary mapping names to values. Any changes to the namespace made by " @@ -1313,57 +1330,57 @@ msgid "" "`globs` after the test is run." msgstr "" -#: ../../library/doctest.rst:1220 +#: ../../library/doctest.rst:1241 msgid "" "A string name identifying the :class:`DocTest`. Typically, this is the name " "of the object or file that the test was extracted from." msgstr "" -#: ../../library/doctest.rst:1226 +#: ../../library/doctest.rst:1247 msgid "" "The name of the file that this :class:`DocTest` was extracted from; or " "``None`` if the filename is unknown, or if the :class:`DocTest` was not " "extracted from a file." msgstr "" -#: ../../library/doctest.rst:1233 +#: ../../library/doctest.rst:1254 msgid "" "The line number within :attr:`filename` where this :class:`DocTest` begins, " "or ``None`` if the line number is unavailable. This line number is zero-" "based with respect to the beginning of the file." msgstr "" -#: ../../library/doctest.rst:1240 +#: ../../library/doctest.rst:1261 msgid "" "The string that the test was extracted from, or ``None`` if the string is " "unavailable, or if the test was not extracted from a string." msgstr "" -#: ../../library/doctest.rst:1247 +#: ../../library/doctest.rst:1268 msgid "Example Objects" msgstr "Example 物件" -#: ../../library/doctest.rst:1252 +#: ../../library/doctest.rst:1273 msgid "" "A single interactive example, consisting of a Python statement and its " "expected output. The constructor arguments are used to initialize the " "attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1257 +#: ../../library/doctest.rst:1278 msgid "" ":class:`Example` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1263 +#: ../../library/doctest.rst:1284 msgid "" "A string containing the example's source code. This source code consists of " "a single Python statement, and always ends with a newline; the constructor " "adds a newline when necessary." msgstr "" -#: ../../library/doctest.rst:1270 +#: ../../library/doctest.rst:1291 msgid "" "The expected output from running the example's source code (either from " "stdout, or a traceback in case of exception). :attr:`want` ends with a " @@ -1371,7 +1388,7 @@ msgid "" "The constructor adds a newline when necessary." msgstr "" -#: ../../library/doctest.rst:1278 +#: ../../library/doctest.rst:1299 msgid "" "The exception message generated by the example, if the example is expected " "to generate an exception; or ``None`` if it is not expected to generate an " @@ -1380,20 +1397,20 @@ msgid "" "unless it's ``None``. The constructor adds a newline if needed." msgstr "" -#: ../../library/doctest.rst:1287 +#: ../../library/doctest.rst:1308 msgid "" "The line number within the string containing this example where the example " "begins. This line number is zero-based with respect to the beginning of the " "containing string." msgstr "" -#: ../../library/doctest.rst:1294 +#: ../../library/doctest.rst:1315 msgid "" "The example's indentation in the containing string, i.e., the number of " "space characters that precede the example's first prompt." msgstr "" -#: ../../library/doctest.rst:1300 +#: ../../library/doctest.rst:1321 msgid "" "A dictionary mapping from option flags to ``True`` or ``False``, which is " "used to override default options for this example. Any option flags not " @@ -1402,11 +1419,11 @@ msgid "" "are set." msgstr "" -#: ../../library/doctest.rst:1309 +#: ../../library/doctest.rst:1330 msgid "DocTestFinder objects" msgstr "DocTestFinder 物件" -#: ../../library/doctest.rst:1314 +#: ../../library/doctest.rst:1335 msgid "" "A processing class used to extract the :class:`DocTest`\\ s that are " "relevant to a given object, from its docstring and the docstrings of its " @@ -1414,48 +1431,48 @@ msgid "" "classes, functions, methods, staticmethods, classmethods, and properties." msgstr "" -#: ../../library/doctest.rst:1319 +#: ../../library/doctest.rst:1340 msgid "" "The optional argument *verbose* can be used to display the objects searched " "by the finder. It defaults to ``False`` (no output)." msgstr "" -#: ../../library/doctest.rst:1322 +#: ../../library/doctest.rst:1343 msgid "" "The optional argument *parser* specifies the :class:`DocTestParser` object " "(or a drop-in replacement) that is used to extract doctests from docstrings." msgstr "" -#: ../../library/doctest.rst:1325 +#: ../../library/doctest.rst:1346 msgid "" "If the optional argument *recurse* is false, then :meth:`DocTestFinder.find` " "will only examine the given object, and not any contained objects." msgstr "" -#: ../../library/doctest.rst:1328 +#: ../../library/doctest.rst:1349 msgid "" "If the optional argument *exclude_empty* is false, then :meth:`DocTestFinder." "find` will include tests for objects with empty docstrings." msgstr "" -#: ../../library/doctest.rst:1332 +#: ../../library/doctest.rst:1353 msgid ":class:`DocTestFinder` defines the following method:" msgstr "" -#: ../../library/doctest.rst:1337 +#: ../../library/doctest.rst:1358 msgid "" "Return a list of the :class:`DocTest`\\ s that are defined by *obj*'s " "docstring, or by any of its contained objects' docstrings." msgstr "" -#: ../../library/doctest.rst:1340 +#: ../../library/doctest.rst:1361 msgid "" "The optional argument *name* specifies the object's name; this name will be " "used to construct names for the returned :class:`DocTest`\\ s. If *name* is " "not specified, then ``obj.__name__`` is used." msgstr "" -#: ../../library/doctest.rst:1344 +#: ../../library/doctest.rst:1365 msgid "" "The optional parameter *module* is the module that contains the given " "object. If the module is not specified or is ``None``, then the test finder " @@ -1463,26 +1480,26 @@ msgid "" "module is used:" msgstr "" -#: ../../library/doctest.rst:1348 +#: ../../library/doctest.rst:1369 msgid "As a default namespace, if *globs* is not specified." msgstr "" -#: ../../library/doctest.rst:1350 +#: ../../library/doctest.rst:1371 msgid "" "To prevent the DocTestFinder from extracting DocTests from objects that are " "imported from other modules. (Contained objects with modules other than " "*module* are ignored.)" msgstr "" -#: ../../library/doctest.rst:1354 +#: ../../library/doctest.rst:1375 msgid "To find the name of the file containing the object." msgstr "" -#: ../../library/doctest.rst:1356 +#: ../../library/doctest.rst:1377 msgid "To help find the line number of the object within its file." msgstr "" -#: ../../library/doctest.rst:1358 +#: ../../library/doctest.rst:1379 msgid "" "If *module* is ``False``, no attempt to find the module will be made. This " "is obscure, of use mostly in testing doctest itself: if *module* is " @@ -1491,7 +1508,7 @@ msgid "" "contained objects will (recursively) be searched for doctests." msgstr "" -#: ../../library/doctest.rst:1364 +#: ../../library/doctest.rst:1385 msgid "" "The globals for each :class:`DocTest` is formed by combining *globs* and " "*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new " @@ -1501,34 +1518,34 @@ msgid "" "defaults to ``{}``." msgstr "" -#: ../../library/doctest.rst:1375 +#: ../../library/doctest.rst:1396 msgid "DocTestParser objects" msgstr "DocTestParser 物件" -#: ../../library/doctest.rst:1380 +#: ../../library/doctest.rst:1401 msgid "" "A processing class used to extract interactive examples from a string, and " "use them to create a :class:`DocTest` object." msgstr "" -#: ../../library/doctest.rst:1384 ../../library/doctest.rst:1452 +#: ../../library/doctest.rst:1405 ../../library/doctest.rst:1473 msgid ":class:`DocTestParser` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1389 +#: ../../library/doctest.rst:1410 msgid "" "Extract all doctest examples from the given string, and collect them into a :" "class:`DocTest` object." msgstr "" -#: ../../library/doctest.rst:1392 +#: ../../library/doctest.rst:1413 msgid "" "*globs*, *name*, *filename*, and *lineno* are attributes for the new :class:" "`DocTest` object. See the documentation for :class:`DocTest` for more " "information." msgstr "" -#: ../../library/doctest.rst:1399 +#: ../../library/doctest.rst:1420 msgid "" "Extract all doctest examples from the given string, and return them as a " "list of :class:`Example` objects. Line numbers are 0-based. The optional " @@ -1536,7 +1553,7 @@ msgid "" "error messages." msgstr "" -#: ../../library/doctest.rst:1406 +#: ../../library/doctest.rst:1427 msgid "" "Divide the given string into examples and intervening text, and return them " "as a list of alternating :class:`Example`\\ s and strings. Line numbers for " @@ -1544,17 +1561,17 @@ msgid "" "name identifying this string, and is only used for error messages." msgstr "" -#: ../../library/doctest.rst:1415 +#: ../../library/doctest.rst:1436 msgid "DocTestRunner objects" msgstr "DocTestRunner 物件" -#: ../../library/doctest.rst:1420 +#: ../../library/doctest.rst:1441 msgid "" "A processing class used to execute and verify the interactive examples in a :" "class:`DocTest`." msgstr "" -#: ../../library/doctest.rst:1423 +#: ../../library/doctest.rst:1444 msgid "" "The comparison between expected outputs and actual outputs is done by an :" "class:`OutputChecker`. This comparison may be customized with a number of " @@ -1564,7 +1581,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/doctest.rst:1429 +#: ../../library/doctest.rst:1450 msgid "" "The test runner's display output can be controlled in two ways. First, an " "output function can be passed to :meth:`TestRunner.run`; this function will " @@ -1575,14 +1592,14 @@ msgid "" "`report_unexpected_exception`, and :meth:`report_failure`." msgstr "" -#: ../../library/doctest.rst:1437 +#: ../../library/doctest.rst:1458 msgid "" "The optional keyword argument *checker* specifies the :class:`OutputChecker` " "object (or drop-in replacement) that should be used to compare the expected " "outputs to the actual outputs of doctest examples." msgstr "" -#: ../../library/doctest.rst:1441 +#: ../../library/doctest.rst:1462 msgid "" "The optional keyword argument *verbose* controls the :class:" "`DocTestRunner`'s verbosity. If *verbose* is ``True``, then information is " @@ -1591,56 +1608,56 @@ msgid "" "verbose output is used iff the command-line switch ``-v`` is used." msgstr "" -#: ../../library/doctest.rst:1447 +#: ../../library/doctest.rst:1468 msgid "" "The optional keyword argument *optionflags* can be used to control how the " "test runner compares expected output to actual output, and how it displays " "failures. For more information, see section :ref:`doctest-options`." msgstr "" -#: ../../library/doctest.rst:1457 +#: ../../library/doctest.rst:1478 msgid "" "Report that the test runner is about to process the given example. This " "method is provided to allow subclasses of :class:`DocTestRunner` to " "customize their output; it should not be called directly." msgstr "" -#: ../../library/doctest.rst:1461 +#: ../../library/doctest.rst:1482 msgid "" "*example* is the example about to be processed. *test* is the test " "*containing example*. *out* is the output function that was passed to :meth:" "`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1468 +#: ../../library/doctest.rst:1489 msgid "" "Report that the given example ran successfully. This method is provided to " "allow subclasses of :class:`DocTestRunner` to customize their output; it " "should not be called directly." msgstr "" -#: ../../library/doctest.rst:1472 ../../library/doctest.rst:1483 +#: ../../library/doctest.rst:1493 ../../library/doctest.rst:1504 msgid "" "*example* is the example about to be processed. *got* is the actual output " "from the example. *test* is the test containing *example*. *out* is the " "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1479 +#: ../../library/doctest.rst:1500 msgid "" "Report that the given example failed. This method is provided to allow " "subclasses of :class:`DocTestRunner` to customize their output; it should " "not be called directly." msgstr "" -#: ../../library/doctest.rst:1490 +#: ../../library/doctest.rst:1511 msgid "" "Report that the given example raised an unexpected exception. This method is " "provided to allow subclasses of :class:`DocTestRunner` to customize their " "output; it should not be called directly." msgstr "" -#: ../../library/doctest.rst:1494 +#: ../../library/doctest.rst:1515 msgid "" "*example* is the example about to be processed. *exc_info* is a tuple " "containing information about the unexpected exception (as returned by :func:" @@ -1648,13 +1665,13 @@ msgid "" "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1502 +#: ../../library/doctest.rst:1523 msgid "" "Run the examples in *test* (a :class:`DocTest` object), and display the " "results using the writer function *out*." msgstr "" -#: ../../library/doctest.rst:1505 +#: ../../library/doctest.rst:1526 msgid "" "The examples are run in the namespace ``test.globs``. If *clear_globs* is " "true (the default), then this namespace will be cleared after the test runs, " @@ -1662,39 +1679,39 @@ msgid "" "after the test completes, then use *clear_globs=False*." msgstr "" -#: ../../library/doctest.rst:1510 +#: ../../library/doctest.rst:1531 msgid "" "*compileflags* gives the set of flags that should be used by the Python " "compiler when running the examples. If not specified, then it will default " "to the set of future-import flags that apply to *globs*." msgstr "" -#: ../../library/doctest.rst:1514 +#: ../../library/doctest.rst:1535 msgid "" "The output of each example is checked using the :class:`DocTestRunner`'s " "output checker, and the results are formatted by the :meth:`DocTestRunner." "report_\\*` methods." msgstr "" -#: ../../library/doctest.rst:1521 +#: ../../library/doctest.rst:1542 msgid "" "Print a summary of all the test cases that have been run by this " "DocTestRunner, and return a :term:`named tuple` ``TestResults(failed, " "attempted)``." msgstr "" -#: ../../library/doctest.rst:1524 +#: ../../library/doctest.rst:1545 msgid "" "The optional *verbose* argument controls how detailed the summary is. If " "the verbosity is not specified, then the :class:`DocTestRunner`'s verbosity " "is used." msgstr "" -#: ../../library/doctest.rst:1531 +#: ../../library/doctest.rst:1552 msgid "OutputChecker objects" msgstr "OutputChecker 物件" -#: ../../library/doctest.rst:1536 +#: ../../library/doctest.rst:1557 msgid "" "A class used to check the whether the actual output from a doctest example " "matches the expected output. :class:`OutputChecker` defines two methods: :" @@ -1703,11 +1720,11 @@ msgid "" "string describing the differences between two outputs." msgstr "" -#: ../../library/doctest.rst:1543 +#: ../../library/doctest.rst:1564 msgid ":class:`OutputChecker` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1547 +#: ../../library/doctest.rst:1568 msgid "" "Return ``True`` iff the actual output from an example (*got*) matches the " "expected output (*want*). These strings are always considered to match if " @@ -1716,28 +1733,28 @@ msgid "" "`doctest-options` for more information about option flags." msgstr "" -#: ../../library/doctest.rst:1556 +#: ../../library/doctest.rst:1577 msgid "" "Return a string describing the differences between the expected output for a " "given example (*example*) and the actual output (*got*). *optionflags* is " "the set of option flags used to compare *want* and *got*." msgstr "" -#: ../../library/doctest.rst:1564 +#: ../../library/doctest.rst:1585 msgid "Debugging" msgstr "" -#: ../../library/doctest.rst:1566 +#: ../../library/doctest.rst:1587 msgid "Doctest provides several mechanisms for debugging doctest examples:" msgstr "" -#: ../../library/doctest.rst:1568 +#: ../../library/doctest.rst:1589 msgid "" "Several functions convert doctests to executable Python programs, which can " "be run under the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1571 +#: ../../library/doctest.rst:1592 msgid "" "The :class:`DebugRunner` class is a subclass of :class:`DocTestRunner` that " "raises an exception for the first failing example, containing information " @@ -1745,13 +1762,13 @@ msgid "" "debugging on the example." msgstr "" -#: ../../library/doctest.rst:1576 +#: ../../library/doctest.rst:1597 msgid "" "The :mod:`unittest` cases generated by :func:`DocTestSuite` support the :" "meth:`debug` method defined by :class:`unittest.TestCase`." msgstr "" -#: ../../library/doctest.rst:1579 +#: ../../library/doctest.rst:1600 msgid "" "You can add a call to :func:`pdb.set_trace` in a doctest example, and you'll " "drop into the Python debugger when that line is executed. Then you can " @@ -1759,21 +1776,21 @@ msgid "" "`a.py` contains just this module docstring::" msgstr "" -#: ../../library/doctest.rst:1594 +#: ../../library/doctest.rst:1615 msgid "Then an interactive Python session may look like this::" msgstr "" -#: ../../library/doctest.rst:1627 +#: ../../library/doctest.rst:1648 msgid "" "Functions that convert doctests to Python code, and possibly run the " "synthesized code under the debugger:" msgstr "" -#: ../../library/doctest.rst:1633 +#: ../../library/doctest.rst:1654 msgid "Convert text with examples to a script." msgstr "" -#: ../../library/doctest.rst:1635 +#: ../../library/doctest.rst:1656 msgid "" "Argument *s* is a string containing doctest examples. The string is " "converted to a Python script, where doctest examples in *s* are converted to " @@ -1781,22 +1798,22 @@ msgid "" "generated script is returned as a string. For example, ::" msgstr "" -#: ../../library/doctest.rst:1650 +#: ../../library/doctest.rst:1671 msgid "displays::" msgstr "" -#: ../../library/doctest.rst:1660 +#: ../../library/doctest.rst:1681 msgid "" "This function is used internally by other functions (see below), but can " "also be useful when you want to transform an interactive Python session into " "a Python script." msgstr "" -#: ../../library/doctest.rst:1667 +#: ../../library/doctest.rst:1688 msgid "Convert the doctest for an object to a script." msgstr "" -#: ../../library/doctest.rst:1669 +#: ../../library/doctest.rst:1690 msgid "" "Argument *module* is a module object, or dotted name of a module, containing " "the object whose doctests are of interest. Argument *name* is the name " @@ -1806,17 +1823,17 @@ msgid "" "module :file:`a.py` contains a top-level function :func:`f`, then ::" msgstr "" -#: ../../library/doctest.rst:1679 +#: ../../library/doctest.rst:1700 msgid "" "prints a script version of function :func:`f`'s docstring, with doctests " "converted to code, and the rest placed in comments." msgstr "" -#: ../../library/doctest.rst:1685 +#: ../../library/doctest.rst:1706 msgid "Debug the doctests for an object." msgstr "" -#: ../../library/doctest.rst:1687 +#: ../../library/doctest.rst:1708 msgid "" "The *module* and *name* arguments are the same as for function :func:" "`testsource` above. The synthesized Python script for the named object's " @@ -1824,13 +1841,13 @@ msgid "" "the control of the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1692 +#: ../../library/doctest.rst:1713 msgid "" "A shallow copy of ``module.__dict__`` is used for both local and global " "execution context." msgstr "" -#: ../../library/doctest.rst:1695 +#: ../../library/doctest.rst:1716 msgid "" "Optional argument *pm* controls whether post-mortem debugging is used. If " "*pm* has a true value, the script file is run directly, and the debugger " @@ -1842,30 +1859,30 @@ msgid "" "to :func:`pdb.run`." msgstr "" -#: ../../library/doctest.rst:1706 +#: ../../library/doctest.rst:1727 msgid "Debug the doctests in a string." msgstr "" -#: ../../library/doctest.rst:1708 +#: ../../library/doctest.rst:1729 msgid "" "This is like function :func:`debug` above, except that a string containing " "doctest examples is specified directly, via the *src* argument." msgstr "" -#: ../../library/doctest.rst:1711 +#: ../../library/doctest.rst:1732 msgid "" "Optional argument *pm* has the same meaning as in function :func:`debug` " "above." msgstr "" -#: ../../library/doctest.rst:1713 +#: ../../library/doctest.rst:1734 msgid "" "Optional argument *globs* gives a dictionary to use as both local and global " "execution context. If not specified, or ``None``, an empty dictionary is " "used. If specified, a shallow copy of the dictionary is used." msgstr "" -#: ../../library/doctest.rst:1718 +#: ../../library/doctest.rst:1739 msgid "" "The :class:`DebugRunner` class, and the special exceptions it may raise, are " "of most interest to testing framework authors, and will only be sketched " @@ -1873,7 +1890,7 @@ msgid "" "(which is a doctest!) for more details:" msgstr "" -#: ../../library/doctest.rst:1726 +#: ../../library/doctest.rst:1747 msgid "" "A subclass of :class:`DocTestRunner` that raises an exception as soon as a " "failure is encountered. If an unexpected exception occurs, an :exc:" @@ -1883,89 +1900,89 @@ msgid "" "the actual output." msgstr "" -#: ../../library/doctest.rst:1733 +#: ../../library/doctest.rst:1754 msgid "" "For information about the constructor parameters and methods, see the " "documentation for :class:`DocTestRunner` in section :ref:`doctest-advanced-" "api`." msgstr "" -#: ../../library/doctest.rst:1736 +#: ../../library/doctest.rst:1757 msgid "" "There are two exceptions that may be raised by :class:`DebugRunner` " "instances:" msgstr "" -#: ../../library/doctest.rst:1741 +#: ../../library/doctest.rst:1762 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example's actual output did not match its expected output. The constructor " "arguments are used to initialize the attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1745 +#: ../../library/doctest.rst:1766 msgid ":exc:`DocTestFailure` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1750 ../../library/doctest.rst:1774 +#: ../../library/doctest.rst:1771 ../../library/doctest.rst:1795 msgid "The :class:`DocTest` object that was being run when the example failed." msgstr "" -#: ../../library/doctest.rst:1755 ../../library/doctest.rst:1779 +#: ../../library/doctest.rst:1776 ../../library/doctest.rst:1800 msgid "The :class:`Example` that failed." msgstr "" -#: ../../library/doctest.rst:1760 +#: ../../library/doctest.rst:1781 msgid "The example's actual output." msgstr "" -#: ../../library/doctest.rst:1765 +#: ../../library/doctest.rst:1786 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example raised an unexpected exception. The constructor arguments are used " "to initialize the attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1769 +#: ../../library/doctest.rst:1790 msgid ":exc:`UnexpectedException` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1784 +#: ../../library/doctest.rst:1805 msgid "" "A tuple containing information about the unexpected exception, as returned " "by :func:`sys.exc_info`." msgstr "" -#: ../../library/doctest.rst:1791 +#: ../../library/doctest.rst:1812 msgid "Soapbox" msgstr "" -#: ../../library/doctest.rst:1793 +#: ../../library/doctest.rst:1814 msgid "" "As mentioned in the introduction, :mod:`doctest` has grown to have three " "primary uses:" msgstr "" -#: ../../library/doctest.rst:1796 +#: ../../library/doctest.rst:1817 msgid "Checking examples in docstrings." msgstr "" -#: ../../library/doctest.rst:1798 +#: ../../library/doctest.rst:1819 msgid "Regression testing." msgstr "" -#: ../../library/doctest.rst:1800 +#: ../../library/doctest.rst:1821 msgid "Executable documentation / literate testing." msgstr "" -#: ../../library/doctest.rst:1802 +#: ../../library/doctest.rst:1823 msgid "" "These uses have different requirements, and it is important to distinguish " "them. In particular, filling your docstrings with obscure test cases makes " "for bad documentation." msgstr "" -#: ../../library/doctest.rst:1806 +#: ../../library/doctest.rst:1827 msgid "" "When writing a docstring, choose docstring examples with care. There's an " "art to this that needs to be learned---it may not be natural at first. " @@ -1977,7 +1994,7 @@ msgid "" "\"harmless\" change." msgstr "" -#: ../../library/doctest.rst:1814 +#: ../../library/doctest.rst:1835 msgid "" "Doctest also makes an excellent tool for regression testing, especially if " "you don't skimp on explanatory text. By interleaving prose and examples, it " @@ -1998,13 +2015,13 @@ msgid "" "different results, blurring the distinction between testing and explaining." msgstr "" -#: ../../library/doctest.rst:1832 +#: ../../library/doctest.rst:1853 msgid "" "Regression testing is best confined to dedicated objects or files. There " "are several options for organizing tests:" msgstr "" -#: ../../library/doctest.rst:1835 +#: ../../library/doctest.rst:1856 msgid "" "Write text files containing test cases as interactive examples, and test the " "files using :func:`testfile` or :func:`DocFileSuite`. This is recommended, " @@ -2012,7 +2029,7 @@ msgid "" "doctest." msgstr "" -#: ../../library/doctest.rst:1840 +#: ../../library/doctest.rst:1861 msgid "" "Define functions named ``_regrtest_topic`` that consist of single " "docstrings, containing test cases for the named topics. These functions can " @@ -2020,13 +2037,13 @@ msgid "" "test file." msgstr "" -#: ../../library/doctest.rst:1844 +#: ../../library/doctest.rst:1865 msgid "" "Define a ``__test__`` dictionary mapping from regression test topics to " "docstrings containing test cases." msgstr "" -#: ../../library/doctest.rst:1847 +#: ../../library/doctest.rst:1868 msgid "" "When you have placed your tests in a module, the module can itself be the " "test runner. When a test fails, you can arrange for your test runner to re-" @@ -2034,53 +2051,53 @@ msgid "" "example of such a test runner::" msgstr "" -#: ../../library/doctest.rst:1869 +#: ../../library/doctest.rst:1890 msgid "Footnotes" msgstr "註解" -#: ../../library/doctest.rst:1870 +#: ../../library/doctest.rst:1891 msgid "" "Examples containing both expected output and an exception are not supported. " "Trying to guess where one ends and the other begins is too error-prone, and " "that also makes for a confusing test." msgstr "" -#: ../../library/doctest.rst:318 +#: ../../library/doctest.rst:339 msgid ">>>" msgstr ">>>" -#: ../../library/doctest.rst:318 +#: ../../library/doctest.rst:339 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/doctest.rst:318 ../../library/doctest.rst:556 +#: ../../library/doctest.rst:339 ../../library/doctest.rst:577 msgid "..." msgstr "..." -#: ../../library/doctest.rst:484 +#: ../../library/doctest.rst:505 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../library/doctest.rst:484 +#: ../../library/doctest.rst:505 msgid "marker" msgstr "marker(標記)" -#: ../../library/doctest.rst:536 +#: ../../library/doctest.rst:557 msgid "" msgstr "" -#: ../../library/doctest.rst:556 ../../library/doctest.rst:686 +#: ../../library/doctest.rst:577 ../../library/doctest.rst:707 msgid "in doctests" msgstr "於 doctests 中" -#: ../../library/doctest.rst:686 +#: ../../library/doctest.rst:707 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/doctest.rst:686 +#: ../../library/doctest.rst:707 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../library/doctest.rst:686 +#: ../../library/doctest.rst:707 msgid "- (minus)" msgstr "- (減號)" diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 9af25c9797..7a2f9ecf06 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -419,8 +419,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:369 msgid "" "Return the value of the named header field. This is identical to :meth:" -"`__getitem__` except that optional *failobj* is returned if the named header " -"is missing (defaults to ``None``)." +"`~object.__getitem__` except that optional *failobj* is returned if the " +"named header is missing (defaults to ``None``)." msgstr "" #: ../../library/email.compat32-message.rst:373 diff --git a/library/email.message.po b/library/email.message.po index 9003644575..5809709c83 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -299,8 +299,8 @@ msgstr "" #: ../../library/email.message.rst:249 msgid "" "Return the value of the named header field. This is identical to :meth:" -"`__getitem__` except that optional *failobj* is returned if the named header " -"is missing (*failobj* defaults to ``None``)." +"`~object.__getitem__` except that optional *failobj* is returned if the " +"named header is missing (*failobj* defaults to ``None``)." msgstr "" #: ../../library/email.message.rst:254 diff --git a/library/enum.po b/library/enum.po index b6f514ad6a..2054456150 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-25 00:03+0000\n" "PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -418,16 +418,15 @@ msgstr "在位元操作時怎麼處理範圍外的值(只有 :class:`Flag` 會 msgid "Returns ``True`` if member belongs to the ``cls``::" msgstr "如果 member 屬於 ``cls`` 則回傳 ``True``: ::" -#: ../../library/enum.rst:204 +#: ../../library/enum.rst:206 msgid "" -"In Python 3.12 it will be possible to check for member values and not just " -"members; until then, a ``TypeError`` will be raised if a non-Enum-member is " -"used in a containment check." +"Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used " +"in a containment check." msgstr "" -"在 Python 3.12 中這可以檢查成員的值,而不只是檢查成員;在此之前,如果用非列舉" -"成員做屬於檢查會引發 ``TypeError``。" +"在 Python 3.12 之前,如果用非列舉成員做屬於檢查 (containment check) 會引發 " +"``TypeError``。" -#: ../../library/enum.rst:210 +#: ../../library/enum.rst:211 msgid "" "Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " "names of the members in *cls*::" @@ -435,46 +434,46 @@ msgstr "" "回傳 ``['__class__', '__doc__', '__members__', '__module__']`` 及 *cls* 的成" "員名稱: ::" -#: ../../library/enum.rst:218 +#: ../../library/enum.rst:219 msgid "" "Returns the Enum member in *cls* matching *name*, or raises a :exc:" "`KeyError`::" msgstr "回傳 *cls* 中符合 *name* 的列舉成員,或引發 :exc:`KeyError`: ::" -#: ../../library/enum.rst:225 +#: ../../library/enum.rst:226 msgid "Returns each member in *cls* in definition order::" msgstr "以定義的順序回傳在 *cls* 中的每個成員: ::" -#: ../../library/enum.rst:232 +#: ../../library/enum.rst:233 msgid "Returns the number of member in *cls*::" msgstr "回傳 *cls* 的成員數量: ::" -#: ../../library/enum.rst:239 +#: ../../library/enum.rst:240 msgid "Returns each member in *cls* in reverse definition order::" msgstr "以跟定義相反的順序回傳 *cls* 的每個成員: ::" -#: ../../library/enum.rst:246 +#: ../../library/enum.rst:247 msgid "Before 3.11 ``enum`` used ``EnumMeta`` type, which is kept as an alias." msgstr "" "在 3.11 之前,``enum`` 使用 ``EnumMeta`` 類型,目前保留此類型當作別名。" -#: ../../library/enum.rst:251 +#: ../../library/enum.rst:252 msgid "*Enum* is the base class for all *enum* enumerations." msgstr "*Enum* 是所有 *enum* 列舉的基礎類別。" -#: ../../library/enum.rst:255 +#: ../../library/enum.rst:256 msgid "The name used to define the ``Enum`` member::" msgstr "用來定義 ``Enum`` 成員的名稱: ::" -#: ../../library/enum.rst:262 +#: ../../library/enum.rst:263 msgid "The value given to the ``Enum`` member::" msgstr "``Enum`` 成員給定的值: ::" -#: ../../library/enum.rst:267 +#: ../../library/enum.rst:268 msgid "Enum member values" msgstr "列舉成員的值" -#: ../../library/enum.rst:269 +#: ../../library/enum.rst:270 msgid "" "Member values can be anything: :class:`int`, :class:`str`, etc. If the " "exact value is unimportant you may use :class:`auto` instances and an " @@ -484,13 +483,13 @@ msgstr "" "重要,你可以使用 :class:`auto` 實例,它會為你選擇合適的值。更多細節請參考 :" "class:`auto`。" -#: ../../library/enum.rst:276 +#: ../../library/enum.rst:277 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "``_ignore_`` 只有在建立的時候用到,在列舉建立完成後會被移除。" -#: ../../library/enum.rst:279 +#: ../../library/enum.rst:280 msgid "" "``_ignore_`` is a list of names that will not become members, and whose " "names will also be removed from the completed enumeration. See :ref:" @@ -499,7 +498,7 @@ msgstr "" "``_ignore_`` 是一個不會變成成員的名稱串列,在列舉建立完成後其名稱會被移除。範" "例請參考 :ref:`TimePeriod `。" -#: ../../library/enum.rst:285 +#: ../../library/enum.rst:286 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" @@ -511,11 +510,11 @@ msgstr "" msgid "name" msgstr "name" -#: ../../library/enum.rst:306 +#: ../../library/enum.rst:307 msgid "The name of the member being defined (e.g. 'RED')." msgstr "定義的成員名稱(例如 'RED')。" -#: ../../library/enum.rst:307 +#: ../../library/enum.rst:308 msgid "The start value for the Enum; the default is 1." msgstr "列舉的開始值,預設為 1。" @@ -523,7 +522,7 @@ msgstr "列舉的開始值,預設為 1。" msgid "count" msgstr "count" -#: ../../library/enum.rst:308 +#: ../../library/enum.rst:309 msgid "The number of members currently defined, not including this one." msgstr "已定義的成員數量,不包含目前這一個。" @@ -531,23 +530,23 @@ msgstr "已定義的成員數量,不包含目前這一個。" msgid "last_values" msgstr "last_values" -#: ../../library/enum.rst:309 +#: ../../library/enum.rst:310 msgid "A list of the previous values." msgstr "一個之前值的串列。" -#: ../../library/enum.rst:311 +#: ../../library/enum.rst:312 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "一個 *staticmethod*,用來決定 :class:`auto` 下一個要回傳的值的: ::" -#: ../../library/enum.rst:327 +#: ../../library/enum.rst:328 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "一個 *classmethod*,用來進一步設定後續的子類別,預設不做任何事。" -#: ../../library/enum.rst:332 +#: ../../library/enum.rst:333 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" @@ -555,7 +554,7 @@ msgstr "" "一個 *classmethod*,用來查詢在 *cls* 裡找不到的值。預設不做任何事,但可以被覆" "寫以實作客製化的搜尋行為: ::" -#: ../../library/enum.rst:354 +#: ../../library/enum.rst:355 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" @@ -563,7 +562,7 @@ msgstr "" "回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" "覆寫: ::" -#: ../../library/enum.rst:370 +#: ../../library/enum.rst:371 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" @@ -571,7 +570,7 @@ msgstr "" "回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" "寫: ::" -#: ../../library/enum.rst:385 +#: ../../library/enum.rst:386 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" @@ -579,17 +578,17 @@ msgstr "" "回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" "傳值,但可以被覆寫: ::" -#: ../../library/enum.rst:400 +#: ../../library/enum.rst:401 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:403 +#: ../../library/enum.rst:404 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:408 +#: ../../library/enum.rst:409 msgid "" "*IntEnum* is the same as *Enum*, but its members are also integers and can " "be used anywhere that an integer can be used. If any integer operation is " @@ -599,13 +598,13 @@ msgstr "" "*IntEnum* 和 *Enum* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。如果 *IntEnum* 成員經過任何整數運算,其結果會失去列舉狀態。" -#: ../../library/enum.rst:429 +#: ../../library/enum.rst:430 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:432 +#: ../../library/enum.rst:433 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " @@ -615,7 +614,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:439 +#: ../../library/enum.rst:440 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -625,7 +624,7 @@ msgstr "" "*StrEnum* 和 *Enum* 一樣,但其成員同時也是字串而可以被用在幾乎所有使用字串的" "地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" -#: ../../library/enum.rst:445 +#: ../../library/enum.rst:446 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -636,13 +635,13 @@ msgstr "" "是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" "你需要使用 ``str(StrEnum.member)``。" -#: ../../library/enum.rst:452 +#: ../../library/enum.rst:453 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" -#: ../../library/enum.rst:457 +#: ../../library/enum.rst:458 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " @@ -652,7 +651,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" -#: ../../library/enum.rst:465 +#: ../../library/enum.rst:466 msgid "" "*Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), " "``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are " @@ -661,43 +660,43 @@ msgstr "" "*Flag* 成員支援位元操作 ``&`` (*AND*)、``|`` (*OR*)、``^`` (*XOR*) 及 ``~`` " "(*INVERT*);這些操作的結果會是列舉成員。" -#: ../../library/enum.rst:471 +#: ../../library/enum.rst:472 msgid "Returns *True* if value is in self::" msgstr "如果 value 在 self 裡則回傳 *True*: ::" -#: ../../library/enum.rst:492 +#: ../../library/enum.rst:493 msgid "Returns all contained non-alias members::" msgstr "回傳所有包含的非別名成員: ::" -#: ../../library/enum.rst:501 +#: ../../library/enum.rst:502 msgid "Aliases are no longer returned during iteration." msgstr "疊代時不會再回傳別名。" -#: ../../library/enum.rst:505 +#: ../../library/enum.rst:506 msgid "Returns number of members in flag::" msgstr "回傳旗標裡的成員數量: ::" -#: ../../library/enum.rst:514 +#: ../../library/enum.rst:515 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" -#: ../../library/enum.rst:526 +#: ../../library/enum.rst:527 msgid "Returns current flag binary or'ed with other::" msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" -#: ../../library/enum.rst:533 +#: ../../library/enum.rst:534 msgid "Returns current flag binary and'ed with other::" msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" -#: ../../library/enum.rst:542 +#: ../../library/enum.rst:543 msgid "Returns current flag binary xor'ed with other::" msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" -#: ../../library/enum.rst:551 +#: ../../library/enum.rst:552 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "回傳所有在 *type(self)* 但不在 self 裡的旗標: ::" -#: ../../library/enum.rst:562 +#: ../../library/enum.rst:563 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." @@ -705,17 +704,17 @@ msgstr "" "用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " "和 :func:`oct`。" -#: ../../library/enum.rst:567 +#: ../../library/enum.rst:568 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:570 +#: ../../library/enum.rst:571 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:578 +#: ../../library/enum.rst:579 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." @@ -723,38 +722,38 @@ msgstr "" "*IntFlag* 和 *Flag* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。" -#: ../../library/enum.rst:592 +#: ../../library/enum.rst:593 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" -#: ../../library/enum.rst:598 +#: ../../library/enum.rst:599 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "如果 *IntFlag* 成員經過 *Flag* 操作且:" -#: ../../library/enum.rst:600 +#: ../../library/enum.rst:601 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" -#: ../../library/enum.rst:601 +#: ../../library/enum.rst:602 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "結果不是合法的 *IntFlag*:結果會根據 *FlagBoundary* 的設定" -#: ../../library/enum.rst:603 +#: ../../library/enum.rst:604 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "未命名且值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:610 +#: ../../library/enum.rst:611 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" ":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:615 +#: ../../library/enum.rst:616 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " @@ -764,7 +763,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:619 +#: ../../library/enum.rst:620 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " @@ -773,7 +772,7 @@ msgstr "" ":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" "旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" -#: ../../library/enum.rst:625 +#: ../../library/enum.rst:626 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" @@ -781,15 +780,15 @@ msgstr "" ":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() `,但使" "用混合資料類型的 :class:`str() `:" -#: ../../library/enum.rst:628 +#: ../../library/enum.rst:629 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" -#: ../../library/enum.rst:629 +#: ../../library/enum.rst:630 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" -#: ../../library/enum.rst:631 +#: ../../library/enum.rst:632 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" @@ -798,7 +797,7 @@ msgstr "" "繼承 :class:`!ReprEnum` 來保留混合資料類型的 :class:`str() ` / :func:" "`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() `。" -#: ../../library/enum.rst:640 +#: ../../library/enum.rst:641 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." @@ -806,17 +805,17 @@ msgstr "" "*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" "制會產生 :exc:`ValueError`。" -#: ../../library/enum.rst:645 +#: ../../library/enum.rst:646 msgid "Ensure that each value has only one name::" msgstr "確保每個值只有一個名稱: ::" -#: ../../library/enum.rst:661 +#: ../../library/enum.rst:662 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" -#: ../../library/enum.rst:676 +#: ../../library/enum.rst:677 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" @@ -824,35 +823,35 @@ msgstr "" "確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " "產生時是很實用的: ::" -#: ../../library/enum.rst:693 +#: ../../library/enum.rst:694 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" -#: ../../library/enum.rst:699 +#: ../../library/enum.rst:700 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "*FlagBoundary* 控制在 *Flag* 及其子類別中如何處理範圍外的值。" -#: ../../library/enum.rst:704 +#: ../../library/enum.rst:705 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" -#: ../../library/enum.rst:722 +#: ../../library/enum.rst:723 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "範圍外的值會移除非法值,留下合法的 *Flag* 值: ::" -#: ../../library/enum.rst:736 +#: ../../library/enum.rst:737 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "範圍外的值會失去它們的 *Flag* 成員資格且恢復成 :class:`int`。" -#: ../../library/enum.rst:749 +#: ../../library/enum.rst:750 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" @@ -860,11 +859,11 @@ msgstr "" "範圍外的值會被保留,*Flag* 成員資格也會被保留。這是 :class:`IntFlag` 的預設行" "為: ::" -#: ../../library/enum.rst:766 +#: ../../library/enum.rst:767 msgid "Supported ``__dunder__`` names" msgstr "支援 ``__dunder__`` 名稱" -#: ../../library/enum.rst:768 +#: ../../library/enum.rst:769 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." @@ -872,7 +871,7 @@ msgstr "" ":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項目的" "對映。只有在類別上可用。" -#: ../../library/enum.rst:771 +#: ../../library/enum.rst:772 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " @@ -882,26 +881,26 @@ msgstr "" "的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" "到。" -#: ../../library/enum.rst:777 +#: ../../library/enum.rst:778 msgid "Supported ``_sunder_`` names" msgstr "支援 ``_sunder_`` 名稱" -#: ../../library/enum.rst:779 +#: ../../library/enum.rst:780 msgid "``_name_`` -- name of the member" msgstr "``_name_`` -- 成員名稱" -#: ../../library/enum.rst:780 +#: ../../library/enum.rst:781 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" -#: ../../library/enum.rst:782 +#: ../../library/enum.rst:783 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "``_missing_`` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" -#: ../../library/enum.rst:784 +#: ../../library/enum.rst:785 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " @@ -910,7 +909,7 @@ msgstr "" "``_ignore_`` -- 可以是 :class:`list` 或 :class:`str` 的名稱串列,它不會被轉換" "成成員,且在最後的類別上會被移除" -#: ../../library/enum.rst:787 +#: ../../library/enum.rst:788 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" @@ -918,20 +917,20 @@ msgstr "" "``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" "別建立時移除)" -#: ../../library/enum.rst:789 +#: ../../library/enum.rst:790 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "``_generate_next_value_`` -- 用來為列舉成員取得合適的值;可以被覆寫" -#: ../../library/enum.rst:794 +#: ../../library/enum.rst:795 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是最後一個看見的值加一。" -#: ../../library/enum.rst:797 +#: ../../library/enum.rst:798 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." @@ -939,19 +938,19 @@ msgstr "" "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方,不管最後" "一個看見的值是什麼。" -#: ../../library/enum.rst:800 +#: ../../library/enum.rst:801 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:801 +#: ../../library/enum.rst:802 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:806 +#: ../../library/enum.rst:807 msgid "Utilities and Decorators" msgstr "通用項目與裝飾器" -#: ../../library/enum.rst:810 +#: ../../library/enum.rst:811 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -967,27 +966,27 @@ msgstr "" "2 的次方的數字;對 *StrEnum* 來說,是成員名稱的小寫版本。如果混用 *auto()* 和" "手動指定值的話要特別注意。" -#: ../../library/enum.rst:818 +#: ../../library/enum.rst:819 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" -#: ../../library/enum.rst:820 +#: ../../library/enum.rst:821 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" -#: ../../library/enum.rst:821 +#: ../../library/enum.rst:822 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" "``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會" -#: ../../library/enum.rst:822 +#: ../../library/enum.rst:823 msgid "used to create the ``SECOND`` enum member;" msgstr "被用來建立列舉成員 ``SECOND``;" -#: ../../library/enum.rst:823 +#: ../../library/enum.rst:824 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" @@ -995,19 +994,19 @@ msgstr "" "``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``, -3`` 會被用來建立列" "舉成員 ``THREE``)" -#: ../../library/enum.rst:828 +#: ../../library/enum.rst:829 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" -#: ../../library/enum.rst:831 +#: ../../library/enum.rst:832 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" -#: ../../library/enum.rst:834 +#: ../../library/enum.rst:835 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " @@ -1016,7 +1015,7 @@ msgstr "" "在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" "是不相容的類型就會失敗。" -#: ../../library/enum.rst:840 +#: ../../library/enum.rst:841 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " @@ -1025,7 +1024,7 @@ msgstr "" "和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" "有相同名稱。" -#: ../../library/enum.rst:844 +#: ../../library/enum.rst:845 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -1035,7 +1034,7 @@ msgstr "" "*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " "*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" -#: ../../library/enum.rst:853 +#: ../../library/enum.rst:854 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " @@ -1045,7 +1044,7 @@ msgstr "" "__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" "`ValueError` 並附上細節: ::" -#: ../../library/enum.rst:871 +#: ../../library/enum.rst:872 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " @@ -1054,15 +1053,15 @@ msgstr "" "專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" "定在裝飾的列舉上應該檢查什麼限制。" -#: ../../library/enum.rst:879 +#: ../../library/enum.rst:880 msgid "A decorator for use in enums: its target will become a member." msgstr "列舉所使用的裝飾器:其目標會變成成員。" -#: ../../library/enum.rst:885 +#: ../../library/enum.rst:886 msgid "A decorator for use in enums: its target will not become a member." msgstr "列舉所使用的裝飾器:其目標不會變成成員。" -#: ../../library/enum.rst:891 +#: ../../library/enum.rst:892 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -1073,19 +1072,19 @@ msgstr "" "組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" "考 :class:`re.RegexFlag`)。" -#: ../../library/enum.rst:901 +#: ../../library/enum.rst:902 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" -#: ../../library/enum.rst:908 +#: ../../library/enum.rst:909 msgid "Notes" msgstr "備註" -#: ../../library/enum.rst:910 +#: ../../library/enum.rst:911 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" -#: ../../library/enum.rst:912 +#: ../../library/enum.rst:913 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" @@ -1093,17 +1092,17 @@ msgstr "" "這三種列舉類型是設計來直接取代現有以整數及字串為基底的值;因此它們有額外的限" "制:" -#: ../../library/enum.rst:915 +#: ../../library/enum.rst:916 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "``__str__`` 使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:917 +#: ../../library/enum.rst:918 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:920 +#: ../../library/enum.rst:921 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" @@ -1111,7 +1110,7 @@ msgstr "" "如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 類型來建立自" "己的基礎類別: ::" -#: ../../library/enum.rst:927 +#: ../../library/enum.rst:928 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" diff --git a/library/fcntl.po b/library/fcntl.po index 2a60f76aa3..8487abb927 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,18 +30,9 @@ msgid "" "`ioctl(2)` Unix manual pages." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" +#: ../../library/fcntl.rst:21 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/fcntl.rst:23 msgid "" @@ -122,7 +113,7 @@ msgstr "" msgid "If the :c:func:`fcntl` fails, an :exc:`OSError` is raised." msgstr "" -#: ../../library/fcntl.rst:96 +#: ../../library/fcntl.rst:85 msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " "``fd``, ``cmd``, ``arg``." @@ -193,7 +184,7 @@ msgstr "" "\n" "::" -#: ../../library/fcntl.rst:147 +#: ../../library/fcntl.rst:136 msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " "``fd``, ``request``, ``arg``." @@ -213,7 +204,7 @@ msgstr "" msgid "If the :c:func:`flock` fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/fcntl.rst:159 +#: ../../library/fcntl.rst:148 msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " "``fd``, ``operation``." @@ -279,7 +270,7 @@ msgid "" "file. The default for *whence* is also 0." msgstr "" -#: ../../library/fcntl.rst:194 +#: ../../library/fcntl.rst:183 msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." @@ -321,3 +312,11 @@ msgstr "file control(檔案控制)" #: ../../library/fcntl.rst:10 msgid "I/O control" msgstr "I/O control(I/O 控制)" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/functions.po b/library/functions.po index 85c5c1ace1..2b6a0f7429 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-07-02 22:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1745,18 +1745,18 @@ msgid "" "differently depending on the presence of the second argument. Without a " "second argument, *object* must be a collection object which supports the :" "term:`iterable` protocol (the :meth:`__iter__` method), or it must support " -"the sequence protocol (the :meth:`__getitem__` method with integer arguments " -"starting at ``0``). If it does not support either of those protocols, :exc:" -"`TypeError` is raised. If the second argument, *sentinel*, is given, then " -"*object* must be a callable object. The iterator created in this case will " -"call *object* with no arguments for each call to its :meth:`~iterator." -"__next__` method; if the value returned is equal to *sentinel*, :exc:" -"`StopIteration` will be raised, otherwise the value will be returned." +"the sequence protocol (the :meth:`~object.__getitem__` method with integer " +"arguments starting at ``0``). If it does not support either of those " +"protocols, :exc:`TypeError` is raised. If the second argument, *sentinel*, " +"is given, then *object* must be a callable object. The iterator created in " +"this case will call *object* with no arguments for each call to its :meth:" +"`~iterator.__next__` method; if the value returned is equal to *sentinel*, :" +"exc:`StopIteration` will be raised, otherwise the value will be returned." msgstr "" "回傳一個 :term:`iterator` 物件。根據是否存在第二個引數,第一個引數的意義是非" "常不同的。如果沒有第二個引數,*object* 必須是支援 :term:`iterable` 協定(有 :" -"meth:`__iter__` method)的集合物件,或必須支援序列協定(有 :meth:" -"`__getitem__` 方法,且數字引數從 ``0`` 開始)。如果它不支援這些協定,會觸發 :" +"meth:`__iter__` method)的集合物件,或必須支援序列協定(有 :meth:`~object." +"__getitem__` 方法,且數字引數從 ``0`` 開始)。如果它不支援這些協定,會觸發 :" "exc:`TypeError`。如果有第二個引數 *sentinel*,那麼 *object* 必須是可呼叫的物" "件,這種情況下生成的 iterator,每次疊代呼叫 :meth:`~iterator.__next__` 時會不" "帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸發 :exc:" @@ -2509,8 +2509,8 @@ msgstr "" msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" -"`__len__` method and the :meth:`__getitem__` method with integer arguments " -"starting at ``0``)." +"`__len__` method and the :meth:`~object.__getitem__` method with integer " +"arguments starting at ``0``)." msgstr "" #: ../../library/functions.rst:1572 diff --git a/library/getpass.po b/library/getpass.po index 828e2edc0d..2b69eeadeb 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2022-02-11 12:04+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -88,15 +88,15 @@ msgstr "回傳使用者的\"登入名稱\"。" #: ../../library/getpass.rst:45 msgid "" "This function checks the environment variables :envvar:`LOGNAME`, :envvar:" -"`USER`, :envvar:`LNAME` and :envvar:`USERNAME`, in order, and returns the " +"`USER`, :envvar:`!LNAME` and :envvar:`USERNAME`, in order, and returns the " "value of the first one which is set to a non-empty string. If none are set, " "the login name from the password database is returned on systems which " "support the :mod:`pwd` module, otherwise, an exception is raised." msgstr "" -"此函式會按順序檢查環境變數 :envvar:`LOGNAME`\\ 、\\ :envvar:`USER`\\ 、\\ :" -"envvar:`LNAME` 和 :envvar:`USERNAME`,並回傳其中第一個被設定成非空字串的值。" -"如果均未設定,則在支援 :mod:`pwd` 模組的系統上將會回傳來自密碼資料庫的登入名" -"稱,否則將引發一個例外。" +"此函式會按順序檢查環境變數 :envvar:`LOGNAME`、:envvar:`USER`、:envvar:`!" +"LNAME` 和 :envvar:`USERNAME`,並回傳其中第一個被設定成非空字串的值。如果均未" +"設定,則在支援 :mod:`pwd` 模組的系統上將會回傳來自密碼資料庫的登入名稱,否則" +"將引發一個例外。" #: ../../library/getpass.rst:52 msgid "" diff --git a/library/grp.po b/library/grp.po index a216d5d66f..7561672a82 100644 --- a/library/grp.po +++ b/library/grp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,18 +28,9 @@ msgid "" "all Unix versions." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" +#: ../../library/grp.rst:13 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/grp.rst:15 msgid "" @@ -159,3 +150,11 @@ msgstr ":mod:`spwd` 模組" #: ../../library/grp.rst:68 msgid "An interface to the shadow password database, similar to this." msgstr "" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/inspect.po b/library/inspect.po index 8f55ff930d..b8d5bf3058 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -911,6 +911,12 @@ msgstr "" #: ../../library/inspect.rst:643 msgid "" +"If the passed object has a ``__signature__`` attribute, this function " +"returns it without further computations." +msgstr "" + +#: ../../library/inspect.rst:646 +msgid "" "For objects defined in modules using stringized annotations (``from " "__future__ import annotations``), :func:`signature` will attempt to " "automatically un-stringize the annotations using :func:`inspect." @@ -920,7 +926,7 @@ msgid "" "instructions on how to use these parameters." msgstr "" -#: ../../library/inspect.rst:652 +#: ../../library/inspect.rst:655 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -929,39 +935,39 @@ msgid "" "exception." msgstr "" -#: ../../library/inspect.rst:658 +#: ../../library/inspect.rst:661 msgid "" "A slash(/) in the signature of a function denotes that the parameters prior " "to it are positional-only. For more info, see :ref:`the FAQ entry on " "positional-only parameters `." msgstr "" -#: ../../library/inspect.rst:662 +#: ../../library/inspect.rst:665 msgid "" "``follow_wrapped`` parameter. Pass ``False`` to get a signature of " "``callable`` specifically (``callable.__wrapped__`` will not be used to " "unwrap decorated callables.)" msgstr "" -#: ../../library/inspect.rst:667 +#: ../../library/inspect.rst:670 msgid "``globals``, ``locals``, and ``eval_str`` parameters." msgstr "" -#: ../../library/inspect.rst:672 +#: ../../library/inspect.rst:675 msgid "" "Some callables may not be introspectable in certain implementations of " "Python. For example, in CPython, some built-in functions defined in C " "provide no metadata about their arguments." msgstr "" -#: ../../library/inspect.rst:679 +#: ../../library/inspect.rst:682 msgid "" "A Signature object represents the call signature of a function and its " "return annotation. For each parameter accepted by the function it stores a :" "class:`Parameter` object in its :attr:`parameters` collection." msgstr "" -#: ../../library/inspect.rst:683 +#: ../../library/inspect.rst:686 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -970,54 +976,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:689 +#: ../../library/inspect.rst:692 msgid "" "The optional *return_annotation* argument, can be an arbitrary Python " "object, is the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:692 +#: ../../library/inspect.rst:695 msgid "" "Signature objects are *immutable*. Use :meth:`Signature.replace` to make a " "modified copy." msgstr "" -#: ../../library/inspect.rst:695 +#: ../../library/inspect.rst:698 msgid "Signature objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:700 +#: ../../library/inspect.rst:703 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:704 +#: ../../library/inspect.rst:707 msgid "" "An ordered mapping of parameters' names to the corresponding :class:" "`Parameter` objects. Parameters appear in strict definition order, " "including keyword-only parameters." msgstr "" -#: ../../library/inspect.rst:708 ../../library/inspect.rst:1034 +#: ../../library/inspect.rst:711 ../../library/inspect.rst:1039 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " "had always been preserved in Python 3." msgstr "" -#: ../../library/inspect.rst:715 +#: ../../library/inspect.rst:718 msgid "" "The \"return\" annotation for the callable. If the callable has no " "\"return\" annotation, this attribute is set to :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:720 +#: ../../library/inspect.rst:723 msgid "" "Create a mapping from positional and keyword arguments to parameters. " "Returns :class:`BoundArguments` if ``*args`` and ``**kwargs`` match the " "signature, or raises a :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:726 +#: ../../library/inspect.rst:729 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -1025,7 +1031,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:733 +#: ../../library/inspect.rst:736 msgid "" "Create a new Signature instance based on the instance :meth:`replace` was " "invoked on. It is possible to pass different ``parameters`` and/or " @@ -1034,7 +1040,7 @@ msgid "" "attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:751 +#: ../../library/inspect.rst:754 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "``obj``. Pass ``follow_wrapped=False`` to get a signature of ``obj`` " @@ -1042,139 +1048,143 @@ msgid "" "will be used as the namespaces when resolving annotations." msgstr "" -#: ../../library/inspect.rst:756 +#: ../../library/inspect.rst:759 msgid "This method simplifies subclassing of :class:`Signature`::" msgstr "" -#: ../../library/inspect.rst:765 +#: ../../library/inspect.rst:766 +msgid "Its behavior is otherwise identical to that of :func:`signature`." +msgstr "" + +#: ../../library/inspect.rst:770 msgid "``globalns`` and ``localns`` parameters." msgstr "" -#: ../../library/inspect.rst:771 +#: ../../library/inspect.rst:776 msgid "" "Parameter objects are *immutable*. Instead of modifying a Parameter object, " "you can use :meth:`Parameter.replace` to create a modified copy." msgstr "" -#: ../../library/inspect.rst:774 +#: ../../library/inspect.rst:779 msgid "Parameter objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:779 +#: ../../library/inspect.rst:784 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:784 +#: ../../library/inspect.rst:789 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:789 +#: ../../library/inspect.rst:794 msgid "" "CPython generates implicit parameter names of the form ``.0`` on the code " "objects used to implement comprehensions and generator expressions." msgstr "" -#: ../../library/inspect.rst:793 +#: ../../library/inspect.rst:798 msgid "" "These parameter names are exposed by this module as names like ``implicit0``." msgstr "" -#: ../../library/inspect.rst:799 +#: ../../library/inspect.rst:804 msgid "" "The default value for the parameter. If the parameter has no default value, " "this attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:804 +#: ../../library/inspect.rst:809 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:809 +#: ../../library/inspect.rst:814 msgid "" "Describes how argument values are bound to the parameter. The possible " "values are accessible via :class:`Parameter` (like ``Parameter." "KEYWORD_ONLY``), and support comparison and ordering, in the following order:" msgstr "" -#: ../../library/inspect.rst:816 +#: ../../library/inspect.rst:821 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:816 +#: ../../library/inspect.rst:821 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:818 +#: ../../library/inspect.rst:823 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:818 +#: ../../library/inspect.rst:823 msgid "" "Value must be supplied as a positional argument. Positional only parameters " "are those which appear before a ``/`` entry (if present) in a Python " "function definition." msgstr "" -#: ../../library/inspect.rst:823 +#: ../../library/inspect.rst:828 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:823 +#: ../../library/inspect.rst:828 msgid "" "Value may be supplied as either a keyword or positional argument (this is " "the standard binding behaviour for functions implemented in Python.)" msgstr "" -#: ../../library/inspect.rst:828 +#: ../../library/inspect.rst:833 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:828 +#: ../../library/inspect.rst:833 msgid "" "A tuple of positional arguments that aren't bound to any other parameter. " "This corresponds to a ``*args`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:833 +#: ../../library/inspect.rst:838 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:833 +#: ../../library/inspect.rst:838 msgid "" "Value must be supplied as a keyword argument. Keyword only parameters are " "those which appear after a ``*`` or ``*args`` entry in a Python function " "definition." msgstr "" -#: ../../library/inspect.rst:838 +#: ../../library/inspect.rst:843 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:838 +#: ../../library/inspect.rst:843 msgid "" "A dict of keyword arguments that aren't bound to any other parameter. This " "corresponds to a ``**kwargs`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:844 +#: ../../library/inspect.rst:849 msgid "Example: print all keyword-only arguments without default values::" msgstr "" -#: ../../library/inspect.rst:858 +#: ../../library/inspect.rst:863 msgid "Describes a enum value of Parameter.kind." msgstr "" -#: ../../library/inspect.rst:862 +#: ../../library/inspect.rst:867 msgid "Example: print all descriptions of arguments::" msgstr "" -#: ../../library/inspect.rst:877 +#: ../../library/inspect.rst:882 msgid "" "Create a new Parameter instance based on the instance replaced was invoked " "on. To override a :class:`Parameter` attribute, pass the corresponding " @@ -1182,94 +1192,94 @@ msgid "" "pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:895 +#: ../../library/inspect.rst:900 msgid "" "In Python 3.3 Parameter objects were allowed to have ``name`` set to " "``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no longer " "permitted." msgstr "" -#: ../../library/inspect.rst:902 +#: ../../library/inspect.rst:907 msgid "" "Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. " "Holds the mapping of arguments to the function's parameters." msgstr "" -#: ../../library/inspect.rst:907 +#: ../../library/inspect.rst:912 msgid "" "A mutable mapping of parameters' names to arguments' values. Contains only " "explicitly bound arguments. Changes in :attr:`arguments` will reflect in :" "attr:`args` and :attr:`kwargs`." msgstr "" -#: ../../library/inspect.rst:911 +#: ../../library/inspect.rst:916 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:916 +#: ../../library/inspect.rst:921 msgid "" "Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` " "relied on a default value are skipped. However, if needed, use :meth:" "`BoundArguments.apply_defaults` to add them." msgstr "" -#: ../../library/inspect.rst:921 +#: ../../library/inspect.rst:926 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:927 +#: ../../library/inspect.rst:932 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:932 +#: ../../library/inspect.rst:937 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:937 +#: ../../library/inspect.rst:942 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:941 +#: ../../library/inspect.rst:946 msgid "Set default values for missing arguments." msgstr "" -#: ../../library/inspect.rst:943 +#: ../../library/inspect.rst:948 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:946 +#: ../../library/inspect.rst:951 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:959 +#: ../../library/inspect.rst:964 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions::" msgstr "" -#: ../../library/inspect.rst:972 +#: ../../library/inspect.rst:977 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:973 +#: ../../library/inspect.rst:978 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:979 +#: ../../library/inspect.rst:984 msgid "Classes and functions" msgstr "" -#: ../../library/inspect.rst:983 +#: ../../library/inspect.rst:988 msgid "" "Arrange the given list of classes into a hierarchy of nested lists. Where a " "nested list appears, it contains classes derived from the class whose entry " @@ -1280,19 +1290,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:994 +#: ../../library/inspect.rst:999 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:997 +#: ../../library/inspect.rst:1002 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:1000 +#: ../../library/inspect.rst:1005 msgid "" "*args* is a list of the positional parameter names. *varargs* is the name of " "the ``*`` parameter or ``None`` if arbitrary positional arguments are not " @@ -1307,7 +1317,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:1015 +#: ../../library/inspect.rst:1020 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1317,14 +1327,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:1022 +#: ../../library/inspect.rst:1027 msgid "" "This function is now based on :func:`signature`, but still ignores " "``__wrapped__`` attributes and includes the already bound first parameter in " "the signature output for bound methods." msgstr "" -#: ../../library/inspect.rst:1027 +#: ../../library/inspect.rst:1032 msgid "" "This method was previously documented as deprecated in favour of :func:" "`signature` in Python 3.5, but that decision has been reversed in order to " @@ -1332,7 +1342,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1042 +#: ../../library/inspect.rst:1047 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1341,18 +1351,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1049 ../../library/inspect.rst:1059 +#: ../../library/inspect.rst:1054 ../../library/inspect.rst:1064 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1054 +#: ../../library/inspect.rst:1059 msgid "" "Format a pretty argument spec from the four values returned by :func:" "`getargvalues`. The format\\* arguments are the corresponding optional " "formatting functions that are called to turn names and values into strings." msgstr "" -#: ../../library/inspect.rst:1064 +#: ../../library/inspect.rst:1069 msgid "" "Return a tuple of class cls's base classes, including cls, in method " "resolution order. No class appears more than once in this tuple. Note that " @@ -1360,7 +1370,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1072 +#: ../../library/inspect.rst:1077 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -1373,11 +1383,11 @@ msgid "" "example::" msgstr "" -#: ../../library/inspect.rst:1096 +#: ../../library/inspect.rst:1101 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "" -#: ../../library/inspect.rst:1102 +#: ../../library/inspect.rst:1107 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1389,18 +1399,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1111 +#: ../../library/inspect.rst:1116 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "" -#: ../../library/inspect.rst:1118 +#: ../../library/inspect.rst:1123 msgid "" "Get the object wrapped by *func*. It follows the chain of :attr:" "`__wrapped__` attributes returning the last object in the chain." msgstr "" -#: ../../library/inspect.rst:1121 +#: ../../library/inspect.rst:1126 msgid "" "*stop* is an optional callback accepting an object in the wrapper chain as " "its sole argument that allows the unwrapping to be terminated early if the " @@ -1410,68 +1420,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1128 +#: ../../library/inspect.rst:1133 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "" -#: ../../library/inspect.rst:1135 +#: ../../library/inspect.rst:1140 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1137 +#: ../../library/inspect.rst:1142 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1140 +#: ../../library/inspect.rst:1145 msgid "" "Returns a dict. ``get_annotations()`` returns a new dict every time it's " "called; calling it twice on the same object will return two different but " "equivalent dicts." msgstr "" -#: ../../library/inspect.rst:1144 +#: ../../library/inspect.rst:1149 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1146 +#: ../../library/inspect.rst:1151 msgid "" "If ``eval_str`` is true, values of type ``str`` will be un-stringized using :" "func:`eval()`. This is intended for use with stringized annotations (``from " "__future__ import annotations``)." msgstr "" -#: ../../library/inspect.rst:1150 +#: ../../library/inspect.rst:1155 msgid "" "If ``obj`` doesn't have an annotations dict, returns an empty dict. " "(Functions and methods always have an annotations dict; classes, modules, " "and other types of callables may not.)" msgstr "" -#: ../../library/inspect.rst:1154 +#: ../../library/inspect.rst:1159 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1156 +#: ../../library/inspect.rst:1161 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1158 +#: ../../library/inspect.rst:1163 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1160 +#: ../../library/inspect.rst:1165 msgid "" "``eval_str`` controls whether or not values of type ``str`` are replaced " "with the result of calling :func:`eval()` on those values:" msgstr "" -#: ../../library/inspect.rst:1163 +#: ../../library/inspect.rst:1168 msgid "" "If eval_str is true, :func:`eval()` is called on values of type ``str``. " "(Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval()` " @@ -1479,12 +1489,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1167 +#: ../../library/inspect.rst:1172 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1169 +#: ../../library/inspect.rst:1174 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1492,35 +1502,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1174 +#: ../../library/inspect.rst:1179 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1175 +#: ../../library/inspect.rst:1180 msgid "" "If ``obj`` is a class, ``globals`` defaults to ``sys.modules[obj.__module__]." "__dict__`` and ``locals`` defaults to the ``obj`` class namespace." msgstr "" -#: ../../library/inspect.rst:1178 +#: ../../library/inspect.rst:1183 msgid "" "If ``obj`` is a callable, ``globals`` defaults to ``obj.__globals__``, " "although if ``obj`` is a wrapped function (using ``functools." "update_wrapper()``) it is first unwrapped." msgstr "" -#: ../../library/inspect.rst:1182 +#: ../../library/inspect.rst:1187 msgid "" "Calling ``get_annotations`` is best practice for accessing the annotations " "dict of any object. See :ref:`annotations-howto` for more information on " "annotations best practices." msgstr "" -#: ../../library/inspect.rst:1192 +#: ../../library/inspect.rst:1197 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1194 +#: ../../library/inspect.rst:1199 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1528,95 +1538,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1203 +#: ../../library/inspect.rst:1208 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1207 +#: ../../library/inspect.rst:1212 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1212 +#: ../../library/inspect.rst:1217 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1217 +#: ../../library/inspect.rst:1222 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1221 +#: ../../library/inspect.rst:1226 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1226 ../../library/inspect.rst:1265 +#: ../../library/inspect.rst:1231 ../../library/inspect.rst:1270 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1230 +#: ../../library/inspect.rst:1235 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1234 +#: ../../library/inspect.rst:1239 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1237 +#: ../../library/inspect.rst:1242 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1246 +#: ../../library/inspect.rst:1251 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1251 +#: ../../library/inspect.rst:1256 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1256 +#: ../../library/inspect.rst:1261 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1260 +#: ../../library/inspect.rst:1265 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1269 +#: ../../library/inspect.rst:1274 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1274 +#: ../../library/inspect.rst:1279 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1281 +#: ../../library/inspect.rst:1286 msgid "" "Keeping references to frame objects, as found in the first element of the " "frame records these functions return, can cause your program to create " @@ -1628,7 +1638,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1289 +#: ../../library/inspect.rst:1294 msgid "" "Though the cycle detector will catch these, destruction of the frames (and " "local variables) can be made deterministic by removing the cycle in a :" @@ -1636,31 +1646,31 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1301 +#: ../../library/inspect.rst:1306 msgid "" "If you want to keep the frame around (for example to print a traceback " "later), you can also break reference cycles by using the :meth:`frame.clear` " "method." msgstr "" -#: ../../library/inspect.rst:1305 +#: ../../library/inspect.rst:1310 msgid "" "The optional *context* argument supported by most of these functions " "specifies the number of lines of context to return, which are centered " "around the current line." msgstr "" -#: ../../library/inspect.rst:1312 +#: ../../library/inspect.rst:1317 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1315 +#: ../../library/inspect.rst:1320 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1320 +#: ../../library/inspect.rst:1325 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -1668,19 +1678,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1325 ../../library/inspect.rst:1340 -#: ../../library/inspect.rst:1366 ../../library/inspect.rst:1381 +#: ../../library/inspect.rst:1330 ../../library/inspect.rst:1345 +#: ../../library/inspect.rst:1371 ../../library/inspect.rst:1386 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1330 ../../library/inspect.rst:1345 -#: ../../library/inspect.rst:1371 ../../library/inspect.rst:1386 +#: ../../library/inspect.rst:1335 ../../library/inspect.rst:1350 +#: ../../library/inspect.rst:1376 ../../library/inspect.rst:1391 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "" -#: ../../library/inspect.rst:1335 +#: ../../library/inspect.rst:1340 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -1688,11 +1698,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1350 +#: ../../library/inspect.rst:1355 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1354 +#: ../../library/inspect.rst:1359 msgid "" "This function relies on Python stack frame support in the interpreter, which " "isn't guaranteed to exist in all implementations of Python. If running in " @@ -1700,14 +1710,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1362 +#: ../../library/inspect.rst:1367 msgid "" "Return a list of :class:`FrameInfo` objects for the caller's stack. The " "first entry in the returned list represents the caller; the last entry " "represents the outermost call on the stack." msgstr "" -#: ../../library/inspect.rst:1376 +#: ../../library/inspect.rst:1381 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -1715,11 +1725,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1390 +#: ../../library/inspect.rst:1395 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1392 +#: ../../library/inspect.rst:1397 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1727,20 +1737,20 @@ msgid "" "`__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1397 +#: ../../library/inspect.rst:1402 msgid "" "For cases where you want passive introspection, like documentation tools, " "this can be inconvenient. :func:`getattr_static` has the same signature as :" "func:`getattr` but avoids executing code when it fetches attributes." msgstr "" -#: ../../library/inspect.rst:1403 +#: ../../library/inspect.rst:1408 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`__getattr__` or :meth:`__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1406 +#: ../../library/inspect.rst:1411 msgid "" "Note: this function may not be able to retrieve all attributes that getattr " "can fetch (like dynamically created attributes) and may find attributes that " @@ -1748,31 +1758,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1412 +#: ../../library/inspect.rst:1417 msgid "" "If the instance :attr:`~object.__dict__` is shadowed by another member (for " "example a property) then this function will be unable to find instance " "members." msgstr "" -#: ../../library/inspect.rst:1418 +#: ../../library/inspect.rst:1423 msgid "" ":func:`getattr_static` does not resolve descriptors, for example slot " "descriptors or getset descriptors on objects implemented in C. The " "descriptor object is returned instead of the underlying attribute." msgstr "" -#: ../../library/inspect.rst:1422 +#: ../../library/inspect.rst:1427 msgid "" "You can handle these with code like the following. Note that for arbitrary " "getset descriptors invoking these may trigger code execution::" msgstr "" -#: ../../library/inspect.rst:1448 +#: ../../library/inspect.rst:1453 msgid "Current State of Generators, Coroutines, and Asynchronous Generators" msgstr "" -#: ../../library/inspect.rst:1450 +#: ../../library/inspect.rst:1455 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1781,32 +1791,32 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1458 +#: ../../library/inspect.rst:1463 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1460 ../../library/inspect.rst:1476 -#: ../../library/inspect.rst:1493 +#: ../../library/inspect.rst:1465 ../../library/inspect.rst:1481 +#: ../../library/inspect.rst:1498 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1462 +#: ../../library/inspect.rst:1467 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1463 +#: ../../library/inspect.rst:1468 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1464 +#: ../../library/inspect.rst:1469 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1465 +#: ../../library/inspect.rst:1470 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1471 +#: ../../library/inspect.rst:1476 msgid "" "Get current state of a coroutine object. The function is intended to be " "used with coroutine objects created by :keyword:`async def` functions, but " @@ -1814,23 +1824,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1478 +#: ../../library/inspect.rst:1483 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1479 +#: ../../library/inspect.rst:1484 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1480 +#: ../../library/inspect.rst:1485 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1481 +#: ../../library/inspect.rst:1486 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1487 +#: ../../library/inspect.rst:1492 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -1839,30 +1849,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1495 +#: ../../library/inspect.rst:1500 msgid "AGEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1496 +#: ../../library/inspect.rst:1501 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1497 +#: ../../library/inspect.rst:1502 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1498 +#: ../../library/inspect.rst:1503 msgid "AGEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1502 +#: ../../library/inspect.rst:1507 msgid "" "The current internal state of the generator can also be queried. This is " "mostly useful for testing purposes, to ensure that internal state is being " "updated as expected:" msgstr "" -#: ../../library/inspect.rst:1508 +#: ../../library/inspect.rst:1513 msgid "" "Get the mapping of live local variables in *generator* to their current " "values. A dictionary is returned that maps from variable names to values. " @@ -1870,14 +1880,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1513 +#: ../../library/inspect.rst:1518 msgid "" "If *generator* is a :term:`generator` with no currently associated frame, " "then an empty dictionary is returned. :exc:`TypeError` is raised if " "*generator* is not a Python generator object." msgstr "" -#: ../../library/inspect.rst:1519 +#: ../../library/inspect.rst:1524 msgid "" "This function relies on the generator exposing a Python stack frame for " "introspection, which isn't guaranteed to be the case in all implementations " @@ -1885,79 +1895,79 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1528 +#: ../../library/inspect.rst:1533 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1535 +#: ../../library/inspect.rst:1540 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for asynchronous generator objects created by :keyword:`async def` functions " "which use the :keyword:`yield` statement." msgstr "" -#: ../../library/inspect.rst:1545 +#: ../../library/inspect.rst:1550 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1547 +#: ../../library/inspect.rst:1552 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1552 +#: ../../library/inspect.rst:1557 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1556 +#: ../../library/inspect.rst:1561 msgid "" "If set, a new dict will be created for the frame's ``f_locals`` when the " "code object is executed." msgstr "" -#: ../../library/inspect.rst:1561 +#: ../../library/inspect.rst:1566 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1565 +#: ../../library/inspect.rst:1570 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1569 +#: ../../library/inspect.rst:1574 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1573 +#: ../../library/inspect.rst:1578 msgid "" "The flag is set when the code object is a generator function, i.e. a " "generator object is returned when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1578 +#: ../../library/inspect.rst:1583 msgid "" "The flag is set when the code object is a coroutine function. When the code " "object is executed it returns a coroutine object. See :pep:`492` for more " "details." msgstr "" -#: ../../library/inspect.rst:1586 +#: ../../library/inspect.rst:1591 msgid "" "The flag is used to transform generators into generator-based coroutines. " "Generator objects with this flag can be used in ``await`` expression, and " "can ``yield from`` coroutine objects. See :pep:`492` for more details." msgstr "" -#: ../../library/inspect.rst:1595 +#: ../../library/inspect.rst:1600 msgid "" "The flag is set when the code object is an asynchronous generator function. " "When the code object is executed it returns an asynchronous generator " "object. See :pep:`525` for more details." msgstr "" -#: ../../library/inspect.rst:1602 +#: ../../library/inspect.rst:1607 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1965,39 +1975,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1610 +#: ../../library/inspect.rst:1615 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1614 +#: ../../library/inspect.rst:1619 msgid "" "This is an :class:`enum.IntFlag` that represents the flags that can be " "passed to the :meth:`~object.__buffer__` method of objects implementing the :" "ref:`buffer protocol `." msgstr "" -#: ../../library/inspect.rst:1618 +#: ../../library/inspect.rst:1623 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1645 +#: ../../library/inspect.rst:1650 msgid "Command Line Interface" msgstr "命令列介面" -#: ../../library/inspect.rst:1647 +#: ../../library/inspect.rst:1652 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1652 +#: ../../library/inspect.rst:1657 msgid "" "By default, accepts the name of a module and prints the source of that " "module. A class or function within the module can be printed instead by " "appended a colon and the qualified name of the target object." msgstr "" -#: ../../library/inspect.rst:1658 +#: ../../library/inspect.rst:1663 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/itertools.po b/library/itertools.po index 1bae04ba61..c34a10c07c 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-13 00:03+0000\n" +"POT-Creation-Date: 2023-10-28 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -81,8 +81,8 @@ msgid ":func:`count`" msgstr ":func:`count`" #: ../../library/itertools.rst:44 -msgid "start, [step]" -msgstr "" +msgid "[start[, step]]" +msgstr "[start[, step]]" #: ../../library/itertools.rst:44 msgid "start, start+step, start+2*step, ..." diff --git a/library/locale.po b/library/locale.po index 0afee18ed9..f3252fcd86 100644 --- a/library/locale.po +++ b/library/locale.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-28 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -679,32 +679,42 @@ msgid "" "conventions." msgstr "" -#: ../../library/locale.rst:469 +#: ../../library/locale.rst:467 +msgid "" +"Locale category for the character type functions. Most importantly, this " +"category defines the text encoding, i.e. how bytes are interpreted as " +"Unicode codepoints. See :pep:`538` and :pep:`540` for how this variable " +"might be automatically coerced to ``C.UTF-8`` to avoid issues created by " +"invalid settings in containers or incompatible settings passed over remote " +"SSH connections." +msgstr "" + +#: ../../library/locale.rst:474 msgid "" -"Locale category for the character type functions. Depending on the settings " -"of this category, the functions of module :mod:`string` dealing with case " -"change their behaviour." +"Python doesn't internally use locale-dependent character transformation " +"functions from ``ctype.h``. Instead, an internal ``pyctype.h`` provides " +"locale-independent equivalents like :c:macro:`!Py_TOLOWER`." msgstr "" -#: ../../library/locale.rst:476 +#: ../../library/locale.rst:481 msgid "" "Locale category for sorting strings. The functions :func:`strcoll` and :" "func:`strxfrm` of the :mod:`locale` module are affected." msgstr "" -#: ../../library/locale.rst:482 +#: ../../library/locale.rst:487 msgid "" "Locale category for the formatting of time. The function :func:`time." "strftime` follows these conventions." msgstr "" -#: ../../library/locale.rst:488 +#: ../../library/locale.rst:493 msgid "" "Locale category for formatting of monetary values. The available options " "are available from the :func:`localeconv` function." msgstr "" -#: ../../library/locale.rst:494 +#: ../../library/locale.rst:499 msgid "" "Locale category for message display. Python currently does not support " "application specific locale-aware messages. Messages displayed by the " @@ -712,13 +722,13 @@ msgid "" "affected by this category." msgstr "" -#: ../../library/locale.rst:499 +#: ../../library/locale.rst:504 msgid "" "This value may not be available on operating systems not conforming to the " "POSIX standard, most notably Windows." msgstr "" -#: ../../library/locale.rst:505 +#: ../../library/locale.rst:510 msgid "" "Locale category for formatting numbers. The functions :func:" "`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:" @@ -726,7 +736,7 @@ msgid "" "operations are not affected." msgstr "" -#: ../../library/locale.rst:513 +#: ../../library/locale.rst:518 msgid "" "Combination of all locale settings. If this flag is used when the locale is " "changed, setting the locale for all categories is attempted. If that fails " @@ -736,24 +746,24 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:522 +#: ../../library/locale.rst:527 msgid "" "This is a symbolic constant used for different values returned by :func:" "`localeconv`." msgstr "" -#: ../../library/locale.rst:526 +#: ../../library/locale.rst:531 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/locale.rst:539 +#: ../../library/locale.rst:544 msgid "Background, details, hints, tips and caveats" msgstr "" -#: ../../library/locale.rst:541 +#: ../../library/locale.rst:546 msgid "" "The C standard defines the locale as a program-wide property that may be " "relatively expensive to change. On top of that, some implementations are " @@ -761,7 +771,7 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: ../../library/locale.rst:546 +#: ../../library/locale.rst:551 msgid "" "Initially, when a program is started, the locale is the ``C`` locale, no " "matter what the user's preferred locale is. There is one exception: the :" @@ -771,7 +781,7 @@ msgid "" "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: ../../library/locale.rst:553 +#: ../../library/locale.rst:558 msgid "" "It is generally a bad idea to call :func:`setlocale` in some library " "routine, since as a side effect it affects the entire program. Saving and " @@ -779,7 +789,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: ../../library/locale.rst:558 +#: ../../library/locale.rst:563 msgid "" "If, when coding a module for general use, you need a locale independent " "version of an operation that is affected by the locale (such as certain " @@ -790,14 +800,14 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:565 +#: ../../library/locale.rst:570 msgid "" "The only way to perform numeric operations according to the locale is to use " "the special functions defined by this module: :func:`atof`, :func:`atoi`, :" "func:`format_string`, :func:`.str`." msgstr "" -#: ../../library/locale.rst:569 +#: ../../library/locale.rst:574 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -808,11 +818,11 @@ msgid "" "whitespace." msgstr "" -#: ../../library/locale.rst:580 +#: ../../library/locale.rst:585 msgid "For extension writers and programs that embed Python" msgstr "" -#: ../../library/locale.rst:582 +#: ../../library/locale.rst:587 msgid "" "Extension modules should never call :func:`setlocale`, except to find out " "what the current locale is. But since the return value can only be used " @@ -820,7 +830,7 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: ../../library/locale.rst:587 +#: ../../library/locale.rst:592 msgid "" "When Python code uses the :mod:`locale` module to change the locale, this " "also affects the embedding application. If the embedding application " @@ -830,11 +840,11 @@ msgid "" "accessible as a shared library." msgstr "" -#: ../../library/locale.rst:598 +#: ../../library/locale.rst:603 msgid "Access to message catalogs" msgstr "" -#: ../../library/locale.rst:606 +#: ../../library/locale.rst:611 msgid "" "The locale module exposes the C library's gettext interface on systems that " "provide this interface. It consists of the functions :func:`!gettext`, :" @@ -845,7 +855,7 @@ msgid "" "for locating message catalogs." msgstr "" -#: ../../library/locale.rst:613 +#: ../../library/locale.rst:618 msgid "" "Python applications should normally find no need to invoke these functions, " "and should use :mod:`gettext` instead. A known exception to this rule are " @@ -855,7 +865,7 @@ msgid "" "their message catalogs." msgstr "" -#: ../../library/locale.rst:19 ../../library/locale.rst:467 +#: ../../library/locale.rst:19 msgid "module" msgstr "module(模組)" @@ -863,6 +873,5 @@ msgstr "module(模組)" msgid "_locale" msgstr "_locale" -#: ../../library/locale.rst:467 -msgid "string" -msgstr "string(字串)" +#~ msgid "string" +#~ msgstr "string(字串)" diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 417245ed9d..3df1e532ef 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-11-03 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -845,19 +845,17 @@ msgid "" "Tries to create a socket and, if it's not a datagram socket, connect it to " "the other end. This method is called during handler initialization, but it's " "not regarded as an error if the other end isn't listening at this point - " -"the method will be called again when emitting an event, if but it's not " -"regarded as an error if the other end isn't listening yet --- the method " -"will be called again when emitting an event, if there is no socket at that " -"point." +"the method will be called again when emitting an event, if there is no " +"socket at that point." msgstr "" -#: ../../library/logging.handlers.rst:667 +#: ../../library/logging.handlers.rst:665 msgid "" "The record is formatted, and then sent to the syslog server. If exception " "information is present, it is *not* sent to the server." msgstr "" -#: ../../library/logging.handlers.rst:670 +#: ../../library/logging.handlers.rst:668 msgid "" "(See: :issue:`12168`.) In earlier versions, the message sent to the syslog " "daemons was always terminated with a NUL byte, because early versions of " @@ -868,7 +866,7 @@ msgid "" "byte on as part of the message." msgstr "" -#: ../../library/logging.handlers.rst:679 +#: ../../library/logging.handlers.rst:677 msgid "" "To enable easier handling of syslog messages in the face of all these " "differing daemon behaviours, the appending of the NUL byte has been made " @@ -878,7 +876,7 @@ msgid "" "*not* append the NUL terminator." msgstr "" -#: ../../library/logging.handlers.rst:686 +#: ../../library/logging.handlers.rst:684 msgid "" "(See: :issue:`12419`.) In earlier versions, there was no facility for an " "\"ident\" or \"tag\" prefix to identify the source of the message. This can " @@ -889,262 +887,262 @@ msgid "" "bytes, and is prepended to the message exactly as is." msgstr "" -#: ../../library/logging.handlers.rst:697 +#: ../../library/logging.handlers.rst:695 msgid "" "Encodes the facility and priority into an integer. You can pass in strings " "or integers - if strings are passed, internal mapping dictionaries are used " "to convert them to integers." msgstr "" -#: ../../library/logging.handlers.rst:701 +#: ../../library/logging.handlers.rst:699 msgid "" "The symbolic ``LOG_`` values are defined in :class:`SysLogHandler` and " "mirror the values defined in the ``sys/syslog.h`` header file." msgstr "" -#: ../../library/logging.handlers.rst:704 +#: ../../library/logging.handlers.rst:702 msgid "**Priorities**" msgstr "" -#: ../../library/logging.handlers.rst:707 -#: ../../library/logging.handlers.rst:729 +#: ../../library/logging.handlers.rst:705 +#: ../../library/logging.handlers.rst:727 msgid "Name (string)" msgstr "" -#: ../../library/logging.handlers.rst:707 -#: ../../library/logging.handlers.rst:729 +#: ../../library/logging.handlers.rst:705 +#: ../../library/logging.handlers.rst:727 msgid "Symbolic value" msgstr "" -#: ../../library/logging.handlers.rst:709 +#: ../../library/logging.handlers.rst:707 msgid "``alert``" msgstr "``alert``" -#: ../../library/logging.handlers.rst:709 +#: ../../library/logging.handlers.rst:707 msgid "LOG_ALERT" msgstr "LOG_ALERT" -#: ../../library/logging.handlers.rst:711 +#: ../../library/logging.handlers.rst:709 msgid "``crit`` or ``critical``" msgstr "``crit`` 或 ``critical``" -#: ../../library/logging.handlers.rst:711 +#: ../../library/logging.handlers.rst:709 msgid "LOG_CRIT" msgstr "LOG_CRIT" -#: ../../library/logging.handlers.rst:713 +#: ../../library/logging.handlers.rst:711 msgid "``debug``" msgstr "``debug``" -#: ../../library/logging.handlers.rst:713 +#: ../../library/logging.handlers.rst:711 msgid "LOG_DEBUG" msgstr "LOG_DEBUG" -#: ../../library/logging.handlers.rst:715 +#: ../../library/logging.handlers.rst:713 msgid "``emerg`` or ``panic``" msgstr "``emerg`` 或 ``panic``" -#: ../../library/logging.handlers.rst:715 +#: ../../library/logging.handlers.rst:713 msgid "LOG_EMERG" msgstr "LOG_EMERG" -#: ../../library/logging.handlers.rst:717 +#: ../../library/logging.handlers.rst:715 msgid "``err`` or ``error``" msgstr "``err`` 或 ``error``" -#: ../../library/logging.handlers.rst:717 +#: ../../library/logging.handlers.rst:715 msgid "LOG_ERR" msgstr "LOG_ERR" -#: ../../library/logging.handlers.rst:719 +#: ../../library/logging.handlers.rst:717 msgid "``info``" msgstr "``info``" -#: ../../library/logging.handlers.rst:719 +#: ../../library/logging.handlers.rst:717 msgid "LOG_INFO" msgstr "LOG_INFO" -#: ../../library/logging.handlers.rst:721 +#: ../../library/logging.handlers.rst:719 msgid "``notice``" msgstr "``notice``" -#: ../../library/logging.handlers.rst:721 +#: ../../library/logging.handlers.rst:719 msgid "LOG_NOTICE" msgstr "LOG_NOTICE" -#: ../../library/logging.handlers.rst:723 +#: ../../library/logging.handlers.rst:721 msgid "``warn`` or ``warning``" msgstr "``warn`` 或 ``warning``" -#: ../../library/logging.handlers.rst:723 +#: ../../library/logging.handlers.rst:721 msgid "LOG_WARNING" msgstr "LOG_WARNING" -#: ../../library/logging.handlers.rst:726 +#: ../../library/logging.handlers.rst:724 msgid "**Facilities**" msgstr "" -#: ../../library/logging.handlers.rst:731 +#: ../../library/logging.handlers.rst:729 msgid "``auth``" msgstr "``auth``" -#: ../../library/logging.handlers.rst:731 +#: ../../library/logging.handlers.rst:729 msgid "LOG_AUTH" msgstr "LOG_AUTH" -#: ../../library/logging.handlers.rst:733 +#: ../../library/logging.handlers.rst:731 msgid "``authpriv``" msgstr "``authpriv``" -#: ../../library/logging.handlers.rst:733 +#: ../../library/logging.handlers.rst:731 msgid "LOG_AUTHPRIV" msgstr "LOG_AUTHPRIV" -#: ../../library/logging.handlers.rst:735 +#: ../../library/logging.handlers.rst:733 msgid "``cron``" msgstr "``cron``" -#: ../../library/logging.handlers.rst:735 +#: ../../library/logging.handlers.rst:733 msgid "LOG_CRON" msgstr "LOG_CRON" -#: ../../library/logging.handlers.rst:737 +#: ../../library/logging.handlers.rst:735 msgid "``daemon``" msgstr "``daemon``" -#: ../../library/logging.handlers.rst:737 +#: ../../library/logging.handlers.rst:735 msgid "LOG_DAEMON" msgstr "LOG_DAEMON" -#: ../../library/logging.handlers.rst:739 +#: ../../library/logging.handlers.rst:737 msgid "``ftp``" msgstr "``ftp``" -#: ../../library/logging.handlers.rst:739 +#: ../../library/logging.handlers.rst:737 msgid "LOG_FTP" msgstr "LOG_FTP" -#: ../../library/logging.handlers.rst:741 +#: ../../library/logging.handlers.rst:739 msgid "``kern``" msgstr "``kern``" -#: ../../library/logging.handlers.rst:741 +#: ../../library/logging.handlers.rst:739 msgid "LOG_KERN" msgstr "LOG_KERN" -#: ../../library/logging.handlers.rst:743 +#: ../../library/logging.handlers.rst:741 msgid "``lpr``" msgstr "``lpr``" -#: ../../library/logging.handlers.rst:743 +#: ../../library/logging.handlers.rst:741 msgid "LOG_LPR" msgstr "LOG_LPR" -#: ../../library/logging.handlers.rst:745 +#: ../../library/logging.handlers.rst:743 msgid "``mail``" msgstr "``mail``" -#: ../../library/logging.handlers.rst:745 +#: ../../library/logging.handlers.rst:743 msgid "LOG_MAIL" msgstr "LOG_MAIL" -#: ../../library/logging.handlers.rst:747 +#: ../../library/logging.handlers.rst:745 msgid "``news``" msgstr "``news``" -#: ../../library/logging.handlers.rst:747 +#: ../../library/logging.handlers.rst:745 msgid "LOG_NEWS" msgstr "LOG_NEWS" -#: ../../library/logging.handlers.rst:749 +#: ../../library/logging.handlers.rst:747 msgid "``syslog``" msgstr "``syslog``" -#: ../../library/logging.handlers.rst:749 +#: ../../library/logging.handlers.rst:747 msgid "LOG_SYSLOG" msgstr "LOG_SYSLOG" -#: ../../library/logging.handlers.rst:751 +#: ../../library/logging.handlers.rst:749 msgid "``user``" msgstr "``user``" -#: ../../library/logging.handlers.rst:751 +#: ../../library/logging.handlers.rst:749 msgid "LOG_USER" msgstr "LOG_USER" -#: ../../library/logging.handlers.rst:753 +#: ../../library/logging.handlers.rst:751 msgid "``uucp``" msgstr "``uucp``" -#: ../../library/logging.handlers.rst:753 +#: ../../library/logging.handlers.rst:751 msgid "LOG_UUCP" msgstr "LOG_UUCP" -#: ../../library/logging.handlers.rst:755 +#: ../../library/logging.handlers.rst:753 msgid "``local0``" msgstr "``local0``" -#: ../../library/logging.handlers.rst:755 +#: ../../library/logging.handlers.rst:753 msgid "LOG_LOCAL0" msgstr "LOG_LOCAL0" -#: ../../library/logging.handlers.rst:757 +#: ../../library/logging.handlers.rst:755 msgid "``local1``" msgstr "``local1``" -#: ../../library/logging.handlers.rst:757 +#: ../../library/logging.handlers.rst:755 msgid "LOG_LOCAL1" msgstr "LOG_LOCAL1" -#: ../../library/logging.handlers.rst:759 +#: ../../library/logging.handlers.rst:757 msgid "``local2``" msgstr "``local2``" -#: ../../library/logging.handlers.rst:759 +#: ../../library/logging.handlers.rst:757 msgid "LOG_LOCAL2" msgstr "LOG_LOCAL2" -#: ../../library/logging.handlers.rst:761 +#: ../../library/logging.handlers.rst:759 msgid "``local3``" msgstr "``local3``" -#: ../../library/logging.handlers.rst:761 +#: ../../library/logging.handlers.rst:759 msgid "LOG_LOCAL3" msgstr "LOG_LOCAL3" -#: ../../library/logging.handlers.rst:763 +#: ../../library/logging.handlers.rst:761 msgid "``local4``" msgstr "``local4``" -#: ../../library/logging.handlers.rst:763 +#: ../../library/logging.handlers.rst:761 msgid "LOG_LOCAL4" msgstr "LOG_LOCAL4" -#: ../../library/logging.handlers.rst:765 +#: ../../library/logging.handlers.rst:763 msgid "``local5``" msgstr "``local5``" -#: ../../library/logging.handlers.rst:765 +#: ../../library/logging.handlers.rst:763 msgid "LOG_LOCAL5" msgstr "LOG_LOCAL5" -#: ../../library/logging.handlers.rst:767 +#: ../../library/logging.handlers.rst:765 msgid "``local6``" msgstr "``local6``" -#: ../../library/logging.handlers.rst:767 +#: ../../library/logging.handlers.rst:765 msgid "LOG_LOCAL6" msgstr "LOG_LOCAL6" -#: ../../library/logging.handlers.rst:769 +#: ../../library/logging.handlers.rst:767 msgid "``local7``" msgstr "``local7``" -#: ../../library/logging.handlers.rst:769 +#: ../../library/logging.handlers.rst:767 msgid "LOG_LOCAL7" msgstr "LOG_LOCAL7" -#: ../../library/logging.handlers.rst:774 +#: ../../library/logging.handlers.rst:772 msgid "" "Maps a logging level name to a syslog priority name. You may need to " "override this if you are using custom levels, or if the default algorithm is " @@ -1153,11 +1151,11 @@ msgid "" "all other level names to 'warning'." msgstr "" -#: ../../library/logging.handlers.rst:784 +#: ../../library/logging.handlers.rst:782 msgid "NTEventLogHandler" msgstr "NTEventLogHandler" -#: ../../library/logging.handlers.rst:786 +#: ../../library/logging.handlers.rst:784 msgid "" "The :class:`NTEventLogHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a local Windows NT, Windows " @@ -1165,7 +1163,7 @@ msgid "" "Win32 extensions for Python installed." msgstr "" -#: ../../library/logging.handlers.rst:794 +#: ../../library/logging.handlers.rst:792 msgid "" "Returns a new instance of the :class:`NTEventLogHandler` class. The " "*appname* is used to define the application name as it appears in the event " @@ -1181,7 +1179,7 @@ msgid "" "or ``'Security'``, and defaults to ``'Application'``." msgstr "" -#: ../../library/logging.handlers.rst:810 +#: ../../library/logging.handlers.rst:808 msgid "" "At this point, you can remove the application name from the registry as a " "source of event log entries. However, if you do this, you will not be able " @@ -1190,19 +1188,19 @@ msgid "" "not do this." msgstr "" -#: ../../library/logging.handlers.rst:819 +#: ../../library/logging.handlers.rst:817 msgid "" "Determines the message ID, event category and event type, and then logs the " "message in the NT event log." msgstr "" -#: ../../library/logging.handlers.rst:825 +#: ../../library/logging.handlers.rst:823 msgid "" "Returns the event category for the record. Override this if you want to " "specify your own categories. This version returns 0." msgstr "" -#: ../../library/logging.handlers.rst:831 +#: ../../library/logging.handlers.rst:829 msgid "" "Returns the event type for the record. Override this if you want to specify " "your own types. This version does a mapping using the handler's typemap " @@ -1213,7 +1211,7 @@ msgid "" "the handler's *typemap* attribute." msgstr "" -#: ../../library/logging.handlers.rst:842 +#: ../../library/logging.handlers.rst:840 msgid "" "Returns the message ID for the record. If you are using your own messages, " "you could do this by having the *msg* passed to the logger being an ID " @@ -1222,17 +1220,17 @@ msgid "" "message ID in :file:`win32service.pyd`." msgstr "" -#: ../../library/logging.handlers.rst:851 +#: ../../library/logging.handlers.rst:849 msgid "SMTPHandler" msgstr "SMTPHandler" -#: ../../library/logging.handlers.rst:853 +#: ../../library/logging.handlers.rst:851 msgid "" "The :class:`SMTPHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to an email address via SMTP." msgstr "" -#: ../../library/logging.handlers.rst:859 +#: ../../library/logging.handlers.rst:857 msgid "" "Returns a new instance of the :class:`SMTPHandler` class. The instance is " "initialized with the from and to addresses and subject line of the email. " @@ -1243,7 +1241,7 @@ msgid "" "*credentials* argument." msgstr "" -#: ../../library/logging.handlers.rst:866 +#: ../../library/logging.handlers.rst:864 msgid "" "To specify the use of a secure protocol (TLS), pass in a tuple to the " "*secure* argument. This will only be used when authentication credentials " @@ -1253,31 +1251,31 @@ msgid "" "SMTP.starttls` method.)" msgstr "" -#: ../../library/logging.handlers.rst:873 +#: ../../library/logging.handlers.rst:871 msgid "" "A timeout can be specified for communication with the SMTP server using the " "*timeout* argument." msgstr "" -#: ../../library/logging.handlers.rst:876 +#: ../../library/logging.handlers.rst:874 msgid "The *timeout* argument was added." msgstr "新增 *timeout* 引數。" -#: ../../library/logging.handlers.rst:881 +#: ../../library/logging.handlers.rst:879 msgid "Formats the record and sends it to the specified addressees." msgstr "" -#: ../../library/logging.handlers.rst:886 +#: ../../library/logging.handlers.rst:884 msgid "" "If you want to specify a subject line which is record-dependent, override " "this method." msgstr "" -#: ../../library/logging.handlers.rst:892 +#: ../../library/logging.handlers.rst:890 msgid "MemoryHandler" msgstr "MemoryHandler" -#: ../../library/logging.handlers.rst:894 +#: ../../library/logging.handlers.rst:892 msgid "" "The :class:`MemoryHandler` class, located in the :mod:`logging.handlers` " "module, supports buffering of logging records in memory, periodically " @@ -1285,7 +1283,7 @@ msgid "" "buffer is full, or when an event of a certain severity or greater is seen." msgstr "" -#: ../../library/logging.handlers.rst:899 +#: ../../library/logging.handlers.rst:897 msgid "" ":class:`MemoryHandler` is a subclass of the more general :class:" "`BufferingHandler`, which is an abstract class. This buffers logging records " @@ -1294,32 +1292,32 @@ msgid "" "should, then :meth:`flush` is expected to do the flushing." msgstr "" -#: ../../library/logging.handlers.rst:908 +#: ../../library/logging.handlers.rst:906 msgid "" "Initializes the handler with a buffer of the specified capacity. Here, " "*capacity* means the number of logging records buffered." msgstr "" -#: ../../library/logging.handlers.rst:914 +#: ../../library/logging.handlers.rst:912 msgid "" "Append the record to the buffer. If :meth:`shouldFlush` returns true, call :" "meth:`flush` to process the buffer." msgstr "" -#: ../../library/logging.handlers.rst:920 +#: ../../library/logging.handlers.rst:918 msgid "" "For a :class:`BufferingHandler` instance, flushing means that it sets the " "buffer to an empty list. This method can be overwritten to implement more " "useful flushing behavior." msgstr "" -#: ../../library/logging.handlers.rst:927 +#: ../../library/logging.handlers.rst:925 msgid "" "Return ``True`` if the buffer is up to capacity. This method can be " "overridden to implement custom flushing strategies." msgstr "" -#: ../../library/logging.handlers.rst:933 +#: ../../library/logging.handlers.rst:931 msgid "" "Returns a new instance of the :class:`MemoryHandler` class. The instance is " "initialized with a buffer size of *capacity* (number of records buffered). " @@ -1331,15 +1329,15 @@ msgid "" "the buffer will occur when the handler is closed." msgstr "" -#: ../../library/logging.handlers.rst:942 +#: ../../library/logging.handlers.rst:940 msgid "The *flushOnClose* parameter was added." msgstr "新增 *flushOnClose* 參數。" -#: ../../library/logging.handlers.rst:948 +#: ../../library/logging.handlers.rst:946 msgid "Calls :meth:`flush`, sets the target to ``None`` and clears the buffer." msgstr "" -#: ../../library/logging.handlers.rst:954 +#: ../../library/logging.handlers.rst:952 msgid "" "For a :class:`MemoryHandler` instance, flushing means just sending the " "buffered records to the target, if there is one. The buffer is also cleared " @@ -1347,26 +1345,26 @@ msgid "" "behavior." msgstr "" -#: ../../library/logging.handlers.rst:961 +#: ../../library/logging.handlers.rst:959 msgid "Sets the target handler for this handler." msgstr "" -#: ../../library/logging.handlers.rst:966 +#: ../../library/logging.handlers.rst:964 msgid "Checks for buffer full or a record at the *flushLevel* or higher." msgstr "" -#: ../../library/logging.handlers.rst:972 +#: ../../library/logging.handlers.rst:970 msgid "HTTPHandler" msgstr "HTTPHandler" -#: ../../library/logging.handlers.rst:974 +#: ../../library/logging.handlers.rst:972 msgid "" "The :class:`HTTPHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a web server, using either " "``GET`` or ``POST`` semantics." msgstr "" -#: ../../library/logging.handlers.rst:981 +#: ../../library/logging.handlers.rst:979 msgid "" "Returns a new instance of the :class:`HTTPHandler` class. The *host* can be " "of the form ``host:port``, should you need to use a specific port number. " @@ -1380,11 +1378,11 @@ msgid "" "cleartext across the wire." msgstr "" -#: ../../library/logging.handlers.rst:992 +#: ../../library/logging.handlers.rst:990 msgid "The *context* parameter was added." msgstr "新增 *context* 參數。" -#: ../../library/logging.handlers.rst:997 +#: ../../library/logging.handlers.rst:995 msgid "" "Provides a dictionary, based on ``record``, which is to be URL-encoded and " "sent to the web server. The default implementation just returns ``record." @@ -1393,14 +1391,14 @@ msgid "" "customization of what's sent to the server is required." msgstr "" -#: ../../library/logging.handlers.rst:1005 +#: ../../library/logging.handlers.rst:1003 msgid "" "Sends the record to the web server as a URL-encoded dictionary. The :meth:" "`mapLogRecord` method is used to convert the record to the dictionary to be " "sent." msgstr "" -#: ../../library/logging.handlers.rst:1009 +#: ../../library/logging.handlers.rst:1007 msgid "" "Since preparing a record for sending it to a web server is not the same as a " "generic formatting operation, using :meth:`~logging.Handler.setFormatter` to " @@ -1410,18 +1408,18 @@ msgid "" "the dictionary in a form suitable for sending to a web server." msgstr "" -#: ../../library/logging.handlers.rst:1022 +#: ../../library/logging.handlers.rst:1020 msgid "QueueHandler" msgstr "QueueHandler" -#: ../../library/logging.handlers.rst:1026 +#: ../../library/logging.handlers.rst:1024 msgid "" "The :class:`QueueHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a queue, such as those " "implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" -#: ../../library/logging.handlers.rst:1030 +#: ../../library/logging.handlers.rst:1028 msgid "" "Along with the :class:`QueueListener` class, :class:`QueueHandler` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1431,7 +1429,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1039 +#: ../../library/logging.handlers.rst:1037 msgid "" "Returns a new instance of the :class:`QueueHandler` class. The instance is " "initialized with the queue to send messages to. The *queue* can be any queue-" @@ -1441,14 +1439,14 @@ msgid "" "instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1046 -#: ../../library/logging.handlers.rst:1135 +#: ../../library/logging.handlers.rst:1044 +#: ../../library/logging.handlers.rst:1133 msgid "" "If you are using :mod:`multiprocessing`, you should avoid using :class:" "`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`." msgstr "" -#: ../../library/logging.handlers.rst:1051 +#: ../../library/logging.handlers.rst:1049 msgid "" "Enqueues the result of preparing the LogRecord. Should an exception occur (e." "g. because a bounded queue has filled up), the :meth:`~logging.Handler." @@ -1458,13 +1456,13 @@ msgid "" "raiseExceptions` is ``True``)." msgstr "" -#: ../../library/logging.handlers.rst:1060 +#: ../../library/logging.handlers.rst:1058 msgid "" "Prepares a record for queuing. The object returned by this method is " "enqueued." msgstr "" -#: ../../library/logging.handlers.rst:1063 +#: ../../library/logging.handlers.rst:1061 msgid "" "The base implementation formats the record to merge the message, arguments, " "exception and stack information, if present. It also removes unpickleable " @@ -1474,14 +1472,14 @@ msgid "" "attr:`exc_info` and :attr:`exc_text` attributes to ``None``." msgstr "" -#: ../../library/logging.handlers.rst:1071 +#: ../../library/logging.handlers.rst:1069 msgid "" "You might want to override this method if you want to convert the record to " "a dict or JSON string, or send a modified copy of the record while leaving " "the original intact." msgstr "" -#: ../../library/logging.handlers.rst:1075 +#: ../../library/logging.handlers.rst:1073 msgid "" "The base implementation formats the message with arguments, sets the " "``message`` and ``msg`` attributes to the formatted message and sets the " @@ -1497,25 +1495,25 @@ msgid "" "libraries that you use.)" msgstr "" -#: ../../library/logging.handlers.rst:1091 +#: ../../library/logging.handlers.rst:1089 msgid "" "Enqueues the record on the queue using ``put_nowait()``; you may want to " "override this if you want to use blocking behaviour, or a timeout, or a " "customized queue implementation." msgstr "" -#: ../../library/logging.handlers.rst:1097 +#: ../../library/logging.handlers.rst:1095 msgid "" "When created via configuration using :func:`~logging.config.dictConfig`, " "this attribute will contain a :class:`QueueListener` instance for use with " "this handler. Otherwise, it will be ``None``." msgstr "" -#: ../../library/logging.handlers.rst:1106 +#: ../../library/logging.handlers.rst:1104 msgid "QueueListener" msgstr "QueueListener" -#: ../../library/logging.handlers.rst:1110 +#: ../../library/logging.handlers.rst:1108 msgid "" "The :class:`QueueListener` class, located in the :mod:`logging.handlers` " "module, supports receiving logging messages from a queue, such as those " @@ -1526,7 +1524,7 @@ msgid "" "works hand-in-hand with :class:`QueueHandler`." msgstr "" -#: ../../library/logging.handlers.rst:1118 +#: ../../library/logging.handlers.rst:1116 msgid "" "Along with the :class:`QueueHandler` class, :class:`QueueListener` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1536,7 +1534,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1127 +#: ../../library/logging.handlers.rst:1125 msgid "" "Returns a new instance of the :class:`QueueListener` class. The instance is " "initialized with the queue to send messages to and a list of handlers which " @@ -1547,7 +1545,7 @@ msgid "" "class:`~queue.SimpleQueue` instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1138 +#: ../../library/logging.handlers.rst:1136 msgid "" "If ``respect_handler_level`` is ``True``, a handler's level is respected " "(compared with the level for the message) when deciding whether to pass " @@ -1555,82 +1553,82 @@ msgid "" "versions - to always pass each message to each handler." msgstr "" -#: ../../library/logging.handlers.rst:1143 +#: ../../library/logging.handlers.rst:1141 msgid "The ``respect_handler_level`` argument was added." msgstr "新增 ``respect_handler_level`` 引數。" -#: ../../library/logging.handlers.rst:1148 +#: ../../library/logging.handlers.rst:1146 msgid "Dequeues a record and return it, optionally blocking." msgstr "" -#: ../../library/logging.handlers.rst:1150 +#: ../../library/logging.handlers.rst:1148 msgid "" "The base implementation uses ``get()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1156 +#: ../../library/logging.handlers.rst:1154 msgid "Prepare a record for handling." msgstr "" -#: ../../library/logging.handlers.rst:1158 +#: ../../library/logging.handlers.rst:1156 msgid "" "This implementation just returns the passed-in record. You may want to " "override this method if you need to do any custom marshalling or " "manipulation of the record before passing it to the handlers." msgstr "" -#: ../../library/logging.handlers.rst:1164 +#: ../../library/logging.handlers.rst:1162 msgid "Handle a record." msgstr "" -#: ../../library/logging.handlers.rst:1166 +#: ../../library/logging.handlers.rst:1164 msgid "" "This just loops through the handlers offering them the record to handle. The " "actual object passed to the handlers is that which is returned from :meth:" "`prepare`." msgstr "" -#: ../../library/logging.handlers.rst:1172 +#: ../../library/logging.handlers.rst:1170 msgid "Starts the listener." msgstr "" -#: ../../library/logging.handlers.rst:1174 +#: ../../library/logging.handlers.rst:1172 msgid "" "This starts up a background thread to monitor the queue for LogRecords to " "process." msgstr "" -#: ../../library/logging.handlers.rst:1179 +#: ../../library/logging.handlers.rst:1177 msgid "Stops the listener." msgstr "" -#: ../../library/logging.handlers.rst:1181 +#: ../../library/logging.handlers.rst:1179 msgid "" "This asks the thread to terminate, and then waits for it to do so. Note that " "if you don't call this before your application exits, there may be some " "records still left on the queue, which won't be processed." msgstr "" -#: ../../library/logging.handlers.rst:1187 +#: ../../library/logging.handlers.rst:1185 msgid "" "Writes a sentinel to the queue to tell the listener to quit. This " "implementation uses ``put_nowait()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1198 +#: ../../library/logging.handlers.rst:1196 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.handlers.rst:1198 +#: ../../library/logging.handlers.rst:1196 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.handlers.rst:1200 +#: ../../library/logging.handlers.rst:1198 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../library/logging.handlers.rst:1201 +#: ../../library/logging.handlers.rst:1199 msgid "Configuration API for the logging module." msgstr "" diff --git a/library/mailbox.po b/library/mailbox.po index a8a1eb86e8..d277e16352 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -202,7 +202,7 @@ msgid "" "Return a representation of the message corresponding to *key*. If no such " "message exists, *default* is returned if the method was called as :meth:" "`get` and a :exc:`KeyError` exception is raised if the method was called as :" -"meth:`__getitem__`. The message is represented as an instance of the " +"meth:`~object.__getitem__`. The message is represented as an instance of the " "appropriate format-specific :class:`Message` subclass unless a custom " "message factory was specified when the :class:`Mailbox` instance was " "initialized." diff --git a/library/mmap.po b/library/mmap.po index a4d3c14a62..418b0e75fc 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -52,10 +52,10 @@ msgid "" "A memory-mapped file is created by the :class:`~mmap.mmap` constructor, " "which is different on Unix and on Windows. In either case you must provide " "a file descriptor for a file opened for update. If you wish to map an " -"existing Python file object, use its :meth:`fileno` method to obtain the " -"correct value for the *fileno* parameter. Otherwise, you can open the file " -"using the :func:`os.open` function, which returns a file descriptor directly " -"(the file still needs to be closed when done)." +"existing Python file object, use its :meth:`~io.IOBase.fileno` method to " +"obtain the correct value for the *fileno* parameter. Otherwise, you can " +"open the file using the :func:`os.open` function, which returns a file " +"descriptor directly (the file still needs to be closed when done)." msgstr "" #: ../../library/mmap.rst:28 diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 38134ab93d..ae00e0cc2c 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2845,8 +2845,9 @@ msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " "Win32 function ``WaitForMultipleObjects()``) or it can be an object with a :" -"meth:`fileno` method which returns a socket handle or pipe handle. (Note " -"that pipe handles and socket handles are **not** waitable handles.)" +"meth:`~io.IOBase.fileno` method which returns a socket handle or pipe " +"handle. (Note that pipe handles and socket handles are **not** waitable " +"handles.)" msgstr "" #: ../../library/multiprocessing.rst:2581 diff --git a/library/operator.po b/library/operator.po index ed45990e29..20f1745011 100644 --- a/library/operator.po +++ b/library/operator.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-02-18 14:49+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -89,8 +89,8 @@ msgid "" "`~object.__len__` methods.)" msgstr "" "回傳 :keyword:`not` *obj* 的結果。(請注意物件實例並沒有 :meth:`!__not__` " -"method(方法);只有直譯器核心定義此操作。結果會受 :meth:`~object.__bool__` 和 " -":meth:`~object.__len__` method 影響。)" +"method(方法);只有直譯器核心定義此操作。結果會受 :meth:`~object.__bool__` " +"和 :meth:`~object.__len__` method 影響。)" #: ../../library/operator.rst:69 msgid "" @@ -298,11 +298,11 @@ msgstr "" #: ../../library/operator.rst:308 msgid "" "Return a callable object that fetches *item* from its operand using the " -"operand's :meth:`__getitem__` method. If multiple items are specified, " -"returns a tuple of lookup values. For example:" +"operand's :meth:`~object.__getitem__` method. If multiple items are " +"specified, returns a tuple of lookup values. For example:" msgstr "" -"回傳一個使用運算元的 :meth:`__getitem__` 方法從運算元中獲取 *item* 的可呼叫物" -"件。如果指定了多個條目,則回傳一個查詢值的 tupple。例如:" +"回傳一個使用運算元的 :meth:`~object.__getitem__` 方法從運算元中獲取 *item* 的" +"可呼叫物件。如果指定了多個條目,則回傳一個查詢值的 tupple。例如:" #: ../../library/operator.rst:312 msgid "After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``." @@ -318,13 +318,13 @@ msgstr "" #: ../../library/operator.rst:329 msgid "" -"The items can be any type accepted by the operand's :meth:`__getitem__` " -"method. Dictionaries accept any :term:`hashable` value. Lists, tuples, and " -"strings accept an index or a slice:" +"The items can be any type accepted by the operand's :meth:`~object." +"__getitem__` method. Dictionaries accept any :term:`hashable` value. " +"Lists, tuples, and strings accept an index or a slice:" msgstr "" -"傳入的條目可以為運算元的 :meth:`__getitem__` 所接受的任何型別。dictionary(字" -"典)接受任意\\ :term:`可雜湊 `\\ 的值。list、tupple 和字串接受索引" -"或切片:" +"傳入的條目可以為運算元的 :meth:`~object.__getitem__` 所接受的任何型別。" +"dictionary(字典)接受任意\\ :term:`可雜湊 `\\ 的值。list、tupple " +"和字串接受索引或切片:" #: ../../library/operator.rst:343 msgid "" diff --git a/library/posix.po b/library/posix.po index 7f86596528..c28cdb16cf 100644 --- a/library/posix.po +++ b/library/posix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2023-01-24 00:05+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,11 @@ msgstr "" "該模組提供對由 C 標準和 POSIX 標準(一種偽裝的 Unix 介面)所標準化的作業系統" "功能的存取。" -#: ../../library/posix.rst:16 +#: ../../library/posix.rst:14 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/posix.rst:18 msgid "" "**Do not import this module directly.** Instead, import the module :mod:" "`os`, which provides a *portable* version of this interface. On Unix, the :" @@ -51,7 +55,7 @@ msgstr "" "`posix` *不會有*\\ 性能損失。此外,:mod:`os` 提供了一些額外的功能,例如當 " "``os.environ`` 中的條目更改時自動呼叫 :func:`~os.putenv`。" -#: ../../library/posix.rst:25 +#: ../../library/posix.rst:27 msgid "" "Errors are reported as exceptions; the usual exceptions are given for type " "errors, while errors reported by the system calls raise :exc:`OSError`." @@ -59,11 +63,11 @@ msgstr "" "錯誤會以例外的形式被回報;常見的例外是因為型別錯誤而給出的,而系統呼叫回報的" "錯誤會引發 :exc:`OSError`。" -#: ../../library/posix.rst:32 +#: ../../library/posix.rst:34 msgid "Large File Support" msgstr "對大檔案 (Large File) 的支援" -#: ../../library/posix.rst:40 +#: ../../library/posix.rst:42 msgid "" "Several operating systems (including AIX and Solaris) provide support for " "files that are larger than 2 GiB from a C programming model where :c:expr:" @@ -76,7 +80,7 @@ msgstr "" "大小和偏移量 (offset) 種類定義為 64-bit 值來實作。此類檔案有時被稱為「大檔案 " "(:dfn:`large files`)」。" -#: ../../library/posix.rst:46 +#: ../../library/posix.rst:48 msgid "" "Large file support is enabled in Python when the size of an :c:type:`off_t` " "is larger than a :c:expr:`long` and the :c:expr:`long long` is at least as " @@ -91,18 +95,18 @@ msgstr "" "\n" "::" -#: ../../library/posix.rst:56 +#: ../../library/posix.rst:58 msgid "On large-file-capable Linux systems, this might work::" msgstr "" "在支援大檔案的 Linux 系統上,這可能有效:\n" "\n" "::" -#: ../../library/posix.rst:65 +#: ../../library/posix.rst:67 msgid "Notable Module Contents" msgstr "值得注意的模組內容" -#: ../../library/posix.rst:67 +#: ../../library/posix.rst:69 msgid "" "In addition to many functions described in the :mod:`os` module " "documentation, :mod:`posix` defines the following data item:" @@ -110,7 +114,7 @@ msgstr "" "除了 :mod:`os` 模組說明文件中描述的許多函式外,:mod:`posix` 還定義了以下資料" "項目:" -#: ../../library/posix.rst:72 +#: ../../library/posix.rst:74 msgid "" "A dictionary representing the string environment at the time the interpreter " "was started. Keys and values are bytes on Unix and str on Windows. For " @@ -121,7 +125,7 @@ msgstr "" "str。例如,``environ[b'HOME']``\\ (Windows 上為 ``environ['HOME']``\\ )是你" "的主目錄的路徑名,等同於 C 語言中的 ``getenv(\"HOME\")``。" -#: ../../library/posix.rst:77 +#: ../../library/posix.rst:79 msgid "" "Modifying this dictionary does not affect the string environment passed on " "by :func:`~os.execv`, :func:`~os.popen` or :func:`~os.system`; if you need " @@ -134,11 +138,11 @@ msgstr "" "`~os.execve` 或將變數賦值和匯出陳述句新增到 :func:`~os.system` 或 :func:`~os." "popen` 的指令字串中。" -#: ../../library/posix.rst:83 +#: ../../library/posix.rst:85 msgid "On Unix, keys and values are bytes." msgstr "在 Unix 上,鍵和值是位元組。" -#: ../../library/posix.rst:88 +#: ../../library/posix.rst:90 msgid "" "The :mod:`os` module provides an alternate implementation of ``environ`` " "which updates the environment on modification. Note also that updating :data:" @@ -150,18 +154,18 @@ msgstr "" "新 :data:`os.environ` 將使該字典變成過時的。建議使用 :mod:`os` 模組版本,而不" "是直接存取 :mod:`posix` 模組。" -#: ../../library/posix.rst:14 +#: ../../library/posix.rst:16 msgid "module" msgstr "module(模組)" -#: ../../library/posix.rst:14 +#: ../../library/posix.rst:16 msgid "os" msgstr "os" -#: ../../library/posix.rst:34 +#: ../../library/posix.rst:36 msgid "large files" msgstr "large files(大型檔案)" -#: ../../library/posix.rst:34 +#: ../../library/posix.rst:36 msgid "file" msgstr "file(檔案)" diff --git a/library/pty.po b/library/pty.po index cbce70b540..14588f7c4b 100644 --- a/library/pty.po +++ b/library/pty.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,17 +34,21 @@ msgid "" msgstr "" #: ../../library/pty.rst:19 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/pty.rst:21 msgid "" "Pseudo-terminal handling is highly platform dependent. This code is mainly " "tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX " "platforms but it's not been thoroughly tested)." msgstr "" -#: ../../library/pty.rst:23 +#: ../../library/pty.rst:25 msgid "The :mod:`pty` module defines the following functions:" msgstr "" -#: ../../library/pty.rst:28 +#: ../../library/pty.rst:30 msgid "" "Fork. Connect the child's controlling terminal to a pseudo-terminal. Return " "value is ``(pid, fd)``. Note that the child gets *pid* 0, and the *fd* is " @@ -53,14 +57,14 @@ msgid "" "the child's standard input and output)." msgstr "" -#: ../../library/pty.rst:37 +#: ../../library/pty.rst:39 msgid "" "Open a new pseudo-terminal pair, using :func:`os.openpty` if possible, or " "emulation code for generic Unix systems. Return a pair of file descriptors " "``(master, slave)``, for the master and the slave end, respectively." msgstr "" -#: ../../library/pty.rst:44 +#: ../../library/pty.rst:46 msgid "" "Spawn a process, and connect its controlling terminal with the current " "process's standard io. This is often used to baffle programs which insist on " @@ -69,14 +73,14 @@ msgid "" "will return." msgstr "" -#: ../../library/pty.rst:50 +#: ../../library/pty.rst:52 msgid "" "A loop copies STDIN of the current process to the child and data received " "from the child to STDOUT of the current process. It is not signaled to the " "child if STDIN of the current process closes down." msgstr "" -#: ../../library/pty.rst:54 +#: ../../library/pty.rst:56 msgid "" "The functions *master_read* and *stdin_read* are passed a file descriptor " "which they should read from, and they should always return a byte string. In " @@ -84,7 +88,7 @@ msgid "" "array should be returned to signal end of file." msgstr "" -#: ../../library/pty.rst:59 +#: ../../library/pty.rst:61 msgid "" "The default implementation for both functions will read and return up to " "1024 bytes each time the function is called. The *master_read* callback is " @@ -93,7 +97,7 @@ msgid "" "the parent process's standard input." msgstr "" -#: ../../library/pty.rst:65 +#: ../../library/pty.rst:67 msgid "" "Returning an empty byte string from either callback is interpreted as an end-" "of-file (EOF) condition, and that callback will not be called after that. If " @@ -103,35 +107,35 @@ msgid "" "signals EOF the same behavior results (on linux at least)." msgstr "" -#: ../../library/pty.rst:72 +#: ../../library/pty.rst:74 msgid "" "Return the exit status value from :func:`os.waitpid` on the child process." msgstr "" -#: ../../library/pty.rst:74 +#: ../../library/pty.rst:76 msgid "" ":func:`os.waitstatus_to_exitcode` can be used to convert the exit status " "into an exit code." msgstr "" -#: ../../library/pty.rst:77 +#: ../../library/pty.rst:79 msgid "" "Raises an :ref:`auditing event ` ``pty.spawn`` with argument " "``argv``." msgstr "" "引發一個附帶引數 ``argv`` 的\\ :ref:`稽核事件 ` ``pty.spawn``。" -#: ../../library/pty.rst:79 +#: ../../library/pty.rst:81 msgid "" ":func:`spawn` now returns the status value from :func:`os.waitpid` on the " "child process." msgstr "" -#: ../../library/pty.rst:84 +#: ../../library/pty.rst:86 msgid "Example" msgstr "範例" -#: ../../library/pty.rst:88 +#: ../../library/pty.rst:90 msgid "" "The following program acts like the Unix command :manpage:`script(1)`, using " "a pseudo-terminal to record all input and output of a terminal session in a " diff --git a/library/pwd.po b/library/pwd.po index 1ac2d5f4cc..10903ae7c6 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2023-05-20 16:08+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,18 +30,9 @@ msgid "" msgstr "" "此模組提供對 Unix 使用者帳戶和密碼資料庫的存取介面。它適用於所有 Unix 版本。" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr ":ref:`Availability `:非 Emscripten、非 WASI。" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上不起作用" -"或無法使用。更多資訊請參閱 :ref:`wasm-availability`。" +#: ../../library/pwd.rst:13 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/pwd.rst:15 msgid "" @@ -214,3 +205,11 @@ msgstr "module(模組)" #: ../../library/pwd.rst:42 msgid "crypt" msgstr "crypt" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上不起" +#~ "作用或無法使用。更多資訊請參閱 :ref:`wasm-availability`。" diff --git a/library/resource.po b/library/resource.po index 9b0e297da0..c310598aa7 100644 --- a/library/resource.po +++ b/library/resource.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,18 +28,9 @@ msgid "" "resources utilized by a program." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" +#: ../../library/resource.rst:16 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/resource.rst:18 msgid "" @@ -123,7 +114,7 @@ msgstr "" msgid "VxWorks only supports setting :data:`RLIMIT_NOFILE`." msgstr "" -#: ../../library/resource.rst:94 +#: ../../library/resource.rst:83 msgid "" "Raises an :ref:`auditing event ` ``resource.setrlimit`` with " "arguments ``resource``, ``limits``." @@ -154,7 +145,7 @@ msgid "" "process." msgstr "" -#: ../../library/resource.rst:113 +#: ../../library/resource.rst:102 msgid "" "Raises an :ref:`auditing event ` ``resource.prlimit`` with " "arguments ``pid``, ``resource``, ``limits``." @@ -604,3 +595,11 @@ msgid "" "Pass to :func:`getrusage` to request resources consumed by the current " "thread. May not be available on all systems." msgstr "" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/selectors.po b/library/selectors.po index 71fd2b0f0f..a1f060159a 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,8 +43,8 @@ msgid "" "concrete implementations (:class:`KqueueSelector`, :class:" "`EpollSelector`...), that can be used to wait for I/O readiness notification " "on multiple file objects. In the following, \"file object\" refers to any " -"object with a :meth:`fileno()` method, or a raw file descriptor. See :term:" -"`file object`." +"object with a :meth:`~io.IOBase.fileno` method, or a raw file descriptor. " +"See :term:`file object`." msgstr "" #: ../../library/selectors.rst:26 diff --git a/library/socket.po b/library/socket.po index 1c2482488b..585c4b7523 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-30 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -113,8 +113,8 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: ../../library/socket.rst:66 ../../library/socket.rst:1142 -#: ../../library/socket.rst:1184 ../../library/socket.rst:1943 +#: ../../library/socket.rst:66 ../../library/socket.rst:1149 +#: ../../library/socket.rst:1191 ../../library/socket.rst:1950 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -288,8 +288,8 @@ msgstr "" msgid "*feat* and *mask* are unsigned 32bit integers." msgstr "" -#: ../../library/socket.rst:171 ../../library/socket.rst:583 -#: ../../library/socket.rst:1865 +#: ../../library/socket.rst:171 ../../library/socket.rst:590 +#: ../../library/socket.rst:1872 msgid ":ref:`Availability `: Linux >= 2.6.38." msgstr ":ref:`適用 `:Linux >= 2.6.38。" @@ -304,7 +304,7 @@ msgid "" "context ID or CID and port are integers." msgstr "" -#: ../../library/socket.rst:181 ../../library/socket.rst:656 +#: ../../library/socket.rst:181 ../../library/socket.rst:663 msgid ":ref:`Availability `: Linux >= 3.9" msgstr ":ref:`適用 `:Linux 3.9 以上。" @@ -370,7 +370,7 @@ msgid "" "address, whose interpretation depends on the device." msgstr "" -#: ../../library/socket.rst:210 ../../library/socket.rst:531 +#: ../../library/socket.rst:210 ../../library/socket.rst:538 msgid ":ref:`Availability `: Linux >= 2.2." msgstr ":ref:`適用 `:Linux >= 2.2。" @@ -382,7 +382,7 @@ msgid "" "*port* are non-negative integers." msgstr "" -#: ../../library/socket.rst:217 ../../library/socket.rst:632 +#: ../../library/socket.rst:217 ../../library/socket.rst:639 msgid ":ref:`Availability `: Linux >= 4.7." msgstr ":ref:`適用 `:Linux >= 4.7。" @@ -562,7 +562,14 @@ msgid "" "depending on the system." msgstr "" -#: ../../library/socket.rst:362 +#: ../../library/socket.rst:357 +msgid "" +":const:`AF_UNSPEC` means that :func:`getaddrinfo` should return socket " +"addresses for any address family (either IPv4, IPv6, or any other) that can " +"be used." +msgstr "" + +#: ../../library/socket.rst:367 msgid "" "These constants represent the socket types, used for the second argument to :" "func:`.socket`. More constants may be available depending on the system. " @@ -570,24 +577,24 @@ msgid "" "useful.)" msgstr "" -#: ../../library/socket.rst:370 +#: ../../library/socket.rst:375 msgid "" "These two constants, if defined, can be combined with the socket types and " "allow you to set some flags atomically (thus avoiding possible race " "conditions and the need for separate calls)." msgstr "" -#: ../../library/socket.rst:376 +#: ../../library/socket.rst:381 msgid "" "`Secure File Descriptor Handling `_ for a more thorough explanation." msgstr "" -#: ../../library/socket.rst:379 +#: ../../library/socket.rst:384 msgid ":ref:`Availability `: Linux >= 2.6.27." msgstr ":ref:`適用 `:Linux >= 2.6.27。" -#: ../../library/socket.rst:398 +#: ../../library/socket.rst:405 msgid "" "Many constants of these forms, documented in the Unix documentation on " "sockets and/or the IP protocol, are also defined in the socket module. They " @@ -597,41 +604,41 @@ msgid "" "default values are provided." msgstr "" -#: ../../library/socket.rst:405 +#: ../../library/socket.rst:412 msgid "" "``SO_DOMAIN``, ``SO_PROTOCOL``, ``SO_PEERSEC``, ``SO_PASSSEC``, " "``TCP_USER_TIMEOUT``, ``TCP_CONGESTION`` were added." msgstr "" -#: ../../library/socket.rst:409 +#: ../../library/socket.rst:416 msgid "" "On Windows, ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:413 +#: ../../library/socket.rst:420 msgid "``TCP_NOTSENT_LOWAT`` was added." msgstr "新增 ``TCP_NOTSENT_LOWAT``。" -#: ../../library/socket.rst:416 +#: ../../library/socket.rst:423 msgid "" "On Windows, ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:419 +#: ../../library/socket.rst:426 msgid "" "``IP_RECVTOS`` was added. Added ``TCP_KEEPALIVE``. On MacOS this constant " "can be used in the same way that ``TCP_KEEPIDLE`` is used on Linux." msgstr "" -#: ../../library/socket.rst:424 +#: ../../library/socket.rst:431 msgid "" "Added ``TCP_CONNECTION_INFO``. On MacOS this constant can be used in the " "same way that ``TCP_INFO`` is used on Linux and BSD." msgstr "" -#: ../../library/socket.rst:428 +#: ../../library/socket.rst:435 msgid "" "Added ``SO_RTABLE`` and ``SO_USER_COOKIE``. On OpenBSD and FreeBSD " "respectively those constants can be used in the same way that ``SO_MARK`` is " @@ -647,166 +654,166 @@ msgid "" "``IP_DROP_SOURCE_MEMBERSHIP``." msgstr "" -#: ../../library/socket.rst:447 ../../library/socket.rst:528 -#: ../../library/socket.rst:552 +#: ../../library/socket.rst:454 ../../library/socket.rst:535 +#: ../../library/socket.rst:559 msgid "" "Many constants of these forms, documented in the Linux documentation, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:450 +#: ../../library/socket.rst:457 msgid ":ref:`Availability `: Linux >= 2.6.25, NetBSD >= 8." msgstr ":ref:`適用 `:Linux 2.6.25 以上、NetBSD 8 以上。" -#: ../../library/socket.rst:454 +#: ../../library/socket.rst:461 msgid "NetBSD support was added." msgstr "" -#: ../../library/socket.rst:460 +#: ../../library/socket.rst:467 msgid "" "CAN_BCM, in the CAN protocol family, is the broadcast manager (BCM) " "protocol. Broadcast manager constants, documented in the Linux " "documentation, are also defined in the socket module." msgstr "" -#: ../../library/socket.rst:464 ../../library/socket.rst:499 +#: ../../library/socket.rst:471 ../../library/socket.rst:506 msgid ":ref:`Availability `: Linux >= 2.6.25." msgstr ":ref:`適用 `:Linux >= 2.6.25。" -#: ../../library/socket.rst:467 +#: ../../library/socket.rst:474 msgid "" "The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." msgstr "" -#: ../../library/socket.rst:473 +#: ../../library/socket.rst:480 msgid "" "Enables CAN FD support in a CAN_RAW socket. This is disabled by default. " "This allows your application to send both CAN and CAN FD frames; however, " "you must accept both CAN and CAN FD frames when reading from the socket." msgstr "" -#: ../../library/socket.rst:477 ../../library/socket.rst:488 +#: ../../library/socket.rst:484 ../../library/socket.rst:495 msgid "This constant is documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:479 +#: ../../library/socket.rst:486 msgid ":ref:`Availability `: Linux >= 3.6." msgstr ":ref:`適用 `:Linux >= 3.6。" -#: ../../library/socket.rst:485 +#: ../../library/socket.rst:492 msgid "" "Joins the applied CAN filters such that only CAN frames that match all given " "CAN filters are passed to user space." msgstr "" -#: ../../library/socket.rst:490 +#: ../../library/socket.rst:497 msgid ":ref:`Availability `: Linux >= 4.1." msgstr ":ref:`適用 `:Linux >= 4.1。" -#: ../../library/socket.rst:496 +#: ../../library/socket.rst:503 msgid "" "CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. " "ISO-TP constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:505 +#: ../../library/socket.rst:512 msgid "" "CAN_J1939, in the CAN protocol family, is the SAE J1939 protocol. J1939 " "constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:508 +#: ../../library/socket.rst:515 msgid ":ref:`Availability `: Linux >= 5.4." msgstr ":ref:`適用 `:Linux >= 5.4。" -#: ../../library/socket.rst:516 +#: ../../library/socket.rst:523 msgid "" "These two constants, documented in the FreeBSD divert(4) manual page, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:519 +#: ../../library/socket.rst:526 msgid ":ref:`Availability `: FreeBSD >= 14.0." msgstr ":ref:`適用 `:FreeBSD >= 14.0。" -#: ../../library/socket.rst:536 +#: ../../library/socket.rst:543 msgid "" ":data:`!ETH_P_ALL` can be used in the :class:`~socket.socket` constructor as " "*proto* for the :const:`AF_PACKET` family in order to capture every packet, " "regardless of protocol." msgstr "" -#: ../../library/socket.rst:540 +#: ../../library/socket.rst:547 msgid "For more information, see the :manpage:`packet(7)` manpage." msgstr "" -#: ../../library/socket.rst:542 +#: ../../library/socket.rst:549 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/socket.rst:555 +#: ../../library/socket.rst:562 msgid ":ref:`Availability `: Linux >= 2.6.30." msgstr ":ref:`適用 `:Linux >= 2.6.30。" -#: ../../library/socket.rst:565 +#: ../../library/socket.rst:572 msgid "" "Constants for Windows' WSAIoctl(). The constants are used as arguments to " "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: ../../library/socket.rst:568 ../../library/socket.rst:1557 +#: ../../library/socket.rst:575 ../../library/socket.rst:1564 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "加入 ``SIO_LOOPBACK_FAST_PATH``。" -#: ../../library/socket.rst:574 +#: ../../library/socket.rst:581 msgid "" "TIPC related constants, matching the ones exported by the C socket API. See " "the TIPC documentation for more information." msgstr "" -#: ../../library/socket.rst:581 +#: ../../library/socket.rst:588 msgid "Constants for Linux Kernel cryptography." msgstr "" -#: ../../library/socket.rst:593 +#: ../../library/socket.rst:600 msgid "Constants for Linux host/guest communication." msgstr "" -#: ../../library/socket.rst:595 +#: ../../library/socket.rst:602 msgid ":ref:`Availability `: Linux >= 4.8." msgstr ":ref:`適用 `:Linux >= 4.8。" -#: ../../library/socket.rst:601 +#: ../../library/socket.rst:608 msgid ":ref:`Availability `: BSD, macOS." msgstr ":ref:`適用 `:BSD、macOS。" -#: ../../library/socket.rst:607 +#: ../../library/socket.rst:614 msgid "" "This constant contains a boolean value which indicates if IPv6 is supported " "on this platform." msgstr "" -#: ../../library/socket.rst:613 +#: ../../library/socket.rst:620 msgid "" "These are string constants containing Bluetooth addresses with special " "meanings. For example, :const:`BDADDR_ANY` can be used to indicate any " "address when specifying the binding socket with :const:`BTPROTO_RFCOMM`." msgstr "" -#: ../../library/socket.rst:622 +#: ../../library/socket.rst:629 msgid "" "For use with :const:`BTPROTO_HCI`. :const:`HCI_FILTER` is not available for " "NetBSD or DragonFlyBSD. :const:`HCI_TIME_STAMP` and :const:`HCI_DATA_DIR` " "are not available for FreeBSD, NetBSD, or DragonFlyBSD." msgstr "" -#: ../../library/socket.rst:629 +#: ../../library/socket.rst:636 msgid "" "Constant for Qualcomm's IPC router protocol, used to communicate with " "service providing remote processors." msgstr "" -#: ../../library/socket.rst:638 +#: ../../library/socket.rst:645 msgid "" "LOCAL_CREDS and LOCAL_CREDS_PERSISTENT can be used with SOCK_DGRAM, " "SOCK_STREAM sockets, equivalent to Linux/DragonFlyBSD SO_PASSCRED, while " @@ -815,49 +822,49 @@ msgid "" "message type." msgstr "" -#: ../../library/socket.rst:647 +#: ../../library/socket.rst:654 msgid ":ref:`Availability `: FreeBSD." msgstr ":ref:`適用 `:FreeBSD。" -#: ../../library/socket.rst:651 +#: ../../library/socket.rst:658 msgid "" "Constant to optimize CPU locality, to be used in conjunction with :data:" "`SO_REUSEPORT`." msgstr "" -#: ../../library/socket.rst:671 +#: ../../library/socket.rst:678 msgid "Constants for Windows Hyper-V sockets for host/guest communications." msgstr "" -#: ../../library/socket.rst:673 ../../library/socket.rst:880 -#: ../../library/socket.rst:1971 +#: ../../library/socket.rst:680 ../../library/socket.rst:887 +#: ../../library/socket.rst:1978 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/socket.rst:684 +#: ../../library/socket.rst:691 msgid "" "`IEEE 802.3 protocol number `_. constants." msgstr "" -#: ../../library/socket.rst:688 +#: ../../library/socket.rst:695 msgid ":ref:`Availability `: Linux, FreeBSD, macOS." msgstr ":ref:`適用 `:Linux、FreeBSD、macOS。" -#: ../../library/socket.rst:694 +#: ../../library/socket.rst:701 msgid "Functions" msgstr "函式" -#: ../../library/socket.rst:697 +#: ../../library/socket.rst:704 msgid "Creating sockets" msgstr "建立 sockets" -#: ../../library/socket.rst:699 +#: ../../library/socket.rst:706 msgid "" "The following functions all create :ref:`socket objects `." msgstr "" -#: ../../library/socket.rst:704 +#: ../../library/socket.rst:711 msgid "" "Create a new socket using the given address family, socket type and protocol " "number. The address family should be :const:`AF_INET` (the default), :const:" @@ -870,7 +877,7 @@ msgid "" "`CAN_J1939`." msgstr "" -#: ../../library/socket.rst:714 +#: ../../library/socket.rst:721 msgid "" "If *fileno* is specified, the values for *family*, *type*, and *proto* are " "auto-detected from the specified file descriptor. Auto-detection can be " @@ -881,12 +888,12 @@ msgid "" "This may help close a detached socket using :meth:`socket.close()`." msgstr "" -#: ../../library/socket.rst:723 ../../library/socket.rst:869 -#: ../../library/socket.rst:1376 ../../library/socket.rst:1470 +#: ../../library/socket.rst:730 ../../library/socket.rst:876 +#: ../../library/socket.rst:1383 ../../library/socket.rst:1477 msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:736 +#: ../../library/socket.rst:743 msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." @@ -894,44 +901,44 @@ msgstr "" "引發一個附帶引數 ``self``、``family``、``type``、``protocol`` 的\\ :ref:`稽核" "事件 ` ``socket.__new__``。" -#: ../../library/socket.rst:727 +#: ../../library/socket.rst:734 msgid "The AF_CAN family was added. The AF_RDS family was added." msgstr "" -#: ../../library/socket.rst:731 +#: ../../library/socket.rst:738 msgid "The CAN_BCM protocol was added." msgstr "新增 CAN_BCM 協定。" -#: ../../library/socket.rst:734 ../../library/socket.rst:871 +#: ../../library/socket.rst:741 ../../library/socket.rst:878 msgid "The returned socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:737 +#: ../../library/socket.rst:744 msgid "The CAN_ISOTP protocol was added." msgstr "新增 CAN_ISOTP 協定。" -#: ../../library/socket.rst:740 +#: ../../library/socket.rst:747 msgid "" "When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied " "to *type* they are cleared, and :attr:`socket.type` will not reflect them. " "They are still passed to the underlying system ``socket()`` call. Therefore," msgstr "" -#: ../../library/socket.rst:752 +#: ../../library/socket.rst:759 msgid "" "will still create a non-blocking socket on OSes that support " "``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." msgstr "" -#: ../../library/socket.rst:756 +#: ../../library/socket.rst:763 msgid "The CAN_J1939 protocol was added." msgstr "新增 CAN_J1939 協定。" -#: ../../library/socket.rst:759 +#: ../../library/socket.rst:766 msgid "The IPPROTO_MPTCP protocol was added." msgstr "新增 IPPROTO_MPTCP 協定。" -#: ../../library/socket.rst:764 +#: ../../library/socket.rst:771 msgid "" "Build a pair of connected socket objects using the given address family, " "socket type, and protocol number. Address family, socket type, and protocol " @@ -940,25 +947,25 @@ msgid "" "`AF_INET`." msgstr "" -#: ../../library/socket.rst:769 +#: ../../library/socket.rst:776 msgid "The newly created sockets are :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:771 +#: ../../library/socket.rst:778 msgid "" "The returned socket objects now support the whole socket API, rather than a " "subset." msgstr "" -#: ../../library/socket.rst:775 +#: ../../library/socket.rst:782 msgid "The returned sockets are now non-inheritable." msgstr "" -#: ../../library/socket.rst:778 +#: ../../library/socket.rst:785 msgid "Windows support added." msgstr "新增對 Windows 的支援。" -#: ../../library/socket.rst:784 +#: ../../library/socket.rst:791 msgid "" "Connect to a TCP service listening on the internet *address* (a 2-tuple " "``(host, port)``), and return the socket object. This is a higher-level " @@ -969,21 +976,21 @@ msgid "" "IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:792 +#: ../../library/socket.rst:799 msgid "" "Passing the optional *timeout* parameter will set the timeout on the socket " "instance before attempting to connect. If no *timeout* is supplied, the " "global default timeout setting returned by :func:`getdefaulttimeout` is used." msgstr "" -#: ../../library/socket.rst:797 +#: ../../library/socket.rst:804 msgid "" "If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the " "socket to bind to as its source address before connecting. If host or port " "are '' or 0 respectively the OS default behavior will be used." msgstr "" -#: ../../library/socket.rst:801 +#: ../../library/socket.rst:808 msgid "" "When a connection cannot be created, an exception is raised. By default, it " "is the exception from the last address in the list. If *all_errors* is " @@ -991,21 +998,21 @@ msgid "" "attempts." msgstr "" -#: ../../library/socket.rst:806 +#: ../../library/socket.rst:813 msgid "*source_address* was added." msgstr "新增 *source_address*\\ 。" -#: ../../library/socket.rst:809 +#: ../../library/socket.rst:816 msgid "*all_errors* was added." msgstr "新增 *all_errors*\\ 。" -#: ../../library/socket.rst:815 +#: ../../library/socket.rst:822 msgid "" "Convenience function which creates a TCP socket bound to *address* (a 2-" "tuple ``(host, port)``) and returns the socket object." msgstr "" -#: ../../library/socket.rst:818 +#: ../../library/socket.rst:825 msgid "" "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " "the queue size passed to :meth:`socket.listen`; if not specified , a default " @@ -1013,7 +1020,7 @@ msgid "" "`SO_REUSEPORT` socket option." msgstr "" -#: ../../library/socket.rst:823 +#: ../../library/socket.rst:830 msgid "" "If *dualstack_ipv6* is true and the platform supports it the socket will be " "able to accept both IPv4 and IPv6 connections, else it will raise :exc:" @@ -1026,60 +1033,60 @@ msgid "" "func:`has_dualstack_ipv6`:" msgstr "" -#: ../../library/socket.rst:845 +#: ../../library/socket.rst:852 msgid "" "On POSIX platforms the :data:`SO_REUSEADDR` socket option is set in order to " "immediately reuse previous sockets which were bound on the same *address* " "and remained in TIME_WAIT state." msgstr "" -#: ../../library/socket.rst:853 +#: ../../library/socket.rst:860 msgid "" "Return ``True`` if the platform supports creating a TCP socket which can " "handle both IPv4 and IPv6 connections." msgstr "" -#: ../../library/socket.rst:860 +#: ../../library/socket.rst:867 msgid "" "Duplicate the file descriptor *fd* (an integer as returned by a file " -"object's :meth:`fileno` method) and build a socket object from the result. " -"Address family, socket type and protocol number are as for the :func:`." -"socket` function above. The file descriptor should refer to a socket, but " -"this is not checked --- subsequent operations on the object may fail if the " -"file descriptor is invalid. This function is rarely needed, but can be used " -"to get or set socket options on a socket passed to a program as standard " -"input or output (such as a server started by the Unix inet daemon). The " -"socket is assumed to be in blocking mode." +"object's :meth:`~io.IOBase.fileno` method) and build a socket object from " +"the result. Address family, socket type and protocol number are as for the :" +"func:`.socket` function above. The file descriptor should refer to a socket, " +"but this is not checked --- subsequent operations on the object may fail if " +"the file descriptor is invalid. This function is rarely needed, but can be " +"used to get or set socket options on a socket passed to a program as " +"standard input or output (such as a server started by the Unix inet " +"daemon). The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:877 +#: ../../library/socket.rst:884 msgid "" "Instantiate a socket from data obtained from the :meth:`socket.share` " "method. The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:887 +#: ../../library/socket.rst:894 msgid "" "This is a Python type object that represents the socket object type. It is " "the same as ``type(socket(...))``." msgstr "" -#: ../../library/socket.rst:892 +#: ../../library/socket.rst:899 msgid "Other functions" msgstr "其他函式" -#: ../../library/socket.rst:894 +#: ../../library/socket.rst:901 msgid "The :mod:`socket` module also offers various network-related services:" msgstr "" -#: ../../library/socket.rst:899 +#: ../../library/socket.rst:906 msgid "" "Close a socket file descriptor. This is like :func:`os.close`, but for " "sockets. On some platforms (most noticeable Windows) :func:`os.close` does " "not work for socket file descriptors." msgstr "" -#: ../../library/socket.rst:907 +#: ../../library/socket.rst:914 msgid "" "Translate the *host*/*port* argument into a sequence of 5-tuples that " "contain all the necessary arguments for creating a socket connected to that " @@ -1089,7 +1096,7 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" -#: ../../library/socket.rst:914 +#: ../../library/socket.rst:921 msgid "" "The *family*, *type* and *proto* arguments can be optionally specified in " "order to narrow the list of addresses returned. Passing zero as a value for " @@ -1100,15 +1107,15 @@ msgid "" "domain name." msgstr "" -#: ../../library/socket.rst:922 +#: ../../library/socket.rst:929 msgid "The function returns a list of 5-tuples with the following structure:" msgstr "" -#: ../../library/socket.rst:924 +#: ../../library/socket.rst:931 msgid "``(family, type, proto, canonname, sockaddr)``" msgstr "``(family, type, proto, canonname, sockaddr)``" -#: ../../library/socket.rst:926 +#: ../../library/socket.rst:933 msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " "be passed to the :func:`.socket` function. *canonname* will be a string " @@ -1120,7 +1127,7 @@ msgid "" "be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:947 +#: ../../library/socket.rst:954 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." @@ -1128,24 +1135,24 @@ msgstr "" "引發一個附帶引數 ``host``、``port``、``family``、``type``、``protocol`` 的" "\\ :ref:`稽核事件 ` ``socket.getaddrinfo``。" -#: ../../library/socket.rst:938 +#: ../../library/socket.rst:945 msgid "" "The following example fetches address information for a hypothetical TCP " "connection to ``example.org`` on port 80 (results may differ on your system " "if IPv6 isn't enabled)::" msgstr "" -#: ../../library/socket.rst:948 +#: ../../library/socket.rst:955 msgid "parameters can now be passed using keyword arguments." msgstr "" -#: ../../library/socket.rst:951 +#: ../../library/socket.rst:958 msgid "" "for IPv6 multicast addresses, string representing an address will not " "contain ``%scope_id`` part." msgstr "" -#: ../../library/socket.rst:957 +#: ../../library/socket.rst:964 msgid "" "Return a fully qualified domain name for *name*. If *name* is omitted or " "empty, it is interpreted as the local host. To find the fully qualified " @@ -1156,7 +1163,7 @@ msgid "" "``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." msgstr "" -#: ../../library/socket.rst:968 +#: ../../library/socket.rst:975 msgid "" "Translate a host name to IPv4 address format. The IPv4 address is returned " "as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " @@ -1166,7 +1173,7 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:985 ../../library/socket.rst:1001 +#: ../../library/socket.rst:992 ../../library/socket.rst:1008 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." @@ -1174,18 +1181,18 @@ msgstr "" "引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyname``。" -#: ../../library/socket.rst:976 ../../library/socket.rst:992 -#: ../../library/socket.rst:1005 ../../library/socket.rst:1020 -#: ../../library/socket.rst:1037 ../../library/socket.rst:1048 -#: ../../library/socket.rst:1059 ../../library/socket.rst:1070 -#: ../../library/socket.rst:1394 ../../library/socket.rst:1441 -#: ../../library/socket.rst:1455 ../../library/socket.rst:1475 -#: ../../library/socket.rst:1522 ../../library/socket.rst:1567 -#: ../../library/socket.rst:1949 ../../library/socket.rst:1959 +#: ../../library/socket.rst:983 ../../library/socket.rst:999 +#: ../../library/socket.rst:1012 ../../library/socket.rst:1027 +#: ../../library/socket.rst:1044 ../../library/socket.rst:1055 +#: ../../library/socket.rst:1066 ../../library/socket.rst:1077 +#: ../../library/socket.rst:1401 ../../library/socket.rst:1448 +#: ../../library/socket.rst:1462 ../../library/socket.rst:1482 +#: ../../library/socket.rst:1529 ../../library/socket.rst:1574 +#: ../../library/socket.rst:1956 ../../library/socket.rst:1966 msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" -#: ../../library/socket.rst:981 +#: ../../library/socket.rst:988 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a 3-" "tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " @@ -1197,26 +1204,26 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:997 +#: ../../library/socket.rst:1004 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:1011 +#: ../../library/socket.rst:1018 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``socket.gethostname``。" -#: ../../library/socket.rst:1002 +#: ../../library/socket.rst:1009 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: ../../library/socket.rst:1010 +#: ../../library/socket.rst:1017 msgid "" "Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1227,7 +1234,7 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:1029 +#: ../../library/socket.rst:1036 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." @@ -1235,7 +1242,7 @@ msgstr "" "引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyaddr``。" -#: ../../library/socket.rst:1025 +#: ../../library/socket.rst:1032 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully " @@ -1243,18 +1250,18 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: ../../library/socket.rst:1030 +#: ../../library/socket.rst:1037 msgid "" "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* " "contains meaningful *scope_id*. Usually this happens for multicast addresses." msgstr "" -#: ../../library/socket.rst:1033 +#: ../../library/socket.rst:1040 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:1046 +#: ../../library/socket.rst:1053 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." @@ -1262,7 +1269,7 @@ msgstr "" "引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` ``socket." "getnameinfo``。" -#: ../../library/socket.rst:1042 +#: ../../library/socket.rst:1049 msgid "" "Translate an internet protocol name (for example, ``'icmp'``) to a constant " "suitable for passing as the (optional) third argument to the :func:`.socket` " @@ -1271,14 +1278,14 @@ msgid "" "chosen automatically if the protocol is omitted or zero." msgstr "" -#: ../../library/socket.rst:1053 +#: ../../library/socket.rst:1060 msgid "" "Translate an internet service name and protocol name to a port number for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1068 +#: ../../library/socket.rst:1075 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." @@ -1286,14 +1293,14 @@ msgstr "" "引發一個附帶引數 ``sockaddr``、``protocolname`` 的\\ :ref:`稽核事件 " "` ``socket.getservbyname``。" -#: ../../library/socket.rst:1064 +#: ../../library/socket.rst:1071 msgid "" "Translate an internet port number and protocol name to a service name for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1079 +#: ../../library/socket.rst:1086 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." @@ -1301,40 +1308,40 @@ msgstr "" "引發一個附帶引數 ``port``、``protocolname`` 的\\ :ref:`稽核事件 ` " "``socket.getservbyport``。" -#: ../../library/socket.rst:1075 +#: ../../library/socket.rst:1082 msgid "" "Convert 32-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1082 +#: ../../library/socket.rst:1089 msgid "" "Convert 16-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1086 ../../library/socket.rst:1104 +#: ../../library/socket.rst:1093 ../../library/socket.rst:1111 msgid "" "Raises :exc:`OverflowError` if *x* does not fit in a 16-bit unsigned integer." msgstr "" -#: ../../library/socket.rst:1093 +#: ../../library/socket.rst:1100 msgid "" "Convert 32-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1100 +#: ../../library/socket.rst:1107 msgid "" "Convert 16-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1111 +#: ../../library/socket.rst:1118 msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " @@ -1343,26 +1350,26 @@ msgid "" "which is the C type for the 32-bit packed binary this function returns." msgstr "" -#: ../../library/socket.rst:1117 +#: ../../library/socket.rst:1124 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -#: ../../library/socket.rst:1120 +#: ../../library/socket.rst:1127 msgid "" "If the IPv4 address string passed to this function is invalid, :exc:" "`OSError` will be raised. Note that exactly what is valid depends on the " "underlying C implementation of :c:func:`inet_aton`." msgstr "" -#: ../../library/socket.rst:1124 +#: ../../library/socket.rst:1131 msgid "" ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " "used instead for IPv4/v6 dual stack support." msgstr "" -#: ../../library/socket.rst:1130 +#: ../../library/socket.rst:1137 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1372,7 +1379,7 @@ msgid "" "argument." msgstr "" -#: ../../library/socket.rst:1137 +#: ../../library/socket.rst:1144 msgid "" "If the byte sequence passed to this function is not exactly 4 bytes in " "length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " @@ -1380,7 +1387,7 @@ msgid "" "support." msgstr "" -#: ../../library/socket.rst:1148 +#: ../../library/socket.rst:1155 msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " @@ -1388,7 +1395,7 @@ msgid "" "`inet_aton`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1153 +#: ../../library/socket.rst:1160 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" @@ -1397,15 +1404,15 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:1159 ../../library/socket.rst:1179 +#: ../../library/socket.rst:1166 ../../library/socket.rst:1186 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/socket.rst:1161 ../../library/socket.rst:1181 +#: ../../library/socket.rst:1168 ../../library/socket.rst:1188 msgid "Windows support added" msgstr "" -#: ../../library/socket.rst:1167 +#: ../../library/socket.rst:1174 msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " @@ -1414,7 +1421,7 @@ msgid "" "(similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1174 +#: ../../library/socket.rst:1181 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " @@ -1422,7 +1429,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: ../../library/socket.rst:1196 +#: ../../library/socket.rst:1203 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1433,16 +1440,16 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1205 ../../library/socket.rst:1228 +#: ../../library/socket.rst:1212 ../../library/socket.rst:1235 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" -#: ../../library/socket.rst:1207 ../../library/socket.rst:1697 -#: ../../library/socket.rst:1741 ../../library/socket.rst:1849 +#: ../../library/socket.rst:1214 ../../library/socket.rst:1704 +#: ../../library/socket.rst:1748 ../../library/socket.rst:1856 msgid "Most Unix platforms." msgstr "" -#: ../../library/socket.rst:1214 +#: ../../library/socket.rst:1221 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1452,7 +1459,7 @@ msgid "" "values." msgstr "" -#: ../../library/socket.rst:1222 +#: ../../library/socket.rst:1229 msgid "" "Note that some systems might support ancillary data without providing this " "function. Also note that setting the buffer size using the results of this " @@ -1460,31 +1467,31 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: ../../library/socket.rst:1230 +#: ../../library/socket.rst:1237 msgid "most Unix platforms." msgstr "" -#: ../../library/socket.rst:1237 +#: ../../library/socket.rst:1244 msgid "" "Return the default timeout in seconds (float) for new socket objects. A " "value of ``None`` indicates that new socket objects have no timeout. When " "the socket module is first imported, the default is ``None``." msgstr "" -#: ../../library/socket.rst:1244 +#: ../../library/socket.rst:1251 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " "socket module is first imported, the default is ``None``. See :meth:" "`~socket.settimeout` for possible values and their respective meanings." msgstr "" -#: ../../library/socket.rst:1252 +#: ../../library/socket.rst:1259 msgid "" "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " "you don't have enough rights." msgstr "" -#: ../../library/socket.rst:1266 +#: ../../library/socket.rst:1273 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." @@ -1492,114 +1499,114 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1257 ../../library/socket.rst:1695 -#: ../../library/socket.rst:1739 +#: ../../library/socket.rst:1264 ../../library/socket.rst:1702 +#: ../../library/socket.rst:1746 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/socket.rst:1264 +#: ../../library/socket.rst:1271 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1268 ../../library/socket.rst:1295 -#: ../../library/socket.rst:1312 ../../library/socket.rst:1329 -#: ../../library/socket.rst:1343 +#: ../../library/socket.rst:1275 ../../library/socket.rst:1302 +#: ../../library/socket.rst:1319 ../../library/socket.rst:1336 +#: ../../library/socket.rst:1350 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" -#: ../../library/socket.rst:1272 ../../library/socket.rst:1299 -#: ../../library/socket.rst:1316 +#: ../../library/socket.rst:1279 ../../library/socket.rst:1306 +#: ../../library/socket.rst:1323 msgid "Windows support was added." msgstr "增加對 Windows 的支援。" -#: ../../library/socket.rst:1277 +#: ../../library/socket.rst:1284 msgid "" "On Windows network interfaces have different names in different contexts " "(all names are examples):" msgstr "" -#: ../../library/socket.rst:1280 +#: ../../library/socket.rst:1287 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgstr "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" -#: ../../library/socket.rst:1281 +#: ../../library/socket.rst:1288 msgid "name: ``ethernet_32770``" msgstr "" -#: ../../library/socket.rst:1282 +#: ../../library/socket.rst:1289 msgid "friendly name: ``vEthernet (nat)``" msgstr "" -#: ../../library/socket.rst:1283 +#: ../../library/socket.rst:1290 msgid "description: ``Hyper-V Virtual Ethernet Adapter``" msgstr "" -#: ../../library/socket.rst:1285 +#: ../../library/socket.rst:1292 msgid "" "This function returns names of the second form from the list, " "``ethernet_32770`` in this example case." msgstr "" -#: ../../library/socket.rst:1291 +#: ../../library/socket.rst:1298 msgid "" "Return a network interface index number corresponding to an interface name. :" "exc:`OSError` if no interface with the given name exists." msgstr "" -#: ../../library/socket.rst:1303 ../../library/socket.rst:1320 +#: ../../library/socket.rst:1310 ../../library/socket.rst:1327 msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" -#: ../../library/socket.rst:1308 +#: ../../library/socket.rst:1315 msgid "" "Return a network interface name corresponding to an interface index number. :" "exc:`OSError` if no interface with the given index exists." msgstr "" -#: ../../library/socket.rst:1325 +#: ../../library/socket.rst:1332 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " "*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" "`sendmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1331 ../../library/socket.rst:1345 +#: ../../library/socket.rst:1338 ../../library/socket.rst:1352 msgid "" "Unix platforms supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` " "mechanism." msgstr "" -#: ../../library/socket.rst:1339 +#: ../../library/socket.rst:1346 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " "*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`recvmsg` " "for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1352 +#: ../../library/socket.rst:1359 msgid "Any truncated integers at the end of the list of file descriptors." msgstr "" -#: ../../library/socket.rst:1358 +#: ../../library/socket.rst:1365 msgid "Socket Objects" msgstr "Socket 物件" -#: ../../library/socket.rst:1360 +#: ../../library/socket.rst:1367 msgid "" "Socket objects have the following methods. Except for :meth:`~socket." "makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" -#: ../../library/socket.rst:1364 +#: ../../library/socket.rst:1371 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`~socket.close`." msgstr "" -#: ../../library/socket.rst:1371 +#: ../../library/socket.rst:1378 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value is a pair ``(conn, address)`` where *conn* " @@ -1608,27 +1615,27 @@ msgid "" "connection." msgstr "" -#: ../../library/socket.rst:1378 ../../library/socket.rst:1472 +#: ../../library/socket.rst:1385 ../../library/socket.rst:1479 msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1381 ../../library/socket.rst:1610 -#: ../../library/socket.rst:1624 ../../library/socket.rst:1701 -#: ../../library/socket.rst:1774 ../../library/socket.rst:1793 -#: ../../library/socket.rst:1810 ../../library/socket.rst:1855 +#: ../../library/socket.rst:1388 ../../library/socket.rst:1617 +#: ../../library/socket.rst:1631 ../../library/socket.rst:1708 +#: ../../library/socket.rst:1781 ../../library/socket.rst:1800 +#: ../../library/socket.rst:1817 ../../library/socket.rst:1862 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" "`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1389 +#: ../../library/socket.rst:1396 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1403 +#: ../../library/socket.rst:1410 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." @@ -1636,7 +1643,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.bind``。" -#: ../../library/socket.rst:1399 +#: ../../library/socket.rst:1406 msgid "" "Mark the socket closed. The underlying system resource (e.g. a file " "descriptor) is also closed when all file objects from :meth:`makefile()` are " @@ -1645,20 +1652,20 @@ msgid "" "flushed)." msgstr "" -#: ../../library/socket.rst:1405 +#: ../../library/socket.rst:1412 msgid "" "Sockets are automatically closed when they are garbage-collected, but it is " "recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " "statement around them." msgstr "" -#: ../../library/socket.rst:1409 +#: ../../library/socket.rst:1416 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`close` call is made." msgstr "" -#: ../../library/socket.rst:1415 +#: ../../library/socket.rst:1422 msgid "" ":meth:`close()` releases the resource associated with a connection but does " "not necessarily close the connection immediately. If you want to close the " @@ -1666,13 +1673,13 @@ msgid "" "`close()`." msgstr "" -#: ../../library/socket.rst:1423 +#: ../../library/socket.rst:1430 msgid "" "Connect to a remote socket at *address*. (The format of *address* depends on " "the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1426 +#: ../../library/socket.rst:1433 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`TimeoutError` on timeout, if the " @@ -1682,7 +1689,7 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1444 ../../library/socket.rst:1464 +#: ../../library/socket.rst:1451 ../../library/socket.rst:1471 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." @@ -1690,7 +1697,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.connect``。" -#: ../../library/socket.rst:1435 +#: ../../library/socket.rst:1442 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1698,7 +1705,7 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1446 +#: ../../library/socket.rst:1453 msgid "" "Like ``connect(address)``, but return an error indicator instead of raising " "an exception for errors returned by the C-level :c:func:`connect` call " @@ -1708,38 +1715,38 @@ msgid "" "asynchronous connects." msgstr "" -#: ../../library/socket.rst:1459 +#: ../../library/socket.rst:1466 msgid "" "Put the socket object into closed state without actually closing the " "underlying file descriptor. The file descriptor is returned, and can be " "reused for other purposes." msgstr "" -#: ../../library/socket.rst:1468 +#: ../../library/socket.rst:1475 msgid "Duplicate the socket." msgstr "" -#: ../../library/socket.rst:1480 +#: ../../library/socket.rst:1487 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -#: ../../library/socket.rst:1483 +#: ../../library/socket.rst:1490 msgid "" "Under Windows the small integer returned by this method cannot be used where " "a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " "have this limitation." msgstr "" -#: ../../library/socket.rst:1489 +#: ../../library/socket.rst:1496 msgid "" "Get the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle: ``True`` if the socket can be inherited in " "child processes, ``False`` if it cannot." msgstr "" -#: ../../library/socket.rst:1498 +#: ../../library/socket.rst:1505 msgid "" "Return the remote address to which the socket is connected. This is useful " "to find out the port number of a remote IPv4/v6 socket, for instance. (The " @@ -1747,14 +1754,14 @@ msgid "" "above.) On some systems this function is not supported." msgstr "" -#: ../../library/socket.rst:1506 +#: ../../library/socket.rst:1513 msgid "" "Return the socket's own address. This is useful to find out the port number " "of an IPv4/v6 socket, for instance. (The format of the address returned " "depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1513 +#: ../../library/socket.rst:1520 msgid "" "Return the value of the given socket option (see the Unix man page :manpage:" "`getsockopt(2)`). The needed symbolic constants (:const:`SO_\\*` etc.) are " @@ -1766,16 +1773,16 @@ msgid "" "`struct` for a way to decode C structures encoded as byte strings)." msgstr "" -#: ../../library/socket.rst:1527 +#: ../../library/socket.rst:1534 msgid "" "Return ``True`` if socket is in blocking mode, ``False`` if in non-blocking." msgstr "" -#: ../../library/socket.rst:1530 +#: ../../library/socket.rst:1537 msgid "This is equivalent to checking ``socket.gettimeout() != 0``." msgstr "這等同於檢查 ``socket.gettimeout() != 0``。" -#: ../../library/socket.rst:1537 +#: ../../library/socket.rst:1544 msgid "" "Return the timeout in seconds (float) associated with socket operations, or " "``None`` if no timeout is set. This reflects the last call to :meth:" @@ -1786,30 +1793,30 @@ msgstr "" msgid "platform" msgstr "平台" -#: ../../library/socket.rst:1544 +#: ../../library/socket.rst:1551 msgid "Windows" msgstr "Windows" -#: ../../library/socket.rst:1546 +#: ../../library/socket.rst:1553 msgid "" "The :meth:`ioctl` method is a limited interface to the WSAIoctl system " "interface. Please refer to the `Win32 documentation `_ for more information." msgstr "" -#: ../../library/socket.rst:1551 +#: ../../library/socket.rst:1558 msgid "" "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " "functions may be used; they accept a socket object as their first argument." msgstr "" -#: ../../library/socket.rst:1554 +#: ../../library/socket.rst:1561 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: ../../library/socket.rst:1562 +#: ../../library/socket.rst:1569 msgid "" "Enable a server to accept connections. If *backlog* is specified, it must " "be at least 0 (if it is lower, it is set to 0); it specifies the number of " @@ -1817,11 +1824,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: ../../library/socket.rst:1569 +#: ../../library/socket.rst:1576 msgid "The *backlog* parameter is now optional." msgstr "" -#: ../../library/socket.rst:1578 +#: ../../library/socket.rst:1585 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1830,28 +1837,28 @@ msgid "" "``'b'``." msgstr "" -#: ../../library/socket.rst:1583 +#: ../../library/socket.rst:1590 msgid "" "The socket must be in blocking mode; it can have a timeout, but the file " "object's internal buffer may end up in an inconsistent state if a timeout " "occurs." msgstr "" -#: ../../library/socket.rst:1587 +#: ../../library/socket.rst:1594 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " "original socket unless all other file objects have been closed and :meth:" "`socket.close` has been called on the socket object." msgstr "" -#: ../../library/socket.rst:1593 +#: ../../library/socket.rst:1600 msgid "" "On Windows, the file-like object created by :meth:`makefile` cannot be used " "where a file object with a file descriptor is expected, such as the stream " "arguments of :meth:`subprocess.Popen`." msgstr "" -#: ../../library/socket.rst:1600 +#: ../../library/socket.rst:1607 msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " @@ -1860,13 +1867,13 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1607 +#: ../../library/socket.rst:1614 msgid "" "For best match with hardware and network realities, the value of *bufsize* " "should be a relatively small power of 2, for example, 4096." msgstr "" -#: ../../library/socket.rst:1618 +#: ../../library/socket.rst:1625 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1876,14 +1883,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1629 +#: ../../library/socket.rst:1636 msgid "" "For multicast IPv6 address, first item of *address* does not contain " "``%scope_id`` part anymore. In order to get full IPv6 address use :func:" "`getnameinfo`." msgstr "" -#: ../../library/socket.rst:1636 +#: ../../library/socket.rst:1643 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1894,7 +1901,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1646 +#: ../../library/socket.rst:1653 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1909,7 +1916,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1660 +#: ../../library/socket.rst:1667 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " @@ -1922,7 +1929,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1671 +#: ../../library/socket.rst:1678 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " @@ -1931,7 +1938,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1678 +#: ../../library/socket.rst:1685 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1940,7 +1947,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1709 +#: ../../library/socket.rst:1716 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -1953,7 +1960,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1720 +#: ../../library/socket.rst:1727 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -1961,14 +1968,14 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1725 +#: ../../library/socket.rst:1732 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/socket.rst:1748 +#: ../../library/socket.rst:1755 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -1978,7 +1985,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1758 +#: ../../library/socket.rst:1765 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -1987,7 +1994,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1767 +#: ../../library/socket.rst:1774 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1997,7 +2004,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1782 +#: ../../library/socket.rst:1789 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -2007,13 +2014,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1789 +#: ../../library/socket.rst:1796 msgid "" "The socket timeout is no longer reset each time data is sent successfully. " "The socket timeout is now the maximum total duration to send all data." msgstr "" -#: ../../library/socket.rst:1802 +#: ../../library/socket.rst:1809 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -2022,7 +2029,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1819 +#: ../../library/socket.rst:1826 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -2030,7 +2037,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendto``。" -#: ../../library/socket.rst:1818 +#: ../../library/socket.rst:1825 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " @@ -2050,18 +2057,18 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1838 +#: ../../library/socket.rst:1845 msgid "" "The following function sends the list of file descriptors *fds* over an :" "const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1847 +#: ../../library/socket.rst:1854 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/socket.rst:1862 +#: ../../library/socket.rst:1869 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." @@ -2069,14 +2076,14 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendmsg``。" -#: ../../library/socket.rst:1862 +#: ../../library/socket.rst:1869 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: ../../library/socket.rst:1871 +#: ../../library/socket.rst:1878 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -2090,38 +2097,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1887 +#: ../../library/socket.rst:1894 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1895 +#: ../../library/socket.rst:1902 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: ../../library/socket.rst:1898 +#: ../../library/socket.rst:1905 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1900 +#: ../../library/socket.rst:1907 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "``sock.setblocking(True)`` 等價於 ``sock.settimeout(None)``" -#: ../../library/socket.rst:1902 +#: ../../library/socket.rst:1909 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" -#: ../../library/socket.rst:1904 +#: ../../library/socket.rst:1911 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1911 +#: ../../library/socket.rst:1918 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating point number expressing seconds, or ``None``. If a non-" @@ -2131,19 +2138,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1918 +#: ../../library/socket.rst:1925 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1920 +#: ../../library/socket.rst:1927 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1933 +#: ../../library/socket.rst:1940 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in the :mod:" @@ -2156,11 +2163,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1946 +#: ../../library/socket.rst:1953 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:1954 +#: ../../library/socket.rst:1961 msgid "" "Shut down one or both halves of the connection. If *how* is :const:" "`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " @@ -2168,7 +2175,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:1964 +#: ../../library/socket.rst:1971 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " @@ -2179,48 +2186,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:1976 +#: ../../library/socket.rst:1983 msgid "" "Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: ../../library/socket.rst:1979 +#: ../../library/socket.rst:1986 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:1985 +#: ../../library/socket.rst:1992 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:1990 +#: ../../library/socket.rst:1997 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:1995 +#: ../../library/socket.rst:2002 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:2002 +#: ../../library/socket.rst:2009 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:2004 +#: ../../library/socket.rst:2011 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:2008 +#: ../../library/socket.rst:2015 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:2011 +#: ../../library/socket.rst:2018 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2228,14 +2235,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:2016 +#: ../../library/socket.rst:2023 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:2021 +#: ../../library/socket.rst:2028 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2244,11 +2251,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno()` of a socket." msgstr "" -#: ../../library/socket.rst:2028 +#: ../../library/socket.rst:2035 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:2030 +#: ../../library/socket.rst:2037 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2258,24 +2265,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:2038 +#: ../../library/socket.rst:2045 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:2040 +#: ../../library/socket.rst:2047 msgid "" "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" "meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " "depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:2044 +#: ../../library/socket.rst:2051 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:2047 +#: ../../library/socket.rst:2054 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2283,11 +2290,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:2056 +#: ../../library/socket.rst:2063 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:2058 +#: ../../library/socket.rst:2065 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " @@ -2300,14 +2307,14 @@ msgid "" "new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:2068 +#: ../../library/socket.rst:2075 msgid "The first two examples support IPv4 only. ::" msgstr "" "前兩個範例只支援 IPv4:\n" "\n" "::" -#: ../../library/socket.rst:2099 +#: ../../library/socket.rst:2106 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2317,73 +2324,73 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2171 +#: ../../library/socket.rst:2178 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:2196 +#: ../../library/socket.rst:2203 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:2202 +#: ../../library/socket.rst:2209 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:2206 +#: ../../library/socket.rst:2213 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2246 +#: ../../library/socket.rst:2253 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2251 +#: ../../library/socket.rst:2258 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2254 +#: ../../library/socket.rst:2261 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2261 +#: ../../library/socket.rst:2268 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2267 +#: ../../library/socket.rst:2274 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2269 +#: ../../library/socket.rst:2276 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2271 +#: ../../library/socket.rst:2278 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2274 +#: ../../library/socket.rst:2281 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " @@ -2402,18 +2409,18 @@ msgstr "object(物件)" msgid "socket" msgstr "socket" -#: ../../library/socket.rst:1576 +#: ../../library/socket.rst:1583 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/socket.rst:1576 +#: ../../library/socket.rst:1583 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:1931 +#: ../../library/socket.rst:1938 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:1931 +#: ../../library/socket.rst:1938 msgid "struct" msgstr "struct" diff --git a/library/sqlite3.po b/library/sqlite3.po index af64d9d6f7..43b1ec9efa 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-26 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,27 +44,27 @@ msgstr "" #: ../../library/sqlite3.rst:34 msgid "This document includes four main sections:" -msgstr "" +msgstr "此文件包含四個主要章節:" #: ../../library/sqlite3.rst:36 msgid ":ref:`sqlite3-tutorial` teaches how to use the :mod:`!sqlite3` module." -msgstr "" +msgstr ":ref:`sqlite3-tutorial` 教導如何使用 :mod:`!sqlite3` 模組。" #: ../../library/sqlite3.rst:37 msgid "" ":ref:`sqlite3-reference` describes the classes and functions this module " "defines." -msgstr "" +msgstr ":ref:`sqlite3-reference` 描述此模組定義的類別與函式。" #: ../../library/sqlite3.rst:39 msgid ":ref:`sqlite3-howtos` details how to handle specific tasks." -msgstr "" +msgstr ":ref:`sqlite3-howtos` 詳細說明如何處理特定工作。" #: ../../library/sqlite3.rst:40 msgid "" ":ref:`sqlite3-explanation` provides in-depth background on transaction " "control." -msgstr "" +msgstr ":ref:`sqlite3-explanation` 深入提供交易 (transaction) 控制的背景。" #: ../../library/sqlite3.rst:47 msgid "https://www.sqlite.org" @@ -87,7 +86,7 @@ msgstr "" #: ../../library/sqlite3.rst:52 msgid ":pep:`249` - Database API Specification 2.0" -msgstr "" +msgstr ":pep:`249` - 資料庫 API 規格 2.0" #: ../../library/sqlite3.rst:53 msgid "PEP written by Marc-André Lemburg." @@ -222,7 +221,7 @@ msgstr "" #: ../../library/sqlite3.rst:236 msgid ":ref:`sqlite3-howtos` for further reading:" -msgstr "" +msgstr "進一步參考 :ref:`sqlite3-howtos`:" #: ../../library/sqlite3.rst:238 msgid ":ref:`sqlite3-placeholders`" @@ -665,7 +664,7 @@ msgstr "" #: ../../library/sqlite3.rst:613 msgid "Connection objects" -msgstr "" +msgstr "Connection 物件" #: ../../library/sqlite3.rst:617 msgid "" @@ -813,8 +812,7 @@ msgstr "新增 *deterministic* 參數。" #: ../../library/sqlite3.rst:744 ../../library/sqlite3.rst:782 #: ../../library/sqlite3.rst:845 ../../library/sqlite3.rst:1115 -#: ../../library/sqlite3.rst:1415 ../../library/sqlite3.rst:1552 -#: ../../library/sqlite3.rst:1591 +#: ../../library/sqlite3.rst:1529 ../../library/sqlite3.rst:1568 msgid "Example:" msgstr "範例:" @@ -1116,27 +1114,31 @@ msgid "" "dump`` command in the :program:`sqlite3` shell." msgstr "" -#: ../../library/sqlite3.rst:1129 +#: ../../library/sqlite3.rst:1128 ../../library/sqlite3.rst:1198 +msgid ":ref:`sqlite3-howto-encoding`" +msgstr ":ref:`sqlite3-howto-encoding`" + +#: ../../library/sqlite3.rst:1133 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1131 +#: ../../library/sqlite3.rst:1135 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:1134 +#: ../../library/sqlite3.rst:1138 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:1137 +#: ../../library/sqlite3.rst:1141 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:1143 +#: ../../library/sqlite3.rst:1147 msgid "" "If set to a :term:`callable`, it is invoked with three integer arguments for " "every backup iteration: the *status* of the last iteration, the *remaining* " @@ -1144,46 +1146,46 @@ msgid "" "Defaults to ``None``." msgstr "" -#: ../../library/sqlite3.rst:1152 +#: ../../library/sqlite3.rst:1156 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1159 +#: ../../library/sqlite3.rst:1163 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:1163 +#: ../../library/sqlite3.rst:1167 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1182 +#: ../../library/sqlite3.rst:1186 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1194 +#: ../../library/sqlite3.rst:1202 msgid "Get a connection runtime limit." msgstr "" -#: ../../library/sqlite3.rst:1196 +#: ../../library/sqlite3.rst:1204 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: ../../library/sqlite3.rst:1201 ../../library/sqlite3.rst:1238 +#: ../../library/sqlite3.rst:1209 ../../library/sqlite3.rst:1246 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:1204 +#: ../../library/sqlite3.rst:1212 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: ../../library/sqlite3.rst:1224 +#: ../../library/sqlite3.rst:1232 msgid "" "Set a connection runtime limit. Attempts to increase a limit above its hard " "upper bound are silently truncated to the hard upper bound. Regardless of " @@ -1191,40 +1193,40 @@ msgid "" "returned." msgstr "" -#: ../../library/sqlite3.rst:1229 +#: ../../library/sqlite3.rst:1237 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: ../../library/sqlite3.rst:1232 +#: ../../library/sqlite3.rst:1240 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: ../../library/sqlite3.rst:1241 +#: ../../library/sqlite3.rst:1249 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: ../../library/sqlite3.rst:1258 +#: ../../library/sqlite3.rst:1266 msgid "Query a boolean connection configuration option." msgstr "" -#: ../../library/sqlite3.rst:1260 ../../library/sqlite3.rst:1271 +#: ../../library/sqlite3.rst:1268 ../../library/sqlite3.rst:1279 msgid "A :ref:`SQLITE_DBCONFIG code `." msgstr "" -#: ../../library/sqlite3.rst:1269 +#: ../../library/sqlite3.rst:1277 msgid "Set a boolean connection configuration option." msgstr "" -#: ../../library/sqlite3.rst:1274 +#: ../../library/sqlite3.rst:1282 msgid "" "``True`` if the configuration option should be enabled (default); ``False`` " "if it should be disabled." msgstr "" -#: ../../library/sqlite3.rst:1282 +#: ../../library/sqlite3.rst:1290 msgid "" "Serialize a database into a :class:`bytes` object. For an ordinary on-disk " "database file, the serialization is just a copy of the disk file. For an in-" @@ -1233,17 +1235,17 @@ msgid "" "backed up to disk." msgstr "" -#: ../../library/sqlite3.rst:1288 +#: ../../library/sqlite3.rst:1296 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1296 +#: ../../library/sqlite3.rst:1304 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: ../../library/sqlite3.rst:1304 +#: ../../library/sqlite3.rst:1312 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1251,96 +1253,96 @@ msgid "" "serialization contained in *data*." msgstr "" -#: ../../library/sqlite3.rst:1310 +#: ../../library/sqlite3.rst:1318 msgid "A serialized database." msgstr "" -#: ../../library/sqlite3.rst:1313 +#: ../../library/sqlite3.rst:1321 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1317 +#: ../../library/sqlite3.rst:1325 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: ../../library/sqlite3.rst:1321 +#: ../../library/sqlite3.rst:1329 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1324 +#: ../../library/sqlite3.rst:1332 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: ../../library/sqlite3.rst:1329 +#: ../../library/sqlite3.rst:1337 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: ../../library/sqlite3.rst:1336 +#: ../../library/sqlite3.rst:1344 msgid "" "This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!" "autocommit` has three allowed values:" msgstr "" -#: ../../library/sqlite3.rst:1339 +#: ../../library/sqlite3.rst:1347 msgid "" "``False``: Select :pep:`249`-compliant transaction behaviour, implying that :" "mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :" "meth:`rollback` to close transactions." msgstr "" -#: ../../library/sqlite3.rst:1343 +#: ../../library/sqlite3.rst:1351 msgid "This is the recommended value of :attr:`!autocommit`." msgstr "" -#: ../../library/sqlite3.rst:1345 +#: ../../library/sqlite3.rst:1353 msgid "" "``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:" "`rollback` have no effect in this mode." msgstr "" -#: ../../library/sqlite3.rst:1348 +#: ../../library/sqlite3.rst:1356 msgid "" ":data:`LEGACY_TRANSACTION_CONTROL`: Pre-Python 3.12 (non-:pep:`249`-" "compliant) transaction control. See :attr:`isolation_level` for more details." msgstr "" -#: ../../library/sqlite3.rst:1352 +#: ../../library/sqlite3.rst:1360 msgid "This is currently the default value of :attr:`!autocommit`." msgstr "" -#: ../../library/sqlite3.rst:1354 +#: ../../library/sqlite3.rst:1362 msgid "" "Changing :attr:`!autocommit` to ``False`` will open a new transaction, and " "changing it to ``True`` will commit any pending transaction." msgstr "" -#: ../../library/sqlite3.rst:1357 +#: ../../library/sqlite3.rst:1365 msgid "See :ref:`sqlite3-transaction-control-autocommit` for more details." -msgstr "" +msgstr "更多詳情請見 :ref:`sqlite3-transaction-control-autocommit`。" -#: ../../library/sqlite3.rst:1361 +#: ../../library/sqlite3.rst:1369 msgid "" "The :attr:`isolation_level` attribute has no effect unless :attr:" "`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." msgstr "" -#: ../../library/sqlite3.rst:1368 +#: ../../library/sqlite3.rst:1376 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:1371 +#: ../../library/sqlite3.rst:1379 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: ../../library/sqlite3.rst:1378 +#: ../../library/sqlite3.rst:1386 msgid "" "Controls the :ref:`legacy transaction handling mode ` of :mod:`!sqlite3`. If set to ``None``, " @@ -1350,13 +1352,13 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:1386 +#: ../../library/sqlite3.rst:1394 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:1391 +#: ../../library/sqlite3.rst:1399 msgid "" "Using :attr:`autocommit` to control transaction handling is recommended over " "using :attr:`!isolation_level`. :attr:`!isolation_level` has no effect " @@ -1364,7 +1366,7 @@ msgid "" "default)." msgstr "" -#: ../../library/sqlite3.rst:1398 +#: ../../library/sqlite3.rst:1406 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " "from this connection. Assigning to this attribute does not affect the :attr:" @@ -1373,30 +1375,33 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1405 ../../library/sqlite3.rst:1718 -#: ../../library/sqlite3.rst:1741 +#: ../../library/sqlite3.rst:1413 ../../library/sqlite3.rst:1694 +#: ../../library/sqlite3.rst:1717 msgid "See :ref:`sqlite3-howto-row-factory` for more details." -msgstr "" +msgstr "更多詳情請見 :ref:`sqlite3-howto-row-factory`。" -#: ../../library/sqlite3.rst:1409 +#: ../../library/sqlite3.rst:1417 msgid "" "A :term:`callable` that accepts a :class:`bytes` parameter and returns a " "text representation of it. The callable is invoked for SQLite values with " -"the ``TEXT`` data type. By default, this attribute is set to :class:`str`. " -"If you want to return ``bytes`` instead, set *text_factory* to ``bytes``." +"the ``TEXT`` data type. By default, this attribute is set to :class:`str`." msgstr "" -#: ../../library/sqlite3.rst:1449 +#: ../../library/sqlite3.rst:1422 +msgid "See :ref:`sqlite3-howto-encoding` for more details." +msgstr "更多詳情請見 :ref:`sqlite3-howto-encoding`。" + +#: ../../library/sqlite3.rst:1426 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:1456 +#: ../../library/sqlite3.rst:1433 msgid "Cursor objects" -msgstr "" +msgstr "Cursor 物件" -#: ../../library/sqlite3.rst:1458 +#: ../../library/sqlite3.rst:1435 msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " @@ -1404,39 +1409,39 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1465 +#: ../../library/sqlite3.rst:1442 msgid "" "Cursor objects are :term:`iterators `, meaning that if you :meth:" "`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " "to fetch the resulting rows:" msgstr "" -#: ../../library/sqlite3.rst:1490 +#: ../../library/sqlite3.rst:1467 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:1497 +#: ../../library/sqlite3.rst:1474 msgid "" "Execute SQL a single SQL statement, optionally binding Python values using :" "ref:`placeholders `." msgstr "" -#: ../../library/sqlite3.rst:1501 +#: ../../library/sqlite3.rst:1478 msgid "A single SQL statement." -msgstr "" +msgstr "單一個 SQL 陳述式。" -#: ../../library/sqlite3.rst:1504 +#: ../../library/sqlite3.rst:1481 msgid "" "Python values to bind to placeholders in *sql*. A :class:`!dict` if named " "placeholders are used. A :term:`!sequence` if unnamed placeholders are used. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1511 +#: ../../library/sqlite3.rst:1488 msgid "If *sql* contains more than one SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1514 +#: ../../library/sqlite3.rst:1491 msgid "" "If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, :" "attr:`~Connection.isolation_level` is not ``None``, *sql* is an ``INSERT``, " @@ -1444,7 +1449,7 @@ msgid "" "transaction, a transaction is implicitly opened before executing *sql*." msgstr "" -#: ../../library/sqlite3.rst:1523 +#: ../../library/sqlite3.rst:1500 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:" @@ -1452,43 +1457,43 @@ msgid "" "instead." msgstr "" -#: ../../library/sqlite3.rst:1529 +#: ../../library/sqlite3.rst:1506 msgid "Use :meth:`executescript` to execute multiple SQL statements." msgstr "" -#: ../../library/sqlite3.rst:1533 +#: ../../library/sqlite3.rst:1510 msgid "" "For every item in *parameters*, repeatedly execute the :ref:`parameterized " "` :abbr:`DML (Data Manipulation Language)` SQL " "statement *sql*." msgstr "" -#: ../../library/sqlite3.rst:1537 +#: ../../library/sqlite3.rst:1514 msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1539 +#: ../../library/sqlite3.rst:1516 msgid "A single SQL DML statement." msgstr "" -#: ../../library/sqlite3.rst:1542 +#: ../../library/sqlite3.rst:1519 msgid "" "An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1548 +#: ../../library/sqlite3.rst:1525 msgid "" "If *sql* contains more than one SQL statement, or is not a DML statement." msgstr "" -#: ../../library/sqlite3.rst:1565 +#: ../../library/sqlite3.rst:1542 msgid "" "Any resulting rows are discarded, including DML statements with `RETURNING " "clauses`_." msgstr "" -#: ../../library/sqlite3.rst:1572 +#: ../../library/sqlite3.rst:1549 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and the items in *parameters* are sequences instead " @@ -1496,7 +1501,7 @@ msgid "" "be raised instead." msgstr "" -#: ../../library/sqlite3.rst:1581 +#: ../../library/sqlite3.rst:1558 msgid "" "Execute the SQL statements in *sql_script*. If the :attr:`~Connection." "autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending " @@ -1505,24 +1510,24 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1589 +#: ../../library/sqlite3.rst:1566 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1607 +#: ../../library/sqlite3.rst:1583 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1615 +#: ../../library/sqlite3.rst:1591 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1618 +#: ../../library/sqlite3.rst:1594 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1530,7 +1535,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1624 +#: ../../library/sqlite3.rst:1600 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1538,36 +1543,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1631 +#: ../../library/sqlite3.rst:1607 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1638 +#: ../../library/sqlite3.rst:1614 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1640 +#: ../../library/sqlite3.rst:1616 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:1645 ../../library/sqlite3.rst:1649 +#: ../../library/sqlite3.rst:1621 ../../library/sqlite3.rst:1625 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1653 +#: ../../library/sqlite3.rst:1629 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:1658 +#: ../../library/sqlite3.rst:1634 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1575,18 +1580,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1672 +#: ../../library/sqlite3.rst:1648 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1676 +#: ../../library/sqlite3.rst:1652 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1680 +#: ../../library/sqlite3.rst:1656 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1596,15 +1601,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1688 +#: ../../library/sqlite3.rst:1664 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1690 +#: ../../library/sqlite3.rst:1666 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1695 +#: ../../library/sqlite3.rst:1671 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1614,7 +1619,7 @@ msgid "" "resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: ../../library/sqlite3.rst:1706 +#: ../../library/sqlite3.rst:1682 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1623,18 +1628,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1713 +#: ../../library/sqlite3.rst:1689 msgid "" "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" "Cursor` was created. Assigning to this attribute does not affect :attr:" "`Connection.row_factory` of the parent connection." msgstr "" -#: ../../library/sqlite3.rst:1729 +#: ../../library/sqlite3.rst:1705 msgid "Row objects" -msgstr "" +msgstr "Row 物件" -#: ../../library/sqlite3.rst:1733 +#: ../../library/sqlite3.rst:1709 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1642,28 +1647,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1738 +#: ../../library/sqlite3.rst:1714 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1745 +#: ../../library/sqlite3.rst:1721 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:1749 +#: ../../library/sqlite3.rst:1725 msgid "Added support of slicing." msgstr "新增對切片的支援。" -#: ../../library/sqlite3.rst:1756 +#: ../../library/sqlite3.rst:1732 msgid "Blob objects" -msgstr "" +msgstr "Blob 物件" -#: ../../library/sqlite3.rst:1762 +#: ../../library/sqlite3.rst:1738 msgid "" "A :class:`Blob` instance is a :term:`file-like object` that can read and " "write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:" @@ -1671,24 +1676,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1767 +#: ../../library/sqlite3.rst:1743 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1797 +#: ../../library/sqlite3.rst:1773 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1799 +#: ../../library/sqlite3.rst:1775 msgid "" "The blob will be unusable from this point onward. An :class:`~sqlite3." "Error` (or subclass) exception will be raised if any further operation is " "attempted with the blob." msgstr "" -#: ../../library/sqlite3.rst:1805 +#: ../../library/sqlite3.rst:1781 msgid "" "Read *length* bytes of data from the blob at the current offset position. If " "the end of the blob is reached, the data up to :abbr:`EOF (End of File)` " @@ -1696,18 +1701,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1813 +#: ../../library/sqlite3.rst:1789 msgid "" "Write *data* to the blob at the current offset. This function cannot change " "the blob length. Writing beyond the end of the blob will raise :exc:" "`ValueError`." msgstr "" -#: ../../library/sqlite3.rst:1819 +#: ../../library/sqlite3.rst:1795 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1823 +#: ../../library/sqlite3.rst:1799 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :const:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1715,26 +1720,26 @@ msgid "" "position) and :const:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1831 +#: ../../library/sqlite3.rst:1807 msgid "PrepareProtocol objects" -msgstr "" +msgstr "PrepareProtocol 物件" -#: ../../library/sqlite3.rst:1835 +#: ../../library/sqlite3.rst:1811 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1843 +#: ../../library/sqlite3.rst:1819 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1845 +#: ../../library/sqlite3.rst:1821 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1849 +#: ../../library/sqlite3.rst:1825 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1742,39 +1747,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1856 +#: ../../library/sqlite3.rst:1832 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1860 +#: ../../library/sqlite3.rst:1836 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1865 +#: ../../library/sqlite3.rst:1841 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1872 +#: ../../library/sqlite3.rst:1848 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1879 +#: ../../library/sqlite3.rst:1855 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1886 +#: ../../library/sqlite3.rst:1862 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1782,14 +1787,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1893 +#: ../../library/sqlite3.rst:1869 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1899 +#: ../../library/sqlite3.rst:1875 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1797,20 +1802,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1907 +#: ../../library/sqlite3.rst:1883 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1912 +#: ../../library/sqlite3.rst:1888 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1919 +#: ../../library/sqlite3.rst:1895 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "supplying the wrong number of bindings to a query, or trying to operate on a " @@ -1818,7 +1823,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1926 +#: ../../library/sqlite3.rst:1902 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1827,78 +1832,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1936 +#: ../../library/sqlite3.rst:1912 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1938 +#: ../../library/sqlite3.rst:1914 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1941 +#: ../../library/sqlite3.rst:1917 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 +#: ../../library/sqlite3.rst:1920 ../../library/sqlite3.rst:1937 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 +#: ../../library/sqlite3.rst:1920 ../../library/sqlite3.rst:1937 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1922 ../../library/sqlite3.rst:1939 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1922 ../../library/sqlite3.rst:1939 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1965 +#: ../../library/sqlite3.rst:1924 ../../library/sqlite3.rst:1941 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1965 +#: ../../library/sqlite3.rst:1924 ../../library/sqlite3.rst:1941 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1967 +#: ../../library/sqlite3.rst:1926 ../../library/sqlite3.rst:1943 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1967 +#: ../../library/sqlite3.rst:1926 ../../library/sqlite3.rst:1943 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1952 +#: ../../library/sqlite3.rst:1928 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1952 ../../library/sqlite3.rst:1969 +#: ../../library/sqlite3.rst:1928 ../../library/sqlite3.rst:1945 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1954 ../../library/sqlite3.rst:1972 +#: ../../library/sqlite3.rst:1930 ../../library/sqlite3.rst:1948 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1954 ../../library/sqlite3.rst:1972 +#: ../../library/sqlite3.rst:1930 ../../library/sqlite3.rst:1948 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1958 +#: ../../library/sqlite3.rst:1934 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1969 +#: ../../library/sqlite3.rst:1945 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1975 +#: ../../library/sqlite3.rst:1951 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1907,47 +1912,47 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1985 +#: ../../library/sqlite3.rst:1961 msgid "Default adapters and converters (deprecated)" msgstr "" -#: ../../library/sqlite3.rst:1989 +#: ../../library/sqlite3.rst:1965 msgid "" "The default adapters and converters are deprecated as of Python 3.12. " "Instead, use the :ref:`sqlite3-adapter-converter-recipes` and tailor them to " "your needs." msgstr "" -#: ../../library/sqlite3.rst:1993 +#: ../../library/sqlite3.rst:1969 msgid "The deprecated default adapters and converters consist of:" msgstr "" -#: ../../library/sqlite3.rst:1995 +#: ../../library/sqlite3.rst:1971 msgid "" "An adapter for :class:`datetime.date` objects to :class:`strings ` in " "`ISO 8601`_ format." msgstr "" -#: ../../library/sqlite3.rst:1997 +#: ../../library/sqlite3.rst:1973 msgid "" "An adapter for :class:`datetime.datetime` objects to strings in ISO 8601 " "format." msgstr "" -#: ../../library/sqlite3.rst:1999 +#: ../../library/sqlite3.rst:1975 msgid "" "A converter for :ref:`declared ` \"date\" types to :" "class:`datetime.date` objects." msgstr "" -#: ../../library/sqlite3.rst:2001 +#: ../../library/sqlite3.rst:1977 msgid "" "A converter for declared \"timestamp\" types to :class:`datetime.datetime` " "objects. Fractional parts will be truncated to 6 digits (microsecond " "precision)." msgstr "" -#: ../../library/sqlite3.rst:2007 +#: ../../library/sqlite3.rst:1983 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1955,38 +1960,38 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:2020 +#: ../../library/sqlite3.rst:1996 msgid "Command-line interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/sqlite3.rst:2022 +#: ../../library/sqlite3.rst:1998 msgid "" "The :mod:`!sqlite3` module can be invoked as a script, using the " "interpreter's :option:`-m` switch, in order to provide a simple SQLite " "shell. The argument signature is as follows::" msgstr "" -#: ../../library/sqlite3.rst:2029 +#: ../../library/sqlite3.rst:2005 msgid "Type ``.quit`` or CTRL-D to exit the shell." msgstr "" -#: ../../library/sqlite3.rst:2035 +#: ../../library/sqlite3.rst:2011 msgid "Print CLI help." msgstr "" -#: ../../library/sqlite3.rst:2039 +#: ../../library/sqlite3.rst:2015 msgid "Print underlying SQLite library version." msgstr "" -#: ../../library/sqlite3.rst:2047 +#: ../../library/sqlite3.rst:2023 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:2052 +#: ../../library/sqlite3.rst:2028 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:2054 +#: ../../library/sqlite3.rst:2030 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1994,7 +1999,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:2067 +#: ../../library/sqlite3.rst:2043 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -2002,7 +2007,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:2072 +#: ../../library/sqlite3.rst:2048 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -2013,24 +2018,24 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:2109 +#: ../../library/sqlite3.rst:2085 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:2116 +#: ../../library/sqlite3.rst:2092 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:2118 +#: ../../library/sqlite3.rst:2094 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:2122 +#: ../../library/sqlite3.rst:2098 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -2040,11 +2045,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:2134 +#: ../../library/sqlite3.rst:2110 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:2136 +#: ../../library/sqlite3.rst:2112 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -2054,84 +2059,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:2167 +#: ../../library/sqlite3.rst:2143 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:2169 +#: ../../library/sqlite3.rst:2145 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:2199 +#: ../../library/sqlite3.rst:2175 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:2201 +#: ../../library/sqlite3.rst:2177 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:2206 +#: ../../library/sqlite3.rst:2182 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:2209 +#: ../../library/sqlite3.rst:2185 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:2214 +#: ../../library/sqlite3.rst:2190 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2223 +#: ../../library/sqlite3.rst:2199 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:2227 +#: ../../library/sqlite3.rst:2203 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2228 +#: ../../library/sqlite3.rst:2204 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2229 +#: ../../library/sqlite3.rst:2205 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2233 +#: ../../library/sqlite3.rst:2209 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2284 +#: ../../library/sqlite3.rst:2260 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2286 +#: ../../library/sqlite3.rst:2262 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2348 +#: ../../library/sqlite3.rst:2324 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2350 +#: ../../library/sqlite3.rst:2326 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -2143,11 +2148,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2391 +#: ../../library/sqlite3.rst:2367 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2393 +#: ../../library/sqlite3.rst:2369 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -2159,60 +2164,60 @@ msgid "" "rolling back." msgstr "" -#: ../../library/sqlite3.rst:2404 +#: ../../library/sqlite3.rst:2380 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, or if :attr:`~Connection.autocommit` is ``True``, the context " "manager does nothing." msgstr "" -#: ../../library/sqlite3.rst:2409 +#: ../../library/sqlite3.rst:2385 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection. If you need a closing context manager, consider using :meth:" "`contextlib.closing`." msgstr "" -#: ../../library/sqlite3.rst:2443 +#: ../../library/sqlite3.rst:2419 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2445 +#: ../../library/sqlite3.rst:2421 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2447 +#: ../../library/sqlite3.rst:2423 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2456 +#: ../../library/sqlite3.rst:2432 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2466 +#: ../../library/sqlite3.rst:2442 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2480 +#: ../../library/sqlite3.rst:2456 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2489 +#: ../../library/sqlite3.rst:2465 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2491 +#: ../../library/sqlite3.rst:2467 msgid "" "By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" "class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." "Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" -#: ../../library/sqlite3.rst:2496 +#: ../../library/sqlite3.rst:2472 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -2220,7 +2225,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2501 +#: ../../library/sqlite3.rst:2477 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -2228,11 +2233,11 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2511 +#: ../../library/sqlite3.rst:2487 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2528 +#: ../../library/sqlite3.rst:2504 msgid "" "The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the " "above example. In such cases, SQLite returns a single row with columns " @@ -2240,41 +2245,80 @@ msgid "" "alias``." msgstr "" -#: ../../library/sqlite3.rst:2533 +#: ../../library/sqlite3.rst:2509 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2542 +#: ../../library/sqlite3.rst:2518 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2552 +#: ../../library/sqlite3.rst:2528 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2563 +#: ../../library/sqlite3.rst:2539 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2578 +#: ../../library/sqlite3.rst:2554 msgid "" "With some adjustments, the above recipe can be adapted to use a :class:" "`~dataclasses.dataclass`, or any other custom class, instead of a :class:" "`~collections.namedtuple`." msgstr "" -#: ../../library/sqlite3.rst:2586 +#: ../../library/sqlite3.rst:2562 +msgid "How to handle non-UTF-8 text encodings" +msgstr "" + +#: ../../library/sqlite3.rst:2564 +msgid "" +"By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with " +"the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might " +"fail for other encodings and invalid UTF-8. You can use a custom :attr:" +"`~Connection.text_factory` to handle such cases." +msgstr "" + +#: ../../library/sqlite3.rst:2570 +msgid "" +"Because of SQLite's `flexible typing`_, it is not uncommon to encounter " +"table columns with the ``TEXT`` data type containing non-UTF-8 encodings, or " +"even arbitrary data. To demonstrate, let's assume we have a database with " +"ISO-8859-2 (Latin-2) encoded text, for example a table of Czech-English " +"dictionary entries. Assuming we now have a :class:`Connection` instance :py:" +"data:`!con` connected to this database, we can decode the Latin-2 encoded " +"text using this :attr:`~Connection.text_factory`:" +msgstr "" + +#: ../../library/sqlite3.rst:2583 +msgid "" +"For invalid UTF-8 or arbitrary data in stored in ``TEXT`` table columns, you " +"can use the following technique, borrowed from the :ref:`unicode-howto`:" +msgstr "" + +#: ../../library/sqlite3.rst:2592 +msgid "" +"The :mod:`!sqlite3` module API does not support strings containing " +"surrogates." +msgstr "" + +#: ../../library/sqlite3.rst:2597 +msgid ":ref:`unicode-howto`" +msgstr "" + +#: ../../library/sqlite3.rst:2603 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2592 +#: ../../library/sqlite3.rst:2609 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2594 +#: ../../library/sqlite3.rst:2611 msgid "" ":mod:`!sqlite3` offers multiple methods of controlling whether, when and how " "database transactions are opened and closed. :ref:`sqlite3-transaction-" @@ -2282,24 +2326,24 @@ msgid "" "isolation-level` retains the pre-Python 3.12 behaviour." msgstr "" -#: ../../library/sqlite3.rst:2603 +#: ../../library/sqlite3.rst:2620 msgid "Transaction control via the ``autocommit`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2605 +#: ../../library/sqlite3.rst:2622 msgid "" "The recommended way of controlling transaction behaviour is through the :" "attr:`Connection.autocommit` attribute, which should preferably be set using " "the *autocommit* parameter of :func:`connect`." msgstr "" -#: ../../library/sqlite3.rst:2610 +#: ../../library/sqlite3.rst:2627 msgid "" "It is suggested to set *autocommit* to ``False``, which implies :pep:`249`-" "compliant transaction control. This means:" msgstr "" -#: ../../library/sqlite3.rst:2614 +#: ../../library/sqlite3.rst:2631 msgid "" ":mod:`!sqlite3` ensures that a transaction is always open, so :func:" "`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " @@ -2308,21 +2352,21 @@ msgid "" "when opening transactions." msgstr "" -#: ../../library/sqlite3.rst:2619 +#: ../../library/sqlite3.rst:2636 msgid "Transactions should be committed explicitly using :meth:`!commit`." msgstr "" -#: ../../library/sqlite3.rst:2620 +#: ../../library/sqlite3.rst:2637 msgid "Transactions should be rolled back explicitly using :meth:`!rollback`." msgstr "" -#: ../../library/sqlite3.rst:2621 +#: ../../library/sqlite3.rst:2638 msgid "" "An implicit rollback is performed if the database is :meth:`~Connection." "close`-ed with pending changes." msgstr "" -#: ../../library/sqlite3.rst:2624 +#: ../../library/sqlite3.rst:2641 msgid "" "Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " "mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no " @@ -2331,25 +2375,25 @@ msgid "" "in_transaction` to query the low-level SQLite autocommit mode." msgstr "" -#: ../../library/sqlite3.rst:2632 +#: ../../library/sqlite3.rst:2649 msgid "" "Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " "control behaviour to the :attr:`Connection.isolation_level` attribute. See :" "ref:`sqlite3-transaction-control-isolation-level` for more information." msgstr "" -#: ../../library/sqlite3.rst:2641 +#: ../../library/sqlite3.rst:2658 msgid "Transaction control via the ``isolation_level`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2645 +#: ../../library/sqlite3.rst:2662 msgid "" "The recommended way of controlling transactions is via the :attr:" "`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-" "autocommit`." msgstr "" -#: ../../library/sqlite3.rst:2649 +#: ../../library/sqlite3.rst:2666 msgid "" "If :attr:`Connection.autocommit` is set to :data:" "`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is " @@ -2357,7 +2401,7 @@ msgid "" "Otherwise, :attr:`!isolation_level` has no effect." msgstr "" -#: ../../library/sqlite3.rst:2655 +#: ../../library/sqlite3.rst:2672 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2371,7 +2415,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2668 +#: ../../library/sqlite3.rst:2685 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2381,33 +2425,33 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2676 +#: ../../library/sqlite3.rst:2693 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2680 +#: ../../library/sqlite3.rst:2697 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:2684 +#: ../../library/sqlite3.rst:2701 msgid "" "The recommended way of controlling transactions is now via the :attr:" "`~Connection.autocommit` attribute." msgstr "" -#: ../../library/sqlite3.rst:1492 +#: ../../library/sqlite3.rst:1469 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/sqlite3.rst:1492 ../../library/sqlite3.rst:1493 +#: ../../library/sqlite3.rst:1469 ../../library/sqlite3.rst:1470 msgid "in SQL statements" msgstr "於 SQL 陳述式中" -#: ../../library/sqlite3.rst:1493 +#: ../../library/sqlite3.rst:1470 msgid ": (colon)" msgstr ": (冒號)" diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index 00d44ff013..1e665b2e7e 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-26 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,84 +21,88 @@ msgstr "" msgid ":mod:`sys.monitoring` --- Execution event monitoring" msgstr "" -#: ../../library/sys.monitoring.rst:11 +#: ../../library/sys.monitoring.rst:13 msgid "" -"``sys.monitoring`` is a namespace within the ``sys`` module, not an " +":mod:`sys.monitoring` is a namespace within the :mod:`sys` module, not an " "independent module, so there is no need to ``import sys.monitoring``, simply " "``import sys`` and then use ``sys.monitoring``." msgstr "" -#: ../../library/sys.monitoring.rst:17 +#: ../../library/sys.monitoring.rst:19 msgid "" "This namespace provides access to the functions and constants necessary to " "activate and control event monitoring." msgstr "" -#: ../../library/sys.monitoring.rst:20 +#: ../../library/sys.monitoring.rst:22 msgid "" "As programs execute, events occur that might be of interest to tools that " -"monitor execution. The :mod:`!sys.monitoring` namespace provides means to " +"monitor execution. The :mod:`sys.monitoring` namespace provides means to " "receive callbacks when events of interest occur." msgstr "" -#: ../../library/sys.monitoring.rst:24 +#: ../../library/sys.monitoring.rst:26 msgid "The monitoring API consists of three components:" msgstr "" -#: ../../library/sys.monitoring.rst:26 ../../library/sys.monitoring.rst:31 -msgid "Tool identifiers" +#: ../../library/sys.monitoring.rst:28 +msgid "`Tool identifiers`_" msgstr "" -#: ../../library/sys.monitoring.rst:27 ../../library/sys.monitoring.rst:74 -msgid "Events" +#: ../../library/sys.monitoring.rst:29 +msgid "`Events`_" msgstr "" -#: ../../library/sys.monitoring.rst:28 -msgid "Callbacks" +#: ../../library/sys.monitoring.rst:30 +msgid ":ref:`Callbacks `" msgstr "" #: ../../library/sys.monitoring.rst:33 +msgid "Tool identifiers" +msgstr "" + +#: ../../library/sys.monitoring.rst:35 msgid "" -"A tool identifier is an integer and associated name. Tool identifiers are " -"used to discourage tools from interfering with each other and to allow " +"A tool identifier is an integer and the associated name. Tool identifiers " +"are used to discourage tools from interfering with each other and to allow " "multiple tools to operate at the same time. Currently tools are completely " "independent and cannot be used to monitor each other. This restriction may " "be lifted in the future." msgstr "" -#: ../../library/sys.monitoring.rst:39 +#: ../../library/sys.monitoring.rst:41 msgid "" "Before registering or activating events, a tool should choose an identifier. " -"Identifiers are integers in the range 0 to 5." +"Identifiers are integers in the range 0 to 5 inclusive." msgstr "" -#: ../../library/sys.monitoring.rst:43 +#: ../../library/sys.monitoring.rst:45 msgid "Registering and using tools" msgstr "" -#: ../../library/sys.monitoring.rst:47 +#: ../../library/sys.monitoring.rst:49 msgid "" -"Must be called before ``id`` can be used. ``id`` must be in the range 0 to 5 " -"inclusive. Raises a ``ValueError`` if ``id`` is in use." +"Must be called before *tool_id* can be used. *tool_id* must be in the range " +"0 to 5 inclusive. Raises a :exc:`ValueError` if *tool_id* is in use." msgstr "" -#: ../../library/sys.monitoring.rst:53 -msgid "Should be called once a tool no longer requires ``id``." +#: ../../library/sys.monitoring.rst:55 +msgid "Should be called once a tool no longer requires *tool_id*." msgstr "" -#: ../../library/sys.monitoring.rst:57 +#: ../../library/sys.monitoring.rst:59 msgid "" -"Returns the name of the tool if ``id`` is in use, otherwise it returns " -"``None``. ``id`` must be in the range 0 to 5 inclusive." +"Returns the name of the tool if *tool_id* is in use, otherwise it returns " +"``None``. *tool_id* must be in the range 0 to 5 inclusive." msgstr "" -#: ../../library/sys.monitoring.rst:61 +#: ../../library/sys.monitoring.rst:63 msgid "" "All IDs are treated the same by the VM with regard to events, but the " "following IDs are pre-defined to make co-operation of tools easier::" msgstr "" -#: ../../library/sys.monitoring.rst:69 +#: ../../library/sys.monitoring.rst:71 msgid "" "There is no obligation to set an ID, nor is there anything preventing a tool " "from using an ID even it is already in use. However, tools are encouraged to " @@ -106,312 +110,327 @@ msgid "" msgstr "" #: ../../library/sys.monitoring.rst:76 -msgid "The following events are supported:" +msgid "Events" msgstr "" -#: ../../library/sys.monitoring.rst:78 ../../library/sys.monitoring.rst:138 -msgid "BRANCH" +#: ../../library/sys.monitoring.rst:78 +msgid "The following events are supported:" msgstr "" -#: ../../library/sys.monitoring.rst:79 +#: ../../library/sys.monitoring.rst:82 msgid "A conditional branch is taken (or not)." msgstr "" -#: ../../library/sys.monitoring.rst:80 ../../library/sys.monitoring.rst:134 -msgid "CALL" -msgstr "" - -#: ../../library/sys.monitoring.rst:81 +#: ../../library/sys.monitoring.rst:86 msgid "A call in Python code (event occurs before the call)." msgstr "" -#: ../../library/sys.monitoring.rst:82 ../../library/sys.monitoring.rst:147 -msgid "C_RAISE" -msgstr "" - -#: ../../library/sys.monitoring.rst:83 +#: ../../library/sys.monitoring.rst:90 msgid "" -"Exception raised from any callable, except Python functions (event occurs " -"after the exit)." -msgstr "" - -#: ../../library/sys.monitoring.rst:84 ../../library/sys.monitoring.rst:148 -msgid "C_RETURN" +"An exception raised from any callable, except for Python functions (event " +"occurs after the exit)." msgstr "" -#: ../../library/sys.monitoring.rst:85 +#: ../../library/sys.monitoring.rst:94 msgid "" -"Return from any callable, except Python functions (event occurs after the " -"return)." -msgstr "" - -#: ../../library/sys.monitoring.rst:86 ../../library/sys.monitoring.rst:165 -msgid "EXCEPTION_HANDLED" +"Return from any callable, except for Python functions (event occurs after " +"the return)." msgstr "" -#: ../../library/sys.monitoring.rst:87 +#: ../../library/sys.monitoring.rst:98 msgid "An exception is handled." msgstr "" -#: ../../library/sys.monitoring.rst:88 ../../library/sys.monitoring.rst:136 -msgid "INSTRUCTION" -msgstr "" - -#: ../../library/sys.monitoring.rst:89 +#: ../../library/sys.monitoring.rst:102 msgid "A VM instruction is about to be executed." msgstr "" -#: ../../library/sys.monitoring.rst:90 ../../library/sys.monitoring.rst:137 -msgid "JUMP" -msgstr "" - -#: ../../library/sys.monitoring.rst:91 +#: ../../library/sys.monitoring.rst:106 msgid "An unconditional jump in the control flow graph is made." msgstr "" -#: ../../library/sys.monitoring.rst:92 ../../library/sys.monitoring.rst:135 -msgid "LINE" -msgstr "" - -#: ../../library/sys.monitoring.rst:93 +#: ../../library/sys.monitoring.rst:110 msgid "" "An instruction is about to be executed that has a different line number from " "the preceding instruction." msgstr "" -#: ../../library/sys.monitoring.rst:94 ../../library/sys.monitoring.rst:131 -msgid "PY_RESUME" -msgstr "" - -#: ../../library/sys.monitoring.rst:95 +#: ../../library/sys.monitoring.rst:114 msgid "" "Resumption of a Python function (for generator and coroutine functions), " -"except for throw() calls." +"except for ``throw()`` calls." msgstr "" -#: ../../library/sys.monitoring.rst:96 ../../library/sys.monitoring.rst:132 -msgid "PY_RETURN" -msgstr "" - -#: ../../library/sys.monitoring.rst:97 +#: ../../library/sys.monitoring.rst:118 msgid "" "Return from a Python function (occurs immediately before the return, the " "callee's frame will be on the stack)." msgstr "" -#: ../../library/sys.monitoring.rst:98 ../../library/sys.monitoring.rst:130 -msgid "PY_START" -msgstr "" - -#: ../../library/sys.monitoring.rst:99 +#: ../../library/sys.monitoring.rst:122 msgid "" "Start of a Python function (occurs immediately after the call, the callee's " "frame will be on the stack)" msgstr "" -#: ../../library/sys.monitoring.rst:100 ../../library/sys.monitoring.rst:162 -msgid "PY_THROW" -msgstr "" - -#: ../../library/sys.monitoring.rst:101 -msgid "A Python function is resumed by a throw() call." -msgstr "" - -#: ../../library/sys.monitoring.rst:102 ../../library/sys.monitoring.rst:163 -msgid "PY_UNWIND" +#: ../../library/sys.monitoring.rst:126 +msgid "A Python function is resumed by a ``throw()`` call." msgstr "" -#: ../../library/sys.monitoring.rst:103 +#: ../../library/sys.monitoring.rst:130 msgid "Exit from a Python function during exception unwinding." msgstr "" -#: ../../library/sys.monitoring.rst:104 ../../library/sys.monitoring.rst:133 -msgid "PY_YIELD" -msgstr "" - -#: ../../library/sys.monitoring.rst:105 +#: ../../library/sys.monitoring.rst:134 msgid "" "Yield from a Python function (occurs immediately before the yield, the " "callee's frame will be on the stack)." msgstr "" -#: ../../library/sys.monitoring.rst:106 ../../library/sys.monitoring.rst:164 -msgid "RAISE" -msgstr "" - -#: ../../library/sys.monitoring.rst:107 +#: ../../library/sys.monitoring.rst:138 msgid "" -"An exception is raised, except those that cause a ``STOP_ITERATION`` event." +"An exception is raised, except those that cause a :monitoring-event:" +"`STOP_ITERATION` event." msgstr "" -#: ../../library/sys.monitoring.rst:108 -msgid "RERAISE" -msgstr "" - -#: ../../library/sys.monitoring.rst:109 +#: ../../library/sys.monitoring.rst:142 msgid "" -"An exception is re-raised, for example at the end of a ``finally`` block." +"An exception is re-raised, for example at the end of a :keyword:`finally` " +"block." msgstr "" -#: ../../library/sys.monitoring.rst:111 ../../library/sys.monitoring.rst:139 -msgid "STOP_ITERATION" -msgstr "" - -#: ../../library/sys.monitoring.rst:111 +#: ../../library/sys.monitoring.rst:146 msgid "" -"An artificial ``StopIteration`` is raised; see `the STOP_ITERATION event`_." +"An artificial :exc:`StopIteration` is raised; see `the STOP_ITERATION " +"event`_." msgstr "" -#: ../../library/sys.monitoring.rst:113 +#: ../../library/sys.monitoring.rst:149 msgid "More events may be added in the future." msgstr "" -#: ../../library/sys.monitoring.rst:115 +#: ../../library/sys.monitoring.rst:151 msgid "" "These events are attributes of the :mod:`!sys.monitoring.events` namespace. " "Each event is represented as a power-of-2 integer constant. To define a set " "of events, simply bitwise or the individual events together. For example, to " -"specify both ``PY_RETURN`` and ``PY_START`` events, use the expression " -"``PY_RETURN | PY_START``." +"specify both :monitoring-event:`PY_RETURN` and :monitoring-event:`PY_START` " +"events, use the expression ``PY_RETURN | PY_START``." +msgstr "" + +#: ../../library/sys.monitoring.rst:159 +msgid "An alias for ``0`` so users can do explict comparisions like::" msgstr "" -#: ../../library/sys.monitoring.rst:121 +#: ../../library/sys.monitoring.rst:164 msgid "Events are divided into three groups:" msgstr "" -#: ../../library/sys.monitoring.rst:124 +#: ../../library/sys.monitoring.rst:167 msgid "Local events" msgstr "" -#: ../../library/sys.monitoring.rst:126 +#: ../../library/sys.monitoring.rst:169 msgid "" "Local events are associated with normal execution of the program and happen " "at clearly defined locations. All local events can be disabled. The local " "events are:" msgstr "" -#: ../../library/sys.monitoring.rst:142 +#: ../../library/sys.monitoring.rst:173 +msgid ":monitoring-event:`PY_START`" +msgstr "" + +#: ../../library/sys.monitoring.rst:174 +msgid ":monitoring-event:`PY_RESUME`" +msgstr "" + +#: ../../library/sys.monitoring.rst:175 +msgid ":monitoring-event:`PY_RETURN`" +msgstr "" + +#: ../../library/sys.monitoring.rst:176 +msgid ":monitoring-event:`PY_YIELD`" +msgstr "" + +#: ../../library/sys.monitoring.rst:177 +msgid ":monitoring-event:`CALL`" +msgstr "" + +#: ../../library/sys.monitoring.rst:178 +msgid ":monitoring-event:`LINE`" +msgstr "" + +#: ../../library/sys.monitoring.rst:179 +msgid ":monitoring-event:`INSTRUCTION`" +msgstr "" + +#: ../../library/sys.monitoring.rst:180 +msgid ":monitoring-event:`JUMP`" +msgstr "" + +#: ../../library/sys.monitoring.rst:181 +msgid ":monitoring-event:`BRANCH`" +msgstr "" + +#: ../../library/sys.monitoring.rst:182 +msgid ":monitoring-event:`STOP_ITERATION`" +msgstr "" + +#: ../../library/sys.monitoring.rst:185 msgid "Ancillary events" msgstr "" -#: ../../library/sys.monitoring.rst:144 +#: ../../library/sys.monitoring.rst:187 msgid "" "Ancillary events can be monitored like other events, but are controlled by " "another event:" msgstr "" -#: ../../library/sys.monitoring.rst:150 +#: ../../library/sys.monitoring.rst:190 +msgid ":monitoring-event:`C_RAISE`" +msgstr "" + +#: ../../library/sys.monitoring.rst:191 +msgid ":monitoring-event:`C_RETURN`" +msgstr "" + +#: ../../library/sys.monitoring.rst:193 msgid "" -"The ``C_RETURN`` and ``C_RAISE`` events are controlled by the ``CALL`` " -"event. ``C_RETURN`` and ``C_RAISE`` events will only be seen if the " -"corresponding ``CALL`` event is being monitored." +"The :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events are " +"controlled by the :monitoring-event:`CALL` event. :monitoring-event:" +"`C_RETURN` and :monitoring-event:`C_RAISE` events will only be seen if the " +"corresponding :monitoring-event:`CALL` event is being monitored." msgstr "" -#: ../../library/sys.monitoring.rst:155 +#: ../../library/sys.monitoring.rst:199 msgid "Other events" msgstr "" -#: ../../library/sys.monitoring.rst:157 +#: ../../library/sys.monitoring.rst:201 msgid "" "Other events are not necessarily tied to a specific location in the program " "and cannot be individually disabled." msgstr "" -#: ../../library/sys.monitoring.rst:160 +#: ../../library/sys.monitoring.rst:204 msgid "The other events that can be monitored are:" msgstr "" -#: ../../library/sys.monitoring.rst:169 +#: ../../library/sys.monitoring.rst:206 +msgid ":monitoring-event:`PY_THROW`" +msgstr "" + +#: ../../library/sys.monitoring.rst:207 +msgid ":monitoring-event:`PY_UNWIND`" +msgstr "" + +#: ../../library/sys.monitoring.rst:208 +msgid ":monitoring-event:`RAISE`" +msgstr "" + +#: ../../library/sys.monitoring.rst:209 +msgid ":monitoring-event:`EXCEPTION_HANDLED`" +msgstr "" + +#: ../../library/sys.monitoring.rst:213 msgid "The STOP_ITERATION event" msgstr "" -#: ../../library/sys.monitoring.rst:171 +#: ../../library/sys.monitoring.rst:215 msgid "" -":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a " -"``StopIteration`` exception is raised when returning a value from a " +":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a :" +"exc:`StopIteration` exception is raised when returning a value from a " "generator or coroutine. However, this is a very inefficient way to return a " "value, so some Python implementations, notably CPython 3.12+, do not raise " "an exception unless it would be visible to other code." msgstr "" -#: ../../library/sys.monitoring.rst:177 +#: ../../library/sys.monitoring.rst:221 msgid "" "To allow tools to monitor for real exceptions without slowing down " -"generators and coroutines, the ``STOP_ITERATION`` event is provided. " -"``STOP_ITERATION`` can be locally disabled, unlike ``RAISE``." +"generators and coroutines, the :monitoring-event:`STOP_ITERATION` event is " +"provided. :monitoring-event:`STOP_ITERATION` can be locally disabled, " +"unlike :monitoring-event:`RAISE`." msgstr "" -#: ../../library/sys.monitoring.rst:183 +#: ../../library/sys.monitoring.rst:227 msgid "Turning events on and off" msgstr "" -#: ../../library/sys.monitoring.rst:185 +#: ../../library/sys.monitoring.rst:229 msgid "" -"In order to monitor an event, it must be turned on and a callback " -"registered. Events can be turned on or off by setting the events either " -"globally or for a particular code object." +"In order to monitor an event, it must be turned on and a corresponding " +"callback must be registered. Events can be turned on or off by setting the " +"events either globally or for a particular code object." msgstr "" -#: ../../library/sys.monitoring.rst:191 +#: ../../library/sys.monitoring.rst:236 msgid "Setting events globally" msgstr "" -#: ../../library/sys.monitoring.rst:193 +#: ../../library/sys.monitoring.rst:238 msgid "" "Events can be controlled globally by modifying the set of events being " "monitored." msgstr "" -#: ../../library/sys.monitoring.rst:197 +#: ../../library/sys.monitoring.rst:242 msgid "Returns the ``int`` representing all the active events." msgstr "" -#: ../../library/sys.monitoring.rst:201 +#: ../../library/sys.monitoring.rst:246 msgid "" -"Activates all events which are set in ``event_set``. Raises a ``ValueError`` " -"if ``tool_id`` is not in use." +"Activates all events which are set in *event_set*. Raises a :exc:" +"`ValueError` if *tool_id* is not in use." msgstr "" -#: ../../library/sys.monitoring.rst:204 +#: ../../library/sys.monitoring.rst:249 msgid "No events are active by default." msgstr "" -#: ../../library/sys.monitoring.rst:207 +#: ../../library/sys.monitoring.rst:252 msgid "Per code object events" msgstr "" -#: ../../library/sys.monitoring.rst:209 +#: ../../library/sys.monitoring.rst:254 msgid "Events can also be controlled on a per code object basis." msgstr "" -#: ../../library/sys.monitoring.rst:213 -msgid "Returns all the local events for ``code``" +#: ../../library/sys.monitoring.rst:258 +msgid "Returns all the local events for *code*" msgstr "" -#: ../../library/sys.monitoring.rst:217 +#: ../../library/sys.monitoring.rst:262 msgid "" -"Activates all the local events for ``code`` which are set in ``event_set``. " -"Raises a ``ValueError`` if ``tool_id`` is not in use." +"Activates all the local events for *code* which are set in *event_set*. " +"Raises a :exc:`ValueError` if *tool_id* is not in use." msgstr "" -#: ../../library/sys.monitoring.rst:220 +#: ../../library/sys.monitoring.rst:265 msgid "" "Local events add to global events, but do not mask them. In other words, all " "global events will trigger for a code object, regardless of the local events." msgstr "" -#: ../../library/sys.monitoring.rst:226 +#: ../../library/sys.monitoring.rst:271 msgid "Disabling events" msgstr "" -#: ../../library/sys.monitoring.rst:228 +#: ../../library/sys.monitoring.rst:275 msgid "" -"Local events can be disabled for a specific code location by returning ``sys." -"monitoring.DISABLE`` from a callback function. This does not change which " -"events are set, or any other code locations for the same event." +"A special value that can be returned from a callback function to disable " +"events for the current code location." msgstr "" -#: ../../library/sys.monitoring.rst:232 +#: ../../library/sys.monitoring.rst:278 +msgid "" +"Local events can be disabled for a specific code location by returning :data:" +"`sys.monitoring.DISABLE` from a callback function. This does not change " +"which events are set, or any other code locations for the same event." +msgstr "" + +#: ../../library/sys.monitoring.rst:282 msgid "" "Disabling events for specific locations is very important for high " "performance monitoring. For example, a program can be run under a debugger " @@ -419,122 +438,105 @@ msgid "" "breakpoints." msgstr "" -#: ../../library/sys.monitoring.rst:239 +#: ../../library/sys.monitoring.rst:289 +msgid "" +"Enable all the events that were disabled by :data:`sys.monitoring.DISABLE` " +"for all tools." +msgstr "" + +#: ../../library/sys.monitoring.rst:296 msgid "Registering callback functions" msgstr "" -#: ../../library/sys.monitoring.rst:241 +#: ../../library/sys.monitoring.rst:298 msgid "To register a callable for events call" msgstr "" -#: ../../library/sys.monitoring.rst:245 -msgid "" -"Registers the callable ``func`` for the ``event`` with the given ``tool_id``" +#: ../../library/sys.monitoring.rst:302 +msgid "Registers the callable *func* for the *event* with the given *tool_id*" msgstr "" -#: ../../library/sys.monitoring.rst:247 +#: ../../library/sys.monitoring.rst:304 msgid "" -"If another callback was registered for the given ``tool_id`` and ``event``, " -"it is unregistered and returned. Otherwise ``register_callback`` returns " +"If another callback was registered for the given *tool_id* and *event*, it " +"is unregistered and returned. Otherwise :func:`register_callback` returns " "``None``." msgstr "" -#: ../../library/sys.monitoring.rst:252 +#: ../../library/sys.monitoring.rst:309 msgid "" "Functions can be unregistered by calling ``sys.monitoring." "register_callback(tool_id, event, None)``." msgstr "" -#: ../../library/sys.monitoring.rst:255 +#: ../../library/sys.monitoring.rst:312 msgid "Callback functions can be registered and unregistered at any time." msgstr "" -#: ../../library/sys.monitoring.rst:257 +#: ../../library/sys.monitoring.rst:314 msgid "" -"Registering or unregistering a callback function will generate a ``sys." -"audit`` event." +"Registering or unregistering a callback function will generate a :func:`sys." +"audit` event." msgstr "" -#: ../../library/sys.monitoring.rst:261 +#: ../../library/sys.monitoring.rst:318 msgid "Callback function arguments" msgstr "" -#: ../../library/sys.monitoring.rst:263 +#: ../../library/sys.monitoring.rst:322 +msgid "" +"A special value that is passed to a callback function to indicate that there " +"are no arguments to the call." +msgstr "" + +#: ../../library/sys.monitoring.rst:325 msgid "" "When an active event occurs, the registered callback function is called. " "Different events will provide the callback function with different " "arguments, as follows:" msgstr "" -#: ../../library/sys.monitoring.rst:266 -msgid "``PY_START`` and ``PY_RESUME``::" +#: ../../library/sys.monitoring.rst:328 +msgid ":monitoring-event:`PY_START` and :monitoring-event:`PY_RESUME`::" msgstr "" -#: ../../library/sys.monitoring.rst:270 -msgid "``PY_RETURN`` and ``PY_YIELD``:" +#: ../../library/sys.monitoring.rst:332 +msgid ":monitoring-event:`PY_RETURN` and :monitoring-event:`PY_YIELD`::" msgstr "" -#: ../../library/sys.monitoring.rst:272 +#: ../../library/sys.monitoring.rst:336 msgid "" -"``func(code: CodeType, instruction_offset: int, retval: object) -> DISABLE | " -"Any``" -msgstr "" - -#: ../../library/sys.monitoring.rst:274 -msgid "``CALL``, ``C_RAISE`` and ``C_RETURN``:" +":monitoring-event:`CALL`, :monitoring-event:`C_RAISE` and :monitoring-event:" +"`C_RETURN`::" msgstr "" -#: ../../library/sys.monitoring.rst:276 +#: ../../library/sys.monitoring.rst:340 msgid "" -"``func(code: CodeType, instruction_offset: int, callable: object, arg0: " -"object | MISSING) -> DISABLE | Any``" +"If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`." msgstr "" -#: ../../library/sys.monitoring.rst:278 -msgid "If there are no arguments, ``arg0`` is set to ``MISSING``." -msgstr "" - -#: ../../library/sys.monitoring.rst:280 -msgid "" -"``RAISE``, ``RERAISE``, ``EXCEPTION_HANDLED``, ``PY_UNWIND``, ``PY_THROW`` " -"and ``STOP_ITERATION``:" -msgstr "" - -#: ../../library/sys.monitoring.rst:282 +#: ../../library/sys.monitoring.rst:342 msgid "" -"``func(code: CodeType, instruction_offset: int, exception: BaseException) -> " -"DISABLE | Any``" -msgstr "" - -#: ../../library/sys.monitoring.rst:284 -msgid "``LINE``:" -msgstr "" - -#: ../../library/sys.monitoring.rst:286 -msgid "``func(code: CodeType, line_number: int) -> DISABLE | Any``" +":monitoring-event:`RAISE`, :monitoring-event:`RERAISE`, :monitoring-event:" +"`EXCEPTION_HANDLED`, :monitoring-event:`PY_UNWIND`, :monitoring-event:" +"`PY_THROW` and :monitoring-event:`STOP_ITERATION`::" msgstr "" -#: ../../library/sys.monitoring.rst:288 -msgid "``BRANCH`` and ``JUMP``:" +#: ../../library/sys.monitoring.rst:347 +msgid ":monitoring-event:`LINE`::" msgstr "" -#: ../../library/sys.monitoring.rst:290 -msgid "" -"``func(code: CodeType, instruction_offset: int, destination_offset: int) -> " -"DISABLE | Any``" +#: ../../library/sys.monitoring.rst:351 +msgid ":monitoring-event:`BRANCH` and :monitoring-event:`JUMP`::" msgstr "" -#: ../../library/sys.monitoring.rst:292 +#: ../../library/sys.monitoring.rst:355 msgid "" -"Note that the ``destination_offset`` is where the code will next execute. " -"For an untaken branch this will be the offset of the instruction following " -"the branch." +"Note that the *destination_offset* is where the code will next execute. For " +"an untaken branch this will be the offset of the instruction following the " +"branch." msgstr "" -#: ../../library/sys.monitoring.rst:296 -msgid "``INSTRUCTION``:" -msgstr "" - -#: ../../library/sys.monitoring.rst:298 -msgid "``func(code: CodeType, instruction_offset: int) -> DISABLE | Any``" +#: ../../library/sys.monitoring.rst:359 +msgid ":monitoring-event:`INSTRUCTION`::" msgstr "" diff --git a/library/sys.po b/library/sys.po index 93f7eb9d6e..e95afb800e 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -79,7 +79,6 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.addaudithook``。" #: ../../library/sys.rst:49 -#, fuzzy msgid "" "Calling :func:`sys.addaudithook` will itself raise an auditing event named " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " @@ -88,9 +87,9 @@ msgid "" "hook has been added unless they control all existing hooks." msgstr "" "呼叫 :func:`sys.addaudithook` 本身會引發一個不帶任何引數、名為 ``sys." -"addaudithook`` 的稽核事件。如果任何現有的掛鉤函式引發從 :class:" -"`RuntimeError` 衍生的例外,則不會添加新的掛鉤函式並抑制異常。因此,除非呼叫者" -"控制所有已存在的掛鉤函式,他們不能假設他們的掛鉤函式已被添加。" +"addaudithook`` 的稽核事件。如果任何現有的 hook 引發從 :class:`RuntimeError` " +"衍生的例外,則不會添加新的 hook 並抑制異常。因此,除非呼叫者控制所有已存在的 " +"hook,他們不能假設他們的 hook 已被添加。" #: ../../library/sys.rst:56 msgid "" @@ -231,27 +230,34 @@ msgstr "另請參閱 :data:`sys.stdlib_module_names` 清單。" msgid "" "Call ``func(*args)``, while tracing is enabled. The tracing state is saved, " "and restored afterwards. This is intended to be called from a debugger from " -"a checkpoint, to recursively debug some other code." +"a checkpoint, to recursively debug or profile some other code." +msgstr "" + +#: ../../library/sys.rst:178 +msgid "" +"Tracing is suspended while calling a tracing function set by :func:" +"`settrace` or :func:`setprofile` to avoid infinite recursion. :func:`!" +"call_tracing` enables explicit recursion of the tracing function." msgstr "" -#: ../../library/sys.rst:181 +#: ../../library/sys.rst:185 msgid "A string containing the copyright pertaining to the Python interpreter." msgstr "" -#: ../../library/sys.rst:186 +#: ../../library/sys.rst:190 msgid "" "Clear the internal type cache. The type cache is used to speed up attribute " "and method lookups. Use the function *only* to drop unnecessary references " "during reference leak debugging." msgstr "" -#: ../../library/sys.rst:190 ../../library/sys.rst:206 -#: ../../library/sys.rst:219 +#: ../../library/sys.rst:194 ../../library/sys.rst:210 +#: ../../library/sys.rst:223 msgid "" "This function should be used for internal and specialized purposes only." msgstr "" -#: ../../library/sys.rst:195 +#: ../../library/sys.rst:199 msgid "" "Return a dictionary mapping each thread's identifier to the topmost stack " "frame currently active in that thread at the time the function is called. " @@ -259,7 +265,7 @@ msgid "" "given such a frame." msgstr "" -#: ../../library/sys.rst:200 +#: ../../library/sys.rst:204 msgid "" "This is most useful for debugging deadlock: this function does not require " "the deadlocked threads' cooperation, and such threads' call stacks are " @@ -268,14 +274,14 @@ msgid "" "by the time calling code examines the frame." msgstr "" -#: ../../library/sys.rst:208 +#: ../../library/sys.rst:212 msgid "" "Raises an :ref:`auditing event ` ``sys._current_frames`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys._current_frames``。" -#: ../../library/sys.rst:212 +#: ../../library/sys.rst:216 msgid "" "Return a dictionary mapping each thread's identifier to the topmost " "exception currently active in that thread at the time the function is " @@ -283,11 +289,11 @@ msgid "" "included in the result dictionary." msgstr "" -#: ../../library/sys.rst:217 +#: ../../library/sys.rst:221 msgid "This is most useful for statistical profiling." msgstr "" -#: ../../library/sys.rst:221 +#: ../../library/sys.rst:225 msgid "" "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " "no arguments." @@ -295,20 +301,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "_current_exceptions``。" -#: ../../library/sys.rst:223 +#: ../../library/sys.rst:227 msgid "" "Each value in the dictionary is now a single exception instance, rather than " "a 3-tuple as returned from ``sys.exc_info()``." msgstr "" -#: ../../library/sys.rst:229 +#: ../../library/sys.rst:233 msgid "" "This hook function is called by built-in :func:`breakpoint`. By default, it " "drops you into the :mod:`pdb` debugger, but it can be set to any other " "function so that you can choose which debugger gets used." msgstr "" -#: ../../library/sys.rst:233 +#: ../../library/sys.rst:237 msgid "" "The signature of this function is dependent on what it calls. For example, " "the default binding (e.g. ``pdb.set_trace()``) expects no arguments, but you " @@ -318,7 +324,7 @@ msgid "" "returns is returned from ``breakpoint()``." msgstr "" -#: ../../library/sys.rst:240 +#: ../../library/sys.rst:244 msgid "" "The default implementation first consults the environment variable :envvar:" "`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this function returns " @@ -332,48 +338,48 @@ msgid "" "breakpointhook()`` returns to the built-in :func:`breakpoint` function." msgstr "" -#: ../../library/sys.rst:252 +#: ../../library/sys.rst:256 msgid "" "Note that if anything goes wrong while importing the callable named by :" "envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the " "breakpoint is ignored." msgstr "" -#: ../../library/sys.rst:256 +#: ../../library/sys.rst:260 msgid "" "Also note that if ``sys.breakpointhook()`` is overridden programmatically, :" "envvar:`PYTHONBREAKPOINT` is *not* consulted." msgstr "" -#: ../../library/sys.rst:263 +#: ../../library/sys.rst:267 msgid "" "Print low-level information to stderr about the state of CPython's memory " "allocator." msgstr "" -#: ../../library/sys.rst:266 +#: ../../library/sys.rst:270 msgid "" "If Python is :ref:`built in debug mode ` (:option:`configure --" "with-pydebug option <--with-pydebug>`), it also performs some expensive " "internal consistency checks." msgstr "" -#: ../../library/sys.rst:274 +#: ../../library/sys.rst:278 msgid "" "This function is specific to CPython. The exact output format is not " "defined here, and may change." msgstr "" -#: ../../library/sys.rst:280 +#: ../../library/sys.rst:284 msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:282 ../../library/sys.rst:972 -#: ../../library/sys.rst:1717 ../../library/sys.rst:1953 +#: ../../library/sys.rst:286 ../../library/sys.rst:976 +#: ../../library/sys.rst:1730 ../../library/sys.rst:1966 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/sys.rst:287 +#: ../../library/sys.rst:291 msgid "" "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." "stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not " @@ -382,7 +388,7 @@ msgid "" "encoding`` with ``'backslashreplace'`` error handler." msgstr "" -#: ../../library/sys.rst:293 +#: ../../library/sys.rst:297 msgid "" "``sys.displayhook`` is called on the result of evaluating an :term:" "`expression` entered in an interactive Python session. The display of these " @@ -390,15 +396,15 @@ msgid "" "displayhook``." msgstr "" -#: ../../library/sys.rst:297 +#: ../../library/sys.rst:301 msgid "Pseudo-code::" msgstr "" -#: ../../library/sys.rst:317 +#: ../../library/sys.rst:321 msgid "Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`." msgstr "" -#: ../../library/sys.rst:323 +#: ../../library/sys.rst:327 msgid "" "If this is true, Python won't try to write ``.pyc`` files on the import of " "source modules. This value is initially set to ``True`` or ``False`` " @@ -407,20 +413,20 @@ msgid "" "to control bytecode file generation." msgstr "" -#: ../../library/sys.rst:332 +#: ../../library/sys.rst:336 msgid "" "A :term:`named tuple` holding information about the environment on the " "*wasm32-emscripten* platform. The named tuple is provisional and may change " "in the future." msgstr "" -#: ../../library/sys.rst:338 +#: ../../library/sys.rst:342 msgid "" "Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, " "8)``." msgstr "" -#: ../../library/sys.rst:342 +#: ../../library/sys.rst:346 msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." @@ -428,19 +434,19 @@ msgstr "" "運行環境字串,例如瀏覽器使用者代理 (browser user agent) ``'Node.js " "v14.18.2'`` 或 ``'UNKNOWN'``。" -#: ../../library/sys.rst:346 +#: ../../library/sys.rst:350 msgid "``True`` if Python is compiled with Emscripten pthreads support." msgstr "" -#: ../../library/sys.rst:350 +#: ../../library/sys.rst:354 msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: ../../library/sys.rst:352 +#: ../../library/sys.rst:356 msgid ":ref:`Availability `: Emscripten." msgstr ":ref:`適用 `:Emscripten。" -#: ../../library/sys.rst:359 +#: ../../library/sys.rst:363 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " "files to (and read them from) a parallel directory tree rooted at this " @@ -451,12 +457,12 @@ msgid "" "with the same pycache prefix (if any) that you will use at runtime." msgstr "" -#: ../../library/sys.rst:367 +#: ../../library/sys.rst:371 msgid "" "A relative path is interpreted relative to the current working directory." msgstr "" -#: ../../library/sys.rst:369 +#: ../../library/sys.rst:373 msgid "" "This value is initially set based on the value of the :option:`-X` " "``pycache_prefix=PATH`` command-line option or the :envvar:" @@ -464,12 +470,12 @@ msgid "" "If neither are set, it is ``None``." msgstr "" -#: ../../library/sys.rst:379 +#: ../../library/sys.rst:383 msgid "" "This function prints out a given traceback and exception to ``sys.stderr``." msgstr "" -#: ../../library/sys.rst:381 +#: ../../library/sys.rst:385 msgid "" "When an exception other than :exc:`SystemExit` is raised and uncaught, the " "interpreter calls ``sys.excepthook`` with three arguments, the exception " @@ -480,7 +486,7 @@ msgid "" "argument function to ``sys.excepthook``." msgstr "" -#: ../../library/sys.rst:388 +#: ../../library/sys.rst:392 msgid "" "Raises an :ref:`auditing event ` ``sys.excepthook`` with arguments " "``hook``, ``type``, ``value``, ``traceback``." @@ -488,7 +494,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``type``、``value``、``traceback`` 的\\ :ref:`稽核" "事件 ` ``sys.excepthook``。" -#: ../../library/sys.rst:390 +#: ../../library/sys.rst:394 msgid "" "Raise an auditing event ``sys.excepthook`` with arguments ``hook``, " "``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " @@ -498,14 +504,14 @@ msgid "" "excepthook`` will be called." msgstr "" -#: ../../library/sys.rst:399 +#: ../../library/sys.rst:403 msgid "" "The :func:`sys.unraisablehook` function handles unraisable exceptions and " "the :func:`threading.excepthook` function handles exception raised by :func:" "`threading.Thread.run`." msgstr "" -#: ../../library/sys.rst:409 +#: ../../library/sys.rst:413 msgid "" "These objects contain the original values of ``breakpointhook``, " "``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the " @@ -514,15 +520,15 @@ msgid "" "get replaced with broken or alternative objects." msgstr "" -#: ../../library/sys.rst:415 +#: ../../library/sys.rst:419 msgid "__breakpointhook__" msgstr "__breakpointhook__" -#: ../../library/sys.rst:418 +#: ../../library/sys.rst:422 msgid "__unraisablehook__" msgstr "__unraisablehook__" -#: ../../library/sys.rst:424 +#: ../../library/sys.rst:428 msgid "" "This function, when called while an exception handler is executing (such as " "an ``except`` or ``except*`` clause), returns the exception instance that " @@ -530,11 +536,11 @@ msgid "" "another, only the exception handled by the innermost handler is accessible." msgstr "" -#: ../../library/sys.rst:429 +#: ../../library/sys.rst:433 msgid "If no exception handler is executing, this function returns ``None``." msgstr "" -#: ../../library/sys.rst:436 +#: ../../library/sys.rst:440 msgid "" "This function returns the old-style representation of the handled exception. " "If an exception ``e`` is currently handled (so :func:`exception` would " @@ -545,13 +551,13 @@ msgid "" "stack at the point where the exception last occurred." msgstr "" -#: ../../library/sys.rst:447 +#: ../../library/sys.rst:451 msgid "" "If no exception is being handled anywhere on the stack, this function return " "a tuple containing three ``None`` values." msgstr "" -#: ../../library/sys.rst:450 +#: ../../library/sys.rst:454 msgid "" "The ``type`` and ``traceback`` fields are now derived from the ``value`` " "(the exception instance), so when an exception is modified while it is being " @@ -559,7 +565,7 @@ msgid "" "func:`exc_info`." msgstr "" -#: ../../library/sys.rst:458 +#: ../../library/sys.rst:462 msgid "" "A string giving the site-specific directory prefix where the platform-" "dependent Python files are installed; by default, this is also ``'/usr/" @@ -571,7 +577,7 @@ msgid "" "is the version number of Python, for example ``3.2``." msgstr "" -#: ../../library/sys.rst:469 +#: ../../library/sys.rst:473 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " @@ -579,7 +585,7 @@ msgid "" "`base_exec_prefix`." msgstr "" -#: ../../library/sys.rst:477 +#: ../../library/sys.rst:481 msgid "" "A string giving the absolute path of the executable binary for the Python " "interpreter, on systems where this makes sense. If Python is unable to " @@ -587,13 +593,13 @@ msgid "" "empty string or ``None``." msgstr "" -#: ../../library/sys.rst:485 +#: ../../library/sys.rst:489 msgid "" "Raise a :exc:`SystemExit` exception, signaling an intention to exit the " "interpreter." msgstr "" -#: ../../library/sys.rst:487 +#: ../../library/sys.rst:491 msgid "" "The optional argument *arg* can be an integer giving the exit status " "(defaulting to zero), or another type of object. If it is an integer, zero " @@ -609,7 +615,7 @@ msgid "" "way to exit a program when an error occurs." msgstr "" -#: ../../library/sys.rst:500 +#: ../../library/sys.rst:504 msgid "" "Since :func:`exit` ultimately \"only\" raises an exception, it will only " "exit the process when called from the main thread, and the exception is not " @@ -618,113 +624,113 @@ msgid "" "an outer level." msgstr "" -#: ../../library/sys.rst:505 +#: ../../library/sys.rst:509 msgid "" "If an error occurs in the cleanup after the Python interpreter has caught :" "exc:`SystemExit` (such as an error flushing buffered data in the standard " "streams), the exit status is changed to 120." msgstr "" -#: ../../library/sys.rst:513 +#: ../../library/sys.rst:517 msgid "" "The :term:`named tuple` *flags* exposes the status of command line flags. " "The attributes are read only." msgstr "" -#: ../../library/sys.rst:519 +#: ../../library/sys.rst:523 msgid ":option:`-d`" msgstr ":option:`-d`" -#: ../../library/sys.rst:522 ../../library/sys.rst:525 +#: ../../library/sys.rst:526 ../../library/sys.rst:529 msgid ":option:`-i`" msgstr ":option:`-i`" -#: ../../library/sys.rst:528 +#: ../../library/sys.rst:532 msgid ":option:`-I`" msgstr ":option:`-I`" -#: ../../library/sys.rst:531 +#: ../../library/sys.rst:535 msgid ":option:`-O` or :option:`-OO`" msgstr ":option:`-O` 或 :option:`-OO`" -#: ../../library/sys.rst:534 +#: ../../library/sys.rst:538 msgid ":option:`-B`" msgstr ":option:`-B`" -#: ../../library/sys.rst:537 +#: ../../library/sys.rst:541 msgid ":option:`-s`" msgstr ":option:`-s`" -#: ../../library/sys.rst:540 +#: ../../library/sys.rst:544 msgid ":option:`-S`" msgstr ":option:`-S`" -#: ../../library/sys.rst:543 +#: ../../library/sys.rst:547 msgid ":option:`-E`" msgstr ":option:`-E`" -#: ../../library/sys.rst:546 +#: ../../library/sys.rst:550 msgid ":option:`-v`" msgstr ":option:`-v`" -#: ../../library/sys.rst:549 +#: ../../library/sys.rst:553 msgid ":option:`-b`" msgstr ":option:`-b`" -#: ../../library/sys.rst:552 +#: ../../library/sys.rst:556 msgid ":option:`-q`" msgstr ":option:`-q`" -#: ../../library/sys.rst:555 +#: ../../library/sys.rst:559 msgid ":option:`-R`" msgstr ":option:`-R`" -#: ../../library/sys.rst:558 +#: ../../library/sys.rst:562 msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" msgstr ":option:`-X dev <-X>` (:ref:`Python 開發模式 `)" -#: ../../library/sys.rst:561 +#: ../../library/sys.rst:565 msgid ":option:`-X utf8 <-X>`" msgstr ":option:`-X utf8 <-X>`" -#: ../../library/sys.rst:564 +#: ../../library/sys.rst:568 msgid ":option:`-P`" msgstr ":option:`-P`" -#: ../../library/sys.rst:567 +#: ../../library/sys.rst:571 msgid "" ":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length " "limitation `)" msgstr "" -#: ../../library/sys.rst:571 +#: ../../library/sys.rst:575 msgid ":option:`-X warn_default_encoding <-X>`" msgstr ":option:`-X warn_default_encoding <-X>`" -#: ../../library/sys.rst:573 +#: ../../library/sys.rst:577 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "新增 ``quiet`` 屬性,用於新的 :option:`-q` 旗標。" -#: ../../library/sys.rst:576 +#: ../../library/sys.rst:580 msgid "The ``hash_randomization`` attribute." msgstr "``hash_randomization`` 屬性。" -#: ../../library/sys.rst:579 +#: ../../library/sys.rst:583 msgid "Removed obsolete ``division_warning`` attribute." msgstr "移除過時的 ``division_warning`` 屬性。" -#: ../../library/sys.rst:582 +#: ../../library/sys.rst:586 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "新增 ``isolated`` 屬性,用於 :option:`-I` ``isolated`` 旗標。" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:589 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:594 msgid "" "Added ``warn_default_encoding`` attribute for :option:`-X` " "``warn_default_encoding`` flag." @@ -732,15 +738,15 @@ msgstr "" "新增 ``warn_default_encoding`` 屬性,用於 :option:`-X` " "``warn_default_encoding`` 旗標。" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:597 msgid "Added the ``safe_path`` attribute for :option:`-P` option." msgstr "新增 ``safe_path`` 屬性,用於 :option:`-P` 選項。" -#: ../../library/sys.rst:596 +#: ../../library/sys.rst:600 msgid "Added the ``int_max_str_digits`` attribute." msgstr "新增 ``int_max_str_digits`` 屬性。" -#: ../../library/sys.rst:602 +#: ../../library/sys.rst:606 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -750,161 +756,161 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:609 +#: ../../library/sys.rst:613 msgid "Attributes of the :data:`!float_info` :term:`named tuple`" msgstr "" -#: ../../library/sys.rst:612 +#: ../../library/sys.rst:616 msgid "attribute" msgstr "屬性" -#: ../../library/sys.rst:613 +#: ../../library/sys.rst:617 msgid "float.h macro" msgstr "float.h macro" -#: ../../library/sys.rst:614 +#: ../../library/sys.rst:618 msgid "explanation" msgstr "解釋" -#: ../../library/sys.rst:617 +#: ../../library/sys.rst:621 msgid ":c:macro:`!DBL_EPSILON`" msgstr ":c:macro:`!DBL_EPSILON`" -#: ../../library/sys.rst:618 +#: ../../library/sys.rst:622 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float." msgstr "" -#: ../../library/sys.rst:621 +#: ../../library/sys.rst:625 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/sys.rst:624 +#: ../../library/sys.rst:628 msgid ":c:macro:`!DBL_DIG`" msgstr ":c:macro:`!DBL_DIG`" -#: ../../library/sys.rst:625 +#: ../../library/sys.rst:629 msgid "" "The maximum number of decimal digits that can be faithfully represented in a " "float; see below." msgstr "" -#: ../../library/sys.rst:629 +#: ../../library/sys.rst:633 msgid ":c:macro:`!DBL_MANT_DIG`" msgstr ":c:macro:`!DBL_MANT_DIG`" -#: ../../library/sys.rst:630 +#: ../../library/sys.rst:634 msgid "" "Float precision: the number of base-``radix`` digits in the significand of a " "float." msgstr "" -#: ../../library/sys.rst:634 +#: ../../library/sys.rst:638 msgid ":c:macro:`!DBL_MAX`" msgstr ":c:macro:`!DBL_MAX`" -#: ../../library/sys.rst:635 +#: ../../library/sys.rst:639 msgid "The maximum representable positive finite float." msgstr "" -#: ../../library/sys.rst:638 +#: ../../library/sys.rst:642 msgid ":c:macro:`!DBL_MAX_EXP`" msgstr ":c:macro:`!DBL_MAX_EXP`" -#: ../../library/sys.rst:639 +#: ../../library/sys.rst:643 msgid "" "The maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float." msgstr "" -#: ../../library/sys.rst:643 +#: ../../library/sys.rst:647 msgid ":c:macro:`!DBL_MAX_10_EXP`" msgstr ":c:macro:`!DBL_MAX_10_EXP`" -#: ../../library/sys.rst:644 +#: ../../library/sys.rst:648 msgid "" "The maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats." msgstr "" -#: ../../library/sys.rst:648 +#: ../../library/sys.rst:652 msgid ":c:macro:`!DBL_MIN`" msgstr ":c:macro:`!DBL_MIN`" -#: ../../library/sys.rst:649 +#: ../../library/sys.rst:653 msgid "The minimum representable positive *normalized* float." msgstr "" -#: ../../library/sys.rst:651 +#: ../../library/sys.rst:655 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:655 +#: ../../library/sys.rst:659 msgid ":c:macro:`!DBL_MIN_EXP`" msgstr ":c:macro:`!DBL_MIN_EXP`" -#: ../../library/sys.rst:656 +#: ../../library/sys.rst:660 msgid "" "The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." msgstr "" -#: ../../library/sys.rst:660 +#: ../../library/sys.rst:664 msgid ":c:macro:`!DBL_MIN_10_EXP`" msgstr ":c:macro:`!DBL_MIN_10_EXP`" -#: ../../library/sys.rst:661 +#: ../../library/sys.rst:665 msgid "The minimum integer *e* such that ``10**e`` is a normalized float." msgstr "" -#: ../../library/sys.rst:664 +#: ../../library/sys.rst:668 msgid ":c:macro:`!FLT_RADIX`" msgstr ":c:macro:`!FLT_RADIX`" -#: ../../library/sys.rst:665 +#: ../../library/sys.rst:669 msgid "The radix of exponent representation." msgstr "" -#: ../../library/sys.rst:668 +#: ../../library/sys.rst:672 msgid ":c:macro:`!FLT_ROUNDS`" msgstr ":c:macro:`!FLT_ROUNDS`" -#: ../../library/sys.rst:669 +#: ../../library/sys.rst:673 msgid "" "An integer representing the rounding mode for floating-point arithmetic. " "This reflects the value of the system :c:macro:`!FLT_ROUNDS` macro at " "interpreter startup time:" msgstr "" -#: ../../library/sys.rst:673 +#: ../../library/sys.rst:677 msgid "``-1``: indeterminable" msgstr "" -#: ../../library/sys.rst:674 +#: ../../library/sys.rst:678 msgid "``0``: toward zero" msgstr "" -#: ../../library/sys.rst:675 +#: ../../library/sys.rst:679 msgid "``1``: to nearest" msgstr "" -#: ../../library/sys.rst:676 +#: ../../library/sys.rst:680 msgid "``2``: toward positive infinity" msgstr "" -#: ../../library/sys.rst:677 +#: ../../library/sys.rst:681 msgid "``3``: toward negative infinity" msgstr "" -#: ../../library/sys.rst:679 +#: ../../library/sys.rst:683 msgid "" "All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-" "defined rounding behavior." msgstr "" -#: ../../library/sys.rst:682 +#: ../../library/sys.rst:686 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`!sys." @@ -912,13 +918,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:695 +#: ../../library/sys.rst:699 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:704 +#: ../../library/sys.rst:708 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -928,7 +934,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:717 +#: ../../library/sys.rst:721 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -938,42 +944,42 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:724 +#: ../../library/sys.rst:728 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:732 +#: ../../library/sys.rst:736 msgid "Return the number of unicode objects that have been interned." msgstr "" -#: ../../library/sys.rst:739 +#: ../../library/sys.rst:743 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:741 +#: ../../library/sys.rst:745 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:748 +#: ../../library/sys.rst:752 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:754 +#: ../../library/sys.rst:758 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:759 ../../library/sys.rst:1447 +#: ../../library/sys.rst:763 ../../library/sys.rst:1451 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:764 +#: ../../library/sys.rst:768 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:797 +#: ../../library/sys.rst:801 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1028,20 +1034,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:815 +#: ../../library/sys.rst:819 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:822 +#: ../../library/sys.rst:826 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:826 +#: ../../library/sys.rst:830 msgid "" "Note that the returned value may not actually reflect how many references to " "the object are actually held. For example, some objects are \"immortal\" " @@ -1050,13 +1056,13 @@ msgid "" "other than a value of 0 or 1." msgstr "" -#: ../../library/sys.rst:832 +#: ../../library/sys.rst:836 msgid "" "Immortal objects have very large refcounts that do not match the actual " "number of references to the object." msgstr "" -#: ../../library/sys.rst:838 +#: ../../library/sys.rst:842 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1064,46 +1070,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:846 +#: ../../library/sys.rst:850 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:851 +#: ../../library/sys.rst:855 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:854 +#: ../../library/sys.rst:858 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:857 +#: ../../library/sys.rst:861 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:861 +#: ../../library/sys.rst:865 msgid "" "See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size " "of containers and all their contents." msgstr "" -#: ../../library/sys.rst:867 +#: ../../library/sys.rst:871 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:875 +#: ../../library/sys.rst:879 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1112,7 +1118,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:880 +#: ../../library/sys.rst:884 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1120,13 +1126,13 @@ msgstr "" "引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." "_getframe``。" -#: ../../library/sys.rst:884 ../../library/sys.rst:900 +#: ../../library/sys.rst:888 ../../library/sys.rst:904 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:890 +#: ../../library/sys.rst:894 msgid "" "Return the name of a module from the call stack. If optional integer " "*depth* is given, return the module that many calls below the top of the " @@ -1135,7 +1141,7 @@ msgid "" "returning the module at the top of the call stack." msgstr "" -#: ../../library/sys.rst:896 +#: ../../library/sys.rst:900 msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." @@ -1143,15 +1149,15 @@ msgstr "" "引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." "_getframemodulename``。" -#: ../../library/sys.rst:910 +#: ../../library/sys.rst:914 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:919 +#: ../../library/sys.rst:923 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:923 +#: ../../library/sys.rst:927 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1159,7 +1165,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:931 +#: ../../library/sys.rst:935 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1171,54 +1177,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:942 +#: ../../library/sys.rst:946 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" -#: ../../library/sys.rst:944 +#: ../../library/sys.rst:948 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:947 +#: ../../library/sys.rst:951 msgid "Constant" msgstr "" -#: ../../library/sys.rst:947 +#: ../../library/sys.rst:951 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:949 +#: ../../library/sys.rst:953 msgid "``1`` (VER_NT_WORKSTATION)" msgstr "``1`` (VER_NT_WORKSTATION)" -#: ../../library/sys.rst:949 +#: ../../library/sys.rst:953 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:951 +#: ../../library/sys.rst:955 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" -#: ../../library/sys.rst:951 +#: ../../library/sys.rst:955 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:954 +#: ../../library/sys.rst:958 msgid "``3`` (VER_NT_SERVER)" msgstr "``3`` (VER_NT_SERVER)" -#: ../../library/sys.rst:954 +#: ../../library/sys.rst:958 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:958 +#: ../../library/sys.rst:962 msgid "" "This function wraps the Win32 :c:func:`!GetVersionEx` function; see the " "Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:962 +#: ../../library/sys.rst:966 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1226,24 +1232,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:968 +#: ../../library/sys.rst:972 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:974 +#: ../../library/sys.rst:978 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:978 +#: ../../library/sys.rst:982 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:984 +#: ../../library/sys.rst:988 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1253,71 +1259,71 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:991 +#: ../../library/sys.rst:995 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:995 ../../library/sys.rst:1649 +#: ../../library/sys.rst:999 ../../library/sys.rst:1662 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:1001 +#: ../../library/sys.rst:1005 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:1007 ../../library/sys.rst:1670 +#: ../../library/sys.rst:1011 ../../library/sys.rst:1683 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:1013 +#: ../../library/sys.rst:1017 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:1019 +#: ../../library/sys.rst:1023 msgid "The width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:1023 +#: ../../library/sys.rst:1027 msgid "The prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:1027 +#: ../../library/sys.rst:1031 msgid "The hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:1031 +#: ../../library/sys.rst:1035 msgid "(This attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:1035 +#: ../../library/sys.rst:1039 msgid "The multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:1039 +#: ../../library/sys.rst:1043 msgid "The name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:1043 +#: ../../library/sys.rst:1047 msgid "The internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1047 +#: ../../library/sys.rst:1051 msgid "The size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1051 +#: ../../library/sys.rst:1055 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:1057 +#: ../../library/sys.rst:1061 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1325,7 +1331,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:1068 +#: ../../library/sys.rst:1072 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1333,25 +1339,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:1073 +#: ../../library/sys.rst:1077 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1078 +#: ../../library/sys.rst:1082 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:1082 +#: ../../library/sys.rst:1086 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:1086 +#: ../../library/sys.rst:1090 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1363,13 +1369,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1096 +#: ../../library/sys.rst:1100 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1099 +#: ../../library/sys.rst:1103 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1378,7 +1384,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1106 +#: ../../library/sys.rst:1110 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1388,41 +1394,41 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1117 +#: ../../library/sys.rst:1121 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1122 +#: ../../library/sys.rst:1126 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1127 +#: ../../library/sys.rst:1131 msgid "" "The number of bits held in each digit. Python integers are stored internally " "in base ``2**int_info.bits_per_digit``." msgstr "" -#: ../../library/sys.rst:1132 +#: ../../library/sys.rst:1136 msgid "The size in bytes of the C type used to represent a digit." msgstr "" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1140 msgid "" "The default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1141 +#: ../../library/sys.rst:1145 msgid "" "The minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1148 +#: ../../library/sys.rst:1152 msgid "" "Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info." "str_digits_check_threshold`." @@ -1430,7 +1436,7 @@ msgstr "" "新增 :attr:`~int_info.default_max_str_digits` 和 :attr:`~int_info." "str_digits_check_threshold`。" -#: ../../library/sys.rst:1154 +#: ../../library/sys.rst:1158 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1160 +#: ../../library/sys.rst:1164 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1447,13 +1453,13 @@ msgstr "" "引發一個附帶引數 ``hook`` 的\\ :ref:`稽核事件 ` ``cpython." "run_interactivehook``。" -#: ../../library/sys.rst:1162 +#: ../../library/sys.rst:1166 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1171 +#: ../../library/sys.rst:1175 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1465,19 +1471,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1179 +#: ../../library/sys.rst:1183 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1185 +#: ../../library/sys.rst:1189 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1192 +#: ../../library/sys.rst:1196 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1488,34 +1494,34 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1206 +#: ../../library/sys.rst:1210 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1216 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1219 +#: ../../library/sys.rst:1223 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1222 +#: ../../library/sys.rst:1226 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1230 +#: ../../library/sys.rst:1234 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1528,27 +1534,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1247 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1247 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1247 +#: ../../library/sys.rst:1251 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1246 +#: ../../library/sys.rst:1250 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1256 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:`!" @@ -1556,7 +1562,7 @@ msgid "" "entry doesn't have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1260 +#: ../../library/sys.rst:1264 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1568,78 +1574,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1272 +#: ../../library/sys.rst:1276 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1275 +#: ../../library/sys.rst:1279 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1288 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1288 +#: ../../library/sys.rst:1292 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1292 +#: ../../library/sys.rst:1296 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1294 +#: ../../library/sys.rst:1298 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1296 +#: ../../library/sys.rst:1300 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1299 +#: ../../library/sys.rst:1303 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1302 +#: ../../library/sys.rst:1306 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1308 +#: ../../library/sys.rst:1312 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1313 +#: ../../library/sys.rst:1317 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1317 ../../library/sys.rst:1328 +#: ../../library/sys.rst:1321 ../../library/sys.rst:1332 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1322 +#: ../../library/sys.rst:1326 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1647,13 +1653,13 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1333 +#: ../../library/sys.rst:1337 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1336 +#: ../../library/sys.rst:1340 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1662,75 +1668,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1349 +#: ../../library/sys.rst:1353 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1352 +#: ../../library/sys.rst:1356 msgid "System" msgstr "" -#: ../../library/sys.rst:1352 +#: ../../library/sys.rst:1356 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1354 +#: ../../library/sys.rst:1358 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1354 +#: ../../library/sys.rst:1358 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1355 +#: ../../library/sys.rst:1359 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1355 +#: ../../library/sys.rst:1359 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1356 +#: ../../library/sys.rst:1360 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1356 +#: ../../library/sys.rst:1360 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1357 +#: ../../library/sys.rst:1361 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1357 +#: ../../library/sys.rst:1361 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1358 +#: ../../library/sys.rst:1362 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1358 +#: ../../library/sys.rst:1362 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1363 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1363 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1364 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1364 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1363 +#: ../../library/sys.rst:1367 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1738,7 +1744,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1369 +#: ../../library/sys.rst:1373 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1746,57 +1752,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1377 +#: ../../library/sys.rst:1381 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1380 +#: ../../library/sys.rst:1384 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1386 +#: ../../library/sys.rst:1390 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1393 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1397 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1395 +#: ../../library/sys.rst:1399 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1398 +#: ../../library/sys.rst:1402 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1400 +#: ../../library/sys.rst:1404 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1408 +#: ../../library/sys.rst:1412 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1805,14 +1811,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1414 +#: ../../library/sys.rst:1418 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1429 +#: ../../library/sys.rst:1433 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1822,7 +1828,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1439 +#: ../../library/sys.rst:1443 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1833,14 +1839,14 @@ msgid "" "g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1451 +#: ../../library/sys.rst:1455 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1463 +#: ../../library/sys.rst:1467 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1855,7 +1861,14 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1474 +#: ../../library/sys.rst:1479 +msgid "" +"The same tracing mechanism is used for :func:`!setprofile` as :func:" +"`settrace`. To trace calls with :func:`!setprofile` inside a tracing " +"function (e.g. in a debugger breakpoint), see :func:`call_tracing`." +msgstr "" + +#: ../../library/sys.rst:1483 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1863,71 +1876,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1479 -msgid "" -"Raises an :ref:`auditing event ` ``sys.setprofile`` with no " -"arguments." -msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" - -#: ../../library/sys.rst:1481 ../../library/sys.rst:1562 +#: ../../library/sys.rst:1488 ../../library/sys.rst:1575 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1485 ../../library/sys.rst:1567 +#: ../../library/sys.rst:1492 ../../library/sys.rst:1580 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1484 +#: ../../library/sys.rst:1491 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1490 ../../library/sys.rst:1582 +#: ../../library/sys.rst:1497 ../../library/sys.rst:1595 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1488 +#: ../../library/sys.rst:1495 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1494 +#: ../../library/sys.rst:1501 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1493 +#: ../../library/sys.rst:1500 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1497 +#: ../../library/sys.rst:1504 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1497 +#: ../../library/sys.rst:1504 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1499 +#: ../../library/sys.rst:1507 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1507 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1504 +#: ../../library/sys.rst:1509 +msgid "" +"Raises an :ref:`auditing event ` ``sys.setprofile`` with no " +"arguments." +msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" + +#: ../../library/sys.rst:1514 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1508 +#: ../../library/sys.rst:1518 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -1935,19 +1948,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1513 +#: ../../library/sys.rst:1523 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1516 +#: ../../library/sys.rst:1526 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1523 +#: ../../library/sys.rst:1533 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -1958,7 +1971,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1540 +#: ../../library/sys.rst:1550 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -1967,7 +1980,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1555 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1975,7 +1988,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1550 +#: ../../library/sys.rst:1560 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -1983,31 +1996,36 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1555 +#: ../../library/sys.rst:1565 msgid "" -"The local trace function should return a reference to itself (or to another " -"function for further tracing in that scope), or ``None`` to turn off tracing " -"in that scope." +"The local trace function should return a reference to itself, or to another " +"function which would then be used as the local trace function for the scope." msgstr "" -#: ../../library/sys.rst:1559 +#: ../../library/sys.rst:1568 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1565 +#: ../../library/sys.rst:1572 +msgid "" +"Tracing is disabled while calling the trace function (e.g. a function set " +"by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." +msgstr "" + +#: ../../library/sys.rst:1578 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1576 +#: ../../library/sys.rst:1589 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1570 +#: ../../library/sys.rst:1583 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2017,7 +2035,7 @@ msgid "" "const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1579 +#: ../../library/sys.rst:1592 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2025,22 +2043,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1587 +#: ../../library/sys.rst:1600 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1585 +#: ../../library/sys.rst:1598 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1595 +#: ../../library/sys.rst:1608 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1590 +#: ../../library/sys.rst:1603 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2049,13 +2067,13 @@ msgid "" "f_trace_opcodes` to :const:`True` on the :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1597 +#: ../../library/sys.rst:1610 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1600 +#: ../../library/sys.rst:1613 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2069,17 +2087,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1611 +#: ../../library/sys.rst:1624 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1613 +#: ../../library/sys.rst:1626 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1617 +#: ../../library/sys.rst:1630 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2087,13 +2105,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1624 +#: ../../library/sys.rst:1637 msgid "" "``'opcode'`` event type added; :attr:`!f_trace_lines` and :attr:`!" "f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1629 +#: ../../library/sys.rst:1642 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2102,7 +2120,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1635 +#: ../../library/sys.rst:1648 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2110,7 +2128,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1650 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2118,20 +2136,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1639 +#: ../../library/sys.rst:1652 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1642 +#: ../../library/sys.rst:1655 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1654 +#: ../../library/sys.rst:1667 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2140,105 +2158,105 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1661 +#: ../../library/sys.rst:1674 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1665 +#: ../../library/sys.rst:1678 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1675 +#: ../../library/sys.rst:1688 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1678 ../../library/sys.rst:1693 -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:1691 ../../library/sys.rst:1706 +#: ../../library/sys.rst:1714 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/sys.rst:1684 +#: ../../library/sys.rst:1697 msgid ":ref:`perf_profiling`" msgstr "" -#: ../../library/sys.rst:1685 +#: ../../library/sys.rst:1698 msgid "https://perf.wiki.kernel.org" msgstr "" -#: ../../library/sys.rst:1689 +#: ../../library/sys.rst:1702 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1691 +#: ../../library/sys.rst:1704 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1699 +#: ../../library/sys.rst:1712 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1707 +#: ../../library/sys.rst:1720 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1711 +#: ../../library/sys.rst:1724 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1714 +#: ../../library/sys.rst:1727 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1719 +#: ../../library/sys.rst:1732 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1726 +#: ../../library/sys.rst:1739 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1729 +#: ../../library/sys.rst:1742 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1731 +#: ../../library/sys.rst:1744 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1733 +#: ../../library/sys.rst:1746 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1735 +#: ../../library/sys.rst:1748 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1739 +#: ../../library/sys.rst:1752 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1742 +#: ../../library/sys.rst:1755 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2249,14 +2267,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1751 +#: ../../library/sys.rst:1764 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1756 +#: ../../library/sys.rst:1769 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2265,7 +2283,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1763 +#: ../../library/sys.rst:1776 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2274,27 +2292,27 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1769 +#: ../../library/sys.rst:1782 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1775 +#: ../../library/sys.rst:1788 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1779 +#: ../../library/sys.rst:1792 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " "replaced with file-like objects like :class:`io.StringIO` which do not " -"support the :attr:!buffer` attribute." +"support the :attr:`!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1789 +#: ../../library/sys.rst:1802 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2302,7 +2320,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1794 +#: ../../library/sys.rst:1807 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2310,7 +2328,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1800 +#: ../../library/sys.rst:1813 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2318,12 +2336,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1808 +#: ../../library/sys.rst:1821 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1810 +#: ../../library/sys.rst:1823 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2331,7 +2349,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1815 +#: ../../library/sys.rst:1828 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2339,62 +2357,60 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1820 +#: ../../library/sys.rst:1833 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1827 +#: ../../library/sys.rst:1840 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1832 +#: ../../library/sys.rst:1845 msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1834 -#, fuzzy +#: ../../library/sys.rst:1847 msgid "``\"nt\"``: Windows threads" -msgstr "``'nt'``: Windows 執行緒" +msgstr "``\"nt\"``: Windows 執行緒" -#: ../../library/sys.rst:1835 -#, fuzzy +#: ../../library/sys.rst:1848 msgid "``\"pthread\"``: POSIX threads" -msgstr "``'pthread'``: POSIX 執行緒" +msgstr "``\"pthread\"``: POSIX 執行緒" -#: ../../library/sys.rst:1836 +#: ../../library/sys.rst:1849 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1838 +#: ../../library/sys.rst:1851 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1842 +#: ../../library/sys.rst:1855 msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1844 +#: ../../library/sys.rst:1857 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1845 +#: ../../library/sys.rst:1858 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1846 +#: ../../library/sys.rst:1859 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1850 +#: ../../library/sys.rst:1863 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: ../../library/sys.rst:1858 +#: ../../library/sys.rst:1871 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2403,73 +2419,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1866 +#: ../../library/sys.rst:1879 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1868 +#: ../../library/sys.rst:1881 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1872 +#: ../../library/sys.rst:1885 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1874 +#: ../../library/sys.rst:1887 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1875 +#: ../../library/sys.rst:1888 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1876 +#: ../../library/sys.rst:1889 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1877 +#: ../../library/sys.rst:1890 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1878 +#: ../../library/sys.rst:1891 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1880 +#: ../../library/sys.rst:1893 msgid "" "The default hook formats :attr:`!err_msg` and :attr:`!object` as: " "``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" "attr:`!err_msg` is ``None``." msgstr "" -#: ../../library/sys.rst:1884 +#: ../../library/sys.rst:1897 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1889 +#: ../../library/sys.rst:1902 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1893 +#: ../../library/sys.rst:1906 msgid "" "Storing :attr:`!exc_value` using a custom hook can create a reference cycle. " "It should be cleared explicitly to break the reference cycle when the " "exception is no longer needed." msgstr "" -#: ../../library/sys.rst:1897 +#: ../../library/sys.rst:1910 msgid "" "Storing :attr:`!object` using a custom hook can resurrect it if it is set to " "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1901 +#: ../../library/sys.rst:1914 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2478,7 +2494,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1903 +#: ../../library/sys.rst:1916 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2486,7 +2502,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1912 +#: ../../library/sys.rst:1925 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2495,13 +2511,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1921 +#: ../../library/sys.rst:1934 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1927 +#: ../../library/sys.rst:1940 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2512,18 +2528,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1935 +#: ../../library/sys.rst:1948 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1940 +#: ../../library/sys.rst:1953 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1947 +#: ../../library/sys.rst:1960 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2532,31 +2548,31 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1959 +#: ../../library/sys.rst:1972 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: ../../library/sys.rst:1965 +#: ../../library/sys.rst:1978 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1981 +#: ../../library/sys.rst:1994 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1989 +#: ../../library/sys.rst:2002 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1990 +#: ../../library/sys.rst:2003 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2569,59 +2585,59 @@ msgstr "" msgid "auditing" msgstr "" -#: ../../library/sys.rst:445 +#: ../../library/sys.rst:449 msgid "object" msgstr "object(物件)" -#: ../../library/sys.rst:445 +#: ../../library/sys.rst:449 msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:906 ../../library/sys.rst:1459 +#: ../../library/sys.rst:910 ../../library/sys.rst:1463 msgid "profile function" msgstr "" -#: ../../library/sys.rst:906 ../../library/sys.rst:1459 +#: ../../library/sys.rst:910 ../../library/sys.rst:1463 msgid "profiler" msgstr "" -#: ../../library/sys.rst:915 ../../library/sys.rst:1536 +#: ../../library/sys.rst:919 ../../library/sys.rst:1546 msgid "trace function" msgstr "" -#: ../../library/sys.rst:915 ../../library/sys.rst:1536 +#: ../../library/sys.rst:919 ../../library/sys.rst:1546 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1286 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1286 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1286 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "..." msgstr "..." diff --git a/library/syslog.po b/library/syslog.po index 40ab46dd77..fc9d6e877d 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,25 +30,16 @@ msgid "" msgstr "" #: ../../library/syslog.rst:14 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" + +#: ../../library/syslog.rst:16 msgid "" "This module wraps the system ``syslog`` family of routines. A pure Python " "library that can speak to a syslog server is available in the :mod:`logging." "handlers` module as :class:`SysLogHandler`." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" - #: ../../library/syslog.rst:20 msgid "The module defines the following functions:" msgstr "該模組定義了以下函式:" @@ -69,7 +60,7 @@ msgid "" "func:`openlog` will be called with no arguments." msgstr "" -#: ../../library/syslog.rst:47 +#: ../../library/syslog.rst:36 msgid "" "Raises an :ref:`auditing event ` ``syslog.syslog`` with arguments " "``priority``, ``message``." @@ -110,7 +101,7 @@ msgid "" "for messages which do not have a facility explicitly encoded." msgstr "" -#: ../../library/syslog.rst:75 +#: ../../library/syslog.rst:64 msgid "" "Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments " "``ident``, ``logoption``, ``facility``." @@ -145,7 +136,7 @@ msgid "" "`openlog` parameters are reset to defaults." msgstr "" -#: ../../library/syslog.rst:98 +#: ../../library/syslog.rst:87 msgid "" "Raises an :ref:`auditing event ` ``syslog.closelog`` with no " "arguments." @@ -162,7 +153,7 @@ msgid "" "and including *pri*." msgstr "" -#: ../../library/syslog.rst:117 +#: ../../library/syslog.rst:106 msgid "" "Raises an :ref:`auditing event ` ``syslog.setlogmask`` with " "argument ``maskpri``." @@ -229,3 +220,11 @@ msgid "" "in logged messages, and write the messages to the destination facility used " "for mail logging::" msgstr "" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/tempfile.po b/library/tempfile.po index a6b5b3d670..369a47297f 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -290,12 +290,14 @@ msgstr "新增 *delete_on_close* 參數。" msgid "" "This class operates exactly as :func:`TemporaryFile` does, except that data " "is spooled in memory until the file size exceeds *max_size*, or until the " -"file's :func:`fileno` method is called, at which point the contents are " -"written to disk and operation proceeds as with :func:`TemporaryFile`." +"file's :func:`~io.IOBase.fileno` method is called, at which point the " +"contents are written to disk and operation proceeds as with :func:" +"`TemporaryFile`." msgstr "" "此類別執行的操作與 :func:`TemporaryFile` 完全相同,但會將資料排存 (spool) 於" -"在記憶體中,直到檔案大小超過 *max_size*,或檔案的 :func:`fileno` 方法被呼叫為" -"止,此時資料會被寫入磁碟,並且之後的操作與 :func:`TemporaryFile` 相同。" +"在記憶體中,直到檔案大小超過 *max_size*,或檔案的 :func:`~io.IOBase.fileno` " +"方法被呼叫為止,此時資料會被寫入磁碟,並且之後的操作與 :func:`TemporaryFile` " +"相同。" #: ../../library/tempfile.rst:154 msgid "" diff --git a/library/termios.po b/library/termios.po index 481411f60f..9ddcd3bbdb 100644 --- a/library/termios.po +++ b/library/termios.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,13 +31,17 @@ msgid "" msgstr "" #: ../../library/termios.rst:19 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/termios.rst:21 msgid "" "All functions in this module take a file descriptor *fd* as their first " "argument. This can be an integer file descriptor, such as returned by ``sys." "stdin.fileno()``, or a :term:`file object`, such as ``sys.stdin`` itself." msgstr "" -#: ../../library/termios.rst:23 +#: ../../library/termios.rst:25 msgid "" "This module also defines all the constants needed to work with the functions " "provided here; these have the same name as their counterparts in C. Please " @@ -45,11 +49,11 @@ msgid "" "terminal control interfaces." msgstr "" -#: ../../library/termios.rst:28 +#: ../../library/termios.rst:30 msgid "The module defines the following functions:" msgstr "" -#: ../../library/termios.rst:33 +#: ../../library/termios.rst:35 msgid "" "Return a list containing the tty attributes for file descriptor *fd*, as " "follows: ``[iflag, oflag, cflag, lflag, ispeed, ospeed, cc]`` where *cc* is " @@ -60,49 +64,60 @@ msgid "" "constants defined in the :mod:`termios` module." msgstr "" -#: ../../library/termios.rst:44 +#: ../../library/termios.rst:46 msgid "" "Set the tty attributes for file descriptor *fd* from the *attributes*, which " "is a list like the one returned by :func:`tcgetattr`. The *when* argument " -"determines when the attributes are changed: :const:`TCSANOW` to change " -"immediately, :const:`TCSADRAIN` to change after transmitting all queued " -"output, or :const:`TCSAFLUSH` to change after transmitting all queued output " -"and discarding all queued input." +"determines when the attributes are changed:" +msgstr "" + +#: ../../library/termios.rst:52 +msgid "Change attributes immediately." +msgstr "" + +#: ../../library/termios.rst:56 +msgid "Change attributes after transmitting all queued output." +msgstr "" + +#: ../../library/termios.rst:60 +msgid "" +"Change attributes after transmitting all queued output and discarding all " +"queued input." msgstr "" -#: ../../library/termios.rst:54 +#: ../../library/termios.rst:66 msgid "" "Send a break on file descriptor *fd*. A zero *duration* sends a break for " "0.25--0.5 seconds; a nonzero *duration* has a system dependent meaning." msgstr "" -#: ../../library/termios.rst:60 +#: ../../library/termios.rst:72 msgid "" "Wait until all output written to file descriptor *fd* has been transmitted." msgstr "" -#: ../../library/termios.rst:65 +#: ../../library/termios.rst:77 msgid "" "Discard queued data on file descriptor *fd*. The *queue* selector specifies " "which queue: :const:`TCIFLUSH` for the input queue, :const:`TCOFLUSH` for " "the output queue, or :const:`TCIOFLUSH` for both queues." msgstr "" -#: ../../library/termios.rst:72 +#: ../../library/termios.rst:84 msgid "" "Suspend or resume input or output on file descriptor *fd*. The *action* " "argument can be :const:`TCOOFF` to suspend output, :const:`TCOON` to restart " "output, :const:`TCIOFF` to suspend input, or :const:`TCION` to restart input." msgstr "" -#: ../../library/termios.rst:79 +#: ../../library/termios.rst:91 msgid "" "Return a tuple ``(ws_row, ws_col)`` containing the tty window size for file " "descriptor *fd*. Requires :const:`termios.TIOCGWINSZ` or :const:`termios." "TIOCGSIZE`." msgstr "" -#: ../../library/termios.rst:88 +#: ../../library/termios.rst:100 msgid "" "Set the tty window size for file descriptor *fd* from *winsize*, which is a " "two-item tuple ``(ws_row, ws_col)`` like the one returned by :func:" @@ -111,19 +126,19 @@ msgid "" "const:`termios.TIOCSSIZE`) to be defined." msgstr "" -#: ../../library/termios.rst:99 +#: ../../library/termios.rst:111 msgid "Module :mod:`tty`" msgstr ":mod:`tty` 模組" -#: ../../library/termios.rst:100 +#: ../../library/termios.rst:112 msgid "Convenience functions for common terminal control operations." msgstr "" -#: ../../library/termios.rst:106 +#: ../../library/termios.rst:118 msgid "Example" msgstr "範例" -#: ../../library/termios.rst:108 +#: ../../library/termios.rst:120 msgid "" "Here's a function that prompts for a password with echoing turned off. Note " "the technique using a separate :func:`tcgetattr` call and a :keyword:" diff --git a/library/test.po b/library/test.po index 42104f34c1..30b923688b 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-30 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -558,115 +558,71 @@ msgid "" msgstr "" #: ../../library/test.rst:503 -msgid "" -"Determine whether *test* matches the patterns set in :func:`set_match_tests`." -msgstr "" - -#: ../../library/test.rst:508 -msgid "" -"Define match patterns on test filenames and test method names for filtering " -"tests." -msgstr "" - -#: ../../library/test.rst:513 -msgid "" -"Execute :class:`unittest.TestCase` subclasses passed to the function. The " -"function scans the classes for methods starting with the prefix ``test_`` " -"and executes the tests individually." -msgstr "" - -#: ../../library/test.rst:517 -msgid "" -"It is also legal to pass strings as parameters; these should be keys in " -"``sys.modules``. Each associated module will be scanned by ``unittest." -"TestLoader.loadTestsFromModule()``. This is usually seen in the following :" -"func:`test_main` function::" -msgstr "" - -#: ../../library/test.rst:525 -msgid "This will run all tests defined in the named module." -msgstr "" - -#: ../../library/test.rst:530 -msgid "" -"Run :func:`doctest.testmod` on the given *module*. Return ``(failure_count, " -"test_count)``." -msgstr "" - -#: ../../library/test.rst:533 -msgid "" -"If *verbosity* is ``None``, :func:`doctest.testmod` is run with verbosity " -"set to :data:`verbose`. Otherwise, it is run with verbosity set to " -"``None``. *optionflags* is passed as ``optionflags`` to :func:`doctest." -"testmod`." -msgstr "" - -#: ../../library/test.rst:541 msgid "Get size of a page in bytes." msgstr "" -#: ../../library/test.rst:548 +#: ../../library/test.rst:510 msgid "" "Set the :func:`sys.setswitchinterval` to the given *interval*. Defines a " "minimum interval for Android systems to prevent the system from hanging." msgstr "" -#: ../../library/test.rst:554 +#: ../../library/test.rst:516 msgid "" "Use this check to guard CPython's implementation-specific tests or to run " "them only on the implementations guarded by the arguments. This function " "returns ``True`` or ``False`` depending on the host platform. Example usage::" msgstr "" -#: ../../library/test.rst:566 +#: ../../library/test.rst:528 msgid "" "Set the values for :data:`max_memuse` and :data:`real_max_memuse` for big " "memory tests." msgstr "" -#: ../../library/test.rst:572 +#: ../../library/test.rst:534 msgid "" "Store the value from *stdout*. It is meant to hold the stdout at the time " "the regrtest began." msgstr "" -#: ../../library/test.rst:578 +#: ../../library/test.rst:540 msgid "" "Return the original stdout set by :func:`record_original_stdout` or ``sys." "stdout`` if it's not set." msgstr "" -#: ../../library/test.rst:584 +#: ../../library/test.rst:546 msgid "" "Return a list of command line arguments reproducing the current settings in " "``sys.flags`` and ``sys.warnoptions``." msgstr "" -#: ../../library/test.rst:590 +#: ../../library/test.rst:552 msgid "" "Return a list of command line arguments reproducing the current optimization " "settings in ``sys.flags``." msgstr "" -#: ../../library/test.rst:598 +#: ../../library/test.rst:560 msgid "" "A context managers that temporarily replaces the named stream with :class:" "`io.StringIO` object." msgstr "" -#: ../../library/test.rst:601 +#: ../../library/test.rst:563 msgid "Example use with output streams::" msgstr "" -#: ../../library/test.rst:609 +#: ../../library/test.rst:571 msgid "Example use with input stream::" msgstr "" -#: ../../library/test.rst:621 +#: ../../library/test.rst:583 msgid "A context manager that temporary disables :mod:`faulthandler`." msgstr "" -#: ../../library/test.rst:626 +#: ../../library/test.rst:588 msgid "" "Force as many objects as possible to be collected. This is needed because " "timely deallocation is not guaranteed by the garbage collector. This means " @@ -674,115 +630,115 @@ msgid "" "remain alive for longer than expected." msgstr "" -#: ../../library/test.rst:634 +#: ../../library/test.rst:596 msgid "" "A context manager that disables the garbage collector on entry. On exit, the " "garbage collector is restored to its prior state." msgstr "" -#: ../../library/test.rst:640 +#: ../../library/test.rst:602 msgid "Context manager to swap out an attribute with a new object." msgstr "" -#: ../../library/test.rst:642 ../../library/test.rst:660 -#: ../../library/test.rst:895 ../../library/test.rst:1361 +#: ../../library/test.rst:604 ../../library/test.rst:622 +#: ../../library/test.rst:857 ../../library/test.rst:1323 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/test.rst:647 +#: ../../library/test.rst:609 msgid "" "This will set ``obj.attr`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``attr`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:652 ../../library/test.rst:670 +#: ../../library/test.rst:614 ../../library/test.rst:632 msgid "" "The old value (or ``None`` if it doesn't exist) will be assigned to the " "target of the \"as\" clause, if there is one." msgstr "" -#: ../../library/test.rst:658 +#: ../../library/test.rst:620 msgid "Context manager to swap out an item with a new object." msgstr "" -#: ../../library/test.rst:665 +#: ../../library/test.rst:627 msgid "" "This will set ``obj[\"item\"]`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``item`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:676 +#: ../../library/test.rst:638 msgid "" "Call the ``flush()`` method on :data:`sys.stdout` and then on :data:`sys." "stderr`. It can be used to make sure that the logs order is consistent " "before writing into stderr." msgstr "" -#: ../../library/test.rst:685 +#: ../../library/test.rst:647 msgid "" "Print a warning into :data:`sys.__stderr__`. Format the message as: " "``f\"Warning -- {msg}\"``. If *msg* is made of multiple lines, add " "``\"Warning -- \"`` prefix to each line." msgstr "" -#: ../../library/test.rst:694 +#: ../../library/test.rst:656 msgid "" "Wait until process *pid* completes and check that the process exit code is " "*exitcode*." msgstr "" -#: ../../library/test.rst:697 +#: ../../library/test.rst:659 msgid "" "Raise an :exc:`AssertionError` if the process exit code is not equal to " "*exitcode*." msgstr "" -#: ../../library/test.rst:700 +#: ../../library/test.rst:662 msgid "" "If the process runs longer than *timeout* seconds (:data:`SHORT_TIMEOUT` by " "default), kill the process and raise an :exc:`AssertionError`. The timeout " "feature is not available on Windows." msgstr "" -#: ../../library/test.rst:709 +#: ../../library/test.rst:671 msgid "" "Return the size of the :c:type:`PyObject` whose structure members are " "defined by *fmt*. The returned value includes the size of the Python object " "header and alignment." msgstr "" -#: ../../library/test.rst:715 +#: ../../library/test.rst:677 msgid "" "Return the size of the :c:type:`PyVarObject` whose structure members are " "defined by *fmt*. The returned value includes the size of the Python object " "header and alignment." msgstr "" -#: ../../library/test.rst:721 +#: ../../library/test.rst:683 msgid "" "For testcase *test*, assert that the ``sys.getsizeof`` for *o* plus the GC " "header size equals *size*." msgstr "" -#: ../../library/test.rst:727 +#: ../../library/test.rst:689 msgid "" "A decorator to conditionally mark tests with :func:`unittest." "expectedFailure`. Any use of this decorator should have an associated " "comment identifying the relevant tracker issue." msgstr "" -#: ../../library/test.rst:734 +#: ../../library/test.rst:696 msgid "" "A decorator that skips the decorated test on TLS certification validation " "failures." msgstr "" -#: ../../library/test.rst:739 +#: ../../library/test.rst:701 msgid "" "A decorator for running a function in a different locale, correctly " "resetting it after it has finished. *catstr* is the locale category as a " @@ -790,79 +746,79 @@ msgid "" "sequentially, and the first valid locale will be used." msgstr "" -#: ../../library/test.rst:747 +#: ../../library/test.rst:709 msgid "" "A decorator for running a function in a specific timezone, correctly " "resetting it after it has finished." msgstr "" -#: ../../library/test.rst:753 +#: ../../library/test.rst:715 msgid "" "Decorator for the minimum version when running test on FreeBSD. If the " "FreeBSD version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:759 +#: ../../library/test.rst:721 msgid "" "Decorator for the minimum version when running test on Linux. If the Linux " "version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:765 +#: ../../library/test.rst:727 msgid "" "Decorator for the minimum version when running test on macOS. If the macOS " "version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:771 +#: ../../library/test.rst:733 msgid "Decorator for skipping tests on non-IEEE 754 platforms." msgstr "" -#: ../../library/test.rst:776 +#: ../../library/test.rst:738 msgid "Decorator for skipping tests if :mod:`zlib` doesn't exist." msgstr "" -#: ../../library/test.rst:781 +#: ../../library/test.rst:743 msgid "Decorator for skipping tests if :mod:`gzip` doesn't exist." msgstr "" -#: ../../library/test.rst:786 +#: ../../library/test.rst:748 msgid "Decorator for skipping tests if :mod:`bz2` doesn't exist." msgstr "" -#: ../../library/test.rst:791 +#: ../../library/test.rst:753 msgid "Decorator for skipping tests if :mod:`lzma` doesn't exist." msgstr "" -#: ../../library/test.rst:796 +#: ../../library/test.rst:758 msgid "Decorator for skipping tests if *resource* is not available." msgstr "" -#: ../../library/test.rst:801 +#: ../../library/test.rst:763 msgid "Decorator for only running the test if :data:`HAVE_DOCSTRINGS`." msgstr "" -#: ../../library/test.rst:806 +#: ../../library/test.rst:768 msgid "" "Decorator for only running the test if :ref:`Limited C API ` " "is available." msgstr "" -#: ../../library/test.rst:812 +#: ../../library/test.rst:774 msgid "Decorator for tests only applicable to CPython." msgstr "" -#: ../../library/test.rst:817 +#: ../../library/test.rst:779 msgid "" "Decorator for invoking :func:`check_impl_detail` on *guards*. If that " "returns ``False``, then uses *msg* as the reason for skipping the test." msgstr "" -#: ../../library/test.rst:823 +#: ../../library/test.rst:785 msgid "Decorator to temporarily turn off tracing for the duration of the test." msgstr "" -#: ../../library/test.rst:828 +#: ../../library/test.rst:790 msgid "" "Decorator for tests which involve reference counting. The decorator does " "not run the test if it is not run by CPython. Any trace function is unset " @@ -870,11 +826,11 @@ msgid "" "trace function." msgstr "" -#: ../../library/test.rst:836 +#: ../../library/test.rst:798 msgid "Decorator for bigmem tests." msgstr "" -#: ../../library/test.rst:838 +#: ../../library/test.rst:800 msgid "" "*size* is a requested size for the test (in arbitrary, test-interpreted " "units.) *memuse* is the number of bytes per unit for the test, or a good " @@ -882,7 +838,7 @@ msgid "" "each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``." msgstr "" -#: ../../library/test.rst:843 +#: ../../library/test.rst:805 msgid "" "The *size* argument is normally passed to the decorated test method as an " "extra argument. If *dry_run* is ``True``, the value passed to the test " @@ -890,11 +846,11 @@ msgid "" "means the test doesn't support dummy runs when ``-M`` is not specified." msgstr "" -#: ../../library/test.rst:851 +#: ../../library/test.rst:813 msgid "Decorator for tests that fill the address space." msgstr "" -#: ../../library/test.rst:856 +#: ../../library/test.rst:818 msgid "" "Test for syntax errors in *statement* by attempting to compile *statement*. " "*testcase* is the :mod:`unittest` instance for the test. *errtext* is the " @@ -904,44 +860,44 @@ msgid "" "of the exception." msgstr "" -#: ../../library/test.rst:866 +#: ../../library/test.rst:828 msgid "Open *url*. If open fails, raises :exc:`TestFailed`." msgstr "" -#: ../../library/test.rst:871 +#: ../../library/test.rst:833 msgid "" "Use this at the end of ``test_main`` whenever sub-processes are started. " "This will help ensure that no extra children (zombies) stick around to hog " "resources and create problems when looking for refleaks." msgstr "" -#: ../../library/test.rst:878 +#: ../../library/test.rst:840 msgid "" "Get an attribute, raising :exc:`unittest.SkipTest` if :exc:`AttributeError` " "is raised." msgstr "" -#: ../../library/test.rst:884 +#: ../../library/test.rst:846 msgid "" "Context manager catching unraisable exception using :func:`sys." "unraisablehook`." msgstr "" -#: ../../library/test.rst:887 +#: ../../library/test.rst:849 msgid "" "Storing the exception value (``cm.unraisable.exc_value``) creates a " "reference cycle. The reference cycle is broken explicitly when the context " "manager exits." msgstr "" -#: ../../library/test.rst:891 +#: ../../library/test.rst:853 msgid "" "Storing the object (``cm.unraisable.object``) can resurrect it if it is set " "to an object which is being finalized. Exiting the context manager clears " "the stored object." msgstr "" -#: ../../library/test.rst:912 +#: ../../library/test.rst:874 msgid "" "Generic implementation of the :mod:`unittest` ``load_tests`` protocol for " "use in test packages. *pkg_dir* is the root directory of the package; " @@ -950,55 +906,55 @@ msgid "" "the following::" msgstr "" -#: ../../library/test.rst:927 +#: ../../library/test.rst:889 msgid "" "Returns the set of attributes, functions or methods of *ref_api* not found " "on *other_api*, except for a defined list of items to be ignored in this " "check specified in *ignore*." msgstr "" -#: ../../library/test.rst:931 +#: ../../library/test.rst:893 msgid "" "By default this skips private attributes beginning with '_' but includes all " "magic methods, i.e. those starting and ending in '__'." msgstr "" -#: ../../library/test.rst:939 +#: ../../library/test.rst:901 msgid "" "Override *object_to_patch.attr_name* with *new_value*. Also add cleanup " "procedure to *test_instance* to restore *object_to_patch* for *attr_name*. " "The *attr_name* should be a valid attribute for *object_to_patch*." msgstr "" -#: ../../library/test.rst:947 +#: ../../library/test.rst:909 msgid "" "Run *code* in subinterpreter. Raise :exc:`unittest.SkipTest` if :mod:" "`tracemalloc` is enabled." msgstr "" -#: ../../library/test.rst:953 +#: ../../library/test.rst:915 msgid "Assert instances of *cls* are deallocated after iterating." msgstr "" -#: ../../library/test.rst:958 +#: ../../library/test.rst:920 msgid "" "Check for the existence of the compiler executables whose names are listed " "in *cmd_names* or all the compiler executables when *cmd_names* is empty and " "return the first missing executable or ``None`` when none is found missing." msgstr "" -#: ../../library/test.rst:966 +#: ../../library/test.rst:928 msgid "" "Assert that the ``__all__`` variable of *module* contains all public names." msgstr "" -#: ../../library/test.rst:968 +#: ../../library/test.rst:930 msgid "" "The module's public names (its API) are detected automatically based on " "whether they match the public name convention and were defined in *module*." msgstr "" -#: ../../library/test.rst:972 +#: ../../library/test.rst:934 msgid "" "The *name_of_module* argument can specify (as a string or tuple thereof) " "what module(s) an API could be defined in order to be detected as a public " @@ -1006,7 +962,7 @@ msgid "" "other modules, possibly a C backend (like ``csv`` and its ``_csv``)." msgstr "" -#: ../../library/test.rst:977 +#: ../../library/test.rst:939 msgid "" "The *extra* argument can be a set of names that wouldn't otherwise be " "automatically detected as \"public\", like objects without a proper " @@ -1014,31 +970,31 @@ msgid "" "detected ones." msgstr "" -#: ../../library/test.rst:981 +#: ../../library/test.rst:943 msgid "" "The *not_exported* argument can be a set of names that must not be treated " "as part of the public API even though their names indicate otherwise." msgstr "" -#: ../../library/test.rst:984 ../../library/test.rst:1610 +#: ../../library/test.rst:946 ../../library/test.rst:1572 msgid "Example use::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../library/test.rst:1007 +#: ../../library/test.rst:969 msgid "" "Skip tests if the :mod:`multiprocessing.synchronize` module is missing, if " "there is no available semaphore implementation, or if creating a lock raises " "an :exc:`OSError`." msgstr "" -#: ../../library/test.rst:1016 +#: ../../library/test.rst:978 msgid "Assert that type *tp* cannot be instantiated using *args* and *kwds*." msgstr "" -#: ../../library/test.rst:1023 +#: ../../library/test.rst:985 msgid "" "This function returns a context manager that will change the global :func:" "`sys.set_int_max_str_digits` setting for the duration of the context to " @@ -1046,72 +1002,73 @@ msgid "" "digits when converting between an integer and string." msgstr "" -#: ../../library/test.rst:1031 +#: ../../library/test.rst:993 msgid "The :mod:`test.support` module defines the following classes:" msgstr "" -#: ../../library/test.rst:1036 +#: ../../library/test.rst:998 msgid "" "A context manager used to try to prevent crash dialog popups on tests that " "are expected to crash a subprocess." msgstr "" -#: ../../library/test.rst:1039 +#: ../../library/test.rst:1001 msgid "" "On Windows, it disables Windows Error Reporting dialogs using `SetErrorMode " "`_." msgstr "" -#: ../../library/test.rst:1042 +#: ../../library/test.rst:1004 msgid "" "On UNIX, :func:`resource.setrlimit` is used to set :const:`resource." "RLIMIT_CORE`'s soft limit to 0 to prevent coredump file creation." msgstr "" -#: ../../library/test.rst:1046 -msgid "On both platforms, the old value is restored by :meth:`__exit__`." +#: ../../library/test.rst:1008 +msgid "" +"On both platforms, the old value is restored by :meth:`~object.__exit__`." msgstr "" -#: ../../library/test.rst:1051 +#: ../../library/test.rst:1013 msgid "" "Class to save and restore signal handlers registered by the Python signal " "handler." msgstr "" -#: ../../library/test.rst:1056 +#: ../../library/test.rst:1018 msgid "" "Save the signal handlers to a dictionary mapping signal numbers to the " "current signal handler." msgstr "" -#: ../../library/test.rst:1061 +#: ../../library/test.rst:1023 msgid "" "Set the signal numbers from the :meth:`save` dictionary to the saved handler." msgstr "" -#: ../../library/test.rst:1069 +#: ../../library/test.rst:1031 msgid "Try to match a single dict with the supplied arguments." msgstr "" -#: ../../library/test.rst:1074 +#: ../../library/test.rst:1036 msgid "Try to match a single stored value (*dv*) with a supplied value (*v*)." msgstr "" -#: ../../library/test.rst:1078 +#: ../../library/test.rst:1040 msgid ":mod:`test.support.socket_helper` --- Utilities for socket tests" msgstr "" -#: ../../library/test.rst:1084 +#: ../../library/test.rst:1046 msgid "" "The :mod:`test.support.socket_helper` module provides support for socket " "tests." msgstr "" -#: ../../library/test.rst:1091 +#: ../../library/test.rst:1053 msgid "Set to ``True`` if IPv6 is enabled on this host, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1096 +#: ../../library/test.rst:1058 msgid "" "Returns an unused port that should be suitable for binding. This is " "achieved by creating a temporary socket with the same family and type as the " @@ -1122,7 +1079,7 @@ msgid "" "port is returned." msgstr "" -#: ../../library/test.rst:1105 +#: ../../library/test.rst:1067 msgid "" "Either this method or :func:`bind_port` should be used for any tests where a " "server socket needs to be bound to a particular port for the duration of the " @@ -1135,7 +1092,7 @@ msgid "" "simultaneously, which is a problem for buildbots." msgstr "" -#: ../../library/test.rst:1119 +#: ../../library/test.rst:1081 msgid "" "Bind the socket to a free port and return the port number. Relies on " "ephemeral ports in order to ensure we are using an unbound port. This is " @@ -1148,7 +1105,7 @@ msgid "" "testing multicasting via multiple UDP sockets." msgstr "" -#: ../../library/test.rst:1130 +#: ../../library/test.rst:1092 msgid "" "Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is " "available (i.e. on Windows), it will be set on the socket. This will " @@ -1156,58 +1113,58 @@ msgid "" "test." msgstr "" -#: ../../library/test.rst:1138 +#: ../../library/test.rst:1100 msgid "" "Bind a Unix socket, raising :exc:`unittest.SkipTest` if :exc:" "`PermissionError` is raised." msgstr "" -#: ../../library/test.rst:1144 +#: ../../library/test.rst:1106 msgid "" "A decorator for running tests that require a functional ``bind()`` for Unix " "sockets." msgstr "" -#: ../../library/test.rst:1150 +#: ../../library/test.rst:1112 msgid "" "A context manager that raises :exc:`~test.support.ResourceDenied` when " "various issues with the internet connection manifest themselves as " "exceptions." msgstr "" -#: ../../library/test.rst:1156 +#: ../../library/test.rst:1118 msgid "" ":mod:`test.support.script_helper` --- Utilities for the Python execution " "tests" msgstr "" -#: ../../library/test.rst:1162 +#: ../../library/test.rst:1124 msgid "" "The :mod:`test.support.script_helper` module provides support for Python's " "script execution tests." msgstr "" -#: ../../library/test.rst:1167 +#: ../../library/test.rst:1129 msgid "" "Return ``True`` if ``sys.executable interpreter`` requires environment " "variables in order to be able to run at all." msgstr "" -#: ../../library/test.rst:1170 +#: ../../library/test.rst:1132 msgid "" "This is designed to be used with ``@unittest.skipIf()`` to annotate tests " "that need to use an ``assert_python*()`` function to launch an isolated mode " "(``-I``) or no environment mode (``-E``) sub-interpreter process." msgstr "" -#: ../../library/test.rst:1174 +#: ../../library/test.rst:1136 msgid "" "A normal build & test does not run into this situation but it can happen " "when trying to run the standard library test suite from an interpreter that " "doesn't have an obvious home with Python's current home finding logic." msgstr "" -#: ../../library/test.rst:1178 +#: ../../library/test.rst:1140 msgid "" "Setting :envvar:`PYTHONHOME` is one way to get most of the testsuite to run " "in that situation. :envvar:`PYTHONPATH` or :envvar:`PYTHONUSERSITE` are " @@ -1215,85 +1172,85 @@ msgid "" "interpreter can start." msgstr "" -#: ../../library/test.rst:1186 +#: ../../library/test.rst:1148 msgid "" "Set up the environment based on *env_vars* for running the interpreter in a " "subprocess. The values can include ``__isolated``, ``__cleanenv``, " "``__cwd``, and ``TERM``." msgstr "" -#: ../../library/test.rst:1190 ../../library/test.rst:1206 -#: ../../library/test.rst:1218 +#: ../../library/test.rst:1152 ../../library/test.rst:1168 +#: ../../library/test.rst:1180 msgid "The function no longer strips whitespaces from *stderr*." msgstr "" -#: ../../library/test.rst:1196 +#: ../../library/test.rst:1158 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1200 +#: ../../library/test.rst:1162 msgid "" "If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a " "fresh environment." msgstr "" -#: ../../library/test.rst:1203 +#: ../../library/test.rst:1165 msgid "" "Python is started in isolated mode (command line option ``-I``), except if " "the *__isolated* keyword-only parameter is set to ``False``." msgstr "" -#: ../../library/test.rst:1212 +#: ../../library/test.rst:1174 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* fails (``rc != 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1216 +#: ../../library/test.rst:1178 msgid "See :func:`assert_python_ok` for more options." msgstr "更多選項請見 :func:`assert_python_ok`\\ 。" -#: ../../library/test.rst:1224 +#: ../../library/test.rst:1186 msgid "Run a Python subprocess with the given arguments." msgstr "" -#: ../../library/test.rst:1226 +#: ../../library/test.rst:1188 msgid "" "*kw* is extra keyword args to pass to :func:`subprocess.Popen`. Returns a :" "class:`subprocess.Popen` object." msgstr "" -#: ../../library/test.rst:1232 +#: ../../library/test.rst:1194 msgid "" "Run the given :class:`subprocess.Popen` process until completion and return " "stdout." msgstr "" -#: ../../library/test.rst:1238 +#: ../../library/test.rst:1200 msgid "" "Create script containing *source* in path *script_dir* and " "*script_basename*. If *omit_suffix* is ``False``, append ``.py`` to the " "name. Return the full script path." msgstr "" -#: ../../library/test.rst:1245 +#: ../../library/test.rst:1207 msgid "" "Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which " "contains the files in *script_name*. *name_in_zip* is the archive name. " "Return a tuple containing ``(full path, full path of archive name)``." msgstr "" -#: ../../library/test.rst:1252 +#: ../../library/test.rst:1214 msgid "" "Create a directory named *pkg_dir* containing an ``__init__`` file with " "*init_source* as its contents." msgstr "" -#: ../../library/test.rst:1259 +#: ../../library/test.rst:1221 msgid "" "Create a zip package directory with a path of *zip_dir* and *zip_basename* " "containing an empty ``__init__`` file and a file *script_basename* " @@ -1302,60 +1259,60 @@ msgid "" "path and the archive name for the zip file." msgstr "" -#: ../../library/test.rst:1267 +#: ../../library/test.rst:1229 msgid "" ":mod:`test.support.bytecode_helper` --- Support tools for testing correct " "bytecode generation" msgstr "" -#: ../../library/test.rst:1272 +#: ../../library/test.rst:1234 msgid "" "The :mod:`test.support.bytecode_helper` module provides support for testing " "and inspecting bytecode generation." msgstr "" -#: ../../library/test.rst:1277 +#: ../../library/test.rst:1239 msgid "The module defines the following class:" msgstr "" -#: ../../library/test.rst:1281 +#: ../../library/test.rst:1243 msgid "This class has custom assertion methods for inspecting bytecode." msgstr "" -#: ../../library/test.rst:1285 +#: ../../library/test.rst:1247 msgid "Return the disassembly of *co* as string." msgstr "" -#: ../../library/test.rst:1290 +#: ../../library/test.rst:1252 msgid "" "Return instr if *opname* is found, otherwise throws :exc:`AssertionError`." msgstr "" -#: ../../library/test.rst:1295 +#: ../../library/test.rst:1257 msgid "Throws :exc:`AssertionError` if *opname* is found." msgstr "" -#: ../../library/test.rst:1299 +#: ../../library/test.rst:1261 msgid ":mod:`test.support.threading_helper` --- Utilities for threading tests" msgstr "" -#: ../../library/test.rst:1304 +#: ../../library/test.rst:1266 msgid "" "The :mod:`test.support.threading_helper` module provides support for " "threading tests." msgstr "" -#: ../../library/test.rst:1311 +#: ../../library/test.rst:1273 msgid "" "Join a *thread* within *timeout*. Raise an :exc:`AssertionError` if thread " "is still alive after *timeout* seconds." msgstr "" -#: ../../library/test.rst:1317 +#: ../../library/test.rst:1279 msgid "Decorator to ensure the threads are cleaned up even if the test fails." msgstr "" -#: ../../library/test.rst:1322 +#: ../../library/test.rst:1284 msgid "" "Context manager to start *threads*, which is a sequence of threads. *unlock* " "is a function called after the threads are started, even if an exception was " @@ -1363,79 +1320,79 @@ msgid "" "will attempt to join the started threads upon exit." msgstr "" -#: ../../library/test.rst:1330 +#: ../../library/test.rst:1292 msgid "" "Cleanup up threads not specified in *original_values*. Designed to emit a " "warning if a test leaves running threads in the background." msgstr "" -#: ../../library/test.rst:1336 +#: ../../library/test.rst:1298 msgid "Return current thread count and copy of dangling threads." msgstr "" -#: ../../library/test.rst:1341 +#: ../../library/test.rst:1303 msgid "" "Context manager to wait until all threads created in the ``with`` statement " "exit." msgstr "" -#: ../../library/test.rst:1347 +#: ../../library/test.rst:1309 msgid "" "Context manager catching :class:`threading.Thread` exception using :func:" "`threading.excepthook`." msgstr "" -#: ../../library/test.rst:1350 +#: ../../library/test.rst:1312 msgid "Attributes set when an exception is caught:" msgstr "" -#: ../../library/test.rst:1352 +#: ../../library/test.rst:1314 msgid "``exc_type``" msgstr "``exc_type``" -#: ../../library/test.rst:1353 +#: ../../library/test.rst:1315 msgid "``exc_value``" msgstr "``exc_value``" -#: ../../library/test.rst:1354 +#: ../../library/test.rst:1316 msgid "``exc_traceback``" msgstr "``exc_traceback``" -#: ../../library/test.rst:1355 +#: ../../library/test.rst:1317 msgid "``thread``" msgstr "``thread``" -#: ../../library/test.rst:1357 +#: ../../library/test.rst:1319 msgid "See :func:`threading.excepthook` documentation." msgstr "參閱 :func:`threading.excepthook` 文件。" -#: ../../library/test.rst:1359 +#: ../../library/test.rst:1321 msgid "These attributes are deleted at the context manager exit." msgstr "" -#: ../../library/test.rst:1379 +#: ../../library/test.rst:1341 msgid ":mod:`test.support.os_helper` --- Utilities for os tests" msgstr "" -#: ../../library/test.rst:1384 +#: ../../library/test.rst:1346 msgid "The :mod:`test.support.os_helper` module provides support for os tests." msgstr "" -#: ../../library/test.rst:1391 +#: ../../library/test.rst:1353 msgid "A non-ASCII character encodable by :func:`os.fsencode`." msgstr "" -#: ../../library/test.rst:1396 +#: ../../library/test.rst:1358 msgid "Set to :func:`os.getcwd`." msgstr "" -#: ../../library/test.rst:1401 +#: ../../library/test.rst:1363 msgid "" "Set to a name that is safe to use as the name of a temporary file. Any " "temporary file that is created should be closed and unlinked (removed)." msgstr "" -#: ../../library/test.rst:1407 +#: ../../library/test.rst:1369 msgid "" "Set to a filename containing the :data:`FS_NONASCII` character, if it " "exists. This guarantees that if the filename exists, it can be encoded and " @@ -1443,25 +1400,25 @@ msgid "" "a non-ASCII filename to be easily skipped on platforms where they can't work." msgstr "" -#: ../../library/test.rst:1415 +#: ../../library/test.rst:1377 msgid "" "Set to a filename (str type) that should not be able to be encoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1422 +#: ../../library/test.rst:1384 msgid "" "Set to a filename (bytes type) that should not be able to be decoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1429 +#: ../../library/test.rst:1391 msgid "Set to a non-ASCII name for a temporary file." msgstr "" -#: ../../library/test.rst:1434 +#: ../../library/test.rst:1396 msgid "" "Class used to temporarily set or unset environment variables. Instances can " "be used as a context manager and have a complete dictionary interface for " @@ -1470,75 +1427,75 @@ msgid "" "instance will be rolled back." msgstr "" -#: ../../library/test.rst:1440 +#: ../../library/test.rst:1402 msgid "Added dictionary interface." msgstr "新增字典介面。" -#: ../../library/test.rst:1446 +#: ../../library/test.rst:1408 msgid "" "Simple :term:`path-like object`. It implements the :meth:`__fspath__` " "method which just returns the *path* argument. If *path* is an exception, " "it will be raised in :meth:`!__fspath__`." msgstr "" -#: ../../library/test.rst:1453 +#: ../../library/test.rst:1415 msgid "" "Temporarily set the environment variable ``envvar`` to the value of " "``value``." msgstr "" -#: ../../library/test.rst:1459 +#: ../../library/test.rst:1421 msgid "Temporarily unset the environment variable ``envvar``." msgstr "" -#: ../../library/test.rst:1464 +#: ../../library/test.rst:1426 msgid "Return ``True`` if the OS supports symbolic links, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1470 +#: ../../library/test.rst:1432 msgid "Return ``True`` if the OS supports xattr, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1476 +#: ../../library/test.rst:1438 msgid "" "A context manager that temporarily changes the current working directory to " "*path* and yields the directory." msgstr "" -#: ../../library/test.rst:1479 +#: ../../library/test.rst:1441 msgid "" "If *quiet* is ``False``, the context manager raises an exception on error. " "Otherwise, it issues only a warning and keeps the current working directory " "the same." msgstr "" -#: ../../library/test.rst:1486 +#: ../../library/test.rst:1448 msgid "" "Create an empty file with *filename*. If it already exists, truncate it." msgstr "" -#: ../../library/test.rst:1491 +#: ../../library/test.rst:1453 msgid "Count the number of open file descriptors." msgstr "" -#: ../../library/test.rst:1496 +#: ../../library/test.rst:1458 msgid "Return ``True`` if the file system for *directory* is case-insensitive." msgstr "" -#: ../../library/test.rst:1501 +#: ../../library/test.rst:1463 msgid "" "Create an invalid file descriptor by opening and closing a temporary file, " "and returning its descriptor." msgstr "" -#: ../../library/test.rst:1507 +#: ../../library/test.rst:1469 msgid "" "Call :func:`os.rmdir` on *filename*. On Windows platforms, this is wrapped " "with a wait loop that checks for the existence of the file, which is needed " "due to antivirus programs that can hold files open and prevent deletion." msgstr "" -#: ../../library/test.rst:1515 +#: ../../library/test.rst:1477 msgid "" "Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and :func:`os." "rmdir` to remove a path and its contents. As with :func:`rmdir`, on Windows " @@ -1546,21 +1503,21 @@ msgid "" "the files." msgstr "" -#: ../../library/test.rst:1523 +#: ../../library/test.rst:1485 msgid "A decorator for running tests that require support for symbolic links." msgstr "" -#: ../../library/test.rst:1528 +#: ../../library/test.rst:1490 msgid "A decorator for running tests that require support for xattr." msgstr "" -#: ../../library/test.rst:1533 +#: ../../library/test.rst:1495 msgid "" "A context manager that temporarily creates a new directory and changes the " "current working directory (CWD)." msgstr "" -#: ../../library/test.rst:1536 +#: ../../library/test.rst:1498 msgid "" "The context manager creates a temporary directory in the current directory " "with name *name* before temporarily changing the current working directory. " @@ -1568,20 +1525,20 @@ msgid "" "`tempfile.mkdtemp`." msgstr "" -#: ../../library/test.rst:1541 +#: ../../library/test.rst:1503 msgid "" "If *quiet* is ``False`` and it is not possible to create or change the CWD, " "an error is raised. Otherwise, only a warning is raised and the original " "CWD is used." msgstr "" -#: ../../library/test.rst:1548 +#: ../../library/test.rst:1510 msgid "" "A context manager that creates a temporary directory at *path* and yields " "the directory." msgstr "" -#: ../../library/test.rst:1551 +#: ../../library/test.rst:1513 msgid "" "If *path* is ``None``, the temporary directory is created using :func:" "`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager raises an " @@ -1589,34 +1546,34 @@ msgid "" "created, only a warning is issued." msgstr "" -#: ../../library/test.rst:1559 +#: ../../library/test.rst:1521 msgid "A context manager that temporarily sets the process umask." msgstr "" -#: ../../library/test.rst:1564 +#: ../../library/test.rst:1526 msgid "" "Call :func:`os.unlink` on *filename*. As with :func:`rmdir`, on Windows " "platforms, this is wrapped with a wait loop that checks for the existence of " "the file." msgstr "" -#: ../../library/test.rst:1570 +#: ../../library/test.rst:1532 msgid ":mod:`test.support.import_helper` --- Utilities for import tests" msgstr "" -#: ../../library/test.rst:1575 +#: ../../library/test.rst:1537 msgid "" "The :mod:`test.support.import_helper` module provides support for import " "tests." msgstr "" -#: ../../library/test.rst:1582 +#: ../../library/test.rst:1544 msgid "" "Remove the module named *module_name* from ``sys.modules`` and delete any " "byte-compiled files of the module." msgstr "" -#: ../../library/test.rst:1588 +#: ../../library/test.rst:1550 msgid "" "This function imports and returns a fresh copy of the named Python module by " "removing the named module from ``sys.modules`` before doing the import. Note " @@ -1624,46 +1581,46 @@ msgid "" "operation." msgstr "" -#: ../../library/test.rst:1593 +#: ../../library/test.rst:1555 msgid "" "*fresh* is an iterable of additional module names that are also removed from " "the ``sys.modules`` cache before doing the import." msgstr "" -#: ../../library/test.rst:1596 +#: ../../library/test.rst:1558 msgid "" "*blocked* is an iterable of module names that are replaced with ``None`` in " "the module cache during the import to ensure that attempts to import them " "raise :exc:`ImportError`." msgstr "" -#: ../../library/test.rst:1600 +#: ../../library/test.rst:1562 msgid "" "The named module and any modules named in the *fresh* and *blocked* " "parameters are saved before starting the import and then reinserted into " "``sys.modules`` when the fresh import is complete." msgstr "" -#: ../../library/test.rst:1604 +#: ../../library/test.rst:1566 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``." msgstr "" -#: ../../library/test.rst:1607 +#: ../../library/test.rst:1569 msgid "" "This function will raise :exc:`ImportError` if the named module cannot be " "imported." msgstr "" -#: ../../library/test.rst:1624 +#: ../../library/test.rst:1586 msgid "" "This function imports and returns the named module. Unlike a normal import, " "this function raises :exc:`unittest.SkipTest` if the module cannot be " "imported." msgstr "" -#: ../../library/test.rst:1628 +#: ../../library/test.rst:1590 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``. If a module is required on a platform but " @@ -1671,21 +1628,21 @@ msgid "" "which will be compared against :data:`sys.platform`." msgstr "" -#: ../../library/test.rst:1638 +#: ../../library/test.rst:1600 msgid "Return a copy of :data:`sys.modules`." msgstr "" -#: ../../library/test.rst:1643 +#: ../../library/test.rst:1605 msgid "" "Remove modules except for *oldmodules* and ``encodings`` in order to " "preserve internal cache." msgstr "" -#: ../../library/test.rst:1649 +#: ../../library/test.rst:1611 msgid "Delete *name* from ``sys.modules``." msgstr "" -#: ../../library/test.rst:1654 +#: ../../library/test.rst:1616 msgid "" "Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return " "the file system path to the legacy pyc file. The *source* value is the file " @@ -1693,42 +1650,42 @@ msgid "" "3147/488 pyc file must exist." msgstr "" -#: ../../library/test.rst:1662 +#: ../../library/test.rst:1624 msgid "" "A context manager to force import to return a new module reference. This is " "useful for testing module-level behaviors, such as the emission of a :exc:" "`DeprecationWarning` on import. Example usage::" msgstr "" -#: ../../library/test.rst:1672 +#: ../../library/test.rst:1634 msgid "A context manager to temporarily add directories to :data:`sys.path`." msgstr "" -#: ../../library/test.rst:1674 +#: ../../library/test.rst:1636 msgid "" "This makes a copy of :data:`sys.path`, appends any directories given as " "positional arguments, then reverts :data:`sys.path` to the copied settings " "when the context ends." msgstr "" -#: ../../library/test.rst:1678 +#: ../../library/test.rst:1640 msgid "" "Note that *all* :data:`sys.path` modifications in the body of the context " "manager, including replacement of the object, will be reverted at the end of " "the block." msgstr "" -#: ../../library/test.rst:1684 +#: ../../library/test.rst:1646 msgid ":mod:`test.support.warnings_helper` --- Utilities for warnings tests" msgstr "" -#: ../../library/test.rst:1689 +#: ../../library/test.rst:1651 msgid "" "The :mod:`test.support.warnings_helper` module provides support for warnings " "tests." msgstr "" -#: ../../library/test.rst:1696 +#: ../../library/test.rst:1658 msgid "" "Suppress warnings that are instances of *category*, which must be :exc:" "`Warning` or a subclass. Roughly equivalent to :func:`warnings." @@ -1736,14 +1693,14 @@ msgid "" "category=category) `. For example::" msgstr "" -#: ../../library/test.rst:1711 +#: ../../library/test.rst:1673 msgid "" "Context manager to check that no :exc:`ResourceWarning` was raised. You " "must remove the object which may emit :exc:`ResourceWarning` before the end " "of the context manager." msgstr "" -#: ../../library/test.rst:1718 +#: ../../library/test.rst:1680 msgid "" "Test for syntax warning in *statement* by attempting to compile *statement*. " "Test also that the :exc:`SyntaxWarning` is emitted only once, and that it " @@ -1755,7 +1712,7 @@ msgid "" "``None``, compares to the offset of the exception." msgstr "" -#: ../../library/test.rst:1732 +#: ../../library/test.rst:1694 msgid "" "A convenience wrapper for :func:`warnings.catch_warnings()` that makes it " "easier to test that a warning was correctly raised. It is approximately " @@ -1764,7 +1721,7 @@ msgid "" "automatically validate the results that are recorded." msgstr "" -#: ../../library/test.rst:1738 +#: ../../library/test.rst:1700 msgid "" "``check_warnings`` accepts 2-tuples of the form ``(\"message regexp\", " "WarningCategory)`` as positional arguments. If one or more *filters* are " @@ -1776,15 +1733,15 @@ msgid "" "*quiet* to ``True``." msgstr "" -#: ../../library/test.rst:1747 +#: ../../library/test.rst:1709 msgid "If no arguments are specified, it defaults to::" msgstr "" -#: ../../library/test.rst:1751 +#: ../../library/test.rst:1713 msgid "In this case all warnings are caught and no errors are raised." msgstr "" -#: ../../library/test.rst:1753 +#: ../../library/test.rst:1715 msgid "" "On entry to the context manager, a :class:`WarningRecorder` instance is " "returned. The underlying warnings list from :func:`~warnings.catch_warnings` " @@ -1796,39 +1753,39 @@ msgid "" "return ``None``." msgstr "" -#: ../../library/test.rst:1762 +#: ../../library/test.rst:1724 msgid "" "The recorder object also has a :meth:`reset` method, which clears the " "warnings list." msgstr "" -#: ../../library/test.rst:1765 +#: ../../library/test.rst:1727 msgid "The context manager is designed to be used like this::" msgstr "" -#: ../../library/test.rst:1772 +#: ../../library/test.rst:1734 msgid "" "In this case if either warning was not raised, or some other warning was " "raised, :func:`check_warnings` would raise an error." msgstr "" -#: ../../library/test.rst:1775 +#: ../../library/test.rst:1737 msgid "" "When a test needs to look more deeply into the warnings, rather than just " "checking whether or not they occurred, code like this can be used::" msgstr "" -#: ../../library/test.rst:1789 +#: ../../library/test.rst:1751 msgid "" "Here all warnings will be caught, and the test code tests the captured " "warnings directly." msgstr "" -#: ../../library/test.rst:1792 +#: ../../library/test.rst:1754 msgid "New optional arguments *filters* and *quiet*." msgstr "" -#: ../../library/test.rst:1798 +#: ../../library/test.rst:1760 msgid "" "Class used to record warnings for unit tests. See documentation of :func:" "`check_warnings` above for more details." diff --git a/library/time.po b/library/time.po index 994feb6c80..a1e21ae69a 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-14 15:34+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -97,9 +97,9 @@ msgid "" "On the other hand, the precision of :func:`.time` and :func:`sleep` is " "better than their Unix equivalents: times are expressed as floating point " "numbers, :func:`.time` returns the most accurate time available (using Unix :" -"c:func:`gettimeofday` where available), and :func:`sleep` will accept a time " -"with a nonzero fraction (Unix :c:func:`select` is used to implement this, " -"where available)." +"c:func:`!gettimeofday` where available), and :func:`sleep` will accept a " +"time with a nonzero fraction (Unix :c:func:`!select` is used to implement " +"this, where available)." msgstr "" #: ../../library/time.rst:78 @@ -117,68 +117,68 @@ msgstr "關於這些物件的敘述請見 :class:`struct_time`\\ 。" #: ../../library/time.rst:86 msgid "" -"The :class:`struct_time` type was extended to provide the :attr:`tm_gmtoff` " -"and :attr:`tm_zone` attributes when platform supports corresponding ``struct " -"tm`` members." +"The :class:`struct_time` type was extended to provide the :attr:" +"`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` attributes when " +"platform supports corresponding ``struct tm`` members." msgstr "" -#: ../../library/time.rst:91 +#: ../../library/time.rst:92 msgid "" -"The :class:`struct_time` attributes :attr:`tm_gmtoff` and :attr:`tm_zone` " -"are now available on all platforms." +"The :class:`struct_time` attributes :attr:`~struct_time.tm_gmtoff` and :attr:" +"`~struct_time.tm_zone` are now available on all platforms." msgstr "" -#: ../../library/time.rst:95 +#: ../../library/time.rst:97 msgid "Use the following functions to convert between time representations:" msgstr "" -#: ../../library/time.rst:98 +#: ../../library/time.rst:100 msgid "From" msgstr "" -#: ../../library/time.rst:98 +#: ../../library/time.rst:100 msgid "To" msgstr "" -#: ../../library/time.rst:98 +#: ../../library/time.rst:100 msgid "Use" msgstr "" -#: ../../library/time.rst:29 ../../library/time.rst:100 -#: ../../library/time.rst:103 ../../library/time.rst:106 -#: ../../library/time.rst:109 +#: ../../library/time.rst:29 ../../library/time.rst:102 +#: ../../library/time.rst:105 ../../library/time.rst:108 +#: ../../library/time.rst:111 msgid "seconds since the epoch" msgstr "" -#: ../../library/time.rst:100 ../../library/time.rst:106 +#: ../../library/time.rst:102 ../../library/time.rst:108 msgid ":class:`struct_time` in UTC" msgstr "" -#: ../../library/time.rst:100 +#: ../../library/time.rst:102 msgid ":func:`gmtime`" msgstr ":func:`gmtime`" -#: ../../library/time.rst:103 ../../library/time.rst:109 +#: ../../library/time.rst:105 ../../library/time.rst:111 msgid ":class:`struct_time` in local time" msgstr "" -#: ../../library/time.rst:103 +#: ../../library/time.rst:105 msgid ":func:`localtime`" msgstr ":func:`localtime`" -#: ../../library/time.rst:106 +#: ../../library/time.rst:108 msgid ":func:`calendar.timegm`" msgstr ":func:`calendar.timegm`" -#: ../../library/time.rst:109 +#: ../../library/time.rst:111 msgid ":func:`mktime`" msgstr ":func:`mktime`" -#: ../../library/time.rst:117 +#: ../../library/time.rst:119 msgid "Functions" msgstr "函式" -#: ../../library/time.rst:121 +#: ../../library/time.rst:123 msgid "" "Convert a tuple or :class:`struct_time` representing a time as returned by :" "func:`gmtime` or :func:`localtime` to a string of the following form: ``'Sun " @@ -186,94 +186,94 @@ msgid "" "padded if the day is a single digit, e.g.: ``'Wed Jun 9 04:26:40 1993'``." msgstr "" -#: ../../library/time.rst:127 +#: ../../library/time.rst:129 msgid "" "If *t* is not provided, the current time as returned by :func:`localtime` is " "used. Locale information is not used by :func:`asctime`." msgstr "" -#: ../../library/time.rst:132 +#: ../../library/time.rst:134 msgid "" "Unlike the C function of the same name, :func:`asctime` does not add a " "trailing newline." msgstr "" -#: ../../library/time.rst:137 +#: ../../library/time.rst:139 msgid "" "Return the *clk_id* of the thread-specific CPU-time clock for the specified " "*thread_id*." msgstr "" -#: ../../library/time.rst:139 +#: ../../library/time.rst:141 msgid "" "Use :func:`threading.get_ident` or the :attr:`~threading.Thread.ident` " "attribute of :class:`threading.Thread` objects to get a suitable value for " "*thread_id*." msgstr "" -#: ../../library/time.rst:144 +#: ../../library/time.rst:146 msgid "" "Passing an invalid or expired *thread_id* may result in undefined behavior, " "such as segmentation fault." msgstr "" -#: ../../library/time.rst:147 +#: ../../library/time.rst:149 msgid ":ref:`Availability `: Unix" msgstr ":ref:`適用 `:Unix" -#: ../../library/time.rst:149 +#: ../../library/time.rst:151 msgid "" "See the man page for :manpage:`pthread_getcpuclockid(3)` for further " "information." msgstr "" -#: ../../library/time.rst:156 +#: ../../library/time.rst:158 msgid "" "Return the resolution (precision) of the specified clock *clk_id*. Refer " "to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*." msgstr "" -#: ../../library/time.rst:159 ../../library/time.rst:172 -#: ../../library/time.rst:181 ../../library/time.rst:194 -#: ../../library/time.rst:203 ../../library/time.rst:680 -#: ../../library/time.rst:797 ../../library/time.rst:816 -#: ../../library/time.rst:844 ../../library/time.rst:879 +#: ../../library/time.rst:161 ../../library/time.rst:174 +#: ../../library/time.rst:183 ../../library/time.rst:196 +#: ../../library/time.rst:205 ../../library/time.rst:707 +#: ../../library/time.rst:824 ../../library/time.rst:843 +#: ../../library/time.rst:871 ../../library/time.rst:906 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/time.rst:166 +#: ../../library/time.rst:168 msgid "" "Return the time of the specified clock *clk_id*. Refer to :ref:`time-clock-" "id-constants` for a list of accepted values for *clk_id*." msgstr "" -#: ../../library/time.rst:169 +#: ../../library/time.rst:171 msgid "" "Use :func:`clock_gettime_ns` to avoid the precision loss caused by the :" "class:`float` type." msgstr "" -#: ../../library/time.rst:179 +#: ../../library/time.rst:181 msgid "Similar to :func:`clock_gettime` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:188 +#: ../../library/time.rst:190 msgid "" "Set the time of the specified clock *clk_id*. Currently, :data:" "`CLOCK_REALTIME` is the only accepted value for *clk_id*." msgstr "" -#: ../../library/time.rst:191 +#: ../../library/time.rst:193 msgid "" "Use :func:`clock_settime_ns` to avoid the precision loss caused by the :" "class:`float` type." msgstr "" -#: ../../library/time.rst:201 +#: ../../library/time.rst:203 msgid "Similar to :func:`clock_settime` but set time with nanoseconds." msgstr "" -#: ../../library/time.rst:210 +#: ../../library/time.rst:212 msgid "" "Convert a time expressed in seconds since the epoch_ to a string of a form: " "``'Sun Jun 20 23:21:05 1993'`` representing local time. The day field is two " @@ -281,7 +281,7 @@ msgid "" "``'Wed Jun 9 04:26:40 1993'``." msgstr "" -#: ../../library/time.rst:215 +#: ../../library/time.rst:217 msgid "" "If *secs* is not provided or :const:`None`, the current time as returned by :" "func:`.time` is used. ``ctime(secs)`` is equivalent to " @@ -289,58 +289,58 @@ msgid "" "`ctime`." msgstr "" -#: ../../library/time.rst:223 +#: ../../library/time.rst:225 msgid "" "Get information on the specified clock as a namespace object. Supported " "clock names and the corresponding functions to read their value are:" msgstr "" -#: ../../library/time.rst:227 +#: ../../library/time.rst:229 msgid "``'monotonic'``: :func:`time.monotonic`" msgstr "``'monotonic'``\\ :\\ :func:`time.monotonic`" -#: ../../library/time.rst:228 +#: ../../library/time.rst:230 msgid "``'perf_counter'``: :func:`time.perf_counter`" msgstr "``'perf_counter'``\\ :\\ :func:`time.perf_counter`" -#: ../../library/time.rst:229 +#: ../../library/time.rst:231 msgid "``'process_time'``: :func:`time.process_time`" msgstr "``'process_time'``\\ :\\ :func:`time.process_time`" -#: ../../library/time.rst:230 +#: ../../library/time.rst:232 msgid "``'thread_time'``: :func:`time.thread_time`" msgstr "``'thread_time'``\\ :\\ :func:`time.thread_time`" -#: ../../library/time.rst:231 +#: ../../library/time.rst:233 msgid "``'time'``: :func:`time.time`" msgstr "``'time'``\\ :\\ :func:`time.time`" -#: ../../library/time.rst:233 +#: ../../library/time.rst:235 msgid "The result has the following attributes:" msgstr "" -#: ../../library/time.rst:235 +#: ../../library/time.rst:237 msgid "" "*adjustable*: ``True`` if the clock can be changed automatically (e.g. by a " "NTP daemon) or manually by the system administrator, ``False`` otherwise" msgstr "" -#: ../../library/time.rst:237 +#: ../../library/time.rst:239 msgid "" "*implementation*: The name of the underlying C function used to get the " "clock value. Refer to :ref:`time-clock-id-constants` for possible values." msgstr "" -#: ../../library/time.rst:239 +#: ../../library/time.rst:241 msgid "" "*monotonic*: ``True`` if the clock cannot go backward, ``False`` otherwise" msgstr "" -#: ../../library/time.rst:241 +#: ../../library/time.rst:243 msgid "*resolution*: The resolution of the clock in seconds (:class:`float`)" msgstr "" -#: ../../library/time.rst:248 +#: ../../library/time.rst:250 msgid "" "Convert a time expressed in seconds since the epoch_ to a :class:" "`struct_time` in UTC in which the dst flag is always zero. If *secs* is not " @@ -350,14 +350,14 @@ msgid "" "of this function." msgstr "" -#: ../../library/time.rst:258 +#: ../../library/time.rst:260 msgid "" "Like :func:`gmtime` but converts to local time. If *secs* is not provided " "or :const:`None`, the current time as returned by :func:`.time` is used. " "The dst flag is set to ``1`` when DST applies to the given time." msgstr "" -#: ../../library/time.rst:262 +#: ../../library/time.rst:264 msgid "" ":func:`localtime` may raise :exc:`OverflowError`, if the timestamp is " "outside the range of values supported by the platform C :c:func:`localtime` " @@ -366,7 +366,7 @@ msgid "" "between 1970 and 2038." msgstr "" -#: ../../library/time.rst:271 +#: ../../library/time.rst:273 msgid "" "This is the inverse function of :func:`localtime`. Its argument is the :" "class:`struct_time` or full 9-tuple (since the dst flag is needed; use " @@ -379,7 +379,7 @@ msgid "" "dependent." msgstr "" -#: ../../library/time.rst:283 +#: ../../library/time.rst:285 msgid "" "Return the value (in fractional seconds) of a monotonic clock, i.e. a clock " "that cannot go backwards. The clock is not affected by system clock " @@ -387,25 +387,25 @@ msgid "" "only the difference between the results of two calls is valid." msgstr "" -#: ../../library/time.rst:288 +#: ../../library/time.rst:290 msgid "" "Use :func:`monotonic_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:293 +#: ../../library/time.rst:295 msgid "The function is now always available and always system-wide." msgstr "" -#: ../../library/time.rst:296 +#: ../../library/time.rst:298 msgid "On macOS, the function is now system-wide." msgstr "" -#: ../../library/time.rst:302 +#: ../../library/time.rst:304 msgid "Similar to :func:`monotonic`, but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:311 +#: ../../library/time.rst:313 msgid "" "Return the value (in fractional seconds) of a performance counter, i.e. a " "clock with the highest available resolution to measure a short duration. It " @@ -414,21 +414,21 @@ msgid "" "between the results of two calls is valid." msgstr "" -#: ../../library/time.rst:317 +#: ../../library/time.rst:319 msgid "" "Use :func:`perf_counter_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:322 +#: ../../library/time.rst:324 msgid "On Windows, the function is now system-wide." msgstr "" -#: ../../library/time.rst:327 +#: ../../library/time.rst:329 msgid "Similar to :func:`perf_counter`, but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:339 +#: ../../library/time.rst:341 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current process. It does not include time elapsed during " @@ -437,36 +437,36 @@ msgid "" "of two calls is valid." msgstr "" -#: ../../library/time.rst:345 +#: ../../library/time.rst:347 msgid "" "Use :func:`process_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:352 +#: ../../library/time.rst:354 msgid "Similar to :func:`process_time` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:358 +#: ../../library/time.rst:360 msgid "" "Suspend execution of the calling thread for the given number of seconds. The " "argument may be a floating point number to indicate a more precise sleep " "time." msgstr "" -#: ../../library/time.rst:362 +#: ../../library/time.rst:364 msgid "" "If the sleep is interrupted by a signal and no exception is raised by the " "signal handler, the sleep is restarted with a recomputed timeout." msgstr "" -#: ../../library/time.rst:365 +#: ../../library/time.rst:367 msgid "" "The suspension time may be longer than requested by an arbitrary amount, " "because of the scheduling of other activity in the system." msgstr "" -#: ../../library/time.rst:368 +#: ../../library/time.rst:370 msgid "" "On Windows, if *secs* is zero, the thread relinquishes the remainder of its " "time slice to any other thread that is ready to run. If there are no other " @@ -477,36 +477,36 @@ msgid "" "nanoseconds. If *secs* is zero, ``Sleep(0)`` is used." msgstr "" -#: ../../library/time.rst:376 +#: ../../library/time.rst:378 msgid "Unix implementation:" msgstr "" -#: ../../library/time.rst:378 +#: ../../library/time.rst:380 msgid "Use ``clock_nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "" -#: ../../library/time.rst:379 +#: ../../library/time.rst:381 msgid "Or use ``nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "" -#: ../../library/time.rst:380 +#: ../../library/time.rst:382 msgid "Or use ``select()`` (resolution: 1 microsecond)." msgstr "" -#: ../../library/time.rst:382 +#: ../../library/time.rst:384 msgid "" "On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now " "used if available. On Windows, a waitable timer is now used." msgstr "" -#: ../../library/time.rst:386 +#: ../../library/time.rst:388 msgid "" "The function now sleeps at least *secs* even if the sleep is interrupted by " "a signal, except if the signal handler raises an exception (see :pep:`475` " "for the rationale)." msgstr "" -#: ../../library/time.rst:397 +#: ../../library/time.rst:399 msgid "" "Convert a tuple or :class:`struct_time` representing a time as returned by :" "func:`gmtime` or :func:`localtime` to a string as specified by the *format* " @@ -515,267 +515,267 @@ msgid "" "raised if any field in *t* is outside of the allowed range." msgstr "" -#: ../../library/time.rst:403 +#: ../../library/time.rst:405 msgid "" "0 is a legal argument for any position in the time tuple; if it is normally " "illegal the value is forced to a correct one." msgstr "" -#: ../../library/time.rst:406 +#: ../../library/time.rst:408 msgid "" "The following directives can be embedded in the *format* string. They are " "shown without the optional field width and precision specification, and are " "replaced by the indicated characters in the :func:`strftime` result:" msgstr "" -#: ../../library/time.rst:411 +#: ../../library/time.rst:413 msgid "Directive" msgstr "" -#: ../../library/time.rst:411 +#: ../../library/time.rst:413 msgid "Meaning" msgstr "" -#: ../../library/time.rst:411 +#: ../../library/time.rst:413 msgid "Notes" msgstr "註解" -#: ../../library/time.rst:413 +#: ../../library/time.rst:415 msgid "``%a``" msgstr "``%a``" -#: ../../library/time.rst:413 +#: ../../library/time.rst:415 msgid "Locale's abbreviated weekday name." msgstr "" -#: ../../library/time.rst:416 +#: ../../library/time.rst:418 msgid "``%A``" msgstr "``%A``" -#: ../../library/time.rst:416 +#: ../../library/time.rst:418 msgid "Locale's full weekday name." msgstr "" -#: ../../library/time.rst:418 +#: ../../library/time.rst:420 msgid "``%b``" msgstr "``%b``" -#: ../../library/time.rst:418 +#: ../../library/time.rst:420 msgid "Locale's abbreviated month name." msgstr "" -#: ../../library/time.rst:421 +#: ../../library/time.rst:423 msgid "``%B``" msgstr "``%B``" -#: ../../library/time.rst:421 +#: ../../library/time.rst:423 msgid "Locale's full month name." msgstr "" -#: ../../library/time.rst:423 +#: ../../library/time.rst:425 msgid "``%c``" msgstr "``%c``" -#: ../../library/time.rst:423 +#: ../../library/time.rst:425 msgid "Locale's appropriate date and time representation." msgstr "" -#: ../../library/time.rst:426 +#: ../../library/time.rst:428 msgid "``%d``" msgstr "``%d``" -#: ../../library/time.rst:426 +#: ../../library/time.rst:428 msgid "Day of the month as a decimal number [01,31]." msgstr "" -#: ../../library/time.rst:429 +#: ../../library/time.rst:431 msgid "``%H``" msgstr "``%H``" -#: ../../library/time.rst:429 +#: ../../library/time.rst:431 msgid "Hour (24-hour clock) as a decimal number [00,23]." msgstr "" -#: ../../library/time.rst:432 +#: ../../library/time.rst:434 msgid "``%I``" msgstr "``%I``" -#: ../../library/time.rst:432 +#: ../../library/time.rst:434 msgid "Hour (12-hour clock) as a decimal number [01,12]." msgstr "" -#: ../../library/time.rst:435 +#: ../../library/time.rst:437 msgid "``%j``" msgstr "``%j``" -#: ../../library/time.rst:435 +#: ../../library/time.rst:437 msgid "Day of the year as a decimal number [001,366]." msgstr "" -#: ../../library/time.rst:438 +#: ../../library/time.rst:440 msgid "``%m``" msgstr "``%m``" -#: ../../library/time.rst:438 +#: ../../library/time.rst:440 msgid "Month as a decimal number [01,12]." msgstr "" -#: ../../library/time.rst:441 +#: ../../library/time.rst:443 msgid "``%M``" msgstr "``%M``" -#: ../../library/time.rst:441 +#: ../../library/time.rst:443 msgid "Minute as a decimal number [00,59]." msgstr "" -#: ../../library/time.rst:444 +#: ../../library/time.rst:446 msgid "``%p``" msgstr "``%p``" -#: ../../library/time.rst:444 +#: ../../library/time.rst:446 msgid "Locale's equivalent of either AM or PM." msgstr "" -#: ../../library/time.rst:444 +#: ../../library/time.rst:446 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/time.rst:447 +#: ../../library/time.rst:449 msgid "``%S``" msgstr "``%S``" -#: ../../library/time.rst:447 +#: ../../library/time.rst:449 msgid "Second as a decimal number [00,61]." msgstr "" -#: ../../library/time.rst:447 +#: ../../library/time.rst:449 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/time.rst:450 +#: ../../library/time.rst:452 msgid "``%U``" msgstr "``%U``" -#: ../../library/time.rst:450 +#: ../../library/time.rst:452 msgid "" "Week number of the year (Sunday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/time.rst:450 ../../library/time.rst:461 +#: ../../library/time.rst:452 ../../library/time.rst:463 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/time.rst:458 +#: ../../library/time.rst:460 msgid "``%w``" msgstr "``%w``" -#: ../../library/time.rst:458 +#: ../../library/time.rst:460 msgid "Weekday as a decimal number [0(Sunday),6]." msgstr "" -#: ../../library/time.rst:461 +#: ../../library/time.rst:463 msgid "``%W``" msgstr "``%W``" -#: ../../library/time.rst:461 +#: ../../library/time.rst:463 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/time.rst:469 +#: ../../library/time.rst:471 msgid "``%x``" msgstr "``%x``" -#: ../../library/time.rst:469 +#: ../../library/time.rst:471 msgid "Locale's appropriate date representation." msgstr "" -#: ../../library/time.rst:472 +#: ../../library/time.rst:474 msgid "``%X``" msgstr "``%X``" -#: ../../library/time.rst:472 +#: ../../library/time.rst:474 msgid "Locale's appropriate time representation." msgstr "" -#: ../../library/time.rst:475 +#: ../../library/time.rst:477 msgid "``%y``" msgstr "``%y``" -#: ../../library/time.rst:475 +#: ../../library/time.rst:477 msgid "Year without century as a decimal number [00,99]." msgstr "" -#: ../../library/time.rst:478 +#: ../../library/time.rst:480 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/time.rst:478 +#: ../../library/time.rst:480 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/time.rst:481 +#: ../../library/time.rst:483 msgid "``%z``" msgstr "``%z``" -#: ../../library/time.rst:481 +#: ../../library/time.rst:483 msgid "" "Time zone offset indicating a positive or negative time difference from UTC/" "GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M " "represents decimal minute digits [-23:59, +23:59]. [1]_" msgstr "" -#: ../../library/time.rst:487 +#: ../../library/time.rst:489 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/time.rst:487 +#: ../../library/time.rst:489 msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "" -#: ../../library/time.rst:490 +#: ../../library/time.rst:492 msgid "``%%``" msgstr "``%%``" -#: ../../library/time.rst:490 +#: ../../library/time.rst:492 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/time.rst:493 +#: ../../library/time.rst:495 msgid "Notes:" msgstr "註解:" -#: ../../library/time.rst:496 +#: ../../library/time.rst:498 msgid "" "When used with the :func:`strptime` function, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/time.rst:500 +#: ../../library/time.rst:504 msgid "" "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " "representing `leap seconds`_ and value ``61`` is supported for historical " "reasons." msgstr "" -#: ../../library/time.rst:505 +#: ../../library/time.rst:509 msgid "" "When used with the :func:`strptime` function, ``%U`` and ``%W`` are only " "used in calculations when the day of the week and the year are specified." msgstr "" -#: ../../library/time.rst:508 +#: ../../library/time.rst:512 msgid "" "Here is an example, a format for dates compatible with that specified in " "the :rfc:`2822` Internet email standard. [1]_ ::" msgstr "" -#: ../../library/time.rst:515 +#: ../../library/time.rst:519 msgid "" "Additional directives may be supported on certain platforms, but only the " "ones listed here have a meaning standardized by ANSI C. To see the full set " @@ -783,7 +783,7 @@ msgid "" "`strftime(3)` documentation." msgstr "" -#: ../../library/time.rst:520 +#: ../../library/time.rst:524 msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " @@ -791,13 +791,13 @@ msgid "" "``%j`` where it is 3." msgstr "" -#: ../../library/time.rst:531 +#: ../../library/time.rst:535 msgid "" "Parse a string representing a time according to a format. The return value " "is a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`." msgstr "" -#: ../../library/time.rst:535 +#: ../../library/time.rst:539 msgid "" "The *format* parameter uses the same directives as those used by :func:" "`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which matches the " @@ -808,11 +808,11 @@ msgid "" "Both *string* and *format* must be strings." msgstr "" -#: ../../library/time.rst:543 +#: ../../library/time.rst:547 msgid "For example:" msgstr "" -#: ../../library/time.rst:550 +#: ../../library/time.rst:554 msgid "" "Support for the ``%Z`` directive is based on the values contained in " "``tzname`` and whether ``daylight`` is true. Because of this, it is " @@ -820,7 +820,7 @@ msgid "" "(and are considered to be non-daylight savings timezones)." msgstr "" -#: ../../library/time.rst:555 +#: ../../library/time.rst:559 msgid "" "Only the directives specified in the documentation are supported. Because " "``strftime()`` is implemented per platform it can sometimes offer more " @@ -829,7 +829,7 @@ msgid "" "are not documented as supported." msgstr "" -#: ../../library/time.rst:564 +#: ../../library/time.rst:568 msgid "" "The type of the time value sequence returned by :func:`gmtime`, :func:" "`localtime`, and :func:`strptime`. It is an object with a :term:`named " @@ -837,153 +837,109 @@ msgid "" "The following values are present:" msgstr "" -#: ../../library/time.rst:570 +#: ../../library/time.rst:575 msgid "Index" msgstr "" -#: ../../library/time.rst:570 +#: ../../library/time.rst:576 msgid "Attribute" msgstr "屬性" -#: ../../library/time.rst:570 +#: ../../library/time.rst:577 msgid "Values" msgstr "" -#: ../../library/time.rst:572 +#: ../../library/time.rst:579 msgid "0" msgstr "0" -#: ../../library/time.rst:572 -msgid ":attr:`tm_year`" -msgstr ":attr:`tm_year`" - -#: ../../library/time.rst:572 +#: ../../library/time.rst:581 msgid "(for example, 1993)" msgstr "(例如 1993)" -#: ../../library/time.rst:574 +#: ../../library/time.rst:583 msgid "1" msgstr "1" -#: ../../library/time.rst:574 -msgid ":attr:`tm_mon`" -msgstr ":attr:`tm_mon`" - -#: ../../library/time.rst:574 +#: ../../library/time.rst:585 msgid "range [1, 12]" msgstr "" -#: ../../library/time.rst:576 +#: ../../library/time.rst:587 msgid "2" msgstr "2" -#: ../../library/time.rst:576 -msgid ":attr:`tm_mday`" -msgstr ":attr:`tm_mday`" - -#: ../../library/time.rst:576 +#: ../../library/time.rst:589 msgid "range [1, 31]" msgstr "" -#: ../../library/time.rst:578 +#: ../../library/time.rst:591 msgid "3" msgstr "3" -#: ../../library/time.rst:578 -msgid ":attr:`tm_hour`" -msgstr ":attr:`tm_hour`" - -#: ../../library/time.rst:578 +#: ../../library/time.rst:593 msgid "range [0, 23]" msgstr "" -#: ../../library/time.rst:580 +#: ../../library/time.rst:595 msgid "4" msgstr "4" -#: ../../library/time.rst:580 -msgid ":attr:`tm_min`" -msgstr ":attr:`tm_min`" - -#: ../../library/time.rst:580 +#: ../../library/time.rst:597 msgid "range [0, 59]" msgstr "" -#: ../../library/time.rst:582 +#: ../../library/time.rst:599 msgid "5" msgstr "5" -#: ../../library/time.rst:582 -msgid ":attr:`tm_sec`" -msgstr ":attr:`tm_sec`" - -#: ../../library/time.rst:582 -msgid "range [0, 61]; see **(2)** in :func:`strftime` description" +#: ../../library/time.rst:601 +msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" -#: ../../library/time.rst:585 +#: ../../library/time.rst:603 msgid "6" msgstr "6" -#: ../../library/time.rst:585 -msgid ":attr:`tm_wday`" -msgstr ":attr:`tm_wday`" - -#: ../../library/time.rst:585 -msgid "range [0, 6], Monday is 0" +#: ../../library/time.rst:605 +msgid "range [0, 6]; Monday is 0" msgstr "" -#: ../../library/time.rst:587 +#: ../../library/time.rst:607 msgid "7" msgstr "7" -#: ../../library/time.rst:587 -msgid ":attr:`tm_yday`" -msgstr ":attr:`tm_yday`" - -#: ../../library/time.rst:587 +#: ../../library/time.rst:609 msgid "range [1, 366]" msgstr "" -#: ../../library/time.rst:589 +#: ../../library/time.rst:611 msgid "8" msgstr "8" -#: ../../library/time.rst:589 -msgid ":attr:`tm_isdst`" -msgstr ":attr:`tm_isdst`" - -#: ../../library/time.rst:589 +#: ../../library/time.rst:613 msgid "0, 1 or -1; see below" msgstr "" -#: ../../library/time.rst:591 ../../library/time.rst:593 +#: ../../library/time.rst:615 ../../library/time.rst:619 msgid "N/A" msgstr "N/A" -#: ../../library/time.rst:591 -msgid ":attr:`tm_zone`" -msgstr ":attr:`tm_zone`" - -#: ../../library/time.rst:591 +#: ../../library/time.rst:617 msgid "abbreviation of timezone name" msgstr "" -#: ../../library/time.rst:593 -msgid ":attr:`tm_gmtoff`" -msgstr ":attr:`tm_gmtoff`" - -#: ../../library/time.rst:593 +#: ../../library/time.rst:621 msgid "offset east of UTC in seconds" msgstr "" -#: ../../library/time.rst:596 +#: ../../library/time.rst:623 msgid "" "Note that unlike the C structure, the month value is a range of [1, 12], not " "[0, 11]." msgstr "" -#: ../../library/time.rst:599 +#: ../../library/time.rst:626 msgid "" "In calls to :func:`mktime`, :attr:`tm_isdst` may be set to 1 when daylight " "savings time is in effect, and 0 when it is not. A value of -1 indicates " @@ -991,14 +947,14 @@ msgid "" "filled in." msgstr "" -#: ../../library/time.rst:603 +#: ../../library/time.rst:630 msgid "" "When a tuple with an incorrect length is passed to a function expecting a :" "class:`struct_time`, or having elements of the wrong type, a :exc:" "`TypeError` is raised." msgstr "" -#: ../../library/time.rst:609 +#: ../../library/time.rst:636 msgid "" "Return the time in seconds since the epoch_ as a floating point number. The " "handling of `leap seconds`_ is platform dependent. On Windows and most Unix " @@ -1007,7 +963,7 @@ msgid "" "org/wiki/Unix_time>`_." msgstr "" -#: ../../library/time.rst:615 +#: ../../library/time.rst:642 msgid "" "Note that even though the time is always returned as a floating point " "number, not all systems provide time with a better precision than 1 second. " @@ -1016,7 +972,7 @@ msgid "" "between the two calls." msgstr "" -#: ../../library/time.rst:621 +#: ../../library/time.rst:648 msgid "" "The number returned by :func:`.time` may be converted into a more common " "time format (i.e. year, month, day, hour, etc...) in UTC by passing it to :" @@ -1026,19 +982,19 @@ msgid "" "attributes." msgstr "" -#: ../../library/time.rst:628 +#: ../../library/time.rst:655 msgid "" "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " "type." msgstr "" -#: ../../library/time.rst:634 +#: ../../library/time.rst:661 msgid "" "Similar to :func:`~time.time` but returns time as an integer number of " "nanoseconds since the epoch_." msgstr "" -#: ../../library/time.rst:647 +#: ../../library/time.rst:674 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current thread. It does not include time elapsed during " @@ -1047,25 +1003,25 @@ msgid "" "of two calls in the same thread is valid." msgstr "" -#: ../../library/time.rst:653 +#: ../../library/time.rst:680 msgid "" "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:656 +#: ../../library/time.rst:683 msgid ":ref:`Availability `: Linux, Unix, Windows." msgstr ":ref:`適用 `:Linux、Unix、Windows。" -#: ../../library/time.rst:658 +#: ../../library/time.rst:685 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "" -#: ../../library/time.rst:665 +#: ../../library/time.rst:692 msgid "Similar to :func:`thread_time` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:672 +#: ../../library/time.rst:699 msgid "" "Reset the time conversion rules used by the library routines. The " "environment variable :envvar:`TZ` specifies how this is done. It will also " @@ -1076,42 +1032,42 @@ msgid "" "when daylight saving time applies)." msgstr "" -#: ../../library/time.rst:684 +#: ../../library/time.rst:711 msgid "" "Although in many cases, changing the :envvar:`TZ` environment variable may " "affect the output of functions like :func:`localtime` without calling :func:" "`tzset`, this behavior should not be relied on." msgstr "" -#: ../../library/time.rst:688 +#: ../../library/time.rst:715 msgid "The :envvar:`TZ` environment variable should contain no whitespace." msgstr "" -#: ../../library/time.rst:690 +#: ../../library/time.rst:717 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" -#: ../../library/time.rst:695 +#: ../../library/time.rst:722 msgid "Where the components are:" msgstr "" -#: ../../library/time.rst:699 +#: ../../library/time.rst:726 msgid "``std`` and ``dst``" msgstr "``std`` 和 ``dst``" -#: ../../library/time.rst:698 +#: ../../library/time.rst:725 msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" msgstr "" -#: ../../library/time.rst:705 +#: ../../library/time.rst:732 msgid "``offset``" msgstr "``offset``" -#: ../../library/time.rst:702 +#: ../../library/time.rst:729 msgid "" "The offset has the form: ``± hh[:mm[:ss]]``. This indicates the value added " "the local time to arrive at UTC. If preceded by a '-', the timezone is east " @@ -1119,41 +1075,41 @@ msgid "" "summer time is assumed to be one hour ahead of standard time." msgstr "" -#: ../../library/time.rst:727 +#: ../../library/time.rst:754 msgid "``start[/time], end[/time]``" msgstr "``start[/time], end[/time]``" -#: ../../library/time.rst:708 +#: ../../library/time.rst:735 msgid "" "Indicates when to change to and back from DST. The format of the start and " "end dates are one of the following:" msgstr "" -#: ../../library/time.rst:713 +#: ../../library/time.rst:740 msgid ":samp:`J{n}`" msgstr ":samp:`J{n}`" -#: ../../library/time.rst:712 +#: ../../library/time.rst:739 msgid "" "The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all " "years February 28 is day 59 and March 1 is day 60." msgstr "" -#: ../../library/time.rst:717 +#: ../../library/time.rst:744 msgid ":samp:`{n}`" msgstr ":samp:`{n}`" -#: ../../library/time.rst:716 +#: ../../library/time.rst:743 msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" -#: ../../library/time.rst:724 +#: ../../library/time.rst:751 msgid ":samp:`M{m}.{n}.{d}`" msgstr ":samp:`M{m}.{n}.{d}`" -#: ../../library/time.rst:720 +#: ../../library/time.rst:747 msgid "" "The *d*'th day (0 <= *d* <= 6) of week *n* of month *m* of the year (1 <= " "*n* <= 5, 1 <= *m* <= 12, where week 5 means \"the last *d* day in month " @@ -1161,13 +1117,13 @@ msgid "" "first week in which the *d*'th day occurs. Day zero is a Sunday." msgstr "" -#: ../../library/time.rst:726 +#: ../../library/time.rst:753 msgid "" "``time`` has the same format as ``offset`` except that no leading sign ('-' " "or '+') is allowed. The default, if time is not given, is 02:00:00." msgstr "" -#: ../../library/time.rst:740 +#: ../../library/time.rst:767 msgid "" "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " "more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) " @@ -1178,23 +1134,23 @@ msgid "" "``'Australia/Melbourne'``, ``'Egypt'`` or ``'Europe/Amsterdam'``. ::" msgstr "" -#: ../../library/time.rst:761 +#: ../../library/time.rst:788 msgid "Clock ID Constants" msgstr "" -#: ../../library/time.rst:763 +#: ../../library/time.rst:790 msgid "" "These constants are used as parameters for :func:`clock_getres` and :func:" "`clock_gettime`." msgstr "" -#: ../../library/time.rst:768 +#: ../../library/time.rst:795 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" -#: ../../library/time.rst:771 +#: ../../library/time.rst:798 msgid "" "This allows applications to get a suspend-aware monotonic clock without " "having to deal with the complications of :data:`CLOCK_REALTIME`, which may " @@ -1202,103 +1158,103 @@ msgid "" "similar." msgstr "" -#: ../../library/time.rst:776 +#: ../../library/time.rst:803 msgid ":ref:`Availability `: Linux >= 2.6.39." msgstr ":ref:`適用 `:Linux 2.6.39 以上。" -#: ../../library/time.rst:783 +#: ../../library/time.rst:810 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " "hardware source, and may give close to nanosecond resolution. " "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" -#: ../../library/time.rst:787 +#: ../../library/time.rst:814 msgid ":ref:`Availability `: Solaris." msgstr ":ref:`適用 `:Solaris。" -#: ../../library/time.rst:794 +#: ../../library/time.rst:821 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." msgstr "" -#: ../../library/time.rst:804 +#: ../../library/time.rst:831 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." msgstr "" -#: ../../library/time.rst:807 +#: ../../library/time.rst:834 msgid ":ref:`Availability `: Linux >= 2.6.28, macOS >= 10.12." msgstr ":ref:`適用 `:Linux 2.6.28 以上、macOS 10.12 以上。" -#: ../../library/time.rst:814 ../../library/time.rst:823 +#: ../../library/time.rst:841 ../../library/time.rst:850 msgid "High-resolution per-process timer from the CPU." msgstr "" -#: ../../library/time.rst:825 +#: ../../library/time.rst:852 msgid ":ref:`Availability `: FreeBSD, NetBSD >= 7, OpenBSD." msgstr ":ref:`適用 `:FreeBSD、NetBSD 7 以上、OpenBSD。" -#: ../../library/time.rst:831 +#: ../../library/time.rst:858 msgid "" "`International Atomic Time `_" msgstr "" -#: ../../library/time.rst:833 +#: ../../library/time.rst:860 msgid "" "The system must have a current leap second table in order for this to give " "the correct answer. PTP or NTP software can maintain a leap second table." msgstr "" -#: ../../library/time.rst:836 +#: ../../library/time.rst:863 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/time.rst:842 +#: ../../library/time.rst:869 msgid "Thread-specific CPU-time clock." msgstr "" -#: ../../library/time.rst:851 +#: ../../library/time.rst:878 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" -#: ../../library/time.rst:855 +#: ../../library/time.rst:882 msgid ":ref:`Availability `: FreeBSD, OpenBSD >= 5.5." msgstr ":ref:`適用 `:FreeBSD、OpenBSD 5.5 以上。" -#: ../../library/time.rst:862 +#: ../../library/time.rst:889 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " "point, unaffected by frequency or time adjustments and not incremented while " "the system is asleep." msgstr "" -#: ../../library/time.rst:866 +#: ../../library/time.rst:893 msgid ":ref:`Availability `: macOS >= 10.12." msgstr ":ref:`適用 `:macOS 10.12 以上。" -#: ../../library/time.rst:870 +#: ../../library/time.rst:897 msgid "" "The following constant is the only parameter that can be sent to :func:" "`clock_settime`." msgstr "" -#: ../../library/time.rst:876 +#: ../../library/time.rst:903 msgid "" "System-wide real-time clock. Setting this clock requires appropriate " "privileges." msgstr "" -#: ../../library/time.rst:887 +#: ../../library/time.rst:914 msgid "Timezone Constants" msgstr "" -#: ../../library/time.rst:891 +#: ../../library/time.rst:918 msgid "" "The offset of the local DST timezone, in seconds west of UTC, if one is " "defined. This is negative if the local DST timezone is east of UTC (as in " @@ -1306,68 +1262,68 @@ msgid "" "nonzero. See note below." msgstr "" -#: ../../library/time.rst:897 +#: ../../library/time.rst:924 msgid "Nonzero if a DST timezone is defined. See note below." msgstr "" -#: ../../library/time.rst:901 +#: ../../library/time.rst:928 msgid "" "The offset of the local (non-DST) timezone, in seconds west of UTC (negative " "in most of Western Europe, positive in the US, zero in the UK). See note " "below." msgstr "" -#: ../../library/time.rst:906 +#: ../../library/time.rst:933 msgid "" "A tuple of two strings: the first is the name of the local non-DST timezone, " "the second is the name of the local DST timezone. If no DST timezone is " "defined, the second string should not be used. See note below." msgstr "" -#: ../../library/time.rst:912 +#: ../../library/time.rst:939 msgid "" "For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:" "`timezone`, and :data:`tzname`), the value is determined by the timezone " "rules in effect at module load time or the last time :func:`tzset` is called " "and may be incorrect for times in the past. It is recommended to use the :" -"attr:`tm_gmtoff` and :attr:`tm_zone` results from :func:`localtime` to " -"obtain timezone information." +"attr:`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` results from :" +"func:`localtime` to obtain timezone information." msgstr "" -#: ../../library/time.rst:922 +#: ../../library/time.rst:949 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/time.rst:922 +#: ../../library/time.rst:949 msgid "More object-oriented interface to dates and times." msgstr "" -#: ../../library/time.rst:926 +#: ../../library/time.rst:953 msgid "Module :mod:`locale`" msgstr ":mod:`locale` 模組" -#: ../../library/time.rst:925 +#: ../../library/time.rst:952 msgid "" "Internationalization services. The locale setting affects the " "interpretation of many format specifiers in :func:`strftime` and :func:" "`strptime`." msgstr "" -#: ../../library/time.rst:929 +#: ../../library/time.rst:956 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/time.rst:929 +#: ../../library/time.rst:956 msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." msgstr "" -#: ../../library/time.rst:933 +#: ../../library/time.rst:960 msgid "Footnotes" msgstr "註解" -#: ../../library/time.rst:934 +#: ../../library/time.rst:961 msgid "" "The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to " "the preferred hour/minute offset is not supported by all ANSI C libraries. " @@ -1406,23 +1362,56 @@ msgstr "Greenwich Mean Time(格林威治標準時間)" msgid "Daylight Saving Time" msgstr "Daylight Saving Time(日光節約時間)" -#: ../../library/time.rst:308 ../../library/time.rst:334 -#: ../../library/time.rst:642 +#: ../../library/time.rst:310 ../../library/time.rst:336 +#: ../../library/time.rst:669 msgid "benchmarking" msgstr "benchmarking(基準測試)" -#: ../../library/time.rst:334 ../../library/time.rst:642 +#: ../../library/time.rst:336 ../../library/time.rst:669 msgid "CPU time" msgstr "CPU time(CPU 時間)" -#: ../../library/time.rst:334 ../../library/time.rst:642 +#: ../../library/time.rst:336 ../../library/time.rst:669 msgid "processor time" msgstr "processor time(處理器時間)" -#: ../../library/time.rst:392 ../../library/time.rst:526 +#: ../../library/time.rst:394 ../../library/time.rst:530 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/time.rst:392 ../../library/time.rst:526 +#: ../../library/time.rst:394 ../../library/time.rst:530 msgid "datetime format" msgstr "datetime format(日期時間格式)" + +#~ msgid ":attr:`tm_year`" +#~ msgstr ":attr:`tm_year`" + +#~ msgid ":attr:`tm_mon`" +#~ msgstr ":attr:`tm_mon`" + +#~ msgid ":attr:`tm_mday`" +#~ msgstr ":attr:`tm_mday`" + +#~ msgid ":attr:`tm_hour`" +#~ msgstr ":attr:`tm_hour`" + +#~ msgid ":attr:`tm_min`" +#~ msgstr ":attr:`tm_min`" + +#~ msgid ":attr:`tm_sec`" +#~ msgstr ":attr:`tm_sec`" + +#~ msgid ":attr:`tm_wday`" +#~ msgstr ":attr:`tm_wday`" + +#~ msgid ":attr:`tm_yday`" +#~ msgstr ":attr:`tm_yday`" + +#~ msgid ":attr:`tm_isdst`" +#~ msgstr ":attr:`tm_isdst`" + +#~ msgid ":attr:`tm_zone`" +#~ msgstr ":attr:`tm_zone`" + +#~ msgid ":attr:`tm_gmtoff`" +#~ msgstr ":attr:`tm_gmtoff`" diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index e773cefb23..8cc691f0de 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-11-02 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,23 +30,216 @@ msgstr "**原始碼:**\\ :source:`Lib/tkinter/messagebox.py`" msgid "" "The :mod:`tkinter.messagebox` module provides a template base class as well " "as a variety of convenience methods for commonly used configurations. The " -"message boxes are modal and will return a subset of (True, False, OK, None, " -"Yes, No) based on the user's selection. Common message box styles and " -"layouts include but are not limited to:" +"message boxes are modal and will return a subset of (``True``, ``False``, " +"``None``, :data:`OK`, :data:`CANCEL`, :data:`YES`, :data:`NO`) based on the " +"user's selection. Common message box styles and layouts include but are not " +"limited to:" msgstr "" -#: ../../library/tkinter.messagebox.rst:22 -msgid "Create a default information message box." +#: ../../library/tkinter.messagebox.rst:23 +msgid "" +"Create a message window with an application-specified message, an icon and a " +"set of buttons. Each of the buttons in the message window is identified by a " +"unique symbolic name (see the *type* options)." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:27 +msgid "The following options are supported:" +msgstr "" + +#: ../../library/tkinter.messagebox.rst:33 +msgid "*command*" +msgstr "*command*" + +#: ../../library/tkinter.messagebox.rst:30 +msgid "" +"Specifies the function to invoke when the user closes the dialog. The name " +"of the button clicked by the user to close the dialog is passed as argument. " +"This is only available on macOS." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:39 +msgid "*default*" +msgstr "*default*" + +#: ../../library/tkinter.messagebox.rst:36 +msgid "" +"Gives the :ref:`symbolic name ` of the default button " +"for this message window (:data:`OK`, :data:`CANCEL`, and so on). If this " +"option is not specified, the first button in the dialog will be made the " +"default." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:46 +msgid "*detail*" +msgstr "*detail*" + +#: ../../library/tkinter.messagebox.rst:42 +msgid "" +"Specifies an auxiliary message to the main message given by the *message* " +"option. The message detail will be presented beneath the main message and, " +"where supported by the OS, in a less emphasized font than the main message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:51 +msgid "*icon*" +msgstr "*icon*" + +#: ../../library/tkinter.messagebox.rst:49 +msgid "" +"Specifies an :ref:`icon ` to display. If this option is " +"not specified, then the :data:`INFO` icon will be displayed." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:55 +msgid "*message*" +msgstr "*message*" + +#: ../../library/tkinter.messagebox.rst:54 +msgid "" +"Specifies the message to display in this message box. The default value is " +"an empty string." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:59 +msgid "*parent*" +msgstr "*parent*" + +#: ../../library/tkinter.messagebox.rst:58 +msgid "" +"Makes the specified window the logical parent of the message box. The " +"message box is displayed on top of its parent window." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:64 +msgid "*title*" +msgstr "*title*" + +#: ../../library/tkinter.messagebox.rst:62 +msgid "" +"Specifies a string to display as the title of the message box. This option " +"is ignored on macOS, where platform guidelines forbid the use of a title on " +"this kind of dialog." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:68 +msgid "*type*" +msgstr "*type*" + +#: ../../library/tkinter.messagebox.rst:67 +msgid "" +"Arranges for a :ref:`predefined set of buttons ` to be " +"displayed." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:72 +msgid "" +"Display a message window and wait for the user to select one of the buttons. " +"Then return the symbolic name of the selected button. Keyword arguments can " +"override options specified in the constructor." msgstr "" -#: ../../library/tkinter.messagebox.rst:24 +#: ../../library/tkinter.messagebox.rst:76 msgid "**Information message box**" msgstr "" -#: ../../library/tkinter.messagebox.rst:28 +#: ../../library/tkinter.messagebox.rst:80 +msgid "" +"Creates and displays an information message box with the specified title and " +"message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:83 msgid "**Warning message boxes**" msgstr "" -#: ../../library/tkinter.messagebox.rst:33 +#: ../../library/tkinter.messagebox.rst:87 +msgid "" +"Creates and displays a warning message box with the specified title and " +"message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:92 +msgid "" +"Creates and displays an error message box with the specified title and " +"message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:95 msgid "**Question message boxes**" msgstr "" + +#: ../../library/tkinter.messagebox.rst:99 +msgid "" +"Ask a question. By default shows buttons :data:`YES` and :data:`NO`. Returns " +"the symbolic name of the selected button." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:104 +msgid "" +"Ask if operation should proceed. Shows buttons :data:`OK` and :data:" +"`CANCEL`. Returns ``True`` if the answer is ok and ``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:109 +msgid "" +"Ask if operation should be retried. Shows buttons :data:`RETRY` and :data:" +"`CANCEL`. Return ``True`` if the answer is yes and ``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:114 +msgid "" +"Ask a question. Shows buttons :data:`YES` and :data:`NO`. Returns ``True`` " +"if the answer is yes and ``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:119 +msgid "" +"Ask a question. Shows buttons :data:`YES`, :data:`NO` and :data:`CANCEL`. " +"Return ``True`` if the answer is yes, ``None`` if cancelled, and ``False`` " +"otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:126 +msgid "Symbolic names of buttons:" +msgstr "" + +#: ../../library/tkinter.messagebox.rst:145 +msgid "Predefined sets of buttons:" +msgstr "" + +#: ../../library/tkinter.messagebox.rst:150 +msgid "" +"Displays three buttons whose symbolic names are :data:`ABORT`, :data:`RETRY` " +"and :data:`IGNORE`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:157 +msgid "Displays one button whose symbolic name is :data:`OK`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:162 +msgid "" +"Displays two buttons whose symbolic names are :data:`OK` and :data:`CANCEL`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:168 +msgid "" +"Displays two buttons whose symbolic names are :data:`RETRY` and :data:" +"`CANCEL`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:174 +msgid "" +"Displays two buttons whose symbolic names are :data:`YES` and :data:`NO`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:180 +msgid "" +"Displays three buttons whose symbolic names are :data:`YES`, :data:`NO` and :" +"data:`CANCEL`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:185 +msgid "Icon images:" +msgstr "" diff --git a/library/tty.po b/library/tty.po index 112a009880..4f00be48f5 100644 --- a/library/tty.po +++ b/library/tty.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2021-12-17 17:00+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,27 +36,31 @@ msgid "" msgstr ":mod:`tty` 模組定義了將 tty 放入 cbreak 和 raw 模式的函式。" #: ../../library/tty.rst:18 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/tty.rst:20 msgid "" "Because it requires the :mod:`termios` module, it will work only on Unix." msgstr "因為它需要 :mod:`termios` 模組,所以只能在 Unix 上執行。" -#: ../../library/tty.rst:20 +#: ../../library/tty.rst:22 msgid "The :mod:`tty` module defines the following functions:" msgstr ":mod:`tty` 模組定義了以下函式:" -#: ../../library/tty.rst:25 +#: ../../library/tty.rst:27 msgid "" "Convert the tty attribute list *mode*, which is a list like the one returned " "by :func:`termios.tcgetattr`, to that of a tty in raw mode." msgstr "" -#: ../../library/tty.rst:33 +#: ../../library/tty.rst:35 msgid "" "Convert the tty attribute list *mode*, which is a list like the one returned " "by :func:`termios.tcgetattr`, to that of a tty in cbreak mode." msgstr "" -#: ../../library/tty.rst:41 +#: ../../library/tty.rst:43 #, fuzzy msgid "" "Change the mode of the file descriptor *fd* to raw. If *when* is omitted, it " @@ -67,11 +71,11 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 raw。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:46 ../../library/tty.rst:57 +#: ../../library/tty.rst:48 ../../library/tty.rst:59 msgid "The return value is now the original tty attributes, instead of None." msgstr "" -#: ../../library/tty.rst:52 +#: ../../library/tty.rst:54 #, fuzzy msgid "" "Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it " @@ -82,10 +86,10 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 cbreak。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:63 +#: ../../library/tty.rst:65 msgid "Module :mod:`termios`" msgstr ":mod:`termios` 模組" -#: ../../library/tty.rst:64 +#: ../../library/tty.rst:66 msgid "Low-level terminal control interface." msgstr "低階終端機控制介面。" diff --git a/library/typing.po b/library/typing.po index 59abe80c15..8267d8a0bf 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-25 00:03+0000\n" "PO-Revision-Date: 2023-09-05 14:49+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -449,8 +449,8 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:271 ../../library/typing.rst:2888 -#: ../../library/typing.rst:3030 +#: ../../library/typing.rst:271 ../../library/typing.rst:2894 +#: ../../library/typing.rst:3036 msgid "For example:" msgstr "舉例來說:" @@ -471,7 +471,7 @@ msgstr "" #: ../../library/typing.rst:306 msgid "" "``Callable`` cannot express complex signatures such as functions that take a " -"variadic number of arguments, :func:`overloaded functions `, or " +"variadic number of arguments, :ref:`overloaded functions `, or " "functions that have keyword-only parameters. However, these signatures can " "be expressed by defining a :class:`Protocol` class with a :meth:`~object." "__call__` method:" @@ -488,7 +488,7 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:341 ../../library/typing.rst:3559 +#: ../../library/typing.rst:341 ../../library/typing.rst:3565 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -598,8 +598,8 @@ msgstr "" #: ../../library/typing.rst:528 msgid "" "This syntax indicates that the class ``LoggedVar`` is parameterised around a " -"single :class:`type variable ` ``T`` . This also makes ``T`` valid " -"as a type within the class body." +"single :ref:`type variable ` ``T`` . This also makes ``T`` valid as " +"a type within the class body." msgstr "" #: ../../library/typing.rst:532 @@ -870,7 +870,7 @@ msgstr "" #: ../../library/typing.rst:843 ../../library/typing.rst:934 #: ../../library/typing.rst:954 ../../library/typing.rst:1011 #: ../../library/typing.rst:1180 ../../library/typing.rst:1237 -#: ../../library/typing.rst:1446 ../../library/typing.rst:2828 +#: ../../library/typing.rst:1446 ../../library/typing.rst:2834 msgid "For example::" msgstr "" "舉例來說:\n" @@ -896,7 +896,7 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:877 ../../library/typing.rst:1957 +#: ../../library/typing.rst:877 ../../library/typing.rst:1961 msgid "Example:" msgstr "" "舉例來說:\n" @@ -1127,7 +1127,7 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1167 ../../library/typing.rst:1925 +#: ../../library/typing.rst:1167 ../../library/typing.rst:1929 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" @@ -1137,7 +1137,7 @@ msgstr "" msgid ":class:`ParamSpec`" msgstr ":class:`ParamSpec`。" -#: ../../library/typing.rst:1170 ../../library/typing.rst:1928 +#: ../../library/typing.rst:1170 ../../library/typing.rst:1932 msgid ":ref:`annotating-callables`" msgstr ":ref:`annotating-callables`" @@ -1199,7 +1199,7 @@ msgid "" "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1248 ../../library/typing.rst:2844 +#: ../../library/typing.rst:1248 ../../library/typing.rst:2850 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1434,9 +1434,9 @@ msgstr "" #: ../../library/typing.rst:1485 msgid "" -"For example, using the unpack operator ``*`` on a :class:`type variable " -"tuple ` is equivalent to using ``Unpack`` to mark the type " -"variable tuple as having been unpacked::" +"For example, using the unpack operator ``*`` on a :ref:`type variable tuple " +"` is equivalent to using ``Unpack`` to mark the type variable " +"tuple as having been unpacked::" msgstr "" #: ../../library/typing.rst:1494 @@ -1510,29 +1510,29 @@ msgid "" "must be declared separately::" msgstr "" -#: ../../library/typing.rst:1579 +#: ../../library/typing.rst:1581 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1583 msgid "" "The preferred way to construct a type variable is via the dedicated syntax " "for :ref:`generic functions `, :ref:`generic classes " "`, and :ref:`generic type aliases `::" msgstr "" -#: ../../library/typing.rst:1589 +#: ../../library/typing.rst:1591 msgid "" "This syntax can also be used to create bound and constrained type variables::" msgstr "" -#: ../../library/typing.rst:1599 +#: ../../library/typing.rst:1601 msgid "" "However, if desired, reusable type variables can also be constructed " "manually, like so::" msgstr "" -#: ../../library/typing.rst:1605 +#: ../../library/typing.rst:1607 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1540,13 +1540,13 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1626 +#: ../../library/typing.rst:1628 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1629 +#: ../../library/typing.rst:1631 msgid "" "The variance of type variables is inferred by type checkers when they are " "created through the :ref:`type parameter syntax ` or when " @@ -1556,92 +1556,92 @@ msgid "" "invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1637 +#: ../../library/typing.rst:1639 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1652 +#: ../../library/typing.rst:1654 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1664 +#: ../../library/typing.rst:1666 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1675 +#: ../../library/typing.rst:1677 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1679 +#: ../../library/typing.rst:1681 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1683 +#: ../../library/typing.rst:1685 msgid "Whether the type var has been explicitly marked as covariant." msgstr "" -#: ../../library/typing.rst:1687 +#: ../../library/typing.rst:1689 msgid "Whether the type var has been explicitly marked as contravariant." msgstr "" -#: ../../library/typing.rst:1691 +#: ../../library/typing.rst:1693 msgid "" "Whether the type variable's variance should be inferred by type checkers." msgstr "" -#: ../../library/typing.rst:1697 +#: ../../library/typing.rst:1699 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1701 +#: ../../library/typing.rst:1703 msgid "" "For type variables created through :ref:`type parameter syntax `, the bound is evaluated only when the attribute is accessed, not " "when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1707 +#: ../../library/typing.rst:1709 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1711 +#: ../../library/typing.rst:1713 msgid "" "For type variables created through :ref:`type parameter syntax `, the constraints are evaluated only when the attribute is accessed, " "not when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1717 +#: ../../library/typing.rst:1719 msgid "" "Type variables can now be declared using the :ref:`type parameter ` syntax introduced by :pep:`695`. The ``infer_variance`` parameter " "was added." msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1727 msgid "" -"Type variable tuple. A specialized form of :class:`type variable ` " +"Type variable tuple. A specialized form of :ref:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1726 +#: ../../library/typing.rst:1730 msgid "" "Type variable tuples can be declared in :ref:`type parameter lists ` using a single asterisk (``*``) before the name::" msgstr "" -#: ../../library/typing.rst:1732 +#: ../../library/typing.rst:1736 msgid "Or by explicitly invoking the ``TypeVarTuple`` constructor::" msgstr "" -#: ../../library/typing.rst:1740 +#: ../../library/typing.rst:1744 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1649,7 +1649,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1762 +#: ../../library/typing.rst:1766 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1659,36 +1659,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1770 +#: ../../library/typing.rst:1774 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1777 +#: ../../library/typing.rst:1781 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1785 +#: ../../library/typing.rst:1789 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:1805 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1808 +#: ../../library/typing.rst:1812 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1818 +#: ../../library/typing.rst:1822 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1697,39 +1697,39 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1825 +#: ../../library/typing.rst:1829 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1829 +#: ../../library/typing.rst:1833 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1835 +#: ../../library/typing.rst:1839 msgid "" "Type variable tuples can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:1840 +#: ../../library/typing.rst:1844 msgid "" -"Parameter specification variable. A specialized version of :class:`type " -"variables `." +"Parameter specification variable. A specialized version of :ref:`type " +"variables `." msgstr "" -#: ../../library/typing.rst:1843 +#: ../../library/typing.rst:1847 msgid "" "In :ref:`type parameter lists `, parameter specifications can " "be declared with two asterisks (``**``)::" msgstr "" -#: ../../library/typing.rst:1848 +#: ../../library/typing.rst:1852 msgid "" "For compatibility with Python 3.11 and earlier, ``ParamSpec`` objects can " "also be created as follows::" msgstr "" -#: ../../library/typing.rst:1853 +#: ../../library/typing.rst:1857 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1739,7 +1739,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1860 +#: ../../library/typing.rst:1864 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1747,27 +1747,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1880 +#: ../../library/typing.rst:1884 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1884 +#: ../../library/typing.rst:1888 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1886 +#: ../../library/typing.rst:1890 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1893 +#: ../../library/typing.rst:1897 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1780,11 +1780,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1905 +#: ../../library/typing.rst:1909 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1907 +#: ../../library/typing.rst:1911 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1793,23 +1793,23 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1917 +#: ../../library/typing.rst:1921 msgid "" "Parameter specifications can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:1921 +#: ../../library/typing.rst:1925 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1927 +#: ../../library/typing.rst:1931 msgid ":data:`Concatenate`" msgstr "" -#: ../../library/typing.rst:1933 +#: ../../library/typing.rst:1937 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1817,75 +1817,75 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1938 +#: ../../library/typing.rst:1942 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1955 +#: ../../library/typing.rst:1959 msgid "The type of type aliases created through the :keyword:`type` statement." msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:1973 msgid "The name of the type alias:" msgstr "" -#: ../../library/typing.rst:1979 +#: ../../library/typing.rst:1983 msgid "The module in which the type alias was defined::" msgstr "" -#: ../../library/typing.rst:1987 +#: ../../library/typing.rst:1991 msgid "" "The type parameters of the type alias, or an empty tuple if the alias is not " "generic:" msgstr "" -#: ../../library/typing.rst:2001 +#: ../../library/typing.rst:2005 msgid "" "The type alias's value. This is :ref:`lazily evaluated `, " "so names used in the definition of the alias are not resolved until the " "``__value__`` attribute is accessed:" msgstr "" -#: ../../library/typing.rst:2019 +#: ../../library/typing.rst:2023 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2025 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:2027 +#: ../../library/typing.rst:2031 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:2029 ../../library/typing.rst:2106 -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:2033 ../../library/typing.rst:2110 +#: ../../library/typing.rst:3076 msgid "Usage::" msgstr "" -#: ../../library/typing.rst:2035 +#: ../../library/typing.rst:2039 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:2039 +#: ../../library/typing.rst:2043 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:2048 +#: ../../library/typing.rst:2052 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:2050 +#: ../../library/typing.rst:2054 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1894,83 +1894,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:2056 +#: ../../library/typing.rst:2060 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:2066 +#: ../../library/typing.rst:2070 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:2072 +#: ../../library/typing.rst:2076 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:2082 +#: ../../library/typing.rst:2086 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:2085 +#: ../../library/typing.rst:2089 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:2088 +#: ../../library/typing.rst:2092 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:2092 +#: ../../library/typing.rst:2096 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:2096 +#: ../../library/typing.rst:2100 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:2101 +#: ../../library/typing.rst:2105 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:2103 +#: ../../library/typing.rst:2107 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:2113 +#: ../../library/typing.rst:2117 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:2117 +#: ../../library/typing.rst:2121 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:2121 +#: ../../library/typing.rst:2125 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:2125 +#: ../../library/typing.rst:2129 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:2130 +#: ../../library/typing.rst:2134 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:2132 +#: ../../library/typing.rst:2136 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:2138 +#: ../../library/typing.rst:2142 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:2150 +#: ../../library/typing.rst:2154 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1978,21 +1978,21 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2159 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:2161 +#: ../../library/typing.rst:2165 msgid "" "In code that needs to be compatible with Python 3.11 or older, generic " "Protocols can be written as follows::" msgstr "" -#: ../../library/typing.rst:2174 +#: ../../library/typing.rst:2178 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:2176 +#: ../../library/typing.rst:2180 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -2001,7 +2001,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:2196 +#: ../../library/typing.rst:2200 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -2012,7 +2012,7 @@ msgid "" "(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2211 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -2020,7 +2020,7 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:2215 +#: ../../library/typing.rst:2219 msgid "" "The internal implementation of :func:`isinstance` checks against runtime-" "checkable protocols now uses :func:`inspect.getattr_static` to look up " @@ -2030,7 +2030,7 @@ msgid "" "versa. Most users are unlikely to be affected by this change." msgstr "" -#: ../../library/typing.rst:2224 +#: ../../library/typing.rst:2228 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -2039,13 +2039,13 @@ msgid "" "`\"What's new in Python 3.12\" ` for more details." msgstr "" -#: ../../library/typing.rst:2235 +#: ../../library/typing.rst:2239 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:2238 +#: ../../library/typing.rst:2242 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -2053,53 +2053,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:2254 +#: ../../library/typing.rst:2258 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:2258 +#: ../../library/typing.rst:2262 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:2262 +#: ../../library/typing.rst:2266 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:2269 +#: ../../library/typing.rst:2273 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:2270 +#: ../../library/typing.rst:2274 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:2282 +#: ../../library/typing.rst:2286 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:2293 +#: ../../library/typing.rst:2297 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2296 +#: ../../library/typing.rst:2300 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2306 +#: ../../library/typing.rst:2310 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -2107,53 +2107,53 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2311 +#: ../../library/typing.rst:2315 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2326 +#: ../../library/typing.rst:2330 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:2333 +#: ../../library/typing.rst:2337 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2341 +#: ../../library/typing.rst:2345 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2356 +#: ../../library/typing.rst:2360 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:2362 +#: ../../library/typing.rst:2366 msgid "" "To create a generic ``TypedDict`` that is compatible with Python 3.11 or " "lower, inherit from :class:`Generic` explicitly:" msgstr "" -#: ../../library/typing.rst:2373 +#: ../../library/typing.rst:2377 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2379 +#: ../../library/typing.rst:2383 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2395 +#: ../../library/typing.rst:2399 msgid "" "This attribute reflects *only* the value of the ``total`` argument to the " "current ``TypedDict`` class, not whether the class is semantically total. " @@ -2164,21 +2164,21 @@ msgid "" "introspection." msgstr "" -#: ../../library/typing.rst:2408 +#: ../../library/typing.rst:2412 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2411 +#: ../../library/typing.rst:2415 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2414 +#: ../../library/typing.rst:2418 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -2187,7 +2187,7 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2439 +#: ../../library/typing.rst:2443 msgid "" "If ``from __future__ import annotations`` is used or if annotations are " "given as strings, annotations are not evaluated when the ``TypedDict`` is " @@ -2196,133 +2196,133 @@ msgid "" "attributes may be incorrect." msgstr "" -#: ../../library/typing.rst:2445 +#: ../../library/typing.rst:2449 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2449 +#: ../../library/typing.rst:2453 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2453 +#: ../../library/typing.rst:2457 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2457 +#: ../../library/typing.rst:2461 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2459 +#: ../../library/typing.rst:2463 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2464 +#: ../../library/typing.rst:2468 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2469 +#: ../../library/typing.rst:2473 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2473 +#: ../../library/typing.rst:2477 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2481 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2481 +#: ../../library/typing.rst:2485 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2487 +#: ../../library/typing.rst:2491 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2491 +#: ../../library/typing.rst:2495 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2495 +#: ../../library/typing.rst:2499 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2501 +#: ../../library/typing.rst:2505 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2507 +#: ../../library/typing.rst:2511 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2511 +#: ../../library/typing.rst:2515 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2513 +#: ../../library/typing.rst:2517 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2520 +#: ../../library/typing.rst:2524 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2522 +#: ../../library/typing.rst:2526 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2525 +#: ../../library/typing.rst:2529 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2532 +#: ../../library/typing.rst:2536 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2546 +#: ../../library/typing.rst:2550 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2548 +#: ../../library/typing.rst:2552 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2559 +#: ../../library/typing.rst:2563 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2564 +#: ../../library/typing.rst:2568 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2332,59 +2332,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2576 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2575 +#: ../../library/typing.rst:2579 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2583 +#: ../../library/typing.rst:2587 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2585 +#: ../../library/typing.rst:2589 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2591 +#: ../../library/typing.rst:2595 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2594 +#: ../../library/typing.rst:2598 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2599 +#: ../../library/typing.rst:2603 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2604 +#: ../../library/typing.rst:2608 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2616 +#: ../../library/typing.rst:2620 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2619 +#: ../../library/typing.rst:2623 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2393,19 +2393,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2626 +#: ../../library/typing.rst:2630 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2640 +#: ../../library/typing.rst:2644 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2649 +#: ../../library/typing.rst:2653 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2664 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2798 +#: ../../library/typing.rst:2804 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2623,32 +2623,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2805 +#: ../../library/typing.rst:2811 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2813 +#: ../../library/typing.rst:2819 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2815 +#: ../../library/typing.rst:2821 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2822 +#: ../../library/typing.rst:2828 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2824 +#: ../../library/typing.rst:2830 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2849 +#: ../../library/typing.rst:2855 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2658,11 +2658,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2860 +#: ../../library/typing.rst:2866 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:2868 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2670,38 +2670,38 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2874 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2872 +#: ../../library/typing.rst:2878 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2874 +#: ../../library/typing.rst:2880 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2880 +#: ../../library/typing.rst:2886 msgid "" "Decorator to indicate that a method in a subclass is intended to override a " "method or attribute in a superclass." msgstr "" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2889 msgid "" "Type checkers should emit an error if a method decorated with ``@override`` " "does not, in fact, override anything. This helps prevent bugs that may occur " "when a base class is changed without an equivalent change to a child class." msgstr "" -#: ../../library/typing.rst:2905 +#: ../../library/typing.rst:2911 msgid "There is no runtime checking of this property." msgstr "" -#: ../../library/typing.rst:2907 +#: ../../library/typing.rst:2913 msgid "" "The decorator will attempt to set an ``__override__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, " @@ -2711,38 +2711,38 @@ msgid "" "without raising an exception." msgstr "" -#: ../../library/typing.rst:2914 +#: ../../library/typing.rst:2920 msgid "See :pep:`698` for more details." msgstr "更多細節請見 :pep:`698`。" -#: ../../library/typing.rst:2921 +#: ../../library/typing.rst:2927 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2923 +#: ../../library/typing.rst:2929 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2934 +#: ../../library/typing.rst:2940 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2938 +#: ../../library/typing.rst:2944 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2942 +#: ../../library/typing.rst:2948 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2945 +#: ../../library/typing.rst:2951 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2751,21 +2751,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2951 +#: ../../library/typing.rst:2957 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example:" msgstr "" -#: ../../library/typing.rst:2968 +#: ../../library/typing.rst:2974 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2973 +#: ../../library/typing.rst:2979 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2773,20 +2773,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2977 +#: ../../library/typing.rst:2983 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2984 +#: ../../library/typing.rst:2990 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2987 +#: ../../library/typing.rst:2993 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2794,17 +2794,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2993 ../../library/typing.rst:3016 +#: ../../library/typing.rst:2999 ../../library/typing.rst:3022 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:3008 +#: ../../library/typing.rst:3014 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:3011 +#: ../../library/typing.rst:3017 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2812,40 +2812,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:3028 +#: ../../library/typing.rst:3034 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3049 +#: ../../library/typing.rst:3055 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:3051 +#: ../../library/typing.rst:3057 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:3056 +#: ../../library/typing.rst:3062 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:3063 +#: ../../library/typing.rst:3069 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3067 +#: ../../library/typing.rst:3073 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:3078 +#: ../../library/typing.rst:3084 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2853,7 +2853,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3085 +#: ../../library/typing.rst:3091 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2861,11 +2861,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3097 +#: ../../library/typing.rst:3103 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:3099 +#: ../../library/typing.rst:3105 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2874,7 +2874,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:3106 +#: ../../library/typing.rst:3112 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -2882,7 +2882,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3117 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " @@ -2890,188 +2890,188 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:3116 +#: ../../library/typing.rst:3122 msgid "" "Type checkers are encouraged to flag uses of the deprecated types if the " "program they are checking targets a minimum Python version of 3.9 or newer." msgstr "" -#: ../../library/typing.rst:3122 +#: ../../library/typing.rst:3128 msgid "Aliases to built-in types" msgstr "內建型別的別名" -#: ../../library/typing.rst:3126 +#: ../../library/typing.rst:3132 msgid "Deprecated alias to :class:`dict`." msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:3128 +#: ../../library/typing.rst:3134 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:3132 ../../library/typing.rst:3374 +#: ../../library/typing.rst:3138 ../../library/typing.rst:3380 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:3137 +#: ../../library/typing.rst:3143 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3143 +#: ../../library/typing.rst:3149 msgid "Deprecated alias to :class:`list`." msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:3145 +#: ../../library/typing.rst:3151 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:3149 +#: ../../library/typing.rst:3155 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:3157 +#: ../../library/typing.rst:3163 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3163 +#: ../../library/typing.rst:3169 msgid "Deprecated alias to :class:`builtins.set `." msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:3165 +#: ../../library/typing.rst:3171 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:3169 +#: ../../library/typing.rst:3175 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3181 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:3177 +#: ../../library/typing.rst:3183 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3184 +#: ../../library/typing.rst:3190 msgid "Deprecated alias for :class:`tuple`." msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:3186 +#: ../../library/typing.rst:3192 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:3189 +#: ../../library/typing.rst:3195 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3195 +#: ../../library/typing.rst:3201 msgid "Deprecated alias to :class:`type`." msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:3197 +#: ../../library/typing.rst:3203 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3208 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3209 +#: ../../library/typing.rst:3215 msgid "Aliases to types in :mod:`collections`" msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:3213 +#: ../../library/typing.rst:3219 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:3217 +#: ../../library/typing.rst:3223 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3223 +#: ../../library/typing.rst:3229 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:3227 +#: ../../library/typing.rst:3233 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3233 +#: ../../library/typing.rst:3239 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:3238 +#: ../../library/typing.rst:3244 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3244 +#: ../../library/typing.rst:3250 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:3249 +#: ../../library/typing.rst:3255 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3255 +#: ../../library/typing.rst:3261 msgid "Deprecated alias to :class:`collections.deque`." msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:3260 +#: ../../library/typing.rst:3266 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3267 +#: ../../library/typing.rst:3273 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:3272 +#: ../../library/typing.rst:3278 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3276 +#: ../../library/typing.rst:3282 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3285 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -3079,391 +3079,391 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3293 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3288 +#: ../../library/typing.rst:3294 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3294 +#: ../../library/typing.rst:3300 msgid "Deprecated alias for :class:`str`." msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:3296 +#: ../../library/typing.rst:3302 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:3300 +#: ../../library/typing.rst:3306 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:3308 +#: ../../library/typing.rst:3314 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:3318 +#: ../../library/typing.rst:3324 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:3322 +#: ../../library/typing.rst:3328 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:3324 +#: ../../library/typing.rst:3330 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3330 +#: ../../library/typing.rst:3336 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:3334 +#: ../../library/typing.rst:3340 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:3338 +#: ../../library/typing.rst:3344 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:3342 +#: ../../library/typing.rst:3348 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3348 +#: ../../library/typing.rst:3354 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:3350 +#: ../../library/typing.rst:3356 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3356 +#: ../../library/typing.rst:3362 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:3358 +#: ../../library/typing.rst:3364 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3364 +#: ../../library/typing.rst:3370 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3366 +#: ../../library/typing.rst:3372 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3372 +#: ../../library/typing.rst:3378 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3379 +#: ../../library/typing.rst:3385 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3385 +#: ../../library/typing.rst:3391 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3387 +#: ../../library/typing.rst:3393 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3393 +#: ../../library/typing.rst:3399 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3395 +#: ../../library/typing.rst:3401 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3402 +#: ../../library/typing.rst:3408 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3404 +#: ../../library/typing.rst:3410 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3411 +#: ../../library/typing.rst:3417 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3413 +#: ../../library/typing.rst:3419 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3419 +#: ../../library/typing.rst:3425 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3421 +#: ../../library/typing.rst:3427 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3427 +#: ../../library/typing.rst:3433 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3429 +#: ../../library/typing.rst:3435 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3436 +#: ../../library/typing.rst:3442 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3440 +#: ../../library/typing.rst:3446 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3442 +#: ../../library/typing.rst:3448 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3453 +#: ../../library/typing.rst:3459 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3459 +#: ../../library/typing.rst:3465 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3461 +#: ../../library/typing.rst:3467 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3470 +#: ../../library/typing.rst:3476 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:3474 +#: ../../library/typing.rst:3480 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3482 +#: ../../library/typing.rst:3488 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3492 +#: ../../library/typing.rst:3498 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3499 +#: ../../library/typing.rst:3505 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3503 +#: ../../library/typing.rst:3509 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3509 +#: ../../library/typing.rst:3515 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3513 +#: ../../library/typing.rst:3519 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3519 +#: ../../library/typing.rst:3525 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3523 +#: ../../library/typing.rst:3529 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3530 +#: ../../library/typing.rst:3536 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3534 +#: ../../library/typing.rst:3540 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3536 +#: ../../library/typing.rst:3542 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3542 +#: ../../library/typing.rst:3548 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3544 +#: ../../library/typing.rst:3550 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3550 +#: ../../library/typing.rst:3556 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "棄用 :class:`collections.abc.Callable` 的別名。" -#: ../../library/typing.rst:3552 +#: ../../library/typing.rst:3558 msgid "" "See :ref:`annotating-callables` for details on how to use :class:" "`collections.abc.Callable` and ``typing.Callable`` in type annotations." msgstr "" -#: ../../library/typing.rst:3555 +#: ../../library/typing.rst:3561 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3565 +#: ../../library/typing.rst:3571 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "棄用 :class:`collections.abc.Generator` 的別名。" -#: ../../library/typing.rst:3567 +#: ../../library/typing.rst:3573 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3576 +#: ../../library/typing.rst:3582 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:3580 +#: ../../library/typing.rst:3586 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3588 +#: ../../library/typing.rst:3594 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3596 +#: ../../library/typing.rst:3602 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3602 +#: ../../library/typing.rst:3608 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" -#: ../../library/typing.rst:3604 +#: ../../library/typing.rst:3610 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:3609 +#: ../../library/typing.rst:3615 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:3611 +#: ../../library/typing.rst:3617 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3617 +#: ../../library/typing.rst:3623 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:3619 +#: ../../library/typing.rst:3625 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "改為直接使用 :class:`collections.abc.Sized`。" -#: ../../library/typing.rst:3625 +#: ../../library/typing.rst:3631 msgid "Aliases to :mod:`contextlib` ABCs" msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:3629 +#: ../../library/typing.rst:3635 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3634 +#: ../../library/typing.rst:3640 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3641 +#: ../../library/typing.rst:3647 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3646 +#: ../../library/typing.rst:3652 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3652 +#: ../../library/typing.rst:3658 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3654 +#: ../../library/typing.rst:3660 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3471,99 +3471,99 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3661 +#: ../../library/typing.rst:3667 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3662 +#: ../../library/typing.rst:3668 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3663 +#: ../../library/typing.rst:3669 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3664 +#: ../../library/typing.rst:3670 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3665 +#: ../../library/typing.rst:3671 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "``typing.io`` 和 ``typing.re`` 子模組" -#: ../../library/typing.rst:3666 +#: ../../library/typing.rst:3672 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3667 +#: ../../library/typing.rst:3673 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3668 +#: ../../library/typing.rst:3674 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3669 +#: ../../library/typing.rst:3675 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3670 ../../library/typing.rst:3674 +#: ../../library/typing.rst:3676 ../../library/typing.rst:3680 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3671 +#: ../../library/typing.rst:3677 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3672 +#: ../../library/typing.rst:3678 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3673 +#: ../../library/typing.rst:3679 msgid ":class:`typing.ByteString`" msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3675 +#: ../../library/typing.rst:3681 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3676 +#: ../../library/typing.rst:3682 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3677 +#: ../../library/typing.rst:3683 msgid ":data:`typing.Text`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3678 +#: ../../library/typing.rst:3684 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3679 ../../library/typing.rst:3683 -#: ../../library/typing.rst:3687 +#: ../../library/typing.rst:3685 ../../library/typing.rst:3689 +#: ../../library/typing.rst:3693 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3680 +#: ../../library/typing.rst:3686 msgid ":gh:`92332`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3681 +#: ../../library/typing.rst:3687 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`。" -#: ../../library/typing.rst:3682 ../../library/typing.rst:3686 +#: ../../library/typing.rst:3688 ../../library/typing.rst:3692 msgid "3.12" msgstr "" -#: ../../library/typing.rst:3684 +#: ../../library/typing.rst:3690 msgid ":gh:`94309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:3685 +#: ../../library/typing.rst:3691 msgid ":data:`typing.TypeAlias`" msgstr ":data:`typing.TypeAlias`" -#: ../../library/typing.rst:3688 +#: ../../library/typing.rst:3694 msgid ":pep:`695`" msgstr ":pep:`695`" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 17cf967b7f..6b9d6326e3 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-10-10 21:59+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"PO-Revision-Date: 2023-09-09 23:07+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -1459,7 +1459,7 @@ msgid "" ":func:`patch.dict` can be used with dictionary like objects that aren't " "actually dictionaries. At the very minimum they must support item getting, " "setting, deleting and either iteration or membership test. This corresponds " -"to the magic methods :meth:`__getitem__`, :meth:`__setitem__`, :meth:" +"to the magic methods :meth:`~object.__getitem__`, :meth:`__setitem__`, :meth:" "`__delitem__` and either :meth:`__iter__` or :meth:`__contains__`." msgstr "" @@ -2320,8 +2320,8 @@ msgstr "" #: ../../library/unittest.mock.rst:2484 msgid "" "The issue is that even if you mock out the call to :func:`open` it is the " -"*returned object* that is used as a context manager (and has :meth:" -"`__enter__` and :meth:`__exit__` called)." +"*returned object* that is used as a context manager (and has :meth:`~object." +"__enter__` and :meth:`~object.__exit__` called)." msgstr "" #: ../../library/unittest.mock.rst:2488 diff --git a/library/wsgiref.po b/library/wsgiref.po index ff281215b8..0c898ef064 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-22 00:16+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -246,7 +246,7 @@ msgid "" msgstr "" #: ../../library/wsgiref.rst:182 -msgid "Support for :meth:`__getitem__` method has been removed." +msgid "Support for :meth:`~object.__getitem__` method has been removed." msgstr "" #: ../../library/wsgiref.rst:187 @@ -269,13 +269,13 @@ msgstr "" #: ../../library/wsgiref.rst:203 msgid "" ":class:`Headers` objects support typical mapping operations including :meth:" -"`__getitem__`, :meth:`get`, :meth:`__setitem__`, :meth:`setdefault`, :meth:" -"`__delitem__` and :meth:`__contains__`. For each of these methods, the key " -"is the header name (treated case-insensitively), and the value is the first " -"value associated with that header name. Setting a header deletes any " -"existing values for that header, then adds a new value at the end of the " -"wrapped header list. Headers' existing order is generally maintained, with " -"new headers added to the end of the wrapped list." +"`~object.__getitem__`, :meth:`get`, :meth:`__setitem__`, :meth:" +"`setdefault`, :meth:`__delitem__` and :meth:`__contains__`. For each of " +"these methods, the key is the header name (treated case-insensitively), and " +"the value is the first value associated with that header name. Setting a " +"header deletes any existing values for that header, then adds a new value at " +"the end of the wrapped header list. Headers' existing order is generally " +"maintained, with new headers added to the end of the wrapped list." msgstr "" #: ../../library/wsgiref.rst:212 diff --git a/library/xml.dom.pulldom.po b/library/xml.dom.pulldom.po index 818fcc93e9..d8ead6c8c4 100644 --- a/library/xml.dom.pulldom.po +++ b/library/xml.dom.pulldom.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -153,7 +153,7 @@ msgid "DOMEventStream Objects" msgstr "DOMEventStream 物件" #: ../../library/xml.dom.pulldom.rst:117 -msgid "Support for :meth:`__getitem__` method has been removed." +msgid "Support for :meth:`~object.__getitem__` method has been removed." msgstr "" #: ../../library/xml.dom.pulldom.rst:122 diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 99998e7c40..6985eb992d 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,7 +38,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:19 msgid "The :mod:`!xml.etree.cElementTree` module is deprecated." -msgstr "" +msgstr ":mod:`!xml.etree.cElementTree` 模組已被棄用。" #: ../../library/xml.etree.elementtree.rst:25 msgid "" @@ -49,7 +49,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:30 msgid "Tutorial" -msgstr "" +msgstr "教學" #: ../../library/xml.etree.elementtree.rst:32 msgid "" @@ -75,7 +75,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:50 msgid "Parsing XML" -msgstr "" +msgstr "剖析 XML" #: ../../library/xml.etree.elementtree.rst:52 msgid "" @@ -147,14 +147,14 @@ msgid "" "XML elements, call :meth:`XMLPullParser.read_events`. Here is an example::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:158 +#: ../../library/xml.etree.elementtree.rst:159 msgid "" "The obvious use case is applications that operate in a non-blocking fashion " "where the XML data is being received from a socket or read incrementally " "from some storage device. In such cases, blocking reads are unacceptable." msgstr "" -#: ../../library/xml.etree.elementtree.rst:162 +#: ../../library/xml.etree.elementtree.rst:163 msgid "" "Because it's so flexible, :class:`XMLPullParser` can be inconvenient to use " "for simpler use-cases. If you don't mind your application blocking on " @@ -164,18 +164,18 @@ msgid "" "memory." msgstr "" -#: ../../library/xml.etree.elementtree.rst:169 +#: ../../library/xml.etree.elementtree.rst:170 msgid "Finding interesting elements" msgstr "" -#: ../../library/xml.etree.elementtree.rst:171 +#: ../../library/xml.etree.elementtree.rst:172 msgid "" ":class:`Element` has some useful methods that help iterate recursively over " "all the sub-tree below it (its children, their children, and so on). For " "example, :meth:`Element.iter`::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:184 +#: ../../library/xml.etree.elementtree.rst:185 msgid "" ":meth:`Element.findall` finds only elements with a tag which are direct " "children of the current element. :meth:`Element.find` finds the *first* " @@ -183,23 +183,23 @@ msgid "" "text content. :meth:`Element.get` accesses the element's attributes::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:198 +#: ../../library/xml.etree.elementtree.rst:199 msgid "" "More sophisticated specification of which elements to look for is possible " "by using :ref:`XPath `." msgstr "" -#: ../../library/xml.etree.elementtree.rst:202 +#: ../../library/xml.etree.elementtree.rst:203 msgid "Modifying an XML File" -msgstr "" +msgstr "改動 XML 檔案" -#: ../../library/xml.etree.elementtree.rst:204 +#: ../../library/xml.etree.elementtree.rst:205 msgid "" ":class:`ElementTree` provides a simple way to build XML documents and write " "them to files. The :meth:`ElementTree.write` method serves this purpose." msgstr "" -#: ../../library/xml.etree.elementtree.rst:207 +#: ../../library/xml.etree.elementtree.rst:208 msgid "" "Once created, an :class:`Element` object may be manipulated by directly " "changing its fields (such as :attr:`Element.text`), adding and modifying " @@ -207,24 +207,24 @@ msgid "" "example with :meth:`Element.append`)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:212 +#: ../../library/xml.etree.elementtree.rst:213 msgid "" "Let's say we want to add one to each country's rank, and add an ``updated`` " "attribute to the rank element::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:222 -#: ../../library/xml.etree.elementtree.rst:266 +#: ../../library/xml.etree.elementtree.rst:223 +#: ../../library/xml.etree.elementtree.rst:267 msgid "Our XML now looks like this:" -msgstr "" +msgstr "XML 現在看起來像這樣:" -#: ../../library/xml.etree.elementtree.rst:250 +#: ../../library/xml.etree.elementtree.rst:251 msgid "" "We can remove elements using :meth:`Element.remove`. Let's say we want to " "remove all countries with a rank higher than 50::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:261 +#: ../../library/xml.etree.elementtree.rst:262 msgid "" "Note that concurrent modification while iterating can lead to problems, just " "like when iterating and modifying Python lists or dicts. Therefore, the " @@ -232,21 +232,21 @@ msgid "" "only then iterates over the list of matches." msgstr "" -#: ../../library/xml.etree.elementtree.rst:288 +#: ../../library/xml.etree.elementtree.rst:289 msgid "Building XML documents" msgstr "" -#: ../../library/xml.etree.elementtree.rst:290 +#: ../../library/xml.etree.elementtree.rst:291 msgid "" "The :func:`SubElement` function also provides a convenient way to create new " "sub-elements for a given element::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:301 +#: ../../library/xml.etree.elementtree.rst:302 msgid "Parsing XML with Namespaces" msgstr "" -#: ../../library/xml.etree.elementtree.rst:303 +#: ../../library/xml.etree.elementtree.rst:304 msgid "" "If the XML input has `namespaces `__, tags and attributes with prefixes in the form ``prefix:" @@ -256,34 +256,34 @@ msgid "" "prefixed tags." msgstr "" -#: ../../library/xml.etree.elementtree.rst:311 +#: ../../library/xml.etree.elementtree.rst:312 msgid "" "Here is an XML example that incorporates two namespaces, one with the prefix " "\"fictional\" and the other serving as the default namespace:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:332 +#: ../../library/xml.etree.elementtree.rst:333 msgid "" "One way to search and explore this XML example is to manually add the URI to " "every tag or attribute in the xpath of a :meth:`~Element.find` or :meth:" "`~Element.findall`::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:343 +#: ../../library/xml.etree.elementtree.rst:344 msgid "" "A better way to search the namespaced XML example is to create a dictionary " "with your own prefixes and use those in the search functions::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:355 +#: ../../library/xml.etree.elementtree.rst:356 msgid "These two approaches both output::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:369 +#: ../../library/xml.etree.elementtree.rst:370 msgid "XPath support" -msgstr "" +msgstr "XPath 支援" -#: ../../library/xml.etree.elementtree.rst:371 +#: ../../library/xml.etree.elementtree.rst:372 msgid "" "This module provides limited support for `XPath expressions `_ for locating elements in a tree. The goal is to support a " @@ -291,41 +291,41 @@ msgid "" "scope of the module." msgstr "" -#: ../../library/xml.etree.elementtree.rst:377 -#: ../../library/xml.etree.elementtree.rst:769 +#: ../../library/xml.etree.elementtree.rst:378 +#: ../../library/xml.etree.elementtree.rst:772 msgid "Example" msgstr "範例" -#: ../../library/xml.etree.elementtree.rst:379 +#: ../../library/xml.etree.elementtree.rst:380 msgid "" "Here's an example that demonstrates some of the XPath capabilities of the " "module. We'll be using the ``countrydata`` XML document from the :ref:" "`Parsing XML ` section::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:403 +#: ../../library/xml.etree.elementtree.rst:404 msgid "" "For XML with namespaces, use the usual qualified ``{namespace}tag`` " "notation::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:410 +#: ../../library/xml.etree.elementtree.rst:411 msgid "Supported XPath syntax" msgstr "" -#: ../../library/xml.etree.elementtree.rst:415 +#: ../../library/xml.etree.elementtree.rst:416 msgid "Syntax" -msgstr "" +msgstr "語法" -#: ../../library/xml.etree.elementtree.rst:415 +#: ../../library/xml.etree.elementtree.rst:416 msgid "Meaning" -msgstr "" +msgstr "意義" -#: ../../library/xml.etree.elementtree.rst:417 +#: ../../library/xml.etree.elementtree.rst:418 msgid "``tag``" msgstr "``tag``" -#: ../../library/xml.etree.elementtree.rst:417 +#: ../../library/xml.etree.elementtree.rst:418 msgid "" "Selects all child elements with the given tag. For example, ``spam`` selects " "all child elements named ``spam``, and ``spam/egg`` selects all " @@ -335,133 +335,133 @@ msgid "" "not in a namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:426 +#: ../../library/xml.etree.elementtree.rst:427 msgid "Support for star-wildcards was added." -msgstr "" +msgstr "新增對星號萬用字元的支援。" -#: ../../library/xml.etree.elementtree.rst:429 +#: ../../library/xml.etree.elementtree.rst:430 msgid "``*``" msgstr "``*``" -#: ../../library/xml.etree.elementtree.rst:429 +#: ../../library/xml.etree.elementtree.rst:430 msgid "" "Selects all child elements, including comments and processing instructions. " "For example, ``*/egg`` selects all grandchildren named ``egg``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:433 +#: ../../library/xml.etree.elementtree.rst:434 msgid "``.``" msgstr "``.``" -#: ../../library/xml.etree.elementtree.rst:433 +#: ../../library/xml.etree.elementtree.rst:434 msgid "" "Selects the current node. This is mostly useful at the beginning of the " "path, to indicate that it's a relative path." msgstr "" -#: ../../library/xml.etree.elementtree.rst:437 +#: ../../library/xml.etree.elementtree.rst:438 msgid "``//``" msgstr "``//``" -#: ../../library/xml.etree.elementtree.rst:437 +#: ../../library/xml.etree.elementtree.rst:438 msgid "" "Selects all subelements, on all levels beneath the current element. For " "example, ``.//egg`` selects all ``egg`` elements in the entire tree." msgstr "" -#: ../../library/xml.etree.elementtree.rst:441 +#: ../../library/xml.etree.elementtree.rst:442 msgid "``..``" msgstr "``..``" -#: ../../library/xml.etree.elementtree.rst:441 +#: ../../library/xml.etree.elementtree.rst:442 msgid "" "Selects the parent element. Returns ``None`` if the path attempts to reach " "the ancestors of the start element (the element ``find`` was called on)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:445 +#: ../../library/xml.etree.elementtree.rst:446 msgid "``[@attrib]``" msgstr "``[@attrib]``" -#: ../../library/xml.etree.elementtree.rst:445 +#: ../../library/xml.etree.elementtree.rst:446 msgid "Selects all elements that have the given attribute." -msgstr "" +msgstr "選擇所有具有給定屬性的元素。" -#: ../../library/xml.etree.elementtree.rst:447 +#: ../../library/xml.etree.elementtree.rst:448 msgid "``[@attrib='value']``" msgstr "``[@attrib='value']``" -#: ../../library/xml.etree.elementtree.rst:447 +#: ../../library/xml.etree.elementtree.rst:448 msgid "" "Selects all elements for which the given attribute has the given value. The " "value cannot contain quotes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:451 +#: ../../library/xml.etree.elementtree.rst:452 msgid "``[@attrib!='value']``" msgstr "``[@attrib!='value']``" -#: ../../library/xml.etree.elementtree.rst:451 +#: ../../library/xml.etree.elementtree.rst:452 msgid "" "Selects all elements for which the given attribute does not have the given " "value. The value cannot contain quotes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:457 +#: ../../library/xml.etree.elementtree.rst:458 msgid "``[tag]``" msgstr "``[tag]``" -#: ../../library/xml.etree.elementtree.rst:457 +#: ../../library/xml.etree.elementtree.rst:458 msgid "" "Selects all elements that have a child named ``tag``. Only immediate " "children are supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:460 +#: ../../library/xml.etree.elementtree.rst:461 msgid "``[.='text']``" msgstr "``[.='text']``" -#: ../../library/xml.etree.elementtree.rst:460 +#: ../../library/xml.etree.elementtree.rst:461 msgid "" "Selects all elements whose complete text content, including descendants, " "equals the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:465 +#: ../../library/xml.etree.elementtree.rst:466 msgid "``[.!='text']``" msgstr "``[.!='text']``" -#: ../../library/xml.etree.elementtree.rst:465 +#: ../../library/xml.etree.elementtree.rst:466 msgid "" "Selects all elements whose complete text content, including descendants, " "does not equal the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:471 +#: ../../library/xml.etree.elementtree.rst:472 msgid "``[tag='text']``" msgstr "``[tag='text']``" -#: ../../library/xml.etree.elementtree.rst:471 +#: ../../library/xml.etree.elementtree.rst:472 msgid "" "Selects all elements that have a child named ``tag`` whose complete text " "content, including descendants, equals the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:475 +#: ../../library/xml.etree.elementtree.rst:476 msgid "``[tag!='text']``" msgstr "``[tag!='text']``" -#: ../../library/xml.etree.elementtree.rst:475 +#: ../../library/xml.etree.elementtree.rst:476 msgid "" "Selects all elements that have a child named ``tag`` whose complete text " "content, including descendants, does not equal the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:481 +#: ../../library/xml.etree.elementtree.rst:482 msgid "``[position]``" msgstr "``[position]``" -#: ../../library/xml.etree.elementtree.rst:481 +#: ../../library/xml.etree.elementtree.rst:482 msgid "" "Selects all elements that are located at the given position. The position " "can be either an integer (1 is the first position), the expression " @@ -469,28 +469,28 @@ msgid "" "position (e.g. ``last()-1``)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:488 +#: ../../library/xml.etree.elementtree.rst:489 msgid "" "Predicates (expressions within square brackets) must be preceded by a tag " "name, an asterisk, or another predicate. ``position`` predicates must be " "preceded by a tag name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:493 -#: ../../library/xml.etree.elementtree.rst:821 +#: ../../library/xml.etree.elementtree.rst:494 +#: ../../library/xml.etree.elementtree.rst:824 msgid "Reference" msgstr "" -#: ../../library/xml.etree.elementtree.rst:498 -#: ../../library/xml.etree.elementtree.rst:826 +#: ../../library/xml.etree.elementtree.rst:499 +#: ../../library/xml.etree.elementtree.rst:829 msgid "Functions" msgstr "函式" -#: ../../library/xml.etree.elementtree.rst:502 +#: ../../library/xml.etree.elementtree.rst:503 msgid "`C14N 2.0 `_ transformation function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:504 +#: ../../library/xml.etree.elementtree.rst:505 msgid "" "Canonicalization is a way to normalise XML output in a way that allows byte-" "by-byte comparisons and digital signatures. It reduced the freedom that XML " @@ -499,7 +499,7 @@ msgid "" "declarations, the ordering of attributes, and ignorable whitespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:510 +#: ../../library/xml.etree.elementtree.rst:511 msgid "" "This function takes an XML data string (*xml_data*) or a file path or file-" "like object (*from_file*) as input, converts it to the canonical form, and " @@ -508,63 +508,63 @@ msgid "" "should therefore be opened in text mode with ``utf-8`` encoding." msgstr "" -#: ../../library/xml.etree.elementtree.rst:517 +#: ../../library/xml.etree.elementtree.rst:518 msgid "Typical uses::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:528 +#: ../../library/xml.etree.elementtree.rst:529 msgid "The configuration *options* are as follows:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:530 +#: ../../library/xml.etree.elementtree.rst:531 msgid "*with_comments*: set to true to include comments (default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:531 +#: ../../library/xml.etree.elementtree.rst:532 msgid "" "*strip_text*: set to true to strip whitespace before and after text content" msgstr "" -#: ../../library/xml.etree.elementtree.rst:532 -#: ../../library/xml.etree.elementtree.rst:534 +#: ../../library/xml.etree.elementtree.rst:533 +#: ../../library/xml.etree.elementtree.rst:535 msgid "(default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:533 +#: ../../library/xml.etree.elementtree.rst:534 msgid "" "*rewrite_prefixes*: set to true to replace namespace prefixes by " "\"n{number}\"" msgstr "" -#: ../../library/xml.etree.elementtree.rst:535 +#: ../../library/xml.etree.elementtree.rst:536 msgid "*qname_aware_tags*: a set of qname aware tag names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:536 -#: ../../library/xml.etree.elementtree.rst:538 +#: ../../library/xml.etree.elementtree.rst:537 +#: ../../library/xml.etree.elementtree.rst:539 msgid "should be replaced in text content (default: empty)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:537 +#: ../../library/xml.etree.elementtree.rst:538 msgid "" "*qname_aware_attrs*: a set of qname aware attribute names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:539 +#: ../../library/xml.etree.elementtree.rst:540 msgid "*exclude_attrs*: a set of attribute names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:540 +#: ../../library/xml.etree.elementtree.rst:541 msgid "*exclude_tags*: a set of tag names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:542 +#: ../../library/xml.etree.elementtree.rst:543 msgid "" "In the option list above, \"a set\" refers to any collection or iterable of " "strings, no ordering is expected." msgstr "" -#: ../../library/xml.etree.elementtree.rst:550 +#: ../../library/xml.etree.elementtree.rst:551 msgid "" "Comment element factory. This factory function creates a special element " "that will be serialized as an XML comment by the standard serializer. The " @@ -573,7 +573,7 @@ msgid "" "representing a comment." msgstr "" -#: ../../library/xml.etree.elementtree.rst:556 +#: ../../library/xml.etree.elementtree.rst:557 msgid "" "Note that :class:`XMLParser` skips over comments in the input instead of " "creating comment objects for them. An :class:`ElementTree` will only contain " @@ -581,29 +581,29 @@ msgid "" "class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:563 +#: ../../library/xml.etree.elementtree.rst:564 msgid "" "Writes an element tree or element structure to sys.stdout. This function " "should be used for debugging only." msgstr "" -#: ../../library/xml.etree.elementtree.rst:566 +#: ../../library/xml.etree.elementtree.rst:567 msgid "" "The exact output format is implementation dependent. In this version, it's " "written as an ordinary XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:569 +#: ../../library/xml.etree.elementtree.rst:570 msgid "*elem* is an element tree or an individual element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:571 +#: ../../library/xml.etree.elementtree.rst:572 msgid "" "The :func:`dump` function now preserves the attribute order specified by the " "user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:578 +#: ../../library/xml.etree.elementtree.rst:579 msgid "" "Parses an XML section from a string constant. Same as :func:`XML`. *text* " "is a string containing XML data. *parser* is an optional parser instance. " @@ -611,7 +611,7 @@ msgid "" "class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:586 +#: ../../library/xml.etree.elementtree.rst:587 msgid "" "Parses an XML document from a sequence of string fragments. *sequence* is a " "list or other sequence containing XML data fragments. *parser* is an " @@ -619,7 +619,7 @@ msgid "" "parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:596 +#: ../../library/xml.etree.elementtree.rst:597 msgid "" "Appends whitespace to the subtree to indent the tree visually. This can be " "used to generate pretty-printed XML output. *tree* can be an Element or " @@ -629,13 +629,13 @@ msgid "" "indentation level as *level*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:608 +#: ../../library/xml.etree.elementtree.rst:609 msgid "" "Check if an object appears to be a valid element object. *element* is an " "element instance. Return ``True`` if this is an element object." msgstr "" -#: ../../library/xml.etree.elementtree.rst:614 +#: ../../library/xml.etree.elementtree.rst:615 msgid "" "Parses an XML section into an element tree incrementally, and reports what's " "going on to the user. *source* is a filename or :term:`file object` " @@ -646,11 +646,13 @@ msgid "" "omitted, only ``\"end\"`` events are reported. *parser* is an optional " "parser instance. If not given, the standard :class:`XMLParser` parser is " "used. *parser* must be a subclass of :class:`XMLParser` and can only use " -"the default :class:`TreeBuilder` as a target. Returns an :term:`iterator` " -"providing ``(event, elem)`` pairs." +"the default :class:`TreeBuilder` as a target. Returns an :term:`iterator` " +"providing ``(event, elem)`` pairs; it has a ``root`` attribute that " +"references the root element of the resulting XML tree once *source* is fully " +"read." msgstr "" -#: ../../library/xml.etree.elementtree.rst:626 +#: ../../library/xml.etree.elementtree.rst:629 msgid "" "Note that while :func:`iterparse` builds the tree incrementally, it issues " "blocking reads on *source* (or the file it names). As such, it's unsuitable " @@ -658,7 +660,7 @@ msgid "" "parsing, see :class:`XMLPullParser`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:633 +#: ../../library/xml.etree.elementtree.rst:636 msgid "" ":func:`iterparse` only guarantees that it has seen the \">\" character of a " "starting tag when it emits a \"start\" event, so the attributes are defined, " @@ -667,21 +669,21 @@ msgid "" "present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:639 -#: ../../library/xml.etree.elementtree.rst:1478 +#: ../../library/xml.etree.elementtree.rst:642 +#: ../../library/xml.etree.elementtree.rst:1481 msgid "If you need a fully populated element, look for \"end\" events instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:641 +#: ../../library/xml.etree.elementtree.rst:644 msgid "The *parser* argument." msgstr "*parser* 引數。" -#: ../../library/xml.etree.elementtree.rst:644 -#: ../../library/xml.etree.elementtree.rst:1482 +#: ../../library/xml.etree.elementtree.rst:647 +#: ../../library/xml.etree.elementtree.rst:1485 msgid "The ``comment`` and ``pi`` events were added." msgstr "新增 *context* 與 *check_hostname* 事件。" -#: ../../library/xml.etree.elementtree.rst:650 +#: ../../library/xml.etree.elementtree.rst:653 msgid "" "Parses an XML section into an element tree. *source* is a filename or file " "object containing XML data. *parser* is an optional parser instance. If " @@ -689,7 +691,7 @@ msgid "" "class:`ElementTree` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:658 +#: ../../library/xml.etree.elementtree.rst:661 msgid "" "PI element factory. This factory function creates a special element that " "will be serialized as an XML processing instruction. *target* is a string " @@ -697,7 +699,7 @@ msgid "" "given. Returns an element instance, representing a processing instruction." msgstr "" -#: ../../library/xml.etree.elementtree.rst:663 +#: ../../library/xml.etree.elementtree.rst:666 msgid "" "Note that :class:`XMLParser` skips over processing instructions in the input " "instead of creating comment objects for them. An :class:`ElementTree` will " @@ -705,7 +707,7 @@ msgid "" "the tree using one of the :class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:671 +#: ../../library/xml.etree.elementtree.rst:674 msgid "" "Registers a namespace prefix. The registry is global, and any existing " "mapping for either the given prefix or the namespace URI will be removed. " @@ -714,13 +716,13 @@ msgid "" "all possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:682 +#: ../../library/xml.etree.elementtree.rst:685 msgid "" "Subelement factory. This function creates an element instance, and appends " "it to an existing element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:685 +#: ../../library/xml.etree.elementtree.rst:688 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *parent* is the parent element. *tag* is " @@ -729,7 +731,7 @@ msgid "" "arguments. Returns an element instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:696 +#: ../../library/xml.etree.elementtree.rst:699 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -741,24 +743,24 @@ msgid "" "Returns an (optionally) encoded string containing the XML data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:705 -#: ../../library/xml.etree.elementtree.rst:732 -#: ../../library/xml.etree.elementtree.rst:1189 +#: ../../library/xml.etree.elementtree.rst:708 +#: ../../library/xml.etree.elementtree.rst:735 +#: ../../library/xml.etree.elementtree.rst:1192 msgid "The *short_empty_elements* parameter." msgstr "*short_empty_elements* 參數。" -#: ../../library/xml.etree.elementtree.rst:708 -#: ../../library/xml.etree.elementtree.rst:735 +#: ../../library/xml.etree.elementtree.rst:711 +#: ../../library/xml.etree.elementtree.rst:738 msgid "The *xml_declaration* and *default_namespace* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:711 +#: ../../library/xml.etree.elementtree.rst:714 msgid "" "The :func:`tostring` function now preserves the attribute order specified by " "the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:720 +#: ../../library/xml.etree.elementtree.rst:723 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -772,13 +774,13 @@ msgid "" "join(tostringlist(element)) == tostring(element)``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:738 +#: ../../library/xml.etree.elementtree.rst:741 msgid "" "The :func:`tostringlist` function now preserves the attribute order " "specified by the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:745 +#: ../../library/xml.etree.elementtree.rst:748 msgid "" "Parses an XML section from a string constant. This function can be used to " "embed \"XML literals\" in Python code. *text* is a string containing XML " @@ -786,7 +788,7 @@ msgid "" "class:`XMLParser` parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:753 +#: ../../library/xml.etree.elementtree.rst:756 msgid "" "Parses an XML section from a string constant, and also returns a dictionary " "which maps from element id:s to elements. *text* is a string containing XML " @@ -795,11 +797,11 @@ msgid "" "`Element` instance and a dictionary." msgstr "" -#: ../../library/xml.etree.elementtree.rst:763 +#: ../../library/xml.etree.elementtree.rst:766 msgid "XInclude support" msgstr "" -#: ../../library/xml.etree.elementtree.rst:765 +#: ../../library/xml.etree.elementtree.rst:768 msgid "" "This module provides limited support for `XInclude directives `_, via the :mod:`xml.etree.ElementInclude` helper " @@ -807,7 +809,7 @@ msgid "" "element trees, based on information in the tree." msgstr "" -#: ../../library/xml.etree.elementtree.rst:771 +#: ../../library/xml.etree.elementtree.rst:774 msgid "" "Here's an example that demonstrates use of the XInclude module. To include " "an XML document in the current document, use the ``{http://www.w3.org/2001/" @@ -815,43 +817,43 @@ msgid "" "and use the **href** attribute to specify the document to include." msgstr "" -#: ../../library/xml.etree.elementtree.rst:780 +#: ../../library/xml.etree.elementtree.rst:783 msgid "" "By default, the **href** attribute is treated as a file name. You can use " "custom loaders to override this behaviour. Also note that the standard " "helper does not support XPointer syntax." msgstr "" -#: ../../library/xml.etree.elementtree.rst:782 +#: ../../library/xml.etree.elementtree.rst:785 msgid "" "To process this file, load it as usual, and pass the root element to the :" "mod:`xml.etree.ElementTree` module:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:793 +#: ../../library/xml.etree.elementtree.rst:796 msgid "" "The ElementInclude module replaces the ``{http://www.w3.org/2001/XInclude}" "include`` element with the root element from the **source.xml** document. " "The result might look something like this:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:801 +#: ../../library/xml.etree.elementtree.rst:804 msgid "" "If the **parse** attribute is omitted, it defaults to \"xml\". The href " "attribute is required." msgstr "" -#: ../../library/xml.etree.elementtree.rst:803 +#: ../../library/xml.etree.elementtree.rst:806 msgid "" "To include a text document, use the ``{http://www.w3.org/2001/XInclude}" "include`` element, and set the **parse** attribute to \"text\":" msgstr "" -#: ../../library/xml.etree.elementtree.rst:812 +#: ../../library/xml.etree.elementtree.rst:815 msgid "The result might look something like:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:833 +#: ../../library/xml.etree.elementtree.rst:836 msgid "" "Default loader. This default loader reads an included resource from disk. " "*href* is a URL. *parse* is for parse mode either \"xml\" or \"text\". " @@ -862,7 +864,7 @@ msgid "" "or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:845 +#: ../../library/xml.etree.elementtree.rst:848 msgid "" "This function expands XInclude directives. *elem* is the root element. " "*loader* is an optional resource loader. If omitted, it defaults to :func:" @@ -873,28 +875,28 @@ msgid "" "malicious content explosion. Pass a negative value to disable the limitation." msgstr "" -#: ../../library/xml.etree.elementtree.rst:853 +#: ../../library/xml.etree.elementtree.rst:856 msgid "" "Returns the expanded resource. If the parse mode is ``\"xml\"``, this is an " "ElementTree instance. If the parse mode is \"text\", this is a Unicode " "string. If the loader fails, it can return None or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:858 +#: ../../library/xml.etree.elementtree.rst:861 msgid "The *base_url* and *max_depth* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:865 +#: ../../library/xml.etree.elementtree.rst:868 msgid "Element Objects" msgstr "" -#: ../../library/xml.etree.elementtree.rst:872 +#: ../../library/xml.etree.elementtree.rst:875 msgid "" "Element class. This class defines the Element interface, and provides a " "reference implementation of this interface." msgstr "" -#: ../../library/xml.etree.elementtree.rst:875 +#: ../../library/xml.etree.elementtree.rst:878 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *tag* is the element name. *attrib* is an " @@ -902,13 +904,13 @@ msgid "" "additional attributes, given as keyword arguments." msgstr "" -#: ../../library/xml.etree.elementtree.rst:883 +#: ../../library/xml.etree.elementtree.rst:886 msgid "" "A string identifying what kind of data this element represents (the element " "type, in other words)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:890 +#: ../../library/xml.etree.elementtree.rst:893 msgid "" "These attributes can be used to hold additional data associated with the " "element. Their values are usually strings but may be any application-" @@ -919,7 +921,7 @@ msgid "" "the XML data" msgstr "" -#: ../../library/xml.etree.elementtree.rst:902 +#: ../../library/xml.etree.elementtree.rst:905 msgid "" "the *a* element has ``None`` for both *text* and *tail* attributes, the *b* " "element has *text* ``\"1\"`` and *tail* ``\"4\"``, the *c* element has " @@ -927,17 +929,17 @@ msgid "" "``None`` and *tail* ``\"3\"``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:907 +#: ../../library/xml.etree.elementtree.rst:910 msgid "" "To collect the inner text of an element, see :meth:`itertext`, for example " "``\"\".join(element.itertext())``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:910 +#: ../../library/xml.etree.elementtree.rst:913 msgid "Applications may store arbitrary objects in these attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:915 +#: ../../library/xml.etree.elementtree.rst:918 msgid "" "A dictionary containing the element's attributes. Note that while the " "*attrib* value is always a real mutable Python dictionary, an ElementTree " @@ -946,59 +948,59 @@ msgid "" "implementations, use the dictionary methods below whenever possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:921 +#: ../../library/xml.etree.elementtree.rst:924 msgid "The following dictionary-like methods work on the element attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:926 +#: ../../library/xml.etree.elementtree.rst:929 msgid "" "Resets an element. This function removes all subelements, clears all " "attributes, and sets the text and tail attributes to ``None``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:932 +#: ../../library/xml.etree.elementtree.rst:935 msgid "Gets the element attribute named *key*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:934 +#: ../../library/xml.etree.elementtree.rst:937 msgid "" "Returns the attribute value, or *default* if the attribute was not found." msgstr "" -#: ../../library/xml.etree.elementtree.rst:939 +#: ../../library/xml.etree.elementtree.rst:942 msgid "" "Returns the element attributes as a sequence of (name, value) pairs. The " "attributes are returned in an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:945 +#: ../../library/xml.etree.elementtree.rst:948 msgid "" "Returns the elements attribute names as a list. The names are returned in " "an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:951 +#: ../../library/xml.etree.elementtree.rst:954 msgid "Set the attribute *key* on the element to *value*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:953 +#: ../../library/xml.etree.elementtree.rst:956 msgid "The following methods work on the element's children (subelements)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:958 +#: ../../library/xml.etree.elementtree.rst:961 msgid "" "Adds the element *subelement* to the end of this element's internal list of " "subelements. Raises :exc:`TypeError` if *subelement* is not an :class:" "`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:965 +#: ../../library/xml.etree.elementtree.rst:968 msgid "" "Appends *subelements* from a sequence object with zero or more elements. " "Raises :exc:`TypeError` if a subelement is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:973 +#: ../../library/xml.etree.elementtree.rst:976 msgid "" "Finds the first subelement matching *match*. *match* may be a tag name or " "a :ref:`path `. Returns an element instance or " @@ -1007,7 +1009,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:982 +#: ../../library/xml.etree.elementtree.rst:985 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns a list containing all matching elements in document " @@ -1016,7 +1018,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:991 +#: ../../library/xml.etree.elementtree.rst:994 msgid "" "Finds text for the first subelement matching *match*. *match* may be a tag " "name or a :ref:`path `. Returns the text content of the " @@ -1027,13 +1029,13 @@ msgid "" "into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1002 +#: ../../library/xml.etree.elementtree.rst:1005 msgid "" "Inserts *subelement* at the given position in this element. Raises :exc:" "`TypeError` if *subelement* is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1008 +#: ../../library/xml.etree.elementtree.rst:1011 msgid "" "Creates a tree :term:`iterator` with the current element as the root. The " "iterator iterates over this element and all elements below it, in document " @@ -1042,7 +1044,7 @@ msgid "" "structure is modified during iteration, the result is undefined." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1019 +#: ../../library/xml.etree.elementtree.rst:1022 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns an iterable yielding all matching elements in document " @@ -1050,44 +1052,44 @@ msgid "" "name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1030 +#: ../../library/xml.etree.elementtree.rst:1033 msgid "" "Creates a text iterator. The iterator loops over this element and all " "subelements, in document order, and returns all inner text." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1038 +#: ../../library/xml.etree.elementtree.rst:1041 msgid "" "Creates a new element object of the same type as this element. Do not call " "this method, use the :func:`SubElement` factory function instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1044 +#: ../../library/xml.etree.elementtree.rst:1047 msgid "" "Removes *subelement* from the element. Unlike the find\\* methods this " "method compares elements based on the instance identity, not on tag value or " "contents." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1048 +#: ../../library/xml.etree.elementtree.rst:1051 msgid "" ":class:`Element` objects also support the following sequence type methods " "for working with subelements: :meth:`~object.__delitem__`, :meth:`~object." "__getitem__`, :meth:`~object.__setitem__`, :meth:`~object.__len__`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1053 +#: ../../library/xml.etree.elementtree.rst:1056 msgid "" "Caution: Elements with no subelements will test as ``False``. Testing the " "truth value of an Element is deprecated and will raise an exception in " "Python 3.14. Use specific ``len(elem)`` or ``elem is None`` test instead.::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1065 +#: ../../library/xml.etree.elementtree.rst:1068 msgid "Testing the truth value of an Element emits :exc:`DeprecationWarning`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1068 +#: ../../library/xml.etree.elementtree.rst:1071 msgid "" "Prior to Python 3.8, the serialisation order of the XML attributes of " "elements was artificially made predictable by sorting the attributes by " @@ -1096,7 +1098,7 @@ msgid "" "attributes were originally parsed or created by user code." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1074 +#: ../../library/xml.etree.elementtree.rst:1077 msgid "" "In general, user code should try not to depend on a specific ordering of " "attributes, given that the `XML Information Set `_ writer. Arguments are the " "same as for the :func:`canonicalize` function. This class does not build a " @@ -1332,11 +1334,11 @@ msgid "" "using the *write* function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1353 +#: ../../library/xml.etree.elementtree.rst:1356 msgid "XMLParser Objects" msgstr "XMLParser 物件" -#: ../../library/xml.etree.elementtree.rst:1358 +#: ../../library/xml.etree.elementtree.rst:1361 msgid "" "This class is the low-level building block of the module. It uses :mod:`xml." "parsers.expat` for efficient, event-based parsing of XML. It can be fed XML " @@ -1347,24 +1349,24 @@ msgid "" "XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1366 +#: ../../library/xml.etree.elementtree.rst:1369 msgid "" "Parameters are now :ref:`keyword-only `. The *html* " "argument no longer supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1373 +#: ../../library/xml.etree.elementtree.rst:1376 msgid "" "Finishes feeding data to the parser. Returns the result of calling the " "``close()`` method of the *target* passed during construction; by default, " "this is the toplevel document element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1380 +#: ../../library/xml.etree.elementtree.rst:1383 msgid "Feeds data to the parser. *data* is encoded data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1382 +#: ../../library/xml.etree.elementtree.rst:1385 msgid "" ":meth:`XMLParser.feed` calls *target*\\'s ``start(tag, attrs_dict)`` method " "for each opening tag, its ``end(tag)`` method for each closing tag, and data " @@ -1375,11 +1377,11 @@ msgid "" "of an XML file::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1426 +#: ../../library/xml.etree.elementtree.rst:1429 msgid "XMLPullParser Objects" msgstr "XMLPullParser 物件" -#: ../../library/xml.etree.elementtree.rst:1430 +#: ../../library/xml.etree.elementtree.rst:1433 msgid "" "A pull parser suitable for non-blocking applications. Its input-side API is " "similar to that of :class:`XMLParser`, but instead of pushing calls to a " @@ -1391,11 +1393,11 @@ msgid "" "If *events* is omitted, only ``\"end\"`` events are reported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1441 +#: ../../library/xml.etree.elementtree.rst:1444 msgid "Feed the given bytes data to the parser." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1445 +#: ../../library/xml.etree.elementtree.rst:1448 msgid "" "Signal the parser that the data stream is terminated. Unlike :meth:" "`XMLParser.close`, this method always returns :const:`None`. Any events not " @@ -1403,7 +1405,7 @@ msgid "" "`read_events`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1452 +#: ../../library/xml.etree.elementtree.rst:1455 msgid "" "Return an iterator over the events which have been encountered in the data " "fed to the parser. The iterator yields ``(event, elem)`` pairs, where " @@ -1412,25 +1414,25 @@ msgid "" "follows." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1458 +#: ../../library/xml.etree.elementtree.rst:1461 msgid "``start``, ``end``: the current Element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1459 +#: ../../library/xml.etree.elementtree.rst:1462 msgid "``comment``, ``pi``: the current comment / processing instruction" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1460 +#: ../../library/xml.etree.elementtree.rst:1463 msgid "" "``start-ns``: a tuple ``(prefix, uri)`` naming the declared namespace " "mapping." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1462 +#: ../../library/xml.etree.elementtree.rst:1465 msgid "``end-ns``: :const:`None` (this may change in a future version)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1464 +#: ../../library/xml.etree.elementtree.rst:1467 msgid "" "Events provided in a previous call to :meth:`read_events` will not be " "yielded again. Events are consumed from the internal queue only when they " @@ -1439,7 +1441,7 @@ msgid "" "results." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1472 +#: ../../library/xml.etree.elementtree.rst:1475 msgid "" ":class:`XMLPullParser` only guarantees that it has seen the \">\" character " "of a starting tag when it emits a \"start\" event, so the attributes are " @@ -1448,11 +1450,11 @@ msgid "" "be present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1487 +#: ../../library/xml.etree.elementtree.rst:1490 msgid "Exceptions" msgstr "例外" -#: ../../library/xml.etree.elementtree.rst:1491 +#: ../../library/xml.etree.elementtree.rst:1494 msgid "" "XML parse error, raised by the various parsing methods in this module when " "parsing fails. The string representation of an instance of this exception " @@ -1460,22 +1462,22 @@ msgid "" "following attributes available:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1498 +#: ../../library/xml.etree.elementtree.rst:1501 msgid "" "A numeric error code from the expat parser. See the documentation of :mod:" "`xml.parsers.expat` for the list of error codes and their meanings." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1503 +#: ../../library/xml.etree.elementtree.rst:1506 msgid "" "A tuple of *line*, *column* numbers, specifying where the error occurred." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1506 +#: ../../library/xml.etree.elementtree.rst:1509 msgid "Footnotes" msgstr "註解" -#: ../../library/xml.etree.elementtree.rst:1507 +#: ../../library/xml.etree.elementtree.rst:1510 msgid "" "The encoding string included in XML output should conform to the appropriate " "standards. For example, \"UTF-8\" is valid, but \"UTF8\" is not. See " diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 2978dd7513..b235260ac4 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -395,30 +395,31 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:492 -msgid "The context manager's :meth:`__enter__` is loaded for later use." +msgid "" +"The context manager's :meth:`~object.__enter__` is loaded for later use." msgstr "" #: ../../reference/compound_stmts.rst:494 -msgid "The context manager's :meth:`__exit__` is loaded for later use." +msgid "The context manager's :meth:`~object.__exit__` is loaded for later use." msgstr "" #: ../../reference/compound_stmts.rst:496 -msgid "The context manager's :meth:`__enter__` method is invoked." +msgid "The context manager's :meth:`~object.__enter__` method is invoked." msgstr "" #: ../../reference/compound_stmts.rst:498 msgid "" "If a target was included in the :keyword:`with` statement, the return value " -"from :meth:`__enter__` is assigned to it." +"from :meth:`~object.__enter__` is assigned to it." msgstr "" #: ../../reference/compound_stmts.rst:503 msgid "" -"The :keyword:`with` statement guarantees that if the :meth:`__enter__` " -"method returns without an error, then :meth:`__exit__` will always be " -"called. Thus, if an error occurs during the assignment to the target list, " -"it will be treated the same as an error occurring within the suite would be. " -"See step 7 below." +"The :keyword:`with` statement guarantees that if the :meth:`~object." +"__enter__` method returns without an error, then :meth:`~object.__exit__` " +"will always be called. Thus, if an error occurs during the assignment to the " +"target list, it will be treated the same as an error occurring within the " +"suite would be. See step 7 below." msgstr "" #: ../../reference/compound_stmts.rst:509 @@ -427,25 +428,25 @@ msgstr "" #: ../../reference/compound_stmts.rst:511 msgid "" -"The context manager's :meth:`__exit__` method is invoked. If an exception " -"caused the suite to be exited, its type, value, and traceback are passed as " -"arguments to :meth:`__exit__`. Otherwise, three :const:`None` arguments are " -"supplied." +"The context manager's :meth:`~object.__exit__` method is invoked. If an " +"exception caused the suite to be exited, its type, value, and traceback are " +"passed as arguments to :meth:`~object.__exit__`. Otherwise, three :const:" +"`None` arguments are supplied." msgstr "" #: ../../reference/compound_stmts.rst:516 msgid "" "If the suite was exited due to an exception, and the return value from the :" -"meth:`__exit__` method was false, the exception is reraised. If the return " -"value was true, the exception is suppressed, and execution continues with " -"the statement following the :keyword:`with` statement." +"meth:`~object.__exit__` method was false, the exception is reraised. If the " +"return value was true, the exception is suppressed, and execution continues " +"with the statement following the :keyword:`with` statement." msgstr "" #: ../../reference/compound_stmts.rst:521 msgid "" "If the suite was exited for any reason other than an exception, the return " -"value from :meth:`__exit__` is ignored, and execution proceeds at the normal " -"location for the kind of exit that was taken." +"value from :meth:`~object.__exit__` is ignored, and execution proceeds at " +"the normal location for the kind of exit that was taken." msgstr "" #: ../../reference/compound_stmts.rst:525 @@ -1101,7 +1102,7 @@ msgid "" "Key-value pairs are matched using the two-argument form of the mapping " "subject's ``get()`` method. Matched key-value pairs must already be present " "in the mapping, and not created on-the-fly via :meth:`__missing__` or :meth:" -"`__getitem__`." +"`~object.__getitem__`." msgstr "" #: ../../reference/compound_stmts.rst:1063 diff --git a/reference/datamodel.po b/reference/datamodel.po index 984e121885..48ab47c007 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-28 00:04+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3270,7 +3270,7 @@ msgstr "" #: ../../reference/datamodel.rst:2942 msgid "" -"Note that :meth:`__exit__` methods should not reraise the passed-in " +"Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" @@ -3593,14 +3593,14 @@ msgstr "" #: ../../reference/datamodel.rst:3260 msgid "" -"Semantically similar to :meth:`__enter__`, the only difference being that it " -"must return an *awaitable*." +"Semantically similar to :meth:`~object.__enter__`, the only difference being " +"that it must return an *awaitable*." msgstr "" #: ../../reference/datamodel.rst:3265 msgid "" -"Semantically similar to :meth:`__exit__`, the only difference being that it " -"must return an *awaitable*." +"Semantically similar to :meth:`~object.__exit__`, the only difference being " +"that it must return an *awaitable*." msgstr "" #: ../../reference/datamodel.rst:3268 diff --git a/reference/expressions.po b/reference/expressions.po index 287b606b1e..a75824076f 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -931,9 +931,9 @@ msgid "" "the last item of ``x``. The resulting value must be a nonnegative integer " "less than the number of items in the sequence, and the subscription selects " "the item whose index is that value (counting from zero). Since the support " -"for negative indices and slicing occurs in the object's :meth:`__getitem__` " -"method, subclasses overriding this method will need to explicitly add that " -"support." +"for negative indices and slicing occurs in the object's :meth:`~object." +"__getitem__` method, subclasses overriding this method will need to " +"explicitly add that support." msgstr "" #: ../../reference/expressions.rst:892 @@ -967,16 +967,16 @@ msgstr "" #: ../../reference/expressions.rst:939 msgid "" "The semantics for a slicing are as follows. The primary is indexed (using " -"the same :meth:`__getitem__` method as normal subscription) with a key that " -"is constructed from the slice list, as follows. If the slice list contains " -"at least one comma, the key is a tuple containing the conversion of the " -"slice items; otherwise, the conversion of the lone slice item is the key. " -"The conversion of a slice item that is an expression is that expression. " -"The conversion of a proper slice is a slice object (see section :ref:" -"`types`) whose :attr:`~slice.start`, :attr:`~slice.stop` and :attr:`~slice." -"step` attributes are the values of the expressions given as lower bound, " -"upper bound and stride, respectively, substituting ``None`` for missing " -"expressions." +"the same :meth:`~object.__getitem__` method as normal subscription) with a " +"key that is constructed from the slice list, as follows. If the slice list " +"contains at least one comma, the key is a tuple containing the conversion of " +"the slice items; otherwise, the conversion of the lone slice item is the " +"key. The conversion of a slice item that is an expression is that " +"expression. The conversion of a proper slice is a slice object (see " +"section :ref:`types`) whose :attr:`~slice.start`, :attr:`~slice.stop` and :" +"attr:`~slice.step` attributes are the values of the expressions given as " +"lower bound, upper bound and stride, respectively, substituting ``None`` for " +"missing expressions." msgstr "" #: ../../reference/expressions.rst:963 @@ -1794,10 +1794,10 @@ msgstr "" #: ../../reference/expressions.rst:1665 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" -"`__getitem__`, ``x in y`` is ``True`` if and only if there is a non-negative " -"integer index *i* such that ``x is y[i] or x == y[i]``, and no lower integer " -"index raises the :exc:`IndexError` exception. (If any other exception is " -"raised, it is as if :keyword:`in` raised that exception)." +"`~object.__getitem__`, ``x in y`` is ``True`` if and only if there is a non-" +"negative integer index *i* such that ``x is y[i] or x == y[i]``, and no " +"lower integer index raises the :exc:`IndexError` exception. (If any other " +"exception is raised, it is as if :keyword:`in` raised that exception)." msgstr "" #: ../../reference/expressions.rst:1677 diff --git a/reference/import.po b/reference/import.po index 20cc4973c8..d214c99770 100644 --- a/reference/import.po +++ b/reference/import.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-28 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -703,8 +703,8 @@ msgstr "" #: ../../reference/import.rst:561 ../../reference/import.rst:582 msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` instead " -"instead of this attribute." +"It is **strongly** recommended that you rely on :attr:`__spec__` instead of " +"this attribute." msgstr "" #: ../../reference/import.rst:564 @@ -813,8 +813,8 @@ msgstr "" #: ../../reference/import.rst:652 msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` instead " -"instead of ``__cached__``." +"It is **strongly** recommended that you rely on :attr:`__spec__` instead of " +"``__cached__``." msgstr "" #: ../../reference/import.rst:658 diff --git a/reference/introduction.po b/reference/introduction.po index 332705e041..d453a71ed1 100644 --- a/reference/introduction.po +++ b/reference/introduction.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-16 00:03+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -156,11 +156,12 @@ msgstr "" #: ../../reference/introduction.rst:93 msgid "" -"The descriptions of lexical analysis and syntax use a modified BNF grammar " -"notation. This uses the following style of definition:" +"The descriptions of lexical analysis and syntax use a modified `Backus–Naur " +"form (BNF) `_ " +"grammar notation. This uses the following style of definition:" msgstr "" -#: ../../reference/introduction.rst:100 +#: ../../reference/introduction.rst:101 msgid "" "The first line says that a ``name`` is an ``lc_letter`` followed by a " "sequence of zero or more ``lc_letter``\\ s and underscores. An " @@ -169,7 +170,7 @@ msgid "" "and grammar rules in this document.)" msgstr "" -#: ../../reference/introduction.rst:105 +#: ../../reference/introduction.rst:106 msgid "" "Each rule begins with a name (which is the name defined by the rule) and ``::" "=``. A vertical bar (``|``) is used to separate alternatives; it is the " @@ -184,7 +185,7 @@ msgid "" "line after the first beginning with a vertical bar." msgstr "" -#: ../../reference/introduction.rst:119 +#: ../../reference/introduction.rst:120 msgid "" "In lexical definitions (as the example above), two more conventions are " "used: Two literal characters separated by three dots mean a choice of any " @@ -194,7 +195,7 @@ msgid "" "'control character' if needed." msgstr "" -#: ../../reference/introduction.rst:126 +#: ../../reference/introduction.rst:127 msgid "" "Even though the notation used is almost the same, there is a big difference " "between the meaning of lexical and syntactic definitions: a lexical " @@ -221,10 +222,10 @@ msgstr "syntax(語法)" msgid "notation" msgstr "notation(標記法)" -#: ../../reference/introduction.rst:117 +#: ../../reference/introduction.rst:118 msgid "lexical definitions" msgstr "lexical definitions(詞法定義)" -#: ../../reference/introduction.rst:117 +#: ../../reference/introduction.rst:118 msgid "ASCII" msgstr "ASCII" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 9979da11cf..75ee915511 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-22 12:58+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -549,10 +549,10 @@ msgstr "" #: ../../tutorial/introduction.rst:430 msgid "" -"You can also add new items at the end of the list, by using the :meth:`~list." +"You can also add new items at the end of the list, by using the :meth:`!list." "append` *method* (we will see more about methods later)::" msgstr "" -"你也可以在 list 的最後加入新元素,透過使用 :meth:`~list.append` *方法* " +"你也可以在 list 的最後加入新元素,透過使用 :meth:`!list.append` *方法* " "(method)(我們稍後會看到更多方法的說明):\n" "\n" "::" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index b0fba98274..a3709bd620 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -1082,7 +1082,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:880 msgid "XML Modules" -msgstr "" +msgstr "XML 模組" #: ../../whatsnew/2.0.rst:882 msgid "" @@ -1101,7 +1101,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:896 msgid "SAX2 Support" -msgstr "" +msgstr "SAX2 支援" #: ../../whatsnew/2.0.rst:898 msgid "" @@ -1138,7 +1138,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:940 msgid "DOM Support" -msgstr "" +msgstr "DOM 支援" #: ../../whatsnew/2.0.rst:942 msgid "" @@ -1301,7 +1301,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:1074 msgid "New modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/2.0.rst:1076 msgid "" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index 2108feb605..2875c7f1d3 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -505,31 +505,33 @@ msgstr "" #: ../../whatsnew/2.2.rst:426 msgid "" "In Python versions up to 2.1, the usual way to make ``for item in obj`` work " -"is to define a :meth:`__getitem__` method that looks something like this::" +"is to define a :meth:`~object.__getitem__` method that looks something like " +"this::" msgstr "" #: ../../whatsnew/2.2.rst:432 msgid "" -":meth:`__getitem__` is more properly used to define an indexing operation on " -"an object so that you can write ``obj[5]`` to retrieve the sixth element. " -"It's a bit misleading when you're using this only to support :keyword:`for` " -"loops. Consider some file-like object that wants to be looped over; the " -"*index* parameter is essentially meaningless, as the class probably assumes " -"that a series of :meth:`__getitem__` calls will be made with *index* " -"incrementing by one each time. In other words, the presence of the :meth:" -"`__getitem__` method doesn't mean that using ``file[5]`` to randomly access " -"the sixth element will work, though it really should." +":meth:`~object.__getitem__` is more properly used to define an indexing " +"operation on an object so that you can write ``obj[5]`` to retrieve the " +"sixth element. It's a bit misleading when you're using this only to " +"support :keyword:`for` loops. Consider some file-like object that wants to " +"be looped over; the *index* parameter is essentially meaningless, as the " +"class probably assumes that a series of :meth:`~object.__getitem__` calls " +"will be made with *index* incrementing by one each time. In other words, " +"the presence of the :meth:`~object.__getitem__` method doesn't mean that " +"using ``file[5]`` to randomly access the sixth element will work, though it " +"really should." msgstr "" #: ../../whatsnew/2.2.rst:442 msgid "" -"In Python 2.2, iteration can be implemented separately, and :meth:" -"`__getitem__` methods can be limited to classes that really do support " -"random access. The basic idea of iterators is simple. A new built-in " -"function, ``iter(obj)`` or ``iter(C, sentinel)``, is used to get an " -"iterator. ``iter(obj)`` returns an iterator for the object *obj*, while " -"``iter(C, sentinel)`` returns an iterator that will invoke the callable " -"object *C* until it returns *sentinel* to signal that the iterator is done." +"In Python 2.2, iteration can be implemented separately, and :meth:`~object." +"__getitem__` methods can be limited to classes that really do support random " +"access. The basic idea of iterators is simple. A new built-in function, " +"``iter(obj)`` or ``iter(C, sentinel)``, is used to get an iterator. " +"``iter(obj)`` returns an iterator for the object *obj*, while ``iter(C, " +"sentinel)`` returns an iterator that will invoke the callable object *C* " +"until it returns *sentinel* to signal that the iterator is done." msgstr "" #: ../../whatsnew/2.2.rst:450 diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index f542f4b572..e2738a5e26 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -958,8 +958,8 @@ msgstr "" #: ../../whatsnew/2.3.rst:928 msgid "" -"One can also now pass slice objects to the :meth:`__getitem__` methods of " -"the built-in sequences::" +"One can also now pass slice objects to the :meth:`~object.__getitem__` " +"methods of the built-in sequences::" msgstr "" #: ../../whatsnew/2.3.rst:934 @@ -1770,8 +1770,8 @@ msgstr "" #: ../../whatsnew/2.3.rst:1598 msgid "" "Adding the mix-in as a superclass provides the full dictionary interface " -"whenever the class defines :meth:`__getitem__`, :meth:`__setitem__`, :meth:" -"`__delitem__`, and :meth:`keys`. For example::" +"whenever the class defines :meth:`~object.__getitem__`, :meth:" +"`__setitem__`, :meth:`__delitem__`, and :meth:`keys`. For example::" msgstr "" #: ../../whatsnew/2.3.rst:1639 diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index f20f05f3ff..94418ebc94 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -689,22 +689,22 @@ msgstr "" #: ../../whatsnew/2.5.rst:577 msgid "" "The expression is evaluated, and it should result in an object that supports " -"the context management protocol (that is, has :meth:`__enter__` and :meth:" -"`__exit__` methods." +"the context management protocol (that is, has :meth:`~object.__enter__` and :" +"meth:`~object.__exit__` methods." msgstr "" #: ../../whatsnew/2.5.rst:581 msgid "" -"The object's :meth:`__enter__` is called before *with-block* is executed and " -"therefore can run set-up code. It also may return a value that is bound to " -"the name *variable*, if given. (Note carefully that *variable* is *not* " -"assigned the result of *expression*.)" +"The object's :meth:`~object.__enter__` is called before *with-block* is " +"executed and therefore can run set-up code. It also may return a value that " +"is bound to the name *variable*, if given. (Note carefully that *variable* " +"is *not* assigned the result of *expression*.)" msgstr "" #: ../../whatsnew/2.5.rst:586 msgid "" -"After execution of the *with-block* is finished, the object's :meth:" -"`__exit__` method is called, even if the block raised an exception, and can " +"After execution of the *with-block* is finished, the object's :meth:`~object." +"__exit__` method is called, even if the block raised an exception, and can " "therefore run clean-up code." msgstr "" @@ -735,7 +735,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:611 msgid "" "In this case, *f* is the same object created by :func:`open`, because :meth:" -"`file.__enter__` returns *self*." +"`~object.__enter__` returns *self*." msgstr "" #: ../../whatsnew/2.5.rst:614 @@ -777,13 +777,13 @@ msgstr "" #: ../../whatsnew/2.5.rst:654 msgid "" "The expression is evaluated and should result in an object called a " -"\"context manager\". The context manager must have :meth:`__enter__` and :" -"meth:`__exit__` methods." +"\"context manager\". The context manager must have :meth:`~object." +"__enter__` and :meth:`~object.__exit__` methods." msgstr "" #: ../../whatsnew/2.5.rst:658 msgid "" -"The context manager's :meth:`__enter__` method is called. The value " +"The context manager's :meth:`~object.__enter__` method is called. The value " "returned is assigned to *VAR*. If no ``'as VAR'`` clause is present, the " "value is simply discarded." msgstr "" @@ -805,8 +805,8 @@ msgstr "" #: ../../whatsnew/2.5.rst:672 msgid "" -"If *BLOCK* didn't raise an exception, the :meth:`__exit__` method is still " -"called, but *type*, *value*, and *traceback* are all ``None``." +"If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method " +"is still called, but *type*, *value*, and *traceback* are all ``None``." msgstr "" #: ../../whatsnew/2.5.rst:675 @@ -839,19 +839,19 @@ msgstr "" #: ../../whatsnew/2.5.rst:706 msgid "" -"The :meth:`__enter__` method is pretty easy, having only to start a new " -"transaction. For this application the resulting cursor object would be a " -"useful result, so the method will return it. The user can then add ``as " +"The :meth:`~object.__enter__` method is pretty easy, having only to start a " +"new transaction. For this application the resulting cursor object would be " +"a useful result, so the method will return it. The user can then add ``as " "cursor`` to their ':keyword:`with`' statement to bind the cursor to a " "variable name. ::" msgstr "" #: ../../whatsnew/2.5.rst:718 msgid "" -"The :meth:`__exit__` method is the most complicated because it's where most " -"of the work has to be done. The method has to check if an exception " -"occurred. If there was no exception, the transaction is committed. The " -"transaction is rolled back if there was an exception." +"The :meth:`~object.__exit__` method is the most complicated because it's " +"where most of the work has to be done. The method has to check if an " +"exception occurred. If there was no exception, the transaction is " +"committed. The transaction is rolled back if there was an exception." msgstr "" #: ../../whatsnew/2.5.rst:723 @@ -878,12 +878,12 @@ msgid "" "The decorator is called :func:`contextmanager`, and lets you write a single " "generator function instead of defining a new class. The generator should " "yield exactly one value. The code up to the :keyword:`yield` will be " -"executed as the :meth:`__enter__` method, and the value yielded will be the " -"method's return value that will get bound to the variable in the ':keyword:" -"`with`' statement's :keyword:`!as` clause, if any. The code after the :" -"keyword:`yield` will be executed in the :meth:`__exit__` method. Any " -"exception raised in the block will be raised by the :keyword:`!yield` " -"statement." +"executed as the :meth:`~object.__enter__` method, and the value yielded will " +"be the method's return value that will get bound to the variable in the ':" +"keyword:`with`' statement's :keyword:`!as` clause, if any. The code after " +"the :keyword:`yield` will be executed in the :meth:`~object.__exit__` " +"method. Any exception raised in the block will be raised by the :keyword:`!" +"yield` statement." msgstr "" #: ../../whatsnew/2.5.rst:757 @@ -1564,8 +1564,8 @@ msgid "" "`universal newlines` mode. Another new parameter, *openhook*, lets you use " "a function other than :func:`open` to open the input files. Once you're " "iterating over the set of files, the :class:`FileInput` object's new :meth:" -"`fileno` returns the file descriptor for the currently opened file. " -"(Contributed by Georg Brandl.)" +"`~fileinput.fileno` returns the file descriptor for the currently opened " +"file. (Contributed by Georg Brandl.)" msgstr "" #: ../../whatsnew/2.5.rst:1354 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index ac6200eaa8..3343bbc83f 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -332,22 +332,22 @@ msgstr "" #: ../../whatsnew/2.6.rst:271 msgid "" "The expression is evaluated, and it should result in an object that supports " -"the context management protocol (that is, has :meth:`__enter__` and :meth:" -"`__exit__` methods)." +"the context management protocol (that is, has :meth:`~object.__enter__` and :" +"meth:`~object.__exit__` methods)." msgstr "" #: ../../whatsnew/2.6.rst:275 msgid "" -"The object's :meth:`__enter__` is called before *with-block* is executed and " -"therefore can run set-up code. It also may return a value that is bound to " -"the name *variable*, if given. (Note carefully that *variable* is *not* " -"assigned the result of *expression*.)" +"The object's :meth:`~object.__enter__` is called before *with-block* is " +"executed and therefore can run set-up code. It also may return a value that " +"is bound to the name *variable*, if given. (Note carefully that *variable* " +"is *not* assigned the result of *expression*.)" msgstr "" #: ../../whatsnew/2.6.rst:280 msgid "" -"After execution of the *with-block* is finished, the object's :meth:" -"`__exit__` method is called, even if the block raised an exception, and can " +"After execution of the *with-block* is finished, the object's :meth:`~object." +"__exit__` method is called, even if the block raised an exception, and can " "therefore run clean-up code." msgstr "" @@ -368,7 +368,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:298 msgid "" "In this case, *f* is the same object created by :func:`open`, because :meth:" -"`file.__enter__` returns *self*." +"`~object.__enter__` returns *self*." msgstr "" #: ../../whatsnew/2.6.rst:301 @@ -410,13 +410,13 @@ msgstr "" #: ../../whatsnew/2.6.rst:341 msgid "" "The expression is evaluated and should result in an object called a " -"\"context manager\". The context manager must have :meth:`__enter__` and :" -"meth:`__exit__` methods." +"\"context manager\". The context manager must have :meth:`~object." +"__enter__` and :meth:`~object.__exit__` methods." msgstr "" #: ../../whatsnew/2.6.rst:345 msgid "" -"The context manager's :meth:`__enter__` method is called. The value " +"The context manager's :meth:`~object.__enter__` method is called. The value " "returned is assigned to *VAR*. If no ``as VAR`` clause is present, the " "value is simply discarded." msgstr "" @@ -427,21 +427,21 @@ msgstr "" #: ../../whatsnew/2.6.rst:351 msgid "" -"If *BLOCK* raises an exception, the context manager's :meth:`__exit__` " -"method is called with three arguments, the exception details (``type, value, " -"traceback``, the same values returned by :func:`sys.exc_info`, which can " -"also be ``None`` if no exception occurred). The method's return value " -"controls whether an exception is re-raised: any false value re-raises the " -"exception, and ``True`` will result in suppressing it. You'll only rarely " -"want to suppress the exception, because if you do the author of the code " -"containing the ':keyword:`with`' statement will never realize anything went " -"wrong." +"If *BLOCK* raises an exception, the context manager's :meth:`~object." +"__exit__` method is called with three arguments, the exception details " +"(``type, value, traceback``, the same values returned by :func:`sys." +"exc_info`, which can also be ``None`` if no exception occurred). The " +"method's return value controls whether an exception is re-raised: any false " +"value re-raises the exception, and ``True`` will result in suppressing it. " +"You'll only rarely want to suppress the exception, because if you do the " +"author of the code containing the ':keyword:`with`' statement will never " +"realize anything went wrong." msgstr "" #: ../../whatsnew/2.6.rst:360 msgid "" -"If *BLOCK* didn't raise an exception, the :meth:`__exit__` method is still " -"called, but *type*, *value*, and *traceback* are all ``None``." +"If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method " +"is still called, but *type*, *value*, and *traceback* are all ``None``." msgstr "" #: ../../whatsnew/2.6.rst:363 @@ -474,19 +474,19 @@ msgstr "" #: ../../whatsnew/2.6.rst:394 msgid "" -"The :meth:`__enter__` method is pretty easy, having only to start a new " -"transaction. For this application the resulting cursor object would be a " -"useful result, so the method will return it. The user can then add ``as " +"The :meth:`~object.__enter__` method is pretty easy, having only to start a " +"new transaction. For this application the resulting cursor object would be " +"a useful result, so the method will return it. The user can then add ``as " "cursor`` to their ':keyword:`with`' statement to bind the cursor to a " "variable name. ::" msgstr "" #: ../../whatsnew/2.6.rst:406 msgid "" -"The :meth:`__exit__` method is the most complicated because it's where most " -"of the work has to be done. The method has to check if an exception " -"occurred. If there was no exception, the transaction is committed. The " -"transaction is rolled back if there was an exception." +"The :meth:`~object.__exit__` method is the most complicated because it's " +"where most of the work has to be done. The method has to check if an " +"exception occurred. If there was no exception, the transaction is " +"committed. The transaction is rolled back if there was an exception." msgstr "" #: ../../whatsnew/2.6.rst:411 @@ -512,12 +512,12 @@ msgid "" "The decorator is called :func:`contextmanager`, and lets you write a single " "generator function instead of defining a new class. The generator should " "yield exactly one value. The code up to the :keyword:`yield` will be " -"executed as the :meth:`__enter__` method, and the value yielded will be the " -"method's return value that will get bound to the variable in the ':keyword:" -"`with`' statement's :keyword:`!as` clause, if any. The code after the :" -"keyword:`!yield` will be executed in the :meth:`__exit__` method. Any " -"exception raised in the block will be raised by the :keyword:`!yield` " -"statement." +"executed as the :meth:`~object.__enter__` method, and the value yielded will " +"be the method's return value that will get bound to the variable in the ':" +"keyword:`with`' statement's :keyword:`!as` clause, if any. The code after " +"the :keyword:`!yield` will be executed in the :meth:`~object.__exit__` " +"method. Any exception raised in the block will be raised by the :keyword:`!" +"yield` statement." msgstr "" #: ../../whatsnew/2.6.rst:445 @@ -1892,8 +1892,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:1740 msgid "" -"The ``with`` statement now stores the :meth:`__exit__` method on the stack, " -"producing a small speedup. (Implemented by Jeffrey Yasskin.)" +"The ``with`` statement now stores the :meth:`~object.__exit__` method on the " +"stack, producing a small speedup. (Implemented by Jeffrey Yasskin.)" msgstr "" #: ../../whatsnew/2.6.rst:1743 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 2b70b2c4ce..779dd14c01 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -966,8 +966,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:932 msgid "" "A new opcode was added to perform the initial setup for :keyword:`with` " -"statements, looking up the :meth:`__enter__` and :meth:`__exit__` methods. " -"(Contributed by Benjamin Peterson.)" +"statements, looking up the :meth:`~object.__enter__` and :meth:`~object." +"__exit__` methods. (Contributed by Benjamin Peterson.)" msgstr "" #: ../../whatsnew/2.7.rst:936 @@ -2895,17 +2895,17 @@ msgstr "" #: ../../whatsnew/2.7.rst:2451 msgid "" "Because of an optimization for the :keyword:`with` statement, the special " -"methods :meth:`__enter__` and :meth:`__exit__` must belong to the object's " -"type, and cannot be directly attached to the object's instance. This " -"affects new-style classes (derived from :class:`object`) and C extension " -"types. (:issue:`6101`.)" +"methods :meth:`~object.__enter__` and :meth:`~object.__exit__` must belong " +"to the object's type, and cannot be directly attached to the object's " +"instance. This affects new-style classes (derived from :class:`object`) and " +"C extension types. (:issue:`6101`.)" msgstr "" #: ../../whatsnew/2.7.rst:2457 msgid "" -"Due to a bug in Python 2.6, the *exc_value* parameter to :meth:`__exit__` " -"methods was often the string representation of the exception, not an " -"instance. This was fixed in 2.7, so *exc_value* will be an instance as " +"Due to a bug in Python 2.6, the *exc_value* parameter to :meth:`~object." +"__exit__` methods was often the string representation of the exception, not " +"an instance. This was fixed in 2.7, so *exc_value* will be an instance as " "expected. (Fixed by Florent Xicluna; :issue:`7853`.)" msgstr "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 32a6ae6486..78decf315a 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-28 00:03+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -796,7 +796,7 @@ msgstr "" #: ../../whatsnew/3.11.rst:572 msgid "Improved Modules" -msgstr "模組改進" +msgstr "改進的模組" #: ../../whatsnew/3.11.rst:577 msgid "asyncio" @@ -3202,11 +3202,11 @@ msgstr ":func:`importlib.resources.path`" #: ../../whatsnew/3.11.rst:1800 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " -"removed in Python 3.13. Use :func:`locale.setlocale`, :func:`locale." +"removed in Python 3.15. Use :func:`locale.setlocale`, :func:`locale." "getpreferredencoding(False) ` and :func:`locale." "getlocale` functions instead. (Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" -":func:`locale.getdefaultlocale` 函式已被棄用且將於 Python 3.13 中移除。請改" +":func:`locale.getdefaultlocale` 函式已被棄用且將於 Python 3.15 中移除。請改" "用 :func:`locale.setlocale`、:func:`locale.getpreferredencoding(False) " "` 和 :func:`locale.getlocale`。(Victor Stinner " "於 :gh:`90817` 中所貢獻。)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index caf6dee4a5..1da29c8b92 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -76,7 +76,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:90 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:92 msgid "" @@ -96,7 +96,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:98 msgid "Interpreter improvements:" -msgstr "" +msgstr "直譯器改進:" #: ../../whatsnew/3.12.rst:100 msgid "" @@ -130,7 +130,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:113 msgid "The :class:`pathlib.Path` class now supports subclassing" -msgstr "" +msgstr ":class:`pathlib.Path` 類別現在支援子類別化" #: ../../whatsnew/3.12.rst:114 msgid "The :mod:`os` module received several improvements for Windows support" @@ -168,7 +168,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:126 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.12.rst:128 msgid "" @@ -180,7 +180,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:134 msgid "C API improvements:" -msgstr "" +msgstr "C API 改進:" #: ../../whatsnew/3.12.rst:136 msgid ":ref:`PEP 697 `, unstable C API tier" @@ -215,10 +215,12 @@ msgid "" ":ref:`PEP 692 `, using :class:`~typing.TypedDict` to " "annotate :term:`**kwargs `" msgstr "" +":ref:`PEP 692 `、使用 :class:`~typing.TypedDict` 來標註 :" +"term:`**kwargs `" #: ../../whatsnew/3.12.rst:149 msgid ":ref:`PEP 698 `, :func:`typing.override` decorator" -msgstr "" +msgstr ":ref:`PEP 698 `、:func:`typing.override` 裝飾器" #: ../../whatsnew/3.12.rst:151 msgid "Important deprecations, removals or restrictions:" @@ -255,7 +257,7 @@ msgid "" "`_." msgstr "" -#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1917 +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1931 msgid "New Features" msgstr "新增特性" @@ -457,7 +459,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:377 msgid "(Contributed by Mark Shannon in :gh:`103082`.)" -msgstr "" +msgstr "(由 Mark Shannon 於 :gh:`103082` 中貢獻。)" #: ../../whatsnew/3.12.rst:382 msgid "PEP 688: Making the buffer protocol accessible in Python" @@ -529,7 +531,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:423 msgid "(Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`.)" -msgstr "" +msgstr "(由 Carl Meyer 和 Vladimir Matveev 於 :pep:`709` 中貢獻。)" #: ../../whatsnew/3.12.rst:426 msgid "Improved Error Messages" @@ -595,7 +597,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:503 msgid "See :pep:`692` for more details." -msgstr "" +msgstr "詳情請見 :pep:`692`。" #: ../../whatsnew/3.12.rst:505 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" @@ -616,11 +618,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:518 msgid "Example::" -msgstr "" +msgstr "範例: ::" #: ../../whatsnew/3.12.rst:536 msgid "See :pep:`698` for more details." -msgstr "" +msgstr "詳情請見 :pep:`698`。" #: ../../whatsnew/3.12.rst:538 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" @@ -753,7 +755,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:626 msgid "New Modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.12.rst:628 msgid "None." @@ -761,7 +763,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:632 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.12.rst:635 msgid "array" @@ -886,7 +888,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:714 msgid "importlib.resources" -msgstr "" +msgstr "importlib.resources" #: ../../whatsnew/3.12.rst:716 msgid "" @@ -894,25 +896,31 @@ msgid "" "(Contributed by Jason R. Coombs in :gh:`97930`.)" msgstr "" -#: ../../whatsnew/3.12.rst:720 +#: ../../whatsnew/3.12.rst:719 +msgid "" +"Rename first parameter of :func:`importlib.resources.files` to *anchor*. " +"(Contributed by Jason R. Coombs in :gh:`100598`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:723 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:722 +#: ../../whatsnew/3.12.rst:725 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:726 +#: ../../whatsnew/3.12.rst:729 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :gh:`79940`.)" msgstr "" -#: ../../whatsnew/3.12.rst:730 +#: ../../whatsnew/3.12.rst:733 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -920,60 +928,62 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:736 +#: ../../whatsnew/3.12.rst:739 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:738 +#: ../../whatsnew/3.12.rst:741 msgid "" "Add :class:`itertools.batched()` for collecting into even-sized tuples where " "the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:746 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:745 +#: ../../whatsnew/3.12.rst:748 msgid "" "Add :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" +"新增 :func:`math.sumprod` 以計算乘積總和。(由 Raymond Hettinger 於 :gh:" +"`100485` 中貢獻。)" -#: ../../whatsnew/3.12.rst:748 +#: ../../whatsnew/3.12.rst:751 msgid "" "Extend :func:`math.nextafter` to include a *steps* argument for moving up or " "down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:753 +#: ../../whatsnew/3.12.rst:756 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:755 +#: ../../whatsnew/3.12.rst:758 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:759 +#: ../../whatsnew/3.12.rst:762 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:763 +#: ../../whatsnew/3.12.rst:766 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:767 +#: ../../whatsnew/3.12.rst:770 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -986,27 +996,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:778 +#: ../../whatsnew/3.12.rst:781 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:780 +#: ../../whatsnew/3.12.rst:783 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:783 +#: ../../whatsnew/3.12.rst:786 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:787 +#: ../../whatsnew/3.12.rst:790 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:789 +#: ../../whatsnew/3.12.rst:792 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -1014,14 +1024,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:794 +#: ../../whatsnew/3.12.rst:797 msgid "" "Add :meth:`pathlib.Path.walk` for walking the directory trees and generating " "all file or directory names within them, similar to :func:`os.walk`. " "(Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:798 +#: ../../whatsnew/3.12.rst:801 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " @@ -1029,13 +1039,13 @@ msgid "" "gh:`84538`.)" msgstr "" -#: ../../whatsnew/3.12.rst:803 +#: ../../whatsnew/3.12.rst:806 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:806 +#: ../../whatsnew/3.12.rst:809 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -1043,38 +1053,40 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:811 +#: ../../whatsnew/3.12.rst:814 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:813 +#: ../../whatsnew/3.12.rst:816 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:819 +#: ../../whatsnew/3.12.rst:822 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:821 +#: ../../whatsnew/3.12.rst:824 msgid "" "Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :gh:" "`81620`.)" msgstr "" +"新增 :func:`random.binomialvariate`。(由 Raymond Hettinger 於 :gh:`81620` 中" +"貢獻。)" -#: ../../whatsnew/3.12.rst:824 +#: ../../whatsnew/3.12.rst:827 msgid "" "Add a default of ``lambd=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:828 +#: ../../whatsnew/3.12.rst:831 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:830 +#: ../../whatsnew/3.12.rst:833 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -1082,7 +1094,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:836 +#: ../../whatsnew/3.12.rst:839 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -1090,14 +1102,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:842 +#: ../../whatsnew/3.12.rst:845 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:847 +#: ../../whatsnew/3.12.rst:850 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -1105,24 +1117,26 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:852 +#: ../../whatsnew/3.12.rst:855 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:858 ../../whatsnew/3.12.rst:1637 +#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1651 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:860 +#: ../../whatsnew/3.12.rst:863 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" +"新增\\ :ref:`命令列介面 `。(由 Erlend E. Aasland 於 :gh:" +"`77617` 中貢獻。)" -#: ../../whatsnew/3.12.rst:863 +#: ../../whatsnew/3.12.rst:866 msgid "" "Add the :attr:`sqlite3.Connection.autocommit` attribute to :class:`sqlite3." "Connection` and the *autocommit* parameter to :func:`sqlite3.connect` to " @@ -1130,43 +1144,43 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:870 +#: ../../whatsnew/3.12.rst:873 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:875 +#: ../../whatsnew/3.12.rst:878 msgid "" "Add :meth:`sqlite3.Connection.getconfig` and :meth:`sqlite3.Connection." "setconfig` to :class:`sqlite3.Connection` to make configuration changes to a " "database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:881 +#: ../../whatsnew/3.12.rst:884 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:883 +#: ../../whatsnew/3.12.rst:886 msgid "" "Extend :func:`statistics.correlation` to include as a ``ranked`` method for " "computing the Spearman correlation of ranked data. (Contributed by Raymond " "Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:888 +#: ../../whatsnew/3.12.rst:891 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:890 +#: ../../whatsnew/3.12.rst:893 msgid "" "Add the :mod:`sys.monitoring` namespace to expose the new :ref:`PEP 669 " "` monitoring API. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:894 +#: ../../whatsnew/3.12.rst:897 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -1176,7 +1190,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:903 +#: ../../whatsnew/3.12.rst:906 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1185,14 +1199,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:909 ../../whatsnew/3.12.rst:1825 +#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1839 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:913 +#: ../../whatsnew/3.12.rst:916 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1200,27 +1214,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:919 +#: ../../whatsnew/3.12.rst:922 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:921 +#: ../../whatsnew/3.12.rst:924 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:923 +#: ../../whatsnew/3.12.rst:926 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:929 +#: ../../whatsnew/3.12.rst:932 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:931 +#: ../../whatsnew/3.12.rst:934 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1228,11 +1242,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:937 +#: ../../whatsnew/3.12.rst:940 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:939 +#: ../../whatsnew/3.12.rst:942 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1242,11 +1256,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:948 +#: ../../whatsnew/3.12.rst:951 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:950 +#: ../../whatsnew/3.12.rst:953 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1254,22 +1268,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:956 +#: ../../whatsnew/3.12.rst:959 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:958 +#: ../../whatsnew/3.12.rst:961 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:963 +#: ../../whatsnew/3.12.rst:966 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:965 +#: ../../whatsnew/3.12.rst:968 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1282,7 +1296,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:976 +#: ../../whatsnew/3.12.rst:979 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1290,13 +1304,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:998 +#: ../../whatsnew/3.12.rst:1001 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:1001 +#: ../../whatsnew/3.12.rst:1004 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1307,71 +1321,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1009 +#: ../../whatsnew/3.12.rst:1012 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1013 +#: ../../whatsnew/3.12.rst:1016 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1017 +#: ../../whatsnew/3.12.rst:1020 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:1019 +#: ../../whatsnew/3.12.rst:1022 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:1023 ../../whatsnew/3.12.rst:1678 +#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1692 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:1025 +#: ../../whatsnew/3.12.rst:1028 msgid "" "Add a ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:1041 +#: ../../whatsnew/3.12.rst:1044 msgid "(Contributed by Giampaolo Rodola in :gh:`48330`)" msgstr "" -#: ../../whatsnew/3.12.rst:1044 +#: ../../whatsnew/3.12.rst:1047 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:1046 +#: ../../whatsnew/3.12.rst:1049 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1051 +#: ../../whatsnew/3.12.rst:1054 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:1053 +#: ../../whatsnew/3.12.rst:1056 msgid "" "Remove ``wstr`` and ``wstr_length`` members from Unicode objects. It reduces " "object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) (Contributed by " "Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1057 +#: ../../whatsnew/3.12.rst:1060 msgid "" "Add experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Donghee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:1061 +#: ../../whatsnew/3.12.rst:1064 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1379,13 +1393,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1066 +#: ../../whatsnew/3.12.rst:1069 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar Oren in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1069 +#: ../../whatsnew/3.12.rst:1072 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1393,18 +1407,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1074 +#: ../../whatsnew/3.12.rst:1077 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1080 +#: ../../whatsnew/3.12.rst:1083 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1085 msgid "" "Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1412,62 +1426,62 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1087 +#: ../../whatsnew/3.12.rst:1090 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1090 +#: ../../whatsnew/3.12.rst:1093 msgid "" "Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" "gh:`92925`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1093 +#: ../../whatsnew/3.12.rst:1096 msgid "" "Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. " "(Contributed by Mark Shannon in :gh:`94163`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1096 +#: ../../whatsnew/3.12.rst:1099 msgid "" "Add the :opcode:`CALL_INTRINSIC_1` instructions. (Contributed by Mark " "Shannon in :gh:`99005`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1099 +#: ../../whatsnew/3.12.rst:1102 msgid "" "Add the :opcode:`CALL_INTRINSIC_2` instruction. (Contributed by Irit Katriel " "in :gh:`101799`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1102 +#: ../../whatsnew/3.12.rst:1105 msgid "" "Add the :opcode:`CLEANUP_THROW` instruction. (Contributed by Brandt Bucher " "in :gh:`90997`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1105 +#: ../../whatsnew/3.12.rst:1108 msgid "" "Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1111 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1111 +#: ../../whatsnew/3.12.rst:1114 msgid "" "Add the :opcode:`LOAD_FAST_CHECK` instruction. (Contributed by Dennis " "Sweeney in :gh:`93143`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1114 +#: ../../whatsnew/3.12.rst:1117 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1476,48 +1490,48 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1123 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1126 msgid "" "Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" "gh:`101632`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1126 +#: ../../whatsnew/3.12.rst:1129 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1131 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1136 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1140 ../../whatsnew/3.12.rst:2219 +#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2233 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.12.rst:1142 +#: ../../whatsnew/3.12.rst:1145 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1147 +#: ../../whatsnew/3.12.rst:1150 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1525,37 +1539,37 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1151 ../../whatsnew/3.12.rst:1383 +#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1386 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1152 ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1387 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1153 ../../whatsnew/3.12.rst:1385 +#: ../../whatsnew/3.12.rst:1156 ../../whatsnew/3.12.rst:1388 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1157 ../../whatsnew/3.12.rst:1389 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1387 +#: ../../whatsnew/3.12.rst:1158 ../../whatsnew/3.12.rst:1390 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1160 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1160 ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1163 ../../whatsnew/3.12.rst:1392 msgid ":mod:`asyncio`:" -msgstr "" +msgstr ":mod:`asyncio`:" -#: ../../whatsnew/3.12.rst:1162 +#: ../../whatsnew/3.12.rst:1165 msgid "" "The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, :class:" "`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` and :class:" @@ -1563,7 +1577,7 @@ msgid "" "3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1168 +#: ../../whatsnew/3.12.rst:1171 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -1571,7 +1585,7 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1174 +#: ../../whatsnew/3.12.rst:1177 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -1579,14 +1593,14 @@ msgid "" "Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1179 +#: ../../whatsnew/3.12.rst:1182 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." "FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1183 +#: ../../whatsnew/3.12.rst:1186 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1594,7 +1608,7 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1188 +#: ../../whatsnew/3.12.rst:1191 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1604,47 +1618,47 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1196 +#: ../../whatsnew/3.12.rst:1199 msgid "" ":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1199 +#: ../../whatsnew/3.12.rst:1202 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1202 ../../whatsnew/3.12.rst:1406 +#: ../../whatsnew/3.12.rst:1205 ../../whatsnew/3.12.rst:1409 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1203 ../../whatsnew/3.12.rst:1407 +#: ../../whatsnew/3.12.rst:1206 ../../whatsnew/3.12.rst:1410 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1204 ../../whatsnew/3.12.rst:1408 +#: ../../whatsnew/3.12.rst:1207 ../../whatsnew/3.12.rst:1411 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1206 +#: ../../whatsnew/3.12.rst:1209 msgid "Use :mod:`importlib.resources.abc` classes instead:" -msgstr "" +msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../whatsnew/3.12.rst:1208 +#: ../../whatsnew/3.12.rst:1211 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1209 +#: ../../whatsnew/3.12.rst:1212 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1211 +#: ../../whatsnew/3.12.rst:1214 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1213 +#: ../../whatsnew/3.12.rst:1216 msgid "" ":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " "operations, which is undocumented, inefficient, historically buggy, and " @@ -1653,7 +1667,7 @@ msgid "" "`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1219 +#: ../../whatsnew/3.12.rst:1222 msgid "" ":mod:`multiprocessing`: In Python 3.14, the default :mod:`multiprocessing` " "start method will change to a safer one on Linux, BSDs, and other non-macOS " @@ -1665,14 +1679,14 @@ msgid "" "methods `." msgstr "" -#: ../../whatsnew/3.12.rst:1229 +#: ../../whatsnew/3.12.rst:1232 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "are deprecated and will be removed in Python 3.14; use :func:`importlib.util." "find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1234 +#: ../../whatsnew/3.12.rst:1237 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " @@ -1680,11 +1694,11 @@ msgid "" "(Contributed by Soumendra Ganguly and Gregory P. Smith in :gh:`85984`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1239 +#: ../../whatsnew/3.12.rst:1242 msgid ":mod:`os`:" -msgstr "" +msgstr ":mod:`os`:" -#: ../../whatsnew/3.12.rst:1241 +#: ../../whatsnew/3.12.rst:1244 msgid "" "The ``st_ctime`` fields return by :func:`os.stat` and :func:`os.lstat` on " "Windows are deprecated. In a future release, they will contain the last " @@ -1693,7 +1707,7 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1247 +#: ../../whatsnew/3.12.rst:1250 msgid "" "On POSIX platforms, :func:`os.fork` can now raise a :exc:" "`DeprecationWarning` when it can detect being called from a multithreaded " @@ -1706,32 +1720,32 @@ msgid "" "longstanding platform compatibility problem to developers." msgstr "" -#: ../../whatsnew/3.12.rst:1257 +#: ../../whatsnew/3.12.rst:1260 msgid "" "When this warning appears due to usage of :mod:`multiprocessing` or :mod:" "`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " "start method such as ``\"spawn\"`` or ``\"forkserver\"``." msgstr "" -#: ../../whatsnew/3.12.rst:1261 +#: ../../whatsnew/3.12.rst:1264 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "and will be removed in Python 3.14. Use *onexc* instead. (Contributed by " "Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1264 +#: ../../whatsnew/3.12.rst:1267 msgid ":mod:`sqlite3`:" -msgstr "" +msgstr ":mod:`sqlite3`:" -#: ../../whatsnew/3.12.rst:1266 +#: ../../whatsnew/3.12.rst:1269 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1272 +#: ../../whatsnew/3.12.rst:1275 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1741,38 +1755,38 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1279 +#: ../../whatsnew/3.12.rst:1282 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1283 +#: ../../whatsnew/3.12.rst:1286 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1287 +#: ../../whatsnew/3.12.rst:1290 msgid ":mod:`typing`:" msgstr "" -#: ../../whatsnew/3.12.rst:1289 +#: ../../whatsnew/3.12.rst:1292 msgid "" ":class:`typing.Hashable` and :class:`typing.Sized` aliases for :class:" "`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1292 +#: ../../whatsnew/3.12.rst:1295 msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" "`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " "Waygood in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1296 +#: ../../whatsnew/3.12.rst:1299 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -1780,7 +1794,7 @@ msgid "" "implementation emitted nothing. (Contributed by Jacob Walls in :gh:`83122`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1302 +#: ../../whatsnew/3.12.rst:1305 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " "`, :meth:`generator throw() ` and :meth:" @@ -1789,21 +1803,21 @@ msgid "" "instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1308 +#: ../../whatsnew/3.12.rst:1311 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1313 +#: ../../whatsnew/3.12.rst:1316 msgid "" "Setting ``__package__`` or ``__cached__`` on a module is deprecated, and " "will cease to be set or taken into consideration by the import system in " "Python 3.14. (Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1320 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1812,7 +1826,7 @@ msgid "" "Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1323 +#: ../../whatsnew/3.12.rst:1326 msgid "" "Accessing ``co_lnotab`` on code objects was deprecated in Python 3.10 via :" "pep:`626`, but it only got a proper :exc:`DeprecationWarning` in 3.12, " @@ -1820,276 +1834,289 @@ msgid "" "`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1329 +#: ../../whatsnew/3.12.rst:1332 msgid "Pending Removal in Python 3.13" -msgstr "" +msgstr "Python 3.13 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1331 +#: ../../whatsnew/3.12.rst:1334 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1337 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1339 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1340 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1341 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1342 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1343 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1344 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1345 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1343 +#: ../../whatsnew/3.12.rst:1346 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1344 +#: ../../whatsnew/3.12.rst:1347 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1345 +#: ../../whatsnew/3.12.rst:1348 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1346 +#: ../../whatsnew/3.12.rst:1349 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1350 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1348 +#: ../../whatsnew/3.12.rst:1351 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1349 +#: ../../whatsnew/3.12.rst:1352 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1353 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1351 +#: ../../whatsnew/3.12.rst:1354 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1352 +#: ../../whatsnew/3.12.rst:1355 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1353 +#: ../../whatsnew/3.12.rst:1356 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1354 +#: ../../whatsnew/3.12.rst:1357 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1359 msgid "Other modules:" -msgstr "" +msgstr "其他模組:" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1361 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1360 +#: ../../whatsnew/3.12.rst:1363 ../../whatsnew/3.12.rst:1441 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1362 +#: ../../whatsnew/3.12.rst:1365 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1363 -msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" -msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" +#: ../../whatsnew/3.12.rst:1366 +msgid "``locale.resetlocale()`` (:gh:`90817`)" +msgstr "``locale.resetlocale()`` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1367 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1368 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1369 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1370 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1368 +#: ../../whatsnew/3.12.rst:1371 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1369 +#: ../../whatsnew/3.12.rst:1372 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1373 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1373 ../../whatsnew/3.12.rst:2306 +#: ../../whatsnew/3.12.rst:1376 ../../whatsnew/3.12.rst:2320 msgid "Pending Removal in Python 3.14" -msgstr "" +msgstr "Python 3.14 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1375 +#: ../../whatsnew/3.12.rst:1378 msgid "" "The following APIs have been deprecated and will be removed in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1381 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction`" msgstr "" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1384 msgid ":mod:`ast`:" msgstr ":mod:`ast`:" -#: ../../whatsnew/3.12.rst:1391 +#: ../../whatsnew/3.12.rst:1394 msgid ":class:`!asyncio.MultiLoopChildWatcher`" msgstr ":class:`!asyncio.MultiLoopChildWatcher`" -#: ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1395 msgid ":class:`!asyncio.FastChildWatcher`" msgstr ":class:`!asyncio.FastChildWatcher`" -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1396 msgid ":class:`!asyncio.AbstractChildWatcher`" msgstr ":class:`!asyncio.AbstractChildWatcher`" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1397 msgid ":class:`!asyncio.SafeChildWatcher`" msgstr ":class:`!asyncio.SafeChildWatcher`" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1398 msgid ":func:`!asyncio.set_child_watcher`" msgstr ":func:`!asyncio.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1399 msgid ":func:`!asyncio.get_child_watcher`," msgstr ":func:`!asyncio.get_child_watcher`、" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1400 msgid ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1401 msgid ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1403 msgid ":mod:`collections.abc`: :class:`!collections.abc.ByteString`." msgstr ":mod:`collections.abc`: :class:`!collections.abc.ByteString`。" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1405 msgid ":mod:`email`: the *isdst* parameter in :func:`email.utils.localtime`." msgstr "" -#: ../../whatsnew/3.12.rst:1404 +#: ../../whatsnew/3.12.rst:1407 msgid ":mod:`importlib.abc`:" msgstr ":mod:`importlib.abc`:" -#: ../../whatsnew/3.12.rst:1410 +#: ../../whatsnew/3.12.rst:1413 msgid ":mod:`itertools`: Support for copy, deepcopy, and pickle operations." msgstr "" -#: ../../whatsnew/3.12.rst:1412 +#: ../../whatsnew/3.12.rst:1415 msgid ":mod:`pkgutil`:" msgstr ":mod:`pkgutil`:" -#: ../../whatsnew/3.12.rst:1414 +#: ../../whatsnew/3.12.rst:1417 msgid ":func:`!pkgutil.find_loader`" msgstr ":func:`!pkgutil.find_loader`" -#: ../../whatsnew/3.12.rst:1415 +#: ../../whatsnew/3.12.rst:1418 msgid ":func:`!pkgutil.get_loader`." msgstr ":func:`!pkgutil.get_loader`。" -#: ../../whatsnew/3.12.rst:1417 +#: ../../whatsnew/3.12.rst:1420 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../whatsnew/3.12.rst:1419 +#: ../../whatsnew/3.12.rst:1422 msgid ":func:`!pty.master_open`" msgstr ":func:`!pty.master_open`" -#: ../../whatsnew/3.12.rst:1420 +#: ../../whatsnew/3.12.rst:1423 msgid ":func:`!pty.slave_open`" msgstr ":func:`!pty.slave_open`" -#: ../../whatsnew/3.12.rst:1422 +#: ../../whatsnew/3.12.rst:1425 msgid ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree`" msgstr "" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1427 msgid ":mod:`typing`: :class:`!typing.ByteString`" msgstr ":mod:`typing`::class:`!typing.ByteString`" -#: ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1429 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element`." msgstr "" -#: ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1431 msgid "The ``__package__`` and ``__cached__`` attributes on module objects." msgstr "" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1433 msgid "The ``co_lnotab`` attribute of code objects." msgstr "" -#: ../../whatsnew/3.12.rst:1433 ../../whatsnew/3.12.rst:2361 -msgid "Pending Removal in Future Versions" +#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:2357 +msgid "Pending Removal in Python 3.15" +msgstr "Python 3.15 中待決議的移除項目" + +#: ../../whatsnew/3.12.rst:1438 +msgid "" +"The following APIs have been deprecated and will be removed in Python 3.15." msgstr "" -#: ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1443 +msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" +msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" + +#: ../../whatsnew/3.12.rst:1447 ../../whatsnew/3.12.rst:2375 +msgid "Pending Removal in Future Versions" +msgstr "未來版本中待決議的移除項目" + +#: ../../whatsnew/3.12.rst:1449 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1438 +#: ../../whatsnew/3.12.rst:1452 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1454 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1456 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -2101,54 +2128,54 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1453 ../../whatsnew/3.12.rst:2393 +#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:2407 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1456 +#: ../../whatsnew/3.12.rst:1470 msgid "asynchat and asyncore" msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1458 +#: ../../whatsnew/3.12.rst:1472 msgid "" "These two modules have been removed according to the schedule in :pep:`594`, " "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1479 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1481 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1484 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1486 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1474 +#: ../../whatsnew/3.12.rst:1488 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1492 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.12.rst:1480 +#: ../../whatsnew/3.12.rst:1494 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -2157,17 +2184,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1487 +#: ../../whatsnew/3.12.rst:1501 msgid "ensurepip" msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1489 +#: ../../whatsnew/3.12.rst:1503 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1506 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -2175,7 +2202,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1498 +#: ../../whatsnew/3.12.rst:1512 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -2185,35 +2212,35 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1505 +#: ../../whatsnew/3.12.rst:1519 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1508 +#: ../../whatsnew/3.12.rst:1522 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.12.rst:1510 +#: ../../whatsnew/3.12.rst:1524 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1515 +#: ../../whatsnew/3.12.rst:1529 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1531 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1536 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1538 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -2222,11 +2249,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1531 +#: ../../whatsnew/3.12.rst:1545 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1533 +#: ../../whatsnew/3.12.rst:1547 msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -2235,191 +2262,191 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1540 ../../whatsnew/3.12.rst:1567 +#: ../../whatsnew/3.12.rst:1554 ../../whatsnew/3.12.rst:1581 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1542 +#: ../../whatsnew/3.12.rst:1556 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1545 +#: ../../whatsnew/3.12.rst:1559 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1548 +#: ../../whatsnew/3.12.rst:1562 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1552 +#: ../../whatsnew/3.12.rst:1566 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1555 +#: ../../whatsnew/3.12.rst:1569 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1559 ../../whatsnew/3.12.rst:1567 +#: ../../whatsnew/3.12.rst:1573 ../../whatsnew/3.12.rst:1581 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1561 +#: ../../whatsnew/3.12.rst:1575 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1564 +#: ../../whatsnew/3.12.rst:1578 msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1583 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1583 msgid "Insert ``None`` into ``sys.path_importer_cache``" -msgstr "" +msgstr "將 ``None`` 插入 ``sys.path_importer_cache``" -#: ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1584 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1584 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1585 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1585 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1572 +#: ../../whatsnew/3.12.rst:1586 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1572 +#: ../../whatsnew/3.12.rst:1586 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1573 +#: ../../whatsnew/3.12.rst:1587 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1573 +#: ../../whatsnew/3.12.rst:1587 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1574 +#: ../../whatsnew/3.12.rst:1588 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1574 +#: ../../whatsnew/3.12.rst:1588 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1589 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1589 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1576 +#: ../../whatsnew/3.12.rst:1590 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1576 +#: ../../whatsnew/3.12.rst:1590 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1577 +#: ../../whatsnew/3.12.rst:1591 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1577 +#: ../../whatsnew/3.12.rst:1591 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1592 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1592 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1593 msgid "``imp.load_source()``" msgstr "``imp.load_source()``" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1593 msgid "*See below*" msgstr "" -#: ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1596 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1611 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1599 +#: ../../whatsnew/3.12.rst:1613 msgid "Undocumented functions:" -msgstr "" +msgstr "未以文件記錄的函式:" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1615 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1602 +#: ../../whatsnew/3.12.rst:1616 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1617 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1604 +#: ../../whatsnew/3.12.rst:1618 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1606 +#: ../../whatsnew/3.12.rst:1620 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1622 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1613 +#: ../../whatsnew/3.12.rst:1627 msgid "io" msgstr "io" -#: ../../whatsnew/3.12.rst:1615 +#: ../../whatsnew/3.12.rst:1629 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2428,18 +2455,18 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1622 +#: ../../whatsnew/3.12.rst:1636 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1638 msgid "" "Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1628 +#: ../../whatsnew/3.12.rst:1642 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2447,27 +2474,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1653 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1642 +#: ../../whatsnew/3.12.rst:1656 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1643 +#: ../../whatsnew/3.12.rst:1657 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1659 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1648 +#: ../../whatsnew/3.12.rst:1662 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2475,22 +2502,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1653 +#: ../../whatsnew/3.12.rst:1667 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1670 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.12.rst:1658 +#: ../../whatsnew/3.12.rst:1672 msgid "" "Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1662 +#: ../../whatsnew/3.12.rst:1676 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2498,7 +2525,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1668 +#: ../../whatsnew/3.12.rst:1682 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2509,189 +2536,189 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1680 +#: ../../whatsnew/3.12.rst:1694 msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1684 +#: ../../whatsnew/3.12.rst:1698 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1701 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1701 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1701 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1689 +#: ../../whatsnew/3.12.rst:1703 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1696 +#: ../../whatsnew/3.12.rst:1703 ../../whatsnew/3.12.rst:1710 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1690 -#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1692 -#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1694 -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1703 ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1705 ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1709 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1704 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1704 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1691 +#: ../../whatsnew/3.12.rst:1705 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1705 ../../whatsnew/3.12.rst:1711 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1706 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1692 ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1706 ../../whatsnew/3.12.rst:1712 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1693 +#: ../../whatsnew/3.12.rst:1707 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1699 +#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1713 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1694 +#: ../../whatsnew/3.12.rst:1708 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1694 ../../whatsnew/3.12.rst:1700 +#: ../../whatsnew/3.12.rst:1708 ../../whatsnew/3.12.rst:1714 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1709 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1709 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1696 +#: ../../whatsnew/3.12.rst:1710 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1696 ../../whatsnew/3.12.rst:1697 -#: ../../whatsnew/3.12.rst:1698 ../../whatsnew/3.12.rst:1699 -#: ../../whatsnew/3.12.rst:1700 ../../whatsnew/3.12.rst:1701 -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1710 ../../whatsnew/3.12.rst:1711 +#: ../../whatsnew/3.12.rst:1712 ../../whatsnew/3.12.rst:1713 +#: ../../whatsnew/3.12.rst:1714 ../../whatsnew/3.12.rst:1715 +#: ../../whatsnew/3.12.rst:1716 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1711 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1712 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1699 +#: ../../whatsnew/3.12.rst:1713 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1700 +#: ../../whatsnew/3.12.rst:1714 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1715 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1715 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1716 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1716 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1717 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1717 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1717 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1720 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1709 +#: ../../whatsnew/3.12.rst:1723 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1726 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1730 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1733 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1722 +#: ../../whatsnew/3.12.rst:1736 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1738 msgid "" "Remove support for obsolete browsers from :mod:`webbrowser`. The removed " "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1729 +#: ../../whatsnew/3.12.rst:1743 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1731 +#: ../../whatsnew/3.12.rst:1745 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -2700,22 +2727,22 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1738 +#: ../../whatsnew/3.12.rst:1752 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1740 +#: ../../whatsnew/3.12.rst:1754 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1746 +#: ../../whatsnew/3.12.rst:1760 msgid "Others" msgstr "其他" -#: ../../whatsnew/3.12.rst:1748 +#: ../../whatsnew/3.12.rst:1762 msgid "" "Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" "file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2960,84 +2987,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1927 +#: ../../whatsnew/3.12.rst:1941 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1929 +#: ../../whatsnew/3.12.rst:1943 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1930 +#: ../../whatsnew/3.12.rst:1944 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1932 +#: ../../whatsnew/3.12.rst:1946 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1934 +#: ../../whatsnew/3.12.rst:1948 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1935 +#: ../../whatsnew/3.12.rst:1949 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1936 +#: ../../whatsnew/3.12.rst:1950 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1938 +#: ../../whatsnew/3.12.rst:1952 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1941 +#: ../../whatsnew/3.12.rst:1955 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:1957 msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1946 +#: ../../whatsnew/3.12.rst:1960 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1948 +#: ../../whatsnew/3.12.rst:1962 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1950 +#: ../../whatsnew/3.12.rst:1964 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1953 +#: ../../whatsnew/3.12.rst:1967 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1956 +#: ../../whatsnew/3.12.rst:1970 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:1972 msgid "" "Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -3045,29 +3072,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1977 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1981 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -msgstr "" +msgstr ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1982 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1983 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:1984 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:1986 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -3078,7 +3105,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1980 +#: ../../whatsnew/3.12.rst:1994 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -3086,32 +3113,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:1999 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1989 +#: ../../whatsnew/3.12.rst:2003 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1990 +#: ../../whatsnew/3.12.rst:2004 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1991 +#: ../../whatsnew/3.12.rst:2005 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:1993 +#: ../../whatsnew/3.12.rst:2007 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1997 +#: ../../whatsnew/3.12.rst:2011 msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -3119,14 +3146,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2017 msgid "" "Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " "the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " "Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2007 +#: ../../whatsnew/3.12.rst:2021 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -3135,28 +3162,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2013 +#: ../../whatsnew/3.12.rst:2027 msgid "" "Add :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2017 +#: ../../whatsnew/3.12.rst:2031 msgid "" "Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2022 +#: ../../whatsnew/3.12.rst:2036 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2026 +#: ../../whatsnew/3.12.rst:2040 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -3166,14 +3193,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2034 +#: ../../whatsnew/3.12.rst:2048 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2038 +#: ../../whatsnew/3.12.rst:2052 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -3181,71 +3208,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2043 +#: ../../whatsnew/3.12.rst:2057 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2049 +#: ../../whatsnew/3.12.rst:2063 msgid "" ":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " "reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:2052 +#: ../../whatsnew/3.12.rst:2066 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:2053 +#: ../../whatsnew/3.12.rst:2067 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2054 +#: ../../whatsnew/3.12.rst:2068 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2069 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:2056 +#: ../../whatsnew/3.12.rst:2070 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:2057 +#: ../../whatsnew/3.12.rst:2071 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:2058 +#: ../../whatsnew/3.12.rst:2072 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2059 +#: ../../whatsnew/3.12.rst:2073 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2060 +#: ../../whatsnew/3.12.rst:2074 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:2063 +#: ../../whatsnew/3.12.rst:2077 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2062 +#: ../../whatsnew/3.12.rst:2076 msgid "" "objects that have been interned. This is now needed for :file:`refleak.py` " "to correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:2065 +#: ../../whatsnew/3.12.rst:2079 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2067 +#: ../../whatsnew/3.12.rst:2081 msgid "" ":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" "c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " @@ -3253,27 +3280,27 @@ msgid "" "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2073 +#: ../../whatsnew/3.12.rst:2087 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2081 +#: ../../whatsnew/3.12.rst:2095 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:2084 +#: ../../whatsnew/3.12.rst:2098 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:2088 +#: ../../whatsnew/3.12.rst:2102 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -3282,7 +3309,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:2095 +#: ../../whatsnew/3.12.rst:2109 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -3290,13 +3317,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:2100 +#: ../../whatsnew/3.12.rst:2114 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:2104 +#: ../../whatsnew/3.12.rst:2118 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -3305,7 +3332,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2110 +#: ../../whatsnew/3.12.rst:2124 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -3314,13 +3341,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2116 +#: ../../whatsnew/3.12.rst:2130 msgid "" "Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2120 +#: ../../whatsnew/3.12.rst:2134 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -3334,7 +3361,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:2132 +#: ../../whatsnew/3.12.rst:2146 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -3342,7 +3369,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2137 +#: ../../whatsnew/3.12.rst:2151 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -3350,7 +3377,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2142 +#: ../../whatsnew/3.12.rst:2156 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -3358,7 +3385,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2147 +#: ../../whatsnew/3.12.rst:2161 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -3366,25 +3393,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:2152 +#: ../../whatsnew/3.12.rst:2166 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:2155 +#: ../../whatsnew/3.12.rst:2169 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:2156 +#: ../../whatsnew/3.12.rst:2170 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:2157 +#: ../../whatsnew/3.12.rst:2171 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:2159 +#: ../../whatsnew/3.12.rst:2173 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -3392,14 +3419,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:2164 +#: ../../whatsnew/3.12.rst:2178 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:2168 +#: ../../whatsnew/3.12.rst:2182 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -3408,17 +3435,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:2175 +#: ../../whatsnew/3.12.rst:2189 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:2177 +#: ../../whatsnew/3.12.rst:2191 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:2179 +#: ../../whatsnew/3.12.rst:2193 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3426,20 +3453,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2184 +#: ../../whatsnew/3.12.rst:2198 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:2188 +#: ../../whatsnew/3.12.rst:2202 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:2191 +#: ../../whatsnew/3.12.rst:2205 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3447,14 +3474,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2196 +#: ../../whatsnew/3.12.rst:2210 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:2200 +#: ../../whatsnew/3.12.rst:2214 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3465,15 +3492,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2208 +#: ../../whatsnew/3.12.rst:2222 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2209 +#: ../../whatsnew/3.12.rst:2223 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2211 +#: ../../whatsnew/3.12.rst:2225 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3482,7 +3509,7 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2221 +#: ../../whatsnew/3.12.rst:2235 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -3491,137 +3518,162 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:2226 +#: ../../whatsnew/3.12.rst:2240 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:2228 ../../whatsnew/3.12.rst:2313 +#: ../../whatsnew/3.12.rst:2242 ../../whatsnew/3.12.rst:2327 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" -msgstr "" +msgstr ":c:var:`Py_DebugFlag`: 請改用 :c:member:`PyConfig.parser_debug`" -#: ../../whatsnew/3.12.rst:2229 ../../whatsnew/3.12.rst:2314 +#: ../../whatsnew/3.12.rst:2243 ../../whatsnew/3.12.rst:2328 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" -msgstr "" +msgstr ":c:var:`Py_VerboseFlag`: 請改用 :c:member:`PyConfig.verbose`" -#: ../../whatsnew/3.12.rst:2230 ../../whatsnew/3.12.rst:2315 +#: ../../whatsnew/3.12.rst:2244 ../../whatsnew/3.12.rst:2329 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" -msgstr "" +msgstr ":c:var:`Py_QuietFlag`: 請改用 :c:member:`PyConfig.quiet`" -#: ../../whatsnew/3.12.rst:2231 ../../whatsnew/3.12.rst:2316 +#: ../../whatsnew/3.12.rst:2245 ../../whatsnew/3.12.rst:2330 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" -msgstr "" +msgstr ":c:var:`Py_InteractiveFlag`: 請改用 :c:member:`PyConfig.interactive`" -#: ../../whatsnew/3.12.rst:2232 ../../whatsnew/3.12.rst:2317 +#: ../../whatsnew/3.12.rst:2246 ../../whatsnew/3.12.rst:2331 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" -msgstr "" +msgstr ":c:var:`Py_InspectFlag`: 請改用 :c:member:`PyConfig.inspect`" -#: ../../whatsnew/3.12.rst:2233 ../../whatsnew/3.12.rst:2318 +#: ../../whatsnew/3.12.rst:2247 ../../whatsnew/3.12.rst:2332 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" +":c:var:`Py_OptimizeFlag`: 請改用 :c:member:`PyConfig.optimization_level`" -#: ../../whatsnew/3.12.rst:2234 ../../whatsnew/3.12.rst:2319 +#: ../../whatsnew/3.12.rst:2248 ../../whatsnew/3.12.rst:2333 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" -msgstr "" +msgstr ":c:var:`Py_NoSiteFlag`: 請改用 :c:member:`PyConfig.site_import`" -#: ../../whatsnew/3.12.rst:2235 ../../whatsnew/3.12.rst:2320 +#: ../../whatsnew/3.12.rst:2249 ../../whatsnew/3.12.rst:2334 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" +":c:var:`Py_BytesWarningFlag`: 請改用 :c:member:`PyConfig.bytes_warning`" -#: ../../whatsnew/3.12.rst:2236 ../../whatsnew/3.12.rst:2321 +#: ../../whatsnew/3.12.rst:2250 ../../whatsnew/3.12.rst:2335 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" +":c:var:`Py_FrozenFlag`: 請改用 :c:member:`PyConfig.pathconfig_warnings`" -#: ../../whatsnew/3.12.rst:2237 ../../whatsnew/3.12.rst:2322 +#: ../../whatsnew/3.12.rst:2251 ../../whatsnew/3.12.rst:2336 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" +":c:var:`Py_IgnoreEnvironmentFlag`: 請改用 :c:member:`PyConfig." +"use_environment`" -#: ../../whatsnew/3.12.rst:2238 ../../whatsnew/3.12.rst:2323 +#: ../../whatsnew/3.12.rst:2252 ../../whatsnew/3.12.rst:2337 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" +":c:var:`Py_DontWriteBytecodeFlag`: 請改用 :c:member:`PyConfig.write_bytecode`" -#: ../../whatsnew/3.12.rst:2239 ../../whatsnew/3.12.rst:2324 +#: ../../whatsnew/3.12.rst:2253 ../../whatsnew/3.12.rst:2338 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" +":c:var:`Py_NoUserSiteDirectory`: 請改用 :c:member:`PyConfig." +"user_site_directory`" -#: ../../whatsnew/3.12.rst:2240 ../../whatsnew/3.12.rst:2325 +#: ../../whatsnew/3.12.rst:2254 ../../whatsnew/3.12.rst:2339 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" +":c:var:`Py_UnbufferedStdioFlag`: 請改用 :c:member:`PyConfig.buffered_stdio`" -#: ../../whatsnew/3.12.rst:2241 ../../whatsnew/3.12.rst:2326 +#: ../../whatsnew/3.12.rst:2255 ../../whatsnew/3.12.rst:2340 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" +":c:var:`Py_HashRandomizationFlag`: 請改用 :c:member:`PyConfig.use_hash_seed` " +"和 :c:member:`PyConfig.hash_seed`" -#: ../../whatsnew/3.12.rst:2243 ../../whatsnew/3.12.rst:2328 +#: ../../whatsnew/3.12.rst:2257 ../../whatsnew/3.12.rst:2342 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" -msgstr "" +msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" -#: ../../whatsnew/3.12.rst:2244 ../../whatsnew/3.12.rst:2329 +#: ../../whatsnew/3.12.rst:2258 ../../whatsnew/3.12.rst:2343 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." +"legacy_windows_fs_encoding`" -#: ../../whatsnew/3.12.rst:2245 ../../whatsnew/3.12.rst:2330 +#: ../../whatsnew/3.12.rst:2259 ../../whatsnew/3.12.rst:2344 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" +":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." +"legacy_windows_stdio`" -#: ../../whatsnew/3.12.rst:2246 ../../whatsnew/3.12.rst:2331 +#: ../../whatsnew/3.12.rst:2260 ../../whatsnew/3.12.rst:2345 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" +":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." +"filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2247 ../../whatsnew/3.12.rst:2332 +#: ../../whatsnew/3.12.rst:2261 ../../whatsnew/3.12.rst:2346 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" +":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." +"filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2248 ../../whatsnew/3.12.rst:2333 +#: ../../whatsnew/3.12.rst:2262 ../../whatsnew/3.12.rst:2347 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." +"filesystem_errors`" -#: ../../whatsnew/3.12.rst:2249 ../../whatsnew/3.12.rst:2334 +#: ../../whatsnew/3.12.rst:2263 ../../whatsnew/3.12.rst:2348 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" +":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" +"func:`Py_PreInitialize`)" -#: ../../whatsnew/3.12.rst:2251 +#: ../../whatsnew/3.12.rst:2265 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" +":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" +"(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2255 +#: ../../whatsnew/3.12.rst:2269 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2258 +#: ../../whatsnew/3.12.rst:2272 msgid "" "The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." -msgstr "" +msgstr ":file:`structmember.h` 標頭已棄用,但仍可使用,且還沒有移除它的計畫。" -#: ../../whatsnew/3.12.rst:2261 +#: ../../whatsnew/3.12.rst:2275 msgid "" "Its contents are now available just by including :file:`Python.h`, with a " "``Py`` prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2264 +#: ../../whatsnew/3.12.rst:2278 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" @@ -3629,325 +3681,348 @@ msgstr "" ":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" "`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2266 +#: ../../whatsnew/3.12.rst:2280 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2268 +#: ../../whatsnew/3.12.rst:2282 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" +":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" +"`Py_AUDIT_READ`\\ (先前全大寫)旗標" -#: ../../whatsnew/3.12.rst:2271 +#: ../../whatsnew/3.12.rst:2285 msgid "Several items are not exposed from :file:`Python.h`:" -msgstr "" +msgstr "數個項目不再從 :file:`Python.h` 中公開:" -#: ../../whatsnew/3.12.rst:2273 +#: ../../whatsnew/3.12.rst:2287 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" -msgstr "" +msgstr ":c:macro:`T_OBJECT`\\ (請改用 :c:macro:`Py_T_OBJECT_EX`)" -#: ../../whatsnew/3.12.rst:2274 +#: ../../whatsnew/3.12.rst:2288 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" -msgstr "" +msgstr ":c:macro:`T_NONE`\\ (先前未記錄於文件上,且相當古怪)" -#: ../../whatsnew/3.12.rst:2275 +#: ../../whatsnew/3.12.rst:2289 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." -msgstr "" +msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" -#: ../../whatsnew/3.12.rst:2276 +#: ../../whatsnew/3.12.rst:2290 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" +"``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" +"`Py_AUDIT_READ`。" -#: ../../whatsnew/3.12.rst:2278 +#: ../../whatsnew/3.12.rst:2292 msgid "" "In some configurations, ```` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2281 +#: ../../whatsnew/3.12.rst:2295 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2286 +#: ../../whatsnew/3.12.rst:2300 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2289 +#: ../../whatsnew/3.12.rst:2303 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2294 +#: ../../whatsnew/3.12.rst:2308 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" +":c:func:`!PyErr_Display` 已棄用,請改用 :c:func:`PyErr_DisplayException`。" +"(由 Irit Katriel 於 :gh:`102755` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2297 +#: ../../whatsnew/3.12.rst:2311 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" +"``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " +"Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2300 +#: ../../whatsnew/3.12.rst:2314 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2308 +#: ../../whatsnew/3.12.rst:2322 msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" -#: ../../whatsnew/3.12.rst:2311 +#: ../../whatsnew/3.12.rst:2325 msgid "Global configuration variables:" msgstr "" -#: ../../whatsnew/3.12.rst:2336 +#: ../../whatsnew/3.12.rst:2350 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead." msgstr "" +":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" -#: ../../whatsnew/3.12.rst:2339 +#: ../../whatsnew/3.12.rst:2353 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:2343 -msgid "Pending Removal in Python 3.15" -msgstr "" - -#: ../../whatsnew/3.12.rst:2345 +#: ../../whatsnew/3.12.rst:2359 msgid "" ":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`" msgstr "" +":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" +"`PyImport_ImportModule`" -#: ../../whatsnew/3.12.rst:2346 +#: ../../whatsnew/3.12.rst:2360 msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t`" -msgstr "" +msgstr ":c:type:`!Py_UNICODE_WIDE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2347 +#: ../../whatsnew/3.12.rst:2361 msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t`" -msgstr "" +msgstr ":c:type:`Py_UNICODE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2348 +#: ../../whatsnew/3.12.rst:2362 msgid "Python initialization functions:" -msgstr "" +msgstr "Python 初始化函式:" -#: ../../whatsnew/3.12.rst:2350 +#: ../../whatsnew/3.12.rst:2364 msgid "" ":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" "warnings.filters`" msgstr "" +":c:func:`PySys_ResetWarnOptions`:清除 :data:`sys.warnoptions` 和 :data:`!" +"warnings.filters`" -#: ../../whatsnew/3.12.rst:2352 +#: ../../whatsnew/3.12.rst:2366 msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix`" -msgstr "" +msgstr ":c:func:`Py_GetExecPrefix`:取得 :data:`sys.exec_prefix`" -#: ../../whatsnew/3.12.rst:2353 +#: ../../whatsnew/3.12.rst:2367 msgid ":c:func:`Py_GetPath`: get :data:`sys.path`" -msgstr "" +msgstr ":c:func:`Py_GetPath`:取得 :data:`sys.path`" -#: ../../whatsnew/3.12.rst:2354 +#: ../../whatsnew/3.12.rst:2368 msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix`" -msgstr "" +msgstr ":c:func:`Py_GetPrefix`:取得 :data:`sys.prefix`" -#: ../../whatsnew/3.12.rst:2355 +#: ../../whatsnew/3.12.rst:2369 msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable`" -msgstr "" +msgstr ":c:func:`Py_GetProgramFullPath`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2356 +#: ../../whatsnew/3.12.rst:2370 msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable`" -msgstr "" +msgstr ":c:func:`Py_GetProgramName`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2357 +#: ../../whatsnew/3.12.rst:2371 msgid "" ":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable" msgstr "" +":c:func:`Py_GetPythonHome`:取得 :c:member:`PyConfig.home` 或 :envvar:" +"`PYTHONHOME` 環境變數" -#: ../../whatsnew/3.12.rst:2363 +#: ../../whatsnew/3.12.rst:2377 msgid "" "The following APIs are deprecated and will be removed, although there is " "currently no date scheduled for their removal." -msgstr "" +msgstr "以下 API 已棄用,且將會被移除,雖目前尚未定下移除日期。" -#: ../../whatsnew/3.12.rst:2366 +#: ../../whatsnew/3.12.rst:2380 msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8" -msgstr "" +msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`:自 Python 3.8 起不再需要" -#: ../../whatsnew/3.12.rst:2367 +#: ../../whatsnew/3.12.rst:2381 msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`" -msgstr "" +msgstr ":c:func:`PyErr_Fetch`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2368 +#: ../../whatsnew/3.12.rst:2382 msgid "" ":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`" msgstr "" +":c:func:`PyErr_NormalizeException`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2369 +#: ../../whatsnew/3.12.rst:2383 msgid ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`" -msgstr "" +msgstr ":c:func:`PyErr_Restore`:請改用 :c:func:`PyErr_SetRaisedException`" -#: ../../whatsnew/3.12.rst:2370 +#: ../../whatsnew/3.12.rst:2384 msgid "" ":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`" msgstr "" +":c:func:`PyModule_GetFilename`:請改用 :c:func:`PyModule_GetFilenameObject`" -#: ../../whatsnew/3.12.rst:2371 +#: ../../whatsnew/3.12.rst:2385 msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`" -msgstr "" +msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`" -#: ../../whatsnew/3.12.rst:2372 +#: ../../whatsnew/3.12.rst:2386 msgid "" ":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices`" msgstr "" +":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" +"`PySlice_AdjustIndices`" -#: ../../whatsnew/3.12.rst:2373 +#: ../../whatsnew/3.12.rst:2387 msgid ":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsDecodedObject`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2374 +#: ../../whatsnew/3.12.rst:2388 msgid ":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2375 +#: ../../whatsnew/3.12.rst:2389 msgid ":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsEncodedObject`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2376 +#: ../../whatsnew/3.12.rst:2390 msgid ":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2377 +#: ../../whatsnew/3.12.rst:2391 msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" -msgstr "" +msgstr ":c:func:`PyUnicode_READY`:自 Python 3.12 起不再需要" -#: ../../whatsnew/3.12.rst:2378 +#: ../../whatsnew/3.12.rst:2392 msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`" -msgstr "" +msgstr ":c:func:`!PyErr_Display`:請改用 :c:func:`PyErr_DisplayException`" -#: ../../whatsnew/3.12.rst:2379 +#: ../../whatsnew/3.12.rst:2393 msgid ":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``" -msgstr "" +msgstr ":c:func:`!_PyErr_ChainExceptions`:請改用 ``_PyErr_ChainExceptions1``" -#: ../../whatsnew/3.12.rst:2380 +#: ../../whatsnew/3.12.rst:2394 msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead" msgstr "" +":c:member:`!PyBytesObject.ob_shash` 成員:請改用 :c:func:`PyObject_Hash`" -#: ../../whatsnew/3.12.rst:2382 +#: ../../whatsnew/3.12.rst:2396 msgid ":c:member:`!PyDictObject.ma_version_tag` member" msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員" -#: ../../whatsnew/3.12.rst:2383 +#: ../../whatsnew/3.12.rst:2397 msgid "Thread Local Storage (TLS) API:" msgstr "" -#: ../../whatsnew/3.12.rst:2385 +#: ../../whatsnew/3.12.rst:2399 msgid ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`" -msgstr "" +msgstr ":c:func:`PyThread_create_key`:請改用 :c:func:`PyThread_tss_alloc`" -#: ../../whatsnew/3.12.rst:2386 +#: ../../whatsnew/3.12.rst:2400 msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`" -msgstr "" +msgstr ":c:func:`PyThread_delete_key`:請改用 :c:func:`PyThread_tss_free`" -#: ../../whatsnew/3.12.rst:2387 +#: ../../whatsnew/3.12.rst:2401 msgid ":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`" -msgstr "" +msgstr ":c:func:`PyThread_set_key_value`:請改用 :c:func:`PyThread_tss_set`" -#: ../../whatsnew/3.12.rst:2388 +#: ../../whatsnew/3.12.rst:2402 msgid ":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`" -msgstr "" +msgstr ":c:func:`PyThread_get_key_value`:請改用 :c:func:`PyThread_tss_get`" -#: ../../whatsnew/3.12.rst:2389 +#: ../../whatsnew/3.12.rst:2403 msgid ":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`" msgstr "" +":c:func:`PyThread_delete_key_value`:請改用 :c:func:`PyThread_tss_delete`" -#: ../../whatsnew/3.12.rst:2390 +#: ../../whatsnew/3.12.rst:2404 msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7" -msgstr "" +msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要" -#: ../../whatsnew/3.12.rst:2395 +#: ../../whatsnew/3.12.rst:2409 msgid "" "Remove the :file:`token.h` header file. There was never any public tokenizer " "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2400 +#: ../../whatsnew/3.12.rst:2414 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2402 +#: ../../whatsnew/3.12.rst:2416 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2403 +#: ../../whatsnew/3.12.rst:2417 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2404 +#: ../../whatsnew/3.12.rst:2418 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2405 +#: ../../whatsnew/3.12.rst:2419 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2406 +#: ../../whatsnew/3.12.rst:2420 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2407 +#: ../../whatsnew/3.12.rst:2421 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2408 +#: ../../whatsnew/3.12.rst:2422 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2409 +#: ../../whatsnew/3.12.rst:2423 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2410 +#: ../../whatsnew/3.12.rst:2424 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2412 +#: ../../whatsnew/3.12.rst:2426 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" +"移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 於 :gh:" +"`85858` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2415 +#: ../../whatsnew/3.12.rst:2429 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" +"移除數個標準函式庫模組與測試中的 ``Jython`` 相容性修補程式。(由 Nikita " +"Sobolev 於 :gh:`99482` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2418 +#: ../../whatsnew/3.12.rst:2432 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" msgstr "" +"移除 :mod:`ctypes` 模組中的 ``_use_broken_old_ctypes_structure_semantics_`` " +"旗標。(由 Nikita Sobolev 於 :gh:`99285` 中貢獻。)" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 0914591a50..615ebdc8c2 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -39,7 +39,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:60 msgid "New syntax features:" -msgstr "新的語法特徵:" +msgstr "新增語法特性:" #: ../../whatsnew/3.3.rst:62 msgid "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 2c35922a63..75456d370f 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -47,7 +47,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:80 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.4.rst:82 msgid "No new syntax features were added in Python 3.4." @@ -180,7 +180,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:132 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.4.rst:134 msgid "" @@ -790,7 +790,7 @@ msgstr "由 Victor Stinner 撰寫 PEP 與實作" #: ../../whatsnew/3.4.rst:589 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.4.rst:593 msgid "abc" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index d09d5e9665..93350b023b 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -49,7 +49,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:60 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.5.rst:62 msgid "" @@ -184,7 +184,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:136 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.5.rst:138 msgid "" @@ -829,7 +829,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:724 msgid "New Modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.5.rst:727 msgid "typing" @@ -873,7 +873,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:761 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.5.rst:764 msgid "argparse" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 722a05f71c..05160bd208 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -44,7 +44,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:60 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.6.rst:62 msgid ":ref:`PEP 498 `, formatted string literals." @@ -162,7 +162,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:130 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.6.rst:132 msgid "" @@ -916,7 +916,7 @@ msgstr "由 Steven D'Aprano 撰寫 PEP 與實作。" #: ../../whatsnew/3.6.rst:792 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.6.rst:795 msgid "array" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 29981b965a..573273daac 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -40,7 +40,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:58 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.7.rst:60 msgid "" @@ -152,7 +152,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:109 msgid "C API improvements:" -msgstr "" +msgstr "C API 改進:" #: ../../whatsnew/3.7.rst:111 msgid ":ref:`PEP 539 `, new C API for thread-local storage" @@ -854,7 +854,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:619 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.7.rst:623 msgid "argparse" @@ -2321,7 +2321,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:1645 msgid "C API Changes" -msgstr "" +msgstr "C API 變更" #: ../../whatsnew/3.7.rst:1647 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 40a1f64f79..c7518e2e99 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-13 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -686,7 +686,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:543 msgid "New Modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.8.rst:545 msgid "" @@ -701,7 +701,7 @@ msgstr "(由 Barry Warsaw 和 Jason R. Coombs 在 :issue:`34632` 中貢獻。 #: ../../whatsnew/3.8.rst:568 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.8.rst:571 msgid "ast" @@ -2106,9 +2106,9 @@ msgstr "" #: ../../whatsnew/3.8.rst:1656 msgid "" -"The :meth:`__getitem__` methods of :class:`xml.dom.pulldom.DOMEventStream`, :" -"class:`wsgiref.util.FileWrapper` and :class:`fileinput.FileInput` have been " -"deprecated." +"The :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." +"DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." +"FileInput` have been deprecated." msgstr "" #: ../../whatsnew/3.8.rst:1660 diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 08cc7c79e0..4b22ebcf8a 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -47,7 +47,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:60 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.9.rst:62 msgid ":pep:`584`, union operators added to ``dict``;" @@ -85,7 +85,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:76 msgid "Interpreter improvements:" -msgstr "" +msgstr "直譯器的改進:" #: ../../whatsnew/3.9.rst:78 msgid "" @@ -428,7 +428,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:325 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.9.rst:328 msgid "ast" @@ -1809,7 +1809,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1270 msgid "C API Changes" -msgstr "" +msgstr "C API 變更" #: ../../whatsnew/3.9.rst:1275 msgid ""