diff --git a/c-api/allocation.po b/c-api/allocation.po index 53b2905968..f167bb99fa 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+0000\n" "PO-Revision-Date: 2022-10-16 15:35+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,16 +50,17 @@ msgstr "" msgid "" "Allocate a new Python object using the C structure type *TYPE* and the " "Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the " -"Python object header are not initialized; the object's reference count will " -"be one. The size of the memory allocation is determined from the :c:member:" -"`~PyTypeObject.tp_basicsize` field of the type object." +"Python object header are not initialized. The caller will own the only " +"reference to the object (i.e. its reference count will be one). The size of " +"the memory allocation is determined from the :c:member:`~PyTypeObject." +"tp_basicsize` field of the type object." msgstr "" "使用 C 結構型別 *TYPE* 和 Python 型別物件 *typeobj* (``PyTypeObject*``) 分配" "一個新的 Python 物件。未在該 Python 物件標頭 (header) 中定義的欄位不會被初始" -"化;物件的參照計數將為一。記憶體分配大小由 type 物件的 :c:member:" -"`~PyTypeObject.tp_basicsize` 欄位來指定。" +"化;呼叫者會擁有那個對於物件的唯一參照(物件的參照計數為一)。記憶體分配大小" +"由 type 物件的 :c:member:`~PyTypeObject.tp_basicsize` 欄位來指定。" -#: ../../c-api/allocation.rst:42 +#: ../../c-api/allocation.rst:43 msgid "" "Allocate a new Python object using the C structure type *TYPE* and the " "Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the " @@ -78,7 +79,7 @@ msgstr "" "於實現如 tuple 這種能夠在建立期間決定自己大小的物件是很實用的。將欄位的陣列嵌" "入到相同的記憶體分配中可以減少記憶體分配的次數,這提高了記憶體管理的效率。" -#: ../../c-api/allocation.rst:56 +#: ../../c-api/allocation.rst:57 msgid "" "Releases memory allocated to an object using :c:macro:`PyObject_New` or :c:" "macro:`PyObject_NewVar`. This is normally called from the :c:member:" @@ -91,7 +92,7 @@ msgstr "" "handler 中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的" "記憶體已不再是一個有效的 Python 物件。" -#: ../../c-api/allocation.rst:65 +#: ../../c-api/allocation.rst:66 msgid "" "Object which is visible in Python as ``None``. This should only be accessed " "using the :c:macro:`Py_None` macro, which evaluates to a pointer to this " @@ -100,10 +101,10 @@ msgstr "" "這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存" "取,該巨集的拿到指向該物件的指標。" -#: ../../c-api/allocation.rst:72 +#: ../../c-api/allocation.rst:73 msgid ":c:func:`PyModule_Create`" msgstr ":c:func:`PyModule_Create`" -#: ../../c-api/allocation.rst:73 +#: ../../c-api/allocation.rst:74 msgid "To allocate and create extension modules." msgstr "分配記憶體和建立擴充模組。" diff --git a/c-api/arg.po b/c-api/arg.po index 3b28780c5b..f70d871cf2 100644 --- a/c-api/arg.po +++ b/c-api/arg.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-08-09 00:03+0000\n" "PO-Revision-Date: 2022-10-16 03:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -178,7 +178,7 @@ msgid "" "encoding." msgstr "" -#: ../../c-api/arg.rst:115 ../../c-api/arg.rst:544 +#: ../../c-api/arg.rst:115 ../../c-api/arg.rst:547 msgid "``z`` (:class:`str` or ``None``) [const char \\*]" msgstr "``z``\\ (:class:`str` 或 ``None``)[const char \\*]" @@ -428,7 +428,7 @@ msgid "" "c:expr:`unsigned char`." msgstr "" -#: ../../c-api/arg.rst:238 ../../c-api/arg.rst:578 +#: ../../c-api/arg.rst:238 ../../c-api/arg.rst:581 msgid "``B`` (:class:`int`) [unsigned char]" msgstr "``B`` (:class:`int`) [unsigned char]" @@ -438,7 +438,7 @@ msgid "" "a C :c:expr:`unsigned char`." msgstr "" -#: ../../c-api/arg.rst:241 ../../c-api/arg.rst:572 +#: ../../c-api/arg.rst:241 ../../c-api/arg.rst:575 msgid "``h`` (:class:`int`) [short int]" msgstr "``h`` (:class:`int`) [short int]" @@ -446,7 +446,7 @@ msgstr "``h`` (:class:`int`) [short int]" msgid "Convert a Python integer to a C :c:expr:`short int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`short int`。" -#: ../../c-api/arg.rst:245 ../../c-api/arg.rst:581 +#: ../../c-api/arg.rst:245 ../../c-api/arg.rst:584 msgid "``H`` (:class:`int`) [unsigned short int]" msgstr "``H`` (:class:`int`) [unsigned short int]" @@ -458,7 +458,7 @@ msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned short int`,轉換過程無溢位檢" "查。" -#: ../../c-api/arg.rst:248 ../../c-api/arg.rst:566 +#: ../../c-api/arg.rst:248 ../../c-api/arg.rst:569 msgid "``i`` (:class:`int`) [int]" msgstr "``i`` (:class:`int`) [int]" @@ -466,7 +466,7 @@ msgstr "``i`` (:class:`int`) [int]" msgid "Convert a Python integer to a plain C :c:expr:`int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`int`。" -#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:584 +#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:587 msgid "``I`` (:class:`int`) [unsigned int]" msgstr "``I`` (:class:`int`) [unsigned int]" @@ -477,7 +477,7 @@ msgid "" msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned int`,轉換過程無溢位檢查。" -#: ../../c-api/arg.rst:255 ../../c-api/arg.rst:575 +#: ../../c-api/arg.rst:255 ../../c-api/arg.rst:578 msgid "``l`` (:class:`int`) [long int]" msgstr "``l`` (:class:`int`) [long int]" @@ -485,7 +485,7 @@ msgstr "``l`` (:class:`int`) [long int]" msgid "Convert a Python integer to a C :c:expr:`long int`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long int`。" -#: ../../c-api/arg.rst:259 ../../c-api/arg.rst:587 +#: ../../c-api/arg.rst:259 ../../c-api/arg.rst:590 msgid "``k`` (:class:`int`) [unsigned long]" msgstr "``k`` (:class:`int`) [unsigned long]" @@ -496,7 +496,7 @@ msgid "" msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long`,轉換過程無溢位檢查。" -#: ../../c-api/arg.rst:262 ../../c-api/arg.rst:590 +#: ../../c-api/arg.rst:262 ../../c-api/arg.rst:593 msgid "``L`` (:class:`int`) [long long]" msgstr "``L`` (:class:`int`) [long long]" @@ -504,7 +504,7 @@ msgstr "``L`` (:class:`int`) [long long]" msgid "Convert a Python integer to a C :c:expr:`long long`." msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long long`。" -#: ../../c-api/arg.rst:266 ../../c-api/arg.rst:593 +#: ../../c-api/arg.rst:266 ../../c-api/arg.rst:596 msgid "``K`` (:class:`int`) [unsigned long long]" msgstr "``K`` (:class:`int`) [unsigned long long]" @@ -516,7 +516,7 @@ msgstr "" "將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long long`,轉換過程無溢位檢" "查。" -#: ../../c-api/arg.rst:269 ../../c-api/arg.rst:596 +#: ../../c-api/arg.rst:269 ../../c-api/arg.rst:599 msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" @@ -538,7 +538,7 @@ msgstr "" msgid "Allow :class:`bytearray` objects." msgstr "允許 :class:`bytearray` 物件。" -#: ../../c-api/arg.rst:280 ../../c-api/arg.rst:604 +#: ../../c-api/arg.rst:280 ../../c-api/arg.rst:607 msgid "``C`` (:class:`str` of length 1) [int]" msgstr "``C``\\ (長度為 1 的 :class:`str`)[int]" @@ -548,7 +548,7 @@ msgid "" "1, to a C :c:expr:`int`." msgstr "" -#: ../../c-api/arg.rst:283 ../../c-api/arg.rst:610 +#: ../../c-api/arg.rst:283 ../../c-api/arg.rst:613 msgid "``f`` (:class:`float`) [float]" msgstr "``f`` (:class:`float`) [float]" @@ -556,7 +556,7 @@ msgstr "``f`` (:class:`float`) [float]" msgid "Convert a Python floating point number to a C :c:expr:`float`." msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`float`。" -#: ../../c-api/arg.rst:286 ../../c-api/arg.rst:607 +#: ../../c-api/arg.rst:286 ../../c-api/arg.rst:610 msgid "``d`` (:class:`float`) [double]" msgstr "``d`` (:class:`float`) [double]" @@ -576,22 +576,23 @@ msgstr "將一個 Python 複數轉換成 C 的 :c:type:`Py_complex` 結構。" msgid "Other objects" msgstr "其他物件" -#: ../../c-api/arg.rst:297 ../../c-api/arg.rst:621 +#: ../../c-api/arg.rst:299 ../../c-api/arg.rst:626 msgid "``O`` (object) [PyObject \\*]" msgstr "``O``\\ (物件)[PyObject \\*]" #: ../../c-api/arg.rst:295 msgid "" "Store a Python object (without any conversion) in a C object pointer. The C " -"program thus receives the actual object that was passed. The object's " -"reference count is not increased. The pointer stored is not ``NULL``." +"program thus receives the actual object that was passed. A new :term:" +"`strong reference` to the object is not created (i.e. its reference count is " +"not increased). The pointer stored is not ``NULL``." msgstr "" -#: ../../c-api/arg.rst:304 +#: ../../c-api/arg.rst:306 msgid "``O!`` (object) [*typeobject*, PyObject \\*]" msgstr "``O!``\\ (物件)[*typeobject*, PyObject \\*]" -#: ../../c-api/arg.rst:300 +#: ../../c-api/arg.rst:302 msgid "" "Store a Python object in a C object pointer. This is similar to ``O``, but " "takes two C arguments: the first is the address of a Python type object, the " @@ -600,11 +601,11 @@ msgid "" "required type, :exc:`TypeError` is raised." msgstr "" -#: ../../c-api/arg.rst:329 ../../c-api/arg.rst:635 +#: ../../c-api/arg.rst:331 ../../c-api/arg.rst:640 msgid "``O&`` (object) [*converter*, *anything*]" msgstr "``O&``\\ (物件)[*converter*, *anything*]" -#: ../../c-api/arg.rst:309 +#: ../../c-api/arg.rst:311 msgid "" "Convert a Python object to a C variable through a *converter* function. " "This takes two arguments: the first is a function, the second is the address " @@ -612,7 +613,7 @@ msgid "" "*converter* function in turn is called as follows::" msgstr "" -#: ../../c-api/arg.rst:316 +#: ../../c-api/arg.rst:318 msgid "" "where *object* is the Python object to be converted and *address* is the :c:" "expr:`void*` argument that was passed to the ``PyArg_Parse*`` function. The " @@ -622,7 +623,7 @@ msgid "" "unmodified." msgstr "" -#: ../../c-api/arg.rst:322 +#: ../../c-api/arg.rst:324 msgid "" "If the *converter* returns ``Py_CLEANUP_SUPPORTED``, it may get called a " "second time if the argument parsing eventually fails, giving the converter a " @@ -631,15 +632,15 @@ msgid "" "value as in the original call." msgstr "" -#: ../../c-api/arg.rst:328 +#: ../../c-api/arg.rst:330 msgid "``Py_CLEANUP_SUPPORTED`` was added." msgstr "加入 ``Py_CLEANUP_SUPPORTED``。" -#: ../../c-api/arg.rst:338 +#: ../../c-api/arg.rst:340 msgid "``p`` (:class:`bool`) [int]" msgstr "``p`` (:class:`bool`) [int]" -#: ../../c-api/arg.rst:332 +#: ../../c-api/arg.rst:334 msgid "" "Tests the value passed in for truth (a boolean **p**\\ redicate) and " "converts the result to its equivalent C true/false integer value. Sets the " @@ -648,18 +649,18 @@ msgid "" "how Python tests values for truth." msgstr "" -#: ../../c-api/arg.rst:343 ../../c-api/arg.rst:638 +#: ../../c-api/arg.rst:345 ../../c-api/arg.rst:643 msgid "``(items)`` (:class:`tuple`) [*matching-items*]" msgstr "``(items)`` (:class:`tuple`) [*matching-items*]" -#: ../../c-api/arg.rst:341 +#: ../../c-api/arg.rst:343 msgid "" "The object must be a Python sequence whose length is the number of format " "units in *items*. The C arguments must correspond to the individual format " "units in *items*. Format units for sequences may be nested." msgstr "" -#: ../../c-api/arg.rst:345 +#: ../../c-api/arg.rst:347 msgid "" "It is possible to pass \"long\" integers (integers whose value exceeds the " "platform's :c:macro:`LONG_MAX`) however no proper range checking is done --- " @@ -668,17 +669,17 @@ msgid "" "downcasts in C --- your mileage may vary)." msgstr "" -#: ../../c-api/arg.rst:351 +#: ../../c-api/arg.rst:353 msgid "" "A few other characters have a meaning in a format string. These may not " "occur inside nested parentheses. They are:" msgstr "" -#: ../../c-api/arg.rst:359 +#: ../../c-api/arg.rst:361 msgid "``|``" msgstr "``|``" -#: ../../c-api/arg.rst:355 +#: ../../c-api/arg.rst:357 msgid "" "Indicates that the remaining arguments in the Python argument list are " "optional. The C variables corresponding to optional arguments should be " @@ -687,11 +688,11 @@ msgid "" "corresponding C variable(s)." msgstr "" -#: ../../c-api/arg.rst:368 +#: ../../c-api/arg.rst:370 msgid "``$``" msgstr "``$``" -#: ../../c-api/arg.rst:362 +#: ../../c-api/arg.rst:364 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` only: Indicates that the remaining " "arguments in the Python argument list are keyword-only. Currently, all " @@ -699,35 +700,36 @@ msgid "" "be specified before ``$`` in the format string." msgstr "" -#: ../../c-api/arg.rst:373 +#: ../../c-api/arg.rst:375 msgid "``:``" msgstr "``:``" -#: ../../c-api/arg.rst:371 +#: ../../c-api/arg.rst:373 msgid "" "The list of format units ends here; the string after the colon is used as " "the function name in error messages (the \"associated value\" of the " "exception that :c:func:`PyArg_ParseTuple` raises)." msgstr "" -#: ../../c-api/arg.rst:378 +#: ../../c-api/arg.rst:380 msgid "``;``" msgstr "``;``" -#: ../../c-api/arg.rst:376 +#: ../../c-api/arg.rst:378 msgid "" "The list of format units ends here; the string after the semicolon is used " "as the error message *instead* of the default error message. ``:`` and ``;" "`` mutually exclude each other." msgstr "" -#: ../../c-api/arg.rst:380 +#: ../../c-api/arg.rst:382 msgid "" "Note that any Python object references which are provided to the caller are " -"*borrowed* references; do not decrement their reference count!" +"*borrowed* references; do not release them (i.e. do not decrement their " +"reference count)!" msgstr "" -#: ../../c-api/arg.rst:383 +#: ../../c-api/arg.rst:386 msgid "" "Additional arguments passed to these functions must be addresses of " "variables whose type is determined by the format string; these are used to " @@ -737,7 +739,7 @@ msgid "" "unit in that case." msgstr "" -#: ../../c-api/arg.rst:389 +#: ../../c-api/arg.rst:392 msgid "" "For the conversion to succeed, the *arg* object must match the format and " "the format must be exhausted. On success, the ``PyArg_Parse*`` functions " @@ -747,24 +749,24 @@ msgid "" "the following format units are left untouched." msgstr "" -#: ../../c-api/arg.rst:398 +#: ../../c-api/arg.rst:401 msgid "API Functions" msgstr "API 函式" -#: ../../c-api/arg.rst:402 +#: ../../c-api/arg.rst:405 msgid "" "Parse the parameters of a function that takes only positional parameters " "into local variables. Returns true on success; on failure, it returns false " "and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:409 +#: ../../c-api/arg.rst:412 msgid "" "Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list " "rather than a variable number of arguments." msgstr "" -#: ../../c-api/arg.rst:415 +#: ../../c-api/arg.rst:418 msgid "" "Parse the parameters of a function that takes both positional and keyword " "parameters into local variables. The *keywords* argument is a ``NULL``-" @@ -773,26 +775,26 @@ msgid "" "success; on failure, it returns false and raises the appropriate exception." msgstr "" -#: ../../c-api/arg.rst:422 +#: ../../c-api/arg.rst:425 msgid "" "Added support for :ref:`positional-only parameters `." msgstr "" -#: ../../c-api/arg.rst:429 +#: ../../c-api/arg.rst:432 msgid "" "Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a " "va_list rather than a variable number of arguments." msgstr "" -#: ../../c-api/arg.rst:435 +#: ../../c-api/arg.rst:438 msgid "" "Ensure that the keys in the keywords argument dictionary are strings. This " "is only needed if :c:func:`PyArg_ParseTupleAndKeywords` is not used, since " "the latter already does this check." msgstr "" -#: ../../c-api/arg.rst:445 +#: ../../c-api/arg.rst:448 msgid "" "Function used to deconstruct the argument lists of \"old-style\" functions " "--- these are functions which use the :const:`METH_OLDARGS` parameter " @@ -803,7 +805,7 @@ msgid "" "continue to be used for that purpose." msgstr "" -#: ../../c-api/arg.rst:456 +#: ../../c-api/arg.rst:459 msgid "" "A simpler form of parameter retrieval which does not use a format string to " "specify the types of the arguments. Functions which use this method to " @@ -821,23 +823,23 @@ msgid "" "if there was a failure." msgstr "" -#: ../../c-api/arg.rst:471 +#: ../../c-api/arg.rst:474 msgid "" "This is an example of the use of this function, taken from the sources for " "the :mod:`!_weakref` helper module for weak references::" msgstr "" -#: ../../c-api/arg.rst:487 +#: ../../c-api/arg.rst:490 msgid "" "The call to :c:func:`PyArg_UnpackTuple` in this example is entirely " "equivalent to this call to :c:func:`PyArg_ParseTuple`::" msgstr "" -#: ../../c-api/arg.rst:495 +#: ../../c-api/arg.rst:498 msgid "Building values" msgstr "" -#: ../../c-api/arg.rst:499 +#: ../../c-api/arg.rst:502 msgid "" "Create a new value based on a format string similar to those accepted by the " "``PyArg_Parse*`` family of functions and a sequence of values. Returns the " @@ -845,7 +847,7 @@ msgid "" "``NULL`` is returned." msgstr "" -#: ../../c-api/arg.rst:504 +#: ../../c-api/arg.rst:507 msgid "" ":c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple " "only if its format string contains two or more format units. If the format " @@ -854,7 +856,7 @@ msgid "" "it to return a tuple of size 0 or one, parenthesize the format string." msgstr "" -#: ../../c-api/arg.rst:510 +#: ../../c-api/arg.rst:513 msgid "" "When memory buffers are passed as parameters to supply data to build " "objects, as for the ``s`` and ``s#`` formats, the required data is copied. " @@ -865,7 +867,7 @@ msgid "" "`Py_BuildValue` returns." msgstr "" -#: ../../c-api/arg.rst:518 +#: ../../c-api/arg.rst:521 msgid "" "In the following description, the quoted form is the format unit; the entry " "in (round) parentheses is the Python object type that the format unit will " @@ -873,155 +875,155 @@ msgid "" "be passed." msgstr "" -#: ../../c-api/arg.rst:522 +#: ../../c-api/arg.rst:525 msgid "" "The characters space, tab, colon and comma are ignored in format strings " "(but not within format units such as ``s#``). This can be used to make long " "format strings a tad more readable." msgstr "" -#: ../../c-api/arg.rst:528 +#: ../../c-api/arg.rst:531 msgid "``s`` (:class:`str` or ``None``) [const char \\*]" msgstr "``s``\\ (:class:`str` 或 ``None``)[const char \\*]" -#: ../../c-api/arg.rst:527 +#: ../../c-api/arg.rst:530 msgid "" "Convert a null-terminated C string to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, ``None`` is used." msgstr "" -#: ../../c-api/arg.rst:533 +#: ../../c-api/arg.rst:536 msgid "" "``s#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``s#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:531 +#: ../../c-api/arg.rst:534 msgid "" "Convert a C string and its length to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:537 +#: ../../c-api/arg.rst:540 msgid "``y`` (:class:`bytes`) [const char \\*]" msgstr "``y`` (:class:`bytes`) [const char \\*]" -#: ../../c-api/arg.rst:536 +#: ../../c-api/arg.rst:539 msgid "" "This converts a C string to a Python :class:`bytes` object. If the C string " "pointer is ``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:541 +#: ../../c-api/arg.rst:544 msgid "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:540 +#: ../../c-api/arg.rst:543 msgid "" "This converts a C string and its lengths to a Python object. If the C " "string pointer is ``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:544 ../../c-api/arg.rst:560 +#: ../../c-api/arg.rst:547 ../../c-api/arg.rst:563 msgid "Same as ``s``." msgstr "和 ``s`` 相同。" -#: ../../c-api/arg.rst:547 +#: ../../c-api/arg.rst:550 msgid "" "``z#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``z#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:547 ../../c-api/arg.rst:563 +#: ../../c-api/arg.rst:550 ../../c-api/arg.rst:566 msgid "Same as ``s#``." msgstr "和 ``s#`` 相同。" -#: ../../c-api/arg.rst:552 +#: ../../c-api/arg.rst:555 msgid "``u`` (:class:`str`) [const wchar_t \\*]" msgstr "``u`` (:class:`str`) [const wchar_t \\*]" -#: ../../c-api/arg.rst:550 +#: ../../c-api/arg.rst:553 msgid "" "Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or " "UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is " "``NULL``, ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:557 +#: ../../c-api/arg.rst:560 msgid "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" msgstr "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:555 +#: ../../c-api/arg.rst:558 msgid "" "Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python " "Unicode object. If the Unicode buffer pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: ../../c-api/arg.rst:560 +#: ../../c-api/arg.rst:563 msgid "``U`` (:class:`str` or ``None``) [const char \\*]" msgstr "``U``\\ (:class:`str` 或 ``None``)[const char \\*]" -#: ../../c-api/arg.rst:563 +#: ../../c-api/arg.rst:566 msgid "" "``U#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" "``U#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:566 +#: ../../c-api/arg.rst:569 msgid "Convert a plain C :c:expr:`int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:569 +#: ../../c-api/arg.rst:572 msgid "``b`` (:class:`int`) [char]" msgstr "``b`` (:class:`int`) [char]" -#: ../../c-api/arg.rst:569 +#: ../../c-api/arg.rst:572 msgid "Convert a plain C :c:expr:`char` to a Python integer object." msgstr "將一個 C 的 :c:expr:`char` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:572 +#: ../../c-api/arg.rst:575 msgid "Convert a plain C :c:expr:`short int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`short int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:575 +#: ../../c-api/arg.rst:578 msgid "Convert a C :c:expr:`long int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`long int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:578 +#: ../../c-api/arg.rst:581 msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned char` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:581 +#: ../../c-api/arg.rst:584 msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned short int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:584 +#: ../../c-api/arg.rst:587 msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned int` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:587 +#: ../../c-api/arg.rst:590 msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:590 +#: ../../c-api/arg.rst:593 msgid "Convert a C :c:expr:`long long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`long long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:593 +#: ../../c-api/arg.rst:596 msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." msgstr "將一個 C 的 :c:expr:`unsigned long long` 轉換成 Python 整數物件。" -#: ../../c-api/arg.rst:596 +#: ../../c-api/arg.rst:599 msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer." msgstr "將一個 C 的 :c:type:`Py_ssize_t` 轉換成 Python 整數。" -#: ../../c-api/arg.rst:600 +#: ../../c-api/arg.rst:603 msgid "``c`` (:class:`bytes` of length 1) [char]" msgstr "``c``\\ (長度為 1 的 :class:`bytes`)[char]" -#: ../../c-api/arg.rst:599 +#: ../../c-api/arg.rst:602 msgid "" "Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " "object of length 1." @@ -1029,7 +1031,7 @@ msgstr "" "將一個 C 中代表一個位元組的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" "`bytes`。" -#: ../../c-api/arg.rst:603 +#: ../../c-api/arg.rst:606 msgid "" "Convert a C :c:expr:`int` representing a character to Python :class:`str` " "object of length 1." @@ -1037,52 +1039,52 @@ msgstr "" "將一個 C 中代表一個字元的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" "`str`。" -#: ../../c-api/arg.rst:607 +#: ../../c-api/arg.rst:610 msgid "Convert a C :c:expr:`double` to a Python floating point number." msgstr "將一個 C 的 :c:expr:`double` 轉換成 Python 浮點數。" -#: ../../c-api/arg.rst:610 +#: ../../c-api/arg.rst:613 msgid "Convert a C :c:expr:`float` to a Python floating point number." msgstr "將一個 C 的 :c:expr:`float` 轉換成 Python 浮點數。" -#: ../../c-api/arg.rst:613 +#: ../../c-api/arg.rst:616 msgid "``D`` (:class:`complex`) [Py_complex \\*]" msgstr "``D`` (:class:`complex`) [Py_complex \\*]" -#: ../../c-api/arg.rst:613 +#: ../../c-api/arg.rst:616 msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number." msgstr "將一個 C 的 :c:type:`Py_complex` 結構轉換成 Python 複數。" -#: ../../c-api/arg.rst:616 +#: ../../c-api/arg.rst:619 msgid "" -"Pass a Python object untouched (except for its reference count, which is " -"incremented by one). If the object passed in is a ``NULL`` pointer, it is " -"assumed that this was caused because the call producing the argument found " -"an error and set an exception. Therefore, :c:func:`Py_BuildValue` will " -"return ``NULL`` but won't raise an exception. If no exception has been " -"raised yet, :exc:`SystemError` is set." +"Pass a Python object untouched but create a new :term:`strong reference` to " +"it (i.e. its reference count is incremented by one). If the object passed in " +"is a ``NULL`` pointer, it is assumed that this was caused because the call " +"producing the argument found an error and set an exception. Therefore, :c:" +"func:`Py_BuildValue` will return ``NULL`` but won't raise an exception. If " +"no exception has been raised yet, :exc:`SystemError` is set." msgstr "" -#: ../../c-api/arg.rst:624 +#: ../../c-api/arg.rst:629 msgid "``S`` (object) [PyObject \\*]" msgstr "``S``\\ (物件)[PyObject \\*]" -#: ../../c-api/arg.rst:624 +#: ../../c-api/arg.rst:629 msgid "Same as ``O``." msgstr "和 ``O`` 相同。" -#: ../../c-api/arg.rst:629 +#: ../../c-api/arg.rst:634 msgid "``N`` (object) [PyObject \\*]" msgstr "``N``\\ (物件)[PyObject \\*]" -#: ../../c-api/arg.rst:627 +#: ../../c-api/arg.rst:632 msgid "" -"Same as ``O``, except it doesn't increment the reference count on the " -"object. Useful when the object is created by a call to an object constructor " -"in the argument list." +"Same as ``O``, except it doesn't create a new :term:`strong reference`. " +"Useful when the object is created by a call to an object constructor in the " +"argument list." msgstr "" -#: ../../c-api/arg.rst:632 +#: ../../c-api/arg.rst:637 msgid "" "Convert *anything* to a Python object through a *converter* function. The " "function is called with *anything* (which should be compatible with :c:expr:" @@ -1090,40 +1092,40 @@ msgid "" "``NULL`` if an error occurred." msgstr "" -#: ../../c-api/arg.rst:638 +#: ../../c-api/arg.rst:643 msgid "" "Convert a sequence of C values to a Python tuple with the same number of " "items." msgstr "" -#: ../../c-api/arg.rst:641 +#: ../../c-api/arg.rst:646 msgid "``[items]`` (:class:`list`) [*matching-items*]" msgstr "``[items]`` (:class:`list`) [*matching-items*]" -#: ../../c-api/arg.rst:641 +#: ../../c-api/arg.rst:646 msgid "" "Convert a sequence of C values to a Python list with the same number of " "items." msgstr "" -#: ../../c-api/arg.rst:646 +#: ../../c-api/arg.rst:651 msgid "``{items}`` (:class:`dict`) [*matching-items*]" msgstr "``{items}`` (:class:`dict`) [*matching-items*]" -#: ../../c-api/arg.rst:644 +#: ../../c-api/arg.rst:649 msgid "" "Convert a sequence of C values to a Python dictionary. Each pair of " "consecutive C values adds one item to the dictionary, serving as key and " "value, respectively." msgstr "" -#: ../../c-api/arg.rst:648 +#: ../../c-api/arg.rst:653 msgid "" "If there is an error in the format string, the :exc:`SystemError` exception " "is set and ``NULL`` returned." msgstr "" -#: ../../c-api/arg.rst:653 +#: ../../c-api/arg.rst:658 msgid "" "Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list " "rather than a variable number of arguments." diff --git a/c-api/buffer.po b/c-api/buffer.po index 6ce805e8d0..a154f8edbe 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.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-08-17 00:04+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -150,19 +150,19 @@ msgstr "" #: ../../c-api/buffer.rst:104 msgid "" "A new reference to the exporting object. The reference is owned by the " -"consumer and automatically decremented and set to ``NULL`` by :c:func:" -"`PyBuffer_Release`. The field is the equivalent of the return value of any " -"standard C-API function." +"consumer and automatically released (i.e. reference count decremented) and " +"set to ``NULL`` by :c:func:`PyBuffer_Release`. The field is the equivalent " +"of the return value of any standard C-API function." msgstr "" -#: ../../c-api/buffer.rst:109 +#: ../../c-api/buffer.rst:111 msgid "" "As a special case, for *temporary* buffers that are wrapped by :c:func:" "`PyMemoryView_FromBuffer` or :c:func:`PyBuffer_FillInfo` this field is " "``NULL``. In general, exporting objects MUST NOT use this scheme." msgstr "" -#: ../../c-api/buffer.rst:116 +#: ../../c-api/buffer.rst:118 msgid "" "``product(shape) * itemsize``. For contiguous arrays, this is the length of " "the underlying memory block. For non-contiguous arrays, it is the length " @@ -170,7 +170,7 @@ msgid "" "representation." msgstr "" -#: ../../c-api/buffer.rst:121 +#: ../../c-api/buffer.rst:123 msgid "" "Accessing ``((char *)buf)[0] up to ((char *)buf)[len-1]`` is only valid if " "the buffer has been obtained by a request that guarantees contiguity. In " @@ -178,19 +178,19 @@ msgid "" "`PyBUF_WRITABLE`." msgstr "" -#: ../../c-api/buffer.rst:127 +#: ../../c-api/buffer.rst:129 msgid "" "An indicator of whether the buffer is read-only. This field is controlled by " "the :c:macro:`PyBUF_WRITABLE` flag." msgstr "" -#: ../../c-api/buffer.rst:132 +#: ../../c-api/buffer.rst:134 msgid "" "Item size in bytes of a single element. Same as the value of :func:`struct." "calcsize` called on non-``NULL`` :c:member:`~Py_buffer.format` values." msgstr "" -#: ../../c-api/buffer.rst:135 +#: ../../c-api/buffer.rst:137 msgid "" "Important exception: If a consumer requests a buffer without the :c:macro:" "`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will be set to " @@ -198,47 +198,41 @@ msgid "" "original format." msgstr "" -#: ../../c-api/buffer.rst:140 +#: ../../c-api/buffer.rst:142 msgid "" "If :c:member:`~Py_buffer.shape` is present, the equality ``product(shape) * " "itemsize == len`` still holds and the consumer can use :c:member:`~Py_buffer." "itemsize` to navigate the buffer." msgstr "" -#: ../../c-api/buffer.rst:144 +#: ../../c-api/buffer.rst:146 msgid "" "If :c:member:`~Py_buffer.shape` is ``NULL`` as a result of a :c:macro:" "`PyBUF_SIMPLE` or a :c:macro:`PyBUF_WRITABLE` request, the consumer must " "disregard :c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``." msgstr "" -#: ../../c-api/buffer.rst:150 +#: ../../c-api/buffer.rst:152 msgid "" "A *NUL* terminated string in :mod:`struct` module style syntax describing " "the contents of a single item. If this is ``NULL``, ``\"B\"`` (unsigned " "bytes) is assumed." msgstr "" -#: ../../c-api/buffer.rst:154 +#: ../../c-api/buffer.rst:156 msgid "This field is controlled by the :c:macro:`PyBUF_FORMAT` flag." msgstr "" -#: ../../c-api/buffer.rst:158 +#: ../../c-api/buffer.rst:160 msgid "" "The number of dimensions the memory represents as an n-dimensional array. If " "it is ``0``, :c:member:`~Py_buffer.buf` points to a single item representing " "a scalar. In this case, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer." -"strides` and :c:member:`~Py_buffer.suboffsets` MUST be ``NULL``." +"strides` and :c:member:`~Py_buffer.suboffsets` MUST be ``NULL``. The maximum " +"number of dimensions is given by :c:macro:`PyBUF_MAX_NDIM`." msgstr "" -#: ../../c-api/buffer.rst:163 -msgid "" -"The macro :c:macro:`PyBUF_MAX_NDIM` limits the maximum number of dimensions " -"to 64. Exporters MUST respect this limit, consumers of multi-dimensional " -"buffers SHOULD be able to handle up to :c:macro:`PyBUF_MAX_NDIM` dimensions." -msgstr "" - -#: ../../c-api/buffer.rst:169 +#: ../../c-api/buffer.rst:168 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` " "indicating the shape of the memory as an n-dimensional array. Note that " @@ -246,34 +240,34 @@ msgid "" "`~Py_buffer.len`." msgstr "" -#: ../../c-api/buffer.rst:174 +#: ../../c-api/buffer.rst:173 msgid "" "Shape values are restricted to ``shape[n] >= 0``. The case ``shape[n] == 0`` " "requires special attention. See `complex arrays`_ for further information." msgstr "" -#: ../../c-api/buffer.rst:178 +#: ../../c-api/buffer.rst:177 msgid "The shape array is read-only for the consumer." msgstr "" -#: ../../c-api/buffer.rst:182 +#: ../../c-api/buffer.rst:181 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` " "giving the number of bytes to skip to get to a new element in each dimension." msgstr "" -#: ../../c-api/buffer.rst:186 +#: ../../c-api/buffer.rst:185 msgid "" "Stride values can be any integer. For regular arrays, strides are usually " "positive, but a consumer MUST be able to handle the case ``strides[n] <= " "0``. See `complex arrays`_ for further information." msgstr "" -#: ../../c-api/buffer.rst:190 +#: ../../c-api/buffer.rst:189 msgid "The strides array is read-only for the consumer." msgstr "" -#: ../../c-api/buffer.rst:194 +#: ../../c-api/buffer.rst:193 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`. If " "``suboffsets[n] >= 0``, the values stored along the nth dimension are " @@ -282,24 +276,24 @@ msgid "" "that no de-referencing should occur (striding in a contiguous memory block)." msgstr "" -#: ../../c-api/buffer.rst:201 +#: ../../c-api/buffer.rst:200 msgid "" "If all suboffsets are negative (i.e. no de-referencing is needed), then this " "field must be ``NULL`` (the default value)." msgstr "" -#: ../../c-api/buffer.rst:204 +#: ../../c-api/buffer.rst:203 msgid "" "This type of array representation is used by the Python Imaging Library " "(PIL). See `complex arrays`_ for further information how to access elements " "of such an array." msgstr "" -#: ../../c-api/buffer.rst:208 +#: ../../c-api/buffer.rst:207 msgid "The suboffsets array is read-only for the consumer." msgstr "" -#: ../../c-api/buffer.rst:212 +#: ../../c-api/buffer.rst:211 msgid "" "This is for use internally by the exporting object. For example, this might " "be re-cast as an integer by the exporter and used to store flags about " @@ -307,11 +301,22 @@ msgid "" "the buffer is released. The consumer MUST NOT alter this value." msgstr "" -#: ../../c-api/buffer.rst:221 +#: ../../c-api/buffer.rst:218 +msgid "Constants:" +msgstr "" + +#: ../../c-api/buffer.rst:222 +msgid "" +"The maximum number of dimensions the memory represents. Exporters MUST " +"respect this limit, consumers of multi-dimensional buffers SHOULD be able to " +"handle up to :c:macro:`!PyBUF_MAX_NDIM` dimensions. Currently set to 64." +msgstr "" + +#: ../../c-api/buffer.rst:231 msgid "Buffer request types" msgstr "" -#: ../../c-api/buffer.rst:223 +#: ../../c-api/buffer.rst:233 msgid "" "Buffers are usually obtained by sending a buffer request to an exporting " "object via :c:func:`PyObject_GetBuffer`. Since the complexity of the logical " @@ -319,16 +324,16 @@ msgid "" "argument to specify the exact buffer type it can handle." msgstr "" -#: ../../c-api/buffer.rst:228 +#: ../../c-api/buffer.rst:238 msgid "" "All :c:type:`Py_buffer` fields are unambiguously defined by the request type." msgstr "" -#: ../../c-api/buffer.rst:232 +#: ../../c-api/buffer.rst:242 msgid "request-independent fields" msgstr "" -#: ../../c-api/buffer.rst:233 +#: ../../c-api/buffer.rst:243 msgid "" "The following fields are not influenced by *flags* and must always be filled " "in with the correct values: :c:member:`~Py_buffer.obj`, :c:member:" @@ -336,11 +341,11 @@ msgid "" "itemsize`, :c:member:`~Py_buffer.ndim`." msgstr "" -#: ../../c-api/buffer.rst:239 +#: ../../c-api/buffer.rst:249 msgid "readonly, format" msgstr "" -#: ../../c-api/buffer.rst:243 +#: ../../c-api/buffer.rst:253 msgid "" "Controls the :c:member:`~Py_buffer.readonly` field. If set, the exporter " "MUST provide a writable buffer or else report failure. Otherwise, the " @@ -348,13 +353,13 @@ msgid "" "MUST be consistent for all consumers." msgstr "" -#: ../../c-api/buffer.rst:250 +#: ../../c-api/buffer.rst:260 msgid "" "Controls the :c:member:`~Py_buffer.format` field. If set, this field MUST be " "filled in correctly. Otherwise, this field MUST be ``NULL``." msgstr "" -#: ../../c-api/buffer.rst:254 +#: ../../c-api/buffer.rst:264 msgid "" ":c:macro:`PyBUF_WRITABLE` can be \\|'d to any of the flags in the next " "section. Since :c:macro:`PyBUF_SIMPLE` is defined as 0, :c:macro:" @@ -362,158 +367,158 @@ msgid "" "writable buffer." msgstr "" -#: ../../c-api/buffer.rst:258 +#: ../../c-api/buffer.rst:268 msgid "" ":c:macro:`PyBUF_FORMAT` can be \\|'d to any of the flags except :c:macro:" "`PyBUF_SIMPLE`. The latter already implies format ``B`` (unsigned bytes)." msgstr "" -#: ../../c-api/buffer.rst:263 +#: ../../c-api/buffer.rst:273 msgid "shape, strides, suboffsets" msgstr "" -#: ../../c-api/buffer.rst:265 +#: ../../c-api/buffer.rst:275 msgid "" "The flags that control the logical structure of the memory are listed in " "decreasing order of complexity. Note that each flag contains all bits of the " "flags below it." msgstr "" -#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 +#: ../../c-api/buffer.rst:331 msgid "Request" msgstr "" -#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 +#: ../../c-api/buffer.rst:331 msgid "shape" msgstr "" -#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 +#: ../../c-api/buffer.rst:331 msgid "strides" msgstr "" -#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:282 ../../c-api/buffer.rst:306 +#: ../../c-api/buffer.rst:331 msgid "suboffsets" msgstr "" -#: ../../c-api/buffer.rst:274 ../../c-api/buffer.rst:276 -#: ../../c-api/buffer.rst:278 ../../c-api/buffer.rst:298 -#: ../../c-api/buffer.rst:300 ../../c-api/buffer.rst:302 -#: ../../c-api/buffer.rst:304 ../../c-api/buffer.rst:323 -#: ../../c-api/buffer.rst:325 ../../c-api/buffer.rst:327 -#: ../../c-api/buffer.rst:329 ../../c-api/buffer.rst:331 -#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:335 -#: ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:284 ../../c-api/buffer.rst:286 +#: ../../c-api/buffer.rst:288 ../../c-api/buffer.rst:308 +#: ../../c-api/buffer.rst:310 ../../c-api/buffer.rst:312 +#: ../../c-api/buffer.rst:314 ../../c-api/buffer.rst:333 +#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:339 ../../c-api/buffer.rst:341 +#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:345 +#: ../../c-api/buffer.rst:347 msgid "yes" msgstr "" -#: ../../c-api/buffer.rst:274 ../../c-api/buffer.rst:323 -#: ../../c-api/buffer.rst:325 +#: ../../c-api/buffer.rst:284 ../../c-api/buffer.rst:333 +#: ../../c-api/buffer.rst:335 msgid "if needed" msgstr "" -#: ../../c-api/buffer.rst:276 ../../c-api/buffer.rst:278 -#: ../../c-api/buffer.rst:280 ../../c-api/buffer.rst:298 -#: ../../c-api/buffer.rst:300 ../../c-api/buffer.rst:302 -#: ../../c-api/buffer.rst:304 ../../c-api/buffer.rst:327 -#: ../../c-api/buffer.rst:329 ../../c-api/buffer.rst:331 -#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:335 -#: ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:286 ../../c-api/buffer.rst:288 +#: ../../c-api/buffer.rst:290 ../../c-api/buffer.rst:308 +#: ../../c-api/buffer.rst:310 ../../c-api/buffer.rst:312 +#: ../../c-api/buffer.rst:314 ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:339 ../../c-api/buffer.rst:341 +#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:345 +#: ../../c-api/buffer.rst:347 msgid "NULL" msgstr "NULL" -#: ../../c-api/buffer.rst:287 +#: ../../c-api/buffer.rst:297 msgid "contiguity requests" msgstr "" -#: ../../c-api/buffer.rst:289 +#: ../../c-api/buffer.rst:299 msgid "" "C or Fortran :term:`contiguity ` can be explicitly requested, " "with and without stride information. Without stride information, the buffer " "must be C-contiguous." msgstr "" -#: ../../c-api/buffer.rst:296 ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:306 ../../c-api/buffer.rst:331 msgid "contig" msgstr "" -#: ../../c-api/buffer.rst:298 ../../c-api/buffer.rst:304 -#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:308 ../../c-api/buffer.rst:314 +#: ../../c-api/buffer.rst:345 ../../c-api/buffer.rst:347 msgid "C" msgstr "C" -#: ../../c-api/buffer.rst:300 +#: ../../c-api/buffer.rst:310 msgid "F" msgstr "F" -#: ../../c-api/buffer.rst:302 +#: ../../c-api/buffer.rst:312 msgid "C or F" msgstr "C 或 F" -#: ../../c-api/buffer.rst:304 +#: ../../c-api/buffer.rst:314 msgid ":c:macro:`PyBUF_ND`" msgstr ":c:macro:`PyBUF_ND`" -#: ../../c-api/buffer.rst:309 +#: ../../c-api/buffer.rst:319 msgid "compound requests" msgstr "" -#: ../../c-api/buffer.rst:311 +#: ../../c-api/buffer.rst:321 msgid "" "All possible requests are fully defined by some combination of the flags in " "the previous section. For convenience, the buffer protocol provides " "frequently used combinations as single flags." msgstr "" -#: ../../c-api/buffer.rst:315 +#: ../../c-api/buffer.rst:325 msgid "" "In the following table *U* stands for undefined contiguity. The consumer " "would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity." msgstr "" -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:331 msgid "readonly" msgstr "" -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:331 msgid "format" msgstr "" -#: ../../c-api/buffer.rst:323 ../../c-api/buffer.rst:325 -#: ../../c-api/buffer.rst:327 ../../c-api/buffer.rst:329 -#: ../../c-api/buffer.rst:331 ../../c-api/buffer.rst:333 +#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:335 +#: ../../c-api/buffer.rst:337 ../../c-api/buffer.rst:339 +#: ../../c-api/buffer.rst:341 ../../c-api/buffer.rst:343 msgid "U" msgstr "U" -#: ../../c-api/buffer.rst:323 ../../c-api/buffer.rst:327 -#: ../../c-api/buffer.rst:331 ../../c-api/buffer.rst:335 +#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:341 ../../c-api/buffer.rst:345 msgid "0" msgstr "0" -#: ../../c-api/buffer.rst:325 ../../c-api/buffer.rst:329 -#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:337 +#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:339 +#: ../../c-api/buffer.rst:343 ../../c-api/buffer.rst:347 msgid "1 or 0" msgstr "1 或 0" -#: ../../c-api/buffer.rst:342 +#: ../../c-api/buffer.rst:352 msgid "Complex arrays" msgstr "" -#: ../../c-api/buffer.rst:345 +#: ../../c-api/buffer.rst:355 msgid "NumPy-style: shape and strides" msgstr "" -#: ../../c-api/buffer.rst:347 +#: ../../c-api/buffer.rst:357 msgid "" "The logical structure of NumPy-style arrays is defined by :c:member:" "`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer." "shape` and :c:member:`~Py_buffer.strides`." msgstr "" -#: ../../c-api/buffer.rst:350 +#: ../../c-api/buffer.rst:360 msgid "" "If ``ndim == 0``, the memory location pointed to by :c:member:`~Py_buffer." "buf` is interpreted as a scalar of size :c:member:`~Py_buffer.itemsize`. In " @@ -521,25 +526,25 @@ msgid "" "strides` are ``NULL``." msgstr "" -#: ../../c-api/buffer.rst:354 +#: ../../c-api/buffer.rst:364 msgid "" "If :c:member:`~Py_buffer.strides` is ``NULL``, the array is interpreted as a " "standard n-dimensional C-array. Otherwise, the consumer must access an n-" "dimensional array as follows:" msgstr "" -#: ../../c-api/buffer.rst:364 +#: ../../c-api/buffer.rst:374 msgid "" "As noted above, :c:member:`~Py_buffer.buf` can point to any location within " "the actual memory block. An exporter can check the validity of a buffer with " "this function:" msgstr "" -#: ../../c-api/buffer.rst:398 +#: ../../c-api/buffer.rst:408 msgid "PIL-style: shape, strides and suboffsets" msgstr "" -#: ../../c-api/buffer.rst:400 +#: ../../c-api/buffer.rst:410 msgid "" "In addition to the regular items, PIL-style arrays can contain pointers that " "must be followed in order to get to the next element in a dimension. For " @@ -550,32 +555,32 @@ msgid "" "x[2][3]`` arrays that can be located anywhere in memory." msgstr "" -#: ../../c-api/buffer.rst:409 +#: ../../c-api/buffer.rst:419 msgid "" "Here is a function that returns a pointer to the element in an N-D array " "pointed to by an N-dimensional index when there are both non-``NULL`` " "strides and suboffsets::" msgstr "" -#: ../../c-api/buffer.rst:428 +#: ../../c-api/buffer.rst:438 msgid "Buffer-related functions" msgstr "" -#: ../../c-api/buffer.rst:432 +#: ../../c-api/buffer.rst:442 msgid "" "Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When " "``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` " "will succeed. This function always succeeds." msgstr "" -#: ../../c-api/buffer.rst:439 +#: ../../c-api/buffer.rst:449 msgid "" "Send a request to *exporter* to fill in *view* as specified by *flags*. If " -"the exporter cannot provide a buffer of the exact type, it MUST raise :c:" -"data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." +"the exporter cannot provide a buffer of the exact type, it MUST raise :exc:" +"`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/buffer.rst:444 +#: ../../c-api/buffer.rst:454 msgid "" "On success, fill in *view*, set ``view->obj`` to a new reference to " "*exporter* and return 0. In the case of chained buffer providers that " @@ -583,7 +588,7 @@ msgid "" "instead of *exporter* (See :ref:`Buffer Object Structures `)." msgstr "" -#: ../../c-api/buffer.rst:449 +#: ../../c-api/buffer.rst:459 msgid "" "Successful calls to :c:func:`PyObject_GetBuffer` must be paired with calls " "to :c:func:`PyBuffer_Release`, similar to :c:func:`malloc` and :c:func:" @@ -591,26 +596,27 @@ msgid "" "`PyBuffer_Release` must be called exactly once." msgstr "" -#: ../../c-api/buffer.rst:457 +#: ../../c-api/buffer.rst:467 msgid "" -"Release the buffer *view* and decrement the reference count for ``view-" +"Release the buffer *view* and release the :term:`strong reference` (i.e. " +"decrement the reference count) to the view's supporting object, ``view-" ">obj``. This function MUST be called when the buffer is no longer being " "used, otherwise reference leaks may occur." msgstr "" -#: ../../c-api/buffer.rst:461 +#: ../../c-api/buffer.rst:472 msgid "" "It is an error to call this function on a buffer that was not obtained via :" "c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../c-api/buffer.rst:467 +#: ../../c-api/buffer.rst:478 msgid "" "Return the implied :c:member:`~Py_buffer.itemsize` from :c:member:" "`~Py_buffer.format`. On error, raise an exception and return -1." msgstr "" -#: ../../c-api/buffer.rst:475 +#: ../../c-api/buffer.rst:486 msgid "" "Return ``1`` if the memory defined by the *view* is C-style (*order* is " "``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either " @@ -618,69 +624,69 @@ msgid "" "succeeds." msgstr "" -#: ../../c-api/buffer.rst:482 +#: ../../c-api/buffer.rst:493 msgid "" "Get the memory area pointed to by the *indices* inside the given *view*. " "*indices* must point to an array of ``view->ndim`` indices." msgstr "" -#: ../../c-api/buffer.rst:488 +#: ../../c-api/buffer.rst:499 msgid "" "Copy contiguous *len* bytes from *buf* to *view*. *fort* can be ``'C'`` or " "``'F'`` (for C-style or Fortran-style ordering). ``0`` is returned on " "success, ``-1`` on error." msgstr "" -#: ../../c-api/buffer.rst:495 +#: ../../c-api/buffer.rst:506 msgid "" "Copy *len* bytes from *src* to its contiguous representation in *buf*. " "*order* can be ``'C'`` or ``'F'`` or ``'A'`` (for C-style or Fortran-style " "ordering or either one). ``0`` is returned on success, ``-1`` on error." msgstr "" -#: ../../c-api/buffer.rst:499 +#: ../../c-api/buffer.rst:510 msgid "This function fails if *len* != *src->len*." msgstr "" -#: ../../c-api/buffer.rst:504 +#: ../../c-api/buffer.rst:515 msgid "" "Copy data from *src* to *dest* buffer. Can convert between C-style and or " "Fortran-style buffers." msgstr "" -#: ../../c-api/buffer.rst:507 +#: ../../c-api/buffer.rst:518 msgid "``0`` is returned on success, ``-1`` on error." msgstr "" -#: ../../c-api/buffer.rst:511 +#: ../../c-api/buffer.rst:522 msgid "" "Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style " "if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the " "given shape with the given number of bytes per element." msgstr "" -#: ../../c-api/buffer.rst:518 +#: ../../c-api/buffer.rst:529 msgid "" "Handle buffer requests for an exporter that wants to expose *buf* of size " "*len* with writability set according to *readonly*. *buf* is interpreted as " "a sequence of unsigned bytes." msgstr "" -#: ../../c-api/buffer.rst:522 +#: ../../c-api/buffer.rst:533 msgid "" "The *flags* argument indicates the request type. This function always fills " "in *view* as specified by flags, unless *buf* has been designated as read-" "only and :c:macro:`PyBUF_WRITABLE` is set in *flags*." msgstr "" -#: ../../c-api/buffer.rst:526 +#: ../../c-api/buffer.rst:537 msgid "" "On success, set ``view->obj`` to a new reference to *exporter* and return 0. " -"Otherwise, raise :c:data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` " -"and return ``-1``;" +"Otherwise, raise :exc:`BufferError`, set ``view->obj`` to ``NULL`` and " +"return ``-1``;" msgstr "" -#: ../../c-api/buffer.rst:530 +#: ../../c-api/buffer.rst:541 msgid "" "If this function is used as part of a :ref:`getbufferproc `, " "*exporter* MUST be set to the exporting object and *flags* must be passed " @@ -707,14 +713,14 @@ msgstr "buffer object(緩衝物件)" msgid "PyBufferProcs" msgstr "PyBufferProcs" -#: ../../c-api/buffer.rst:284 +#: ../../c-api/buffer.rst:294 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../c-api/buffer.rst:284 +#: ../../c-api/buffer.rst:294 msgid "C-contiguous" msgstr "C-contiguous(C 連續的)" -#: ../../c-api/buffer.rst:284 +#: ../../c-api/buffer.rst:294 msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" diff --git a/c-api/bytes.po b/c-api/bytes.po index ae0d5ed2b7..dc329a20bf 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.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-08-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -310,8 +310,8 @@ msgstr "" #: ../../c-api/bytes.rst:186 msgid "" "Create a new bytes object in *\\*bytes* containing the contents of *newpart* " -"appended to *bytes*. This version decrements the reference count of " -"*newpart*." +"appended to *bytes*. This version releases the :term:`strong reference` to " +"*newpart* (i.e. decrements its reference count)." msgstr "" #: ../../c-api/bytes.rst:193 diff --git a/c-api/code.po b/c-api/code.po index beed548be4..3ffca4a8c2 100644 --- a/c-api/code.po +++ b/c-api/code.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-07-30 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-" @@ -70,9 +70,9 @@ msgid "" "execution or VM crashes. Use this function only with extreme care." msgstr "" -#: ../../c-api/code.rst:48 ../../c-api/code.rst:68 -msgid "Added ``exceptiontable`` parameter." -msgstr "" +#: ../../c-api/code.rst:48 +msgid "Added ``qualname`` and ``exceptiontable`` parameters." +msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" #: ../../c-api/code.rst:55 msgid "" @@ -91,6 +91,10 @@ msgstr "" msgid "as ``PyCode_NewWithPosOnlyArgs``" msgstr "" +#: ../../c-api/code.rst:68 +msgid "Added ``qualname`` and ``exceptiontable`` parameters." +msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" + #: ../../c-api/code.rst:73 msgid "" "Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is " diff --git a/c-api/exceptions.po b/c-api/exceptions.po index c539882ea8..2950357cf0 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-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 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-" @@ -153,18 +153,18 @@ msgstr "" 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, " -"e.g. :c:data:`PyExc_RuntimeError`. You need not increment its reference " -"count. The second argument is an error message; it is decoded from " -"``'utf-8'``." +"e.g. :c:data:`PyExc_RuntimeError`. You need not create a new :term:`strong " +"reference` to it (e.g. with :c:func:`Py_INCREF`). The second argument is an " +"error message; it is decoded from ``'utf-8'``." msgstr "" -#: ../../c-api/exceptions.rst:119 +#: ../../c-api/exceptions.rst:120 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:125 +#: ../../c-api/exceptions.rst:126 msgid "" "This function sets the error indicator and returns ``NULL``. *exception* " "should be a Python exception class. The *format* and subsequent parameters " @@ -172,31 +172,31 @@ msgid "" "c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." msgstr "" -#: ../../c-api/exceptions.rst:134 +#: ../../c-api/exceptions.rst:135 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:142 +#: ../../c-api/exceptions.rst:143 msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``." msgstr "" -#: ../../c-api/exceptions.rst:147 +#: ../../c-api/exceptions.rst:148 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:154 +#: ../../c-api/exceptions.rst:155 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:163 +#: ../../c-api/exceptions.rst:164 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 +210,7 @@ msgid "" "``return PyErr_SetFromErrno(type);`` when the system call returns an error." msgstr "" -#: ../../c-api/exceptions.rst:177 +#: ../../c-api/exceptions.rst:178 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 +218,21 @@ msgid "" "is used to define the :attr:`!filename` attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:186 +#: ../../c-api/exceptions.rst:187 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:195 +#: ../../c-api/exceptions.rst:196 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:202 +#: ../../c-api/exceptions.rst:203 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,44 +245,44 @@ msgid "" "returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:211 ../../c-api/exceptions.rst:219 -#: ../../c-api/exceptions.rst:228 ../../c-api/exceptions.rst:236 -#: ../../c-api/exceptions.rst:244 ../../c-api/exceptions.rst:254 +#: ../../c-api/exceptions.rst:212 ../../c-api/exceptions.rst:220 +#: ../../c-api/exceptions.rst:229 ../../c-api/exceptions.rst:237 +#: ../../c-api/exceptions.rst:245 ../../c-api/exceptions.rst:255 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../c-api/exceptions.rst:216 +#: ../../c-api/exceptions.rst:217 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter " "specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:224 +#: ../../c-api/exceptions.rst:225 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the " "filename is given as a C string. *filename* is decoded from the filesystem " "encoding (:func:`os.fsdecode`)." msgstr "" -#: ../../c-api/exceptions.rst:233 +#: ../../c-api/exceptions.rst:234 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an " "additional parameter specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:241 +#: ../../c-api/exceptions.rst:242 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " "accepts a second filename object." msgstr "" -#: ../../c-api/exceptions.rst:251 +#: ../../c-api/exceptions.rst:252 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " "parameter specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:259 +#: ../../c-api/exceptions.rst:260 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 " @@ -290,13 +290,13 @@ msgid "" "``path`` attributes." msgstr "" -#: ../../c-api/exceptions.rst:269 +#: ../../c-api/exceptions.rst:270 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:277 +#: ../../c-api/exceptions.rst:278 msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " @@ -304,19 +304,19 @@ msgid "" "is a :exc:`SyntaxError`." msgstr "" -#: ../../c-api/exceptions.rst:287 +#: ../../c-api/exceptions.rst:288 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:295 +#: ../../c-api/exceptions.rst:296 msgid "" "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " "omitted." msgstr "" -#: ../../c-api/exceptions.rst:301 +#: ../../c-api/exceptions.rst:302 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " @@ -324,11 +324,11 @@ msgid "" "use." msgstr "" -#: ../../c-api/exceptions.rst:308 +#: ../../c-api/exceptions.rst:309 msgid "Issuing warnings" msgstr "" -#: ../../c-api/exceptions.rst:310 +#: ../../c-api/exceptions.rst:311 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -344,7 +344,7 @@ msgid "" "return an error value)." msgstr "" -#: ../../c-api/exceptions.rst:325 +#: ../../c-api/exceptions.rst:326 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. " @@ -354,7 +354,7 @@ msgid "" "`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" -#: ../../c-api/exceptions.rst:332 +#: ../../c-api/exceptions.rst:333 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 " @@ -363,14 +363,14 @@ msgid "" "enumerated at :ref:`standardwarningcategories`." msgstr "" -#: ../../c-api/exceptions.rst:338 +#: ../../c-api/exceptions.rst:339 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:345 +#: ../../c-api/exceptions.rst:346 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." @@ -378,31 +378,31 @@ msgid "" "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" -#: ../../c-api/exceptions.rst:356 +#: ../../c-api/exceptions.rst:357 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:363 +#: ../../c-api/exceptions.rst:364 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:372 +#: ../../c-api/exceptions.rst:373 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:379 +#: ../../c-api/exceptions.rst:380 msgid "Querying the error indicator" msgstr "" -#: ../../c-api/exceptions.rst:383 +#: ../../c-api/exceptions.rst:384 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*`` " @@ -411,11 +411,11 @@ msgid "" "`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:389 +#: ../../c-api/exceptions.rst:390 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/exceptions.rst:393 +#: ../../c-api/exceptions.rst:394 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -423,14 +423,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: ../../c-api/exceptions.rst:401 +#: ../../c-api/exceptions.rst:402 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:408 +#: ../../c-api/exceptions.rst:409 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 " @@ -438,43 +438,43 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:416 +#: ../../c-api/exceptions.rst:417 msgid "" "Return the exception currently being raised, clearing the error indicator at " "the same time." msgstr "" -#: ../../c-api/exceptions.rst:419 +#: ../../c-api/exceptions.rst:420 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:422 ../../c-api/exceptions.rst:466 +#: ../../c-api/exceptions.rst:423 ../../c-api/exceptions.rst:467 msgid "For example::" msgstr "" -#: ../../c-api/exceptions.rst:432 +#: ../../c-api/exceptions.rst:433 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " "handled." msgstr "" -#: ../../c-api/exceptions.rst:440 +#: ../../c-api/exceptions.rst:441 msgid "" "Set *exc* as the exception currently being raised, clearing the existing " "exception if one is set." msgstr "" -#: ../../c-api/exceptions.rst:445 +#: ../../c-api/exceptions.rst:446 msgid "This call steals a reference to *exc*, which must be a valid exception." msgstr "" -#: ../../c-api/exceptions.rst:454 +#: ../../c-api/exceptions.rst:455 msgid "Use :c:func:`PyErr_GetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:456 +#: ../../c-api/exceptions.rst:457 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -483,17 +483,17 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:463 +#: ../../c-api/exceptions.rst:464 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:482 +#: ../../c-api/exceptions.rst:483 msgid "Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:484 +#: ../../c-api/exceptions.rst:485 msgid "" "Set the error indicator from the three objects, *type*, *value*, and " "*traceback*, clearing the existing exception if one is set. If the objects " @@ -506,20 +506,20 @@ msgid "" "don't use this function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:498 +#: ../../c-api/exceptions.rst:499 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:507 +#: ../../c-api/exceptions.rst:508 msgid "" "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" "normalization." msgstr "" -#: ../../c-api/exceptions.rst:510 +#: ../../c-api/exceptions.rst:511 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -529,14 +529,14 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:518 +#: ../../c-api/exceptions.rst:519 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:529 +#: ../../c-api/exceptions.rst:530 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 " @@ -544,7 +544,7 @@ msgid "" "or ``NULL``. Does not modify the interpreter's exception state." msgstr "" -#: ../../c-api/exceptions.rst:536 +#: ../../c-api/exceptions.rst:537 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 " @@ -552,14 +552,14 @@ msgid "" "clear the exception state." msgstr "" -#: ../../c-api/exceptions.rst:545 +#: ../../c-api/exceptions.rst:546 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:552 +#: ../../c-api/exceptions.rst:553 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 " @@ -567,7 +567,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:561 +#: ../../c-api/exceptions.rst:562 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*, " @@ -577,7 +577,7 @@ msgid "" "using :c:func:`PyErr_GetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:570 +#: ../../c-api/exceptions.rst:571 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 " @@ -585,7 +585,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:580 +#: ../../c-api/exceptions.rst:581 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 " @@ -595,7 +595,7 @@ msgid "" "`PyErr_SetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:589 +#: ../../c-api/exceptions.rst:590 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 " @@ -603,22 +603,22 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:596 +#: ../../c-api/exceptions.rst:597 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:604 +#: ../../c-api/exceptions.rst:605 msgid "Signal Handling" msgstr "" -#: ../../c-api/exceptions.rst:614 +#: ../../c-api/exceptions.rst:615 msgid "This function interacts with Python's signal handling." msgstr "" -#: ../../c-api/exceptions.rst:616 +#: ../../c-api/exceptions.rst:617 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 " @@ -626,7 +626,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: ../../c-api/exceptions.rst:621 +#: ../../c-api/exceptions.rst:622 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 " @@ -635,44 +635,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: ../../c-api/exceptions.rst:627 +#: ../../c-api/exceptions.rst:628 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:630 +#: ../../c-api/exceptions.rst:631 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:634 +#: ../../c-api/exceptions.rst:635 msgid "" "The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:645 +#: ../../c-api/exceptions.rst:646 msgid "" "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: ../../c-api/exceptions.rst:649 ../../c-api/exceptions.rst:676 +#: ../../c-api/exceptions.rst:650 ../../c-api/exceptions.rst:677 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:659 +#: ../../c-api/exceptions.rst:660 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:663 +#: ../../c-api/exceptions.rst:664 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 " @@ -680,27 +680,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:668 +#: ../../c-api/exceptions.rst:669 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:671 +#: ../../c-api/exceptions.rst:672 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:684 +#: ../../c-api/exceptions.rst:685 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:688 +#: ../../c-api/exceptions.rst:689 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 " @@ -708,15 +708,15 @@ msgid "" "be called from the main thread." msgstr "" -#: ../../c-api/exceptions.rst:693 +#: ../../c-api/exceptions.rst:694 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../c-api/exceptions.rst:698 +#: ../../c-api/exceptions.rst:699 msgid "Exception Classes" msgstr "例外類別" -#: ../../c-api/exceptions.rst:702 +#: ../../c-api/exceptions.rst:703 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 " @@ -725,7 +725,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:708 +#: ../../c-api/exceptions.rst:709 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 " @@ -735,31 +735,31 @@ msgid "" "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:717 +#: ../../c-api/exceptions.rst:718 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:725 +#: ../../c-api/exceptions.rst:726 msgid "Exception Objects" msgstr "例外物件" -#: ../../c-api/exceptions.rst:729 +#: ../../c-api/exceptions.rst:730 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:736 +#: ../../c-api/exceptions.rst:737 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:742 +#: ../../c-api/exceptions.rst:743 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -767,41 +767,41 @@ msgid "" "this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:750 +#: ../../c-api/exceptions.rst:751 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:757 +#: ../../c-api/exceptions.rst:758 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:764 +#: ../../c-api/exceptions.rst:765 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:768 +#: ../../c-api/exceptions.rst:769 msgid "" ":attr:`__suppress_context__` is implicitly set to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:773 +#: ../../c-api/exceptions.rst:774 msgid "Return :attr:`~BaseException.args` of exception *ex*." msgstr "" -#: ../../c-api/exceptions.rst:778 +#: ../../c-api/exceptions.rst:779 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "" -#: ../../c-api/exceptions.rst:782 +#: ../../c-api/exceptions.rst:783 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 " @@ -813,72 +813,72 @@ msgid "" "if there is nothing to reraise." msgstr "" -#: ../../c-api/exceptions.rst:796 +#: ../../c-api/exceptions.rst:797 msgid "Unicode Exception Objects" msgstr "" -#: ../../c-api/exceptions.rst:798 +#: ../../c-api/exceptions.rst:799 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:802 +#: ../../c-api/exceptions.rst:803 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:809 +#: ../../c-api/exceptions.rst:810 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:815 +#: ../../c-api/exceptions.rst:816 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:821 +#: ../../c-api/exceptions.rst:822 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:829 +#: ../../c-api/exceptions.rst:830 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:836 +#: ../../c-api/exceptions.rst:837 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:844 +#: ../../c-api/exceptions.rst:845 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:851 +#: ../../c-api/exceptions.rst:852 msgid "Return the *reason* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:857 +#: ../../c-api/exceptions.rst:858 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:864 +#: ../../c-api/exceptions.rst:865 msgid "Recursion Control" msgstr "" -#: ../../c-api/exceptions.rst:866 +#: ../../c-api/exceptions.rst:867 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 " @@ -888,44 +888,44 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:875 +#: ../../c-api/exceptions.rst:876 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:877 +#: ../../c-api/exceptions.rst:878 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:881 +#: ../../c-api/exceptions.rst:882 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:885 +#: ../../c-api/exceptions.rst:886 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:889 ../../c-api/exceptions.rst:897 +#: ../../c-api/exceptions.rst:890 ../../c-api/exceptions.rst:898 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:894 +#: ../../c-api/exceptions.rst:895 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:900 +#: ../../c-api/exceptions.rst:901 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -934,13 +934,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:908 +#: ../../c-api/exceptions.rst:909 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:911 +#: ../../c-api/exceptions.rst:912 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -948,30 +948,30 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:917 +#: ../../c-api/exceptions.rst:918 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:921 +#: ../../c-api/exceptions.rst:922 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:926 +#: ../../c-api/exceptions.rst:927 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:933 +#: ../../c-api/exceptions.rst:934 msgid "Standard Exceptions" msgstr "" -#: ../../c-api/exceptions.rst:935 +#: ../../c-api/exceptions.rst:936 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" @@ -979,451 +979,451 @@ msgid "" "all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:996 ../../c-api/exceptions.rst:1129 -#: ../../c-api/exceptions.rst:1174 +#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1130 +#: ../../c-api/exceptions.rst:1175 msgid "C Name" msgstr "" -#: ../../c-api/exceptions.rst:996 ../../c-api/exceptions.rst:1174 +#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1175 msgid "Python Name" msgstr "" -#: ../../c-api/exceptions.rst:996 ../../c-api/exceptions.rst:1129 -#: ../../c-api/exceptions.rst:1174 +#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1130 +#: ../../c-api/exceptions.rst:1175 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:998 +#: ../../c-api/exceptions.rst:999 msgid ":c:data:`PyExc_BaseException`" msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:998 +#: ../../c-api/exceptions.rst:999 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:998 ../../c-api/exceptions.rst:1000 -#: ../../c-api/exceptions.rst:1002 ../../c-api/exceptions.rst:1048 -#: ../../c-api/exceptions.rst:1060 +#: ../../c-api/exceptions.rst:999 ../../c-api/exceptions.rst:1001 +#: ../../c-api/exceptions.rst:1003 ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1061 msgid "[1]_" msgstr "[1]_" -#: ../../c-api/exceptions.rst:1000 +#: ../../c-api/exceptions.rst:1001 msgid ":c:data:`PyExc_Exception`" msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:1000 +#: ../../c-api/exceptions.rst:1001 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1002 +#: ../../c-api/exceptions.rst:1003 msgid ":c:data:`PyExc_ArithmeticError`" msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:1002 +#: ../../c-api/exceptions.rst:1003 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1004 +#: ../../c-api/exceptions.rst:1005 msgid ":c:data:`PyExc_AssertionError`" msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:1004 +#: ../../c-api/exceptions.rst:1005 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1006 +#: ../../c-api/exceptions.rst:1007 msgid ":c:data:`PyExc_AttributeError`" msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:1006 +#: ../../c-api/exceptions.rst:1007 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1008 +#: ../../c-api/exceptions.rst:1009 msgid ":c:data:`PyExc_BlockingIOError`" msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:1008 +#: ../../c-api/exceptions.rst:1009 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1010 +#: ../../c-api/exceptions.rst:1011 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:1010 +#: ../../c-api/exceptions.rst:1011 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1012 +#: ../../c-api/exceptions.rst:1013 msgid ":c:data:`PyExc_BufferError`" msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:1012 +#: ../../c-api/exceptions.rst:1013 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1014 +#: ../../c-api/exceptions.rst:1015 msgid ":c:data:`PyExc_ChildProcessError`" msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:1014 +#: ../../c-api/exceptions.rst:1015 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1016 +#: ../../c-api/exceptions.rst:1017 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1016 +#: ../../c-api/exceptions.rst:1017 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1018 +#: ../../c-api/exceptions.rst:1019 msgid ":c:data:`PyExc_ConnectionError`" msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:1018 +#: ../../c-api/exceptions.rst:1019 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1020 +#: ../../c-api/exceptions.rst:1021 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1020 +#: ../../c-api/exceptions.rst:1021 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1022 +#: ../../c-api/exceptions.rst:1023 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:1022 +#: ../../c-api/exceptions.rst:1023 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1024 +#: ../../c-api/exceptions.rst:1025 msgid ":c:data:`PyExc_EOFError`" msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:1024 +#: ../../c-api/exceptions.rst:1025 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1026 +#: ../../c-api/exceptions.rst:1027 msgid ":c:data:`PyExc_FileExistsError`" msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:1026 +#: ../../c-api/exceptions.rst:1027 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1028 +#: ../../c-api/exceptions.rst:1029 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:1028 +#: ../../c-api/exceptions.rst:1029 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1030 +#: ../../c-api/exceptions.rst:1031 msgid ":c:data:`PyExc_FloatingPointError`" msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:1030 +#: ../../c-api/exceptions.rst:1031 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1032 +#: ../../c-api/exceptions.rst:1033 msgid ":c:data:`PyExc_GeneratorExit`" msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:1032 +#: ../../c-api/exceptions.rst:1033 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1034 +#: ../../c-api/exceptions.rst:1035 msgid ":c:data:`PyExc_ImportError`" msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:1034 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1036 +#: ../../c-api/exceptions.rst:1037 msgid ":c:data:`PyExc_IndentationError`" msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:1036 +#: ../../c-api/exceptions.rst:1037 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1038 +#: ../../c-api/exceptions.rst:1039 msgid ":c:data:`PyExc_IndexError`" msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:1038 +#: ../../c-api/exceptions.rst:1039 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1040 +#: ../../c-api/exceptions.rst:1041 msgid ":c:data:`PyExc_InterruptedError`" msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:1040 +#: ../../c-api/exceptions.rst:1041 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1042 +#: ../../c-api/exceptions.rst:1043 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:1042 +#: ../../c-api/exceptions.rst:1043 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1044 +#: ../../c-api/exceptions.rst:1045 msgid ":c:data:`PyExc_KeyError`" msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:1044 +#: ../../c-api/exceptions.rst:1045 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1046 +#: ../../c-api/exceptions.rst:1047 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1046 +#: ../../c-api/exceptions.rst:1047 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1048 +#: ../../c-api/exceptions.rst:1049 msgid ":c:data:`PyExc_LookupError`" msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:1048 +#: ../../c-api/exceptions.rst:1049 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1050 +#: ../../c-api/exceptions.rst:1051 msgid ":c:data:`PyExc_MemoryError`" msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:1050 +#: ../../c-api/exceptions.rst:1051 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1052 +#: ../../c-api/exceptions.rst:1053 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1052 +#: ../../c-api/exceptions.rst:1053 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1054 +#: ../../c-api/exceptions.rst:1055 msgid ":c:data:`PyExc_NameError`" msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:1054 +#: ../../c-api/exceptions.rst:1055 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1056 +#: ../../c-api/exceptions.rst:1057 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:1056 +#: ../../c-api/exceptions.rst:1057 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1058 +#: ../../c-api/exceptions.rst:1059 msgid ":c:data:`PyExc_NotImplementedError`" msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:1058 +#: ../../c-api/exceptions.rst:1059 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1060 +#: ../../c-api/exceptions.rst:1061 msgid ":c:data:`PyExc_OSError`" msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:1060 +#: ../../c-api/exceptions.rst:1061 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1062 +#: ../../c-api/exceptions.rst:1063 msgid ":c:data:`PyExc_OverflowError`" msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:1062 +#: ../../c-api/exceptions.rst:1063 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1064 +#: ../../c-api/exceptions.rst:1065 msgid ":c:data:`PyExc_PermissionError`" msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:1064 +#: ../../c-api/exceptions.rst:1065 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1066 +#: ../../c-api/exceptions.rst:1067 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:1066 +#: ../../c-api/exceptions.rst:1067 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1068 +#: ../../c-api/exceptions.rst:1069 msgid ":c:data:`PyExc_RecursionError`" msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:1068 +#: ../../c-api/exceptions.rst:1069 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1070 +#: ../../c-api/exceptions.rst:1071 msgid ":c:data:`PyExc_ReferenceError`" msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:1070 +#: ../../c-api/exceptions.rst:1071 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1072 +#: ../../c-api/exceptions.rst:1073 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:1072 +#: ../../c-api/exceptions.rst:1073 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1075 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1074 +#: ../../c-api/exceptions.rst:1075 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1076 +#: ../../c-api/exceptions.rst:1077 msgid ":c:data:`PyExc_StopIteration`" msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:1076 +#: ../../c-api/exceptions.rst:1077 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1078 +#: ../../c-api/exceptions.rst:1079 msgid ":c:data:`PyExc_SyntaxError`" msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:1078 +#: ../../c-api/exceptions.rst:1079 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1080 +#: ../../c-api/exceptions.rst:1081 msgid ":c:data:`PyExc_SystemError`" msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:1080 +#: ../../c-api/exceptions.rst:1081 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1082 +#: ../../c-api/exceptions.rst:1083 msgid ":c:data:`PyExc_SystemExit`" msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:1082 +#: ../../c-api/exceptions.rst:1083 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1084 +#: ../../c-api/exceptions.rst:1085 msgid ":c:data:`PyExc_TabError`" msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:1084 +#: ../../c-api/exceptions.rst:1085 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1086 +#: ../../c-api/exceptions.rst:1087 msgid ":c:data:`PyExc_TimeoutError`" msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:1086 +#: ../../c-api/exceptions.rst:1087 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1088 +#: ../../c-api/exceptions.rst:1089 msgid ":c:data:`PyExc_TypeError`" msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:1088 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1090 +#: ../../c-api/exceptions.rst:1091 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:1090 +#: ../../c-api/exceptions.rst:1091 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1092 +#: ../../c-api/exceptions.rst:1093 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1092 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1094 +#: ../../c-api/exceptions.rst:1095 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1094 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1096 +#: ../../c-api/exceptions.rst:1097 msgid ":c:data:`PyExc_UnicodeError`" msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:1096 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1098 +#: ../../c-api/exceptions.rst:1099 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1098 +#: ../../c-api/exceptions.rst:1099 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1100 +#: ../../c-api/exceptions.rst:1101 msgid ":c:data:`PyExc_ValueError`" msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:1100 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1102 +#: ../../c-api/exceptions.rst:1103 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1102 +#: ../../c-api/exceptions.rst:1103 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1106 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1443,58 +1443,58 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1115 +#: ../../c-api/exceptions.rst:1116 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr "" ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`\\ 。" -#: ../../c-api/exceptions.rst:1118 +#: ../../c-api/exceptions.rst:1119 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`\\ 。" -#: ../../c-api/exceptions.rst:1121 +#: ../../c-api/exceptions.rst:1122 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:1132 msgid ":c:data:`PyExc_EnvironmentError`" msgstr ":c:data:`PyExc_EnvironmentError`" -#: ../../c-api/exceptions.rst:1133 +#: ../../c-api/exceptions.rst:1134 msgid ":c:data:`PyExc_IOError`" msgstr ":c:data:`PyExc_IOError`" -#: ../../c-api/exceptions.rst:1135 +#: ../../c-api/exceptions.rst:1136 msgid ":c:data:`PyExc_WindowsError`" msgstr ":c:data:`PyExc_WindowsError`" -#: ../../c-api/exceptions.rst:1135 +#: ../../c-api/exceptions.rst:1136 msgid "[2]_" msgstr "[2]_" -#: ../../c-api/exceptions.rst:1138 +#: ../../c-api/exceptions.rst:1139 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1141 ../../c-api/exceptions.rst:1202 +#: ../../c-api/exceptions.rst:1142 ../../c-api/exceptions.rst:1203 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1144 +#: ../../c-api/exceptions.rst:1145 msgid "This is a base class for other standard exceptions." msgstr "" -#: ../../c-api/exceptions.rst:1147 +#: ../../c-api/exceptions.rst:1148 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:1153 +#: ../../c-api/exceptions.rst:1154 msgid "Standard Warning Categories" msgstr "" -#: ../../c-api/exceptions.rst:1155 +#: ../../c-api/exceptions.rst:1156 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " @@ -1502,393 +1502,393 @@ msgid "" "here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1176 +#: ../../c-api/exceptions.rst:1177 msgid ":c:data:`PyExc_Warning`" msgstr ":c:data:`PyExc_Warning`" -#: ../../c-api/exceptions.rst:1176 +#: ../../c-api/exceptions.rst:1177 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1176 +#: ../../c-api/exceptions.rst:1177 msgid "[3]_" msgstr "[3]_" -#: ../../c-api/exceptions.rst:1178 +#: ../../c-api/exceptions.rst:1179 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" -#: ../../c-api/exceptions.rst:1178 +#: ../../c-api/exceptions.rst:1179 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1180 +#: ../../c-api/exceptions.rst:1181 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr ":c:data:`PyExc_DeprecationWarning`" -#: ../../c-api/exceptions.rst:1180 +#: ../../c-api/exceptions.rst:1181 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1182 +#: ../../c-api/exceptions.rst:1183 msgid ":c:data:`PyExc_FutureWarning`" msgstr ":c:data:`PyExc_FutureWarning`" -#: ../../c-api/exceptions.rst:1182 +#: ../../c-api/exceptions.rst:1183 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1184 +#: ../../c-api/exceptions.rst:1185 msgid ":c:data:`PyExc_ImportWarning`" msgstr ":c:data:`PyExc_ImportWarning`" -#: ../../c-api/exceptions.rst:1184 +#: ../../c-api/exceptions.rst:1185 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1186 +#: ../../c-api/exceptions.rst:1187 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr ":c:data:`PyExc_PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1186 +#: ../../c-api/exceptions.rst:1187 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1188 +#: ../../c-api/exceptions.rst:1189 msgid ":c:data:`PyExc_ResourceWarning`" msgstr ":c:data:`PyExc_ResourceWarning`" -#: ../../c-api/exceptions.rst:1188 +#: ../../c-api/exceptions.rst:1189 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1190 +#: ../../c-api/exceptions.rst:1191 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr ":c:data:`PyExc_RuntimeWarning`" -#: ../../c-api/exceptions.rst:1190 +#: ../../c-api/exceptions.rst:1191 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1192 +#: ../../c-api/exceptions.rst:1193 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr ":c:data:`PyExc_SyntaxWarning`" -#: ../../c-api/exceptions.rst:1192 +#: ../../c-api/exceptions.rst:1193 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1194 +#: ../../c-api/exceptions.rst:1195 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr ":c:data:`PyExc_UnicodeWarning`" -#: ../../c-api/exceptions.rst:1194 +#: ../../c-api/exceptions.rst:1195 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1196 +#: ../../c-api/exceptions.rst:1197 msgid ":c:data:`PyExc_UserWarning`" msgstr ":c:data:`PyExc_UserWarning`" -#: ../../c-api/exceptions.rst:1196 +#: ../../c-api/exceptions.rst:1197 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:1200 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1205 +#: ../../c-api/exceptions.rst:1206 msgid "This is a base class for other standard warning categories." msgstr "" -#: ../../c-api/exceptions.rst:161 +#: ../../c-api/exceptions.rst:162 msgid "strerror()" msgstr "strerror()" -#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 -#: ../../c-api/exceptions.rst:655 +#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 +#: ../../c-api/exceptions.rst:656 msgid "module" msgstr "module(模組)" -#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 -#: ../../c-api/exceptions.rst:655 +#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 +#: ../../c-api/exceptions.rst:656 msgid "signal" msgstr "signal(訊號)" -#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 +#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 msgid "SIGINT" msgstr "SIGINT" -#: ../../c-api/exceptions.rst:609 ../../c-api/exceptions.rst:640 -#: ../../c-api/exceptions.rst:655 +#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 +#: ../../c-api/exceptions.rst:656 msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_BaseException" msgstr "PyExc_BaseException" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_Exception" msgstr "PyExc_Exception" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ArithmeticError" msgstr "PyExc_ArithmeticError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_AssertionError" msgstr "PyExc_AssertionError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_AttributeError" msgstr "PyExc_AttributeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_BlockingIOError" msgstr "PyExc_BlockingIOError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_BrokenPipeError" msgstr "PyExc_BrokenPipeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_BufferError" msgstr "PyExc_BufferError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ChildProcessError" msgstr "PyExc_ChildProcessError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ConnectionAbortedError" msgstr "PyExc_ConnectionAbortedError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ConnectionError" msgstr "PyExc_ConnectionError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ConnectionRefusedError" msgstr "PyExc_ConnectionRefusedError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ConnectionResetError" msgstr "PyExc_ConnectionResetError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_EOFError" msgstr "PyExc_EOFError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_FileExistsError" msgstr "PyExc_FileExistsError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_FileNotFoundError" msgstr "PyExc_FileNotFoundError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_FloatingPointError" msgstr "PyExc_FloatingPointError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_GeneratorExit" msgstr "PyExc_GeneratorExit" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ImportError" msgstr "PyExc_ImportError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_IndentationError" msgstr "PyExc_IndentationError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_IndexError" msgstr "PyExc_IndexError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_InterruptedError" msgstr "PyExc_InterruptedError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_IsADirectoryError" msgstr "PyExc_IsADirectoryError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_KeyError" msgstr "PyExc_KeyError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_KeyboardInterrupt" msgstr "PyExc_KeyboardInterrupt" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_LookupError" msgstr "PyExc_LookupError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_MemoryError" msgstr "PyExc_MemoryError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ModuleNotFoundError" msgstr "PyExc_ModuleNotFoundError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_NameError" msgstr "PyExc_NameError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_NotADirectoryError" msgstr "PyExc_NotADirectoryError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_NotImplementedError" msgstr "PyExc_NotImplementedError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_OSError" msgstr "PyExc_OSError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_OverflowError" msgstr "PyExc_OverflowError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_PermissionError" msgstr "PyExc_PermissionError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ProcessLookupError" msgstr "PyExc_ProcessLookupError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_RecursionError" msgstr "PyExc_RecursionError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ReferenceError" msgstr "PyExc_ReferenceError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_RuntimeError" msgstr "PyExc_RuntimeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_StopAsyncIteration" msgstr "PyExc_StopAsyncIteration" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_StopIteration" msgstr "PyExc_StopIteration" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_SyntaxError" msgstr "PyExc_SyntaxError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_SystemError" msgstr "PyExc_SystemError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_SystemExit" msgstr "PyExc_SystemExit" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_TabError" msgstr "PyExc_TabError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_TimeoutError" msgstr "PyExc_TimeoutError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_TypeError" msgstr "PyExc_TypeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_UnboundLocalError" msgstr "PyExc_UnboundLocalError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_UnicodeDecodeError" msgstr "PyExc_UnicodeDecodeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_UnicodeEncodeError" msgstr "PyExc_UnicodeEncodeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_UnicodeError" msgstr "PyExc_UnicodeError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_UnicodeTranslateError" msgstr "PyExc_UnicodeTranslateError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ValueError" msgstr "PyExc_ValueError" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:941 msgid "PyExc_ZeroDivisionError" msgstr "PyExc_ZeroDivisionError" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1124 msgid "PyExc_EnvironmentError" msgstr "PyExc_EnvironmentError" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1124 msgid "PyExc_IOError" msgstr "PyExc_IOError" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1124 msgid "PyExc_WindowsError" msgstr "PyExc_WindowsError" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_Warning" msgstr "PyExc_Warning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_BytesWarning" msgstr "PyExc_BytesWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_DeprecationWarning" msgstr "PyExc_DeprecationWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_FutureWarning" msgstr "PyExc_FutureWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_ImportWarning" msgstr "PyExc_ImportWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_PendingDeprecationWarning" msgstr "PyExc_PendingDeprecationWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_ResourceWarning" msgstr "PyExc_ResourceWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_RuntimeWarning" msgstr "PyExc_RuntimeWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_SyntaxWarning" msgstr "PyExc_SyntaxWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_UnicodeWarning" msgstr "PyExc_UnicodeWarning" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1161 msgid "PyExc_UserWarning" msgstr "PyExc_UserWarning" diff --git a/c-api/init.po b/c-api/init.po index ea7e11da21..0247553cf1 100644 --- a/c-api/init.po +++ b/c-api/init.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-08-01 00:03+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1770,40 +1770,41 @@ msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " "is currently active. Otherwise only multi-phase init extension modules (see :" -"pep:`489`) may be imported." +"pep:`489`) may be imported. (Also see :c:macro:" +"`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1559 +#: ../../c-api/init.rst:1560 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1564 +#: ../../c-api/init.rst:1565 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1571 +#: ../../c-api/init.rst:1572 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1575 +#: ../../c-api/init.rst:1576 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1579 +#: ../../c-api/init.rst:1580 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1581 +#: ../../c-api/init.rst:1582 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1595 +#: ../../c-api/init.rst:1596 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1816,13 +1817,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1606 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1608 +#: ../../c-api/init.rst:1609 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -1833,7 +1834,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1617 +#: ../../c-api/init.rst:1618 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -1845,13 +1846,13 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1628 +#: ../../c-api/init.rst:1629 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1642 +#: ../../c-api/init.rst:1643 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -1859,11 +1860,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1651 +#: ../../c-api/init.rst:1652 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1653 +#: ../../c-api/init.rst:1654 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -1871,7 +1872,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1659 +#: ../../c-api/init.rst:1660 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -1883,7 +1884,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1670 +#: ../../c-api/init.rst:1671 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -1893,7 +1894,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1690 +#: ../../c-api/init.rst:1691 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -1902,7 +1903,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1702 +#: ../../c-api/init.rst:1703 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -1912,17 +1913,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1710 +#: ../../c-api/init.rst:1711 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1715 +#: ../../c-api/init.rst:1716 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1717 +#: ../../c-api/init.rst:1718 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -1934,7 +1935,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:1728 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -1948,7 +1949,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1738 +#: ../../c-api/init.rst:1739 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -1956,7 +1957,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1743 +#: ../../c-api/init.rst:1744 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -1966,11 +1967,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1754 +#: ../../c-api/init.rst:1755 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1756 +#: ../../c-api/init.rst:1757 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -1983,7 +1984,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1766 +#: ../../c-api/init.rst:1767 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -1992,7 +1993,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1772 +#: ../../c-api/init.rst:1773 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2004,25 +2005,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1783 +#: ../../c-api/init.rst:1784 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1785 +#: ../../c-api/init.rst:1786 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1794 +#: ../../c-api/init.rst:1795 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1798 +#: ../../c-api/init.rst:1799 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2030,17 +2031,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1803 +#: ../../c-api/init.rst:1804 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1804 +#: ../../c-api/init.rst:1805 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1807 +#: ../../c-api/init.rst:1808 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2048,20 +2049,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1812 +#: ../../c-api/init.rst:1813 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1815 +#: ../../c-api/init.rst:1816 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1820 +#: ../../c-api/init.rst:1821 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2071,7 +2072,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1827 +#: ../../c-api/init.rst:1828 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2079,18 +2080,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1838 +#: ../../c-api/init.rst:1839 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1843 +#: ../../c-api/init.rst:1844 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1847 +#: ../../c-api/init.rst:1848 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2100,7 +2101,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1857 +#: ../../c-api/init.rst:1858 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " @@ -2112,66 +2113,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1866 +#: ../../c-api/init.rst:1867 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1866 +#: ../../c-api/init.rst:1867 msgid "Meaning of *arg*" msgstr "" -#: ../../c-api/init.rst:1868 +#: ../../c-api/init.rst:1869 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1868 ../../c-api/init.rst:1873 -#: ../../c-api/init.rst:1884 +#: ../../c-api/init.rst:1869 ../../c-api/init.rst:1874 +#: ../../c-api/init.rst:1885 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1870 +#: ../../c-api/init.rst:1871 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1870 +#: ../../c-api/init.rst:1871 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1873 +#: ../../c-api/init.rst:1874 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1875 +#: ../../c-api/init.rst:1876 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1875 +#: ../../c-api/init.rst:1876 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1878 +#: ../../c-api/init.rst:1879 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1878 ../../c-api/init.rst:1880 -#: ../../c-api/init.rst:1882 +#: ../../c-api/init.rst:1879 ../../c-api/init.rst:1881 +#: ../../c-api/init.rst:1883 msgid "Function object being called." msgstr "" -#: ../../c-api/init.rst:1880 +#: ../../c-api/init.rst:1881 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1882 +#: ../../c-api/init.rst:1883 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1884 +#: ../../c-api/init.rst:1885 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1889 +#: ../../c-api/init.rst:1890 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2180,7 +2181,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1898 +#: ../../c-api/init.rst:1899 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2192,7 +2193,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1909 +#: ../../c-api/init.rst:1910 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2200,31 +2201,31 @@ msgid "" "*0* on that frame." msgstr "" -#: ../../c-api/init.rst:1916 +#: ../../c-api/init.rst:1917 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1922 +#: ../../c-api/init.rst:1923 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1929 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1934 +#: ../../c-api/init.rst:1935 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1940 +#: ../../c-api/init.rst:1941 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2232,7 +2233,7 @@ msgid "" "attr:`f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1948 +#: ../../c-api/init.rst:1949 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2242,29 +2243,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:1955 +#: ../../c-api/init.rst:1956 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:1957 ../../c-api/init.rst:1964 -#: ../../c-api/init.rst:1983 ../../c-api/init.rst:1990 +#: ../../c-api/init.rst:1958 ../../c-api/init.rst:1965 +#: ../../c-api/init.rst:1984 ../../c-api/init.rst:1991 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:1961 +#: ../../c-api/init.rst:1962 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:1966 +#: ../../c-api/init.rst:1967 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:1974 +#: ../../c-api/init.rst:1975 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2275,65 +2276,65 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:1981 +#: ../../c-api/init.rst:1982 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:1987 +#: ../../c-api/init.rst:1988 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:1992 +#: ../../c-api/init.rst:1993 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2001 +#: ../../c-api/init.rst:2002 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2006 +#: ../../c-api/init.rst:2007 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2011 +#: ../../c-api/init.rst:2012 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2016 +#: ../../c-api/init.rst:2017 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2021 +#: ../../c-api/init.rst:2022 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2027 +#: ../../c-api/init.rst:2028 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2033 +#: ../../c-api/init.rst:2034 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2040 +#: ../../c-api/init.rst:2041 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2044 +#: ../../c-api/init.rst:2045 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2343,19 +2344,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2051 +#: ../../c-api/init.rst:2052 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2054 +#: ../../c-api/init.rst:2055 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2058 +#: ../../c-api/init.rst:2059 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2363,22 +2364,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2066 +#: ../../c-api/init.rst:2067 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2068 +#: ../../c-api/init.rst:2069 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2074 +#: ../../c-api/init.rst:2075 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2079 +#: ../../c-api/init.rst:2080 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2386,52 +2387,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2084 +#: ../../c-api/init.rst:2085 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2090 +#: ../../c-api/init.rst:2091 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2095 +#: ../../c-api/init.rst:2096 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2097 +#: ../../c-api/init.rst:2098 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2104 +#: ../../c-api/init.rst:2105 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2111 +#: ../../c-api/init.rst:2112 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2117 +#: ../../c-api/init.rst:2118 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2122 +#: ../../c-api/init.rst:2123 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2124 +#: ../../c-api/init.rst:2125 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2439,13 +2440,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2132 +#: ../../c-api/init.rst:2133 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2138 +#: ../../c-api/init.rst:2139 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2454,7 +2455,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2147 +#: ../../c-api/init.rst:2148 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2463,31 +2464,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2156 +#: ../../c-api/init.rst:2157 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2163 +#: ../../c-api/init.rst:2164 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2171 +#: ../../c-api/init.rst:2172 msgid "Thread Local Storage (TLS) API" msgstr "" -#: ../../c-api/init.rst:2173 +#: ../../c-api/init.rst:2174 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2178 +#: ../../c-api/init.rst:2179 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2496,7 +2497,7 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2183 +#: ../../c-api/init.rst:2184 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." @@ -2519,20 +2520,20 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 -#: ../../c-api/init.rst:1057 ../../c-api/init.rst:1587 -#: ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1057 ../../c-api/init.rst:1588 +#: ../../c-api/init.rst:1683 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "sys" msgstr "sys" @@ -2552,11 +2553,11 @@ msgstr "PySys_SetArgv()" msgid "PySys_SetArgvEx()" msgstr "PySys_SetArgvEx()" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1647 ../../c-api/init.rst:1700 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1648 ../../c-api/init.rst:1701 msgid "Py_FinalizeEx()" msgstr "Py_FinalizeEx()" -#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 ../../c-api/init.rst:1647 +#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 ../../c-api/init.rst:1648 msgid "Py_Initialize()" msgstr "Py_Initialize()" @@ -2656,22 +2657,22 @@ msgstr "PyEval_ReleaseThread()" msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1588 ../../c-api/init.rst:1683 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1677 +#: ../../c-api/init.rst:1678 msgid "close() (in module os)" msgstr "close()(sys 模組中)" -#: ../../c-api/init.rst:1792 +#: ../../c-api/init.rst:1793 msgid "Py_AddPendingCall()" msgstr "Py_AddPendingCall()" diff --git a/c-api/init_config.po b/c-api/init_config.po index 3515990b20..6958b33c49 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.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-08-09 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1422,7 +1422,7 @@ msgid "Value of the :option:`-m` command line option." msgstr "" #: ../../c-api/init_config.rst:1112 -msgid "Show total reference count at exit?" +msgid "Show total reference count at exit (excluding immortal objects)?" msgstr "" #: ../../c-api/init_config.rst:1114 diff --git a/c-api/intro.po b/c-api/intro.po index 3434e5e689..0808d31558 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -441,109 +441,116 @@ msgstr "參照計數" #: ../../c-api/intro.rst:290 msgid "" "The reference count is important because today's computers have a finite " -"(and often severely limited) memory size; it counts how many different " -"places there are that have a reference to an object. Such a place could be " -"another object, or a global (or static) C variable, or a local variable in " -"some C function. When an object's reference count becomes zero, the object " -"is deallocated. If it contains references to other objects, their " -"reference count is decremented. Those other objects may be deallocated in " -"turn, if this decrement makes their reference count become zero, and so on. " -"(There's an obvious problem with objects that reference each other here; " -"for now, the solution is \"don't do that.\")" +"(and often severely limited) memory size; it counts how many different " +"places there are that have a :term:`strong reference` to an object. Such a " +"place could be another object, or a global (or static) C variable, or a " +"local variable in some C function. When the last :term:`strong reference` to " +"an object is released (i.e. its reference count becomes zero), the object is " +"deallocated. If it contains references to other objects, those references " +"are released. Those other objects may be deallocated in turn, if there are " +"no more references to them, and so on. (There's an obvious problem with " +"objects that reference each other here; for now, the solution is \"don't do " +"that.\")" msgstr "" "參照計數很重要,因為現今的電腦記憶體大小是有限的(而且通常是非常有限的);它" -"計算有多少個不同的地方參照了一個物件。這樣的地方可以是另一個物件,或者全域" -"(或靜態)C 變數,或者某個 C 函式中的本地變數。當一個物件的參照計數變為零時," -"該物件將被釋放 (deallocated)。如果它包含對其他物件的參照,則它們的參照計數會" -"減少。如果這樣的減少使它們的參照計數變為零,則可以依次釋放那些其他物件,依此" -"類推。 (此處相互參照物件的存在是個明顯的問題;目前,解決方案是「就不要那樣" -"做」。)" - -#: ../../c-api/intro.rst:305 -msgid "" -"Reference counts are always manipulated explicitly. The normal way is to " -"use the macro :c:func:`Py_INCREF` to increment an object's reference count " -"by one, and :c:func:`Py_DECREF` to decrement it by one. The :c:func:" +"計算有多少個不同的地方用有了一個物件的\\ :term:`強參照 `。" +"這樣的地方可以是另一個物件,或者全域(或靜態)C 變數,或者某個 C 函式中的本地" +"變數。當一個物件的最後一個\\ :term:`強參照 `\\ 被釋放時(即" +"其的參照計數變為零),該物件將被解除配置 (deallocated)。如果它包含對其他物件" +"的參照,則它們的參照會被釋放。如果這樣的釋放使得再也沒有任何對於它們的參照," +"則可以依次為那些其他物件解除配置,依此類推。 (此處相互參照物件的存在是個明顯" +"的問題;目前,解決方案是「就不要那樣做」。)" + +#: ../../c-api/intro.rst:307 +msgid "" +"Reference counts are always manipulated explicitly. The normal way is to " +"use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. " +"increment its reference count by one), and :c:func:`Py_DECREF` to release " +"that reference (i.e. decrement the reference count by one). The :c:func:" "`Py_DECREF` macro is considerably more complex than the incref one, since it " "must check whether the reference count becomes zero and then cause the " -"object's deallocator to be called. The deallocator is a function pointer " +"object's deallocator to be called. The deallocator is a function pointer " "contained in the object's type structure. The type-specific deallocator " -"takes care of decrementing the reference counts for other objects contained " -"in the object if this is a compound object type, such as a list, as well as " -"performing any additional finalization that's needed. There's no chance " -"that the reference count can overflow; at least as many bits are used to " -"hold the reference count as there are distinct memory locations in virtual " -"memory (assuming ``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the " -"reference count increment is a simple operation." -msgstr "" -"參照計數總是被明確地操作。正常的方法是使用巨集 :c:func:`Py_INCREF` 將物件的參" -"照計數加一,並使用巨集 :c:func:`Py_DECREF` 來將其減一。:c:func:`Py_DECREF` 巨" -"集比 incref 巨集複雜得多,因為它必須檢查參照計數是否變為零,然後呼叫物件的釋" -"放器 (deallocator)。釋放器是包含在物件型別結構中的函式指標。特定型別的釋放" -"器,在如果是一個複合物件型別(例如 list)時負責減少物件中包含的其他物件的參照" -"計數,並執行任何需要的額外完結步驟。參照計數不可能溢出;至少與虛擬記憶體中用" -"來保存參照計數的不同記憶體位置數量一樣多的位元會被使用(假設 " -"``sizeof(Py_ssize_t) >= sizeof(void*)``)。因此參照計數增加是一個簡單的操作。" - -#: ../../c-api/intro.rst:319 -msgid "" -"It is not necessary to increment an object's reference count for every " -"local variable that contains a pointer to an object. In theory, the " -"object's reference count goes up by one when the variable is made to point " -"to it and it goes down by one when the variable goes out of scope. " -"However, these two cancel each other out, so at the end the reference count " -"hasn't changed. The only real reason to use the reference count is to " -"prevent the object from being deallocated as long as our variable is " -"pointing to it. If we know that there is at least one other reference to " -"the object that lives at least as long as our variable, there is no need to " -"increment the reference count temporarily. An important situation where " -"this arises is in objects that are passed as arguments to C functions in an " -"extension module that are called from Python; the call mechanism guarantees " -"to hold a reference to every argument for the duration of the call." -msgstr "" -"沒有必要為每個包含物件指標的本地變數增加物件的參照計數。理論上,當變數指向它" -"時,物件的參照計數會增加 1,而當變數離開作用域時就會減少 1。然而這兩者會相互" -"抵消,所以最後參照計數沒有改變。使用參照計數的唯一真正原因是防止物件還有變數" -"指向它時被釋放。如果我們知道至少有一個物件的其他參照生存了至少與我們的變數一" -"樣久,就不需要臨時增加參照計數。出現這種情況的一個重要情況是在從 Python 呼叫" -"的擴充模組中作為引數傳遞給 C 函式的物件;呼叫機制保證在呼叫期間保持對每個參數" -"的參照。" - -#: ../../c-api/intro.rst:333 +"takes care of releasing references for other objects contained in the object " +"if this is a compound object type, such as a list, as well as performing any " +"additional finalization that's needed. There's no chance that the reference " +"count can overflow; at least as many bits are used to hold the reference " +"count as there are distinct memory locations in virtual memory (assuming " +"``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the reference count " +"increment is a simple operation." +msgstr "" +"參照計數總是被明確地操作。正常的方法是使用巨集 :c:func:`Py_INCREF` 來取得對於" +"物件的參照(即參照計數加一),並使用巨集 :c:func:`Py_DECREF` 來釋放參照(即將" +"參照計數減一)。:c:func:`Py_DECREF` 巨集比 incref 巨集複雜得多,因為它必須檢" +"查參照計數是否變為零,然後呼叫物件的釋放器 (deallocator)。釋放器是包含在物件" +"型別結構中的函式指標。特定型別的釋放器,在如果是一個複合物件型別(例如 list)" +"時負責釋放物件中包含的其他物件的參照,並執行任何需要的額外完結步驟。參照計數" +"不可能溢出;至少與虛擬記憶體中用來保存參照計數的不同記憶體位置數量一樣多的位" +"元會被使用(假設 ``sizeof(Py_ssize_t) >= sizeof(void*)``)。因此參照計數增加" +"是一個簡單的操作。" + +#: ../../c-api/intro.rst:323 +msgid "" +"It is not necessary to hold a :term:`strong reference` (i.e. increment the " +"reference count) for every local variable that contains a pointer to an " +"object. In theory, the object's reference count goes up by one when the " +"variable is made to point to it and it goes down by one when the variable " +"goes out of scope. However, these two cancel each other out, so at the end " +"the reference count hasn't changed. The only real reason to use the " +"reference count is to prevent the object from being deallocated as long as " +"our variable is pointing to it. If we know that there is at least one " +"other reference to the object that lives at least as long as our variable, " +"there is no need to take a new :term:`strong reference` (i.e. increment the " +"reference count) temporarily. An important situation where this arises is in " +"objects that are passed as arguments to C functions in an extension module " +"that are called from Python; the call mechanism guarantees to hold a " +"reference to every argument for the duration of the call." +msgstr "" +"沒有必要為每個包含物件指標的本地變數物件都持有一個\\ :term:`強參照 `\\ (即增加參照計數)。理論上,當變數指向它時,物件的參照計數會增" +"加 1,而當變數離開作用域時就會減少 1。然而這兩者會相互抵消,所以最後參照計數" +"沒有改變。使用參照計數的唯一真正原因是防止物件還有變數指向它時被解除配置。如" +"果我們知道至少有一個物件的其他參照生存了至少與我們的變數一樣久,就不需要臨時" +"增加建立新的\\ :term:`強參照 `\\ (即增加參照計數)。出現這" +"種情況的一個重要情況是在從 Python 呼叫的擴充模組中作為引數傳遞給 C 函式的物" +"件;呼叫機制保證在呼叫期間保持對每個參數的參照。" + +#: ../../c-api/intro.rst:339 msgid "" "However, a common pitfall is to extract an object from a list and hold on to " -"it for a while without incrementing its reference count. Some other " -"operation might conceivably remove the object from the list, decrementing " -"its reference count and possibly deallocating it. The real danger is that " -"innocent-looking operations may invoke arbitrary Python code which could do " -"this; there is a code path which allows control to flow back to the user " -"from a :c:func:`Py_DECREF`, so almost any operation is potentially dangerous." +"it for a while without taking a new reference. Some other operation might " +"conceivably remove the object from the list, releasing that reference, and " +"possibly deallocating it. The real danger is that innocent-looking " +"operations may invoke arbitrary Python code which could do this; there is a " +"code path which allows control to flow back to the user from a :c:func:" +"`Py_DECREF`, so almost any operation is potentially dangerous." msgstr "" -"然而,一個常見的陷阱是從一個 list 中提取一個物件並保留它一段時間而不增加其參" -"照計數。某些其他操作可能會從列表中刪除該物件,減少其參照計數並可能取消分配" -"它。真正的危險是看似無害的操作可能會呼叫可以執行此操作的任意 Python 程式碼;" -"有一個程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作" -"都有潛在危險。" +"然而,一個常見的陷阱是從一個 list 中提取一個物件並保留它一段時間而不取得其參" +"照。某些其他操作可能會從列表中刪除該物件,減少其參照計數並可能取消分配它。真" +"正的危險是看似無害的操作可能會呼叫可以執行此操作的任意 Python 程式碼;有一個" +"程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作都有潛" +"在危險。" -#: ../../c-api/intro.rst:341 +#: ../../c-api/intro.rst:347 msgid "" "A safe approach is to always use the generic operations (functions whose " "name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " -"``PyMapping_``). These operations always increment the reference count of " -"the object they return. This leaves the caller with the responsibility to " -"call :c:func:`Py_DECREF` when they are done with the result; this soon " -"becomes second nature." +"``PyMapping_``). These operations always create a new :term:`strong " +"reference` (i.e. increment the reference count) of the object they return. " +"This leaves the caller with the responsibility to call :c:func:`Py_DECREF` " +"when they are done with the result; this soon becomes second nature." msgstr "" "一種安全的方法是都使用通用 (generics) 操作(名稱以 ``PyObject_``、" -"``PyNumber_``、``PySequence_`` 或 ``PyMapping_`` 開頭的函式)。這些操作總是增" -"加它們回傳的物件的參照計數。這讓呼叫者有責任在處理完結果後呼叫 :c:func:" -"`Py_DECREF`;這就成為第二本質。" +"``PyNumber_``、``PySequence_`` 或 ``PyMapping_`` 開頭的函式)。這些操作總是建" +"立新的對於它們回傳物件的\\ :term:`強參照 `\\ (即增加其參照" +"計數)。這讓呼叫者有責任在處理完結果後呼叫 :c:func:`Py_DECREF`;這就成為第二" +"本質。" -#: ../../c-api/intro.rst:351 +#: ../../c-api/intro.rst:358 msgid "Reference Count Details" msgstr "參照計數詳細資訊" -#: ../../c-api/intro.rst:353 +#: ../../c-api/intro.rst:360 msgid "" "The reference count behavior of functions in the Python/C API is best " "explained in terms of *ownership of references*. Ownership pertains to " @@ -551,8 +558,8 @@ msgid "" "shared). \"Owning a reference\" means being responsible for calling " "Py_DECREF on it when the reference is no longer needed. Ownership can also " "be transferred, meaning that the code that receives ownership of the " -"reference then becomes responsible for eventually decref'ing it by calling :" -"c:func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer needed---or " +"reference then becomes responsible for eventually releasing it by calling :c:" +"func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer needed---or " "passing on this responsibility (usually to its caller). When a function " "passes ownership of a reference on to its caller, the caller is said to " "receive a *new* reference. When no ownership is transferred, the caller is " @@ -563,12 +570,12 @@ msgstr "" "於參照而非物件(物件並非被擁有,它們總是共享的)。「擁有參照」意味著當不再需" "要該參照時,負責在其上呼叫 Py_DECREF。所有權也可以轉移,這意味著接收參照所有" "權的程式碼最終會負責在不需要參照時透過呼叫 :c:func:`Py_DECREF` 或 :c:func:" -"`Py_XDECREF` 減少參照 --- 或者將這個責任再傳遞出去(通常是給它的呼叫者)。當" +"`Py_XDECREF` 釋放參照 --- 或者將這個責任再傳遞出去(通常是給它的呼叫者)。當" "一個函式將參照的所有權傳遞給它的呼叫者時,呼叫者被稱為接收到一個\\ *新*\\ 參" "照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是\\ :term:`借用參" "照 `\\ 就不需要做任何事情。" -#: ../../c-api/intro.rst:366 +#: ../../c-api/intro.rst:373 msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " @@ -580,7 +587,7 @@ msgstr "" "物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定" "它現在擁有該參照,並且你不再對它負責。" -#: ../../c-api/intro.rst:376 +#: ../../c-api/intro.rst:383 msgid "" "Few functions steal references; the two notable exceptions are :c:func:" "`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " @@ -597,7 +604,7 @@ msgstr "" "慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的程式碼可以" "如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):" -#: ../../c-api/intro.rst:391 +#: ../../c-api/intro.rst:398 msgid "" "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately " "stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object " @@ -608,7 +615,7 @@ msgstr "" "`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將被竊取,請" "在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來獲取另一個參照。" -#: ../../c-api/intro.rst:396 +#: ../../c-api/intro.rst:403 msgid "" "Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple " "items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to " @@ -620,7 +627,7 @@ msgstr "" "tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple 使" "用 :c:func:`PyTuple_SetItem`。" -#: ../../c-api/intro.rst:401 +#: ../../c-api/intro.rst:408 msgid "" "Equivalent code for populating a list can be written using :c:func:" "`PyList_New` and :c:func:`PyList_SetItem`." @@ -628,7 +635,7 @@ msgstr "" "可以使用 :c:func:`PyList_New` 和 :c:func:`PyList_SetItem` 編寫用於填充列表的" "等效程式碼。" -#: ../../c-api/intro.rst:404 +#: ../../c-api/intro.rst:411 msgid "" "However, in practice, you will rarely use these ways of creating and " "populating a tuple or list. There's a generic function, :c:func:" @@ -643,22 +650,22 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:415 +#: ../../c-api/intro.rst:422 msgid "" "It is much more common to use :c:func:`PyObject_SetItem` and friends with " "items whose references you are only borrowing, like arguments that were " "passed in to the function you are writing. In that case, their behaviour " -"regarding reference counts is much saner, since you don't have to increment " -"a reference count so you can give a reference away (\"have it be stolen\"). " +"regarding references is much saner, since you don't have to take a new " +"reference just so you can give that reference away (\"have it be stolen\"). " "For example, this function sets all items of a list (actually, any mutable " "sequence) to a given item::" msgstr "" "更常見的是以那些借用參照的項目來使用 :c:func:`PyObject_SetItem` 及其系列函" -"式,比如傳遞給你正在編寫的函式的引數。在那種情況下,他們關於參照計數的行為會" -"比較穩健,因為你不必增加參照計數就可以放棄參照(「讓它被竊取」)。例如,此函" -"式將 list(實際上是任何可變序列)的所有項目設定於給定項目:" +"式,比如傳遞給你正在編寫的函式的引數。在那種情況下,他們關於參照的行為會比較" +"穩健,因為你不取得新的一個參照就可以放棄參照(「讓它被竊取」)。例如,此函式" +"將 list(實際上是任何可變序列)的所有項目設定於給定項目:" -#: ../../c-api/intro.rst:445 +#: ../../c-api/intro.rst:452 msgid "" "The situation is slightly different for function return values. While " "passing a reference to most functions does not change your ownership " @@ -676,7 +683,7 @@ msgstr "" "照的通用函式,如 :c:func:`PyObject_GetItem` 和 :c:func:`PySequence_GetItem`," "總是回傳一個新的參照(呼叫者成為參照的所有者)。" -#: ../../c-api/intro.rst:454 +#: ../../c-api/intro.rst:461 msgid "" "It is important to realize that whether you own a reference returned by a " "function depends on which function you call only --- *the plumage* (the type " @@ -692,7 +699,7 @@ msgstr "" "如果你使用 :c:func:`PySequence_GetItem` 從同一 list 中獲取相同的項目(且恰好" "使用完全相同的引數),你確實會擁有對回傳物件的參照。" -#: ../../c-api/intro.rst:466 +#: ../../c-api/intro.rst:473 msgid "" "Here is an example of how you could write a function that computes the sum " "of the items in a list of integers; once using :c:func:`PyList_GetItem`, " @@ -703,11 +710,11 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:530 +#: ../../c-api/intro.rst:537 msgid "Types" msgstr "型別" -#: ../../c-api/intro.rst:532 +#: ../../c-api/intro.rst:539 msgid "" "There are few other data types that play a significant role in the Python/C " "API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:" @@ -722,7 +729,7 @@ msgstr "" "一些結構型別被用於描述用於列出模組所匯出的函式或新物件型別的資料屬性的靜態" "表,其他則用於描述複數的值。這些將與使用它們的函式一起討論。" -#: ../../c-api/intro.rst:542 +#: ../../c-api/intro.rst:549 msgid "" "A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. " "C99 doesn't define such a thing directly (size_t is an unsigned integral " @@ -733,11 +740,11 @@ msgstr "" "有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參閱 :pep:" "`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。" -#: ../../c-api/intro.rst:551 +#: ../../c-api/intro.rst:558 msgid "Exceptions" msgstr "例外" -#: ../../c-api/intro.rst:553 +#: ../../c-api/intro.rst:560 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -749,7 +756,7 @@ msgstr "" "給呼叫者,然後傳遞給呼叫者的呼叫者,依此類推,直到它們到達頂層直譯器,在那裡" "它們透過堆疊回溯 (stack trace) 回報給使用者。" -#: ../../c-api/intro.rst:561 +#: ../../c-api/intro.rst:568 msgid "" "For C programmers, however, error checking always has to be explicit. All " "functions in the Python/C API can raise exceptions, unless an explicit claim " @@ -771,7 +778,7 @@ msgstr "" "確的錯誤指示器或者有不明確的回傳值,而需要使用 :c:func:`PyErr_Occurred` 明確" "測試錯誤。這些例外都會被明確地記錄於文件。" -#: ../../c-api/intro.rst:576 +#: ../../c-api/intro.rst:583 msgid "" "Exception state is maintained in per-thread storage (this is equivalent to " "using global storage in an unthreaded application). A thread can be in one " @@ -790,7 +797,7 @@ msgstr "" "func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函式,而 :" "c:func:`PyErr_Clear` 是用來清除例外狀態。" -#: ../../c-api/intro.rst:586 +#: ../../c-api/intro.rst:593 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " @@ -809,7 +816,7 @@ msgstr "" "達 Python 位元組碼直譯器的主迴圈,該迴圈負責將它傳遞給 ``sys.exc_info()`` 和" "其系列函式。" -#: ../../c-api/intro.rst:598 +#: ../../c-api/intro.rst:605 msgid "" "Note that starting with Python 1.5, the preferred, thread-safe way to access " "the exception state from Python code is to call the function :func:`sys." @@ -829,7 +836,7 @@ msgstr "" "式碼中的常見錯誤,這些錯誤是由看似無辜的函式覆蓋了正在處理的例外而引起的;它" "還替回溯中被堆疊幀 (stack frame) 參照的物件減少了通常不需要的生命週期延長。" -#: ../../c-api/intro.rst:609 +#: ../../c-api/intro.rst:616 msgid "" "As a general principle, a function that calls another function to perform " "some task should check whether the called function raised an exception, and " @@ -844,7 +851,7 @@ msgstr "" "並回傳一個錯誤指示符,但它\\ *不應該*\\ 設定另一個例外 --- 這將覆蓋剛剛引發的" "例外,並丟失關於錯誤確切原因的重要資訊。" -#: ../../c-api/intro.rst:618 +#: ../../c-api/intro.rst:625 msgid "" "A simple example of detecting exceptions and passing them on is shown in " "the :c:func:`!sum_sequence` example above. It so happens that this example " @@ -858,11 +865,11 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:633 +#: ../../c-api/intro.rst:640 msgid "Here is the corresponding C code, in all its glory::" msgstr "這是相應的 C 程式碼:" -#: ../../c-api/intro.rst:685 +#: ../../c-api/intro.rst:692 msgid "" "This example represents an endorsed use of the ``goto`` statement in C! It " "illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:" @@ -881,11 +888,11 @@ msgstr "" "於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣地,回傳值" "被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成功。" -#: ../../c-api/intro.rst:699 +#: ../../c-api/intro.rst:706 msgid "Embedding Python" msgstr "嵌入式Python" -#: ../../c-api/intro.rst:701 +#: ../../c-api/intro.rst:708 msgid "" "The one important task that only embedders (as opposed to extension writers) " "of the Python interpreter have to worry about is the initialization, and " @@ -895,7 +902,7 @@ msgstr "" "只有 Python 直譯器的嵌入者(而不是擴充編寫者)需要擔心的一項重要任務是 " "Python 直譯器的初始化與完成階段。直譯器的大部分功能只能在直譯器初始化後使用。" -#: ../../c-api/intro.rst:714 +#: ../../c-api/intro.rst:721 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -906,7 +913,7 @@ msgstr "" "立基礎模組 :mod:`builtins`、:mod:`__main__` 和 :mod:`sys`。它還會初始化模組搜" "索路徑 (``sys.path``)。" -#: ../../c-api/intro.rst:719 +#: ../../c-api/intro.rst:726 msgid "" ":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys." "argv``). If this variable is needed by Python code that will be executed " @@ -918,7 +925,7 @@ msgstr "" "`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請見 :ref:`Python 初始化" "配置 `。" -#: ../../c-api/intro.rst:724 +#: ../../c-api/intro.rst:731 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -936,7 +943,7 @@ msgstr "" "file:`python` 的可執行檔案,並在其父目錄中查找一個名為 :file:`lib/python{X.Y}" "` 的目錄的相對位置。" -#: ../../c-api/intro.rst:733 +#: ../../c-api/intro.rst:740 msgid "" "For instance, if the Python executable is found in :file:`/usr/local/bin/" "python`, it will assume that the libraries are in :file:`/usr/local/lib/" @@ -953,7 +960,7 @@ msgstr "" "`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入額外的目" "錄。" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:755 msgid "" "The embedding application can steer the search by calling " "``Py_SetProgramName(file)`` *before* calling :c:func:`Py_Initialize`. Note " @@ -970,7 +977,7 @@ msgstr "" "`Py_GetExecPrefix` 和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :file:" "`Modules/getpath.c`)。" -#: ../../c-api/intro.rst:758 +#: ../../c-api/intro.rst:765 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " "application may want to start over (make another call to :c:func:" @@ -991,11 +998,11 @@ msgstr "" "`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例如目前無法釋" "放被擴充模組所分配的記憶體。" -#: ../../c-api/intro.rst:772 +#: ../../c-api/intro.rst:779 msgid "Debugging Builds" msgstr "除錯建置" -#: ../../c-api/intro.rst:774 +#: ../../c-api/intro.rst:781 msgid "" "Python can be built with several macros to enable extra checks of the " "interpreter and extension modules. These checks tend to add a large amount " @@ -1004,7 +1011,7 @@ msgstr "" "Python 可以在建置時使用多個巨集來啟用對直譯器和擴充模組的額外檢查,這些檢查往" "往會在執行環境 (runtime) 增加大量開銷 (overhead),因此預設情況下不啟用它們。" -#: ../../c-api/intro.rst:778 +#: ../../c-api/intro.rst:785 msgid "" "A full list of the various types of debugging builds is in the file :file:" "`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are " @@ -1017,7 +1024,7 @@ msgstr "" "錯構置的完整列表,為支援追蹤參照計數、為記憶體分配器除錯或對主直譯器迴圈進行" "低階分析的建置。本節的其餘部分將僅描述最常用的建置。" -#: ../../c-api/intro.rst:784 +#: ../../c-api/intro.rst:791 msgid "" "Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `." @@ -1041,7 +1048,7 @@ msgstr "" "除了下面描述的參照計數除錯之外,還會執行額外的檢查,請參閱 :ref:`Python 除錯" "建置 `。" -#: ../../c-api/intro.rst:795 +#: ../../c-api/intro.rst:802 msgid "" "Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" "`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " @@ -1056,7 +1063,7 @@ msgstr "" "linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下," "這發生在直譯器運行的每個陳述句之後。)" -#: ../../c-api/intro.rst:802 +#: ../../c-api/intro.rst:809 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." @@ -1072,122 +1079,122 @@ msgstr "object(物件)" msgid "type" msgstr "type(型別)" -#: ../../c-api/intro.rst:301 +#: ../../c-api/intro.rst:303 msgid "Py_INCREF()" msgstr "Py_INCREF()" -#: ../../c-api/intro.rst:301 +#: ../../c-api/intro.rst:303 msgid "Py_DECREF()" msgstr "Py_DECREF()" -#: ../../c-api/intro.rst:372 +#: ../../c-api/intro.rst:379 msgid "PyList_SetItem()" msgstr "PyList_SetItem()" -#: ../../c-api/intro.rst:372 +#: ../../c-api/intro.rst:379 msgid "PyTuple_SetItem()" msgstr "PyTuple_SetItem()" -#: ../../c-api/intro.rst:443 +#: ../../c-api/intro.rst:450 msgid "set_all()" msgstr "set_all()" -#: ../../c-api/intro.rst:462 +#: ../../c-api/intro.rst:469 msgid "PyList_GetItem()" msgstr "PyList_GetItem()" -#: ../../c-api/intro.rst:462 +#: ../../c-api/intro.rst:469 msgid "PySequence_GetItem()" msgstr "PySequence_GetItem()" -#: ../../c-api/intro.rst:492 +#: ../../c-api/intro.rst:499 msgid "sum_list()" msgstr "sum_list()" -#: ../../c-api/intro.rst:524 ../../c-api/intro.rst:616 +#: ../../c-api/intro.rst:531 ../../c-api/intro.rst:623 msgid "sum_sequence()" msgstr "sum_sequence()" -#: ../../c-api/intro.rst:559 +#: ../../c-api/intro.rst:566 msgid "PyErr_Occurred()" msgstr "PyErr_Occurred()" -#: ../../c-api/intro.rst:572 +#: ../../c-api/intro.rst:579 msgid "PyErr_SetString()" msgstr "PyErr_SetString()" -#: ../../c-api/intro.rst:572 ../../c-api/intro.rst:680 +#: ../../c-api/intro.rst:579 ../../c-api/intro.rst:687 msgid "PyErr_Clear()" msgstr "PyErr_Clear()" -#: ../../c-api/intro.rst:596 +#: ../../c-api/intro.rst:603 msgid "exc_info() (in module sys)" msgstr "exc_info() (sys 模組中)" -#: ../../c-api/intro.rst:631 ../../c-api/intro.rst:678 +#: ../../c-api/intro.rst:638 ../../c-api/intro.rst:685 msgid "incr_item()" msgstr "incr_item()" -#: ../../c-api/intro.rst:680 +#: ../../c-api/intro.rst:687 msgid "PyErr_ExceptionMatches()" msgstr "PyErr_ExceptionMatches()" -#: ../../c-api/intro.rst:680 +#: ../../c-api/intro.rst:687 msgid "Py_XDECREF()" msgstr "Py_XDECREF()" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "Py_Initialize()" msgstr "Py_Initialize()" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "module" msgstr "module(模組)" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "__main__" msgstr "__main__" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "sys" msgstr "sys" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "path" msgstr "path(路徑)" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:713 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/intro.rst:741 +#: ../../c-api/intro.rst:748 msgid "Py_SetProgramName()" msgstr "Py_SetProgramName()" -#: ../../c-api/intro.rst:741 +#: ../../c-api/intro.rst:748 msgid "Py_GetPath()" msgstr "Py_GetPath()" -#: ../../c-api/intro.rst:741 +#: ../../c-api/intro.rst:748 msgid "Py_GetPrefix()" msgstr "Py_GetPrefix()" -#: ../../c-api/intro.rst:741 +#: ../../c-api/intro.rst:748 msgid "Py_GetExecPrefix()" msgstr "Py_GetExecPrefix()" -#: ../../c-api/intro.rst:741 +#: ../../c-api/intro.rst:748 msgid "Py_GetProgramFullPath()" msgstr "Py_GetProgramFullPath()" -#: ../../c-api/intro.rst:756 +#: ../../c-api/intro.rst:763 msgid "Py_IsInitialized()" msgstr "Py_IsInitialized()" diff --git a/c-api/memory.po b/c-api/memory.po index 70ab0af2cf..9a8b640b46 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-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-01 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:651 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657 msgid "Field" msgstr "" -#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:651 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657 msgid "Meaning" msgstr "" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:653 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659 msgid "``void *ctx``" msgstr "``void *ctx``" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:653 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659 msgid "user context passed as first argument" msgstr "" @@ -691,22 +691,29 @@ msgstr "" #: ../../c-api/memory.rst:479 msgid "" +"For the remaining domains, the allocator must also be thread-safe: the " +"allocator may be called in different interpreters that do not share a " +"``GIL``." +msgstr "" + +#: ../../c-api/memory.rst:483 +msgid "" "If the new allocator is not a hook (does not call the previous allocator), " "the :c:func:`PyMem_SetupDebugHooks` function must be called to reinstall the " "debug hooks on top on the new allocator." msgstr "" -#: ../../c-api/memory.rst:483 +#: ../../c-api/memory.rst:487 msgid "" "See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python " "with PyPreConfig `." msgstr "" -#: ../../c-api/memory.rst:488 +#: ../../c-api/memory.rst:492 msgid ":c:func:`PyMem_SetAllocator` does have the following contract:" msgstr "" -#: ../../c-api/memory.rst:490 +#: ../../c-api/memory.rst:494 msgid "" "It can be called after :c:func:`Py_PreInitialize` and before :c:func:" "`Py_InitializeFromConfig` to install a custom memory allocator. There are no " @@ -716,7 +723,7 @@ msgid "" "domains>` for more information." msgstr "" -#: ../../c-api/memory.rst:498 +#: ../../c-api/memory.rst:502 msgid "" "If called after Python has finish initializing (after :c:func:" "`Py_InitializeFromConfig` has been called) the allocator **must** wrap the " @@ -725,16 +732,20 @@ msgid "" msgstr "" #: ../../c-api/memory.rst:507 +msgid "All allocators must be thread-safe." +msgstr "" + +#: ../../c-api/memory.rst:513 msgid "" "Setup :ref:`debug hooks in the Python memory allocators ` " "to detect memory errors." msgstr "" -#: ../../c-api/memory.rst:514 +#: ../../c-api/memory.rst:520 msgid "Debug hooks on the Python memory allocators" msgstr "" -#: ../../c-api/memory.rst:516 +#: ../../c-api/memory.rst:522 msgid "" "When :ref:`Python is built in debug mode `, the :c:func:" "`PyMem_SetupDebugHooks` function is called at the :ref:`Python " @@ -742,19 +753,19 @@ msgid "" "allocators to detect memory errors." msgstr "" -#: ../../c-api/memory.rst:521 +#: ../../c-api/memory.rst:527 msgid "" "The :envvar:`PYTHONMALLOC` environment variable can be used to install debug " "hooks on a Python compiled in release mode (ex: ``PYTHONMALLOC=debug``)." msgstr "" -#: ../../c-api/memory.rst:524 +#: ../../c-api/memory.rst:530 msgid "" "The :c:func:`PyMem_SetupDebugHooks` function can be used to set debug hooks " "after calling :c:func:`PyMem_SetAllocator`." msgstr "" -#: ../../c-api/memory.rst:527 +#: ../../c-api/memory.rst:533 msgid "" "These debug hooks fill dynamically allocated memory blocks with special, " "recognizable bit patterns. Newly allocated memory is filled with the byte " @@ -764,25 +775,25 @@ msgid "" "these bytes are unlikely to be valid addresses, floats, or ASCII strings." msgstr "" -#: ../../c-api/memory.rst:534 +#: ../../c-api/memory.rst:540 msgid "Runtime checks:" msgstr "" -#: ../../c-api/memory.rst:536 +#: ../../c-api/memory.rst:542 msgid "" "Detect API violations. For example, detect if :c:func:`PyObject_Free` is " "called on a memory block allocated by :c:func:`PyMem_Malloc`." msgstr "" -#: ../../c-api/memory.rst:538 +#: ../../c-api/memory.rst:544 msgid "Detect write before the start of the buffer (buffer underflow)." msgstr "" -#: ../../c-api/memory.rst:539 +#: ../../c-api/memory.rst:545 msgid "Detect write after the end of the buffer (buffer overflow)." msgstr "" -#: ../../c-api/memory.rst:540 +#: ../../c-api/memory.rst:546 msgid "" "Check that the :term:`GIL ` is held when allocator " "functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " @@ -790,7 +801,7 @@ msgid "" "called." msgstr "" -#: ../../c-api/memory.rst:545 +#: ../../c-api/memory.rst:551 msgid "" "On error, the debug hooks use the :mod:`tracemalloc` module to get the " "traceback where a memory block was allocated. The traceback is only " @@ -798,7 +809,7 @@ msgid "" "memory block was traced." msgstr "" -#: ../../c-api/memory.rst:550 +#: ../../c-api/memory.rst:556 msgid "" "Let *S* = ``sizeof(size_t)``. ``2*S`` bytes are added at each end of each " "block of *N* bytes requested. The memory layout is like so, where p " @@ -808,49 +819,49 @@ msgid "" "from a Python slice):" msgstr "" -#: ../../c-api/memory.rst:557 +#: ../../c-api/memory.rst:563 msgid "``p[-2*S:-S]``" msgstr "``p[-2*S:-S]``" -#: ../../c-api/memory.rst:557 +#: ../../c-api/memory.rst:563 msgid "" "Number of bytes originally asked for. This is a size_t, big-endian (easier " "to read in a memory dump)." msgstr "" -#: ../../c-api/memory.rst:564 +#: ../../c-api/memory.rst:570 msgid "``p[-S]``" msgstr "``p[-S]``" -#: ../../c-api/memory.rst:560 +#: ../../c-api/memory.rst:566 msgid "API identifier (ASCII character):" msgstr "" -#: ../../c-api/memory.rst:562 +#: ../../c-api/memory.rst:568 msgid "``'r'`` for :c:macro:`PYMEM_DOMAIN_RAW`." msgstr "" -#: ../../c-api/memory.rst:563 +#: ../../c-api/memory.rst:569 msgid "``'m'`` for :c:macro:`PYMEM_DOMAIN_MEM`." msgstr "" -#: ../../c-api/memory.rst:564 +#: ../../c-api/memory.rst:570 msgid "``'o'`` for :c:macro:`PYMEM_DOMAIN_OBJ`." msgstr "" -#: ../../c-api/memory.rst:567 +#: ../../c-api/memory.rst:573 msgid "``p[-S+1:0]``" msgstr "``p[-S+1:0]``" -#: ../../c-api/memory.rst:567 +#: ../../c-api/memory.rst:573 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch under- writes and reads." msgstr "" -#: ../../c-api/memory.rst:576 +#: ../../c-api/memory.rst:582 msgid "``p[0:N]``" msgstr "``p[0:N]``" -#: ../../c-api/memory.rst:570 +#: ../../c-api/memory.rst:576 msgid "" "The requested memory, filled with copies of PYMEM_CLEANBYTE, used to catch " "reference to uninitialized memory. When a realloc-like function is called " @@ -861,25 +872,25 @@ msgid "" "bytes are also filled with PYMEM_DEADBYTE." msgstr "" -#: ../../c-api/memory.rst:579 +#: ../../c-api/memory.rst:585 msgid "``p[N:N+S]``" msgstr "``p[N:N+S]``" -#: ../../c-api/memory.rst:579 +#: ../../c-api/memory.rst:585 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch over- writes and reads." msgstr "" -#: ../../c-api/memory.rst:590 +#: ../../c-api/memory.rst:596 msgid "``p[N+S:N+2*S]``" msgstr "``p[N+S:N+2*S]``" -#: ../../c-api/memory.rst:582 +#: ../../c-api/memory.rst:588 msgid "" "Only used if the ``PYMEM_DEBUG_SERIALNO`` macro is defined (not defined by " "default)." msgstr "" -#: ../../c-api/memory.rst:585 +#: ../../c-api/memory.rst:591 msgid "" "A serial number, incremented by 1 on each call to a malloc-like or realloc-" "like function. Big-endian :c:type:`size_t`. If \"bad memory\" is detected " @@ -889,7 +900,7 @@ msgid "" "number is incremented, and exists so you can set such a breakpoint easily." msgstr "" -#: ../../c-api/memory.rst:592 +#: ../../c-api/memory.rst:598 msgid "" "A realloc-like or free-like function first checks that the " "PYMEM_FORBIDDENBYTE bytes at each end are intact. If they've been altered, " @@ -902,7 +913,7 @@ msgid "" "getting used)." msgstr "" -#: ../../c-api/memory.rst:601 +#: ../../c-api/memory.rst:607 msgid "" "The :c:func:`PyMem_SetupDebugHooks` function now also works on Python " "compiled in release mode. On error, the debug hooks now use :mod:" @@ -911,7 +922,7 @@ msgid "" "`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` domains are called." msgstr "" -#: ../../c-api/memory.rst:609 +#: ../../c-api/memory.rst:615 msgid "" "Byte patterns ``0xCB`` (``PYMEM_CLEANBYTE``), ``0xDB`` (``PYMEM_DEADBYTE``) " "and ``0xFB`` (``PYMEM_FORBIDDENBYTE``) have been replaced with ``0xCD``, " @@ -919,11 +930,11 @@ msgid "" "``malloc()`` and ``free()``." msgstr "" -#: ../../c-api/memory.rst:619 +#: ../../c-api/memory.rst:625 msgid "The pymalloc allocator" msgstr "" -#: ../../c-api/memory.rst:621 +#: ../../c-api/memory.rst:627 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 " @@ -932,114 +943,114 @@ msgid "" "512 bytes." msgstr "" -#: ../../c-api/memory.rst:626 +#: ../../c-api/memory.rst:632 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:630 +#: ../../c-api/memory.rst:636 msgid "The arena allocator uses the following functions:" msgstr "" -#: ../../c-api/memory.rst:632 +#: ../../c-api/memory.rst:638 msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," msgstr "" -#: ../../c-api/memory.rst:633 +#: ../../c-api/memory.rst:639 msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," msgstr "" -#: ../../c-api/memory.rst:634 +#: ../../c-api/memory.rst:640 msgid ":c:func:`malloc` and :c:func:`free` otherwise." msgstr "" -#: ../../c-api/memory.rst:636 +#: ../../c-api/memory.rst:642 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:641 +#: ../../c-api/memory.rst:647 msgid "Customize pymalloc Arena Allocator" msgstr "" -#: ../../c-api/memory.rst:647 +#: ../../c-api/memory.rst:653 msgid "" "Structure used to describe an arena allocator. The structure has three " "fields:" msgstr "" -#: ../../c-api/memory.rst:655 +#: ../../c-api/memory.rst:661 msgid "``void* alloc(void *ctx, size_t size)``" msgstr "``void* alloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:655 +#: ../../c-api/memory.rst:661 msgid "allocate an arena of size bytes" msgstr "" -#: ../../c-api/memory.rst:657 +#: ../../c-api/memory.rst:663 msgid "``void free(void *ctx, void *ptr, size_t size)``" msgstr "``void free(void *ctx, void *ptr, size_t size)``" -#: ../../c-api/memory.rst:657 +#: ../../c-api/memory.rst:663 msgid "free an arena" msgstr "" -#: ../../c-api/memory.rst:662 +#: ../../c-api/memory.rst:668 msgid "Get the arena allocator." msgstr "" -#: ../../c-api/memory.rst:666 +#: ../../c-api/memory.rst:672 msgid "Set the arena allocator." msgstr "" -#: ../../c-api/memory.rst:670 +#: ../../c-api/memory.rst:676 msgid "tracemalloc C API" msgstr "" -#: ../../c-api/memory.rst:676 +#: ../../c-api/memory.rst:682 msgid "Track an allocated memory block in the :mod:`tracemalloc` module." msgstr "" -#: ../../c-api/memory.rst:678 +#: ../../c-api/memory.rst:684 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:681 +#: ../../c-api/memory.rst:687 msgid "If memory block is already tracked, update the existing trace." msgstr "" -#: ../../c-api/memory.rst:685 +#: ../../c-api/memory.rst:691 msgid "" "Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " "nothing if the block was not tracked." msgstr "" -#: ../../c-api/memory.rst:688 +#: ../../c-api/memory.rst:694 msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." msgstr "" -#: ../../c-api/memory.rst:694 +#: ../../c-api/memory.rst:700 msgid "Examples" msgstr "範例" -#: ../../c-api/memory.rst:696 +#: ../../c-api/memory.rst:702 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:709 +#: ../../c-api/memory.rst:715 msgid "The same code using the type-oriented function set::" msgstr "" -#: ../../c-api/memory.rst:721 +#: ../../c-api/memory.rst:727 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 " @@ -1049,14 +1060,14 @@ msgid "" "different allocators operating on different heaps. ::" msgstr "" -#: ../../c-api/memory.rst:736 +#: ../../c-api/memory.rst:742 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:740 +#: ../../c-api/memory.rst:746 msgid "" "These will be explained in the next chapter on defining and implementing new " "object types in C." diff --git a/c-api/module.po b/c-api/module.po index bfca4455de..56d28314f2 100644 --- a/c-api/module.po +++ b/c-api/module.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-08-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -426,15 +426,53 @@ msgid "" "order they appear in the *m_slots* array." msgstr "" -#: ../../c-api/module.rst:379 +#: ../../c-api/module.rst:381 +msgid "Specifies one of the following values:" +msgstr "" + +#: ../../c-api/module.rst:385 +msgid "The module does not support being imported in subinterpreters." +msgstr "" + +#: ../../c-api/module.rst:389 +msgid "" +"The module supports being imported in subinterpreters, but only when they " +"share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)" +msgstr "" + +#: ../../c-api/module.rst:395 +msgid "" +"The module supports being imported in subinterpreters, even when they have " +"their own GIL. (See :ref:`isolating-extensions-howto`.)" +msgstr "" + +#: ../../c-api/module.rst:399 +msgid "" +"This slot determines whether or not importing this module in a " +"subinterpreter will fail." +msgstr "" + +#: ../../c-api/module.rst:402 +msgid "" +"Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " +"module definition." +msgstr "" + +#: ../../c-api/module.rst:405 +msgid "" +"If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " +"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``." +msgstr "" + +#: ../../c-api/module.rst:410 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "" -#: ../../c-api/module.rst:382 +#: ../../c-api/module.rst:413 msgid "Low-level module creation functions" msgstr "" -#: ../../c-api/module.rst:384 +#: ../../c-api/module.rst:415 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -442,14 +480,14 @@ msgid "" "``PyModule_ExecDef`` must be called to fully initialize a module." msgstr "" -#: ../../c-api/module.rst:391 +#: ../../c-api/module.rst:422 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with " "*module_api_version* set to :c:macro:`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:399 +#: ../../c-api/module.rst:430 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*, assuming the API version *module_api_version*. If that version does " @@ -457,24 +495,24 @@ msgid "" "emitted." msgstr "" -#: ../../c-api/module.rst:406 +#: ../../c-api/module.rst:437 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:413 +#: ../../c-api/module.rst:444 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: ../../c-api/module.rst:419 +#: ../../c-api/module.rst:450 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef``, using either " "``PyModule_Create`` or ``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:428 +#: ../../c-api/module.rst:459 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -486,11 +524,11 @@ msgid "" "``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:440 +#: ../../c-api/module.rst:471 msgid "Support functions" msgstr "" -#: ../../c-api/module.rst:442 +#: ../../c-api/module.rst:473 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -498,82 +536,82 @@ msgid "" "module state:" msgstr "" -#: ../../c-api/module.rst:449 +#: ../../c-api/module.rst:480 msgid "" "Add an object to *module* as *name*. This is a convenience function which " "can be used from the module's initialization function." msgstr "" -#: ../../c-api/module.rst:452 +#: ../../c-api/module.rst:483 msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:454 +#: ../../c-api/module.rst:485 msgid "" "Return ``NULL`` if *value* is ``NULL``. It must be called with an exception " "raised in this case." msgstr "" -#: ../../c-api/module.rst:457 ../../c-api/module.rst:506 +#: ../../c-api/module.rst:488 ../../c-api/module.rst:537 msgid "Example usage::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../c-api/module.rst:471 ../../c-api/module.rst:524 +#: ../../c-api/module.rst:502 ../../c-api/module.rst:555 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" msgstr "" -#: ../../c-api/module.rst:483 ../../c-api/module.rst:540 +#: ../../c-api/module.rst:514 ../../c-api/module.rst:571 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: ../../c-api/module.rst:491 +#: ../../c-api/module.rst:522 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -#: ../../c-api/module.rst:494 +#: ../../c-api/module.rst:525 msgid "" "The new :c:func:`PyModule_AddObjectRef` function is recommended, since it is " "easy to introduce reference leaks by misusing the :c:func:" "`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:500 +#: ../../c-api/module.rst:531 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " -"decrements the reference count of *value* **on success**." +"releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:503 +#: ../../c-api/module.rst:534 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_DECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:546 +#: ../../c-api/module.rst:577 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` on " "error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:553 +#: ../../c-api/module.rst:584 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " "be ``NULL``-terminated. Return ``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:560 +#: ../../c-api/module.rst:591 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " @@ -581,11 +619,11 @@ msgid "" "error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:568 +#: ../../c-api/module.rst:599 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:572 +#: ../../c-api/module.rst:603 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " @@ -593,25 +631,25 @@ msgid "" "``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:582 +#: ../../c-api/module.rst:613 msgid "Module lookup" msgstr "" -#: ../../c-api/module.rst:584 +#: ../../c-api/module.rst:615 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:588 +#: ../../c-api/module.rst:619 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:593 +#: ../../c-api/module.rst:624 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -620,18 +658,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:600 +#: ../../c-api/module.rst:631 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:603 +#: ../../c-api/module.rst:634 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:605 +#: ../../c-api/module.rst:636 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -642,15 +680,15 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:613 ../../c-api/module.rst:624 +#: ../../c-api/module.rst:644 ../../c-api/module.rst:655 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/module.rst:615 +#: ../../c-api/module.rst:646 msgid "Return 0 on success or -1 on failure." msgstr "" -#: ../../c-api/module.rst:621 +#: ../../c-api/module.rst:652 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return 0 on success or -1 on failure." diff --git a/c-api/object.po b/c-api/object.po index 9c7f786d81..26c27baa4c 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,8 +31,8 @@ msgstr "" #: ../../c-api/object.rst:17 msgid "" "Properly handle returning :c:data:`Py_NotImplemented` from within a C " -"function (that is, increment the reference count of NotImplemented and " -"return it)." +"function (that is, create a new :term:`strong reference` to NotImplemented " +"and return it)." msgstr "" #: ../../c-api/object.rst:24 @@ -339,19 +339,19 @@ msgid "" "When *o* is non-``NULL``, returns a type object corresponding to the object " "type of object *o*. On failure, raises :exc:`SystemError` and returns " "``NULL``. This is equivalent to the Python expression ``type(o)``. This " -"function increments the reference count of the return value. There's really " -"no reason to use this function instead of the :c:func:`Py_TYPE()` function, " -"which returns a pointer of type :c:expr:`PyTypeObject*`, except when the " -"incremented reference count is needed." +"function creates a new :term:`strong reference` to the return value. There's " +"really no reason to use this function instead of the :c:func:`Py_TYPE()` " +"function, which returns a pointer of type :c:expr:`PyTypeObject*`, except " +"when a new :term:`strong reference` is needed." msgstr "" -#: ../../c-api/object.rst:332 +#: ../../c-api/object.rst:333 msgid "" "Return non-zero if the object *o* is of type *type* or a subtype of *type*, " "and ``0`` otherwise. Both parameters must be non-``NULL``." msgstr "" -#: ../../c-api/object.rst:341 +#: ../../c-api/object.rst:342 msgid "" "Return the length of object *o*. If the object *o* provides either the " "sequence and mapping protocols, the sequence length is returned. On error, " @@ -359,7 +359,7 @@ msgid "" "``len(o)``." msgstr "" -#: ../../c-api/object.rst:348 +#: ../../c-api/object.rst:349 msgid "" "Return an estimated length for the object *o*. First try to return its " "actual length, then an estimate using :meth:`~object.__length_hint__`, and " @@ -368,26 +368,26 @@ msgid "" "defaultvalue)``." msgstr "" -#: ../../c-api/object.rst:358 +#: ../../c-api/object.rst:359 msgid "" "Return element of *o* corresponding to the object *key* or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o[key]``." msgstr "" -#: ../../c-api/object.rst:364 +#: ../../c-api/object.rst:365 msgid "" "Map the object *key* to the value *v*. Raise an exception and return ``-1`` " "on failure; return ``0`` on success. This is the equivalent of the Python " "statement ``o[key] = v``. This function *does not* steal a reference to *v*." msgstr "" -#: ../../c-api/object.rst:372 +#: ../../c-api/object.rst:373 msgid "" "Remove the mapping for the object *key* from the object *o*. Return ``-1`` " "on failure. This is equivalent to the Python statement ``del o[key]``." msgstr "" -#: ../../c-api/object.rst:378 +#: ../../c-api/object.rst:379 msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " @@ -397,7 +397,7 @@ msgid "" "`PyErr_Occurred` will return false." msgstr "" -#: ../../c-api/object.rst:387 +#: ../../c-api/object.rst:388 msgid "" "This is equivalent to the Python expression ``iter(o)``. It returns a new " "iterator for the object argument, or the object itself if the object is " @@ -405,7 +405,7 @@ msgid "" "object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:395 +#: ../../c-api/object.rst:396 msgid "" "This is the equivalent to the Python expression ``aiter(o)``. Takes an :" "class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " @@ -414,51 +414,51 @@ msgid "" "``NULL`` if the object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:405 +#: ../../c-api/object.rst:406 msgid "Get a pointer to subclass-specific data reserved for *cls*." msgstr "" -#: ../../c-api/object.rst:407 +#: ../../c-api/object.rst:408 msgid "" "The object *o* must be an instance of *cls*, and *cls* must have been " "created using negative :c:member:`PyType_Spec.basicsize`. Python does not " "check this." msgstr "" -#: ../../c-api/object.rst:411 +#: ../../c-api/object.rst:412 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/object.rst:417 +#: ../../c-api/object.rst:418 msgid "" "Return the size of the instance memory space reserved for *cls*, i.e. the " "size of the memory :c:func:`PyObject_GetTypeData` returns." msgstr "" -#: ../../c-api/object.rst:420 +#: ../../c-api/object.rst:421 msgid "" "This may be larger than requested using :c:member:`-PyType_Spec.basicsize " "`; it is safe to use this larger size (e.g. with :c:" "func:`!memset`)." msgstr "" -#: ../../c-api/object.rst:423 +#: ../../c-api/object.rst:424 msgid "" "The type *cls* **must** have been created using negative :c:member:" "`PyType_Spec.basicsize`. Python does not check this." msgstr "" -#: ../../c-api/object.rst:427 +#: ../../c-api/object.rst:428 msgid "On error, set an exception and return a negative value." msgstr "" -#: ../../c-api/object.rst:433 +#: ../../c-api/object.rst:434 msgid "" "Get a pointer to per-item data for a class with :c:macro:" "`Py_TPFLAGS_ITEMS_AT_END`." msgstr "" -#: ../../c-api/object.rst:436 +#: ../../c-api/object.rst:437 msgid "" "On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " "raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." @@ -466,7 +466,7 @@ msgstr "" #: ../../c-api/object.rst:197 ../../c-api/object.rst:209 #: ../../c-api/object.rst:234 ../../c-api/object.rst:285 -#: ../../c-api/object.rst:319 ../../c-api/object.rst:339 +#: ../../c-api/object.rst:319 ../../c-api/object.rst:340 msgid "built-in function" msgstr "bulit-in function(內建函式)" @@ -498,6 +498,6 @@ msgstr "hash(雜湊)" msgid "type" msgstr "type(型別)" -#: ../../c-api/object.rst:339 +#: ../../c-api/object.rst:340 msgid "len" msgstr "len" diff --git a/c-api/sys.po b/c-api/sys.po index c047265062..ba49aadc7f 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 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-" @@ -28,14 +28,14 @@ msgstr "作業系統工具" #: ../../c-api/sys.rst:10 msgid "" "Return the file system representation for *path*. If the object is a :class:" -"`str` or :class:`bytes` object, then its reference count is incremented. If " -"the object implements the :class:`os.PathLike` interface, then :meth:`~os." -"PathLike.__fspath__` is returned as long as it is a :class:`str` or :class:" -"`bytes` object. Otherwise :exc:`TypeError` is raised and ``NULL`` is " -"returned." +"`str` or :class:`bytes` object, then a new :term:`strong reference` is " +"returned. If the object implements the :class:`os.PathLike` interface, then :" +"meth:`~os.PathLike.__fspath__` is returned as long as it is a :class:`str` " +"or :class:`bytes` object. Otherwise :exc:`TypeError` is raised and ``NULL`` " +"is returned." msgstr "" -#: ../../c-api/sys.rst:22 +#: ../../c-api/sys.rst:23 msgid "" "Return true (nonzero) if the standard I/O file *fp* with name *filename* is " "deemed interactive. This is the case for files for which " @@ -45,11 +45,11 @@ msgid "" "``'???'``." msgstr "" -#: ../../c-api/sys.rst:28 +#: ../../c-api/sys.rst:29 msgid "This function must not be called before Python is initialized." msgstr "" -#: ../../c-api/sys.rst:33 +#: ../../c-api/sys.rst:34 msgid "" "Function to prepare some internal state before a process fork. This should " "be called before calling :c:func:`fork` or any similar function that clones " @@ -57,14 +57,14 @@ msgid "" "defined." msgstr "" -#: ../../c-api/sys.rst:39 +#: ../../c-api/sys.rst:40 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_BeforeFork()``." msgstr "" -#: ../../c-api/sys.rst:49 +#: ../../c-api/sys.rst:50 msgid "" "Function to update some internal state after a process fork. This should be " "called from the parent process after calling :c:func:`fork` or any similar " @@ -73,14 +73,14 @@ msgid "" "defined." msgstr "" -#: ../../c-api/sys.rst:56 +#: ../../c-api/sys.rst:57 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Parent()``." msgstr "" -#: ../../c-api/sys.rst:66 +#: ../../c-api/sys.rst:67 msgid "" "Function to update internal interpreter state after a process fork. This " "must be called from the child process after calling :c:func:`fork`, or any " @@ -89,21 +89,21 @@ msgid "" "systems where :c:func:`fork` is defined." msgstr "" -#: ../../c-api/sys.rst:73 +#: ../../c-api/sys.rst:74 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Child()``." msgstr "" -#: ../../c-api/sys.rst:81 +#: ../../c-api/sys.rst:82 msgid "" ":func:`os.register_at_fork` allows registering custom Python functions to be " "called by :c:func:`PyOS_BeforeFork()`, :c:func:`PyOS_AfterFork_Parent` and :" "c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../c-api/sys.rst:88 +#: ../../c-api/sys.rst:89 msgid "" "Function to update some internal state after a process fork; this should be " "called in the new process if the Python interpreter will continue to be " @@ -111,11 +111,11 @@ msgid "" "not need to be called." msgstr "" -#: ../../c-api/sys.rst:93 +#: ../../c-api/sys.rst:94 msgid "This function is superseded by :c:func:`PyOS_AfterFork_Child()`." msgstr "" -#: ../../c-api/sys.rst:99 +#: ../../c-api/sys.rst:100 msgid "" "Return true when the interpreter runs out of stack space. This is a " "reliable check, but is only available when :c:macro:`USE_STACKCHECK` is " @@ -124,7 +124,7 @@ msgid "" "should never change the definition in your own code." msgstr "" -#: ../../c-api/sys.rst:108 +#: ../../c-api/sys.rst:109 msgid "" "Return the current signal handler for signal *i*. This is a thin wrapper " "around either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those " @@ -132,7 +132,7 @@ msgid "" "expr:`void (\\*)(int)`." msgstr "" -#: ../../c-api/sys.rst:116 +#: ../../c-api/sys.rst:117 msgid "" "Set the signal handler for signal *i* to be *h*; return the old signal " "handler. This is a thin wrapper around either :c:func:`!sigaction` or :c:" @@ -140,21 +140,21 @@ msgid "" "`PyOS_sighandler_t` is a typedef alias for :c:expr:`void (\\*)(int)`." msgstr "" -#: ../../c-api/sys.rst:124 +#: ../../c-api/sys.rst:125 msgid "" "This function should not be called directly: use the :c:type:`PyConfig` API " "with the :c:func:`PyConfig_SetBytesString` function which ensures that :ref:" "`Python is preinitialized `." msgstr "" -#: ../../c-api/sys.rst:128 ../../c-api/sys.rst:195 +#: ../../c-api/sys.rst:129 ../../c-api/sys.rst:196 msgid "" "This function must not be called before :ref:`Python is preinitialized ` and so that the LC_CTYPE locale is properly configured: see the :c:" "func:`Py_PreInitialize` function." msgstr "" -#: ../../c-api/sys.rst:132 +#: ../../c-api/sys.rst:133 msgid "" "Decode a byte string from the :term:`filesystem encoding and error handler`. " "If the error handler is :ref:`surrogateescape error handler " @@ -164,57 +164,57 @@ msgid "" "instead of decoding them." msgstr "" -#: ../../c-api/sys.rst:139 +#: ../../c-api/sys.rst:140 msgid "" "Return a pointer to a newly allocated wide character string, use :c:func:" "`PyMem_RawFree` to free the memory. If size is not ``NULL``, write the " "number of wide characters excluding the null character into ``*size``" msgstr "" -#: ../../c-api/sys.rst:143 +#: ../../c-api/sys.rst:144 msgid "" "Return ``NULL`` on decoding error or memory allocation error. If *size* is " "not ``NULL``, ``*size`` is set to ``(size_t)-1`` on memory error or set to " "``(size_t)-2`` on decoding error." msgstr "" -#: ../../c-api/sys.rst:147 ../../c-api/sys.rst:187 +#: ../../c-api/sys.rst:148 ../../c-api/sys.rst:188 msgid "" "The :term:`filesystem encoding and error handler` are selected by :c:func:" "`PyConfig_Read`: see :c:member:`~PyConfig.filesystem_encoding` and :c:member:" "`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." msgstr "" -#: ../../c-api/sys.rst:151 +#: ../../c-api/sys.rst:152 msgid "" "Decoding errors should never happen, unless there is a bug in the C library." msgstr "" -#: ../../c-api/sys.rst:154 +#: ../../c-api/sys.rst:155 msgid "" "Use the :c:func:`Py_EncodeLocale` function to encode the character string " "back to a byte string." msgstr "" -#: ../../c-api/sys.rst:159 +#: ../../c-api/sys.rst:160 msgid "" "The :c:func:`PyUnicode_DecodeFSDefaultAndSize` and :c:func:" "`PyUnicode_DecodeLocaleAndSize` functions." msgstr "" -#: ../../c-api/sys.rst:164 ../../c-api/sys.rst:206 +#: ../../c-api/sys.rst:165 ../../c-api/sys.rst:207 msgid "" "The function now uses the UTF-8 encoding in the :ref:`Python UTF-8 Mode " "`." msgstr "" -#: ../../c-api/sys.rst:168 +#: ../../c-api/sys.rst:169 msgid "" "The function now uses the UTF-8 encoding on Windows if :c:member:" "`PyPreConfig.legacy_windows_fs_encoding` is zero;" msgstr "" -#: ../../c-api/sys.rst:175 +#: ../../c-api/sys.rst:176 msgid "" "Encode a wide character string to the :term:`filesystem encoding and error " "handler`. If the error handler is :ref:`surrogateescape error handler " @@ -222,42 +222,42 @@ msgid "" "converted to bytes 0x80..0xFF." msgstr "" -#: ../../c-api/sys.rst:180 +#: ../../c-api/sys.rst:181 msgid "" "Return a pointer to a newly allocated byte string, use :c:func:`PyMem_Free` " "to free the memory. Return ``NULL`` on encoding error or memory allocation " "error." msgstr "" -#: ../../c-api/sys.rst:184 +#: ../../c-api/sys.rst:185 msgid "" "If error_pos is not ``NULL``, ``*error_pos`` is set to ``(size_t)-1`` on " "success, or set to the index of the invalid character on encoding error." msgstr "" -#: ../../c-api/sys.rst:191 +#: ../../c-api/sys.rst:192 msgid "" "Use the :c:func:`Py_DecodeLocale` function to decode the bytes string back " "to a wide character string." msgstr "" -#: ../../c-api/sys.rst:201 +#: ../../c-api/sys.rst:202 msgid "" "The :c:func:`PyUnicode_EncodeFSDefault` and :c:func:`PyUnicode_EncodeLocale` " "functions." msgstr "" -#: ../../c-api/sys.rst:210 +#: ../../c-api/sys.rst:211 msgid "" "The function now uses the UTF-8 encoding on Windows if :c:member:" "`PyPreConfig.legacy_windows_fs_encoding` is zero." msgstr "" -#: ../../c-api/sys.rst:218 +#: ../../c-api/sys.rst:219 msgid "System Functions" msgstr "系統函式" -#: ../../c-api/sys.rst:220 +#: ../../c-api/sys.rst:221 msgid "" "These are utility functions that make functionality from the :mod:`sys` " "module accessible to C code. They all work with the current interpreter " @@ -265,43 +265,43 @@ msgid "" "state structure." msgstr "" -#: ../../c-api/sys.rst:226 +#: ../../c-api/sys.rst:227 msgid "" "Return the object *name* from the :mod:`sys` module or ``NULL`` if it does " "not exist, without setting an exception." msgstr "" -#: ../../c-api/sys.rst:231 +#: ../../c-api/sys.rst:232 msgid "" "Set *name* in the :mod:`sys` module to *v* unless *v* is ``NULL``, in which " "case *name* is deleted from the sys module. Returns ``0`` on success, ``-1`` " "on error." msgstr "" -#: ../../c-api/sys.rst:237 +#: ../../c-api/sys.rst:238 msgid "" "Reset :data:`sys.warnoptions` to an empty list. This function may be called " "prior to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/sys.rst:242 ../../c-api/sys.rst:253 +#: ../../c-api/sys.rst:243 ../../c-api/sys.rst:254 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "warnoptions` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/sys.rst:246 +#: ../../c-api/sys.rst:247 msgid "" "Append *s* to :data:`sys.warnoptions`. This function must be called prior " "to :c:func:`Py_Initialize` in order to affect the warnings filter list." msgstr "" -#: ../../c-api/sys.rst:257 +#: ../../c-api/sys.rst:258 msgid "Append *unicode* to :data:`sys.warnoptions`." msgstr "" -#: ../../c-api/sys.rst:259 +#: ../../c-api/sys.rst:260 msgid "" "Note: this function is not currently usable from outside the CPython " "implementation, as it must be called prior to the implicit import of :mod:" @@ -310,7 +310,7 @@ msgid "" "Unicode objects." msgstr "" -#: ../../c-api/sys.rst:269 +#: ../../c-api/sys.rst:270 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "module_search_paths` and :c:member:`PyConfig.module_search_paths_set` should " @@ -318,20 +318,20 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/sys.rst:274 +#: ../../c-api/sys.rst:275 msgid "" "Set :data:`sys.path` to a list object of paths found in *path* which should " "be a list of paths separated with the platform's search path delimiter (``:" "`` on Unix, ``;`` on Windows)." msgstr "" -#: ../../c-api/sys.rst:282 +#: ../../c-api/sys.rst:283 msgid "" "Write the output string described by *format* to :data:`sys.stdout`. No " "exceptions are raised, even if truncation occurs (see below)." msgstr "" -#: ../../c-api/sys.rst:285 +#: ../../c-api/sys.rst:286 msgid "" "*format* should limit the total size of the formatted output string to 1000 " "bytes or less -- after 1000 bytes, the output string is truncated. In " @@ -342,58 +342,58 @@ msgid "" "of digits for very large numbers." msgstr "" -#: ../../c-api/sys.rst:293 +#: ../../c-api/sys.rst:294 msgid "" "If a problem occurs, or :data:`sys.stdout` is unset, the formatted message " "is written to the real (C level) *stdout*." msgstr "" -#: ../../c-api/sys.rst:298 +#: ../../c-api/sys.rst:299 msgid "" "As :c:func:`PySys_WriteStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." msgstr "" -#: ../../c-api/sys.rst:303 +#: ../../c-api/sys.rst:304 msgid "" "Function similar to PySys_WriteStdout() but format the message using :c:func:" "`PyUnicode_FromFormatV` and don't truncate the message to an arbitrary " "length." msgstr "" -#: ../../c-api/sys.rst:311 +#: ../../c-api/sys.rst:312 msgid "" "As :c:func:`PySys_FormatStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." msgstr "" -#: ../../c-api/sys.rst:318 +#: ../../c-api/sys.rst:319 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "xoptions` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/sys.rst:322 +#: ../../c-api/sys.rst:323 msgid "" "Parse *s* as a set of :option:`-X` options and add them to the current " "options mapping as returned by :c:func:`PySys_GetXOptions`. This function " "may be called prior to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/sys.rst:332 +#: ../../c-api/sys.rst:333 msgid "" "Return the current dictionary of :option:`-X` options, similarly to :data:" "`sys._xoptions`. On error, ``NULL`` is returned and an exception is set." msgstr "" -#: ../../c-api/sys.rst:341 +#: ../../c-api/sys.rst:342 msgid "" "Raise an auditing event with any active hooks. Return zero for success and " "non-zero with an exception set on failure." msgstr "" -#: ../../c-api/sys.rst:344 +#: ../../c-api/sys.rst:345 msgid "" "If any hooks have been added, *format* and other arguments will be used to " "construct a tuple to pass. Apart from ``N``, the same format characters as " @@ -404,23 +404,23 @@ msgid "" "leaks.)" msgstr "" -#: ../../c-api/sys.rst:352 +#: ../../c-api/sys.rst:353 msgid "" "Note that ``#`` format characters should always be treated as :c:type:" "`Py_ssize_t`, regardless of whether ``PY_SSIZE_T_CLEAN`` was defined." msgstr "" -#: ../../c-api/sys.rst:355 +#: ../../c-api/sys.rst:356 msgid ":func:`sys.audit` performs the same function from Python code." msgstr "" -#: ../../c-api/sys.rst:361 +#: ../../c-api/sys.rst:362 msgid "" "Require :c:type:`Py_ssize_t` for ``#`` format characters. Previously, an " "unavoidable deprecation warning was raised." msgstr "" -#: ../../c-api/sys.rst:367 +#: ../../c-api/sys.rst:368 msgid "" "Append the callable *hook* to the list of active auditing hooks. Return zero " "on success and non-zero on failure. If the runtime has been initialized, " @@ -428,14 +428,14 @@ msgid "" "all interpreters created by the runtime." msgstr "" -#: ../../c-api/sys.rst:373 +#: ../../c-api/sys.rst:374 msgid "" "The *userData* pointer is passed into the hook function. Since hook " "functions may be called from different runtimes, this pointer should not " "refer directly to Python state." msgstr "" -#: ../../c-api/sys.rst:377 +#: ../../c-api/sys.rst:378 msgid "" "This function is safe to call before :c:func:`Py_Initialize`. When called " "after runtime initialization, existing audit hooks are notified and may " @@ -443,7 +443,7 @@ msgid "" "`Exception` (other errors will not be silenced)." msgstr "" -#: ../../c-api/sys.rst:382 +#: ../../c-api/sys.rst:383 msgid "" "The hook function is of type :c:expr:`int (*)(const char *event, PyObject " "*args, void *userData)`, where *args* is guaranteed to be a :c:type:" @@ -451,21 +451,21 @@ msgid "" "Python interpreter that raised the event." msgstr "" -#: ../../c-api/sys.rst:387 +#: ../../c-api/sys.rst:388 msgid "" "See :pep:`578` for a detailed description of auditing. Functions in the " "runtime and standard library that raise events are listed in the :ref:`audit " "events table `. Details are in each function's documentation." msgstr "" -#: ../../c-api/sys.rst:392 +#: ../../c-api/sys.rst:393 msgid "" "Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.addaudithook``。" -#: ../../c-api/sys.rst:394 +#: ../../c-api/sys.rst:395 msgid "" "If the interpreter is initialized, this function raises a auditing event " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " @@ -474,11 +474,11 @@ msgid "" "hook has been added unless they control all existing hooks." msgstr "" -#: ../../c-api/sys.rst:406 +#: ../../c-api/sys.rst:407 msgid "Process Control" -msgstr "行程(Process)控制" +msgstr "行程控制" -#: ../../c-api/sys.rst:413 +#: ../../c-api/sys.rst:414 msgid "" "Print a fatal error message and kill the process. No cleanup is performed. " "This function should only be invoked when a condition is detected that would " @@ -488,29 +488,29 @@ msgid "" "file:`core` file." msgstr "" -#: ../../c-api/sys.rst:420 +#: ../../c-api/sys.rst:421 msgid "" "The ``Py_FatalError()`` function is replaced with a macro which logs " "automatically the name of the current function, unless the " "``Py_LIMITED_API`` macro is defined." msgstr "" -#: ../../c-api/sys.rst:424 +#: ../../c-api/sys.rst:425 msgid "Log the function name automatically." msgstr "" -#: ../../c-api/sys.rst:434 +#: ../../c-api/sys.rst:435 msgid "" "Exit the current process. This calls :c:func:`Py_FinalizeEx` and then calls " "the standard C library function ``exit(status)``. If :c:func:" "`Py_FinalizeEx` indicates an error, the exit status is set to 120." msgstr "" -#: ../../c-api/sys.rst:438 +#: ../../c-api/sys.rst:439 msgid "Errors from finalization no longer ignored." msgstr "" -#: ../../c-api/sys.rst:448 +#: ../../c-api/sys.rst:449 msgid "" "Register a cleanup function to be called by :c:func:`Py_FinalizeEx`. The " "cleanup function will be called with no arguments and should return no " @@ -522,18 +522,18 @@ msgid "" "should be called by *func*." msgstr "" -#: ../../c-api/sys.rst:411 +#: ../../c-api/sys.rst:412 msgid "abort()" msgstr "abort()" -#: ../../c-api/sys.rst:430 ../../c-api/sys.rst:444 +#: ../../c-api/sys.rst:431 ../../c-api/sys.rst:445 msgid "Py_FinalizeEx()" msgstr "Py_FinalizeEx()" -#: ../../c-api/sys.rst:430 +#: ../../c-api/sys.rst:431 msgid "exit()" msgstr "exit()" -#: ../../c-api/sys.rst:444 +#: ../../c-api/sys.rst:445 msgid "cleanup functions" msgstr "cleanup functions(清理函式)" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 5bca8b7244..7b0d0db989 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -579,8 +579,8 @@ msgid "[:c:member:`~PyTypeObject.tp_watched`]" msgstr "[:c:member:`~PyTypeObject.tp_watched`]" #: ../../c-api/typeobj.rst:150 -msgid "char" -msgstr "char" +msgid "unsigned char" +msgstr "unsigned char" #: ../../c-api/typeobj.rst:155 msgid "" @@ -1185,36 +1185,36 @@ msgstr "" #: ../../c-api/typeobj.rst:503 ../../c-api/typeobj.rst:526 #: ../../c-api/typeobj.rst:548 ../../c-api/typeobj.rst:562 #: ../../c-api/typeobj.rst:606 ../../c-api/typeobj.rst:649 -#: ../../c-api/typeobj.rst:707 ../../c-api/typeobj.rst:748 -#: ../../c-api/typeobj.rst:765 ../../c-api/typeobj.rst:782 -#: ../../c-api/typeobj.rst:800 ../../c-api/typeobj.rst:824 -#: ../../c-api/typeobj.rst:841 ../../c-api/typeobj.rst:853 -#: ../../c-api/typeobj.rst:865 ../../c-api/typeobj.rst:898 -#: ../../c-api/typeobj.rst:916 ../../c-api/typeobj.rst:936 -#: ../../c-api/typeobj.rst:957 ../../c-api/typeobj.rst:983 -#: ../../c-api/typeobj.rst:1002 ../../c-api/typeobj.rst:1018 -#: ../../c-api/typeobj.rst:1056 ../../c-api/typeobj.rst:1067 -#: ../../c-api/typeobj.rst:1077 ../../c-api/typeobj.rst:1087 -#: ../../c-api/typeobj.rst:1101 ../../c-api/typeobj.rst:1119 -#: ../../c-api/typeobj.rst:1142 ../../c-api/typeobj.rst:1157 -#: ../../c-api/typeobj.rst:1170 ../../c-api/typeobj.rst:1192 -#: ../../c-api/typeobj.rst:1236 ../../c-api/typeobj.rst:1257 -#: ../../c-api/typeobj.rst:1276 ../../c-api/typeobj.rst:1306 -#: ../../c-api/typeobj.rst:1328 ../../c-api/typeobj.rst:1354 -#: ../../c-api/typeobj.rst:1422 ../../c-api/typeobj.rst:1489 -#: ../../c-api/typeobj.rst:1550 ../../c-api/typeobj.rst:1586 -#: ../../c-api/typeobj.rst:1611 ../../c-api/typeobj.rst:1634 -#: ../../c-api/typeobj.rst:1647 ../../c-api/typeobj.rst:1662 -#: ../../c-api/typeobj.rst:1676 ../../c-api/typeobj.rst:1706 -#: ../../c-api/typeobj.rst:1738 ../../c-api/typeobj.rst:1764 -#: ../../c-api/typeobj.rst:1782 ../../c-api/typeobj.rst:1811 -#: ../../c-api/typeobj.rst:1855 ../../c-api/typeobj.rst:1872 -#: ../../c-api/typeobj.rst:1913 ../../c-api/typeobj.rst:1935 -#: ../../c-api/typeobj.rst:1967 ../../c-api/typeobj.rst:1995 -#: ../../c-api/typeobj.rst:2008 ../../c-api/typeobj.rst:2018 -#: ../../c-api/typeobj.rst:2035 ../../c-api/typeobj.rst:2052 -#: ../../c-api/typeobj.rst:2066 ../../c-api/typeobj.rst:2112 -#: ../../c-api/typeobj.rst:2135 +#: ../../c-api/typeobj.rst:708 ../../c-api/typeobj.rst:749 +#: ../../c-api/typeobj.rst:766 ../../c-api/typeobj.rst:783 +#: ../../c-api/typeobj.rst:801 ../../c-api/typeobj.rst:825 +#: ../../c-api/typeobj.rst:842 ../../c-api/typeobj.rst:854 +#: ../../c-api/typeobj.rst:866 ../../c-api/typeobj.rst:899 +#: ../../c-api/typeobj.rst:917 ../../c-api/typeobj.rst:937 +#: ../../c-api/typeobj.rst:958 ../../c-api/typeobj.rst:984 +#: ../../c-api/typeobj.rst:1003 ../../c-api/typeobj.rst:1019 +#: ../../c-api/typeobj.rst:1057 ../../c-api/typeobj.rst:1068 +#: ../../c-api/typeobj.rst:1078 ../../c-api/typeobj.rst:1088 +#: ../../c-api/typeobj.rst:1102 ../../c-api/typeobj.rst:1120 +#: ../../c-api/typeobj.rst:1143 ../../c-api/typeobj.rst:1158 +#: ../../c-api/typeobj.rst:1171 ../../c-api/typeobj.rst:1193 +#: ../../c-api/typeobj.rst:1237 ../../c-api/typeobj.rst:1258 +#: ../../c-api/typeobj.rst:1277 ../../c-api/typeobj.rst:1307 +#: ../../c-api/typeobj.rst:1329 ../../c-api/typeobj.rst:1355 +#: ../../c-api/typeobj.rst:1423 ../../c-api/typeobj.rst:1491 +#: ../../c-api/typeobj.rst:1552 ../../c-api/typeobj.rst:1588 +#: ../../c-api/typeobj.rst:1613 ../../c-api/typeobj.rst:1636 +#: ../../c-api/typeobj.rst:1649 ../../c-api/typeobj.rst:1664 +#: ../../c-api/typeobj.rst:1678 ../../c-api/typeobj.rst:1708 +#: ../../c-api/typeobj.rst:1740 ../../c-api/typeobj.rst:1766 +#: ../../c-api/typeobj.rst:1784 ../../c-api/typeobj.rst:1813 +#: ../../c-api/typeobj.rst:1857 ../../c-api/typeobj.rst:1874 +#: ../../c-api/typeobj.rst:1915 ../../c-api/typeobj.rst:1937 +#: ../../c-api/typeobj.rst:1969 ../../c-api/typeobj.rst:1997 +#: ../../c-api/typeobj.rst:2010 ../../c-api/typeobj.rst:2020 +#: ../../c-api/typeobj.rst:2037 ../../c-api/typeobj.rst:2054 +#: ../../c-api/typeobj.rst:2068 ../../c-api/typeobj.rst:2114 +#: ../../c-api/typeobj.rst:2137 msgid "**Inheritance:**" msgstr "" @@ -1243,12 +1243,12 @@ msgid "" "class. :c:func:`PyType_Ready` will not change this field if it is non-zero." msgstr "" -#: ../../c-api/typeobj.rst:528 ../../c-api/typeobj.rst:709 -#: ../../c-api/typeobj.rst:826 ../../c-api/typeobj.rst:918 -#: ../../c-api/typeobj.rst:938 ../../c-api/typeobj.rst:1613 -#: ../../c-api/typeobj.rst:1636 ../../c-api/typeobj.rst:1766 -#: ../../c-api/typeobj.rst:1784 ../../c-api/typeobj.rst:1857 -#: ../../c-api/typeobj.rst:1969 ../../c-api/typeobj.rst:2114 +#: ../../c-api/typeobj.rst:528 ../../c-api/typeobj.rst:710 +#: ../../c-api/typeobj.rst:827 ../../c-api/typeobj.rst:919 +#: ../../c-api/typeobj.rst:939 ../../c-api/typeobj.rst:1615 +#: ../../c-api/typeobj.rst:1638 ../../c-api/typeobj.rst:1768 +#: ../../c-api/typeobj.rst:1786 ../../c-api/typeobj.rst:1859 +#: ../../c-api/typeobj.rst:1971 ../../c-api/typeobj.rst:2116 msgid "This field is inherited by subtypes." msgstr "" @@ -1448,33 +1448,33 @@ msgstr "" #: ../../c-api/typeobj.rst:692 msgid "" "Finally, if the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the " -"deallocator should decrement the reference count for its type object after " -"calling the type deallocator. In order to avoid dangling pointers, the " -"recommended way to achieve this is:" +"deallocator should release the owned reference to its type object (via :c:" +"func:`Py_DECREF`) after calling the type deallocator. In order to avoid " +"dangling pointers, the recommended way to achieve this is:" msgstr "" -#: ../../c-api/typeobj.rst:714 +#: ../../c-api/typeobj.rst:715 msgid "" "An optional offset to a per-instance function that implements calling the " "object using the :ref:`vectorcall protocol `, a more efficient " "alternative of the simpler :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:719 +#: ../../c-api/typeobj.rst:720 msgid "" "This field is only used if the flag :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` is " "set. If so, this must be a positive integer containing the offset in the " "instance of a :c:type:`vectorcallfunc` pointer." msgstr "" -#: ../../c-api/typeobj.rst:723 +#: ../../c-api/typeobj.rst:724 msgid "" "The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " "behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " "instance falls back to :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:727 +#: ../../c-api/typeobj.rst:728 msgid "" "Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:" "`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the " @@ -1482,13 +1482,13 @@ msgid "" "`PyVectorcall_Call`." msgstr "" -#: ../../c-api/typeobj.rst:734 +#: ../../c-api/typeobj.rst:735 msgid "" "Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " "used for printing to a file. In Python 3.0 to 3.7, it was unused." msgstr "" -#: ../../c-api/typeobj.rst:740 +#: ../../c-api/typeobj.rst:741 msgid "" "Before version 3.12, it was not recommended for :ref:`mutable heap types " "` to implement the vectorcall protocol. When a user sets :attr:" @@ -1498,7 +1498,7 @@ msgid "" "`Py_TPFLAGS_HAVE_VECTORCALL` flag." msgstr "" -#: ../../c-api/typeobj.rst:750 +#: ../../c-api/typeobj.rst:751 msgid "" "This field is always inherited. However, the :c:macro:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not set, " @@ -1506,11 +1506,11 @@ msgid "" "func:`PyVectorcall_Call` is explicitly called." msgstr "" -#: ../../c-api/typeobj.rst:759 +#: ../../c-api/typeobj.rst:760 msgid "An optional pointer to the get-attribute-string function." msgstr "" -#: ../../c-api/typeobj.rst:761 +#: ../../c-api/typeobj.rst:762 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, " @@ -1518,7 +1518,7 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:767 ../../c-api/typeobj.rst:959 +#: ../../c-api/typeobj.rst:768 ../../c-api/typeobj.rst:960 msgid "" "Group: :c:member:`~PyTypeObject.tp_getattr`, :c:member:`~PyTypeObject." "tp_getattro`" @@ -1526,7 +1526,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_getattr`、:c:member:`~PyTypeObject." "tp_getattro`" -#: ../../c-api/typeobj.rst:769 +#: ../../c-api/typeobj.rst:770 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1535,12 +1535,12 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:776 ../../c-api/typeobj.rst:972 +#: ../../c-api/typeobj.rst:777 ../../c-api/typeobj.rst:973 msgid "" "An optional pointer to the function for setting and deleting attributes." msgstr "" -#: ../../c-api/typeobj.rst:778 +#: ../../c-api/typeobj.rst:779 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, " @@ -1548,7 +1548,7 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:784 ../../c-api/typeobj.rst:985 +#: ../../c-api/typeobj.rst:785 ../../c-api/typeobj.rst:986 msgid "" "Group: :c:member:`~PyTypeObject.tp_setattr`, :c:member:`~PyTypeObject." "tp_setattro`" @@ -1556,7 +1556,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_setattr`、:c:member:`~PyTypeObject." "tp_setattro`" -#: ../../c-api/typeobj.rst:786 +#: ../../c-api/typeobj.rst:787 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1565,34 +1565,34 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:793 +#: ../../c-api/typeobj.rst:794 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement :term:`awaitable` and :term:`asynchronous iterator` " "protocols at the C-level. See :ref:`async-structs` for details." msgstr "" -#: ../../c-api/typeobj.rst:797 +#: ../../c-api/typeobj.rst:798 msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." msgstr "" -#: ../../c-api/typeobj.rst:802 +#: ../../c-api/typeobj.rst:803 msgid "" "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:810 +#: ../../c-api/typeobj.rst:811 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`repr`." msgstr "" -#: ../../c-api/typeobj.rst:813 +#: ../../c-api/typeobj.rst:814 msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "" -#: ../../c-api/typeobj.rst:817 +#: ../../c-api/typeobj.rst:818 msgid "" "The function must return a string or a Unicode object. Ideally, this " "function should return a string that, when passed to :func:`eval`, given a " @@ -1601,81 +1601,81 @@ msgid "" "``'>'`` from which both the type and the value of the object can be deduced." msgstr "" -#: ../../c-api/typeobj.rst:828 ../../c-api/typeobj.rst:940 -#: ../../c-api/typeobj.rst:965 ../../c-api/typeobj.rst:991 -#: ../../c-api/typeobj.rst:1032 ../../c-api/typeobj.rst:1559 -#: ../../c-api/typeobj.rst:1593 ../../c-api/typeobj.rst:1710 -#: ../../c-api/typeobj.rst:1743 ../../c-api/typeobj.rst:1818 -#: ../../c-api/typeobj.rst:1859 ../../c-api/typeobj.rst:1877 -#: ../../c-api/typeobj.rst:1919 ../../c-api/typeobj.rst:1940 -#: ../../c-api/typeobj.rst:1971 +#: ../../c-api/typeobj.rst:829 ../../c-api/typeobj.rst:941 +#: ../../c-api/typeobj.rst:966 ../../c-api/typeobj.rst:992 +#: ../../c-api/typeobj.rst:1033 ../../c-api/typeobj.rst:1561 +#: ../../c-api/typeobj.rst:1595 ../../c-api/typeobj.rst:1712 +#: ../../c-api/typeobj.rst:1745 ../../c-api/typeobj.rst:1820 +#: ../../c-api/typeobj.rst:1861 ../../c-api/typeobj.rst:1879 +#: ../../c-api/typeobj.rst:1921 ../../c-api/typeobj.rst:1942 +#: ../../c-api/typeobj.rst:1973 msgid "**Default:**" msgstr "**預設:**" -#: ../../c-api/typeobj.rst:830 +#: ../../c-api/typeobj.rst:831 msgid "" "When this field is not set, a string of the form ``<%s object at %p>`` is " "returned, where ``%s`` is replaced by the type name, and ``%p`` by the " "object's memory address." msgstr "" -#: ../../c-api/typeobj.rst:837 +#: ../../c-api/typeobj.rst:838 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the number protocol. These fields are documented " "in :ref:`number-structs`." msgstr "" -#: ../../c-api/typeobj.rst:843 +#: ../../c-api/typeobj.rst:844 msgid "" "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:849 +#: ../../c-api/typeobj.rst:850 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the sequence protocol. These fields are documented " "in :ref:`sequence-structs`." msgstr "" -#: ../../c-api/typeobj.rst:855 +#: ../../c-api/typeobj.rst:856 msgid "" "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:861 +#: ../../c-api/typeobj.rst:862 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the mapping protocol. These fields are documented " "in :ref:`mapping-structs`." msgstr "" -#: ../../c-api/typeobj.rst:867 +#: ../../c-api/typeobj.rst:868 msgid "" "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:875 +#: ../../c-api/typeobj.rst:876 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`hash`." msgstr "" -#: ../../c-api/typeobj.rst:878 +#: ../../c-api/typeobj.rst:879 msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "" -#: ../../c-api/typeobj.rst:882 +#: ../../c-api/typeobj.rst:883 msgid "" "The value ``-1`` should not be returned as a normal return value; when an " "error occurs during the computation of the hash value, the function should " "set an exception and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:886 +#: ../../c-api/typeobj.rst:887 msgid "" "When this field is not set (*and* :c:member:`~PyTypeObject.tp_richcompare` " "is not set), an attempt to take the hash of the object raises :exc:" @@ -1683,7 +1683,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:890 +#: ../../c-api/typeobj.rst:891 msgid "" "This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to " "block inheritance of the hash method from a parent type. This is interpreted " @@ -1694,7 +1694,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:900 ../../c-api/typeobj.rst:1552 +#: ../../c-api/typeobj.rst:901 ../../c-api/typeobj.rst:1554 msgid "" "Group: :c:member:`~PyTypeObject.tp_hash`, :c:member:`~PyTypeObject." "tp_richcompare`" @@ -1702,7 +1702,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_hash`、:c:member:`~PyTypeObject." "tp_richcompare`" -#: ../../c-api/typeobj.rst:902 +#: ../../c-api/typeobj.rst:903 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." @@ -1711,14 +1711,14 @@ msgid "" "are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:910 +#: ../../c-api/typeobj.rst:911 msgid "" "An optional pointer to a function that implements calling the object. This " "should be ``NULL`` if the object is not callable. The signature is the same " "as for :c:func:`PyObject_Call`::" msgstr "" -#: ../../c-api/typeobj.rst:923 +#: ../../c-api/typeobj.rst:924 msgid "" "An optional pointer to a function that implements the built-in operation :" "func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls " @@ -1727,11 +1727,11 @@ msgid "" "this handler.)" msgstr "" -#: ../../c-api/typeobj.rst:928 +#: ../../c-api/typeobj.rst:929 msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "" -#: ../../c-api/typeobj.rst:932 +#: ../../c-api/typeobj.rst:933 msgid "" "The function must return a string or a Unicode object. It should be a " "\"friendly\" string representation of the object, as this is the " @@ -1739,28 +1739,28 @@ msgid "" "function." msgstr "" -#: ../../c-api/typeobj.rst:942 +#: ../../c-api/typeobj.rst:943 msgid "" "When this field is not set, :c:func:`PyObject_Repr` is called to return a " "string representation." msgstr "" -#: ../../c-api/typeobj.rst:948 +#: ../../c-api/typeobj.rst:949 msgid "An optional pointer to the get-attribute function." msgstr "" -#: ../../c-api/typeobj.rst:950 +#: ../../c-api/typeobj.rst:951 msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:954 +#: ../../c-api/typeobj.rst:955 msgid "" "It is usually convenient to set this field to :c:func:" "`PyObject_GenericGetAttr`, which implements the normal way of looking for " "object attributes." msgstr "" -#: ../../c-api/typeobj.rst:961 +#: ../../c-api/typeobj.rst:962 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1769,15 +1769,15 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:967 +#: ../../c-api/typeobj.rst:968 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:974 +#: ../../c-api/typeobj.rst:975 msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:978 +#: ../../c-api/typeobj.rst:979 msgid "" "In addition, setting *value* to ``NULL`` to delete an attribute must be " "supported. It is usually convenient to set this field to :c:func:" @@ -1785,7 +1785,7 @@ msgid "" "attributes." msgstr "" -#: ../../c-api/typeobj.rst:987 +#: ../../c-api/typeobj.rst:988 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1794,24 +1794,24 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:993 +#: ../../c-api/typeobj.rst:994 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:998 +#: ../../c-api/typeobj.rst:999 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the buffer interface. These fields are documented " "in :ref:`buffer-structs`." msgstr "" -#: ../../c-api/typeobj.rst:1004 +#: ../../c-api/typeobj.rst:1005 msgid "" "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:1010 +#: ../../c-api/typeobj.rst:1011 msgid "" "This field is a bit mask of various flags. Some flags indicate variant " "semantics for certain situations; others are used to indicate that certain " @@ -1823,7 +1823,7 @@ msgid "" "accessed and must be considered to have a zero or ``NULL`` value instead." msgstr "" -#: ../../c-api/typeobj.rst:1020 +#: ../../c-api/typeobj.rst:1021 msgid "" "Inheritance of this field is complicated. Most flag bits are inherited " "individually, i.e. if the base type has a flag bit set, the subtype inherits " @@ -1839,17 +1839,17 @@ msgid "" "*really* inherited individually?" msgstr "" -#: ../../c-api/typeobj.rst:1034 +#: ../../c-api/typeobj.rst:1035 msgid "" ":c:data:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." msgstr "" -#: ../../c-api/typeobj.rst:1037 +#: ../../c-api/typeobj.rst:1038 msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1041 +#: ../../c-api/typeobj.rst:1042 msgid "" "The following bit masks are currently defined; these can be ORed together " "using the ``|`` operator to form the value of the :c:member:`~PyTypeObject." @@ -1858,7 +1858,7 @@ msgid "" "zero." msgstr "" -#: ../../c-api/typeobj.rst:1048 +#: ../../c-api/typeobj.rst:1049 msgid "" "This bit is set when the type object itself is allocated on the heap, for " "example, types created dynamically using :c:func:`PyType_FromSpec`. In this " @@ -1869,32 +1869,32 @@ msgid "" "instance's ob_type gets INCREF'ed or DECREF'ed)." msgstr "" -#: ../../c-api/typeobj.rst:1058 ../../c-api/typeobj.rst:1069 -#: ../../c-api/typeobj.rst:1079 ../../c-api/typeobj.rst:1089 -#: ../../c-api/typeobj.rst:1121 +#: ../../c-api/typeobj.rst:1059 ../../c-api/typeobj.rst:1070 +#: ../../c-api/typeobj.rst:1080 ../../c-api/typeobj.rst:1090 +#: ../../c-api/typeobj.rst:1122 msgid "???" msgstr "" -#: ../../c-api/typeobj.rst:1063 +#: ../../c-api/typeobj.rst:1064 msgid "" "This bit is set when the type can be used as the base type of another type. " "If this bit is clear, the type cannot be subtyped (similar to a \"final\" " "class in Java)." msgstr "" -#: ../../c-api/typeobj.rst:1074 +#: ../../c-api/typeobj.rst:1075 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1084 +#: ../../c-api/typeobj.rst:1085 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: ../../c-api/typeobj.rst:1094 +#: ../../c-api/typeobj.rst:1095 msgid "" "This bit is set when the object supports garbage collection. If this bit is " "set, instances must be created using :c:macro:`PyObject_GC_New` and " @@ -1904,14 +1904,14 @@ msgid "" "tp_clear` are present in the type object." msgstr "" -#: ../../c-api/typeobj.rst:1103 ../../c-api/typeobj.rst:1424 -#: ../../c-api/typeobj.rst:1491 +#: ../../c-api/typeobj.rst:1104 ../../c-api/typeobj.rst:1425 +#: ../../c-api/typeobj.rst:1493 msgid "" "Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject." "tp_traverse`, :c:member:`~PyTypeObject.tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1105 +#: ../../c-api/typeobj.rst:1106 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :c:" "member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` " @@ -1921,99 +1921,99 @@ msgid "" "values." msgstr "" -#: ../../c-api/typeobj.rst:1115 +#: ../../c-api/typeobj.rst:1116 msgid "" "This is a bitmask of all the bits that pertain to the existence of certain " "fields in the type object and its extension structures. Currently, it " "includes the following bits: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgstr "" -#: ../../c-api/typeobj.rst:1126 +#: ../../c-api/typeobj.rst:1127 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1128 +#: ../../c-api/typeobj.rst:1129 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: ../../c-api/typeobj.rst:1130 +#: ../../c-api/typeobj.rst:1131 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1133 +#: ../../c-api/typeobj.rst:1134 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1136 +#: ../../c-api/typeobj.rst:1137 msgid "" "This flag enables an optimization for typical method calls like ``obj." "meth()``: it avoids creating a temporary \"bound method\" object for ``obj." "meth``." msgstr "" -#: ../../c-api/typeobj.rst:1144 +#: ../../c-api/typeobj.rst:1145 msgid "" "This flag is never inherited by types without the :c:macro:" "`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited " "whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1150 +#: ../../c-api/typeobj.rst:1151 msgid "" "This bit indicates that instances of the class have a ``__dict__`` " "attribute, and that the space for the dictionary is managed by the VM." msgstr "" -#: ../../c-api/typeobj.rst:1153 +#: ../../c-api/typeobj.rst:1154 msgid "If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set." msgstr "" -#: ../../c-api/typeobj.rst:1159 +#: ../../c-api/typeobj.rst:1160 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` " "field is set in a superclass." msgstr "" -#: ../../c-api/typeobj.rst:1165 +#: ../../c-api/typeobj.rst:1166 msgid "" "This bit indicates that instances of the class should be weakly " "referenceable." msgstr "" -#: ../../c-api/typeobj.rst:1172 +#: ../../c-api/typeobj.rst:1173 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject." "tp_weaklistoffset` field is set in a superclass." msgstr "" -#: ../../c-api/typeobj.rst:1178 +#: ../../c-api/typeobj.rst:1179 msgid "" "Only usable with variable-size types, i.e. ones with non-zero :c:member:" "`~PyTypeObject.tp_itemsize`." msgstr "" -#: ../../c-api/typeobj.rst:1181 +#: ../../c-api/typeobj.rst:1182 msgid "" "Indicates that the variable-sized portion of an instance of this type is at " "the end of the instance's memory area, at an offset of ``Py_TYPE(obj)-" ">tp_basicsize`` (which may be different in each subclass)." msgstr "" -#: ../../c-api/typeobj.rst:1186 +#: ../../c-api/typeobj.rst:1187 msgid "" "When setting this flag, be sure that all superclasses either use this memory " "layout, or are not variable-sized. Python does not check this." msgstr "" -#: ../../c-api/typeobj.rst:1194 +#: ../../c-api/typeobj.rst:1195 msgid "This flag is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1208 +#: ../../c-api/typeobj.rst:1209 msgid "" "These flags are used by functions such as :c:func:`PyLong_Check` to quickly " "determine if a type is a subclass of a built-in type; such specific checks " @@ -2023,90 +2023,90 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: ../../c-api/typeobj.rst:1219 +#: ../../c-api/typeobj.rst:1220 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1224 +#: ../../c-api/typeobj.rst:1225 msgid "" "This flag isn't necessary anymore, as the interpreter assumes the :c:member:" "`~PyTypeObject.tp_finalize` slot is always present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1232 +#: ../../c-api/typeobj.rst:1233 msgid "" "This bit is set when the class implements the :ref:`vectorcall protocol " "`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for " "details." msgstr "" -#: ../../c-api/typeobj.rst:1238 +#: ../../c-api/typeobj.rst:1239 msgid "" "This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited." msgstr "" -#: ../../c-api/typeobj.rst:1245 +#: ../../c-api/typeobj.rst:1246 msgid "" "This flag is now removed from a class when the class's :py:meth:`~object." "__call__` method is reassigned." msgstr "" -#: ../../c-api/typeobj.rst:1248 +#: ../../c-api/typeobj.rst:1249 msgid "This flag can now be inherited by mutable classes." msgstr "" -#: ../../c-api/typeobj.rst:1252 +#: ../../c-api/typeobj.rst:1253 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: ../../c-api/typeobj.rst:1254 +#: ../../c-api/typeobj.rst:1255 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: ../../c-api/typeobj.rst:1259 +#: ../../c-api/typeobj.rst:1260 msgid "This flag is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1265 +#: ../../c-api/typeobj.rst:1266 msgid "" "Disallow creating instances of the type: set :c:member:`~PyTypeObject." "tp_new` to NULL and don't create the ``__new__`` key in the type dictionary." msgstr "" -#: ../../c-api/typeobj.rst:1269 +#: ../../c-api/typeobj.rst:1270 msgid "" "The flag must be set before creating the type, not after. For example, it " "must be set before :c:func:`PyType_Ready` is called on the type." msgstr "" -#: ../../c-api/typeobj.rst:1272 +#: ../../c-api/typeobj.rst:1273 msgid "" "The flag is set automatically on :ref:`static types ` if :c:" "member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:" "member:`~PyTypeObject.tp_new` is NULL." msgstr "" -#: ../../c-api/typeobj.rst:1278 +#: ../../c-api/typeobj.rst:1279 msgid "" "This flag is not inherited. However, subclasses will not be instantiable " "unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " "only possible via the C API)." msgstr "" -#: ../../c-api/typeobj.rst:1285 +#: ../../c-api/typeobj.rst:1286 msgid "" "To disallow instantiating a class directly but allow instantiating its " "subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " "Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1296 +#: ../../c-api/typeobj.rst:1297 msgid "" "This bit indicates that instances of the class may match mapping patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2114,23 +2114,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: ../../c-api/typeobj.rst:1303 ../../c-api/typeobj.rst:1325 +#: ../../c-api/typeobj.rst:1304 ../../c-api/typeobj.rst:1326 msgid "" ":c:macro:`Py_TPFLAGS_MAPPING` and :c:macro:`Py_TPFLAGS_SEQUENCE` are " "mutually exclusive; it is an error to enable both flags simultaneously." msgstr "" -#: ../../c-api/typeobj.rst:1308 +#: ../../c-api/typeobj.rst:1309 msgid "" "This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: ../../c-api/typeobj.rst:1311 ../../c-api/typeobj.rst:1333 +#: ../../c-api/typeobj.rst:1312 ../../c-api/typeobj.rst:1334 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../c-api/typeobj.rst:1318 +#: ../../c-api/typeobj.rst:1319 msgid "" "This bit indicates that instances of the class may match sequence patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2138,49 +2138,49 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: ../../c-api/typeobj.rst:1330 +#: ../../c-api/typeobj.rst:1331 msgid "" "This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: ../../c-api/typeobj.rst:1340 +#: ../../c-api/typeobj.rst:1341 msgid "" "Internal. Do not set or unset this flag. To indicate that a class has " "changed call :c:func:`PyType_Modified`" msgstr "" -#: ../../c-api/typeobj.rst:1344 +#: ../../c-api/typeobj.rst:1345 msgid "" "This flag is present in header files, but is an internal feature and should " "not be used. It will be removed in a future version of CPython" msgstr "" -#: ../../c-api/typeobj.rst:1350 +#: ../../c-api/typeobj.rst:1351 msgid "" "An optional pointer to a NUL-terminated C string giving the docstring for " "this type object. This is exposed as the :attr:`__doc__` attribute on the " "type and instances of the type." msgstr "" -#: ../../c-api/typeobj.rst:1356 +#: ../../c-api/typeobj.rst:1357 msgid "This field is *not* inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:1361 +#: ../../c-api/typeobj.rst:1362 msgid "" "An optional pointer to a traversal function for the garbage collector. This " "is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1366 ../../c-api/typeobj.rst:1486 +#: ../../c-api/typeobj.rst:1367 ../../c-api/typeobj.rst:1488 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1369 +#: ../../c-api/typeobj.rst:1370 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2190,7 +2190,7 @@ msgid "" "`!_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1384 +#: ../../c-api/typeobj.rst:1385 msgid "" "Note that :c:func:`Py_VISIT` is called only on those members that can " "participate in reference cycles. Although there is also a ``self->key`` " @@ -2198,14 +2198,14 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../c-api/typeobj.rst:1388 +#: ../../c-api/typeobj.rst:1389 msgid "" "On the other hand, even if you know a member can never be part of a cycle, " "as a debugging aid you may want to visit it anyway just so the :mod:`gc` " "module's :func:`~gc.get_referents` function will include it." msgstr "" -#: ../../c-api/typeobj.rst:1393 +#: ../../c-api/typeobj.rst:1394 msgid "" "When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members " "that the instance *owns* (by having :term:`strong references ` hold a reference to " "their type. Their traversal function must therefore either visit :c:func:" @@ -2234,14 +2234,14 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1417 +#: ../../c-api/typeobj.rst:1418 msgid "" "Heap-allocated types are expected to visit ``Py_TYPE(self)`` in " "``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1426 +#: ../../c-api/typeobj.rst:1427 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2249,14 +2249,14 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1434 +#: ../../c-api/typeobj.rst:1435 msgid "" "An optional pointer to a clear function for the garbage collector. This is " "only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1439 +#: ../../c-api/typeobj.rst:1440 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " "reference cycles in cyclic garbage detected by the garbage collector. Taken " @@ -2271,7 +2271,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1449 +#: ../../c-api/typeobj.rst:1450 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2279,22 +2279,22 @@ msgid "" "example::" msgstr "" -#: ../../c-api/typeobj.rst:1463 +#: ../../c-api/typeobj.rst:1464 msgid "" "The :c:func:`Py_CLEAR` macro should be used, because clearing references is " -"delicate: the reference to the contained object must not be decremented " -"until after the pointer to the contained object is set to ``NULL``. This is " -"because decrementing the reference count may cause the contained object to " -"become trash, triggering a chain of reclamation activity that may include " -"invoking arbitrary Python code (due to finalizers, or weakref callbacks, " -"associated with the contained object). If it's possible for such code to " -"reference *self* again, it's important that the pointer to the contained " -"object be ``NULL`` at that time, so that *self* knows the contained object " -"can no longer be used. The :c:func:`Py_CLEAR` macro performs the operations " -"in a safe order." +"delicate: the reference to the contained object must not be released (via :" +"c:func:`Py_DECREF`) until after the pointer to the contained object is set " +"to ``NULL``. This is because releasing the reference may cause the " +"contained object to become trash, triggering a chain of reclamation activity " +"that may include invoking arbitrary Python code (due to finalizers, or " +"weakref callbacks, associated with the contained object). If it's possible " +"for such code to reference *self* again, it's important that the pointer to " +"the contained object be ``NULL`` at that time, so that *self* knows the " +"contained object can no longer be used. The :c:func:`Py_CLEAR` macro " +"performs the operations in a safe order." msgstr "" -#: ../../c-api/typeobj.rst:1474 +#: ../../c-api/typeobj.rst:1476 msgid "" "Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " "an instance is deallocated. For example, when reference counting is enough " @@ -2302,7 +2302,7 @@ msgid "" "is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." msgstr "" -#: ../../c-api/typeobj.rst:1480 +#: ../../c-api/typeobj.rst:1482 msgid "" "Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break " "reference cycles, it's not necessary to clear contained objects like Python " @@ -2312,7 +2312,7 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1493 +#: ../../c-api/typeobj.rst:1495 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :" @@ -2320,18 +2320,18 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1501 +#: ../../c-api/typeobj.rst:1503 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1505 +#: ../../c-api/typeobj.rst:1507 msgid "" "The first parameter is guaranteed to be an instance of the type that is " "defined by :c:type:`PyTypeObject`." msgstr "" -#: ../../c-api/typeobj.rst:1508 +#: ../../c-api/typeobj.rst:1510 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2339,50 +2339,50 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1513 +#: ../../c-api/typeobj.rst:1515 msgid "" "The following constants are defined to be used as the third argument for :c:" "member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" msgstr "" -#: ../../c-api/typeobj.rst:1519 +#: ../../c-api/typeobj.rst:1521 msgid "Constant" msgstr "常數" -#: ../../c-api/typeobj.rst:1519 +#: ../../c-api/typeobj.rst:1521 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1521 +#: ../../c-api/typeobj.rst:1523 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1523 +#: ../../c-api/typeobj.rst:1525 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1525 +#: ../../c-api/typeobj.rst:1527 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1527 +#: ../../c-api/typeobj.rst:1529 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1529 +#: ../../c-api/typeobj.rst:1531 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1531 +#: ../../c-api/typeobj.rst:1533 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1534 +#: ../../c-api/typeobj.rst:1536 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1538 +#: ../../c-api/typeobj.rst:1540 msgid "" "Return ``Py_True`` or ``Py_False`` from the function, depending on the " "result of a comparison. VAL_A and VAL_B must be orderable by C comparison " @@ -2390,15 +2390,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1544 -msgid "The return value's reference count is properly incremented." +#: ../../c-api/typeobj.rst:1546 +msgid "The returned value is a new :term:`strong reference`." msgstr "" -#: ../../c-api/typeobj.rst:1546 +#: ../../c-api/typeobj.rst:1548 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1554 +#: ../../c-api/typeobj.rst:1556 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2406,7 +2406,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1561 +#: ../../c-api/typeobj.rst:1563 msgid "" ":c:data:`PyBaseObject_Type` provides a :c:member:`~PyTypeObject." "tp_richcompare` implementation, which may be inherited. However, if only :c:" @@ -2415,13 +2415,13 @@ msgid "" "comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1570 +#: ../../c-api/typeobj.rst:1572 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` " "should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:1573 +#: ../../c-api/typeobj.rst:1575 msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " @@ -2431,19 +2431,19 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1580 +#: ../../c-api/typeobj.rst:1582 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " "is the list head for weak references to the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1583 +#: ../../c-api/typeobj.rst:1585 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " "and :c:member:`~PyTypeObject.tp_weaklist`." msgstr "" -#: ../../c-api/typeobj.rst:1588 +#: ../../c-api/typeobj.rst:1590 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype uses a " @@ -2452,7 +2452,7 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1595 +#: ../../c-api/typeobj.rst:1597 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" "`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject." @@ -2460,24 +2460,24 @@ msgid "" "unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1603 +#: ../../c-api/typeobj.rst:1605 msgid "" "An optional pointer to a function that returns an :term:`iterator` for the " "object. Its presence normally signals that the instances of this type are :" "term:`iterable` (although sequences may be iterable without this function)." msgstr "" -#: ../../c-api/typeobj.rst:1607 +#: ../../c-api/typeobj.rst:1609 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1618 +#: ../../c-api/typeobj.rst:1620 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1623 +#: ../../c-api/typeobj.rst:1625 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2485,74 +2485,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1628 +#: ../../c-api/typeobj.rst:1630 msgid "" "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " "function, and that function should return the iterator instance itself (not " "a new iterator instance)." msgstr "" -#: ../../c-api/typeobj.rst:1632 +#: ../../c-api/typeobj.rst:1634 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1641 +#: ../../c-api/typeobj.rst:1643 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMethodDef` structures, declaring regular methods of this type." msgstr "" -#: ../../c-api/typeobj.rst:1644 +#: ../../c-api/typeobj.rst:1646 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1649 +#: ../../c-api/typeobj.rst:1651 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1655 +#: ../../c-api/typeobj.rst:1657 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMemberDef` structures, declaring regular data members (fields or slots) " "of instances of this type." msgstr "" -#: ../../c-api/typeobj.rst:1659 +#: ../../c-api/typeobj.rst:1661 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1664 +#: ../../c-api/typeobj.rst:1666 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1670 +#: ../../c-api/typeobj.rst:1672 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyGetSetDef` structures, declaring computed attributes of instances of this " "type." msgstr "" -#: ../../c-api/typeobj.rst:1673 +#: ../../c-api/typeobj.rst:1675 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1678 +#: ../../c-api/typeobj.rst:1680 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1684 +#: ../../c-api/typeobj.rst:1686 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2560,7 +2560,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1692 +#: ../../c-api/typeobj.rst:1694 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2568,35 +2568,35 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1697 +#: ../../c-api/typeobj.rst:1699 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" -"func:`PyBaseObject_Type` is not required to produce an address constant. " +"data:`PyBaseObject_Type` is not required to produce an address constant. " "Compilers may support this (gcc does), MSVC does not. Both compilers are " "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1703 +#: ../../c-api/typeobj.rst:1705 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1708 +#: ../../c-api/typeobj.rst:1710 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1712 +#: ../../c-api/typeobj.rst:1714 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1718 +#: ../../c-api/typeobj.rst:1720 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1720 +#: ../../c-api/typeobj.rst:1722 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -2607,64 +2607,64 @@ msgid "" "be treated as read-only." msgstr "" -#: ../../c-api/typeobj.rst:1728 +#: ../../c-api/typeobj.rst:1730 msgid "" "Some types may not store their dictionary in this slot. Use :c:func:" "`PyType_GetDict` to retreive the dictionary for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1734 +#: ../../c-api/typeobj.rst:1736 msgid "" "Internals detail: For static builtin types, this is always ``NULL``. " "Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:" "func:`PyType_GetDict` to get the dict for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1740 +#: ../../c-api/typeobj.rst:1742 msgid "" "This field is not inherited by subtypes (though the attributes defined in " "here are inherited through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1745 +#: ../../c-api/typeobj.rst:1747 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1750 +#: ../../c-api/typeobj.rst:1752 msgid "" "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" "member:`~PyTypeObject.tp_dict` with the dictionary C-API." msgstr "" -#: ../../c-api/typeobj.rst:1756 +#: ../../c-api/typeobj.rst:1758 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1758 ../../c-api/typeobj.rst:1774 -#: ../../c-api/typeobj.rst:1838 ../../c-api/typeobj.rst:1868 -#: ../../c-api/typeobj.rst:1892 +#: ../../c-api/typeobj.rst:1760 ../../c-api/typeobj.rst:1776 +#: ../../c-api/typeobj.rst:1840 ../../c-api/typeobj.rst:1870 +#: ../../c-api/typeobj.rst:1894 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1771 +#: ../../c-api/typeobj.rst:1773 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1778 +#: ../../c-api/typeobj.rst:1780 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1789 +#: ../../c-api/typeobj.rst:1791 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` " "should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:1792 +#: ../../c-api/typeobj.rst:1794 msgid "" "If the instances of this type have a dictionary containing instance " "variables, this field is non-zero and contains the offset in the instances " @@ -2672,19 +2672,19 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1797 +#: ../../c-api/typeobj.rst:1799 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " "the dictionary for attributes of the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1800 +#: ../../c-api/typeobj.rst:1802 msgid "" "The value specifies the offset of the dictionary from the start of the " "instance structure." msgstr "" -#: ../../c-api/typeobj.rst:1802 +#: ../../c-api/typeobj.rst:1804 msgid "" "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" "only. To get the pointer to the dictionary call :c:func:" @@ -2693,13 +2693,13 @@ msgid "" "to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." msgstr "" -#: ../../c-api/typeobj.rst:1808 +#: ../../c-api/typeobj.rst:1810 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " "and :c:member:`~PyTypeObject.tp_dictoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1813 +#: ../../c-api/typeobj.rst:1815 msgid "" "This field is inherited by subtypes. A subtype should not override this " "offset; doing so could be unsafe, if C code tries to access the dictionary " @@ -2707,25 +2707,25 @@ msgid "" "`Py_TPFLAGS_MANAGED_DICT`." msgstr "" -#: ../../c-api/typeobj.rst:1820 +#: ../../c-api/typeobj.rst:1822 msgid "" "This slot has no default. For :ref:`static types `, if the " "field is ``NULL`` then no :attr:`~object.__dict__` gets created for " "instances." msgstr "" -#: ../../c-api/typeobj.rst:1823 +#: ../../c-api/typeobj.rst:1825 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" "`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject.tp_dictoffset` " "will be set to ``-1``, to indicate that it is unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1831 +#: ../../c-api/typeobj.rst:1833 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1833 +#: ../../c-api/typeobj.rst:1835 msgid "" "This function corresponds to the :meth:`~object.__init__` method of " "classes. Like :meth:`!__init__`, it is possible to create an instance " @@ -2733,14 +2733,14 @@ msgid "" "instance by calling its :meth:`!__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1842 +#: ../../c-api/typeobj.rst:1844 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " "arguments represent positional and keyword arguments of the call to :meth:" "`~object.__init__`." msgstr "" -#: ../../c-api/typeobj.rst:1846 +#: ../../c-api/typeobj.rst:1848 msgid "" "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " "when an instance is created normally by calling its type, after the type's :" @@ -2752,43 +2752,43 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1853 +#: ../../c-api/typeobj.rst:1855 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1861 +#: ../../c-api/typeobj.rst:1863 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1866 +#: ../../c-api/typeobj.rst:1868 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1874 +#: ../../c-api/typeobj.rst:1876 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1879 +#: ../../c-api/typeobj.rst:1881 msgid "" "For dynamic subtypes, this field is always set to :c:func:" "`PyType_GenericAlloc`, to force a standard heap allocation strategy." msgstr "" -#: ../../c-api/typeobj.rst:1883 +#: ../../c-api/typeobj.rst:1885 msgid "" "For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:" "`PyType_GenericAlloc`. That is the recommended value for all statically " "defined types." msgstr "" -#: ../../c-api/typeobj.rst:1890 +#: ../../c-api/typeobj.rst:1892 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1896 +#: ../../c-api/typeobj.rst:1898 msgid "" "The *subtype* argument is the type of the object being created; the *args* " "and *kwds* arguments represent positional and keyword arguments of the call " @@ -2797,7 +2797,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1902 +#: ../../c-api/typeobj.rst:1904 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -2809,20 +2809,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1910 +#: ../../c-api/typeobj.rst:1912 msgid "" "Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow " "creating instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:1915 +#: ../../c-api/typeobj.rst:1917 msgid "" "This field is inherited by subtypes, except it is not inherited by :ref:" "`static types ` whose :c:member:`~PyTypeObject.tp_base` is " "``NULL`` or ``&PyBaseObject_Type``." msgstr "" -#: ../../c-api/typeobj.rst:1921 +#: ../../c-api/typeobj.rst:1923 msgid "" "For :ref:`static types ` this field has no default. This means " "if the slot is defined as ``NULL``, the type cannot be called to create new " @@ -2830,40 +2830,40 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:1929 +#: ../../c-api/typeobj.rst:1931 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1933 +#: ../../c-api/typeobj.rst:1935 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1937 +#: ../../c-api/typeobj.rst:1939 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1942 +#: ../../c-api/typeobj.rst:1944 msgid "" "In dynamic subtypes, this field is set to a deallocator suitable to match :c:" "func:`PyType_GenericAlloc` and the value of the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit." msgstr "" -#: ../../c-api/typeobj.rst:1946 +#: ../../c-api/typeobj.rst:1948 msgid "" "For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:`PyObject_Del`." msgstr "" -#: ../../c-api/typeobj.rst:1951 +#: ../../c-api/typeobj.rst:1953 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1953 +#: ../../c-api/typeobj.rst:1955 msgid "" "The garbage collector needs to know whether a particular object is " "collectible or not. Normally, it is sufficient to look at the object's " @@ -2875,89 +2875,89 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1963 +#: ../../c-api/typeobj.rst:1965 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" "`PyType_Type`, defines this function to distinguish between statically and :" "ref:`dynamically allocated types `.)" msgstr "" -#: ../../c-api/typeobj.rst:1973 +#: ../../c-api/typeobj.rst:1975 msgid "" "This slot has no default. If this field is ``NULL``, :c:macro:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: ../../c-api/typeobj.rst:1979 +#: ../../c-api/typeobj.rst:1981 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1981 ../../c-api/typeobj.rst:2005 +#: ../../c-api/typeobj.rst:1983 ../../c-api/typeobj.rst:2007 msgid "" "This field should be set to ``NULL`` and treated as read-only. Python will " "fill it in when the type is :c:func:`initialized `." msgstr "" -#: ../../c-api/typeobj.rst:1984 +#: ../../c-api/typeobj.rst:1986 msgid "" "For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " "` can be used instead of the *bases* argument of :c:func:" "`PyType_FromSpecWithBases`. The argument form is preferred." msgstr "" -#: ../../c-api/typeobj.rst:1991 +#: ../../c-api/typeobj.rst:1993 msgid "" "Multiple inheritance does not work well for statically defined types. If you " "set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " "will only be inherited from the first base." msgstr "" -#: ../../c-api/typeobj.rst:1997 ../../c-api/typeobj.rst:2020 -#: ../../c-api/typeobj.rst:2037 ../../c-api/typeobj.rst:2054 -#: ../../c-api/typeobj.rst:2068 +#: ../../c-api/typeobj.rst:1999 ../../c-api/typeobj.rst:2022 +#: ../../c-api/typeobj.rst:2039 ../../c-api/typeobj.rst:2056 +#: ../../c-api/typeobj.rst:2070 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:2002 +#: ../../c-api/typeobj.rst:2004 msgid "" "Tuple containing the expanded set of base types, starting with the type " "itself and ending with :class:`object`, in Method Resolution Order." msgstr "" -#: ../../c-api/typeobj.rst:2010 +#: ../../c-api/typeobj.rst:2012 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2016 +#: ../../c-api/typeobj.rst:2018 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2025 +#: ../../c-api/typeobj.rst:2027 msgid "" "A collection of subclasses. Internal use only. May be an invalid pointer." msgstr "" -#: ../../c-api/typeobj.rst:2027 +#: ../../c-api/typeobj.rst:2029 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__`." msgstr "" -#: ../../c-api/typeobj.rst:2032 +#: ../../c-api/typeobj.rst:2034 msgid "" "For some types, this field does not hold a valid :c:expr:`PyObject*`. The " "type was changed to :c:expr:`void*` to indicate this." msgstr "" -#: ../../c-api/typeobj.rst:2042 +#: ../../c-api/typeobj.rst:2044 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2047 +#: ../../c-api/typeobj.rst:2049 msgid "" "Internals detail: For the static builtin types this is always ``NULL``, even " "if weakrefs are added. Instead, the weakrefs for each are stored on " @@ -2965,21 +2965,21 @@ msgid "" "``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." msgstr "" -#: ../../c-api/typeobj.rst:2059 +#: ../../c-api/typeobj.rst:2061 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:2064 +#: ../../c-api/typeobj.rst:2066 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2073 +#: ../../c-api/typeobj.rst:2075 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:2077 +#: ../../c-api/typeobj.rst:2079 msgid "" "If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " "once when finalizing an instance. It is called either from the garbage " @@ -2989,14 +2989,14 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:2084 +#: ../../c-api/typeobj.rst:2086 msgid "" ":c:member:`~PyTypeObject.tp_finalize` should not mutate the current " "exception status; therefore, a recommended way to write a non-trivial " "finalizer is::" msgstr "" -#: ../../c-api/typeobj.rst:2101 +#: ../../c-api/typeobj.rst:2103 msgid "" "Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." "tp_dealloc` may be called from any Python thread, not just the thread which " @@ -3009,18 +3009,18 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:2120 +#: ../../c-api/typeobj.rst:2122 msgid "" "Before version 3.8 it was necessary to set the :c:macro:" "`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " "This is no longer required." msgstr "" -#: ../../c-api/typeobj.rst:2124 +#: ../../c-api/typeobj.rst:2126 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2129 +#: ../../c-api/typeobj.rst:2131 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -3028,65 +3028,65 @@ msgid "" "meth:`~object.__new__` and :meth:`~object.__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2137 +#: ../../c-api/typeobj.rst:2139 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2139 +#: ../../c-api/typeobj.rst:2141 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2144 +#: ../../c-api/typeobj.rst:2146 msgid "Internal. Do not use." msgstr "" -#: ../../c-api/typeobj.rst:2152 +#: ../../c-api/typeobj.rst:2154 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2154 +#: ../../c-api/typeobj.rst:2156 msgid "" "Traditionally, types defined in C code are *static*, that is, a static :c:" "type:`PyTypeObject` structure is defined directly in code and initialized " "using :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2158 +#: ../../c-api/typeobj.rst:2160 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2160 +#: ../../c-api/typeobj.rst:2162 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2162 +#: ../../c-api/typeobj.rst:2164 msgid "" "Static type objects (but not necessarily their instances) are immutable. It " "is not possible to add or modify the type object's attributes from Python." msgstr "" -#: ../../c-api/typeobj.rst:2164 +#: ../../c-api/typeobj.rst:2166 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2168 +#: ../../c-api/typeobj.rst:2170 msgid "" "Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " "` as an opaque struct, any extension modules using static " "types must be compiled for a specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2176 +#: ../../c-api/typeobj.rst:2178 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2178 +#: ../../c-api/typeobj.rst:2180 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -3094,29 +3094,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2183 +#: ../../c-api/typeobj.rst:2185 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" "func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:" "`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." msgstr "" -#: ../../c-api/typeobj.rst:2191 +#: ../../c-api/typeobj.rst:2193 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2198 +#: ../../c-api/typeobj.rst:2200 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the number protocol. Each function is used by the function of " "similar name documented in the :ref:`number` section." msgstr "" -#: ../../c-api/typeobj.rst:2204 ../../c-api/typeobj.rst:2528 +#: ../../c-api/typeobj.rst:2206 ../../c-api/typeobj.rst:2530 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2251 +#: ../../c-api/typeobj.rst:2253 msgid "" "Binary and ternary functions must check the type of all their operands, and " "implement the necessary conversions (at least one of the operands is an " @@ -3126,31 +3126,31 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2260 +#: ../../c-api/typeobj.rst:2262 msgid "" "The :c:member:`~PyNumberMethods.nb_reserved` field should always be " "``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in " "Python 3.0.1." msgstr "" -#: ../../c-api/typeobj.rst:2305 +#: ../../c-api/typeobj.rst:2307 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2312 +#: ../../c-api/typeobj.rst:2314 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the mapping protocol. It has three members:" msgstr "" -#: ../../c-api/typeobj.rst:2317 +#: ../../c-api/typeobj.rst:2319 msgid "" "This function is used by :c:func:`PyMapping_Size` and :c:func:" "`PyObject_Size`, and has the same signature. This slot may be set to " "``NULL`` if the object has no defined length." msgstr "" -#: ../../c-api/typeobj.rst:2323 +#: ../../c-api/typeobj.rst:2325 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3158,7 +3158,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2331 +#: ../../c-api/typeobj.rst:2333 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PySequence_SetSlice` and :c:func:" @@ -3168,17 +3168,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2342 +#: ../../c-api/typeobj.rst:2344 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2349 +#: ../../c-api/typeobj.rst:2351 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2354 +#: ../../c-api/typeobj.rst:2356 msgid "" "This function is used by :c:func:`PySequence_Size` and :c:func:" "`PyObject_Size`, and has the same signature. It is also used for handling " @@ -3186,21 +3186,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2361 +#: ../../c-api/typeobj.rst:2363 msgid "" "This function is used by :c:func:`PySequence_Concat` and has the same " "signature. It is also used by the ``+`` operator, after trying the numeric " "addition via the :c:member:`~PyNumberMethods.nb_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2367 +#: ../../c-api/typeobj.rst:2369 msgid "" "This function is used by :c:func:`PySequence_Repeat` and has the same " "signature. It is also used by the ``*`` operator, after trying numeric " "multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2373 +#: ../../c-api/typeobj.rst:2375 msgid "" "This function is used by :c:func:`PySequence_GetItem` and has the same " "signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " @@ -3209,7 +3209,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2379 +#: ../../c-api/typeobj.rst:2381 msgid "" "Negative indexes are handled as follows: if the :c:member:" "`~PySequenceMethods.sq_length` slot is filled, it is called and the sequence " @@ -3218,7 +3218,7 @@ msgid "" "index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2386 +#: ../../c-api/typeobj.rst:2388 msgid "" "This function is used by :c:func:`PySequence_SetItem` and has the same " "signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" @@ -3227,14 +3227,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2395 +#: ../../c-api/typeobj.rst:2397 msgid "" "This function may be used by :c:func:`PySequence_Contains` and has the same " "signature. This slot may be left to ``NULL``, in this case :c:func:`!" "PySequence_Contains` simply traverses the sequence until it finds a match." msgstr "" -#: ../../c-api/typeobj.rst:2402 +#: ../../c-api/typeobj.rst:2404 msgid "" "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3244,7 +3244,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2411 +#: ../../c-api/typeobj.rst:2413 msgid "" "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3254,72 +3254,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2422 +#: ../../c-api/typeobj.rst:2424 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2430 +#: ../../c-api/typeobj.rst:2432 msgid "" "This structure holds pointers to the functions required by the :ref:`Buffer " "protocol `. The protocol defines how an exporter object can " "expose its internal data to consumer objects." msgstr "" -#: ../../c-api/typeobj.rst:2436 ../../c-api/typeobj.rst:2485 -#: ../../c-api/typeobj.rst:2539 ../../c-api/typeobj.rst:2550 -#: ../../c-api/typeobj.rst:2562 ../../c-api/typeobj.rst:2572 +#: ../../c-api/typeobj.rst:2438 ../../c-api/typeobj.rst:2487 +#: ../../c-api/typeobj.rst:2541 ../../c-api/typeobj.rst:2552 +#: ../../c-api/typeobj.rst:2564 ../../c-api/typeobj.rst:2574 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2440 +#: ../../c-api/typeobj.rst:2442 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " "Except for point (3), an implementation of this function MUST take these " "steps:" msgstr "" -#: ../../c-api/typeobj.rst:2444 +#: ../../c-api/typeobj.rst:2446 msgid "" -"Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " -"set :c:expr:`view->obj` to ``NULL`` and return ``-1``." +"Check if the request can be met. If not, raise :exc:`BufferError`, set :c:" +"expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2447 +#: ../../c-api/typeobj.rst:2449 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2449 +#: ../../c-api/typeobj.rst:2451 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2451 +#: ../../c-api/typeobj.rst:2453 msgid "" "Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2453 +#: ../../c-api/typeobj.rst:2455 msgid "Return ``0``." -msgstr "" +msgstr "回傳 ``0``。" -#: ../../c-api/typeobj.rst:2455 +#: ../../c-api/typeobj.rst:2457 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2458 +#: ../../c-api/typeobj.rst:2460 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "expr:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2461 +#: ../../c-api/typeobj.rst:2463 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:expr:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2465 +#: ../../c-api/typeobj.rst:2467 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3327,7 +3327,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2470 +#: ../../c-api/typeobj.rst:2472 msgid "" "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " "exporter and must remain valid until there are no consumers left. :c:member:" @@ -3336,19 +3336,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2477 +#: ../../c-api/typeobj.rst:2479 msgid "" ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " "buffer while dealing correctly with all request types." msgstr "" -#: ../../c-api/typeobj.rst:2480 +#: ../../c-api/typeobj.rst:2482 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2489 +#: ../../c-api/typeobj.rst:2491 msgid "" "Handle a request to release the resources of the buffer. If no resources " "need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " @@ -3356,15 +3356,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2494 +#: ../../c-api/typeobj.rst:2496 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2496 +#: ../../c-api/typeobj.rst:2498 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2498 +#: ../../c-api/typeobj.rst:2500 msgid "" "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " "track of buffer-specific resources. This field is guaranteed to remain " @@ -3372,68 +3372,68 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2504 +#: ../../c-api/typeobj.rst:2506 msgid "" "This function MUST NOT decrement :c:expr:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2509 +#: ../../c-api/typeobj.rst:2511 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2517 +#: ../../c-api/typeobj.rst:2519 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2525 +#: ../../c-api/typeobj.rst:2527 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2543 +#: ../../c-api/typeobj.rst:2545 msgid "" "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " "must return ``1`` for it." msgstr "" -#: ../../c-api/typeobj.rst:2546 +#: ../../c-api/typeobj.rst:2548 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2554 +#: ../../c-api/typeobj.rst:2556 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`~object." "__anext__` for details." msgstr "" -#: ../../c-api/typeobj.rst:2557 +#: ../../c-api/typeobj.rst:2559 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2566 +#: ../../c-api/typeobj.rst:2568 msgid "" "Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for " "details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2576 +#: ../../c-api/typeobj.rst:2578 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2585 +#: ../../c-api/typeobj.rst:2587 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2589 +#: ../../c-api/typeobj.rst:2591 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " @@ -3447,80 +3447,80 @@ msgid "" "length of the block should be :c:member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2599 +#: ../../c-api/typeobj.rst:2601 msgid "" "This function should not do any other instance initialization, not even to " "allocate additional memory; that should be done by :c:member:`~PyTypeObject." "tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2606 +#: ../../c-api/typeobj.rst:2608 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`。" -#: ../../c-api/typeobj.rst:2610 +#: ../../c-api/typeobj.rst:2612 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`。" -#: ../../c-api/typeobj.rst:2614 +#: ../../c-api/typeobj.rst:2616 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" -#: ../../c-api/typeobj.rst:2618 +#: ../../c-api/typeobj.rst:2620 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。" -#: ../../c-api/typeobj.rst:2622 ../../c-api/typeobj.rst:2631 +#: ../../c-api/typeobj.rst:2624 ../../c-api/typeobj.rst:2633 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2626 ../../c-api/typeobj.rst:2637 +#: ../../c-api/typeobj.rst:2628 ../../c-api/typeobj.rst:2639 msgid "" "Set the value of the named attribute for the object. The value argument is " "set to ``NULL`` to delete the attribute." msgstr "" -#: ../../c-api/typeobj.rst:2633 +#: ../../c-api/typeobj.rst:2635 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。" -#: ../../c-api/typeobj.rst:2640 +#: ../../c-api/typeobj.rst:2642 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。" -#: ../../c-api/typeobj.rst:2644 +#: ../../c-api/typeobj.rst:2646 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。" -#: ../../c-api/typeobj.rst:2648 +#: ../../c-api/typeobj.rst:2650 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。" -#: ../../c-api/typeobj.rst:2652 +#: ../../c-api/typeobj.rst:2654 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。" -#: ../../c-api/typeobj.rst:2656 +#: ../../c-api/typeobj.rst:2658 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。" -#: ../../c-api/typeobj.rst:2660 +#: ../../c-api/typeobj.rst:2662 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。" -#: ../../c-api/typeobj.rst:2664 +#: ../../c-api/typeobj.rst:2666 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。" -#: ../../c-api/typeobj.rst:2678 +#: ../../c-api/typeobj.rst:2680 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。" -#: ../../c-api/typeobj.rst:2694 +#: ../../c-api/typeobj.rst:2696 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2696 +#: ../../c-api/typeobj.rst:2698 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3528,46 +3528,46 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2701 +#: ../../c-api/typeobj.rst:2703 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2718 +#: ../../c-api/typeobj.rst:2720 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2762 +#: ../../c-api/typeobj.rst:2764 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2787 +#: ../../c-api/typeobj.rst:2789 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " "instances (e.g. uses a separate factory func) using :c:macro:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: ../../c-api/typeobj.rst:2806 +#: ../../c-api/typeobj.rst:2808 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2817 +#: ../../c-api/typeobj.rst:2819 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" msgstr "" -#: ../../c-api/typeobj.rst:808 ../../c-api/typeobj.rst:873 +#: ../../c-api/typeobj.rst:809 ../../c-api/typeobj.rst:874 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/typeobj.rst:808 +#: ../../c-api/typeobj.rst:809 msgid "repr" msgstr "repr" -#: ../../c-api/typeobj.rst:873 +#: ../../c-api/typeobj.rst:874 msgid "hash" msgstr "hash(雜湊)" diff --git a/c-api/unicode.po b/c-api/unicode.po index 7739b467b3..4795cf2177 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.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 00:03+0000\n" +"POT-Creation-Date: 2023-08-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -757,7 +757,7 @@ msgstr "" msgid "" "Copy an instance of a Unicode subtype to a new true Unicode object if " "necessary. If *obj* is already a true Unicode object (not a subtype), return " -"the reference with incremented refcount." +"a new :term:`strong reference` to the object." msgstr "" #: ../../c-api/unicode.rst:576 @@ -1697,12 +1697,12 @@ msgid "" "Intern the argument *\\*string* in place. The argument must be the address " "of a pointer variable pointing to a Python Unicode string object. If there " "is an existing interned string that is the same as *\\*string*, it sets " -"*\\*string* to it (decrementing the reference count of the old string object " -"and incrementing the reference count of the interned string object), " -"otherwise it leaves *\\*string* alone and interns it (incrementing its " -"reference count). (Clarification: even though there is a lot of talk about " -"reference counts, think of this function as reference-count-neutral; you own " -"the object after the call if and only if you owned it before the call.)" +"*\\*string* to it (releasing the reference to the old string object and " +"creating a new :term:`strong reference` to the interned string object), " +"otherwise it leaves *\\*string* alone and interns it (creating a new :term:" +"`strong reference`). (Clarification: even though there is a lot of talk " +"about references, think of this function as reference-neutral; you own the " +"object after the call if and only if you owned it before the call.)" msgstr "" #: ../../c-api/unicode.rst:1458 diff --git a/distributing/index.po b/distributing/index.po index 2275126ded..c21b18ddd6 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-18 00:03+0000\n" "PO-Revision-Date: 2021-07-04 18:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -21,308 +21,15 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.2.2\n" -#: ../../distributing/index.rst:5 +#: ../../distributing/index.rst:10 msgid "Distributing Python Modules" msgstr "發布 Python 模組" -#: ../../distributing/index.rst:0 -msgid "Email" -msgstr "電子郵件" - -#: ../../distributing/index.rst:7 -msgid "distutils-sig@python.org" -msgstr "distutils-sig@python.org" - -#: ../../distributing/index.rst:10 -msgid "" -"As a popular open source development project, Python has an active " -"supporting community of contributors and users that also make their software " -"available for other Python developers to use under open source license terms." -msgstr "" -"作為一個普及的開源開發專案,Python 有一個活躍的支持社群,由其貢獻者及使用者組" -"成,而他們也讓他們的軟體可被其他 Python 開發者在開源授權條款下使用。" - #: ../../distributing/index.rst:14 msgid "" -"This allows Python users to share and collaborate effectively, benefiting " -"from the solutions others have already created to common (and sometimes even " -"rare!) problems, as well as potentially contributing their own solutions to " -"the common pool." -msgstr "" -"這樣可以讓 Python 使用者們有效地共享和合作,並受益於其他人對常見(有時甚至是" -"罕見)的問題已經建立的解決方案,更可以在公開社群中潛在地貢獻他們自己的解決方" -"案。" - -#: ../../distributing/index.rst:19 -msgid "" -"This guide covers the distribution part of the process. For a guide to " -"installing other Python projects, refer to the :ref:`installation guide " -"`." -msgstr "" -"這份指南涵蓋了上述過程中的發布部分。如果是要安裝其他的 Python 專案,請參考" -"\\ :ref:`安裝 Python 模組 `\\ 指南。" - -#: ../../distributing/index.rst:25 -msgid "" -"For corporate and other institutional users, be aware that many " -"organisations have their own policies around using and contributing to open " -"source software. Please take such policies into account when making use of " -"the distribution and installation tools provided with Python." -msgstr "" -"對於企業和其他機構的使用者,要注意到,許多組織對於使用和貢獻開源軟體都有自己" -"的政策。在開始使用配備 Python 的發布及安裝工具時,請將那些政策納入考量。" - -#: ../../distributing/index.rst:32 -msgid "Key terms" -msgstr "關鍵術語" - -#: ../../distributing/index.rst:34 -msgid "" -"the `Python Package Index `__ is a public repository of " -"open source licensed packages made available for use by other Python users" -msgstr "" -"`Python 套件索引 (Python Package Index) `__ 是開源授權套件" -"的一個公共儲存庫,其中的套件皆可被其他 Python 使用者所使用" - -#: ../../distributing/index.rst:37 -msgid "" -"the `Python Packaging Authority `__ are the group of " -"developers and documentation authors responsible for the maintenance and " -"evolution of the standard packaging tools and the associated metadata and " -"file format standards. They maintain a variety of tools, documentation and " -"issue trackers on `GitHub `__." -msgstr "" -"`Python 封裝管理站 (Python Packaging Authority) `__ 是" -"一個由開發者和說明文件作者組成的團隊,負責維護及改進標準封裝工具,以及相關的" -"元資料 (metadata) 和檔案格式標準。他們在 `GitHub `__ 平台上維護各種工具、說明文件及問題追蹤系統。" - -#: ../../distributing/index.rst:43 -msgid "" -"``distutils`` is the original build and distribution system first added to " -"the Python standard library in 1998. While direct use of ``distutils`` is " -"being phased out, it still laid the foundation for the current packaging and " -"distribution infrastructure, and it not only remains part of the standard " -"library, but its name lives on in other ways (such as the name of the " -"mailing list used to coordinate Python packaging standards development)." -msgstr "" -"``distutils`` 是最早的建置和發布系統,於 1998 年首次被加入 Python 標準函式" -"庫。雖然直接使用 ``distutils`` 的方式已經被逐步淘汰,它仍然是現今封裝和發布的" -"基礎結構根基,而且它不僅仍然是標準函式庫的一部分,它的名稱也以其他的方式存活" -"著(例如:用於協調 Python 封裝標準開發的郵寄清單就是以它命名)。" - -#: ../../distributing/index.rst:50 -msgid "" -"`setuptools`_ is a (largely) drop-in replacement for ``distutils`` first " -"published in 2004. Its most notable addition over the unmodified " -"``distutils`` tools was the ability to declare dependencies on other " -"packages. It is currently recommended as a more regularly updated " -"alternative to ``distutils`` that offers consistent support for more recent " -"packaging standards across a wide range of Python versions." -msgstr "" -"`setuptools`_ 是 ``distutils`` 的一個(主要的)偶然出現的替代品,它於 2004 年" -"首次被發布。相較於未修改的 ``distutils`` 工具,它最值得注意的新功能,是能夠宣" -"告對其他套件的依賴性 (dependency)。它目前被推薦為 ``distutils`` 的一個替代方" -"案,因其更新較為頻繁,且能在各個廣泛的 Python 版本之間,為較新的封裝標準提供" -"一致性的支援。" - -#: ../../distributing/index.rst:56 -msgid "" -"`wheel`_ (in this context) is a project that adds the ``bdist_wheel`` " -"command to ``distutils``/`setuptools`_. This produces a cross platform " -"binary packaging format (called \"wheels\" or \"wheel files\" and defined " -"in :pep:`427`) that allows Python libraries, even those including binary " -"extensions, to be installed on a system without needing to be built locally." -msgstr "" -"`wheel`_\\ (在此文中)是一個將 ``bdist_wheel`` 指令附加到 ``distutils``/" -"`setuptools`_ 的專案。這會產生一個跨平台的二進制封裝格式(稱為「wheels」或" -"「wheel 檔案」,並於 :pep:`427` 中被定義),它可讓 Python 函式庫,甚至那些包" -"含二進制擴充的函式庫,可以在系統中被安裝,但不需要在本機進行建置。" - -#: ../../distributing/index.rst:67 -msgid "Open source licensing and collaboration" -msgstr "開源授權與協同合作" - -#: ../../distributing/index.rst:69 -msgid "" -"In most parts of the world, software is automatically covered by copyright. " -"This means that other developers require explicit permission to copy, use, " -"modify and redistribute the software." +"Information and guidance on distributing Python modules and packages has " +"been moved to the `Python Packaging User Guide`_, and the tutorial on " +"`packaging Python projects`_." msgstr "" -"在世界上多數地方,軟體會自動受版權所保護。這代表著其他開發人員需要明確的許" -"可,才能複製、使用、修改和重新發布軟體。" - -#: ../../distributing/index.rst:73 -msgid "" -"Open source licensing is a way of explicitly granting such permission in a " -"relatively consistent way, allowing developers to share and collaborate " -"efficiently by making common solutions to various problems freely available. " -"This leaves many developers free to spend more time focusing on the problems " -"that are relatively unique to their specific situation." -msgstr "" -"開源授權是一種以相對一致的方式,明確地授予此類許可的方法,它允許開發人員透過" -"為各種問題提供免費可用的共通解決方案,來達到高效率的共享和協作。這使得許多開" -"發人員可以自由地將更多時間專注於處理他們在特定情況中遇到的相對獨特的問題。" - -#: ../../distributing/index.rst:79 -msgid "" -"The distribution tools provided with Python are designed to make it " -"reasonably straightforward for developers to make their own contributions " -"back to that common pool of software if they choose to do so." -msgstr "" -"Python 所提供的發布工具,被設計為讓開發人員能夠以合理的直觀方式,對該公用軟體" -"庫回饋他們自己的貢獻,前提是他們願意這樣做。" - -#: ../../distributing/index.rst:83 -msgid "" -"The same distribution tools can also be used to distribute software within " -"an organisation, regardless of whether that software is published as open " -"source software or not." -msgstr "" -"同一個發布工具也可用於在組織內發布軟體,不論該軟體是否有作為開源軟體被發布。" - -#: ../../distributing/index.rst:89 -msgid "Installing the tools" -msgstr "安裝工具" - -#: ../../distributing/index.rst:91 -msgid "" -"The standard library does not include build tools that support modern Python " -"packaging standards, as the core development team has found that it is " -"important to have standard tools that work consistently, even on older " -"versions of Python." -msgstr "" -"標準函式庫並不包含那些支援現代 Python 封裝標準的建置工具,因為核心開發團隊發" -"現,提供始終可運作的標準工具是很重要的,即使它們是在舊版的 Python 上運作。" - -#: ../../distributing/index.rst:96 -msgid "" -"The currently recommended build and distribution tools can be installed by " -"invoking the ``pip`` module at the command line::" -msgstr "" -"當今被推薦的建置及發布工具,可以透過在命令列中呼叫 ``pip`` 模組來安裝它們:\n" -"\n" -"::" - -#: ../../distributing/index.rst:103 -msgid "" -"For POSIX users (including macOS and Linux users), these instructions assume " -"the use of a :term:`virtual environment`." -msgstr "" -"對於 POSIX 使用者(包括 Mac OS X 和 Linux 使用者),這些教學皆假設有使用 :" -"term:`virtual environment`\\ 。" - -#: ../../distributing/index.rst:106 -msgid "" -"For Windows users, these instructions assume that the option to adjust the " -"system PATH environment variable was selected when installing Python." -msgstr "" -"對於 Windows 使用者,這些教學皆假設在安裝 Python 時,「可調整系統 PATH 環境變" -"數」的選項已被選取。" - -#: ../../distributing/index.rst:110 -msgid "" -"The Python Packaging User Guide includes more details on the `currently " -"recommended tools`_." -msgstr "Python 封裝使用者指南包含了關於\\ `當今推薦工具`_\\ 的更多細節。" - -#: ../../distributing/index.rst:122 -msgid "Reading the Python Packaging User Guide" -msgstr "閱讀 Python 封裝使用者指南" - -#: ../../distributing/index.rst:124 -msgid "" -"The Python Packaging User Guide covers the various key steps and elements " -"involved in creating and publishing a project:" -msgstr "" -"Python 封裝使用者指南涵蓋了關於建立和發布一個專案的各項關鍵步驟和元素:" - -#: ../../distributing/index.rst:127 -msgid "`Project structure`_" -msgstr "`專案結構`_" - -#: ../../distributing/index.rst:128 -msgid "`Building and packaging the project`_" -msgstr "`專案建置與封裝`_" - -#: ../../distributing/index.rst:129 -msgid "`Uploading the project to the Python Package Index`_" -msgstr "`上傳專案至 Python 套件索引 (Python Package Index)`_" - -#: ../../distributing/index.rst:130 -msgid "`The .pypirc file`_" -msgstr "`.pypirc 檔案`_" - -#: ../../distributing/index.rst:139 -msgid "How do I...?" -msgstr "我該如何...?" - -#: ../../distributing/index.rst:141 -msgid "These are quick answers or links for some common tasks." -msgstr "接下來是關於一些常見任務的快速解答或連結。" - -#: ../../distributing/index.rst:144 -msgid "... choose a name for my project?" -msgstr "...為我的專案選擇一個名稱?" - -#: ../../distributing/index.rst:146 -msgid "This isn't an easy topic, but here are a few tips:" -msgstr "這不是一個簡單的題目,但這裡有一些提示:" - -#: ../../distributing/index.rst:148 -msgid "check the Python Package Index to see if the name is already in use" -msgstr "檢查 Python 套件索引,看看該名稱是否已被使用" - -#: ../../distributing/index.rst:149 -msgid "" -"check popular hosting sites like GitHub, Bitbucket, etc to see if there is " -"already a project with that name" -msgstr "" -"檢查常用的代管網站,像是 GitHub、Bitbucket 等,看看是否已經有一個使用該名稱的" -"專案" - -#: ../../distributing/index.rst:151 -msgid "check what comes up in a web search for the name you're considering" -msgstr "檢查您正在考慮的名稱在網路搜尋中會出現的內容" - -#: ../../distributing/index.rst:152 -msgid "" -"avoid particularly common words, especially ones with multiple meanings, as " -"they can make it difficult for users to find your software when searching " -"for it" -msgstr "" -"避免使用特別常見的單字,尤其是那些有多重含義的單字,因為它們會讓使用者在搜尋" -"你的軟體時時很難找到它" - -#: ../../distributing/index.rst:158 -msgid "... create and distribute binary extensions?" -msgstr "...建立和發布二進制擴充?" - -#: ../../distributing/index.rst:160 -msgid "" -"This is actually quite a complex topic, with a variety of alternatives " -"available depending on exactly what you're aiming to achieve. See the Python " -"Packaging User Guide for more information and recommendations." -msgstr "" -"實際上這是一個非常複雜的題目,因為有各式各樣的替代方案可使用,取決於您確實想" -"要達成的目標。更多的資訊和建議,請參閱 Python 封裝使用者指南。" - -#: ../../distributing/index.rst:166 -msgid "" -"`Python Packaging User Guide: Binary Extensions `__" -msgstr "" -"`Python 封裝使用者指南:二進制擴充 `__" - -#: ../../distributing/index.rst:115 -msgid "Python Package Index (PyPI)" -msgstr "Python Package Index (PyPI)" - -#: ../../distributing/index.rst:115 -msgid "PyPI" -msgstr "PyPI" - -#: ../../distributing/index.rst:115 -msgid "(see Python Package Index (PyPI))" -msgstr "(請見 Python Package Index (PyPI))" +"有關發布 Python 模組和套件的資訊和指南已移至 `Python Packaging User Guide`_," +"而相關教學已經移至 `packaging Python projects`_。" diff --git a/extending/building.po b/extending/building.po index 83ef47cbff..ea72239809 100644 --- a/extending/building.po +++ b/extending/building.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-18 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -67,11 +67,11 @@ msgid "" "in one library\"* section in :pep:`489` for details." msgstr "" -#: ../../extending/building.rst:51 +#: ../../extending/building.rst:52 msgid "Building C and C++ Extensions with setuptools" msgstr "" -#: ../../extending/building.rst:53 +#: ../../extending/building.rst:54 msgid "" "Python 3.12 and newer no longer come with distutils. Please refer to the " "``setuptools`` documentation at https://setuptools.readthedocs.io/en/latest/" diff --git a/extending/extending.po b/extending/extending.po index 958e723db0..3df03f58c9 100644 --- a/extending/extending.po +++ b/extending/extending.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-08-18 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -307,8 +307,8 @@ msgstr "" #: ../../extending/extending.rst:245 msgid "" -"We discuss the use of ``PyMODINIT_FUNC`` as a function return type later in " -"this sample." +"We discuss the use of :c:macro:`PyMODINIT_FUNC` as a function return type " +"later in this sample." msgstr "" #: ../../extending/extending.rst:248 @@ -422,9 +422,9 @@ msgstr "" #: ../../extending/extending.rst:366 msgid "" -"Note that PyMODINIT_FUNC declares the function as ``PyObject *`` return " -"type, declares any special linkage declarations required by the platform, " -"and for C++ declares the function as ``extern \"C\"``." +"Note that :c:macro:`PyMODINIT_FUNC` declares the function as ``PyObject *`` " +"return type, declares any special linkage declarations required by the " +"platform, and for C++ declares the function as ``extern \"C\"``." msgstr "" #: ../../extending/extending.rst:370 diff --git a/faq/programming.po b/faq/programming.po index c9a99333a9..f569f5483c 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-20 15:45+0000\n" "PO-Revision-Date: 2023-02-18 14:48+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -796,11 +796,11 @@ msgstr "list 是 :term:`mutable`,這意味著你可以變更它們的內容。 #: ../../faq/programming.rst:457 #, fuzzy msgid "" -"After the call to :meth:`~list.append`, the content of the mutable object " -"has changed from ``[]`` to ``[10]``. Since both the variables refer to the " -"same object, using either name accesses the modified value ``[10]``." +"After the call to :meth:`!append`, the content of the mutable object has " +"changed from ``[]`` to ``[10]``. Since both the variables refer to the same " +"object, using either name accesses the modified value ``[10]``." msgstr "" -"在呼叫 :meth:`~list.append` 之後,可變物件的內容從 ``[]`` 變成了 ``[10]``。由" +"在呼叫 :meth:`!append` 之後,可變物件的內容從 ``[]`` 變成了 ``[10]``。由" "於這兩個變數都引用同一個物件,因此使用任一名稱都可以存取修改後的值 " "``[10]`` 。" @@ -2222,14 +2222,13 @@ msgid "" "an :meth:`~object.__iadd__` magic method, it gets called when the ``+=`` " "augmented assignment is executed, and its return value is what gets used in " "the assignment statement; and (b) for lists, :meth:`!__iadd__` is equivalent " -"to calling :meth:`~list.extend` on the list and returning the list. That's " -"why we say that for lists, ``+=`` is a \"shorthand\" for :meth:`!list." -"extend`::" +"to calling :meth:`!extend` on the list and returning the list. That's why " +"we say that for lists, ``+=`` is a \"shorthand\" for :meth:`!list.extend`::" msgstr "" "要了解為什麼會發生這種情況,你需要知道 (a) 如果一個物件實作了一個 :meth:" "`~object.__iadd__` 魔術方法,它會在執行 ``+=`` 增廣賦值時被呼叫,並且它的回傳" "value 是賦值陳述式中使用的值; (b) 對於list,:meth:`!__iadd__` 相當於在list上" -"呼叫 :meth:`~list.extend` 並回傳list。這就是為什麼我們說對於list,``+=`` 是 :" +"呼叫 :meth:`!extend` 並回傳list。這就是為什麼我們說對於list,``+=`` 是 :" "meth:`!list.extend` 的「簡寫」:\n" "\n" "::" @@ -2959,12 +2958,10 @@ msgstr "" #: ../../faq/programming.rst:1905 msgid "" -"For example, here is the implementation of :meth:`collections.abc.Sequence." +"For example, here is the implementation of :meth:`!collections.abc.Sequence." "__contains__`::" msgstr "" -"例如,以下是 :meth:`collections.abc.Sequence.__contains__` 的實作:\n" -"\n" -"::" +"例如,以下是 :meth:`!collections.abc.Sequence.__contains__` 的實作: ::" #: ../../faq/programming.rst:1916 msgid "" diff --git a/glossary.po b/glossary.po index 5e6d394234..a5b4f9f455 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-06-29 00:19+0000\n" +"POT-Creation-Date: 2023-08-09 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-" @@ -57,7 +57,7 @@ msgstr "" #: ../../glossary.rst:23 msgid "The :const:`Ellipsis` built-in constant." -msgstr "內建常數 :const:`Ellipsis`\\ 。" +msgstr "內建常數 :const:`Ellipsis`。" #: ../../glossary.rst:24 msgid "2to3" @@ -80,7 +80,7 @@ msgid "" "reference`." msgstr "" "2to3 在可以標準函式庫中以 :mod:`lib2to3` 被使用;它提供了一個獨立的入口點," -"在 :file:`Tools/scripts/2to3`\\ 。請參閱 :ref:`2to3-reference`。" +"在 :file:`Tools/scripts/2to3`。請參閱 :ref:`2to3-reference`。" #: ../../glossary.rst:33 msgid "abstract base class" @@ -100,8 +100,8 @@ msgid "" "You can create your own ABCs with the :mod:`abc` module." msgstr "" "抽象基底類別(又稱為 ABC)提供了一種定義介面的方法,作為 :term:`duck-" -"typing`\\ (鴨子型別)的補充。其他類似的技術,像是 :func:`hasattr`\\ ,則顯得" -"笨拙或是帶有細微的錯誤(例如使用\\ :ref:`魔術方法 (magic method) `\\ )。ABC 採用虛擬的 subclass(子類別),它們並不繼承自另一個 class" "(類別),但仍可被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參閱 :" "mod:`abc` 模組的說明文件。Python 有許多內建的 ABC,用於資料結構(在 :mod:" @@ -138,9 +138,9 @@ msgid "" "and :pep:`526`, which describe this functionality. Also see :ref:" "`annotations-howto` for best practices on working with annotations." msgstr "" -"請參閱 :term:`variable annotation`\\ 、\\ :term:`function " -"annotation`\\ 、\\ :pep:`484` 和 :pep:`526`,這些章節皆有此功能的說明。關於註" -"釋的最佳實踐方法也請參閱 :ref:`annotations-howto`\\ 。" +"請參閱 :term:`variable annotation`、:term:`function annotation`、:pep:`484` " +"和 :pep:`526`,這些章節皆有此功能的說明。關於註釋的最佳實踐方法也請參閱 :ref:" +"`annotations-howto`。" #: ../../glossary.rst:62 msgid "argument" @@ -199,7 +199,7 @@ msgid "" "and :pep:`362`." msgstr "" "另請參閱術語表的 :term:`parameter`\\ (參數)條目、常見問題中的\\ :ref:`引數" -"和參數之間的差異 `\\ ,以及 :pep:`362`\\ 。" +"和參數之間的差異 `,以及 :pep:`362`。" #: ../../glossary.rst:92 msgid "asynchronous context manager" @@ -364,11 +364,11 @@ msgid "" "github.io/>`_, Python's creator." msgstr "" "Benevolent Dictator For Life(終身仁慈獨裁者),又名 `Guido van Rossum " -"`_\\ ,Python 的創造者。" +"`_,Python 的創造者。" #: ../../glossary.rst:158 msgid "binary file" -msgstr "binary file(二進制檔案)" +msgstr "binary file(二進位檔案)" #: ../../glossary.rst:160 msgid "" @@ -379,10 +379,10 @@ msgid "" "GzipFile`." msgstr "" "一個能夠讀取和寫入 :term:`bytes-like objects `\\ (類位元" -"組串物件)的 :term:`file object`\\ (檔案物件)。二進制檔案的例子有:以二進制" -"模式(``'rb'``、``'wb'`` 或 ``'rb+'``)開啟的檔案、\\ :data:`sys.stdin." -"buffer`、\\ :data:`sys.stdout.buffer`,以及 :class:`io.BytesIO` 和 :class:" -"`gzip.GzipFile` 實例。" +"組串物件)的 :term:`file object`\\ (檔案物件)。二進位檔案的例子有:以二進位" +"模式(``'rb'``、``'wb'`` 或 ``'rb+'``)開啟的檔案、:data:`sys.stdin." +"buffer`、:data:`sys.stdout.buffer`,以及 :class:`io.BytesIO` 和 :class:`gzip." +"GzipFile` 實例。" #: ../../glossary.rst:167 msgid "" @@ -398,17 +398,17 @@ msgstr "borrowed reference(借用參照)" #: ../../glossary.rst:171 msgid "" -"In Python's C API, a borrowed reference is a reference to an object. It does " -"not modify the object reference count. It becomes a dangling pointer if the " -"object is destroyed. For example, a garbage collection can remove the last :" -"term:`strong reference` to the object and so destroy it." +"In Python's C API, a borrowed reference is a reference to an object, where " +"the code using the object does not own the reference. It becomes a dangling " +"pointer if the object is destroyed. For example, a garbage collection can " +"remove the last :term:`strong reference` to the object and so destroy it." msgstr "" -"在 Python 的 C API 中,借用參照是一個對物件的參照。它不會修改該物件的參照計" -"數 (reference count)。如果該物件被銷毀,它會成為一個迷途指標 (dangling " -"pointer)。例如,一次垃圾回收 (garbage collection) 可以移除對物件的最後一個 :" -"term:`strong reference`\\ (強參照),而將該物件銷毀。" +"在 Python 的 C API 中,借用參照是一個對物件的參照,其中使用該物件的程式碼並不" +"擁有這個參照。如果該物件被銷毀,它會成為一個迷途指標 (dangling pointer)。例" +"如,一次垃圾回收 (garbage collection) 可以移除對物件的最後一個 :term:`strong " +"reference`\\ (強參照),而將該物件銷毀。" -#: ../../glossary.rst:176 +#: ../../glossary.rst:177 msgid "" "Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended " "to convert it to a :term:`strong reference` in-place, except when the object " @@ -418,14 +418,14 @@ msgid "" msgstr "" "對 :term:`borrowed reference` 呼叫 :c:func:`Py_INCREF` 以將它原地 (in-place) " "轉換為 :term:`strong reference` 是被建議的做法,除非該物件不能在最後一次使用" -"借用參照之前被銷毀。\\ :c:func:`Py_NewRef` 函式可用於建立一個新的 :term:" -"`strong reference`。" +"借用參照之前被銷毀。:c:func:`Py_NewRef` 函式可用於建立一個新的 :term:`strong " +"reference`。" -#: ../../glossary.rst:181 +#: ../../glossary.rst:182 msgid "bytes-like object" msgstr "bytes-like object(類位元組串物件)" -#: ../../glossary.rst:183 +#: ../../glossary.rst:184 msgid "" "An object that supports the :ref:`bufferobjects` and can export a C-:term:" "`contiguous` buffer. This includes all :class:`bytes`, :class:`bytearray`, " @@ -435,12 +435,11 @@ msgid "" "sending over a socket." msgstr "" "一個支援\\ :ref:`bufferobjects`\\ 且能夠匯出 C-:term:`contiguous` 緩衝區的物" -"件。這包括所有的 :class:`bytes`、\\ :class:`bytearray` 和 :class:`array." -"array` 物件,以及許多常見的 :class:`memoryview` 物件。類位元組串物件可用於處" -"理二進制資料的各種運算;這些運算包括壓縮、儲存至二進制檔案和透過 socket(插" -"座)發送。" +"件。這包括所有的 :class:`bytes`、:class:`bytearray` 和 :class:`array.array` " +"物件,以及許多常見的 :class:`memoryview` 物件。類位元組串物件可用於處理二進位" +"資料的各種運算;這些運算包括壓縮、儲存至二進位檔案和透過 socket(插座)發送。" -#: ../../glossary.rst:190 +#: ../../glossary.rst:191 msgid "" "Some operations need the binary data to be mutable. The documentation often " "refers to these as \"read-write bytes-like objects\". Example mutable " @@ -449,17 +448,17 @@ msgid "" "immutable objects (\"read-only bytes-like objects\"); examples of these " "include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." msgstr "" -"有些運算需要二進制資料是可變的。說明文件通常會將這些物件稱為「可讀寫的類位元" +"有些運算需要二進位資料是可變的。說明文件通常會將這些物件稱為「可讀寫的類位元" "組串物件」。可變緩衝區的物件包括 :class:`bytearray`,以及 :class:`bytearray` " -"的 :class:`memoryview`。其他的運算需要讓二進制資料被儲存在不可變物件(「唯讀" +"的 :class:`memoryview`。其他的運算需要讓二進位資料被儲存在不可變物件(「唯讀" "的類位元組串物件」)中;這些物件包括 :class:`bytes`,以及 :class:`bytes` 物件" "的 :class:`memoryview`。" -#: ../../glossary.rst:198 +#: ../../glossary.rst:199 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../glossary.rst:200 +#: ../../glossary.rst:201 msgid "" "Python source code is compiled into bytecode, the internal representation of " "a Python program in the CPython interpreter. The bytecode is also cached in " @@ -478,18 +477,18 @@ msgstr "" "上是無法在不同的 Python 虛擬機器之間運作的,也不能在不同版本的 Python 之間保" "持穩定。" -#: ../../glossary.rst:210 +#: ../../glossary.rst:211 msgid "" "A list of bytecode instructions can be found in the documentation for :ref:" "`the dis module `." msgstr "" "位元組碼的指令列表可以在 :ref:`dis 模組 `\\ 的說明文件中找到。" -#: ../../glossary.rst:212 +#: ../../glossary.rst:213 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../glossary.rst:214 +#: ../../glossary.rst:215 msgid "" "A callable is an object that can be called, possibly with a set of arguments " "(see :term:`argument`), with the following syntax::" @@ -499,7 +498,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:219 +#: ../../glossary.rst:220 msgid "" "A :term:`function`, and by extension a :term:`method`, is a callable. An " "instance of a class that implements the :meth:`~object.__call__` method is " @@ -508,22 +507,22 @@ msgstr "" "一個 :term:`function` 與其延伸的 :term:`method` 都是 callable。一個有實作 :" "meth:`~object.__call__` 方法的 class 之實例也是個 callable。" -#: ../../glossary.rst:222 +#: ../../glossary.rst:223 msgid "callback" msgstr "callback(回呼)" -#: ../../glossary.rst:224 +#: ../../glossary.rst:225 msgid "" "A subroutine function which is passed as an argument to be executed at some " "point in the future." msgstr "" "作為引數被傳遞的一個副程式 (subroutine) 函式,會在未來的某個時間點被執行。" -#: ../../glossary.rst:226 +#: ../../glossary.rst:227 msgid "class" msgstr "class(類別)" -#: ../../glossary.rst:228 +#: ../../glossary.rst:229 msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." @@ -531,11 +530,11 @@ msgstr "" "一個用於建立使用者定義物件的模板。Class 的定義通常會包含 method 的定義,這些 " "method 可以在 class 的實例上進行操作。" -#: ../../glossary.rst:231 +#: ../../glossary.rst:232 msgid "class variable" msgstr "class variable(類別變數)" -#: ../../glossary.rst:233 +#: ../../glossary.rst:234 msgid "" "A variable defined in a class and intended to be modified only at class " "level (i.e., not in an instance of the class)." @@ -543,11 +542,11 @@ msgstr "" "一個在 class 中被定義,且應該只能在 class 層次(意即不是在 class 的實例中)被" "修改的變數。" -#: ../../glossary.rst:235 +#: ../../glossary.rst:236 msgid "complex number" msgstr "complex number(複數)" -#: ../../glossary.rst:237 +#: ../../glossary.rst:238 msgid "" "An extension of the familiar real number system in which all numbers are " "expressed as a sum of a real part and an imaginary part. Imaginary numbers " @@ -567,23 +566,23 @@ msgstr "" "相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" "忽略它們。" -#: ../../glossary.rst:247 +#: ../../glossary.rst:248 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../glossary.rst:249 +#: ../../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`." msgstr "" "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" -"`__enter__` 和 :meth:`__exit__` method 來控制的。請參閱 :pep:`343`\\ 。" +"`__enter__` 和 :meth:`__exit__` method 來控制的。請參閱 :pep:`343`。" -#: ../../glossary.rst:252 +#: ../../glossary.rst:253 msgid "context variable" msgstr "context variable(情境變數)" -#: ../../glossary.rst:254 +#: ../../glossary.rst:255 msgid "" "A variable which can have different values depending on its context. This is " "similar to Thread-Local Storage in which each execution thread may have a " @@ -596,13 +595,13 @@ msgstr "" "Local Storage),在其中,一個變數在每個執行緒可能具有不同的值。然而,關於情境" "變數,在一個執行緒中可能會有多個情境,而情境變數的主要用途,是在並行的非同步" "任務 (concurrent asynchronous task) 中,對於變數狀態的追蹤。請參閱 :mod:" -"`contextvars`\\ 。" +"`contextvars`。" -#: ../../glossary.rst:261 +#: ../../glossary.rst:262 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../glossary.rst:265 +#: ../../glossary.rst:266 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -619,11 +618,11 @@ msgstr "" "的順序訪問各個項目時,最後一個索引的變化最快。然而,在 Fortran contiguous 陣" "列中,第一個索引的變化最快。" -#: ../../glossary.rst:273 +#: ../../glossary.rst:274 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../glossary.rst:275 +#: ../../glossary.rst:276 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -632,13 +631,13 @@ msgid "" msgstr "" "協程是副程式 (subroutine) 的一種更為廣義的形式。副程式是在某個時間點被進入並" "在另一個時間點被退出。協程可以在許多不同的時間點被進入、退出和回復。它們能夠" -"以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`\\ 。" +"以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`。" -#: ../../glossary.rst:280 +#: ../../glossary.rst:281 msgid "coroutine function" msgstr "coroutine function(協程函式)" -#: ../../glossary.rst:282 +#: ../../glossary.rst:283 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " "may be defined with the :keyword:`async def` statement, and may contain :" @@ -646,14 +645,14 @@ msgid "" "These were introduced by :pep:`492`." msgstr "" "一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能以 :keyword:" -"`async def` 陳述式被定義,並可能會包含 :keyword:`await`\\ 、\\ :keyword:" -"`async for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" +"`async def` 陳述式被定義,並可能會包含 :keyword:`await`、:keyword:`async " +"for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" -#: ../../glossary.rst:287 +#: ../../glossary.rst:288 msgid "CPython" msgstr "CPython" -#: ../../glossary.rst:289 +#: ../../glossary.rst:290 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\" " @@ -664,11 +663,11 @@ msgstr "" "`_ 上。「CPython」這個術語在必要時被使用,以區分此實" "作與其它語言的實作,例如 Jython 或 IronPython。" -#: ../../glossary.rst:293 +#: ../../glossary.rst:294 msgid "decorator" msgstr "decorator(裝飾器)" -#: ../../glossary.rst:295 +#: ../../glossary.rst:296 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " @@ -676,9 +675,9 @@ msgid "" msgstr "" "一個函式,它會回傳另一個函式,通常它會使用 ``@wrapper`` 語法,被應用為一種函" "式的變換 (function transformation)。裝飾器的常見範例是 :func:`classmethod` " -"和 :func:`staticmethod`\\ 。" +"和 :func:`staticmethod`。" -#: ../../glossary.rst:299 +#: ../../glossary.rst:300 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" @@ -687,7 +686,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:310 +#: ../../glossary.rst:311 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class " @@ -696,11 +695,11 @@ msgstr "" "Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" "ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" -#: ../../glossary.rst:313 +#: ../../glossary.rst:314 msgid "descriptor" msgstr "descriptor(描述器)" -#: ../../glossary.rst:315 +#: ../../glossary.rst:316 msgid "" "Any object which defines the methods :meth:`__get__`, :meth:`__set__`, or :" "meth:`__delete__`. When a class attribute is a descriptor, its special " @@ -712,27 +711,27 @@ msgid "" "including functions, methods, properties, class methods, static methods, and " "reference to super classes." msgstr "" -"任何定義了 :meth:`__get__`\\ 、\\ :meth:`__set__` 或 :meth:`__delete__` " -"method 的物件。當一個 class 屬性是一個描述器時,它的特殊連結行為會在屬性查找" -"時被觸發。通常,使用 *a.b* 來取得、設定或刪除某個屬性時,會在 *a* 的 class 字" -"典中查找名稱為 *b* 的物件,但如果 *b* 是一個描述器,則相對應的描述器 method " -"會被呼叫。對描述器的理解是深入理解 Python 的關鍵,因為它們是許多功能的基礎," -"這些功能包括函式、method、屬性 (property)、class method、靜態 method,以及對 " -"super class(父類別)的參照。" +"任何定義了 :meth:`__get__`、:meth:`__set__` 或 :meth:`__delete__` method 的物" +"件。當一個 class 屬性是一個描述器時,它的特殊連結行為會在屬性查找時被觸發。通" +"常,使用 *a.b* 來取得、設定或刪除某個屬性時,會在 *a* 的 class 字典中查找名稱" +"為 *b* 的物件,但如果 *b* 是一個描述器,則相對應的描述器 method 會被呼叫。對" +"描述器的理解是深入理解 Python 的關鍵,因為它們是許多功能的基礎,這些功能包括" +"函式、method、屬性 (property)、class method、靜態 method,以及對 super class" +"(父類別)的參照。" -#: ../../glossary.rst:325 +#: ../../glossary.rst:326 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." msgstr "" "關於描述器 method 的更多資訊,請參閱\\ :ref:`descriptors`\\ 或\\ :ref:`描述器" -"使用指南 `\\ 。" +"使用指南 `。" -#: ../../glossary.rst:327 +#: ../../glossary.rst:328 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../glossary.rst:329 +#: ../../glossary.rst:330 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`__hash__` and :meth:`__eq__` methods. Called a " @@ -742,11 +741,11 @@ msgstr "" "有 :meth:`__hash__` 和 :meth:`__eq__` method 的物件。在 Perl 中被稱為雜湊 " "(hash)。" -#: ../../glossary.rst:332 +#: ../../glossary.rst:333 msgid "dictionary comprehension" msgstr "dictionary comprehension(字典綜合運算)" -#: ../../glossary.rst:334 +#: ../../glossary.rst:335 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " @@ -755,13 +754,13 @@ msgid "" msgstr "" "一種緊密的方法,用來處理一個可疊代物件中的全部或部分元素,並將處理結果以一個" "字典回傳。``results = {n: n ** 2 for n in range(10)}`` 會產生一個字典,它包含" -"了鍵 ``n`` 映射到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`\\ 。" +"了鍵 ``n`` 映射到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:338 +#: ../../glossary.rst:339 msgid "dictionary view" msgstr "dictionary view(字典檢視)" -#: ../../glossary.rst:340 +#: ../../glossary.rst:341 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" "`dict.items` are called dictionary views. They provide a dynamic view on the " @@ -769,16 +768,16 @@ msgid "" "reflects these changes. To force the dictionary view to become a full list " "use ``list(dictview)``. See :ref:`dict-views`." msgstr "" -"從 :meth:`dict.keys`\\ 、\\ :meth:`dict.values` 及 :meth:`dict.items` 回傳的" -"物件被稱為字典檢視。它們提供了字典中項目的動態檢視,這表示當字典有變動時,該" -"檢視會反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " -"``list(dictview)``。請參閱\\ :ref:`dict-views`\\ 。" +"從 :meth:`dict.keys`、:meth:`dict.values` 及 :meth:`dict.items` 回傳的物件被" +"稱為字典檢視。它們提供了字典中項目的動態檢視,這表示當字典有變動時,該檢視會" +"反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " +"``list(dictview)``。請參閱\\ :ref:`dict-views`。" -#: ../../glossary.rst:346 +#: ../../glossary.rst:347 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../glossary.rst:348 +#: ../../glossary.rst:349 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " @@ -791,11 +790,11 @@ msgstr "" "`__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏覽,因此它是物" "件的說明文件存放的標準位置。" -#: ../../glossary.rst:354 +#: ../../glossary.rst:355 msgid "duck-typing" msgstr "duck-typing(鴨子型別)" -#: ../../glossary.rst:356 +#: ../../glossary.rst:357 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " @@ -816,11 +815,11 @@ msgstr "" "來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:`EAFP` 程式設計" "風格。" -#: ../../glossary.rst:365 +#: ../../glossary.rst:366 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:367 +#: ../../glossary.rst:368 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -835,11 +834,11 @@ msgstr "" "keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" "格形成了對比。" -#: ../../glossary.rst:373 +#: ../../glossary.rst:374 msgid "expression" msgstr "expression(運算式)" -#: ../../glossary.rst:375 +#: ../../glossary.rst:376 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -852,14 +851,14 @@ msgstr "" "一段可以被評估並求值的語法。換句話說,一個運算式就是文字、名稱、屬性存取、運" "算子或函式呼叫等運算式元件的累積,而這些元件都能回傳一個值。與許多其他語言不" "同的是,並非所有的 Python 語言構造都是運算式。另外有一些 :term:`statement`\\ " -"(陳述式)不能被用作運算式,例如 :keyword:`while`\\ 。賦值 (assignment) 也是" -"陳述式,而不是運算式。" +"(陳述式)不能被用作運算式,例如 :keyword:`while`。賦值 (assignment) 也是陳述" +"式,而不是運算式。" -#: ../../glossary.rst:382 +#: ../../glossary.rst:383 msgid "extension module" msgstr "extension module(擴充模組)" -#: ../../glossary.rst:384 +#: ../../glossary.rst:385 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." @@ -867,24 +866,24 @@ msgstr "" "一個以 C 或 C++ 編寫的模組,它使用 Python 的 C API 來與核心及使用者程式碼進行" "互動。" -#: ../../glossary.rst:386 +#: ../../glossary.rst:387 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../glossary.rst:388 +#: ../../glossary.rst:389 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " "See also :pep:`498`." msgstr "" "以 ``'f'`` 或 ``'F'`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式" -"化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`\\ 。" +"化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`。" -#: ../../glossary.rst:391 +#: ../../glossary.rst:392 msgid "file object" msgstr "file object(檔案物件)" -#: ../../glossary.rst:393 +#: ../../glossary.rst:394 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`read()` " "or :meth:`write()`) to an underlying resource. Depending on the way it was " @@ -897,9 +896,9 @@ msgstr "" "`write()` 等 method)來操作底層資源的物件。根據檔案物件被建立的方式,它能夠協" "調對真實磁碟檔案或是其他類型的儲存器或通訊裝置(例如標準輸入/輸出、記憶體內" "緩衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔" -"案物件 (file-like object)` 或\\ :dfn:`串流 (stream)`\\ 。" +"案物件 (file-like object)` 或\\ :dfn:`串流 (stream)`。" -#: ../../glossary.rst:401 +#: ../../glossary.rst:402 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -907,24 +906,23 @@ msgid "" "The canonical way to create a file object is by using the :func:`open` " "function." msgstr "" -"實際上,有三種檔案物件:原始的\\ :term:`二進制檔案 `\\ 、緩衝的" -"\\ :term:`二進制檔案 `\\ 和\\ :term:`文字檔案 `\\ 。" -"它們的介面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:" -"`open` 函式。" +"實際上,有三種檔案物件:原始的\\ :term:`二進位檔案 `、緩衝的\\ :" +"term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們的介" +"面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函式。" -#: ../../glossary.rst:406 +#: ../../glossary.rst:407 msgid "file-like object" msgstr "file-like object(類檔案物件)" -#: ../../glossary.rst:408 +#: ../../glossary.rst:409 msgid "A synonym for :term:`file object`." msgstr ":term:`file object`\\ (檔案物件)的同義字。" -#: ../../glossary.rst:409 +#: ../../glossary.rst:410 msgid "filesystem encoding and error handler" msgstr "filesystem encoding and error handler(檔案系統編碼和錯誤處理函式)" -#: ../../glossary.rst:411 +#: ../../glossary.rst:412 msgid "" "Encoding and error handler used by Python to decode bytes from the operating " "system and encode Unicode to the operating system." @@ -932,16 +930,16 @@ msgstr "" "Python 所使用的一種編碼和錯誤處理函式,用來解碼來自作業系統的位元組,以及將 " "Unicode 編碼到作業系統。" -#: ../../glossary.rst:414 +#: ../../glossary.rst:415 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " "functions can raise :exc:`UnicodeError`." msgstr "" "檔案系統編碼必須保證能成功解碼所有小於 128 的位元組。如果檔案系統編碼無法提供" -"此保證,則 API 函式會引發 :exc:`UnicodeError`\\ 。" +"此保證,則 API 函式會引發 :exc:`UnicodeError`。" -#: ../../glossary.rst:418 +#: ../../glossary.rst:419 msgid "" "The :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors` functions can be used to get the filesystem " @@ -950,7 +948,7 @@ msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" -#: ../../glossary.rst:422 +#: ../../glossary.rst:423 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " "startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." @@ -959,44 +957,44 @@ msgid "" msgstr "" ":term:`filesystem encoding and error handler`\\ (檔案系統編碼和錯誤處理函" "式)會在 Python 啟動時由 :c:func:`PyConfig_Read` 函式來配置:請參閱 :c:" -"member:`~PyConfig.filesystem_encoding`\\ ,以及 :c:type:`PyConfig` 的成員 :c:" -"member:`~PyConfig.filesystem_errors`\\ 。" +"member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成員 :c:" +"member:`~PyConfig.filesystem_errors`。" -#: ../../glossary.rst:427 +#: ../../glossary.rst:428 msgid "See also the :term:`locale encoding`." msgstr "另請參閱 :term:`locale encoding`\\ (區域編碼)。" -#: ../../glossary.rst:428 +#: ../../glossary.rst:429 msgid "finder" msgstr "finder(尋檢器)" -#: ../../glossary.rst:430 +#: ../../glossary.rst:431 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "一個物件,它會嘗試為正在被 import 的模組尋找 :term:`loader`\\ (載入器)。" -#: ../../glossary.rst:433 +#: ../../glossary.rst:434 msgid "" "Since Python 3.3, there are two types of finder: :term:`meta path finders " "` for use with :data:`sys.meta_path`, and :term:`path " "entry finders ` for use with :data:`sys.path_hooks`." msgstr "" "從 Python 3.3 開始,有兩種類型的尋檢器:\\ :term:`元路徑尋檢器 (meta path " -"finder) ` 會使用 :data:`sys.meta_path`\\ ,而\\ :term:`路徑" -"項目尋檢器 (path entry finder) ` 會使用 :data:`sys." -"path_hooks`\\ 。" +"finder) ` 會使用 :data:`sys.meta_path`,而\\ :term:`路徑項" +"目尋檢器 (path entry finder) ` 會使用 :data:`sys." +"path_hooks`。" -#: ../../glossary.rst:437 +#: ../../glossary.rst:438 msgid "See :pep:`302`, :pep:`420` and :pep:`451` for much more detail." -msgstr "請參閱 :pep:`302`\\ 、\\ :pep:`420` 和 :pep:`451` 以了解更多細節。" +msgstr "請參閱 :pep:`302`、:pep:`420` 和 :pep:`451` 以了解更多細節。" -#: ../../glossary.rst:438 +#: ../../glossary.rst:439 msgid "floor division" msgstr "floor division(向下取整除法)" -#: ../../glossary.rst:440 +#: ../../glossary.rst:441 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -1007,13 +1005,13 @@ msgstr "" "向下無條件捨去到最接近整數的數學除法。向下取整除法的運算子是 ``//``。例如,運" "算式 ``11 // 4`` 的計算結果為 ``2``,與 float(浮點數)真除法所回傳的 " "``2.75`` 不同。請注意,``(-11) // 4`` 的結果是 ``-3``,因為是 ``-2.75`` 被\\ " -"*向下*\\ 無條件捨去。請參閱 :pep:`238`\\ 。" +"*向下*\\ 無條件捨去。請參閱 :pep:`238`。" -#: ../../glossary.rst:445 +#: ../../glossary.rst:446 msgid "function" msgstr "function(函式)" -#: ../../glossary.rst:447 +#: ../../glossary.rst:448 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " @@ -1021,19 +1019,19 @@ msgid "" "ref:`function` section." msgstr "" "一連串的陳述式,它能夠向呼叫者回傳一些值。它也可以被傳遞零個或多個\\ :term:`" -"引數 `\\ ,這些引數可被使用於函式本體的執行。另請參閱 :term:" +"引數 `,這些引數可被使用於函式本體的執行。另請參閱 :term:" "`parameter`\\ (參數)、\\ :term:`method`\\ (方法),以及\\ :ref:" "`function`\\ 章節。" -#: ../../glossary.rst:451 +#: ../../glossary.rst:452 msgid "function annotation" msgstr "function annotation(函式註釋)" -#: ../../glossary.rst:453 +#: ../../glossary.rst:454 msgid "An :term:`annotation` of a function parameter or return value." msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:455 +#: ../../glossary.rst:456 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -1044,24 +1042,24 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:463 +#: ../../glossary.rst:464 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" -#: ../../glossary.rst:465 +#: ../../glossary.rst:466 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " "working with annotations." msgstr "" -"請參閱 :term:`variable annotation` 和 :pep:`484`\\ ,皆有此功能的描述。關於註" -"釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`\\ 。" +"請參閱 :term:`variable annotation` 和 :pep:`484`,皆有此功能的描述。關於註釋" +"的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:469 +#: ../../glossary.rst:470 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:471 +#: ../../glossary.rst:472 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " @@ -1079,11 +1077,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:482 +#: ../../glossary.rst:483 msgid "garbage collection" msgstr "garbage collection(垃圾回收)" -#: ../../glossary.rst:484 +#: ../../glossary.rst:485 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1095,11 +1093,11 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:489 ../../glossary.rst:490 +#: ../../glossary.rst:490 ../../glossary.rst:491 msgid "generator" msgstr "generator(產生器)" -#: ../../glossary.rst:492 +#: ../../glossary.rst:493 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1110,24 +1108,24 @@ msgstr "" "個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," "這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" -#: ../../glossary.rst:497 +#: ../../glossary.rst:498 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " "clear, using the full terms avoids ambiguity." msgstr "" "這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" -"代器*\\ 。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" +"代器*。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:500 +#: ../../glossary.rst:501 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" -#: ../../glossary.rst:502 +#: ../../glossary.rst:503 msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" -#: ../../glossary.rst:504 +#: ../../glossary.rst:505 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" @@ -1138,11 +1136,11 @@ msgstr "" "中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" "那些每次調用時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:510 ../../glossary.rst:511 +#: ../../glossary.rst:511 ../../glossary.rst:512 msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../glossary.rst:513 +#: ../../glossary.rst:514 msgid "" "An expression that returns an iterator. It looks like a normal expression " "followed by a :keyword:`!for` clause defining a loop variable, range, and an " @@ -1155,11 +1153,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:520 +#: ../../glossary.rst:521 msgid "generic function" msgstr "generic function(泛型函式)" -#: ../../glossary.rst:522 +#: ../../glossary.rst:523 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1168,49 +1166,49 @@ msgstr "" "一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" "用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" -#: ../../glossary.rst:526 +#: ../../glossary.rst:527 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." msgstr "" "另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、\\ :func:" -"`functools.singledispatch` 裝飾器和 :pep:`443`\\ 。" +"`functools.singledispatch` 裝飾器和 :pep:`443`。" -#: ../../glossary.rst:528 +#: ../../glossary.rst:529 msgid "generic type" msgstr "generic type(泛型型別)" -#: ../../glossary.rst:530 +#: ../../glossary.rst:531 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" "term:`type hints ` and :term:`annotations `." msgstr "" "一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一個 :ref:" -"`容器型別 `\\ ,像是 :class:`list` 和 :class:`dict`。它被用於" -"\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `\\ 。" +"`容器型別 `,像是 :class:`list` 和 :class:`dict`。它被用於" +"\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" -#: ../../glossary.rst:535 +#: ../../glossary.rst:536 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." msgstr "" -"詳情請參閱\\ :ref:`泛型別名型別 `\\ 、\\ :pep:" -"`483`\\ 、\\ :pep:`484`\\ 、\\ :pep:`585` 和 :mod:`typing` 模組。" +"詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:" +"`484`、:pep:`585` 和 :mod:`typing` 模組。" -#: ../../glossary.rst:537 +#: ../../glossary.rst:538 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:539 +#: ../../glossary.rst:540 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:540 +#: ../../glossary.rst:541 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:542 +#: ../../glossary.rst:543 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1227,7 +1225,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:551 +#: ../../glossary.rst:552 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally intensive tasks " @@ -1238,7 +1236,7 @@ msgstr "" "計算密集 (computationally intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:556 +#: ../../glossary.rst:557 msgid "" "Past efforts to create a \"free-threaded\" interpreter (one which locks " "shared data at a much finer granularity) have not been successful because " @@ -1250,24 +1248,24 @@ msgstr "" "力並未成功,因為在一般的單一處理器情況下,效能會有所損失。一般認為,若要克服" "這個效能問題,會使實作變得複雜許多,進而付出更高的維護成本。" -#: ../../glossary.rst:562 +#: ../../glossary.rst:563 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:564 +#: ../../glossary.rst:565 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" "invalidation`." msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" -"間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`\\ 。" +"間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`。" -#: ../../glossary.rst:567 +#: ../../glossary.rst:568 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:569 +#: ../../glossary.rst:570 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`__hash__` method), and can be compared to " @@ -1279,7 +1277,7 @@ msgstr "" "method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的多個可雜湊物件," "它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:574 +#: ../../glossary.rst:575 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1287,7 +1285,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:577 +#: ../../glossary.rst:578 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1300,13 +1298,13 @@ msgstr "" "dictionary)並不是;而不可變的容器(例如 tuple(元組)和 frozenset),只有當" "它們的元素是可雜湊的,它們本身才是可雜湊的。若物件是使用者自定 class 的實例," "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" -"較),而它們的雜湊值則是衍生自它們的 :func:`id`\\ 。" +"較),而它們的雜湊值則是衍生自它們的 :func:`id`。" -#: ../../glossary.rst:584 +#: ../../glossary.rst:585 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:586 +#: ../../glossary.rst:587 msgid "" "An Integrated Development and Learning Environment for Python. :ref:`idle` " "is a basic editor and interpreter environment which ships with the standard " @@ -1316,11 +1314,11 @@ msgstr "" "境)。:ref:`idle` 是一個基本的編輯器和直譯器環境,它和 Python 的標準發行版本" "一起被提供。" -#: ../../glossary.rst:589 +#: ../../glossary.rst:590 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:591 +#: ../../glossary.rst:592 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1332,11 +1330,11 @@ msgstr "" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" -#: ../../glossary.rst:596 +#: ../../glossary.rst:597 msgid "import path" msgstr "import path(引入路徑)" -#: ../../glossary.rst:598 +#: ../../glossary.rst:599 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1345,14 +1343,14 @@ msgid "" msgstr "" "一個位置(或\\ :term:`路徑項目 `\\ )的列表,而那些位置就是在 " "import 模組時,會被 :term:`path based finder`\\ (基於路徑的尋檢器)搜尋模組" -"的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`\\ ,但對於子套" -"件 (subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" +"的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`,但對於子套件 " +"(subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:603 +#: ../../glossary.rst:604 msgid "importing" msgstr "importing(引入)" -#: ../../glossary.rst:605 +#: ../../glossary.rst:606 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1360,11 +1358,11 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:607 +#: ../../glossary.rst:608 msgid "importer" msgstr "importer(引入器)" -#: ../../glossary.rst:609 +#: ../../glossary.rst:610 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1372,11 +1370,11 @@ msgstr "" "一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" "`loader`\\ (載入器)物件。" -#: ../../glossary.rst:611 +#: ../../glossary.rst:612 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:613 +#: ../../glossary.rst:614 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1389,11 +1387,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模塊和包的非常強大的方法(請" "記住help(x))。" -#: ../../glossary.rst:619 +#: ../../glossary.rst:620 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:621 +#: ../../glossary.rst:622 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1407,11 +1405,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:628 +#: ../../glossary.rst:629 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:630 +#: ../../glossary.rst:631 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1424,23 +1422,23 @@ msgid "" msgstr "" "當 Python 直譯器被要求關閉時,它會進入一個特殊階段,在此它逐漸釋放所有被配置" "的資源,例如模組和各種關鍵內部結構。它也會多次呼叫\\ :term:`垃圾回收器 " -"(garbage collector) `\\ 。這能夠觸發使用者自定的解構函式 " +"(garbage collector) `。這能夠觸發使用者自定的解構函式 " "(destructor) 或弱引用的回呼 (weakref callback),並執行其中的程式碼。在關閉階" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:639 +#: ../../glossary.rst:640 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:641 +#: ../../glossary.rst:642 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:643 +#: ../../glossary.rst:644 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1450,13 +1448,12 @@ msgid "" "term:`sequence` semantics." msgstr "" "一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" -"是 :class:`list`\\ 、\\ :class:`str` 和 :class:`tuple`\\ )和某些非序列型別," -"像是 :class:`dict`\\ 、\\ :term:`檔案物件 `\\ ,以及你所定義的任" -"何 class 物件,只要那些 class 有 :meth:`__iter__` method 或是實作 :term:" -"`sequence`\\ (序列)語意的 :meth:`__getitem__` method,該物件就是可疊代物" -"件。" +"是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像是 :" +"class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物件," +"只要那些 class 有 :meth:`__iter__` method 或是實作 :term:`sequence`\\ (序" +"列)語意的 :meth:`__getitem__` method,該物件就是可疊代物件。" -#: ../../glossary.rst:650 +#: ../../glossary.rst:651 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1469,18 +1466,18 @@ msgid "" "also :term:`iterator`, :term:`sequence`, and :term:`generator`." msgstr "" "可疊代物件可用於 :keyword:`for` 迴圈和許多其他需要一個序列的地方 (:func:" -"`zip`\\ 、\\ :func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函式 :" -"func:`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行一遍 " -"(one pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理疊代器" -"物件。``for`` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變數," -"用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、\\ :term:" +"`zip`、:func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函式 :func:" +"`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行一遍 (one " +"pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理疊代器物" +"件。``for`` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變數,用" +"於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:term:" "`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:660 +#: ../../glossary.rst:661 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:662 +#: ../../glossary.rst:663 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1501,19 +1498,19 @@ msgstr "" "(或是將它傳遞給內建函式 :func:`next`\\ )會依序回傳資料流中的各項目。當不再" "有資料時,則會引發 :exc:`StopIteration` 例外。此時,該疊代器物件已被用盡,而" "任何對其 :meth:`__next__` method 的進一步呼叫,都只會再次引發 :exc:" -"`StopIteration`\\ 。疊代器必須有一個 :meth:`__iter__` method,它會回傳疊代器" -"物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊代物件" -"的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程式碼。" -"一個容器物件(像是 :class:`list`\\ )在每次你將它傳遞給 :func:`iter` 函式或" -"在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊代器。使用疊代器嘗試此" -"事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" -"件,使其看起來就像一個空的容器。" - -#: ../../glossary.rst:677 +"`StopIteration`。疊代器必須有一個 :meth:`__iter__` method,它會回傳疊代器物件" +"本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊代物件的場" +"合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程式碼。一個" +"容器物件(像是 :class:`list`)在每次你將它傳遞給 :func:`iter` 函式或在 :" +"keyword:`for` 迴圈中使用它時,都會產生一個全新的疊代器。使用疊代器嘗試此事" +"(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物件," +"使其看起來就像一個空的容器。" + +#: ../../glossary.rst:678 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:681 +#: ../../glossary.rst:682 msgid "" "CPython does not consistently apply the requirement that an iterator define :" "meth:`__iter__`." @@ -1521,11 +1518,11 @@ msgstr "" "CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`__iter__`\\ 」這個規" "定。" -#: ../../glossary.rst:683 +#: ../../glossary.rst:684 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:685 +#: ../../glossary.rst:686 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1535,7 +1532,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,\\ :func:`locale." "strxfrm` 被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:690 +#: ../../glossary.rst:691 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1543,11 +1540,11 @@ msgid "" "nlargest`, and :func:`itertools.groupby`." msgstr "" "Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包括 :" -"func:`min`\\ 、\\ :func:`max`\\ 、\\ :func:`sorted`\\ 、\\ :meth:`list." -"sort`\\ 、\\ :func:`heapq.merge`\\ 、\\ :func:`heapq.nsmallest`\\ 、\\ :func:" -"`heapq.nlargest` 和 :func:`itertools.groupby`\\ 。" +"func:`min`、:func:`max`、:func:`sorted`、:meth:`list.sort`、:func:`heapq." +"merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." +"groupby`。" -#: ../../glossary.rst:696 +#: ../../glossary.rst:697 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.lower` method can serve as a key function for case insensitive sorts. " @@ -1557,26 +1554,26 @@ msgid "" "are three key function constructors. See the :ref:`Sorting HOW TO " "` for examples of how to create and use key functions." msgstr "" -"有幾種方法可以建立一個鍵函式。例如,\\ :meth:`str.lower` method 可以作為不分" -"大小寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被建造," -"例如 ``lambda r: (r[0], r[2])``。另外,:func:`operator.attrgetter`\\ 、\\ :" -"func:`operator.itemgetter` 和 :func:`operator.methodcaller` 為三個鍵函式的建" -"構函式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排" -"序 `\\ 。" +"有幾種方法可以建立一個鍵函式。例如,:meth:`str.lower` method 可以作為不分大小" +"寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被建造,例" +"如 ``lambda r: (r[0], r[2])``。另外,:func:`operator.attrgetter`、:func:" +"`operator.itemgetter` 和 :func:`operator.methodcaller` 為三個鍵函式的建構函" +"式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " +"`。" -#: ../../glossary.rst:703 +#: ../../glossary.rst:704 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:705 ../../glossary.rst:994 +#: ../../glossary.rst:706 ../../glossary.rst:995 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:706 +#: ../../glossary.rst:707 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:708 +#: ../../glossary.rst:709 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1586,11 +1583,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``" -#: ../../glossary.rst:711 +#: ../../glossary.rst:712 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:713 +#: ../../glossary.rst:714 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1601,7 +1598,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:718 +#: ../../glossary.rst:719 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1615,11 +1612,11 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" -#: ../../glossary.rst:723 +#: ../../glossary.rst:724 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:725 +#: ../../glossary.rst:726 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" "`locale.setlocale(locale.LC_CTYPE, new_locale) `." @@ -1627,28 +1624,28 @@ msgstr "" "在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." "setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" -#: ../../glossary.rst:728 +#: ../../glossary.rst:729 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "在 Windows 上,它是 ANSI 代碼頁(code page,例如 ``\"cp1252\"``\\ )。" -#: ../../glossary.rst:730 +#: ../../glossary.rst:731 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作為區域編碼。" -#: ../../glossary.rst:732 +#: ../../glossary.rst:733 msgid "``locale.getencoding()`` can be used to get the locale encoding." msgstr "``locale.getencoding()`` 可以用來取得區域編碼。" -#: ../../glossary.rst:734 +#: ../../glossary.rst:735 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "也請參考 :term:`filesystem encoding and error handler`。" -#: ../../glossary.rst:735 +#: ../../glossary.rst:736 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:737 +#: ../../glossary.rst:738 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -1658,11 +1655,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 O(1)。" -#: ../../glossary.rst:740 +#: ../../glossary.rst:741 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:742 +#: ../../glossary.rst:743 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1672,15 +1669,15 @@ msgid "" msgstr "" "一種用來處理一個序列中的全部或部分元素,並將處理結果以一個 list 回傳的簡要方" "法。``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` 會產" -"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 (0x..)。\\ :" +"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 (0x..)。:" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:748 +#: ../../glossary.rst:749 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:750 +#: ../../glossary.rst:751 msgid "" "An object that loads a module. It must define a method named :meth:" "`load_module`. A loader is typically returned by a :term:`finder`. See :pep:" @@ -1690,21 +1687,21 @@ msgstr "" "一個能夠載入模組的物件。它必須定義一個名為 :meth:`load_module` 的 method(方" "法)。載入器通常是被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱 :pep:" "`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" -"`importlib.abc.Loader`\\ 。" +"`importlib.abc.Loader`。" -#: ../../glossary.rst:754 +#: ../../glossary.rst:755 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:758 +#: ../../glossary.rst:759 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:759 +#: ../../glossary.rst:760 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:761 +#: ../../glossary.rst:762 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`collections.abc.Mapping` or :class:" @@ -1714,16 +1711,16 @@ msgid "" "`collections.Counter`." msgstr "" "一個容器物件,它支援任意鍵的查找,且能實作 :ref:`abstract base classes(抽象" -"基底類別) `\\ 中,\\ :class:`collections." +"基底類別) `\\ 中,:class:`collections." "abc.Mapping` 或 :class:`collections.abc.MutableMapping` 所指定的 method。範例" -"包括 :class:`dict`\\ 、\\ :class:`collections.defaultdict`\\ 、\\ :class:" -"`collections.OrderedDict` 和 :class:`collections.Counter`\\ 。" +"包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." +"OrderedDict` 和 :class:`collections.Counter`。" -#: ../../glossary.rst:767 +#: ../../glossary.rst:768 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:769 +#: ../../glossary.rst:770 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:773 +#: ../../glossary.rst:774 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" -"關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc." -"MetaPathFinder`\\ 。" +"關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`。" -#: ../../glossary.rst:775 +#: ../../glossary.rst:776 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:777 +#: ../../glossary.rst:778 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -1765,15 +1761,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:787 +#: ../../glossary.rst:788 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:756 ../../glossary.rst:788 ../../glossary.rst:1120 +#: ../../glossary.rst:757 ../../glossary.rst:789 ../../glossary.rst:1123 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:790 +#: ../../glossary.rst:791 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -1785,11 +1781,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:794 +#: ../../glossary.rst:795 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:796 +#: ../../glossary.rst:797 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See `The Python 2.3 Method Resolution Order `_\\ 。" +"析順序 `_。" -#: ../../glossary.rst:800 +#: ../../glossary.rst:801 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:802 +#: ../../glossary.rst:803 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -1814,15 +1810,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:806 +#: ../../glossary.rst:807 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:807 +#: ../../glossary.rst:808 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:809 +#: ../../glossary.rst:810 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -1830,31 +1826,31 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:811 +#: ../../glossary.rst:812 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:813 +#: ../../glossary.rst:814 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:814 +#: ../../glossary.rst:815 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:816 +#: ../../glossary.rst:817 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." msgstr "" -"可變物件可以改變它們的值,但維持它們的 :func:`id`\\ 。另請參閱 :term:" +"可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參閱 :term:" "`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:818 +#: ../../glossary.rst:819 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:820 +#: ../../glossary.rst:821 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -1864,18 +1860,18 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:824 +#: ../../glossary.rst:825 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." "float_info`::" msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " -"回傳的值。另一個例子是 :data:`sys.float_info`\\ :\n" +"回傳的值。另一個例子是 :data:`sys.float_info`:\n" "\n" "::" -#: ../../glossary.rst:835 +#: ../../glossary.rst:836 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -1885,17 +1881,17 @@ msgid "" "methods that may not be found in hand-written or built-in named tuples." msgstr "" "有些 named tuple 是內建型別(如上例)。或者,一個 named tuple 也可以從一個正" -"規的 class 定義來建立,只要該 class 是繼承自 :class:`tuple`\\ ,且定義了附名" -"欄位 (named field) 即可。這類的 class 可以手工編寫,也可以使用工廠函式 " +"規的 class 定義來建立,只要該 class 是繼承自 :class:`tuple`,且定義了附名欄" +"位 (named field) 即可。這類的 class 可以手工編寫,也可以使用工廠函式 " "(factory function) :func:`collections.namedtuple` 來建立。後者技術也增加了一" "些額外的 method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到" "的。" -#: ../../glossary.rst:842 +#: ../../glossary.rst:843 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:844 +#: ../../glossary.rst:845 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -1915,11 +1911,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:854 +#: ../../glossary.rst:855 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:856 +#: ../../glossary.rst:857 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -1930,15 +1926,15 @@ msgstr "" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:861 +#: ../../glossary.rst:862 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:862 +#: ../../glossary.rst:863 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:864 +#: ../../glossary.rst:865 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -1950,14 +1946,14 @@ msgstr "" "能夠參照外層定義 (enclosing definition) 中的變數的能力。舉例來說,一個函式如" "果是在另一個函式中被定義,則它便能夠參照外層函式中的變數。請注意,在預設情況" "下,巢狀作用域僅適用於參照,而無法用於賦值。區域變數能在最內層作用域中讀取及" -"寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。\\ :keyword:`nonlocal` 容" -"許對外層作用域進行寫入。" +"寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" +"對外層作用域進行寫入。" -#: ../../glossary.rst:871 +#: ../../glossary.rst:872 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:873 +#: ../../glossary.rst:874 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -1966,14 +1962,14 @@ msgid "" msgstr "" "一個舊名,它是指現在所有的 class 物件所使用的 class 風格。在早期的 Python 版" "本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像是 :attr:`~object." -"__slots__`\\ 、描述器 (descriptor)、屬性 (property)、\\ :meth:" -"`__getattribute__`\\ 、class method(類別方法)和 static method(靜態方法)。" +"__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`__getattribute__`、" +"class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:877 +#: ../../glossary.rst:878 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:879 +#: ../../glossary.rst:880 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -1981,11 +1977,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:882 +#: ../../glossary.rst:883 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:884 +#: ../../glossary.rst:885 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -1995,17 +1991,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:888 +#: ../../glossary.rst:889 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:889 +#: ../../glossary.rst:890 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:891 +#: ../../glossary.rst:892 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2015,7 +2011,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:895 +#: ../../glossary.rst:896 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2028,7 +2024,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:904 +#: ../../glossary.rst:905 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2041,7 +2037,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:913 +#: ../../glossary.rst:914 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2056,7 +2052,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:921 +#: ../../glossary.rst:922 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2070,7 +2066,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:929 +#: ../../glossary.rst:930 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2081,14 +2077,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:935 +#: ../../glossary.rst:936 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:938 +#: ../../glossary.rst:939 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2096,14 +2092,14 @@ msgid "" "`362`." msgstr "" "另請參閱術語表的 :term:`argument`\\ (引數)條目、常見問題中的\\ :ref:`引數和" -"參數之間的差異 `\\ 、\\ :class:`inspect." -"Parameter` class、\\ :ref:`function`\\ 章節,以及 :pep:`362`\\ 。" +"參數之間的差異 `、:class:`inspect.Parameter` " +"class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:942 +#: ../../glossary.rst:943 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:944 +#: ../../glossary.rst:945 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2111,33 +2107,33 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:946 +#: ../../glossary.rst:947 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:948 +#: ../../glossary.rst:949 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" "`path entry`." msgstr "" "被 :data:`sys.path_hooks` 中的一個可呼叫物件 (callable)(意即一個 :term:" -"`path entry hook`\\ )所回傳的一種 :term:`finder`\\ ,它知道如何以一個 :term:" +"`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:952 +#: ../../glossary.rst:953 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." -"PathEntryFinder`\\ 。" +"PathEntryFinder`。" -#: ../../glossary.rst:954 +#: ../../glossary.rst:955 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:956 +#: ../../glossary.rst:957 msgid "" "A callable on the :data:`sys.path_hook` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2147,11 +2143,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:959 +#: ../../glossary.rst:960 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:961 +#: ../../glossary.rst:962 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2159,11 +2155,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:963 +#: ../../glossary.rst:964 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:965 +#: ../../glossary.rst:966 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2181,11 +2177,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:973 +#: ../../glossary.rst:974 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:975 +#: ../../glossary.rst:976 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2196,7 +2192,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:981 +#: ../../glossary.rst:982 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2208,15 +2204,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:987 +#: ../../glossary.rst:988 msgid "See :pep:`1`." -msgstr "請參閱 :pep:`1`\\ 。" +msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:988 +#: ../../glossary.rst:989 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:990 +#: ../../glossary.rst:991 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2224,15 +2220,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:992 +#: ../../glossary.rst:993 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:995 +#: ../../glossary.rst:996 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:997 +#: ../../glossary.rst:998 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2248,7 +2244,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1006 +#: ../../glossary.rst:1007 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2257,7 +2253,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1010 +#: ../../glossary.rst:1011 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2266,19 +2262,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1013 +#: ../../glossary.rst:1014 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1015 +#: ../../glossary.rst:1016 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1016 +#: ../../glossary.rst:1017 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1018 +#: ../../glossary.rst:1019 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2287,11 +2283,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1021 +#: ../../glossary.rst:1022 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1023 +#: ../../glossary.rst:1024 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2307,18 +2303,18 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1033 +#: ../../glossary.rst:1034 msgid "As opposed to the cleaner, Pythonic method::" msgstr "" "相較之下,以下方法更簡潔、更具有 Python 風格:\n" "\n" "::" -#: ../../glossary.rst:1037 +#: ../../glossary.rst:1038 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1039 +#: ../../glossary.rst:1040 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2331,7 +2327,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1056 +#: ../../glossary.rst:1057 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2342,28 +2338,31 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1063 +#: ../../glossary.rst:1064 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1065 +#: ../../glossary.rst:1066 msgid "" "The number of references to an object. When the reference count of an " -"object drops to zero, it is deallocated. Reference counting is generally " -"not visible to Python code, but it is a key element of the :term:`CPython` " -"implementation. Programmers can call the :func:`sys.getrefcount` function " -"to return the reference count for a particular object." +"object drops to zero, it is deallocated. Some objects are \"immortal\" and " +"have reference counts that are never modified, and therefore the objects are " +"never deallocated. Reference counting is generally not visible to Python " +"code, but it is a key element of the :term:`CPython` implementation. " +"Programmers can call the :func:`sys.getrefcount` function to return the " +"reference count for a particular object." msgstr "" "對於一個物件的參照次數。當一個物件的參照計數下降到零時,它會被解除配置 " -"(deallocated)。參照計數通常在 Python 程式碼中看不到,但它卻是 :term:" +"(deallocated)。有些物件是「不滅的 (immortal)」並擁有不會被改變的參照計數,也" +"因此永遠不會被解除配置。參照計數通常在 Python 程式碼中看不到,但它卻是 :term:" "`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :func:`~sys.getrefcount` 函" "式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1071 +#: ../../glossary.rst:1074 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1073 +#: ../../glossary.rst:1076 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2371,15 +2370,15 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1076 +#: ../../glossary.rst:1079 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1077 +#: ../../glossary.rst:1080 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1079 +#: ../../glossary.rst:1082 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2392,11 +2391,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1084 +#: ../../glossary.rst:1087 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1086 +#: ../../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:" @@ -2408,13 +2407,12 @@ msgid "" 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` 鍵,而不是整數。" +"`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:`list`、:" +"class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :class:`dict` 也" +"支援 :meth:`__getitem__` 和 :meth:`__len__`,但它被視為對映 (mapping) 而不是" +"序列,因為其查找方式是使用任意的 :term:`immutable` 鍵,而不是整數。" -#: ../../glossary.rst:1095 +#: ../../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:" @@ -2423,16 +2421,16 @@ msgid "" "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:" -"`__reversed__`\\ 。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta." -"register` 被明確地註冊。" +"個更加豐富的介面,並不僅止於 :meth:`__getitem__` 和 :meth:`__len__`,還增加" +"了 :meth:`count`、:meth:`index`、:meth:`__contains__` 和 :meth:" +"`__reversed__`。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta.register` " +"被明確地註冊。" -#: ../../glossary.rst:1102 +#: ../../glossary.rst:1105 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1104 +#: ../../glossary.rst:1107 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2441,13 +2439,13 @@ msgid "" msgstr "" "一種緊密的方法,用來處理一個可疊代物件中的全部或部分元素,並將處理結果以一個 " "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" -"個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`\\ 。" +"個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1108 +#: ../../glossary.rst:1111 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1110 +#: ../../glossary.rst:1113 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2455,11 +2453,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1112 +#: ../../glossary.rst:1115 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1114 +#: ../../glossary.rst:1117 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2467,15 +2465,15 @@ msgid "" "(subscript) notation uses :class:`slice` objects internally." msgstr "" "一個物件,它通常包含一段 :term:`sequence`\\ (序列)的某一部分。建立一段切片" -"的方法是使用下標符號 (subscript notation) ``[]``\\ ,若要給出多個數字,則在數" -"字之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" +"的方法是使用下標符號 (subscript notation) ``[]``,若要給出多個數字,則在數字" +"之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1118 +#: ../../glossary.rst:1121 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1122 +#: ../../glossary.rst:1125 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2486,34 +2484,36 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1126 +#: ../../glossary.rst:1129 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1128 +#: ../../glossary.rst:1131 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" "keyword:`if`, :keyword:`while` or :keyword:`for`." msgstr "" "陳述式是一個套組(suite,一個程式碼「區塊」)中的一部分。陳述式可以是一個 :" -"term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`\\ 、\\ :" -"keyword:`while` 或 :keyword:`for`\\ )的多種結構之一。" +"term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" +"`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1131 +#: ../../glossary.rst:1134 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1133 +#: ../../glossary.rst:1136 msgid "" -"In Python's C API, a strong reference is a reference to an object which " -"increments the object's reference count when it is created and decrements " -"the object's reference count when it is deleted." +"In Python's C API, a strong reference is a reference to an object which is " +"owned by the code holding the reference. The strong reference is taken by " +"calling :c:func:`Py_INCREF` when the reference is created and released with :" +"c:func:`Py_DECREF` when the reference is deleted." msgstr "" -"在 Python 的 C API 中,強參照是一個對物件的參照,在它被建立時會增加該物件的參" -"照計數 (reference count),在它被刪除時則會減少該物件的參照計數。" +"在 Python 的 C API 中,強參照是對物件的參照,該物件為持有該參照的程式碼所擁" +"有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" +"func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1137 +#: ../../glossary.rst:1142 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2523,15 +2523,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1142 +#: ../../glossary.rst:1147 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1143 +#: ../../glossary.rst:1148 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1145 +#: ../../glossary.rst:1150 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " @@ -2540,7 +2540,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1149 +#: ../../glossary.rst:1154 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2548,7 +2548,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1152 +#: ../../glossary.rst:1157 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2556,11 +2556,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1155 +#: ../../glossary.rst:1160 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1157 +#: ../../glossary.rst:1162 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2571,22 +2571,22 @@ msgstr "" "一個能夠讀取和寫入 :class:`str` 物件的一個 :term:`file object`\\ (檔案物" "件)。通常,文字檔案實際上是存取位元組導向的資料流 (byte-oriented " "datastream) 並會自動處理 :term:`text encoding`\\ (文字編碼)。文字檔案的例子" -"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`\\ 、\\ :" -"data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" +"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`、:data:" +"`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1164 +#: ../../glossary.rst:1169 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." msgstr "" -"另請參閱 :term:`binary file`\\ (二進制檔案),它是一個能夠讀取和寫入\\ :" +"另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1166 +#: ../../glossary.rst:1171 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1168 +#: ../../glossary.rst:1173 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2601,11 +2601,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1175 +#: ../../glossary.rst:1180 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1177 +#: ../../glossary.rst:1182 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~instance." @@ -2615,15 +2615,15 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1181 +#: ../../glossary.rst:1186 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1183 +#: ../../glossary.rst:1188 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1185 +#: ../../glossary.rst:1190 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" @@ -2632,22 +2632,22 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1192 +#: ../../glossary.rst:1197 msgid "could be made more readable like this::" msgstr "" "可以寫成這樣,更具有可讀性:\n" "\n" "::" -#: ../../glossary.rst:1199 ../../glossary.rst:1213 +#: ../../glossary.rst:1204 ../../glossary.rst:1218 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." -msgstr "請參閱 :mod:`typing` 和 :pep:`484`\\ ,有此功能的描述。" +msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1200 +#: ../../glossary.rst:1205 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1202 +#: ../../glossary.rst:1207 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2655,7 +2655,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1205 +#: ../../glossary.rst:1210 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to static type analysis tools, and aid IDEs with code completion and " @@ -2664,7 +2664,7 @@ msgstr "" "型別提示是選擇性的,而不是被 Python 強制的,但它們對靜態型別分析工具很有用," "並能協助 IDE 完成程式碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1209 +#: ../../glossary.rst:1214 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2672,11 +2672,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1214 +#: ../../glossary.rst:1219 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1216 +#: ../../glossary.rst:1221 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -2686,18 +2686,18 @@ msgid "" msgstr "" "一種解譯文字流 (text stream) 的方式,會將以下所有的情況識別為一行的結束:" "Unix 行尾慣例 ``'\\n'``、Windows 慣例 ``'\\r\\n'`` 和舊的 Macintosh 慣例 " -"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`\\ ,以及用於 :func:`bytes." +"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1221 +#: ../../glossary.rst:1226 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1223 +#: ../../glossary.rst:1228 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1225 +#: ../../glossary.rst:1230 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "" @@ -2705,35 +2705,34 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1230 +#: ../../glossary.rst:1235 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" msgstr "" -"變數註釋通常用於\\ :term:`型別提示 (type hint) `\\ :例如,這個變" -"數預期會取得 :class:`int`\\ (整數)值:\n" +"變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" +"期會取得 :class:`int`\\ (整數)值:\n" "\n" "::" -#: ../../glossary.rst:1236 +#: ../../glossary.rst:1241 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1238 +#: ../../glossary.rst:1243 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " "working with annotations." msgstr "" -"請參閱 :term:`function annotation`\\ (函式註釋)、\\ :pep:`484` 和 :pep:" -"`526`\\ ,皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:" -"`annotations-howto`\\ 。" +"請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," +"皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1242 +#: ../../glossary.rst:1247 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1244 +#: ../../glossary.rst:1249 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2744,15 +2743,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1254 msgid "See also :mod:`venv`." -msgstr "另請參閱 :mod:`venv`\\ 。" +msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1250 +#: ../../glossary.rst:1255 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1252 +#: ../../glossary.rst:1257 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2760,11 +2759,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1254 +#: ../../glossary.rst:1259 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1256 +#: ../../glossary.rst:1261 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -2773,50 +2772,18 @@ msgstr "" "Python 設計原則與哲學的列表,其內容有助於理解和使用此語言。此列表可以透過在互" "動式提式字元後輸入「``import this``」來找到它。" -#: ../../glossary.rst:263 +#: ../../glossary.rst:264 msgid "C-contiguous" msgstr "C-contiguous(C 連續的)" -#: ../../glossary.rst:263 +#: ../../glossary.rst:264 msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" -#: ../../glossary.rst:756 +#: ../../glossary.rst:757 msgid "magic" msgstr "magic" -#: ../../glossary.rst:1120 +#: ../../glossary.rst:1123 msgid "special" msgstr "special" - -#~ msgid "coercion" -#~ msgstr "coercion(強制轉型)" - -#~ msgid "" -#~ "The implicit conversion of an instance of one type to another during an " -#~ "operation which involves two arguments of the same type. For example, " -#~ "``int(3.15)`` converts the floating point number to the integer ``3``, " -#~ "but in ``3+4.5``, each argument is of a different type (one int, one " -#~ "float), and both must be converted to the same type before they can be " -#~ "added or it will raise a :exc:`TypeError`. Without coercion, all " -#~ "arguments of even compatible types would have to be normalized to the " -#~ "same value by the programmer, e.g., ``float(3)+4.5`` rather than just " -#~ "``3+4.5``." -#~ msgstr "" -#~ "在涉及兩個不同型別引數的操作過程中,將某一種型別的實例換為另一種型別的隱式" -#~ "轉換 (implicit conversion) 過程。例如,``int(3.15)`` 會將浮點數轉換為整數 " -#~ "``3``,但在 ``3+4.5`` 中,每個引數是不同的型別(一個 int,一個 float),而" -#~ "這兩個引數必須在被轉換為相同的型別之後才能相加,否則就會引發 :exc:" -#~ "`TypeError`\\ 。如果沒有強制轉型,即使所有的引數型別皆相容,它們都必須要由" -#~ "程式設計師正規化 (normalize) 為相同的值,例如,要用 ``float(3)+4.5`` 而不" -#~ "能只是 ``3+4.5``。" - -#~ msgid "" -#~ "Python uses the :term:`filesystem encoding and error handler` to convert " -#~ "between Unicode filenames and bytes filenames." -#~ msgstr "" -#~ "Python 使用 :term:`filesystem encoding and error handler`\\ (檔案系統編碼" -#~ "和錯誤處理函式)在 Unicode 檔案名稱和位元組檔案名稱之間進行轉換。" - -#~ msgid "A codec which encodes Unicode strings to bytes." -#~ msgstr "將 Unicode 字串編碼為位元組的一個編解碼器 (codec)。" diff --git a/howto/clinic.po b/howto/clinic.po index e873f731db..469e7f45c1 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-28 00:03+0000\n" +"POT-Creation-Date: 2023-08-08 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-" @@ -40,35 +40,36 @@ msgstr "摘要" #: ../../howto/clinic.rst:15 msgid "" -"Argument Clinic is a preprocessor for CPython C files. Its purpose is to " -"automate all the boilerplate involved with writing argument parsing code for " -"\"builtins\", module level functions, and class methods. This document is " -"divided in four major sections:" +"Argument Clinic is a preprocessor for CPython C files. It was introduced in " +"Python 3.4 with :pep:`436`, in order to provide introspection signatures, " +"and to generate performant and tailor-made boilerplate code for argument " +"parsing in CPython builtins, module level functions, and class methods. This " +"document is divided in four major sections:" msgstr "" -#: ../../howto/clinic.rst:21 +#: ../../howto/clinic.rst:23 msgid "" ":ref:`clinic-background` talks about the basic concepts and goals of " "Argument Clinic." msgstr "" -#: ../../howto/clinic.rst:23 +#: ../../howto/clinic.rst:25 msgid "" ":ref:`clinic-reference` describes the command-line interface and Argument " "Clinic terminology." msgstr "" -#: ../../howto/clinic.rst:25 +#: ../../howto/clinic.rst:27 msgid "" ":ref:`clinic-tutorial` guides you through all the steps required to adapt an " "existing C function to Argument Clinic." msgstr "" -#: ../../howto/clinic.rst:27 +#: ../../howto/clinic.rst:29 msgid ":ref:`clinic-howtos` details how to handle specific tasks." msgstr "" -#: ../../howto/clinic.rst:32 +#: ../../howto/clinic.rst:34 msgid "" "Argument Clinic is considered internal-only for CPython. Its use is not " "supported for files outside CPython, and no guarantees are made regarding " @@ -79,85 +80,26 @@ msgid "" "and break all your code." msgstr "" -#: ../../howto/clinic.rst:45 +#: ../../howto/clinic.rst:47 msgid "Background" msgstr "" -#: ../../howto/clinic.rst:49 -msgid "The goals of Argument Clinic" -msgstr "" - -#: ../../howto/clinic.rst:51 -msgid "" -"Argument Clinic's primary goal is to take over responsibility for all " -"argument parsing code inside CPython. This means that, when you convert a " -"function to work with Argument Clinic, that function should no longer do any " -"of its own argument parsing—the code generated by Argument Clinic should be " -"a \"black box\" to you, where CPython calls in at the top, and your code " -"gets called at the bottom, with ``PyObject *args`` (and maybe ``PyObject " -"*kwargs``) magically converted into the C variables and types you need." -msgstr "" - -#: ../../howto/clinic.rst:61 -msgid "" -"In order for Argument Clinic to accomplish its primary goal, it must be easy " -"to use. Currently, working with CPython's argument parsing library is a " -"chore, requiring maintaining redundant information in a surprising number of " -"places. When you use Argument Clinic, you don't have to repeat yourself." -msgstr "" - -#: ../../howto/clinic.rst:67 -msgid "" -"Obviously, no one would want to use Argument Clinic unless it's solving " -"their problem—and without creating new problems of its own. So it's " -"paramount that Argument Clinic generate correct code. It'd be nice if the " -"code was faster, too, but at the very least it should not introduce a major " -"speed regression. (Eventually Argument Clinic *should* make a major speedup " -"possible—we could rewrite its code generator to produce tailor-made argument " -"parsing code, rather than calling the general-purpose CPython argument " -"parsing library. That would make for the fastest argument parsing possible!)" -msgstr "" - -#: ../../howto/clinic.rst:79 -msgid "" -"Additionally, Argument Clinic must be flexible enough to work with any " -"approach to argument parsing. Python has some functions with some very " -"strange parsing behaviors; Argument Clinic's goal is to support all of them." -msgstr "" - -#: ../../howto/clinic.rst:84 -msgid "" -"Finally, the original motivation for Argument Clinic was to provide " -"introspection \"signatures\" for CPython builtins. It used to be, the " -"introspection query functions would throw an exception if you passed in a " -"builtin. With Argument Clinic, that's a thing of the past!" -msgstr "" - -#: ../../howto/clinic.rst:90 -msgid "" -"One idea you should keep in mind, as you work with Argument Clinic: the more " -"information you give it, the better job it'll be able to do. Argument Clinic " -"is admittedly relatively simple right now. But as it evolves it will get " -"more sophisticated, and it should be able to do many interesting and smart " -"things with all the information you give it." -msgstr "" - -#: ../../howto/clinic.rst:100 +#: ../../howto/clinic.rst:50 msgid "Basic concepts" msgstr "" -#: ../../howto/clinic.rst:102 +#: ../../howto/clinic.rst:52 msgid "" "When Argument Clinic is run on a file, either via the :ref:`clinic-cli` or " "via ``make clinic``, it will scan over the input files looking for :term:" "`start lines `:" msgstr "" -#: ../../howto/clinic.rst:110 +#: ../../howto/clinic.rst:60 msgid "When it finds one, it reads everything up to the :term:`end line`:" msgstr "" -#: ../../howto/clinic.rst:116 +#: ../../howto/clinic.rst:66 msgid "" "Everything in between these two lines is Argument Clinic :term:`input`. When " "Argument Clinic parses input, it generates :term:`output`. The output is " @@ -167,7 +109,7 @@ msgid "" "`block`:" msgstr "" -#: ../../howto/clinic.rst:131 +#: ../../howto/clinic.rst:81 msgid "" "If you run Argument Clinic on the same file a second time, Argument Clinic " "will discard the old :term:`output` and write out the new output with a " @@ -175,7 +117,7 @@ msgid "" "won't change either." msgstr "" -#: ../../howto/clinic.rst:138 +#: ../../howto/clinic.rst:88 msgid "" "You should never modify the output of an Argument Clinic block, as any " "change will be lost in future Argument Clinic runs; Argument Clinic will " @@ -184,29 +126,29 @@ msgid "" "until it produces the output you want." msgstr "" -#: ../../howto/clinic.rst:149 +#: ../../howto/clinic.rst:99 msgid "Reference" msgstr "" -#: ../../howto/clinic.rst:155 +#: ../../howto/clinic.rst:105 msgid "Terminology" msgstr "" -#: ../../howto/clinic.rst:158 +#: ../../howto/clinic.rst:108 msgid "start line" msgstr "" -#: ../../howto/clinic.rst:160 +#: ../../howto/clinic.rst:110 msgid "" "The line ``/*[clinic input]``. This line marks the beginning of Argument " "Clinic input. Note that the *start line* opens a C block comment." msgstr "" -#: ../../howto/clinic.rst:163 +#: ../../howto/clinic.rst:113 msgid "end line" msgstr "" -#: ../../howto/clinic.rst:165 +#: ../../howto/clinic.rst:115 msgid "" "The line ``[clinic start generated code]*/``. The *end line* marks the _end_ " "of Argument Clinic :term:`input`, but at the same time marks the _start_ of " @@ -215,21 +157,21 @@ msgid "" "by the *start line*." msgstr "" -#: ../../howto/clinic.rst:171 +#: ../../howto/clinic.rst:121 msgid "checksum" msgstr "" -#: ../../howto/clinic.rst:173 +#: ../../howto/clinic.rst:123 msgid "" "A hash to distinguish unique :term:`inputs ` and :term:`outputs " "`." msgstr "" -#: ../../howto/clinic.rst:175 +#: ../../howto/clinic.rst:125 msgid "checksum line" msgstr "" -#: ../../howto/clinic.rst:177 +#: ../../howto/clinic.rst:127 msgid "" "A line that looks like ``/*[clinic end generated code: ...]*/``. The three " "dots will be replaced by a :term:`checksum` generated from the :term:" @@ -238,86 +180,148 @@ msgid "" "by Argument Clinic to determine if it needs to regenerate output." msgstr "" -#: ../../howto/clinic.rst:183 +#: ../../howto/clinic.rst:133 msgid "input" msgstr "" -#: ../../howto/clinic.rst:185 +#: ../../howto/clinic.rst:135 msgid "" "The text between the :term:`start line` and the :term:`end line`. Note that " "the start and end lines open and close a C block comment; the *input* is " "thus a part of that same C block comment." msgstr "" -#: ../../howto/clinic.rst:188 +#: ../../howto/clinic.rst:138 msgid "output" msgstr "" -#: ../../howto/clinic.rst:190 +#: ../../howto/clinic.rst:140 msgid "The text between the :term:`end line` and the :term:`checksum line`." msgstr "" -#: ../../howto/clinic.rst:191 +#: ../../howto/clinic.rst:141 msgid "block" msgstr "" -#: ../../howto/clinic.rst:193 +#: ../../howto/clinic.rst:143 msgid "" "All text from the :term:`start line` to the :term:`checksum line` " "inclusively." msgstr "" -#: ../../howto/clinic.rst:199 +#: ../../howto/clinic.rst:149 msgid "Command-line interface" msgstr "" -#: ../../howto/clinic.rst:201 +#: ../../howto/clinic.rst:151 msgid "" "The Argument Clinic :abbr:`CLI (Command-Line Interface)` is typically used " "to process a single source file, like this:" msgstr "" -#: ../../howto/clinic.rst:208 +#: ../../howto/clinic.rst:158 msgid "The CLI supports the following options:" msgstr "" -#: ../../howto/clinic.rst:215 +#: ../../howto/clinic.rst:165 msgid "Print CLI usage." msgstr "" -#: ../../howto/clinic.rst:219 +#: ../../howto/clinic.rst:169 msgid "Force output regeneration." msgstr "" -#: ../../howto/clinic.rst:223 +#: ../../howto/clinic.rst:173 msgid "Redirect file output to OUTPUT" msgstr "" -#: ../../howto/clinic.rst:227 +#: ../../howto/clinic.rst:177 msgid "Enable verbose mode." msgstr "" -#: ../../howto/clinic.rst:231 +#: ../../howto/clinic.rst:181 msgid "Print a list of all supported converters and return converters." msgstr "" -#: ../../howto/clinic.rst:235 +#: ../../howto/clinic.rst:185 msgid "Walk :option:`--srcdir` to run over all relevant files." msgstr "" -#: ../../howto/clinic.rst:239 +#: ../../howto/clinic.rst:189 msgid "The directory tree to walk in :option:`--make` mode." msgstr "" -#: ../../howto/clinic.rst:243 +#: ../../howto/clinic.rst:193 msgid "The list of files to process." msgstr "" -#: ../../howto/clinic.rst:249 +#: ../../howto/clinic.rst:199 +msgid "Classes for extending Argument Clinic" +msgstr "" + +#: ../../howto/clinic.rst:205 +msgid "" +"The base class for all converters. See :ref:`clinic-howto-custom-converter` " +"for how to subclass this class." +msgstr "" + +#: ../../howto/clinic.rst:210 +msgid "" +"The C type to use for this variable. :attr:`!type` should be a Python string " +"specifying the type, e.g. ``'int'``. If this is a pointer type, the type " +"string should end with ``' *'``." +msgstr "" + +#: ../../howto/clinic.rst:217 +msgid "" +"The Python default value for this parameter, as a Python value. Or the magic " +"value ``unspecified`` if there is no default." +msgstr "" + +#: ../../howto/clinic.rst:222 +msgid "" +":attr:`!default` as it should appear in Python code, as a string. Or " +"``None`` if there is no default." +msgstr "" + +#: ../../howto/clinic.rst:228 +msgid "" +":attr:`!default` as it should appear in C code, as a string. Or ``None`` if " +"there is no default." +msgstr "" + +#: ../../howto/clinic.rst:234 +msgid "" +"The default value used to initialize the C variable when there is no " +"default, but not specifying a default may result in an \"uninitialized " +"variable\" warning. This can easily happen when using option groups—" +"although properly written code will never actually use this value, the " +"variable does get passed in to the impl, and the C compiler will complain " +"about the \"use\" of the uninitialized value. This value should always be a " +"non-empty string." +msgstr "" + +#: ../../howto/clinic.rst:246 +msgid "The name of the C converter function, as a string." +msgstr "" + +#: ../../howto/clinic.rst:250 +msgid "" +"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " +"name of the variable when passing it into the impl function." +msgstr "" + +#: ../../howto/clinic.rst:256 +msgid "" +"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " +"name of the variable when passing it into :c:func:`PyArg_ParseTuple`." +msgstr "" + +#: ../../howto/clinic.rst:264 msgid "Tutorial" msgstr "" -#: ../../howto/clinic.rst:251 +#: ../../howto/clinic.rst:266 msgid "" "The best way to get a sense of how Argument Clinic works is to convert a " "function to work with it. Here, then, are the bare minimum steps you'd need " @@ -329,13 +333,13 @@ msgid "" "walkthrough so you can learn." msgstr "" -#: ../../howto/clinic.rst:262 +#: ../../howto/clinic.rst:277 msgid "" "First, make sure you're working with a freshly updated checkout of the " "CPython trunk." msgstr "" -#: ../../howto/clinic.rst:265 +#: ../../howto/clinic.rst:280 msgid "" "Next, find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :" "c:func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " @@ -343,20 +347,20 @@ msgid "" "Pickler.dump `." msgstr "" -#: ../../howto/clinic.rst:271 +#: ../../howto/clinic.rst:286 msgid "" "If the call to the :c:func:`!PyArg_Parse*` function uses any of the " "following format units...:" msgstr "" -#: ../../howto/clinic.rst:283 +#: ../../howto/clinic.rst:298 msgid "" "... or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should " "choose a different function. (See :ref:`clinic-howto-advanced-converters` " "for those scenarios.)" msgstr "" -#: ../../howto/clinic.rst:287 +#: ../../howto/clinic.rst:302 msgid "" "Also, if the function has multiple calls to :c:func:`!PyArg_ParseTuple` or :" "c:func:`PyArg_ParseTupleAndKeywords` where it supports different types for " @@ -366,13 +370,13 @@ msgid "" "functions or polymorphic parameters." msgstr "" -#: ../../howto/clinic.rst:294 +#: ../../howto/clinic.rst:309 msgid "" "Next, add the following boilerplate above the function, creating our input " "block::" msgstr "" -#: ../../howto/clinic.rst:300 +#: ../../howto/clinic.rst:315 msgid "" "Cut the docstring and paste it in between the ``[clinic]`` lines, removing " "all the junk that makes it a properly quoted C string. When you're done you " @@ -380,7 +384,7 @@ msgid "" "80 characters. Argument Clinic will preserve indents inside the docstring." msgstr "" -#: ../../howto/clinic.rst:306 +#: ../../howto/clinic.rst:321 msgid "" "If the old docstring had a first line that looked like a function signature, " "throw that line away; The docstring doesn't need it anymore --- when you " @@ -388,11 +392,11 @@ msgid "" "built automatically based on the function's signature." msgstr "" -#: ../../howto/clinic.rst:311 +#: ../../howto/clinic.rst:326 msgid "Example docstring summary line::" msgstr "" -#: ../../howto/clinic.rst:317 +#: ../../howto/clinic.rst:332 msgid "" "If your docstring doesn't have a \"summary\" line, Argument Clinic will " "complain, so let's make sure it has one. The \"summary\" line should be a " @@ -400,13 +404,13 @@ msgid "" "docstring. (See :pep:`257` regarding docstring conventions.)" msgstr "" -#: ../../howto/clinic.rst:323 +#: ../../howto/clinic.rst:338 msgid "" "Our example docstring consists solely of a summary line, so the sample code " "doesn't have to change for this step." msgstr "" -#: ../../howto/clinic.rst:326 +#: ../../howto/clinic.rst:341 msgid "" "Now, above the docstring, enter the name of the function, followed by a " "blank line. This should be the Python name of the function, and should be " @@ -415,14 +419,14 @@ msgid "" "class it should include the class name too." msgstr "" -#: ../../howto/clinic.rst:333 +#: ../../howto/clinic.rst:348 msgid "" "In our example, :mod:`!_pickle` is the module, :py:class:`!Pickler` is the " "class, and :py:meth:`!dump` is the method, so the name becomes :py:meth:`!" "_pickle.Pickler.dump`::" msgstr "" -#: ../../howto/clinic.rst:343 +#: ../../howto/clinic.rst:358 msgid "" "If this is the first time that module or class has been used with Argument " "Clinic in this C file, you must declare the module and/or class. Proper " @@ -432,21 +436,21 @@ msgid "" "next to each other." msgstr "" -#: ../../howto/clinic.rst:351 +#: ../../howto/clinic.rst:366 msgid "" "The name of the class and module should be the same as the one seen by " "Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" "`PyTypeObject` as appropriate." msgstr "" -#: ../../howto/clinic.rst:355 +#: ../../howto/clinic.rst:370 msgid "" "When you declare a class, you must also specify two aspects of its type in " "C: the type declaration you'd use for a pointer to an instance of this " "class, and a pointer to the :c:type:`!PyTypeObject` for this class::" msgstr "" -#: ../../howto/clinic.rst:370 +#: ../../howto/clinic.rst:385 msgid "" "Declare each of the parameters to the function. Each parameter should get " "its own line. All the parameter lines should be indented from the function " @@ -454,21 +458,21 @@ msgid "" "follows:" msgstr "" -#: ../../howto/clinic.rst:379 +#: ../../howto/clinic.rst:394 msgid "If the parameter has a default value, add that after the converter:" msgstr "" -#: ../../howto/clinic.rst:386 +#: ../../howto/clinic.rst:401 msgid "" "Argument Clinic's support for \"default values\" is quite sophisticated; " "see :ref:`clinic-howto-default-values` for more information." msgstr "" -#: ../../howto/clinic.rst:389 +#: ../../howto/clinic.rst:404 msgid "Next, add a blank line below the parameters." msgstr "" -#: ../../howto/clinic.rst:391 +#: ../../howto/clinic.rst:406 msgid "" "What's a \"converter\"? It establishes both the type of the variable used in " "C, and the method to convert the Python value into a C value at runtime. For " @@ -477,7 +481,7 @@ msgid "" "easier." msgstr "" -#: ../../howto/clinic.rst:398 +#: ../../howto/clinic.rst:413 msgid "" "For each parameter, copy the \"format unit\" for that parameter from the :c:" "func:`PyArg_Parse` format argument and specify *that* as its converter, as a " @@ -487,59 +491,59 @@ msgid "" "more on format units please see :ref:`arg-parsing`." msgstr "" -#: ../../howto/clinic.rst:407 +#: ../../howto/clinic.rst:422 msgid "" "For multicharacter format units like ``z#``, use the entire two-or-three " "character string." msgstr "" -#: ../../howto/clinic.rst:410 ../../howto/clinic.rst:445 -#: ../../howto/clinic.rst:473 ../../howto/clinic.rst:579 -#: ../../howto/clinic.rst:632 +#: ../../howto/clinic.rst:425 ../../howto/clinic.rst:460 +#: ../../howto/clinic.rst:488 ../../howto/clinic.rst:594 +#: ../../howto/clinic.rst:647 msgid "Sample::" msgstr "" -#: ../../howto/clinic.rst:425 +#: ../../howto/clinic.rst:440 msgid "" "If your function has ``|`` in the format string, meaning some parameters " "have default values, you can ignore it. Argument Clinic infers which " "parameters are optional based on whether or not they have default values." msgstr "" -#: ../../howto/clinic.rst:430 +#: ../../howto/clinic.rst:445 msgid "" "If your function has ``$`` in the format string, meaning it takes keyword-" "only arguments, specify ``*`` on a line by itself before the first keyword-" "only argument, indented the same as the parameter lines." msgstr "" -#: ../../howto/clinic.rst:435 +#: ../../howto/clinic.rst:450 msgid "" ":py:meth:`!_pickle.Pickler.dump` has neither, so our sample is unchanged." msgstr "" -#: ../../howto/clinic.rst:437 +#: ../../howto/clinic.rst:452 msgid "" "Next, if the existing C function calls :c:func:`PyArg_ParseTuple` (as " "opposed to :c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments " "are positional-only." msgstr "" -#: ../../howto/clinic.rst:441 +#: ../../howto/clinic.rst:456 msgid "" "To mark parameters as positional-only in Argument Clinic, add a ``/`` on a " "line by itself after the last positional-only parameter, indented the same " "as the parameter lines." msgstr "" -#: ../../howto/clinic.rst:461 +#: ../../howto/clinic.rst:476 msgid "" "It can be helpful to write a per-parameter docstring for each parameter. " "Since per-parameter docstrings are optional, you can skip this step if you " "prefer." msgstr "" -#: ../../howto/clinic.rst:465 +#: ../../howto/clinic.rst:480 msgid "" "Nevertheless, here's how to add a per-parameter docstring. The first line of " "the per-parameter docstring must be indented further than the parameter " @@ -549,7 +553,7 @@ msgid "" "multiple lines if you wish." msgstr "" -#: ../../howto/clinic.rst:490 +#: ../../howto/clinic.rst:505 msgid "" "Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " "luck everything worked---your block now has output, and a :file:`.c.h` file " @@ -557,27 +561,27 @@ msgid "" "code::" msgstr "" -#: ../../howto/clinic.rst:509 +#: ../../howto/clinic.rst:524 msgid "" "Obviously, if Argument Clinic didn't produce any output, it's because it " "found an error in your input. Keep fixing your errors and retrying until " "Argument Clinic processes your file without complaint." msgstr "" -#: ../../howto/clinic.rst:514 +#: ../../howto/clinic.rst:529 msgid "" "For readability, most of the glue code has been generated to a :file:`.c.h` " "file. You'll need to include that in your original :file:`.c` file, " "typically right after the clinic module block::" msgstr "" -#: ../../howto/clinic.rst:520 +#: ../../howto/clinic.rst:535 msgid "" "Double-check that the argument-parsing code Argument Clinic generated looks " "basically the same as the existing code." msgstr "" -#: ../../howto/clinic.rst:523 +#: ../../howto/clinic.rst:538 msgid "" "First, ensure both places use the same argument-parsing function. The " "existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" @@ -585,21 +589,21 @@ msgid "" "Clinic calls the *exact* same function." msgstr "" -#: ../../howto/clinic.rst:529 +#: ../../howto/clinic.rst:544 msgid "" "Second, the format string passed in to :c:func:`!PyArg_ParseTuple` or :c:" "func:`!PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" "written one in the existing function, up to the colon or semi-colon." msgstr "" -#: ../../howto/clinic.rst:534 +#: ../../howto/clinic.rst:549 msgid "" "Argument Clinic always generates its format strings with a ``:`` followed by " "the name of the function. If the existing code's format string ends with ``;" "``, to provide usage help, this change is harmless --- don't worry about it." msgstr "" -#: ../../howto/clinic.rst:539 +#: ../../howto/clinic.rst:554 msgid "" "Third, for parameters whose format units require two arguments, like a " "length variable, an encoding string, or a pointer to a conversion function, " @@ -607,27 +611,27 @@ msgid "" "invocations." msgstr "" -#: ../../howto/clinic.rst:544 +#: ../../howto/clinic.rst:559 msgid "" "Fourth, inside the output portion of the block, you'll find a preprocessor " "macro defining the appropriate static :c:type:`PyMethodDef` structure for " "this builtin::" msgstr "" -#: ../../howto/clinic.rst:551 +#: ../../howto/clinic.rst:566 msgid "" "This static structure should be *exactly* the same as the existing static :c:" "type:`!PyMethodDef` structure for this builtin." msgstr "" -#: ../../howto/clinic.rst:554 +#: ../../howto/clinic.rst:569 msgid "" "If any of these items differ in *any way*, adjust your Argument Clinic " "function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " "the same." msgstr "" -#: ../../howto/clinic.rst:558 +#: ../../howto/clinic.rst:573 msgid "" "Notice that the last line of its output is the declaration of your \"impl\" " "function. This is where the builtin's implementation goes. Delete the " @@ -638,20 +642,20 @@ msgid "" "used different names for these variables, fix it." msgstr "" -#: ../../howto/clinic.rst:566 +#: ../../howto/clinic.rst:581 msgid "" "Let's reiterate, just because it's kind of weird. Your code should now look " "like this::" msgstr "" -#: ../../howto/clinic.rst:575 +#: ../../howto/clinic.rst:590 msgid "" "Argument Clinic generated the checksum line and the function prototype just " "above it. You should write the opening and closing curly braces for the " "function, and the implementation inside." msgstr "" -#: ../../howto/clinic.rst:621 +#: ../../howto/clinic.rst:636 msgid "" "Remember the macro with the :c:type:`PyMethodDef` structure for this " "function? Find the existing :c:type:`!PyMethodDef` structure for this " @@ -661,24 +665,24 @@ msgid "" "to the implementation." msgstr "" -#: ../../howto/clinic.rst:628 +#: ../../howto/clinic.rst:643 msgid "" "Note that the body of the macro contains a trailing comma; when you replace " "the existing static :c:type:`!PyMethodDef` structure with the macro, *don't* " "add a comma to the end." msgstr "" -#: ../../howto/clinic.rst:640 +#: ../../howto/clinic.rst:655 msgid "Argument Clinic may generate new instances of ``_Py_ID``. For example::" msgstr "" -#: ../../howto/clinic.rst:644 +#: ../../howto/clinic.rst:659 msgid "" "If it does, you'll have to run ``make regen-global-objects`` to regenerate " "the list of precompiled identifiers at this point." msgstr "" -#: ../../howto/clinic.rst:647 +#: ../../howto/clinic.rst:662 msgid "" "Finally, compile, then run the relevant portions of the regression-test " "suite. This change should not introduce any new compile-time warnings or " @@ -687,21 +691,21 @@ msgid "" "your function should now provide a valid signature!" msgstr "" -#: ../../howto/clinic.rst:653 +#: ../../howto/clinic.rst:668 msgid "" "Congratulations, you've ported your first function to work with Argument " "Clinic!" msgstr "" -#: ../../howto/clinic.rst:659 +#: ../../howto/clinic.rst:674 msgid "How-to guides" msgstr "" -#: ../../howto/clinic.rst:663 +#: ../../howto/clinic.rst:678 msgid "How to rename C functions and variables generated by Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:665 +#: ../../howto/clinic.rst:680 msgid "" "Argument Clinic automatically names the functions it generates for you. " "Occasionally this may cause a problem, if the generated name collides with " @@ -713,19 +717,19 @@ msgid "" "impl function." msgstr "" -#: ../../howto/clinic.rst:673 +#: ../../howto/clinic.rst:688 msgid "" "For example, if we wanted to rename the C function names generated for :py:" "meth:`pickle.Pickler.dump`, it'd look like this::" msgstr "" -#: ../../howto/clinic.rst:681 +#: ../../howto/clinic.rst:696 msgid "" "The base function would now be named :c:func:`!pickler_dumper`, and the impl " "function would now be named :c:func:`!pickler_dumper_impl`." msgstr "" -#: ../../howto/clinic.rst:685 +#: ../../howto/clinic.rst:700 msgid "" "Similarly, you may have a problem where you want to give a parameter a " "specific Python name, but that name may be inconvenient in C. Argument " @@ -733,21 +737,21 @@ msgid "" "using the same ``\"as\"`` syntax::" msgstr "" -#: ../../howto/clinic.rst:699 +#: ../../howto/clinic.rst:714 msgid "" "Here, the name used in Python (in the signature and the ``keywords`` array) " "would be *file*, but the C variable would be named ``file_obj``." msgstr "" -#: ../../howto/clinic.rst:702 +#: ../../howto/clinic.rst:717 msgid "You can use this to rename the *self* parameter too!" msgstr "" -#: ../../howto/clinic.rst:706 +#: ../../howto/clinic.rst:721 msgid "How to convert functions using ``PyArg_UnpackTuple``" msgstr "" -#: ../../howto/clinic.rst:708 +#: ../../howto/clinic.rst:723 msgid "" "To convert a function parsing its arguments with :c:func:" "`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " @@ -756,17 +760,17 @@ msgid "" "a line by itself after the last argument)." msgstr "" -#: ../../howto/clinic.rst:714 +#: ../../howto/clinic.rst:729 msgid "" "Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " "will change soon." msgstr "" -#: ../../howto/clinic.rst:719 +#: ../../howto/clinic.rst:734 msgid "How to use optional groups" msgstr "" -#: ../../howto/clinic.rst:721 +#: ../../howto/clinic.rst:736 msgid "" "Some legacy functions have a tricky approach to parsing their arguments: " "they count the number of positional arguments, then use a ``switch`` " @@ -777,7 +781,7 @@ msgid "" "created." msgstr "" -#: ../../howto/clinic.rst:728 +#: ../../howto/clinic.rst:743 msgid "" "While functions using this approach can often be converted to use :c:func:`!" "PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " @@ -791,7 +795,7 @@ msgid "" "don't pass in *x* you may not pass in *y* either.)" msgstr "" -#: ../../howto/clinic.rst:740 +#: ../../howto/clinic.rst:755 msgid "" "In any case, the goal of Argument Clinic is to support argument parsing for " "all existing CPython builtins without changing their semantics. Therefore " @@ -801,7 +805,7 @@ msgid "" "required arguments. They can *only* be used with positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:748 +#: ../../howto/clinic.rst:763 msgid "" "Optional groups are *only* intended for use when converting functions that " "make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " @@ -812,7 +816,7 @@ msgid "" "possible." msgstr "" -#: ../../howto/clinic.rst:757 +#: ../../howto/clinic.rst:772 msgid "" "To specify an optional group, add a ``[`` on a line by itself before the " "parameters you wish to group together, and a ``]`` on a line by itself after " @@ -821,11 +825,11 @@ msgid "" "optional::" msgstr "" -#: ../../howto/clinic.rst:786 +#: ../../howto/clinic.rst:801 msgid "Notes:" msgstr "註解:" -#: ../../howto/clinic.rst:788 +#: ../../howto/clinic.rst:803 msgid "" "For every optional group, one additional parameter will be passed into the " "impl function representing the group. The parameter will be an int named " @@ -838,34 +842,34 @@ msgid "" "I mean whether or not the parameters received arguments in this invocation.)" msgstr "" -#: ../../howto/clinic.rst:799 +#: ../../howto/clinic.rst:814 msgid "" "If there are no required arguments, the optional groups will behave as if " "they're to the right of the required arguments." msgstr "" -#: ../../howto/clinic.rst:802 +#: ../../howto/clinic.rst:817 msgid "" "In the case of ambiguity, the argument parsing code favors parameters on the " "left (before the required parameters)." msgstr "" -#: ../../howto/clinic.rst:805 +#: ../../howto/clinic.rst:820 msgid "Optional groups can only contain positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:807 +#: ../../howto/clinic.rst:822 msgid "" "Optional groups are *only* intended for legacy code. Please do not use " "optional groups for new code." msgstr "" -#: ../../howto/clinic.rst:812 +#: ../../howto/clinic.rst:827 msgid "" "How to use real Argument Clinic converters, instead of \"legacy converters\"" msgstr "" -#: ../../howto/clinic.rst:814 +#: ../../howto/clinic.rst:829 msgid "" "To save time, and to minimize how much you need to learn to achieve your " "first port to Argument Clinic, the walkthrough above tells you to use " @@ -874,38 +878,38 @@ msgid "" "be clear, their use is acceptable when porting code for Python 3.4." msgstr "" -#: ../../howto/clinic.rst:821 +#: ../../howto/clinic.rst:836 msgid "" "However, in the long term we probably want all our blocks to use Argument " "Clinic's real syntax for converters. Why? A couple reasons:" msgstr "" -#: ../../howto/clinic.rst:825 +#: ../../howto/clinic.rst:840 msgid "" "The proper converters are far easier to read and clearer in their intent." msgstr "" -#: ../../howto/clinic.rst:826 +#: ../../howto/clinic.rst:841 msgid "" "There are some format units that are unsupported as \"legacy converters\", " "because they require arguments, and the legacy converter syntax doesn't " "support specifying arguments." msgstr "" -#: ../../howto/clinic.rst:829 +#: ../../howto/clinic.rst:844 msgid "" "In the future we may have a new argument parsing library that isn't " "restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " "won't be available to parameters using legacy converters." msgstr "" -#: ../../howto/clinic.rst:833 +#: ../../howto/clinic.rst:848 msgid "" "Therefore, if you don't mind a little extra effort, please use the normal " "converters instead of legacy converters." msgstr "" -#: ../../howto/clinic.rst:836 +#: ../../howto/clinic.rst:851 msgid "" "In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " "like a Python function call. However, if there are no explicit arguments to " @@ -913,17 +917,17 @@ msgid "" "parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." msgstr "" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:857 msgid "" "All arguments to Argument Clinic converters are keyword-only. All Argument " "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:865 msgid "*c_default*" msgstr "*c_default*" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:861 msgid "" "The default value for this parameter when defined in C. Specifically, this " "will be the initializer for the variable declared in the \"parse " @@ -931,36 +935,36 @@ msgid "" "how to use this. Specified as a string." msgstr "" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:870 msgid "*annotation*" msgstr "*annotation*" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:868 msgid "" "The annotation value for this parameter. Not currently supported, because :" "pep:`8` mandates that the Python library may not use annotations." msgstr "" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:873 msgid "*unused*" msgstr "*unused*" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:873 msgid "" "Wrap the argument with :c:macro:`Py_UNUSED` in the impl function signature." msgstr "" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:875 msgid "" "In addition, some converters accept additional arguments. Here is a list of " "these arguments, along with their meanings:" msgstr "" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:884 msgid "*accept*" msgstr "*accept*" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:879 msgid "" "A set of Python types (and possibly pseudo-types); this restricts the " "allowable Python argument to values of these types. (This is not a general-" @@ -968,68 +972,68 @@ msgid "" "shown in the legacy converter table.)" msgstr "" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:884 msgid "To accept ``None``, add ``NoneType`` to this set." msgstr "" -#: ../../howto/clinic.rst:874 +#: ../../howto/clinic.rst:889 msgid "*bitwise*" msgstr "*bitwise*" -#: ../../howto/clinic.rst:872 +#: ../../howto/clinic.rst:887 msgid "" "Only supported for unsigned integers. The native integer value of this " "Python argument will be written to the parameter without any range checking, " "even for negative values." msgstr "" -#: ../../howto/clinic.rst:879 +#: ../../howto/clinic.rst:894 msgid "*converter*" msgstr "*converter*" -#: ../../howto/clinic.rst:877 +#: ../../howto/clinic.rst:892 msgid "" "Only supported by the ``object`` converter. Specifies the name of a :ref:`C " "\"converter function\" ` to use to convert this object to a " "native type." msgstr "" -#: ../../howto/clinic.rst:884 +#: ../../howto/clinic.rst:899 msgid "*encoding*" msgstr "*encoding*" -#: ../../howto/clinic.rst:882 +#: ../../howto/clinic.rst:897 msgid "" "Only supported for strings. Specifies the encoding to use when converting " "this string from a Python str (Unicode) value into a C ``char *`` value." msgstr "" -#: ../../howto/clinic.rst:888 +#: ../../howto/clinic.rst:903 msgid "*subclass_of*" msgstr "*subclass_of*" -#: ../../howto/clinic.rst:887 +#: ../../howto/clinic.rst:902 msgid "" "Only supported for the ``object`` converter. Requires that the Python value " "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:893 +#: ../../howto/clinic.rst:908 msgid "*type*" msgstr "" -#: ../../howto/clinic.rst:891 +#: ../../howto/clinic.rst:906 msgid "" "Only supported for the ``object`` and ``self`` converters. Specifies the C " "type that will be used to declare the variable. Default value is " "``\"PyObject *\"``." msgstr "" -#: ../../howto/clinic.rst:899 +#: ../../howto/clinic.rst:914 msgid "*zeroes*" msgstr "*zeroes*" -#: ../../howto/clinic.rst:896 +#: ../../howto/clinic.rst:911 msgid "" "Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " "permitted inside the value. The length of the string will be passed in to " @@ -1037,7 +1041,7 @@ msgid "" "``_length``." msgstr "" -#: ../../howto/clinic.rst:901 +#: ../../howto/clinic.rst:916 msgid "" "Please note, not every possible combination of arguments will work. Usually " "these arguments are implemented by specific :c:func:`PyArg_ParseTuple` " @@ -1048,350 +1052,350 @@ msgid "" "(Or, at least, not yet.)" msgstr "" -#: ../../howto/clinic.rst:909 +#: ../../howto/clinic.rst:924 msgid "" "Below is a table showing the mapping of legacy converters into real Argument " "Clinic converters. On the left is the legacy converter, on the right is the " "text you'd replace it with." msgstr "" -#: ../../howto/clinic.rst:914 +#: ../../howto/clinic.rst:929 msgid "``'B'``" msgstr "``'B'``" -#: ../../howto/clinic.rst:914 +#: ../../howto/clinic.rst:929 msgid "``unsigned_char(bitwise=True)``" msgstr "``unsigned_char(bitwise=True)``" -#: ../../howto/clinic.rst:915 +#: ../../howto/clinic.rst:930 msgid "``'b'``" msgstr "``'b'``" -#: ../../howto/clinic.rst:915 +#: ../../howto/clinic.rst:930 msgid "``unsigned_char``" msgstr "``unsigned_char``" -#: ../../howto/clinic.rst:916 +#: ../../howto/clinic.rst:931 msgid "``'c'``" msgstr "``'c'``" -#: ../../howto/clinic.rst:916 +#: ../../howto/clinic.rst:931 msgid "``char``" msgstr "``char``" -#: ../../howto/clinic.rst:917 +#: ../../howto/clinic.rst:932 msgid "``'C'``" msgstr "``'C'``" -#: ../../howto/clinic.rst:917 +#: ../../howto/clinic.rst:932 msgid "``int(accept={str})``" msgstr "``int(accept={str})``" -#: ../../howto/clinic.rst:918 +#: ../../howto/clinic.rst:933 msgid "``'d'``" msgstr "``'d'``" -#: ../../howto/clinic.rst:918 +#: ../../howto/clinic.rst:933 msgid "``double``" msgstr "``double``" -#: ../../howto/clinic.rst:919 +#: ../../howto/clinic.rst:934 msgid "``'D'``" msgstr "``'D'``" -#: ../../howto/clinic.rst:919 +#: ../../howto/clinic.rst:934 msgid "``Py_complex``" msgstr "``Py_complex``" -#: ../../howto/clinic.rst:920 +#: ../../howto/clinic.rst:935 msgid "``'es'``" msgstr "``'es'``" -#: ../../howto/clinic.rst:920 +#: ../../howto/clinic.rst:935 msgid "``str(encoding='name_of_encoding')``" msgstr "``str(encoding='name_of_encoding')``" -#: ../../howto/clinic.rst:921 +#: ../../howto/clinic.rst:936 msgid "``'es#'``" msgstr "``'es#'``" -#: ../../howto/clinic.rst:921 +#: ../../howto/clinic.rst:936 msgid "``str(encoding='name_of_encoding', zeroes=True)``" msgstr "``str(encoding='name_of_encoding', zeroes=True)``" -#: ../../howto/clinic.rst:922 +#: ../../howto/clinic.rst:937 msgid "``'et'``" msgstr "``'et'``" -#: ../../howto/clinic.rst:922 +#: ../../howto/clinic.rst:937 msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -#: ../../howto/clinic.rst:923 +#: ../../howto/clinic.rst:938 msgid "``'et#'``" msgstr "``'et#'``" -#: ../../howto/clinic.rst:923 +#: ../../howto/clinic.rst:938 msgid "" "``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " "zeroes=True)``" msgstr "" -#: ../../howto/clinic.rst:924 +#: ../../howto/clinic.rst:939 msgid "``'f'``" msgstr "``'f'``" -#: ../../howto/clinic.rst:924 +#: ../../howto/clinic.rst:939 msgid "``float``" msgstr "``float``" -#: ../../howto/clinic.rst:925 +#: ../../howto/clinic.rst:940 msgid "``'h'``" msgstr "``'h'``" -#: ../../howto/clinic.rst:925 +#: ../../howto/clinic.rst:940 msgid "``short``" msgstr "``short``" -#: ../../howto/clinic.rst:926 +#: ../../howto/clinic.rst:941 msgid "``'H'``" msgstr "``'H'``" -#: ../../howto/clinic.rst:926 +#: ../../howto/clinic.rst:941 msgid "``unsigned_short(bitwise=True)``" msgstr "``unsigned_short(bitwise=True)``" -#: ../../howto/clinic.rst:927 +#: ../../howto/clinic.rst:942 msgid "``'i'``" msgstr "``'i'``" -#: ../../howto/clinic.rst:927 +#: ../../howto/clinic.rst:942 msgid "``int``" msgstr "``int``" -#: ../../howto/clinic.rst:928 +#: ../../howto/clinic.rst:943 msgid "``'I'``" msgstr "``'I'``" -#: ../../howto/clinic.rst:928 +#: ../../howto/clinic.rst:943 msgid "``unsigned_int(bitwise=True)``" msgstr "``unsigned_int(bitwise=True)``" -#: ../../howto/clinic.rst:929 +#: ../../howto/clinic.rst:944 msgid "``'k'``" msgstr "``'k'``" -#: ../../howto/clinic.rst:929 +#: ../../howto/clinic.rst:944 msgid "``unsigned_long(bitwise=True)``" msgstr "``unsigned_long(bitwise=True)``" -#: ../../howto/clinic.rst:930 +#: ../../howto/clinic.rst:945 msgid "``'K'``" msgstr "``'K'``" -#: ../../howto/clinic.rst:930 +#: ../../howto/clinic.rst:945 msgid "``unsigned_long_long(bitwise=True)``" msgstr "``unsigned_long_long(bitwise=True)``" -#: ../../howto/clinic.rst:931 +#: ../../howto/clinic.rst:946 msgid "``'l'``" msgstr "``'l'``" -#: ../../howto/clinic.rst:931 +#: ../../howto/clinic.rst:946 msgid "``long``" msgstr "``long``" -#: ../../howto/clinic.rst:932 +#: ../../howto/clinic.rst:947 msgid "``'L'``" msgstr "``'L'``" -#: ../../howto/clinic.rst:932 +#: ../../howto/clinic.rst:947 msgid "``long long``" msgstr "``long long``" -#: ../../howto/clinic.rst:933 +#: ../../howto/clinic.rst:948 msgid "``'n'``" msgstr "``'n'``" -#: ../../howto/clinic.rst:933 +#: ../../howto/clinic.rst:948 msgid "``Py_ssize_t``" msgstr "``Py_ssize_t``" -#: ../../howto/clinic.rst:934 +#: ../../howto/clinic.rst:949 msgid "``'O'``" msgstr "``'O'``" -#: ../../howto/clinic.rst:934 +#: ../../howto/clinic.rst:949 msgid "``object``" msgstr "``object``" -#: ../../howto/clinic.rst:935 +#: ../../howto/clinic.rst:950 msgid "``'O!'``" msgstr "``'O!'``" -#: ../../howto/clinic.rst:935 +#: ../../howto/clinic.rst:950 msgid "``object(subclass_of='&PySomething_Type')``" msgstr "``object(subclass_of='&PySomething_Type')``" -#: ../../howto/clinic.rst:936 +#: ../../howto/clinic.rst:951 msgid "``'O&'``" msgstr "``'O&'``" -#: ../../howto/clinic.rst:936 +#: ../../howto/clinic.rst:951 msgid "``object(converter='name_of_c_function')``" msgstr "``object(converter='name_of_c_function')``" -#: ../../howto/clinic.rst:937 +#: ../../howto/clinic.rst:952 msgid "``'p'``" msgstr "``'p'``" -#: ../../howto/clinic.rst:937 +#: ../../howto/clinic.rst:952 msgid "``bool``" msgstr "``bool``" -#: ../../howto/clinic.rst:938 +#: ../../howto/clinic.rst:953 msgid "``'S'``" msgstr "``'S'``" -#: ../../howto/clinic.rst:938 +#: ../../howto/clinic.rst:953 msgid "``PyBytesObject``" msgstr "``PyBytesObject``" -#: ../../howto/clinic.rst:939 +#: ../../howto/clinic.rst:954 msgid "``'s'``" msgstr "``'s'``" -#: ../../howto/clinic.rst:939 +#: ../../howto/clinic.rst:954 msgid "``str``" msgstr "``str``" -#: ../../howto/clinic.rst:940 +#: ../../howto/clinic.rst:955 msgid "``'s#'``" msgstr "``'s#'``" -#: ../../howto/clinic.rst:940 +#: ../../howto/clinic.rst:955 msgid "``str(zeroes=True)``" msgstr "``str(zeroes=True)``" -#: ../../howto/clinic.rst:941 +#: ../../howto/clinic.rst:956 msgid "``'s*'``" msgstr "``'s*'``" -#: ../../howto/clinic.rst:941 +#: ../../howto/clinic.rst:956 msgid "``Py_buffer(accept={buffer, str})``" msgstr "``Py_buffer(accept={buffer, str})``" -#: ../../howto/clinic.rst:942 +#: ../../howto/clinic.rst:957 msgid "``'U'``" msgstr "``'U'``" -#: ../../howto/clinic.rst:942 +#: ../../howto/clinic.rst:957 msgid "``unicode``" msgstr "``unicode``" -#: ../../howto/clinic.rst:943 +#: ../../howto/clinic.rst:958 msgid "``'u'``" msgstr "``'u'``" -#: ../../howto/clinic.rst:943 +#: ../../howto/clinic.rst:958 msgid "``wchar_t``" msgstr "``wchar_t``" -#: ../../howto/clinic.rst:944 +#: ../../howto/clinic.rst:959 msgid "``'u#'``" msgstr "``'u#'``" -#: ../../howto/clinic.rst:944 +#: ../../howto/clinic.rst:959 msgid "``wchar_t(zeroes=True)``" msgstr "``wchar_t(zeroes=True)``" -#: ../../howto/clinic.rst:945 +#: ../../howto/clinic.rst:960 msgid "``'w*'``" msgstr "``'w*'``" -#: ../../howto/clinic.rst:945 +#: ../../howto/clinic.rst:960 msgid "``Py_buffer(accept={rwbuffer})``" msgstr "``Py_buffer(accept={rwbuffer})``" -#: ../../howto/clinic.rst:946 +#: ../../howto/clinic.rst:961 msgid "``'Y'``" msgstr "``'Y'``" -#: ../../howto/clinic.rst:946 +#: ../../howto/clinic.rst:961 msgid "``PyByteArrayObject``" msgstr "``PyByteArrayObject``" -#: ../../howto/clinic.rst:947 +#: ../../howto/clinic.rst:962 msgid "``'y'``" msgstr "``'y'``" -#: ../../howto/clinic.rst:947 +#: ../../howto/clinic.rst:962 msgid "``str(accept={bytes})``" msgstr "``str(accept={bytes})``" -#: ../../howto/clinic.rst:948 +#: ../../howto/clinic.rst:963 msgid "``'y#'``" msgstr "``'y#'``" -#: ../../howto/clinic.rst:948 +#: ../../howto/clinic.rst:963 msgid "``str(accept={robuffer}, zeroes=True)``" msgstr "``str(accept={robuffer}, zeroes=True)``" -#: ../../howto/clinic.rst:949 +#: ../../howto/clinic.rst:964 msgid "``'y*'``" msgstr "``'y*'``" -#: ../../howto/clinic.rst:949 +#: ../../howto/clinic.rst:964 msgid "``Py_buffer``" msgstr "``Py_buffer``" -#: ../../howto/clinic.rst:950 +#: ../../howto/clinic.rst:965 msgid "``'Z'``" msgstr "``'Z'``" -#: ../../howto/clinic.rst:950 +#: ../../howto/clinic.rst:965 msgid "``wchar_t(accept={str, NoneType})``" msgstr "``wchar_t(accept={str, NoneType})``" -#: ../../howto/clinic.rst:951 +#: ../../howto/clinic.rst:966 msgid "``'Z#'``" msgstr "``'Z#'``" -#: ../../howto/clinic.rst:951 +#: ../../howto/clinic.rst:966 msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" msgstr "``wchar_t(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:952 +#: ../../howto/clinic.rst:967 msgid "``'z'``" msgstr "``'z'``" -#: ../../howto/clinic.rst:952 +#: ../../howto/clinic.rst:967 msgid "``str(accept={str, NoneType})``" msgstr "``str(accept={str, NoneType})``" -#: ../../howto/clinic.rst:953 +#: ../../howto/clinic.rst:968 msgid "``'z#'``" msgstr "``'z#'``" -#: ../../howto/clinic.rst:953 +#: ../../howto/clinic.rst:968 msgid "``str(accept={str, NoneType}, zeroes=True)``" msgstr "``str(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:954 +#: ../../howto/clinic.rst:969 msgid "``'z*'``" msgstr "``'z*'``" -#: ../../howto/clinic.rst:954 +#: ../../howto/clinic.rst:969 msgid "``Py_buffer(accept={buffer, str, NoneType})``" msgstr "``Py_buffer(accept={buffer, str, NoneType})``" -#: ../../howto/clinic.rst:957 +#: ../../howto/clinic.rst:972 msgid "" "As an example, here's our sample ``pickle.Pickler.dump`` using the proper " "converter::" msgstr "" -#: ../../howto/clinic.rst:970 +#: ../../howto/clinic.rst:985 msgid "" "One advantage of real converters is that they're more flexible than legacy " "converters. For example, the ``unsigned_int`` converter (and all the " @@ -1400,7 +1404,7 @@ msgid "" "negative numbers. You just can't do that with a legacy converter!" msgstr "" -#: ../../howto/clinic.rst:976 +#: ../../howto/clinic.rst:991 msgid "" "Argument Clinic will show you all the converters it has available. For each " "converter it'll show you all the parameters it accepts, along with the " @@ -1408,11 +1412,11 @@ msgid "" "converters`` to see the full list." msgstr "" -#: ../../howto/clinic.rst:983 +#: ../../howto/clinic.rst:998 msgid "How to use the ``Py_buffer`` converter" msgstr "" -#: ../../howto/clinic.rst:985 +#: ../../howto/clinic.rst:1000 msgid "" "When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " "or ``'z*'`` legacy converters), you *must* not call :c:func:" @@ -1420,17 +1424,17 @@ msgid "" "that does it for you (in the parsing function)." msgstr "" -#: ../../howto/clinic.rst:994 +#: ../../howto/clinic.rst:1009 msgid "How to use advanced converters" msgstr "" -#: ../../howto/clinic.rst:996 +#: ../../howto/clinic.rst:1011 msgid "" "Remember those format units you skipped for your first time because they " "were advanced? Here's how to handle those too." msgstr "" -#: ../../howto/clinic.rst:999 +#: ../../howto/clinic.rst:1014 msgid "" "The trick is, all those format units take arguments—either conversion " "functions, or types, or strings specifying an encoding. (But \"legacy " @@ -1441,7 +1445,7 @@ msgid "" "start with ``e``)." msgstr "" -#: ../../howto/clinic.rst:1007 +#: ../../howto/clinic.rst:1022 msgid "" "When using *subclass_of*, you may also want to use the other custom argument " "for ``object()``: *type*, which lets you set the type actually used for the " @@ -1450,7 +1454,7 @@ msgid "" "``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." msgstr "" -#: ../../howto/clinic.rst:1013 +#: ../../howto/clinic.rst:1028 msgid "" "One possible problem with using Argument Clinic: it takes away some possible " "flexibility for the format units starting with ``e``. When writing a :c:" @@ -1463,31 +1467,31 @@ msgid "" "parameters whose format units start with ``e``." msgstr "" -#: ../../howto/clinic.rst:1027 +#: ../../howto/clinic.rst:1042 msgid "How to assign default values to parameter" msgstr "" -#: ../../howto/clinic.rst:1029 +#: ../../howto/clinic.rst:1044 msgid "" "Default values for parameters can be any of a number of values. At their " "simplest, they can be string, int, or float literals:" msgstr "" -#: ../../howto/clinic.rst:1038 +#: ../../howto/clinic.rst:1053 msgid "They can also use any of Python's built-in constants:" msgstr "" -#: ../../howto/clinic.rst:1046 +#: ../../howto/clinic.rst:1061 msgid "" "There's also special support for a default value of ``NULL``, and for simple " "expressions, documented in the following sections." msgstr "" -#: ../../howto/clinic.rst:1051 +#: ../../howto/clinic.rst:1066 msgid "The ``NULL`` default value" msgstr "" -#: ../../howto/clinic.rst:1053 +#: ../../howto/clinic.rst:1068 msgid "" "For string and object parameters, you can set them to ``None`` to indicate " "that there's no default. However, that means the C variable will be " @@ -1497,45 +1501,45 @@ msgid "" "with ``NULL``." msgstr "" -#: ../../howto/clinic.rst:1062 +#: ../../howto/clinic.rst:1077 msgid "Symbolic default values" msgstr "" -#: ../../howto/clinic.rst:1064 +#: ../../howto/clinic.rst:1079 msgid "" "The default value you provide for a parameter can't be any arbitrary " "expression. Currently the following are explicitly supported:" msgstr "" -#: ../../howto/clinic.rst:1067 +#: ../../howto/clinic.rst:1082 msgid "Numeric constants (integer and float)" msgstr "" -#: ../../howto/clinic.rst:1068 +#: ../../howto/clinic.rst:1083 msgid "String constants" msgstr "" -#: ../../howto/clinic.rst:1069 +#: ../../howto/clinic.rst:1084 msgid "``True``, ``False``, and ``None``" -msgstr "" +msgstr "``True``、``False`` 和 ``None``" -#: ../../howto/clinic.rst:1070 +#: ../../howto/clinic.rst:1085 msgid "" "Simple symbolic constants like :py:data:`sys.maxsize`, which must start with " "the name of the module" msgstr "" -#: ../../howto/clinic.rst:1073 +#: ../../howto/clinic.rst:1088 msgid "" "(In the future, this may need to get even more elaborate, to allow full " "expressions like ``CONSTANT - 1``.)" msgstr "" -#: ../../howto/clinic.rst:1078 +#: ../../howto/clinic.rst:1093 msgid "Expressions as default values" msgstr "" -#: ../../howto/clinic.rst:1080 +#: ../../howto/clinic.rst:1095 msgid "" "The default value for a parameter can be more than just a literal value. It " "can be an entire expression, using math operators and looking up attributes " @@ -1543,11 +1547,11 @@ msgid "" "obvious semantics." msgstr "" -#: ../../howto/clinic.rst:1085 +#: ../../howto/clinic.rst:1100 msgid "Consider the following example:" msgstr "" -#: ../../howto/clinic.rst:1091 +#: ../../howto/clinic.rst:1106 msgid "" ":py:data:`sys.maxsize` can have different values on different platforms. " "Therefore Argument Clinic can't simply evaluate that expression locally and " @@ -1555,7 +1559,7 @@ msgid "" "evaluated at runtime, when the user asks for the function's signature." msgstr "" -#: ../../howto/clinic.rst:1096 +#: ../../howto/clinic.rst:1111 msgid "" "What namespace is available when the expression is evaluated? It's " "evaluated in the context of the module the builtin came from. So, if your " @@ -1563,7 +1567,7 @@ msgid "" "it:" msgstr "" -#: ../../howto/clinic.rst:1104 +#: ../../howto/clinic.rst:1119 msgid "" "If the symbol isn't found in the current module, it fails over to looking " "in :py:data:`sys.modules`. That's how it can find :py:data:`sys.maxsize` " @@ -1572,7 +1576,7 @@ msgid "" "are preloaded by Python itself.)" msgstr "" -#: ../../howto/clinic.rst:1109 +#: ../../howto/clinic.rst:1124 msgid "" "Evaluating default values only at runtime means Argument Clinic can't " "compute the correct equivalent C default value. So you need to tell it " @@ -1580,7 +1584,7 @@ msgid "" "expression in C, using the *c_default* parameter to the converter:" msgstr "" -#: ../../howto/clinic.rst:1118 +#: ../../howto/clinic.rst:1133 msgid "" "Another complication: Argument Clinic can't know in advance whether or not " "the expression you supply is valid. It parses it to make sure it looks " @@ -1588,38 +1592,38 @@ msgid "" "expressions to specify values that are guaranteed to be valid at runtime!" msgstr "" -#: ../../howto/clinic.rst:1123 +#: ../../howto/clinic.rst:1138 msgid "" "Finally, because expressions must be representable as static C values, there " "are many restrictions on legal expressions. Here's a list of Python " "features you're not permitted to use:" msgstr "" -#: ../../howto/clinic.rst:1127 +#: ../../howto/clinic.rst:1142 msgid "Function calls." msgstr "" -#: ../../howto/clinic.rst:1128 +#: ../../howto/clinic.rst:1143 msgid "Inline if statements (``3 if foo else 5``)." msgstr "" -#: ../../howto/clinic.rst:1129 +#: ../../howto/clinic.rst:1144 msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." msgstr "" -#: ../../howto/clinic.rst:1130 +#: ../../howto/clinic.rst:1145 msgid "List/set/dict comprehensions and generator expressions." msgstr "" -#: ../../howto/clinic.rst:1131 +#: ../../howto/clinic.rst:1146 msgid "Tuple/list/set/dict literals." msgstr "" -#: ../../howto/clinic.rst:1137 +#: ../../howto/clinic.rst:1152 msgid "How to use return converters" msgstr "" -#: ../../howto/clinic.rst:1139 +#: ../../howto/clinic.rst:1154 msgid "" "By default, the impl function Argument Clinic generates for you returns :c:" "type:`PyObject * `. But your C function often computes some C " @@ -1629,38 +1633,38 @@ msgid "" "a Python type too?" msgstr "" -#: ../../howto/clinic.rst:1147 +#: ../../howto/clinic.rst:1162 msgid "" "That's what a \"return converter\" does. It changes your impl function to " "return some C type, then adds code to the generated (non-impl) function to " "handle converting that value into the appropriate :c:type:`!PyObject *`." msgstr "" -#: ../../howto/clinic.rst:1151 +#: ../../howto/clinic.rst:1166 msgid "" "The syntax for return converters is similar to that of parameter converters. " "You specify the return converter like it was a return annotation on the " "function itself, using ``->`` notation." msgstr "" -#: ../../howto/clinic.rst:1155 +#: ../../howto/clinic.rst:1170 msgid "For example:" msgstr "" -#: ../../howto/clinic.rst:1168 +#: ../../howto/clinic.rst:1183 msgid "" "Return converters behave much the same as parameter converters; they take " "arguments, the arguments are all keyword-only, and if you're not changing " "any of the default arguments you can omit the parentheses." msgstr "" -#: ../../howto/clinic.rst:1172 +#: ../../howto/clinic.rst:1187 msgid "" "(If you use both ``\"as\"`` *and* a return converter for your function, the " "``\"as\"`` should come before the return converter.)" msgstr "" -#: ../../howto/clinic.rst:1175 +#: ../../howto/clinic.rst:1190 msgid "" "There's one additional complication when using return converters: how do you " "indicate an error has occurred? Normally, a function returns a valid (non-" @@ -1673,127 +1677,127 @@ msgid "" "you return like normal." msgstr "" -#: ../../howto/clinic.rst:1184 +#: ../../howto/clinic.rst:1199 msgid "Currently Argument Clinic supports only a few return converters:" msgstr "" -#: ../../howto/clinic.rst:1198 +#: ../../howto/clinic.rst:1213 msgid "" "None of these take parameters. For all of these, return ``-1`` to indicate " "error." msgstr "" -#: ../../howto/clinic.rst:1201 +#: ../../howto/clinic.rst:1216 msgid "" "To see all the return converters Argument Clinic supports, along with their " "parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " "the full list." msgstr "" -#: ../../howto/clinic.rst:1207 +#: ../../howto/clinic.rst:1222 msgid "How to clone existing functions" msgstr "" -#: ../../howto/clinic.rst:1209 +#: ../../howto/clinic.rst:1224 msgid "" "If you have a number of functions that look similar, you may be able to use " "Clinic's \"clone\" feature. When you clone an existing function, you reuse:" msgstr "" -#: ../../howto/clinic.rst:1213 +#: ../../howto/clinic.rst:1228 msgid "its parameters, including" msgstr "" -#: ../../howto/clinic.rst:1215 +#: ../../howto/clinic.rst:1230 msgid "their names," msgstr "" -#: ../../howto/clinic.rst:1217 +#: ../../howto/clinic.rst:1232 msgid "their converters, with all parameters," msgstr "" -#: ../../howto/clinic.rst:1219 +#: ../../howto/clinic.rst:1234 msgid "their default values," msgstr "" -#: ../../howto/clinic.rst:1221 +#: ../../howto/clinic.rst:1236 msgid "their per-parameter docstrings," msgstr "" -#: ../../howto/clinic.rst:1223 +#: ../../howto/clinic.rst:1238 msgid "" "their *kind* (whether they're positional only, positional or keyword, or " "keyword only), and" msgstr "" -#: ../../howto/clinic.rst:1226 +#: ../../howto/clinic.rst:1241 msgid "its return converter." msgstr "" -#: ../../howto/clinic.rst:1228 +#: ../../howto/clinic.rst:1243 msgid "" "The only thing not copied from the original function is its docstring; the " "syntax allows you to specify a new docstring." msgstr "" -#: ../../howto/clinic.rst:1231 +#: ../../howto/clinic.rst:1246 msgid "Here's the syntax for cloning a function::" msgstr "" -#: ../../howto/clinic.rst:1239 +#: ../../howto/clinic.rst:1254 msgid "" "(The functions can be in different modules or classes. I wrote ``module." "class`` in the sample just to illustrate that you must use the full path to " "*both* functions.)" msgstr "" -#: ../../howto/clinic.rst:1243 +#: ../../howto/clinic.rst:1258 msgid "" "Sorry, there's no syntax for partially cloning a function, or cloning a " "function then modifying it. Cloning is an all-or nothing proposition." msgstr "" -#: ../../howto/clinic.rst:1246 +#: ../../howto/clinic.rst:1261 msgid "" "Also, the function you are cloning from must have been previously defined in " "the current file." msgstr "" -#: ../../howto/clinic.rst:1251 +#: ../../howto/clinic.rst:1266 msgid "How to call Python code" msgstr "" -#: ../../howto/clinic.rst:1253 +#: ../../howto/clinic.rst:1268 msgid "" "The rest of the advanced topics require you to write Python code which lives " "inside your C file and modifies Argument Clinic's runtime state. This is " "simple: you simply define a Python block." msgstr "" -#: ../../howto/clinic.rst:1257 +#: ../../howto/clinic.rst:1272 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1264 +#: ../../howto/clinic.rst:1279 msgid "" "All the code inside the Python block is executed at the time it's parsed. " "All text written to stdout inside the block is redirected into the " "\"output\" after the block." msgstr "" -#: ../../howto/clinic.rst:1268 +#: ../../howto/clinic.rst:1283 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1281 +#: ../../howto/clinic.rst:1296 msgid "How to use the \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1283 +#: ../../howto/clinic.rst:1298 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " @@ -1804,13 +1808,13 @@ msgid "" "self_converter` or a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1292 +#: ../../howto/clinic.rst:1307 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1295 +#: ../../howto/clinic.rst:1310 msgid "" "How do you specify the custom type you want to cast ``self`` to? If you only " "have one or two functions with the same type for ``self``, you can directly " @@ -1818,18 +1822,18 @@ msgid "" "want to use as the *type* parameter::" msgstr "" -#: ../../howto/clinic.rst:1311 +#: ../../howto/clinic.rst:1326 msgid "" "On the other hand, if you have a lot of functions that will use the same " "type for ``self``, it's best to create your own converter, subclassing :" "class:`!self_converter` but overwriting the :py:attr:`!type` member::" msgstr "" -#: ../../howto/clinic.rst:1333 +#: ../../howto/clinic.rst:1348 msgid "How to use the \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1335 +#: ../../howto/clinic.rst:1350 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1839,25 +1843,25 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1341 +#: ../../howto/clinic.rst:1356 msgid "" "Example from :source:`Modules/zlibmodule.c`. First, ``defining_class`` is " "added to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1353 +#: ../../howto/clinic.rst:1368 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1363 +#: ../../howto/clinic.rst:1378 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1369 +#: ../../howto/clinic.rst:1384 msgid "" "Each method may only have one argument using this converter, and it must " "appear after ``self``, or, if ``self`` is not used, as the first argument. " @@ -1865,14 +1869,14 @@ msgid "" "appear in the :py:attr:`!__text_signature__`." msgstr "" -#: ../../howto/clinic.rst:1374 +#: ../../howto/clinic.rst:1389 msgid "" "The ``defining_class`` converter is not compatible with :py:meth:`!__init__` " "and :py:meth:`!__new__` methods, which cannot use the :c:macro:`METH_METHOD` " "convention." msgstr "" -#: ../../howto/clinic.rst:1378 +#: ../../howto/clinic.rst:1393 msgid "" "It is not possible to use ``defining_class`` with slot methods. In order to " "fetch the module state from such methods, use :c:func:" @@ -1881,134 +1885,74 @@ msgid "" "``setattro`` slot method in :source:`Modules/_threadmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1393 +#: ../../howto/clinic.rst:1408 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1397 +#: ../../howto/clinic.rst:1414 msgid "How to write a custom converter" msgstr "" -#: ../../howto/clinic.rst:1399 -msgid "" -"As we hinted at in the previous section... you can write your own " -"converters! A converter is simply a Python class that inherits from :py:" -"class:`!CConverter`. The main purpose of a custom converter is if you have a " -"parameter using the ``O&`` format unit—parsing this parameter means calling " -"a :c:func:`PyArg_ParseTuple` \"converter function\"." -msgstr "" - -#: ../../howto/clinic.rst:1405 +#: ../../howto/clinic.rst:1416 msgid "" -"Your converter class should be named ``*something*_converter``. If the name " -"follows this convention, then your converter class will be automatically " -"registered with Argument Clinic; its name will be the name of your class " -"with the ``_converter`` suffix stripped off. (This is accomplished with a " -"metaclass.)" +"A converter is a Python class that inherits from :py:class:`CConverter`. The " +"main purpose of a custom converter, is for parameters parsed with the ``O&`` " +"format unit --- parsing such a parameter means calling a :c:func:" +"`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1411 +#: ../../howto/clinic.rst:1421 msgid "" -"You shouldn't subclass :py:meth:`!CConverter.__init__`. Instead, you should " -"write a :py:meth:`!converter_init` function. :py:meth:`!converter_init` " -"always accepts a *self* parameter; after that, all additional parameters " -"*must* be keyword-only. Any arguments passed in to the converter in " -"Argument Clinic will be passed along to your :py:meth:`!converter_init`." +"Your converter class should be named :samp:`{ConverterName}_converter`. By " +"following this convention, your converter class will be automatically " +"registered with Argument Clinic, with its *converter name* being the name of " +"your converter class with the ``_converter`` suffix stripped off." msgstr "" -#: ../../howto/clinic.rst:1418 +#: ../../howto/clinic.rst:1426 msgid "" -"There are some additional members of :py:class:`!CConverter` you may wish to " -"specify in your subclass. Here's the current list:" -msgstr "" - -#: ../../howto/clinic.rst:1427 -msgid "" -"The C type to use for this variable. :attr:`!type` should be a Python string " -"specifying the type, e.g. ``'int'``. If this is a pointer type, the type " -"string should end with ``' *'``." -msgstr "" - -#: ../../howto/clinic.rst:1434 -msgid "" -"The Python default value for this parameter, as a Python value. Or the magic " -"value ``unspecified`` if there is no default." -msgstr "" - -#: ../../howto/clinic.rst:1439 -msgid "" -":attr:`!default` as it should appear in Python code, as a string. Or " -"``None`` if there is no default." -msgstr "" - -#: ../../howto/clinic.rst:1445 -msgid "" -":attr:`!default` as it should appear in C code, as a string. Or ``None`` if " -"there is no default." -msgstr "" - -#: ../../howto/clinic.rst:1451 -msgid "" -"The default value used to initialize the C variable when there is no " -"default, but not specifying a default may result in an \"uninitialized " -"variable\" warning. This can easily happen when using option groups—" -"although properly written code will never actually use this value, the " -"variable does get passed in to the impl, and the C compiler will complain " -"about the \"use\" of the uninitialized value. This value should always be a " -"non-empty string." -msgstr "" - -#: ../../howto/clinic.rst:1463 -msgid "The name of the C converter function, as a string." -msgstr "" - -#: ../../howto/clinic.rst:1467 -msgid "" -"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " -"name of the variable when passing it into the impl function." +"Instead of subclassing :py:meth:`!CConverter.__init__`, write a :py:meth:`!" +"converter_init` method. :py:meth:`!converter_init` always accepts a *self* " +"parameter. After *self*, all additional parameters **must** be keyword-only. " +"Any arguments passed to the converter in Argument Clinic will be passed " +"along to your :py:meth:`!converter_init` method. See :py:class:`CConverter` " +"for a list of members you may wish to specify in your subclass." msgstr "" -#: ../../howto/clinic.rst:1473 -msgid "" -"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " -"name of the variable when passing it into :c:func:`PyArg_ParseTuple`." -msgstr "" - -#: ../../howto/clinic.rst:1478 +#: ../../howto/clinic.rst:1435 msgid "" "Here's the simplest example of a custom converter, from :source:`Modules/" "zlibmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1489 +#: ../../howto/clinic.rst:1446 msgid "" -"This block adds a converter to Argument Clinic named ``ssize_t``. " -"Parameters declared as ``ssize_t`` will be declared as type :c:type:" -"`Py_ssize_t`, and will be parsed by the ``'O&'`` format unit, which will " -"call the ``ssize_t_converter`` converter function. ``ssize_t`` variables " -"automatically support default values." +"This block adds a converter named ``ssize_t`` to Argument Clinic. Parameters " +"declared as ``ssize_t`` will be declared with type :c:type:`Py_ssize_t`, and " +"will be parsed by the ``'O&'`` format unit, which will call the :c:func:`!" +"ssize_t_converter` converter C function. ``ssize_t`` variables automatically " +"support default values." msgstr "" -#: ../../howto/clinic.rst:1495 +#: ../../howto/clinic.rst:1452 msgid "" "More sophisticated custom converters can insert custom C code to handle " "initialization and cleanup. You can see more examples of custom converters " -"in the CPython source tree; grep the C files for the string :py:class:`!" -"CConverter`." +"in the CPython source tree; grep the C files for the string ``CConverter``." msgstr "" -#: ../../howto/clinic.rst:1502 +#: ../../howto/clinic.rst:1459 msgid "How to write a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1504 +#: ../../howto/clinic.rst:1461 msgid "" "Writing a custom return converter is much like writing a custom converter. " "Except it's somewhat simpler, because return converters are themselves much " "simpler." msgstr "" -#: ../../howto/clinic.rst:1508 +#: ../../howto/clinic.rst:1465 msgid "" "Return converters must subclass :py:class:`!CReturnConverter`. There are no " "examples yet of custom return converters, because they are not widely used " @@ -2017,60 +1961,60 @@ msgid "" "CReturnConverter` and all its subclasses." msgstr "" -#: ../../howto/clinic.rst:1517 +#: ../../howto/clinic.rst:1474 msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" msgstr "" -#: ../../howto/clinic.rst:1519 +#: ../../howto/clinic.rst:1476 msgid "" "To convert a function using :c:macro:`METH_O`, make sure the function's " "single argument is using the ``object`` converter, and mark the arguments as " "positional-only::" msgstr "" -#: ../../howto/clinic.rst:1531 +#: ../../howto/clinic.rst:1488 msgid "" "To convert a function using :c:macro:`METH_NOARGS`, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1534 +#: ../../howto/clinic.rst:1491 msgid "" "You can still use a self converter, a return converter, and specify a *type* " "argument to the object converter for :c:macro:`METH_O`." msgstr "" -#: ../../howto/clinic.rst:1539 +#: ../../howto/clinic.rst:1496 msgid "How to convert ``tp_new`` and ``tp_init`` functions" msgstr "" -#: ../../howto/clinic.rst:1541 +#: ../../howto/clinic.rst:1498 msgid "" "You can convert :c:member:`~PyTypeObject.tp_new` and :c:member:" "`~PyTypeObject.tp_init` functions. Just name them ``__new__`` or " "``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1545 +#: ../../howto/clinic.rst:1502 msgid "" "The function name generated for ``__new__`` doesn't end in ``__new__`` like " "it would by default. It's just the name of the class, converted into a " "valid C identifier." msgstr "" -#: ../../howto/clinic.rst:1549 +#: ../../howto/clinic.rst:1506 msgid "No :c:type:`PyMethodDef` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1551 +#: ../../howto/clinic.rst:1508 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1553 +#: ../../howto/clinic.rst:1510 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1555 +#: ../../howto/clinic.rst:1512 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -2079,11 +2023,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1563 +#: ../../howto/clinic.rst:1520 msgid "How to change and redirect Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1565 +#: ../../howto/clinic.rst:1522 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -2092,7 +2036,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1571 +#: ../../howto/clinic.rst:1528 msgid "" "While changing Clinic's output in this manner can be a boon to readability, " "it may result in Clinic code using types before they are defined, or your " @@ -2104,15 +2048,15 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1580 +#: ../../howto/clinic.rst:1537 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1607 +#: ../../howto/clinic.rst:1564 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1583 +#: ../../howto/clinic.rst:1540 msgid "" "A field, in this context, is a subsection of Clinic's output. For example, " "the ``#define`` for the :c:type:`PyMethodDef` structure is a field, called " @@ -2120,7 +2064,7 @@ msgid "" "function definition:" msgstr "" -#: ../../howto/clinic.rst:1598 +#: ../../howto/clinic.rst:1555 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2133,45 +2077,45 @@ msgid "" "``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1641 +#: ../../howto/clinic.rst:1598 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1610 +#: ../../howto/clinic.rst:1567 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1615 ../../howto/clinic.rst:1690 -#: ../../howto/clinic.rst:1768 +#: ../../howto/clinic.rst:1572 ../../howto/clinic.rst:1647 +#: ../../howto/clinic.rst:1725 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1614 +#: ../../howto/clinic.rst:1571 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1621 ../../howto/clinic.rst:1717 -#: ../../howto/clinic.rst:1771 +#: ../../howto/clinic.rst:1578 ../../howto/clinic.rst:1674 +#: ../../howto/clinic.rst:1728 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1618 +#: ../../howto/clinic.rst:1575 msgid "" "A text buffer where you can save text for later. Text sent here is appended " "to the end of any existing text. It's an error to have any text left in the " "buffer when Clinic finishes processing a file." msgstr "" -#: ../../howto/clinic.rst:1632 ../../howto/clinic.rst:1703 -#: ../../howto/clinic.rst:1797 +#: ../../howto/clinic.rst:1589 ../../howto/clinic.rst:1660 +#: ../../howto/clinic.rst:1754 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1624 +#: ../../howto/clinic.rst:1581 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " @@ -2180,65 +2124,65 @@ msgid "" "for :file:`_pickle.c` would be written to :file:`_pickle.clinic.c`.)" msgstr "" -#: ../../howto/clinic.rst:1631 +#: ../../howto/clinic.rst:1588 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1637 ../../howto/clinic.rst:1730 -#: ../../howto/clinic.rst:1801 +#: ../../howto/clinic.rst:1594 ../../howto/clinic.rst:1687 +#: ../../howto/clinic.rst:1758 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1635 +#: ../../howto/clinic.rst:1592 msgid "" "A buffer like ``buffer``. However, a two-pass buffer can only be dumped " "once, and it prints out all text sent to it during all processing, even from " "Clinic blocks *after* the dumping point." msgstr "" -#: ../../howto/clinic.rst:1641 ../../howto/clinic.rst:1764 +#: ../../howto/clinic.rst:1598 ../../howto/clinic.rst:1721 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1640 +#: ../../howto/clinic.rst:1597 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1643 +#: ../../howto/clinic.rst:1600 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1645 +#: ../../howto/clinic.rst:1602 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1651 +#: ../../howto/clinic.rst:1608 msgid "" "This dumps the current contents of the named destination into the output of " "the current block, and empties it. This only works with ``buffer`` and " "``two-pass`` destinations." msgstr "" -#: ../../howto/clinic.rst:1655 +#: ../../howto/clinic.rst:1612 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1662 +#: ../../howto/clinic.rst:1619 msgid "" "This tells Clinic to output *field* to *destination*. ``output`` also " "supports a special meta-destination, called ``everything``, which tells " "Clinic to output *all* fields to that *destination*." msgstr "" -#: ../../howto/clinic.rst:1666 +#: ../../howto/clinic.rst:1623 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1675 +#: ../../howto/clinic.rst:1632 msgid "" "``output push`` and ``output pop`` allow you to push and pop configurations " "on an internal configuration stack, so that you can temporarily modify the " @@ -2247,25 +2191,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1682 +#: ../../howto/clinic.rst:1639 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1686 +#: ../../howto/clinic.rst:1643 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1689 +#: ../../howto/clinic.rst:1646 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1693 +#: ../../howto/clinic.rst:1650 msgid "" "Designed to write everything to the \"clinic file\" that it can. You then " "``#include`` this file near the top of your file. You may need to rearrange " @@ -2273,17 +2217,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1699 +#: ../../howto/clinic.rst:1656 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1703 +#: ../../howto/clinic.rst:1660 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1706 +#: ../../howto/clinic.rst:1663 msgid "" "Save up most of the output from Clinic, to be written into your file near " "the end. For Python files implementing modules or builtin types, it's " @@ -2293,14 +2237,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1715 +#: ../../howto/clinic.rst:1672 msgid "" "Suppress the ``parser_prototype``, ``impl_prototype``, and " "``docstring_prototype``, write the ``impl_definition`` to ``block``, and " "write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1720 +#: ../../howto/clinic.rst:1677 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2309,18 +2253,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1727 +#: ../../howto/clinic.rst:1684 msgid "" "Suppresses the ``impl_prototype``, write the ``impl_definition`` to " "``block``, write ``docstring_prototype``, ``methoddef_define``, and " "``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." msgstr "" -#: ../../howto/clinic.rst:1741 +#: ../../howto/clinic.rst:1698 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1733 +#: ../../howto/clinic.rst:1690 msgid "" "Similar to the ``buffer`` preset, but writes more things to ``block``, only " "writing the really big chunks of generated code to ``buffer``. This avoids " @@ -2330,137 +2274,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1740 +#: ../../howto/clinic.rst:1697 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1743 +#: ../../howto/clinic.rst:1700 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1749 +#: ../../howto/clinic.rst:1706 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1751 +#: ../../howto/clinic.rst:1708 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1753 +#: ../../howto/clinic.rst:1710 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1759 +#: ../../howto/clinic.rst:1716 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1761 +#: ../../howto/clinic.rst:1718 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1764 +#: ../../howto/clinic.rst:1721 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1767 +#: ../../howto/clinic.rst:1724 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1771 +#: ../../howto/clinic.rst:1728 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1774 +#: ../../howto/clinic.rst:1731 msgid "" "A text file. The file destination takes an extra argument, a template to " "use for building the filename, like so:" msgstr "" -#: ../../howto/clinic.rst:1777 +#: ../../howto/clinic.rst:1734 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1779 +#: ../../howto/clinic.rst:1736 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1782 +#: ../../howto/clinic.rst:1739 msgid "{path}" msgstr "{path}" -#: ../../howto/clinic.rst:1783 +#: ../../howto/clinic.rst:1740 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1784 +#: ../../howto/clinic.rst:1741 msgid "{dirname}" msgstr "{dirname}" -#: ../../howto/clinic.rst:1785 +#: ../../howto/clinic.rst:1742 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1786 +#: ../../howto/clinic.rst:1743 msgid "{basename}" msgstr "{basename}" -#: ../../howto/clinic.rst:1787 +#: ../../howto/clinic.rst:1744 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1789 +#: ../../howto/clinic.rst:1746 msgid "{basename_root}" msgstr "{basename_root}" -#: ../../howto/clinic.rst:1789 +#: ../../howto/clinic.rst:1746 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1793 +#: ../../howto/clinic.rst:1750 msgid "{basename_extension}" msgstr "{basename_extension}" -#: ../../howto/clinic.rst:1792 +#: ../../howto/clinic.rst:1749 msgid "" "The last '.' and everything after it. If the basename does not contain a " "period, this will be the empty string." msgstr "" -#: ../../howto/clinic.rst:1795 +#: ../../howto/clinic.rst:1752 msgid "" "If there are no periods in the filename, {basename} and {filename} are the " "same, and {extension} is empty. \"{basename}{extension}\" is always exactly " "the same as \"{filename}\".\"" msgstr "" -#: ../../howto/clinic.rst:1800 +#: ../../howto/clinic.rst:1757 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1803 +#: ../../howto/clinic.rst:1760 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1809 +#: ../../howto/clinic.rst:1766 msgid "" "It removes all the accumulated text up to this point in the destination. (I " "don't know what you'd need this for, but I thought maybe it'd be useful " "while someone's experimenting.)" msgstr "" -#: ../../howto/clinic.rst:1813 +#: ../../howto/clinic.rst:1770 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1820 +#: ../../howto/clinic.rst:1777 msgid "" "``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " "string that will be prepended to every line of Clinic's output; " @@ -2468,35 +2412,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1824 +#: ../../howto/clinic.rst:1781 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1827 +#: ../../howto/clinic.rst:1784 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1827 +#: ../../howto/clinic.rst:1784 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1830 +#: ../../howto/clinic.rst:1787 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1830 +#: ../../howto/clinic.rst:1787 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1832 +#: ../../howto/clinic.rst:1789 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1839 +#: ../../howto/clinic.rst:1796 msgid "" "This tells Clinic that the current contents of the output should be kept, " "unmodified. This is used internally by Clinic when dumping output into " @@ -2505,36 +2449,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1846 +#: ../../howto/clinic.rst:1803 msgid "How to use the ``#ifdef`` trick" msgstr "" -#: ../../howto/clinic.rst:1848 +#: ../../howto/clinic.rst:1805 msgid "" "If you're converting a function that isn't available on all platforms, " "there's a trick you can use to make life a little easier. The existing code " "probably looks like this::" msgstr "" -#: ../../howto/clinic.rst:1859 +#: ../../howto/clinic.rst:1816 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1868 +#: ../../howto/clinic.rst:1825 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1882 +#: ../../howto/clinic.rst:1839 msgid "" "Then, remove those three lines from the :c:type:`PyMethodDef` structure, " "replacing them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1889 +#: ../../howto/clinic.rst:1846 msgid "" "(You can find the real name for this macro inside the generated code. Or you " "can calculate it yourself: it's the name of your function as defined on the " @@ -2542,27 +2486,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1894 +#: ../../howto/clinic.rst:1851 msgid "" "Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " "``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" msgstr "" -#: ../../howto/clinic.rst:1897 +#: ../../howto/clinic.rst:1854 msgid "" "Here's where Argument Clinic gets very clever. It actually detects that the " "Argument Clinic block might be deactivated by the ``#ifdef``. When that " "happens, it generates a little extra code that looks like this::" msgstr "" -#: ../../howto/clinic.rst:1905 +#: ../../howto/clinic.rst:1862 msgid "" "That means the macro always works. If the function is defined, this turns " "into the correct structure, including the trailing comma. If the function " "is undefined, this turns into nothing." msgstr "" -#: ../../howto/clinic.rst:1909 +#: ../../howto/clinic.rst:1866 msgid "" "However, this causes one ticklish problem: where should Argument Clinic put " "this extra code when using the \"block\" output preset? It can't go in the " @@ -2570,24 +2514,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1913 +#: ../../howto/clinic.rst:1870 msgid "" "In this situation, Argument Clinic writes the extra code to the \"buffer\" " "destination. This may mean that you get a complaint from Argument Clinic:" msgstr "" -#: ../../howto/clinic.rst:1921 +#: ../../howto/clinic.rst:1878 msgid "" "When this happens, just open your file, find the ``dump buffer`` block that " "Argument Clinic added to your file (it'll be at the very bottom), then move " "it above the :c:type:`PyMethodDef` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1927 +#: ../../howto/clinic.rst:1884 msgid "How to use Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1929 +#: ../../howto/clinic.rst:1886 msgid "" "It's actually possible to use Argument Clinic to preprocess Python files. " "There's no point to using Argument Clinic blocks, of course, as the output " @@ -2595,7 +2539,7 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1934 +#: ../../howto/clinic.rst:1891 msgid "" "Since Python comments are different from C comments, Argument Clinic blocks " "embedded in Python files look slightly different. They look like this:" diff --git a/howto/curses.po b/howto/curses.po index 35aa97a92e..76ed9f39c4 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -352,7 +352,7 @@ msgstr "描述" #: ../../howto/curses.rst:281 msgid "*str* or *ch*" -msgstr "" +msgstr "*str* 或 *ch*" #: ../../howto/curses.rst:281 msgid "Display the string *str* or character *ch* at the current position" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index d422a77854..f6f7481fe9 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-27 00:03+0000\n" +"POT-Creation-Date: 2023-08-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../../howto/isolating-extensions.rst:5 +#: ../../howto/isolating-extensions.rst:7 msgid "Isolating Extension Modules" msgstr "" @@ -25,14 +25,14 @@ msgstr "" msgid "Abstract" msgstr "" -#: ../../howto/isolating-extensions.rst:9 +#: ../../howto/isolating-extensions.rst:11 msgid "" "Traditionally, state belonging to Python extension modules was kept in C " "``static`` variables, which have process-wide scope. This document describes " "problems of such per-process state and shows a safer way: per-module state." msgstr "" -#: ../../howto/isolating-extensions.rst:14 +#: ../../howto/isolating-extensions.rst:16 msgid "" "The document also describes how to switch to per-module state where " "possible. This transition involves allocating space for that state, " @@ -40,47 +40,47 @@ msgid "" "importantly—accessing per-module state from code." msgstr "" -#: ../../howto/isolating-extensions.rst:21 +#: ../../howto/isolating-extensions.rst:23 msgid "Who should read this" msgstr "" -#: ../../howto/isolating-extensions.rst:23 +#: ../../howto/isolating-extensions.rst:25 msgid "" "This guide is written for maintainers of :ref:`C-API ` " "extensions who would like to make that extension safer to use in " "applications where Python itself is used as a library." msgstr "" -#: ../../howto/isolating-extensions.rst:29 +#: ../../howto/isolating-extensions.rst:31 msgid "Background" msgstr "" -#: ../../howto/isolating-extensions.rst:31 +#: ../../howto/isolating-extensions.rst:33 msgid "" "An *interpreter* is the context in which Python code runs. It contains " "configuration (e.g. the import path) and runtime state (e.g. the set of " "imported modules)." msgstr "" -#: ../../howto/isolating-extensions.rst:35 +#: ../../howto/isolating-extensions.rst:37 msgid "" "Python supports running multiple interpreters in one process. There are two " "cases to think about—users may run interpreters:" msgstr "" -#: ../../howto/isolating-extensions.rst:38 +#: ../../howto/isolating-extensions.rst:40 msgid "" "in sequence, with several :c:func:`Py_InitializeEx`/:c:func:`Py_FinalizeEx` " "cycles, and" msgstr "" -#: ../../howto/isolating-extensions.rst:40 +#: ../../howto/isolating-extensions.rst:42 msgid "" "in parallel, managing \"sub-interpreters\" using :c:func:" "`Py_NewInterpreter`/:c:func:`Py_EndInterpreter`." msgstr "" -#: ../../howto/isolating-extensions.rst:43 +#: ../../howto/isolating-extensions.rst:45 msgid "" "Both cases (and combinations of them) would be most useful when embedding " "Python within a library. Libraries generally shouldn't make assumptions " @@ -88,7 +88,7 @@ msgid "" "\"main Python interpreter\"." msgstr "" -#: ../../howto/isolating-extensions.rst:48 +#: ../../howto/isolating-extensions.rst:50 msgid "" "Historically, Python extension modules don't handle this use case well. Many " "extension modules (and even some stdlib modules) use *per-process* global " @@ -99,18 +99,18 @@ msgid "" "than one interpreter in the same process." msgstr "" -#: ../../howto/isolating-extensions.rst:56 +#: ../../howto/isolating-extensions.rst:58 msgid "" "Unfortunately, *per-interpreter* state is not easy to achieve. Extension " "authors tend to not keep multiple interpreters in mind when developing, and " "it is currently cumbersome to test the behavior." msgstr "" -#: ../../howto/isolating-extensions.rst:61 +#: ../../howto/isolating-extensions.rst:63 msgid "Enter Per-Module State" msgstr "" -#: ../../howto/isolating-extensions.rst:63 +#: ../../howto/isolating-extensions.rst:65 msgid "" "Instead of focusing on per-interpreter state, Python's C API is evolving to " "better support the more granular *per-module* state. This means that C-level " @@ -120,7 +120,7 @@ msgid "" "loaded in a single interpreter." msgstr "" -#: ../../howto/isolating-extensions.rst:70 +#: ../../howto/isolating-extensions.rst:72 msgid "" "Per-module state provides an easy way to think about lifetime and resource " "ownership: the extension module will initialize when a module object is " @@ -129,7 +129,7 @@ msgid "" "hooks to think—or forget—about." msgstr "" -#: ../../howto/isolating-extensions.rst:76 +#: ../../howto/isolating-extensions.rst:78 msgid "" "Note that there are use cases for different kinds of \"globals\": per-" "process, per-interpreter, per-thread or per-task state. With per-module " @@ -138,18 +138,18 @@ msgid "" "and testing. (Note that this guide does not cover them.)" msgstr "" -#: ../../howto/isolating-extensions.rst:85 +#: ../../howto/isolating-extensions.rst:87 msgid "Isolated Module Objects" msgstr "" -#: ../../howto/isolating-extensions.rst:87 +#: ../../howto/isolating-extensions.rst:89 msgid "" "The key point to keep in mind when developing an extension module is that " "several module objects can be created from a single shared library. For " "example:" msgstr "" -#: ../../howto/isolating-extensions.rst:101 +#: ../../howto/isolating-extensions.rst:103 msgid "" "As a rule of thumb, the two modules should be completely independent. All " "objects and state specific to the module should be encapsulated within the " @@ -159,18 +159,18 @@ msgid "" "and attention to edge cases." msgstr "" -#: ../../howto/isolating-extensions.rst:109 +#: ../../howto/isolating-extensions.rst:111 msgid "" "While some modules could do with less stringent restrictions, isolated " "modules make it easier to set clear expectations and guidelines that work " "across a variety of use cases." msgstr "" -#: ../../howto/isolating-extensions.rst:115 +#: ../../howto/isolating-extensions.rst:117 msgid "Surprising Edge Cases" msgstr "" -#: ../../howto/isolating-extensions.rst:117 +#: ../../howto/isolating-extensions.rst:119 msgid "" "Note that isolated modules do create some surprising edge cases. Most " "notably, each module object will typically not share its classes and " @@ -180,43 +180,43 @@ msgid "" "exception is *not* caught:" msgstr "" -#: ../../howto/isolating-extensions.rst:137 +#: ../../howto/isolating-extensions.rst:139 msgid "" "This is expected. Notice that pure-Python modules behave the same way: it is " "a part of how Python works." msgstr "" -#: ../../howto/isolating-extensions.rst:140 +#: ../../howto/isolating-extensions.rst:142 msgid "" "The goal is to make extension modules safe at the C level, not to make hacks " "behave intuitively. Mutating ``sys.modules`` \"manually\" counts as a hack." msgstr "" -#: ../../howto/isolating-extensions.rst:146 +#: ../../howto/isolating-extensions.rst:148 msgid "Making Modules Safe with Multiple Interpreters" msgstr "" -#: ../../howto/isolating-extensions.rst:150 +#: ../../howto/isolating-extensions.rst:152 msgid "Managing Global State" msgstr "" -#: ../../howto/isolating-extensions.rst:152 +#: ../../howto/isolating-extensions.rst:154 msgid "" "Sometimes, the state associated with a Python module is not specific to that " "module, but to the entire process (or something else \"more global\" than a " "module). For example:" msgstr "" -#: ../../howto/isolating-extensions.rst:156 +#: ../../howto/isolating-extensions.rst:158 msgid "The ``readline`` module manages *the* terminal." msgstr "" -#: ../../howto/isolating-extensions.rst:157 +#: ../../howto/isolating-extensions.rst:159 msgid "" "A module running on a circuit board wants to control *the* on-board LED." msgstr "" -#: ../../howto/isolating-extensions.rst:160 +#: ../../howto/isolating-extensions.rst:162 msgid "" "In these cases, the Python module should provide *access* to the global " "state, rather than *own* it. If possible, write the module so that multiple " @@ -225,7 +225,7 @@ msgid "" "explicit locking." msgstr "" -#: ../../howto/isolating-extensions.rst:166 +#: ../../howto/isolating-extensions.rst:168 msgid "" "If it is necessary to use process-global state, the simplest way to avoid " "issues with multiple interpreters is to explicitly prevent a module from " @@ -233,18 +233,18 @@ msgid "" "Object per Process`_." msgstr "" -#: ../../howto/isolating-extensions.rst:173 +#: ../../howto/isolating-extensions.rst:175 msgid "Managing Per-Module State" msgstr "" -#: ../../howto/isolating-extensions.rst:175 +#: ../../howto/isolating-extensions.rst:177 msgid "" "To use per-module state, use :ref:`multi-phase extension module " "initialization `. This signals that your module " "supports multiple interpreters correctly." msgstr "" -#: ../../howto/isolating-extensions.rst:179 +#: ../../howto/isolating-extensions.rst:181 msgid "" "Set ``PyModuleDef.m_size`` to a positive number to request that many bytes " "of storage local to the module. Usually, this will be set to the size of " @@ -255,7 +255,7 @@ msgid "" "function." msgstr "" -#: ../../howto/isolating-extensions.rst:188 +#: ../../howto/isolating-extensions.rst:190 msgid "" "Another option is to store state in the module's ``__dict__``, but you must " "avoid crashing when users modify ``__dict__`` from Python code. This usually " @@ -263,13 +263,13 @@ msgid "" "and hard to test sufficiently." msgstr "" -#: ../../howto/isolating-extensions.rst:193 +#: ../../howto/isolating-extensions.rst:195 msgid "" "However, if module state is not needed in C code, storing it in ``__dict__`` " "only is a good idea." msgstr "" -#: ../../howto/isolating-extensions.rst:196 +#: ../../howto/isolating-extensions.rst:198 msgid "" "If the module state includes ``PyObject`` pointers, the module object must " "hold references to those objects and implement the module-level hooks " @@ -279,18 +279,18 @@ msgid "" "unloaded cleanly." msgstr "" -#: ../../howto/isolating-extensions.rst:203 +#: ../../howto/isolating-extensions.rst:205 msgid "" "An example of a module with per-module state is currently available as " "`xxlimited `__; example module initialization shown at the bottom of the file." msgstr "" -#: ../../howto/isolating-extensions.rst:209 +#: ../../howto/isolating-extensions.rst:211 msgid "Opt-Out: Limiting to One Module Object per Process" msgstr "" -#: ../../howto/isolating-extensions.rst:211 +#: ../../howto/isolating-extensions.rst:213 msgid "" "A non-negative ``PyModuleDef.m_size`` signals that a module supports " "multiple interpreters correctly. If this is not yet the case for your " @@ -298,36 +298,36 @@ msgid "" "For example::" msgstr "" -#: ../../howto/isolating-extensions.rst:232 +#: ../../howto/isolating-extensions.rst:234 msgid "Module State Access from Functions" msgstr "" -#: ../../howto/isolating-extensions.rst:234 +#: ../../howto/isolating-extensions.rst:236 msgid "" "Accessing the state from module-level functions is straightforward. " "Functions get the module object as their first argument; for extracting the " "state, you can use ``PyModule_GetState``::" msgstr "" -#: ../../howto/isolating-extensions.rst:249 +#: ../../howto/isolating-extensions.rst:251 msgid "" "``PyModule_GetState`` may return ``NULL`` without setting an exception if " "there is no module state, i.e. ``PyModuleDef.m_size`` was zero. In your own " "module, you're in control of ``m_size``, so this is easy to prevent." msgstr "" -#: ../../howto/isolating-extensions.rst:256 +#: ../../howto/isolating-extensions.rst:258 msgid "Heap Types" msgstr "" -#: ../../howto/isolating-extensions.rst:258 +#: ../../howto/isolating-extensions.rst:260 msgid "" "Traditionally, types defined in C code are *static*; that is, ``static " "PyTypeObject`` structures defined directly in code and initialized using " "``PyType_Ready()``." msgstr "" -#: ../../howto/isolating-extensions.rst:262 +#: ../../howto/isolating-extensions.rst:264 msgid "" "Such types are necessarily shared across the process. Sharing them between " "module objects requires paying attention to any state they own or access. To " @@ -335,7 +335,7 @@ msgid "" "for example, you can't set ``str.myattribute = 123``." msgstr "" -#: ../../howto/isolating-extensions.rst:268 +#: ../../howto/isolating-extensions.rst:270 msgid "" "Sharing truly immutable objects between interpreters is fine, as long as " "they don't provide access to mutable objects. However, in CPython, every " @@ -345,7 +345,7 @@ msgid "" "process-wide GIL." msgstr "" -#: ../../howto/isolating-extensions.rst:275 +#: ../../howto/isolating-extensions.rst:277 msgid "" "Because they are immutable and process-global, static types cannot access " "\"their\" module state. If any method of such a type requires access to " @@ -354,15 +354,15 @@ msgid "" "Python's ``class`` statement." msgstr "" -#: ../../howto/isolating-extensions.rst:282 +#: ../../howto/isolating-extensions.rst:284 msgid "For new modules, using heap types by default is a good rule of thumb." msgstr "" -#: ../../howto/isolating-extensions.rst:286 +#: ../../howto/isolating-extensions.rst:288 msgid "Changing Static Types to Heap Types" msgstr "" -#: ../../howto/isolating-extensions.rst:288 +#: ../../howto/isolating-extensions.rst:290 msgid "" "Static types can be converted to heap types, but note that the heap type API " "was not designed for \"lossless\" conversion from static types—that is, " @@ -372,126 +372,126 @@ msgid "" "slots). Always test the details that are important to you." msgstr "" -#: ../../howto/isolating-extensions.rst:297 +#: ../../howto/isolating-extensions.rst:299 msgid "" "Watch out for the following two points in particular (but note that this is " "not a comprehensive list):" msgstr "" -#: ../../howto/isolating-extensions.rst:300 +#: ../../howto/isolating-extensions.rst:302 msgid "" "Unlike static types, heap type objects are mutable by default. Use the :c:" "macro:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." msgstr "" -#: ../../howto/isolating-extensions.rst:302 +#: ../../howto/isolating-extensions.rst:304 msgid "" "Heap types inherit :c:member:`~PyTypeObject.tp_new` by default, so it may " "become possible to instantiate them from Python code. You can prevent this " "with the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." msgstr "" -#: ../../howto/isolating-extensions.rst:308 +#: ../../howto/isolating-extensions.rst:310 msgid "Defining Heap Types" msgstr "" -#: ../../howto/isolating-extensions.rst:310 +#: ../../howto/isolating-extensions.rst:312 msgid "" "Heap types can be created by filling a :c:struct:`PyType_Spec` structure, a " "description or \"blueprint\" of a class, and calling :c:func:" "`PyType_FromModuleAndSpec` to construct a new class object." msgstr "" -#: ../../howto/isolating-extensions.rst:315 +#: ../../howto/isolating-extensions.rst:317 msgid "" "Other functions, like :c:func:`PyType_FromSpec`, can also create heap types, " "but :c:func:`PyType_FromModuleAndSpec` associates the module with the class, " "allowing access to the module state from methods." msgstr "" -#: ../../howto/isolating-extensions.rst:319 +#: ../../howto/isolating-extensions.rst:321 msgid "" "The class should generally be stored in *both* the module state (for safe " "access from C) and the module's ``__dict__`` (for access from Python code)." msgstr "" -#: ../../howto/isolating-extensions.rst:325 +#: ../../howto/isolating-extensions.rst:327 msgid "Garbage-Collection Protocol" msgstr "" -#: ../../howto/isolating-extensions.rst:327 +#: ../../howto/isolating-extensions.rst:329 msgid "" "Instances of heap types hold a reference to their type. This ensures that " "the type isn't destroyed before all its instances are, but may result in " "reference cycles that need to be broken by the garbage collector." msgstr "" -#: ../../howto/isolating-extensions.rst:332 +#: ../../howto/isolating-extensions.rst:334 msgid "" "To avoid memory leaks, instances of heap types must implement the garbage " "collection protocol. That is, heap types should:" msgstr "" -#: ../../howto/isolating-extensions.rst:336 +#: ../../howto/isolating-extensions.rst:338 msgid "Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." msgstr "" -#: ../../howto/isolating-extensions.rst:337 +#: ../../howto/isolating-extensions.rst:339 msgid "" "Define a traverse function using ``Py_tp_traverse``, which visits the type " "(e.g. using :c:expr:`Py_VISIT(Py_TYPE(self))`)." msgstr "" -#: ../../howto/isolating-extensions.rst:340 +#: ../../howto/isolating-extensions.rst:342 msgid "" "Please refer to the :ref:`the documentation ` of :c:macro:" "`Py_TPFLAGS_HAVE_GC` and :c:member:`~PyTypeObject.tp_traverse` for " "additional considerations." msgstr "" -#: ../../howto/isolating-extensions.rst:344 +#: ../../howto/isolating-extensions.rst:346 msgid "" "If your traverse function delegates to the ``tp_traverse`` of its base class " "(or another type), ensure that ``Py_TYPE(self)`` is visited only once. Note " "that only heap type are expected to visit the type in ``tp_traverse``." msgstr "" -#: ../../howto/isolating-extensions.rst:348 +#: ../../howto/isolating-extensions.rst:350 msgid "For example, if your traverse function includes::" msgstr "" -#: ../../howto/isolating-extensions.rst:352 +#: ../../howto/isolating-extensions.rst:354 msgid "...and ``base`` may be a static type, then it should also include::" msgstr "" -#: ../../howto/isolating-extensions.rst:360 +#: ../../howto/isolating-extensions.rst:362 msgid "" "It is not necessary to handle the type's reference count in ``tp_new`` and " "``tp_clear``." msgstr "" -#: ../../howto/isolating-extensions.rst:365 +#: ../../howto/isolating-extensions.rst:367 msgid "Module State Access from Classes" msgstr "" -#: ../../howto/isolating-extensions.rst:367 +#: ../../howto/isolating-extensions.rst:369 msgid "" "If you have a type object defined with :c:func:`PyType_FromModuleAndSpec`, " "you can call :c:func:`PyType_GetModule` to get the associated module, and " "then :c:func:`PyModule_GetState` to get the module's state." msgstr "" -#: ../../howto/isolating-extensions.rst:371 +#: ../../howto/isolating-extensions.rst:373 msgid "" "To save a some tedious error-handling boilerplate code, you can combine " "these two steps with :c:func:`PyType_GetModuleState`, resulting in::" msgstr "" -#: ../../howto/isolating-extensions.rst:381 +#: ../../howto/isolating-extensions.rst:383 msgid "Module State Access from Regular Methods" msgstr "" -#: ../../howto/isolating-extensions.rst:383 +#: ../../howto/isolating-extensions.rst:385 msgid "" "Accessing the module-level state from methods of a class is somewhat more " "complicated, but is possible thanks to API introduced in Python 3.9. To get " @@ -499,27 +499,27 @@ msgid "" "module state from it." msgstr "" -#: ../../howto/isolating-extensions.rst:388 +#: ../../howto/isolating-extensions.rst:390 msgid "" "The largest roadblock is getting *the class a method was defined in*, or " "that method's \"defining class\" for short. The defining class can have a " "reference to the module it is part of." msgstr "" -#: ../../howto/isolating-extensions.rst:392 +#: ../../howto/isolating-extensions.rst:394 msgid "" "Do not confuse the defining class with :c:expr:`Py_TYPE(self)`. If the " "method is called on a *subclass* of your type, ``Py_TYPE(self)`` will refer " "to that subclass, which may be defined in different module than yours." msgstr "" -#: ../../howto/isolating-extensions.rst:397 +#: ../../howto/isolating-extensions.rst:399 msgid "" "The following Python code can illustrate the concept. ``Base." "get_defining_class`` returns ``Base`` even if ``type(self) == Sub``:" msgstr "" -#: ../../howto/isolating-extensions.rst:413 +#: ../../howto/isolating-extensions.rst:415 msgid "" "For a method to get its \"defining class\", it must use the :ref:" "`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `__." msgstr "" -#: ../../howto/isolating-extensions.rst:524 +#: ../../howto/isolating-extensions.rst:526 msgid "Per-Class Scope" msgstr "" -#: ../../howto/isolating-extensions.rst:526 +#: ../../howto/isolating-extensions.rst:528 msgid "" "It is currently (as of Python 3.11) not possible to attach state to " "individual *types* without relying on CPython implementation details (which " @@ -624,11 +624,11 @@ msgid "" "per-class scope)." msgstr "" -#: ../../howto/isolating-extensions.rst:533 +#: ../../howto/isolating-extensions.rst:535 msgid "Lossless Conversion to Heap Types" msgstr "" -#: ../../howto/isolating-extensions.rst:535 +#: ../../howto/isolating-extensions.rst:537 msgid "" "The heap type API was not designed for \"lossless\" conversion from static " "types; that is, creating a type that works exactly like a given static type." diff --git a/installing/index.po b/installing/index.po index 8ac251689f..8d490a1b4c 100644 --- a/installing/index.po +++ b/installing/index.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-08-18 00:03+0000\n" "PO-Revision-Date: 2022-06-27 09:37+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -57,13 +57,13 @@ msgstr "" #: ../../installing/index.rst:20 msgid "" "This guide covers the installation part of the process. For a guide to " -"creating and sharing your own Python projects, refer to the :ref:" -"`distribution guide `." +"creating and sharing your own Python projects, refer to the `Python " +"packaging user guide`_." msgstr "" "這份指南涵蓋了上述過程中的安裝部分。如果是要建立及分享您自己的 Python 專案," -"請參考\\ :ref:`發布 Python 模組 `\\ 指南。" +"請參考 `Python packaging user guide`_。" -#: ../../installing/index.rst:26 +#: ../../installing/index.rst:28 msgid "" "For corporate and other institutional users, be aware that many " "organisations have their own policies around using and contributing to open " @@ -73,11 +73,11 @@ msgstr "" "對於企業和其他機構的使用者,要注意到,許多組織對於使用和貢獻開源軟體都有自己" "的政策。在開始使用配備 Python 的發布及安裝工具時,請將那些政策納入考量。" -#: ../../installing/index.rst:33 +#: ../../installing/index.rst:35 msgid "Key terms" msgstr "關鍵術語" -#: ../../installing/index.rst:35 +#: ../../installing/index.rst:37 msgid "" "``pip`` is the preferred installer program. Starting with Python 3.4, it is " "included by default with the Python binary installers." @@ -85,7 +85,7 @@ msgstr "" "``pip`` 是首選的安裝程式。從 Python 3.4 開始,它被預設包含在 Python 二進制安" "裝程式中。" -#: ../../installing/index.rst:37 +#: ../../installing/index.rst:39 msgid "" "A *virtual environment* is a semi-isolated Python environment that allows " "packages to be installed for use by a particular application, rather than " @@ -94,7 +94,7 @@ msgstr "" "*virtual environment(虛擬環境)*\\ 是一種半隔離的 Python 環境,可以為某個特" "定應用程式安裝其所需的套件,而不用在整個系統上安裝它們。" -#: ../../installing/index.rst:40 +#: ../../installing/index.rst:42 msgid "" "``venv`` is the standard tool for creating virtual environments, and has " "been part of Python since Python 3.3. Starting with Python 3.4, it defaults " @@ -103,7 +103,7 @@ msgstr "" "``venv`` 是建立虛擬環境的標準工具,它從 Python 3.3 開始成為 Python 的一部分。" "從 Python 3.4 開始,它會預設地安裝 ``pip`` 到所有被建立的虛擬環境。" -#: ../../installing/index.rst:43 +#: ../../installing/index.rst:45 msgid "" "``virtualenv`` is a third party alternative (and predecessor) to ``venv``. " "It allows virtual environments to be used on versions of Python prior to " @@ -114,7 +114,7 @@ msgstr "" "在 Python 3.4 之前的版本被使用,那些版本要不是根本沒提供 ``venv``,就是無法自" "動安裝 ``pip`` 到所建立的環境中。" -#: ../../installing/index.rst:47 +#: ../../installing/index.rst:49 msgid "" "The `Python Package Index `__ is a public repository of " "open source licensed packages made available for use by other Python users." @@ -122,7 +122,7 @@ msgstr "" "`Python 套件索引 (Python Package Index) `__ 是開源授權套件" "的一個公共儲存庫,其中的套件皆可被其他 Python 使用者所使用。" -#: ../../installing/index.rst:50 +#: ../../installing/index.rst:52 msgid "" "the `Python Packaging Authority `__ is the group of " "developers and documentation authors responsible for the maintenance and " @@ -135,7 +135,7 @@ msgstr "" "元資料 (metadata) 和檔案格式標準。他們在 `GitHub `__ 平台上維護各種工具、說明文件及問題追蹤系統。" -#: ../../installing/index.rst:56 +#: ../../installing/index.rst:58 msgid "" "``distutils`` is the original build and distribution system first added to " "the Python standard library in 1998. While direct use of ``distutils`` is " @@ -149,12 +149,12 @@ msgstr "" "基礎結構根基,而且它不僅仍然是標準函式庫的一部分,它的名稱也以其他的方式存活" "著(例如:用於協調 Python 封裝標準開發的郵寄清單就是以它命名)。" -#: ../../installing/index.rst:64 +#: ../../installing/index.rst:66 msgid "" "The use of ``venv`` is now recommended for creating virtual environments." msgstr "對於建立虛擬環境,現在推薦使用 ``venv``。" -#: ../../installing/index.rst:69 +#: ../../installing/index.rst:71 msgid "" "`Python Packaging User Guide: Creating and using virtual environments " "`__" @@ -162,17 +162,17 @@ msgstr "" "`Python 封裝使用者指南:建立和使用虛擬環境 `__" -#: ../../installing/index.rst:74 +#: ../../installing/index.rst:76 msgid "Basic usage" msgstr "基本用法" -#: ../../installing/index.rst:76 +#: ../../installing/index.rst:78 msgid "" "The standard packaging tools are all designed to be used from the command " "line." msgstr "標準封裝工具皆是以能從命令列使用的方式被設計的。" -#: ../../installing/index.rst:79 +#: ../../installing/index.rst:81 msgid "" "The following command will install the latest version of a module and its " "dependencies from the Python Package Index::" @@ -182,7 +182,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:86 +#: ../../installing/index.rst:88 msgid "" "For POSIX users (including macOS and Linux users), the examples in this " "guide assume the use of a :term:`virtual environment`." @@ -190,7 +190,7 @@ msgstr "" "對於 POSIX 使用者(包括 macOS 和 Linux 使用者),本指南中的範例皆假設有使用 :" "term:`virtual environment`\\ 。" -#: ../../installing/index.rst:89 +#: ../../installing/index.rst:91 msgid "" "For Windows users, the examples in this guide assume that the option to " "adjust the system PATH environment variable was selected when installing " @@ -199,7 +199,7 @@ msgstr "" "對於 Windows 使用者,本指南中的範例皆假設在安裝 Python 時,「可調整系統 PATH " "環境變數」的選項已被選取。" -#: ../../installing/index.rst:93 +#: ../../installing/index.rst:95 msgid "" "It's also possible to specify an exact or minimum version directly on the " "command line. When using comparator operators such as ``>``, ``<`` or some " @@ -212,7 +212,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:101 +#: ../../installing/index.rst:103 msgid "" "Normally, if a suitable module is already installed, attempting to install " "it again will have no effect. Upgrading existing modules must be requested " @@ -223,7 +223,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:107 +#: ../../installing/index.rst:109 msgid "" "More information and resources regarding ``pip`` and its capabilities can be " "found in the `Python Packaging User Guide `__." @@ -231,7 +231,7 @@ msgstr "" "關於 ``pip`` 及其能力的更多資訊和資源,可以在 `Python 封裝使用者指南 " "`__\\ 中找到。" -#: ../../installing/index.rst:110 +#: ../../installing/index.rst:112 msgid "" "Creation of virtual environments is done through the :mod:`venv` module. " "Installing packages into an active virtual environment uses the commands " @@ -240,7 +240,7 @@ msgstr "" "虛擬環境的建立是使用 :mod:`venv` 模組來完成。要在一個已啟用的虛擬環境中安裝套" "件,可使用前面展示的指令。" -#: ../../installing/index.rst:116 +#: ../../installing/index.rst:118 msgid "" "`Python Packaging User Guide: Installing Python Distribution Packages " "`__" @@ -248,19 +248,19 @@ msgstr "" "`Python 封裝使用者指南:安裝 Python 發布套件 `__" -#: ../../installing/index.rst:121 +#: ../../installing/index.rst:123 msgid "How do I ...?" msgstr "我該如何...?" -#: ../../installing/index.rst:123 +#: ../../installing/index.rst:125 msgid "These are quick answers or links for some common tasks." msgstr "接下來是關於一些常見任務的快速解答或連結。" -#: ../../installing/index.rst:126 +#: ../../installing/index.rst:128 msgid "... install ``pip`` in versions of Python prior to Python 3.4?" msgstr "...在 Python 3.4 之前的 Python 版本中安裝 ``pip``?" -#: ../../installing/index.rst:128 +#: ../../installing/index.rst:130 msgid "" "Python only started bundling ``pip`` with Python 3.4. For earlier versions, " "``pip`` needs to be \"bootstrapped\" as described in the Python Packaging " @@ -269,7 +269,7 @@ msgstr "" "Python 是從 Python 3.4 才開始綁定 ``pip`` 的。對於更早的版本,\\ ``pip`` 需要" "被「自助安裝 (bootstrapped)」,請參考 Python 封裝使用者指南中的說明。" -#: ../../installing/index.rst:134 +#: ../../installing/index.rst:136 msgid "" "`Python Packaging User Guide: Requirements for Installing Packages `__" @@ -277,11 +277,11 @@ msgstr "" "`Python 封裝使用者指南:安裝套件的需求 `__" -#: ../../installing/index.rst:141 +#: ../../installing/index.rst:143 msgid "... install packages just for the current user?" msgstr "...只為目前的使用者安裝套件?" -#: ../../installing/index.rst:143 +#: ../../installing/index.rst:145 msgid "" "Passing the ``--user`` option to ``python -m pip install`` will install a " "package just for the current user, rather than for all users of the system." @@ -289,11 +289,11 @@ msgstr "" "把 ``--user`` 選項傳給 ``python -m pip install``,這樣將會只為目前使用者而非" "系統的所有使用者安裝套件。" -#: ../../installing/index.rst:148 +#: ../../installing/index.rst:150 msgid "... install scientific Python packages?" msgstr "...安裝科學的 Python 套件?" -#: ../../installing/index.rst:150 +#: ../../installing/index.rst:152 msgid "" "A number of scientific Python packages have complex binary dependencies, and " "aren't currently easy to install using ``pip`` directly. At this point in " @@ -305,7 +305,7 @@ msgstr "" "``pip`` 安裝。目前為止,使用\\ `其他方法 `__\\ 而非嘗試用 ``pip`` 來安裝它們,對使用者來說通常會更簡單。" -#: ../../installing/index.rst:158 +#: ../../installing/index.rst:160 msgid "" "`Python Packaging User Guide: Installing Scientific Packages `__" @@ -313,11 +313,11 @@ msgstr "" "`Python 封裝使用者指南:安裝科學套件 `__" -#: ../../installing/index.rst:163 +#: ../../installing/index.rst:165 msgid "... work with multiple versions of Python installed in parallel?" msgstr "...平行安裝多個 Python 版本並使用它們?" -#: ../../installing/index.rst:165 +#: ../../installing/index.rst:167 msgid "" "On Linux, macOS, and other POSIX systems, use the versioned Python commands " "in combination with the ``-m`` switch to run the appropriate copy of " @@ -328,11 +328,11 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:174 +#: ../../installing/index.rst:176 msgid "Appropriately versioned ``pip`` commands may also be available." msgstr "使用帶有合適版本編號的 ``pip`` 指令,也是可行的。" -#: ../../installing/index.rst:176 +#: ../../installing/index.rst:178 msgid "" "On Windows, use the ``py`` Python launcher in combination with the ``-m`` " "switch::" @@ -342,15 +342,15 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:193 +#: ../../installing/index.rst:195 msgid "Common installation issues" msgstr "常見的安裝問題" -#: ../../installing/index.rst:196 +#: ../../installing/index.rst:198 msgid "Installing into the system Python on Linux" msgstr "在 Linux 上安裝套件至系統 Python" -#: ../../installing/index.rst:198 +#: ../../installing/index.rst:200 msgid "" "On Linux systems, a Python installation will typically be included as part " "of the distribution. Installing into this Python installation requires root " @@ -362,7 +362,7 @@ msgstr "" "件到這個 Python 版本上需要系統的 root 權限,並且可能會干擾到系統套件管理器的" "運作。如果其他系統組件非預期地以 ``pip`` 被升級,也會干擾這些組件的運作。" -#: ../../installing/index.rst:204 +#: ../../installing/index.rst:206 msgid "" "On such systems, it is often better to use a virtual environment or a per-" "user installation when installing packages with ``pip``." @@ -370,11 +370,11 @@ msgstr "" "在這樣的系統上,以 ``pip`` 安裝套件時,通常較好的方式是使用虛擬環境,或以個別" "使用者安裝。" -#: ../../installing/index.rst:209 +#: ../../installing/index.rst:211 msgid "Pip not installed" msgstr "未安裝 pip" -#: ../../installing/index.rst:211 +#: ../../installing/index.rst:213 msgid "" "It is possible that ``pip`` does not get installed by default. One potential " "fix is::" @@ -383,7 +383,7 @@ msgstr "" "\n" "::" -#: ../../installing/index.rst:215 +#: ../../installing/index.rst:217 msgid "" "There are also additional resources for `installing pip. `__\\ 的資源。" -#: ../../installing/index.rst:220 +#: ../../installing/index.rst:222 msgid "Installing binary extensions" msgstr "安裝二進制擴充 (binary extension)" -#: ../../installing/index.rst:222 +#: ../../installing/index.rst:224 msgid "" "Python has typically relied heavily on source based distribution, with end " "users being expected to compile extension modules from source as part of the " @@ -406,7 +406,7 @@ msgstr "" "Python 基本上相當倚賴以原始碼為基礎的發布方式,也會期望使用者在安裝過程的某個" "階段,從原始碼來編譯擴充模組。" -#: ../../installing/index.rst:226 +#: ../../installing/index.rst:228 msgid "" "With the introduction of support for the binary ``wheel`` format, and the " "ability to publish wheels for at least Windows and macOS through the Python " @@ -418,7 +418,7 @@ msgstr "" "Windows 和 macOS 發布 wheel 檔案,這個問題預期將會逐漸消失,因為使用者將能夠" "更頻繁地安裝預建置 (pre-built) 的擴充,而不再需要自己建置它們。" -#: ../../installing/index.rst:232 +#: ../../installing/index.rst:234 msgid "" "Some of the solutions for installing `scientific software `__ that are not yet available as pre-built ``wheel`` " @@ -429,7 +429,7 @@ msgstr "" "軟體 `__\\ ,這些方案也有助於取得其他" "的二進制擴充,且無需在本機對它們進行建置。" -#: ../../installing/index.rst:239 +#: ../../installing/index.rst:241 msgid "" "`Python Packaging User Guide: Binary Extensions `__" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 05d60d7dee..7bb353e610 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -697,7 +697,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:508 #: ../../library/asyncio-eventloop.rst:750 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." -msgstr "" +msgstr "新增 :class:`ProactorEventLoop` 中的 SSL/TLS 支援。" #: ../../library/asyncio-eventloop.rst:512 msgid "" diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 639f5fea43..682cea2052 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -97,7 +97,7 @@ msgstr "" #: ../../library/asyncio-runner.rst:69 msgid "Added *loop_factory* parameter." -msgstr "" +msgstr "新增 *loop_factory* 參數。" #: ../../library/asyncio-runner.rst:73 msgid "Runner context manager" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index a256bb058c..fd1ced339d 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -100,7 +100,7 @@ msgstr "新增 *ssl_handshake_timeout* 參數。" #: ../../library/asyncio-stream.rst:80 msgid "Added *happy_eyeballs_delay* and *interleave* parameters." -msgstr "" +msgstr "新增 *happy_eyeballs_delay* 和 *interleave* 參數。" #: ../../library/asyncio-stream.rst:83 ../../library/asyncio-stream.rst:125 #: ../../library/asyncio-stream.rst:157 ../../library/asyncio-stream.rst:187 diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 16372ee81e..20eded89b3 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -602,8 +602,8 @@ msgstr "" #: ../../library/asyncio-task.rst:633 msgid "" -"An :ref:`asynchronous context manager ` that can be " -"used to limit the amount of time spent waiting on something." +"Return an :ref:`asynchronous context manager ` that " +"can be used to limit the amount of time spent waiting on something." msgstr "" #: ../../library/asyncio-task.rst:637 diff --git a/library/csv.po b/library/csv.po index 8b742a9fca..ceefe0fe93 100644 --- a/library/csv.po +++ b/library/csv.po @@ -602,7 +602,7 @@ msgstr "" #: ../../library/csv.rst:505 msgid "Added support of arbitrary iterables." -msgstr "" +msgstr "新增對任意 iterable 的支援。" #: ../../library/csv.rst:510 msgid "" diff --git a/library/ctypes.po b/library/ctypes.po index db3176d87a..120a3fae5a 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-20 15:45+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,9 +69,9 @@ msgid "" "loads libraries which export functions using the standard ``cdecl`` calling " "convention, while *windll* libraries call functions using the ``stdcall`` " "calling convention. *oledll* also uses the ``stdcall`` calling convention, " -"and assumes the functions return a Windows :c:type:`HRESULT` error code. The " -"error code is used to automatically raise an :class:`OSError` exception when " -"the function call fails." +"and assumes the functions return a Windows :c:type:`!HRESULT` error code. " +"The error code is used to automatically raise an :class:`OSError` exception " +"when the function call fails." msgstr "" #: ../../library/ctypes.rst:48 @@ -103,20 +103,20 @@ msgstr "" msgid "" "On Linux, it is required to specify the filename *including* the extension " "to load a library, so attribute access can not be used to load libraries. " -"Either the :meth:`LoadLibrary` method of the dll loaders should be used, or " -"you should load the library by creating an instance of CDLL by calling the " -"constructor::" +"Either the :meth:`~LibraryLoader.LoadLibrary` method of the dll loaders " +"should be used, or you should load the library by creating an instance of " +"CDLL by calling the constructor::" msgstr "" -#: ../../library/ctypes.rst:91 +#: ../../library/ctypes.rst:92 msgid "Accessing functions from loaded dlls" msgstr "" -#: ../../library/ctypes.rst:93 +#: ../../library/ctypes.rst:94 msgid "Functions are accessed as attributes of dll objects::" msgstr "" -#: ../../library/ctypes.rst:108 +#: ../../library/ctypes.rst:109 msgid "" "Note that win32 system dlls like ``kernel32`` and ``user32`` often export " "ANSI as well as UNICODE versions of a function. The UNICODE version is " @@ -127,65 +127,65 @@ msgid "" "``GetModuleHandle`` depending on whether UNICODE is defined or not::" msgstr "" -#: ../../library/ctypes.rst:121 +#: ../../library/ctypes.rst:122 msgid "" "*windll* does not try to select one of them by magic, you must access the " "version you need by specifying ``GetModuleHandleA`` or ``GetModuleHandleW`` " "explicitly, and then call it with bytes or string objects respectively." msgstr "" -#: ../../library/ctypes.rst:125 +#: ../../library/ctypes.rst:126 msgid "" "Sometimes, dlls export functions with names which aren't valid Python " "identifiers, like ``\"??2@YAPAXI@Z\"``. In this case you have to use :func:" "`getattr` to retrieve the function::" msgstr "" -#: ../../library/ctypes.rst:133 +#: ../../library/ctypes.rst:134 msgid "" "On Windows, some dlls export functions not by name but by ordinal. These " "functions can be accessed by indexing the dll object with the ordinal " "number::" msgstr "" -#: ../../library/ctypes.rst:150 +#: ../../library/ctypes.rst:151 msgid "Calling functions" msgstr "" -#: ../../library/ctypes.rst:152 +#: ../../library/ctypes.rst:153 msgid "" "You can call these functions like any other Python callable. This example " "uses the ``rand()`` function, which takes no arguments and returns a pseudo-" "random integer::" msgstr "" -#: ../../library/ctypes.rst:158 +#: ../../library/ctypes.rst:159 msgid "" "On Windows, you can call the ``GetModuleHandleA()`` function, which returns " "a win32 module handle (passing ``None`` as single argument to call it with a " "``NULL`` pointer)::" msgstr "" -#: ../../library/ctypes.rst:165 +#: ../../library/ctypes.rst:166 msgid "" ":exc:`ValueError` is raised when you call an ``stdcall`` function with the " "``cdecl`` calling convention, or vice versa::" msgstr "" -#: ../../library/ctypes.rst:180 +#: ../../library/ctypes.rst:181 msgid "" "To find out the correct calling convention you have to look into the C " "header file or the documentation for the function you want to call." msgstr "" -#: ../../library/ctypes.rst:183 +#: ../../library/ctypes.rst:184 msgid "" "On Windows, :mod:`ctypes` uses win32 structured exception handling to " "prevent crashes from general protection faults when functions are called " "with invalid argument values::" msgstr "" -#: ../../library/ctypes.rst:193 +#: ../../library/ctypes.rst:194 msgid "" "There are, however, enough ways to crash Python with :mod:`ctypes`, so you " "should be careful anyway. The :mod:`faulthandler` module can be helpful in " @@ -193,7 +193,7 @@ msgid "" "library calls)." msgstr "" -#: ../../library/ctypes.rst:198 +#: ../../library/ctypes.rst:199 msgid "" "``None``, integers, bytes objects and (unicode) strings are the only native " "Python objects that can directly be used as parameters in these function " @@ -204,259 +204,259 @@ msgid "" "the C type." msgstr "" -#: ../../library/ctypes.rst:205 +#: ../../library/ctypes.rst:206 msgid "" "Before we move on calling functions with other parameter types, we have to " "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2198 +#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2201 msgid "Fundamental data types" msgstr "" -#: ../../library/ctypes.rst:214 +#: ../../library/ctypes.rst:215 msgid ":mod:`ctypes` defines a number of primitive C compatible data types:" msgstr "" -#: ../../library/ctypes.rst:217 +#: ../../library/ctypes.rst:218 msgid "ctypes type" msgstr "" -#: ../../library/ctypes.rst:217 +#: ../../library/ctypes.rst:218 msgid "C type" msgstr "" -#: ../../library/ctypes.rst:217 +#: ../../library/ctypes.rst:218 msgid "Python type" msgstr "" -#: ../../library/ctypes.rst:219 +#: ../../library/ctypes.rst:220 msgid ":class:`c_bool`" msgstr ":class:`c_bool`" -#: ../../library/ctypes.rst:219 +#: ../../library/ctypes.rst:220 msgid ":c:expr:`_Bool`" msgstr ":c:expr:`_Bool`" -#: ../../library/ctypes.rst:219 +#: ../../library/ctypes.rst:220 msgid "bool (1)" msgstr "bool (1)" -#: ../../library/ctypes.rst:221 +#: ../../library/ctypes.rst:222 msgid ":class:`c_char`" msgstr ":class:`c_char`" -#: ../../library/ctypes.rst:221 ../../library/ctypes.rst:225 +#: ../../library/ctypes.rst:222 ../../library/ctypes.rst:226 msgid ":c:expr:`char`" msgstr ":c:expr:`char`" -#: ../../library/ctypes.rst:221 +#: ../../library/ctypes.rst:222 msgid "1-character bytes object" msgstr "" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:224 msgid ":class:`c_wchar`" msgstr ":class:`c_wchar`" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:224 msgid ":c:type:`wchar_t`" msgstr ":c:type:`wchar_t`" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:224 msgid "1-character string" msgstr "" -#: ../../library/ctypes.rst:225 +#: ../../library/ctypes.rst:226 msgid ":class:`c_byte`" msgstr ":class:`c_byte`" -#: ../../library/ctypes.rst:225 ../../library/ctypes.rst:227 -#: ../../library/ctypes.rst:229 ../../library/ctypes.rst:231 -#: ../../library/ctypes.rst:233 ../../library/ctypes.rst:235 -#: ../../library/ctypes.rst:237 ../../library/ctypes.rst:239 -#: ../../library/ctypes.rst:241 ../../library/ctypes.rst:243 -#: ../../library/ctypes.rst:246 ../../library/ctypes.rst:248 -#: ../../library/ctypes.rst:251 +#: ../../library/ctypes.rst:226 ../../library/ctypes.rst:228 +#: ../../library/ctypes.rst:230 ../../library/ctypes.rst:232 +#: ../../library/ctypes.rst:234 ../../library/ctypes.rst:236 +#: ../../library/ctypes.rst:238 ../../library/ctypes.rst:240 +#: ../../library/ctypes.rst:242 ../../library/ctypes.rst:244 +#: ../../library/ctypes.rst:247 ../../library/ctypes.rst:249 +#: ../../library/ctypes.rst:252 msgid "int" msgstr "int" -#: ../../library/ctypes.rst:227 +#: ../../library/ctypes.rst:228 msgid ":class:`c_ubyte`" msgstr ":class:`c_ubyte`" -#: ../../library/ctypes.rst:227 +#: ../../library/ctypes.rst:228 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../library/ctypes.rst:229 +#: ../../library/ctypes.rst:230 msgid ":class:`c_short`" msgstr ":class:`c_short`" -#: ../../library/ctypes.rst:229 +#: ../../library/ctypes.rst:230 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../library/ctypes.rst:231 +#: ../../library/ctypes.rst:232 msgid ":class:`c_ushort`" msgstr ":class:`c_ushort`" -#: ../../library/ctypes.rst:231 +#: ../../library/ctypes.rst:232 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../library/ctypes.rst:233 +#: ../../library/ctypes.rst:234 msgid ":class:`c_int`" msgstr ":class:`c_int`" -#: ../../library/ctypes.rst:233 +#: ../../library/ctypes.rst:234 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../library/ctypes.rst:235 +#: ../../library/ctypes.rst:236 msgid ":class:`c_uint`" msgstr ":class:`c_uint`" -#: ../../library/ctypes.rst:235 +#: ../../library/ctypes.rst:236 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../library/ctypes.rst:237 +#: ../../library/ctypes.rst:238 msgid ":class:`c_long`" msgstr ":class:`c_long`" -#: ../../library/ctypes.rst:237 +#: ../../library/ctypes.rst:238 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../library/ctypes.rst:239 +#: ../../library/ctypes.rst:240 msgid ":class:`c_ulong`" msgstr ":class:`c_ulong`" -#: ../../library/ctypes.rst:239 +#: ../../library/ctypes.rst:240 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../library/ctypes.rst:241 +#: ../../library/ctypes.rst:242 msgid ":class:`c_longlong`" msgstr ":class:`c_longlong`" -#: ../../library/ctypes.rst:241 +#: ../../library/ctypes.rst:242 msgid ":c:expr:`__int64` or :c:expr:`long long`" msgstr ":c:expr:`__int64` 或 :c:expr:`long long`" -#: ../../library/ctypes.rst:243 +#: ../../library/ctypes.rst:244 msgid ":class:`c_ulonglong`" msgstr ":class:`c_ulonglong`" -#: ../../library/ctypes.rst:243 +#: ../../library/ctypes.rst:244 msgid ":c:expr:`unsigned __int64` or :c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned __int64` 或 :c:expr:`unsigned long long`" -#: ../../library/ctypes.rst:246 +#: ../../library/ctypes.rst:247 msgid ":class:`c_size_t`" msgstr ":class:`c_size_t`" -#: ../../library/ctypes.rst:246 +#: ../../library/ctypes.rst:247 msgid ":c:type:`size_t`" msgstr ":c:type:`size_t`" -#: ../../library/ctypes.rst:248 +#: ../../library/ctypes.rst:249 msgid ":class:`c_ssize_t`" msgstr ":class:`c_ssize_t`" -#: ../../library/ctypes.rst:248 +#: ../../library/ctypes.rst:249 msgid ":c:type:`ssize_t` or :c:expr:`Py_ssize_t`" msgstr ":c:type:`ssize_t` 或 :c:expr:`Py_ssize_t`" -#: ../../library/ctypes.rst:251 +#: ../../library/ctypes.rst:252 msgid ":class:`c_time_t`" msgstr ":class:`c_time_t`" -#: ../../library/ctypes.rst:251 +#: ../../library/ctypes.rst:252 msgid ":c:type:`time_t`" msgstr ":c:type:`time_t`" -#: ../../library/ctypes.rst:253 +#: ../../library/ctypes.rst:254 msgid ":class:`c_float`" msgstr ":class:`c_float`" -#: ../../library/ctypes.rst:253 +#: ../../library/ctypes.rst:254 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../library/ctypes.rst:253 ../../library/ctypes.rst:255 -#: ../../library/ctypes.rst:257 +#: ../../library/ctypes.rst:254 ../../library/ctypes.rst:256 +#: ../../library/ctypes.rst:258 msgid "float" msgstr "float" -#: ../../library/ctypes.rst:255 +#: ../../library/ctypes.rst:256 msgid ":class:`c_double`" msgstr ":class:`c_double`" -#: ../../library/ctypes.rst:255 +#: ../../library/ctypes.rst:256 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../library/ctypes.rst:257 +#: ../../library/ctypes.rst:258 msgid ":class:`c_longdouble`" msgstr ":class:`c_longdouble`" -#: ../../library/ctypes.rst:257 +#: ../../library/ctypes.rst:258 msgid ":c:expr:`long double`" msgstr ":c:expr:`long double`" -#: ../../library/ctypes.rst:259 +#: ../../library/ctypes.rst:260 msgid ":class:`c_char_p`" msgstr ":class:`c_char_p`" -#: ../../library/ctypes.rst:259 +#: ../../library/ctypes.rst:260 msgid ":c:expr:`char *` (NUL terminated)" msgstr "" -#: ../../library/ctypes.rst:259 +#: ../../library/ctypes.rst:260 msgid "bytes object or ``None``" msgstr "" -#: ../../library/ctypes.rst:261 +#: ../../library/ctypes.rst:262 msgid ":class:`c_wchar_p`" msgstr ":class:`c_wchar_p`" -#: ../../library/ctypes.rst:261 +#: ../../library/ctypes.rst:262 msgid ":c:expr:`wchar_t *` (NUL terminated)" msgstr "" -#: ../../library/ctypes.rst:261 +#: ../../library/ctypes.rst:262 msgid "string or ``None``" msgstr "字串或 ``None``" -#: ../../library/ctypes.rst:263 +#: ../../library/ctypes.rst:264 msgid ":class:`c_void_p`" msgstr ":class:`c_void_p`" -#: ../../library/ctypes.rst:263 +#: ../../library/ctypes.rst:264 msgid ":c:expr:`void *`" msgstr ":c:expr:`void *`" -#: ../../library/ctypes.rst:263 +#: ../../library/ctypes.rst:264 msgid "int or ``None``" msgstr "" -#: ../../library/ctypes.rst:267 +#: ../../library/ctypes.rst:268 msgid "The constructor accepts any object with a truth value." msgstr "" -#: ../../library/ctypes.rst:269 +#: ../../library/ctypes.rst:270 msgid "" "All these types can be created by calling them with an optional initializer " "of the correct type and value::" msgstr "" -#: ../../library/ctypes.rst:280 +#: ../../library/ctypes.rst:281 msgid "" "Since these types are mutable, their value can also be changed afterwards::" msgstr "" -#: ../../library/ctypes.rst:292 +#: ../../library/ctypes.rst:293 msgid "" "Assigning a new value to instances of the pointer types :class:`c_char_p`, :" "class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they " @@ -464,7 +464,7 @@ msgid "" "Python bytes objects are immutable)::" msgstr "" -#: ../../library/ctypes.rst:312 +#: ../../library/ctypes.rst:313 msgid "" "You should be careful, however, not to pass them to functions expecting " "pointers to mutable memory. If you need mutable memory blocks, ctypes has a :" @@ -474,37 +474,37 @@ msgid "" "``value`` property::" msgstr "" -#: ../../library/ctypes.rst:336 +#: ../../library/ctypes.rst:337 msgid "" -"The :func:`create_string_buffer` function replaces the old :func:`c_buffer` " +"The :func:`create_string_buffer` function replaces the old :func:`!c_buffer` " "function (which is still available as an alias). To create a mutable memory " "block containing unicode characters of the C type :c:type:`wchar_t`, use " "the :func:`create_unicode_buffer` function." msgstr "" -#: ../../library/ctypes.rst:345 +#: ../../library/ctypes.rst:346 msgid "Calling functions, continued" msgstr "" -#: ../../library/ctypes.rst:347 +#: ../../library/ctypes.rst:348 msgid "" "Note that printf prints to the real standard output channel, *not* to :data:" "`sys.stdout`, so these examples will only work at the console prompt, not " "from within *IDLE* or *PythonWin*::" msgstr "" -#: ../../library/ctypes.rst:367 +#: ../../library/ctypes.rst:368 msgid "" "As has been mentioned before, all Python types except integers, strings, and " "bytes objects have to be wrapped in their corresponding :mod:`ctypes` type, " "so that they can be converted to the required C data type::" msgstr "" -#: ../../library/ctypes.rst:379 +#: ../../library/ctypes.rst:380 msgid "Calling variadic functions" msgstr "" -#: ../../library/ctypes.rst:381 +#: ../../library/ctypes.rst:382 msgid "" "On a lot of platforms calling variadic functions through ctypes is exactly " "the same as calling functions with a fixed number of parameters. On some " @@ -513,127 +513,130 @@ msgid "" "functions." msgstr "" -#: ../../library/ctypes.rst:386 +#: ../../library/ctypes.rst:387 msgid "" -"On those platforms it is required to specify the *argtypes* attribute for " -"the regular, non-variadic, function arguments:" +"On those platforms it is required to specify the :attr:`~_FuncPtr.argtypes` " +"attribute for the regular, non-variadic, function arguments:" msgstr "" -#: ../../library/ctypes.rst:393 +#: ../../library/ctypes.rst:394 msgid "" "Because specifying the attribute does not inhibit portability it is advised " -"to always specify ``argtypes`` for all variadic functions." +"to always specify :attr:`~_FuncPtr.argtypes` for all variadic functions." msgstr "" -#: ../../library/ctypes.rst:400 +#: ../../library/ctypes.rst:401 msgid "Calling functions with your own custom data types" msgstr "" -#: ../../library/ctypes.rst:402 +#: ../../library/ctypes.rst:403 msgid "" "You can also customize :mod:`ctypes` argument conversion to allow instances " -"of your own classes be used as function arguments. :mod:`ctypes` looks for " -"an :attr:`_as_parameter_` attribute and uses this as the function argument. " -"Of course, it must be one of integer, string, or bytes::" +"of your own classes be used as function arguments. :mod:`ctypes` looks for " +"an :attr:`!_as_parameter_` attribute and uses this as the function argument. " +"The attribute must be an integer, string, bytes, a :mod:`ctypes` instance, " +"or an object with an :attr:`!_as_parameter_` attribute::" msgstr "" -#: ../../library/ctypes.rst:417 +#: ../../library/ctypes.rst:419 msgid "" -"If you don't want to store the instance's data in the :attr:`_as_parameter_` " -"instance variable, you could define a :class:`property` which makes the " -"attribute available on request." +"If you don't want to store the instance's data in the :attr:`!" +"_as_parameter_` instance variable, you could define a :class:`property` " +"which makes the attribute available on request." msgstr "" -#: ../../library/ctypes.rst:425 +#: ../../library/ctypes.rst:427 msgid "Specifying the required argument types (function prototypes)" msgstr "" -#: ../../library/ctypes.rst:427 +#: ../../library/ctypes.rst:429 msgid "" "It is possible to specify the required argument types of functions exported " -"from DLLs by setting the :attr:`argtypes` attribute." +"from DLLs by setting the :attr:`~_FuncPtr.argtypes` attribute." msgstr "" -#: ../../library/ctypes.rst:430 +#: ../../library/ctypes.rst:432 msgid "" -":attr:`argtypes` must be a sequence of C data types (the ``printf`` function " -"is probably not a good example here, because it takes a variable number and " -"different types of parameters depending on the format string, on the other " -"hand this is quite handy to experiment with this feature)::" +":attr:`~_FuncPtr.argtypes` must be a sequence of C data types (the :func:`!" +"printf` function is probably not a good example here, because it takes a " +"variable number and different types of parameters depending on the format " +"string, on the other hand this is quite handy to experiment with this " +"feature)::" msgstr "" -#: ../../library/ctypes.rst:441 +#: ../../library/ctypes.rst:443 msgid "" "Specifying a format protects against incompatible argument types (just as a " "prototype for a C function), and tries to convert the arguments to valid " "types::" msgstr "" -#: ../../library/ctypes.rst:453 +#: ../../library/ctypes.rst:455 msgid "" "If you have defined your own classes which you pass to function calls, you " -"have to implement a :meth:`from_param` class method for them to be able to " -"use them in the :attr:`argtypes` sequence. The :meth:`from_param` class " -"method receives the Python object passed to the function call, it should do " -"a typecheck or whatever is needed to make sure this object is acceptable, " -"and then return the object itself, its :attr:`_as_parameter_` attribute, or " -"whatever you want to pass as the C function argument in this case. Again, " -"the result should be an integer, string, bytes, a :mod:`ctypes` instance, or " -"an object with an :attr:`_as_parameter_` attribute." -msgstr "" - -#: ../../library/ctypes.rst:467 +"have to implement a :meth:`~_CData.from_param` class method for them to be " +"able to use them in the :attr:`~_FuncPtr.argtypes` sequence. The :meth:" +"`~_CData.from_param` class method receives the Python object passed to the " +"function call, it should do a typecheck or whatever is needed to make sure " +"this object is acceptable, and then return the object itself, its :attr:`!" +"_as_parameter_` attribute, or whatever you want to pass as the C function " +"argument in this case. Again, the result should be an integer, string, " +"bytes, a :mod:`ctypes` instance, or an object with an :attr:`!" +"_as_parameter_` attribute." +msgstr "" + +#: ../../library/ctypes.rst:469 msgid "Return types" msgstr "" -#: ../../library/ctypes.rst:477 +#: ../../library/ctypes.rst:479 msgid "" "By default functions are assumed to return the C :c:expr:`int` type. Other " -"return types can be specified by setting the :attr:`restype` attribute of " -"the function object." +"return types can be specified by setting the :attr:`~_FuncPtr.restype` " +"attribute of the function object." msgstr "" -#: ../../library/ctypes.rst:481 +#: ../../library/ctypes.rst:483 msgid "" -"The C prototype of ``time()`` is ``time_t time(time_t *)``. Because :c:type:" -"`time_t` might be of a different type than the default return type ``int``, " -"you should specify the ``restype``::" +"The C prototype of :c:func:`time` is ``time_t time(time_t *)``. Because :c:" +"type:`time_t` might be of a different type than the default return type :c:" +"expr:`int`, you should specify the :attr:`!restype` attribute::" msgstr "" -#: ../../library/ctypes.rst:487 -msgid "The argument types can be specified using ``argtypes``::" +#: ../../library/ctypes.rst:489 +msgid "The argument types can be specified using :attr:`~_FuncPtr.argtypes`::" msgstr "" -#: ../../library/ctypes.rst:491 +#: ../../library/ctypes.rst:493 msgid "" "To call the function with a ``NULL`` pointer as first argument, use " "``None``::" msgstr "" -#: ../../library/ctypes.rst:496 +#: ../../library/ctypes.rst:498 msgid "" -"Here is a more advanced example, it uses the ``strchr`` function, which " +"Here is a more advanced example, it uses the :func:`!strchr` function, which " "expects a string pointer and a char, and returns a pointer to a string::" msgstr "" -#: ../../library/ctypes.rst:509 +#: ../../library/ctypes.rst:511 msgid "" -"If you want to avoid the ``ord(\"x\")`` calls above, you can set the :attr:" -"`argtypes` attribute, and the second argument will be converted from a " -"single character Python bytes object into a C char:" +"If you want to avoid the :func:`ord(\"x\") ` calls above, you can set " +"the :attr:`~_FuncPtr.argtypes` attribute, and the second argument will be " +"converted from a single character Python bytes object into a C char:" msgstr "" -#: ../../library/ctypes.rst:528 +#: ../../library/ctypes.rst:530 msgid "" "You can also use a callable Python object (a function or a class for " -"example) as the :attr:`restype` attribute, if the foreign function returns " -"an integer. The callable will be called with the *integer* the C function " -"returns, and the result of this call will be used as the result of your " -"function call. This is useful to check for error return values and " +"example) as the :attr:`~_FuncPtr.restype` attribute, if the foreign function " +"returns an integer. The callable will be called with the *integer* the C " +"function returns, and the result of this call will be used as the result of " +"your function call. This is useful to check for error return values and " "automatically raise an exception::" msgstr "" -#: ../../library/ctypes.rst:551 +#: ../../library/ctypes.rst:553 msgid "" "``WinError`` is a function which will call Windows ``FormatMessage()`` api " "to get the string representation of an error code, and *returns* an " @@ -641,17 +644,18 @@ msgid "" "used, it calls :func:`GetLastError` to retrieve it." msgstr "" -#: ../../library/ctypes.rst:556 +#: ../../library/ctypes.rst:558 msgid "" "Please note that a much more powerful error checking mechanism is available " -"through the :attr:`errcheck` attribute; see the reference manual for details." +"through the :attr:`~_FuncPtr.errcheck` attribute; see the reference manual " +"for details." msgstr "" -#: ../../library/ctypes.rst:563 +#: ../../library/ctypes.rst:566 msgid "Passing pointers (or: passing parameters by reference)" msgstr "" -#: ../../library/ctypes.rst:565 +#: ../../library/ctypes.rst:568 msgid "" "Sometimes a C api function expects a *pointer* to a data type as parameter, " "probably to write into the corresponding location, or if the data is too " @@ -659,7 +663,7 @@ msgid "" "reference*." msgstr "" -#: ../../library/ctypes.rst:569 +#: ../../library/ctypes.rst:572 msgid "" ":mod:`ctypes` exports the :func:`byref` function which is used to pass " "parameters by reference. The same effect can be achieved with the :func:" @@ -668,56 +672,57 @@ msgid "" "you don't need the pointer object in Python itself::" msgstr "" -#: ../../library/ctypes.rst:591 +#: ../../library/ctypes.rst:594 msgid "Structures and unions" msgstr "" -#: ../../library/ctypes.rst:593 +#: ../../library/ctypes.rst:596 msgid "" "Structures and unions must derive from the :class:`Structure` and :class:" "`Union` base classes which are defined in the :mod:`ctypes` module. Each " -"subclass must define a :attr:`_fields_` attribute. :attr:`_fields_` must be " -"a list of *2-tuples*, containing a *field name* and a *field type*." +"subclass must define a :attr:`~Structure._fields_` attribute. :attr:`!" +"_fields_` must be a list of *2-tuples*, containing a *field name* and a " +"*field type*." msgstr "" -#: ../../library/ctypes.rst:598 +#: ../../library/ctypes.rst:601 msgid "" "The field type must be a :mod:`ctypes` type like :class:`c_int`, or any " "other derived :mod:`ctypes` type: structure, union, array, pointer." msgstr "" -#: ../../library/ctypes.rst:601 +#: ../../library/ctypes.rst:604 msgid "" "Here is a simple example of a POINT structure, which contains two integers " "named *x* and *y*, and also shows how to initialize a structure in the " "constructor::" msgstr "" -#: ../../library/ctypes.rst:621 +#: ../../library/ctypes.rst:624 msgid "" "You can, however, build much more complicated structures. A structure can " "itself contain other structures by using a structure as a field type." msgstr "" -#: ../../library/ctypes.rst:624 +#: ../../library/ctypes.rst:627 msgid "" "Here is a RECT structure which contains two POINTs named *upperleft* and " "*lowerright*::" msgstr "" -#: ../../library/ctypes.rst:638 +#: ../../library/ctypes.rst:641 msgid "" "Nested structures can also be initialized in the constructor in several " "ways::" msgstr "" -#: ../../library/ctypes.rst:643 +#: ../../library/ctypes.rst:646 msgid "" "Field :term:`descriptor`\\s can be retrieved from the *class*, they are " "useful for debugging because they can provide useful information::" msgstr "" -#: ../../library/ctypes.rst:657 +#: ../../library/ctypes.rst:660 msgid "" ":mod:`ctypes` does not support passing unions or structures with bit-fields " "to functions by value. While this may work on 32-bit x86, it's not " @@ -725,20 +730,20 @@ msgid "" "structures with bit-fields should always be passed to functions by pointer." msgstr "" -#: ../../library/ctypes.rst:663 +#: ../../library/ctypes.rst:666 msgid "Structure/union alignment and byte order" msgstr "" -#: ../../library/ctypes.rst:665 +#: ../../library/ctypes.rst:668 msgid "" "By default, Structure and Union fields are aligned in the same way the C " "compiler does it. It is possible to override this behavior by specifying a :" -"attr:`_pack_` class attribute in the subclass definition. This must be set " -"to a positive integer and specifies the maximum alignment for the fields. " -"This is what ``#pragma pack(n)`` also does in MSVC." +"attr:`~Structure._pack_` class attribute in the subclass definition. This " +"must be set to a positive integer and specifies the maximum alignment for " +"the fields. This is what ``#pragma pack(n)`` also does in MSVC." msgstr "" -#: ../../library/ctypes.rst:671 +#: ../../library/ctypes.rst:674 msgid "" ":mod:`ctypes` uses the native byte order for Structures and Unions. To " "build structures with non-native byte order, you can use one of the :class:" @@ -747,91 +752,91 @@ msgid "" "classes cannot contain pointer fields." msgstr "" -#: ../../library/ctypes.rst:681 +#: ../../library/ctypes.rst:684 msgid "Bit fields in structures and unions" msgstr "" -#: ../../library/ctypes.rst:683 +#: ../../library/ctypes.rst:686 msgid "" "It is possible to create structures and unions containing bit fields. Bit " "fields are only possible for integer fields, the bit width is specified as " -"the third item in the :attr:`_fields_` tuples::" +"the third item in the :attr:`~Structure._fields_` tuples::" msgstr "" -#: ../../library/ctypes.rst:701 +#: ../../library/ctypes.rst:704 msgid "Arrays" msgstr "" -#: ../../library/ctypes.rst:703 +#: ../../library/ctypes.rst:706 msgid "" "Arrays are sequences, containing a fixed number of instances of the same " "type." msgstr "" -#: ../../library/ctypes.rst:705 +#: ../../library/ctypes.rst:708 msgid "" "The recommended way to create array types is by multiplying a data type with " "a positive integer::" msgstr "" -#: ../../library/ctypes.rst:710 +#: ../../library/ctypes.rst:713 msgid "" "Here is an example of a somewhat artificial data type, a structure " "containing 4 POINTs among other stuff::" msgstr "" -#: ../../library/ctypes.rst:726 +#: ../../library/ctypes.rst:729 msgid "Instances are created in the usual way, by calling the class::" msgstr "" -#: ../../library/ctypes.rst:732 +#: ../../library/ctypes.rst:735 msgid "" "The above code print a series of ``0 0`` lines, because the array contents " "is initialized to zeros." msgstr "" -#: ../../library/ctypes.rst:735 +#: ../../library/ctypes.rst:738 msgid "Initializers of the correct type can also be specified::" msgstr "" -#: ../../library/ctypes.rst:751 +#: ../../library/ctypes.rst:754 msgid "Pointers" msgstr "" -#: ../../library/ctypes.rst:753 +#: ../../library/ctypes.rst:756 msgid "" "Pointer instances are created by calling the :func:`pointer` function on a :" "mod:`ctypes` type::" msgstr "" -#: ../../library/ctypes.rst:761 +#: ../../library/ctypes.rst:764 msgid "" "Pointer instances have a :attr:`~_Pointer.contents` attribute which returns " "the object to which the pointer points, the ``i`` object above::" msgstr "" -#: ../../library/ctypes.rst:768 +#: ../../library/ctypes.rst:771 msgid "" "Note that :mod:`ctypes` does not have OOR (original object return), it " "constructs a new, equivalent object each time you retrieve an attribute::" msgstr "" -#: ../../library/ctypes.rst:777 +#: ../../library/ctypes.rst:780 msgid "" "Assigning another :class:`c_int` instance to the pointer's contents " "attribute would cause the pointer to point to the memory location where this " "is stored::" msgstr "" -#: ../../library/ctypes.rst:789 +#: ../../library/ctypes.rst:792 msgid "Pointer instances can also be indexed with integers::" msgstr "" -#: ../../library/ctypes.rst:795 +#: ../../library/ctypes.rst:798 msgid "Assigning to an integer index changes the pointed to value::" msgstr "" -#: ../../library/ctypes.rst:804 +#: ../../library/ctypes.rst:807 msgid "" "It is also possible to use indexes different from 0, but you must know what " "you're doing, just as in C: You can access or change arbitrary memory " @@ -840,7 +845,7 @@ msgid "" "instead of a single item." msgstr "" -#: ../../library/ctypes.rst:810 +#: ../../library/ctypes.rst:813 msgid "" "Behind the scenes, the :func:`pointer` function does more than simply create " "pointer instances, it has to create pointer *types* first. This is done with " @@ -848,46 +853,47 @@ msgid "" "returns a new type::" msgstr "" -#: ../../library/ctypes.rst:826 +#: ../../library/ctypes.rst:829 msgid "" "Calling the pointer type without an argument creates a ``NULL`` pointer. " "``NULL`` pointers have a ``False`` boolean value::" msgstr "" -#: ../../library/ctypes.rst:834 +#: ../../library/ctypes.rst:837 msgid "" ":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but " "dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" msgstr "" -#: ../../library/ctypes.rst:853 +#: ../../library/ctypes.rst:856 msgid "Type conversions" msgstr "" -#: ../../library/ctypes.rst:855 +#: ../../library/ctypes.rst:858 msgid "" "Usually, ctypes does strict type checking. This means, if you have " -"``POINTER(c_int)`` in the :attr:`argtypes` list of a function or as the type " -"of a member field in a structure definition, only instances of exactly the " -"same type are accepted. There are some exceptions to this rule, where " -"ctypes accepts other objects. For example, you can pass compatible array " -"instances instead of pointer types. So, for ``POINTER(c_int)``, ctypes " -"accepts an array of c_int::" +"``POINTER(c_int)`` in the :attr:`~_FuncPtr.argtypes` list of a function or " +"as the type of a member field in a structure definition, only instances of " +"exactly the same type are accepted. There are some exceptions to this rule, " +"where ctypes accepts other objects. For example, you can pass compatible " +"array instances instead of pointer types. So, for ``POINTER(c_int)``, " +"ctypes accepts an array of c_int::" msgstr "" -#: ../../library/ctypes.rst:876 +#: ../../library/ctypes.rst:879 msgid "" "In addition, if a function argument is explicitly declared to be a pointer " -"type (such as ``POINTER(c_int)``) in :attr:`argtypes`, an object of the " -"pointed type (``c_int`` in this case) can be passed to the function. ctypes " -"will apply the required :func:`byref` conversion in this case automatically." +"type (such as ``POINTER(c_int)``) in :attr:`~_FuncPtr.argtypes`, an object " +"of the pointed type (``c_int`` in this case) can be passed to the function. " +"ctypes will apply the required :func:`byref` conversion in this case " +"automatically." msgstr "" -#: ../../library/ctypes.rst:881 +#: ../../library/ctypes.rst:884 msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" msgstr "" -#: ../../library/ctypes.rst:888 +#: ../../library/ctypes.rst:891 msgid "" "Sometimes you have instances of incompatible types. In C, you can cast one " "type into another type. :mod:`ctypes` provides a :func:`cast` function " @@ -896,11 +902,11 @@ msgid "" "``values`` field, but not instances of other types::" msgstr "" -#: ../../library/ctypes.rst:900 +#: ../../library/ctypes.rst:903 msgid "For these cases, the :func:`cast` function is handy." msgstr "" -#: ../../library/ctypes.rst:902 +#: ../../library/ctypes.rst:905 msgid "" "The :func:`cast` function can be used to cast a ctypes instance into a " "pointer to a different ctypes data type. :func:`cast` takes two parameters, " @@ -909,60 +915,60 @@ msgid "" "references the same memory block as the first argument::" msgstr "" -#: ../../library/ctypes.rst:913 +#: ../../library/ctypes.rst:916 msgid "" "So, :func:`cast` can be used to assign to the ``values`` field of ``Bar`` " "the structure::" msgstr "" -#: ../../library/ctypes.rst:926 +#: ../../library/ctypes.rst:929 msgid "Incomplete Types" msgstr "" -#: ../../library/ctypes.rst:928 +#: ../../library/ctypes.rst:931 msgid "" "*Incomplete Types* are structures, unions or arrays whose members are not " "yet specified. In C, they are specified by forward declarations, which are " "defined later::" msgstr "" -#: ../../library/ctypes.rst:939 +#: ../../library/ctypes.rst:942 msgid "" "The straightforward translation into ctypes code would be this, but it does " "not work::" msgstr "" -#: ../../library/ctypes.rst:952 +#: ../../library/ctypes.rst:955 msgid "" "because the new ``class cell`` is not available in the class statement " "itself. In :mod:`ctypes`, we can define the ``cell`` class and set the :attr:" -"`_fields_` attribute later, after the class statement::" +"`~Structure._fields_` attribute later, after the class statement::" msgstr "" -#: ../../library/ctypes.rst:964 +#: ../../library/ctypes.rst:967 msgid "" "Let's try it. We create two instances of ``cell``, and let them point to " "each other, and finally follow the pointer chain a few times::" msgstr "" -#: ../../library/ctypes.rst:985 +#: ../../library/ctypes.rst:988 msgid "Callback functions" msgstr "" -#: ../../library/ctypes.rst:987 +#: ../../library/ctypes.rst:990 msgid "" ":mod:`ctypes` allows creating C callable function pointers from Python " "callables. These are sometimes called *callback functions*." msgstr "" -#: ../../library/ctypes.rst:990 +#: ../../library/ctypes.rst:993 msgid "" "First, you must create a class for the callback function. The class knows " "the calling convention, the return type, and the number and types of " "arguments this function will receive." msgstr "" -#: ../../library/ctypes.rst:994 +#: ../../library/ctypes.rst:997 msgid "" "The :func:`CFUNCTYPE` factory function creates types for callback functions " "using the ``cdecl`` calling convention. On Windows, the :func:`WINFUNCTYPE` " @@ -970,23 +976,23 @@ msgid "" "calling convention." msgstr "" -#: ../../library/ctypes.rst:999 +#: ../../library/ctypes.rst:1002 msgid "" "Both of these factory functions are called with the result type as first " "argument, and the callback functions expected argument types as the " "remaining arguments." msgstr "" -#: ../../library/ctypes.rst:1003 +#: ../../library/ctypes.rst:1006 msgid "" -"I will present an example here which uses the standard C library's :c:func:" -"`qsort` function, that is used to sort items with the help of a callback " -"function. :c:func:`qsort` will be used to sort an array of integers::" +"I will present an example here which uses the standard C library's :c:func:`!" +"qsort` function, that is used to sort items with the help of a callback " +"function. :c:func:`!qsort` will be used to sort an array of integers::" msgstr "" -#: ../../library/ctypes.rst:1013 +#: ../../library/ctypes.rst:1016 msgid "" -":func:`qsort` must be called with a pointer to the data to sort, the number " +":func:`!qsort` must be called with a pointer to the data to sort, the number " "of items in the data array, the size of one item, and a pointer to the " "comparison function, the callback. The callback will then be called with two " "pointers to items, and it must return a negative integer if the first item " @@ -994,44 +1000,44 @@ msgid "" "otherwise." msgstr "" -#: ../../library/ctypes.rst:1019 +#: ../../library/ctypes.rst:1022 msgid "" "So our callback function receives pointers to integers, and must return an " "integer. First we create the ``type`` for the callback function::" msgstr "" -#: ../../library/ctypes.rst:1025 +#: ../../library/ctypes.rst:1028 msgid "" "To get started, here is a simple callback that shows the values it gets " "passed::" msgstr "" -#: ../../library/ctypes.rst:1035 +#: ../../library/ctypes.rst:1038 msgid "The result::" msgstr "" -#: ../../library/ctypes.rst:1045 +#: ../../library/ctypes.rst:1048 msgid "Now we can actually compare the two items and return a useful result::" msgstr "" -#: ../../library/ctypes.rst:1060 +#: ../../library/ctypes.rst:1063 msgid "As we can easily check, our array is sorted now::" msgstr "" -#: ../../library/ctypes.rst:1067 +#: ../../library/ctypes.rst:1070 msgid "" "The function factories can be used as decorator factories, so we may as well " "write::" msgstr "" -#: ../../library/ctypes.rst:1085 +#: ../../library/ctypes.rst:1088 msgid "" "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " "are used from C code. :mod:`ctypes` doesn't, and if you don't, they may be " "garbage collected, crashing your program when a callback is made." msgstr "" -#: ../../library/ctypes.rst:1089 +#: ../../library/ctypes.rst:1092 msgid "" "Also, note that if the callback function is called in a thread created " "outside of Python's control (e.g. by the foreign code that calls the " @@ -1041,42 +1047,42 @@ msgid "" "even when those calls are made from the same C thread." msgstr "" -#: ../../library/ctypes.rst:1099 +#: ../../library/ctypes.rst:1102 msgid "Accessing values exported from dlls" msgstr "" -#: ../../library/ctypes.rst:1101 +#: ../../library/ctypes.rst:1104 msgid "" "Some shared libraries not only export functions, they also export variables. " "An example in the Python library itself is the :c:data:`Py_Version`, Python " "runtime version number encoded in a single constant integer." msgstr "" -#: ../../library/ctypes.rst:1105 +#: ../../library/ctypes.rst:1108 msgid "" -":mod:`ctypes` can access values like this with the :meth:`in_dll` class " -"methods of the type. *pythonapi* is a predefined symbol giving access to " -"the Python C api::" +":mod:`ctypes` can access values like this with the :meth:`~_CData.in_dll` " +"class methods of the type. *pythonapi* is a predefined symbol giving access " +"to the Python C api::" msgstr "" -#: ../../library/ctypes.rst:1113 +#: ../../library/ctypes.rst:1116 msgid "" "If the interpreter would have been started with :option:`-O`, the sample " "would have printed ``c_long(1)``, or ``c_long(2)`` if :option:`-OO` would " "have been specified." msgstr "" -#: ../../library/ctypes.rst:1117 +#: ../../library/ctypes.rst:1120 msgid "" "An extended example which also demonstrates the use of pointers accesses " "the :c:data:`PyImport_FrozenModules` pointer exported by Python." msgstr "" -#: ../../library/ctypes.rst:1120 +#: ../../library/ctypes.rst:1123 msgid "Quoting the docs for that value:" msgstr "" -#: ../../library/ctypes.rst:1122 +#: ../../library/ctypes.rst:1125 msgid "" "This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " @@ -1085,19 +1091,19 @@ msgid "" "frozen modules." msgstr "" -#: ../../library/ctypes.rst:1127 +#: ../../library/ctypes.rst:1130 msgid "" "So manipulating this pointer could even prove useful. To restrict the " "example size, we show only how this table can be read with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1141 +#: ../../library/ctypes.rst:1144 msgid "" "We have defined the :c:struct:`_frozen` data type, so we can get the pointer " "to the table::" msgstr "" -#: ../../library/ctypes.rst:1148 +#: ../../library/ctypes.rst:1151 msgid "" "Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, " "we can iterate over it, but we just have to make sure that our loop " @@ -1106,34 +1112,34 @@ msgid "" "the loop when we hit the ``NULL`` entry::" msgstr "" -#: ../../library/ctypes.rst:1164 +#: ../../library/ctypes.rst:1167 msgid "" "The fact that standard Python has a frozen module and a frozen package " "(indicated by the negative ``size`` member) is not well known, it is only " "used for testing. Try it out with ``import __hello__`` for example." msgstr "" -#: ../../library/ctypes.rst:1172 +#: ../../library/ctypes.rst:1175 msgid "Surprises" msgstr "" -#: ../../library/ctypes.rst:1174 +#: ../../library/ctypes.rst:1177 msgid "" "There are some edges in :mod:`ctypes` where you might expect something other " "than what actually happens." msgstr "" -#: ../../library/ctypes.rst:1177 +#: ../../library/ctypes.rst:1180 msgid "Consider the following example::" msgstr "" -#: ../../library/ctypes.rst:1197 +#: ../../library/ctypes.rst:1200 msgid "" "Hm. We certainly expected the last statement to print ``3 4 1 2``. What " "happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" msgstr "" -#: ../../library/ctypes.rst:1205 +#: ../../library/ctypes.rst:1208 msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " "buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the " @@ -1142,26 +1148,26 @@ msgid "" "have the expected effect." msgstr "" -#: ../../library/ctypes.rst:1211 +#: ../../library/ctypes.rst:1214 msgid "" "Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays " "doesn't *copy* the sub-object, instead it retrieves a wrapper object " "accessing the root-object's underlying buffer." msgstr "" -#: ../../library/ctypes.rst:1215 +#: ../../library/ctypes.rst:1218 msgid "" "Another example that may behave differently from what one would expect is " "this::" msgstr "" -#: ../../library/ctypes.rst:1227 +#: ../../library/ctypes.rst:1230 msgid "" "Objects instantiated from :class:`c_char_p` can only have their value set to " "bytes or integers." msgstr "" -#: ../../library/ctypes.rst:1230 +#: ../../library/ctypes.rst:1233 msgid "" "Why is it printing ``False``? ctypes instances are objects containing a " "memory block plus some :term:`descriptor`\\s accessing the contents of the " @@ -1170,16 +1176,16 @@ msgid "" "the contents again constructs a new Python object each time!" msgstr "" -#: ../../library/ctypes.rst:1240 +#: ../../library/ctypes.rst:1243 msgid "Variable-sized data types" msgstr "" -#: ../../library/ctypes.rst:1242 +#: ../../library/ctypes.rst:1245 msgid "" ":mod:`ctypes` provides some support for variable-sized arrays and structures." msgstr "" -#: ../../library/ctypes.rst:1244 +#: ../../library/ctypes.rst:1247 msgid "" "The :func:`resize` function can be used to resize the memory buffer of an " "existing ctypes object. The function takes the object as first argument, " @@ -1188,50 +1194,50 @@ msgid "" "objects type, a :exc:`ValueError` is raised if this is tried::" msgstr "" -#: ../../library/ctypes.rst:1264 +#: ../../library/ctypes.rst:1267 msgid "" "This is nice and fine, but how would one access the additional elements " "contained in this array? Since the type still only knows about 4 elements, " "we get errors accessing other elements::" msgstr "" -#: ../../library/ctypes.rst:1276 +#: ../../library/ctypes.rst:1279 msgid "" "Another way to use variable-sized data types with :mod:`ctypes` is to use " "the dynamic nature of Python, and (re-)define the data type after the " "required size is already known, on a case by case basis." msgstr "" -#: ../../library/ctypes.rst:1284 +#: ../../library/ctypes.rst:1287 msgid "ctypes reference" msgstr "" -#: ../../library/ctypes.rst:1290 +#: ../../library/ctypes.rst:1293 msgid "Finding shared libraries" msgstr "" -#: ../../library/ctypes.rst:1292 +#: ../../library/ctypes.rst:1295 msgid "" "When programming in a compiled language, shared libraries are accessed when " "compiling/linking a program, and when the program is run." msgstr "" -#: ../../library/ctypes.rst:1295 +#: ../../library/ctypes.rst:1298 msgid "" -"The purpose of the :func:`find_library` function is to locate a library in a " -"way similar to what the compiler or runtime loader does (on platforms with " -"several versions of a shared library the most recent should be loaded), " -"while the ctypes library loaders act like when a program is run, and call " -"the runtime loader directly." +"The purpose of the :func:`~ctypes.util.find_library` function is to locate a " +"library in a way similar to what the compiler or runtime loader does (on " +"platforms with several versions of a shared library the most recent should " +"be loaded), while the ctypes library loaders act like when a program is run, " +"and call the runtime loader directly." msgstr "" -#: ../../library/ctypes.rst:1301 +#: ../../library/ctypes.rst:1304 msgid "" -"The :mod:`ctypes.util` module provides a function which can help to " +"The :mod:`!ctypes.util` module provides a function which can help to " "determine the library to load." msgstr "" -#: ../../library/ctypes.rst:1309 +#: ../../library/ctypes.rst:1312 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like *lib*, suffix like ``.so``, ``.dylib`` or version " @@ -1239,70 +1245,72 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1314 ../../library/ctypes.rst:1973 +#: ../../library/ctypes.rst:1317 ../../library/ctypes.rst:1976 msgid "The exact functionality is system dependent." msgstr "" -#: ../../library/ctypes.rst:1316 +#: ../../library/ctypes.rst:1319 msgid "" -"On Linux, :func:`find_library` tries to run external programs (``/sbin/" -"ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library file. It " -"returns the filename of the library file." +"On Linux, :func:`~ctypes.util.find_library` tries to run external programs " +"(``/sbin/ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library " +"file. It returns the filename of the library file." msgstr "" -#: ../../library/ctypes.rst:1320 +#: ../../library/ctypes.rst:1323 msgid "" "On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used " "when searching for libraries, if a library cannot be found by any other " "means." msgstr "" -#: ../../library/ctypes.rst:1324 +#: ../../library/ctypes.rst:1327 msgid "Here are some examples::" msgstr "" "以下是一些範例:\n" "\n" "::" -#: ../../library/ctypes.rst:1335 +#: ../../library/ctypes.rst:1338 msgid "" -"On macOS, :func:`find_library` tries several predefined naming schemes and " -"paths to locate the library, and returns a full pathname if successful::" +"On macOS, :func:`~ctypes.util.find_library` tries several predefined naming " +"schemes and paths to locate the library, and returns a full pathname if " +"successful::" msgstr "" -#: ../../library/ctypes.rst:1349 +#: ../../library/ctypes.rst:1352 msgid "" -"On Windows, :func:`find_library` searches along the system search path, and " -"returns the full pathname, but since there is no predefined naming scheme a " -"call like ``find_library(\"c\")`` will fail and return ``None``." +"On Windows, :func:`~ctypes.util.find_library` searches along the system " +"search path, and returns the full pathname, but since there is no predefined " +"naming scheme a call like ``find_library(\"c\")`` will fail and return " +"``None``." msgstr "" -#: ../../library/ctypes.rst:1353 +#: ../../library/ctypes.rst:1356 msgid "" "If wrapping a shared library with :mod:`ctypes`, it *may* be better to " "determine the shared library name at development time, and hardcode that " -"into the wrapper module instead of using :func:`find_library` to locate the " -"library at runtime." +"into the wrapper module instead of using :func:`~ctypes.util.find_library` " +"to locate the library at runtime." msgstr "" -#: ../../library/ctypes.rst:1361 +#: ../../library/ctypes.rst:1364 msgid "Loading shared libraries" msgstr "" -#: ../../library/ctypes.rst:1363 +#: ../../library/ctypes.rst:1366 msgid "" "There are several ways to load shared libraries into the Python process. " "One way is to instantiate one of the following classes:" msgstr "" -#: ../../library/ctypes.rst:1369 +#: ../../library/ctypes.rst:1372 msgid "" "Instances of this class represent loaded shared libraries. Functions in " "these libraries use the standard C calling convention, and are assumed to " "return :c:expr:`int`." msgstr "" -#: ../../library/ctypes.rst:1373 +#: ../../library/ctypes.rst:1376 msgid "" "On Windows creating a :class:`CDLL` instance may fail even if the DLL name " "exists. When a dependent DLL of the loaded DLL is not found, a :exc:" @@ -1314,18 +1322,18 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1385 ../../library/ctypes.rst:1407 -#: ../../library/ctypes.rst:1418 ../../library/ctypes.rst:1435 +#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1410 +#: ../../library/ctypes.rst:1421 ../../library/ctypes.rst:1438 msgid "The *name* parameter can now be a :term:`path-like object`." msgstr "" -#: ../../library/ctypes.rst:1389 +#: ../../library/ctypes.rst:1392 msgid "" "`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." msgstr "" -#: ../../library/ctypes.rst:1395 +#: ../../library/ctypes.rst:1398 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " @@ -1335,24 +1343,24 @@ msgid "" "value signals a failure, an :class:`OSError` is automatically raised." msgstr "" -#: ../../library/ctypes.rst:1402 +#: ../../library/ctypes.rst:1405 msgid ":exc:`WindowsError` used to be raised." msgstr "" -#: ../../library/ctypes.rst:1412 +#: ../../library/ctypes.rst:1415 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " "assumed to return :c:expr:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1420 +#: ../../library/ctypes.rst:1423 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1426 +#: ../../library/ctypes.rst:1429 msgid "" "Instances of this class behave like :class:`CDLL` instances, except that the " "Python GIL is *not* released during the function call, and after the " @@ -1360,21 +1368,21 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1431 +#: ../../library/ctypes.rst:1434 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1437 +#: ../../library/ctypes.rst:1440 msgid "" "All these classes can be instantiated by calling them with at least one " "argument, the pathname of the shared library. If you have an existing " "handle to an already loaded shared library, it can be passed as the " -"``handle`` named parameter, otherwise the underlying platforms ``dlopen`` or " -"``LoadLibrary`` function is used to load the library into the process, and " -"to get a handle to it." +"``handle`` named parameter, otherwise the underlying platforms :c:func:`!" +"dlopen` or :c:func:`!LoadLibrary` function is used to load the library into " +"the process, and to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1444 +#: ../../library/ctypes.rst:1447 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " @@ -1382,7 +1390,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1449 +#: ../../library/ctypes.rst:1452 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " "allows accessing the system :data:`errno` error number in a safe way. :mod:" @@ -1392,23 +1400,23 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1456 +#: ../../library/ctypes.rst:1459 msgid "" "The function :func:`ctypes.get_errno` returns the value of the ctypes " "private copy, and the function :func:`ctypes.set_errno` changes the ctypes " "private copy to a new value and returns the former value." msgstr "" -#: ../../library/ctypes.rst:1460 +#: ../../library/ctypes.rst:1463 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " "for the Windows error code which is managed by the :func:`GetLastError` and :" -"func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` " +"func:`!SetLastError` Windows API functions; :func:`ctypes.get_last_error` " "and :func:`ctypes.set_last_error` are used to request and change the ctypes " "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1466 +#: ../../library/ctypes.rst:1469 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " @@ -1418,29 +1426,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1473 +#: ../../library/ctypes.rst:1476 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1480 +#: ../../library/ctypes.rst:1483 msgid "" "Flag to use as *mode* parameter. On platforms where this flag is not " "available, it is defined as the integer zero." msgstr "" -#: ../../library/ctypes.rst:1487 +#: ../../library/ctypes.rst:1490 msgid "" "Flag to use as *mode* parameter. On platforms where this is not available, " "it is the same as *RTLD_GLOBAL*." msgstr "" -#: ../../library/ctypes.rst:1494 +#: ../../library/ctypes.rst:1497 msgid "" "The default mode which is used to load shared libraries. On OSX 10.3, this " "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." msgstr "" -#: ../../library/ctypes.rst:1497 +#: ../../library/ctypes.rst:1500 msgid "" "Instances of these classes have no public methods. Functions exported by " "the shared library can be accessed as attributes or by index. Please note " @@ -1449,96 +1457,97 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1510 +#: ../../library/ctypes.rst:1513 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1516 +#: ../../library/ctypes.rst:1519 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1521 +#: ../../library/ctypes.rst:1524 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1523 +#: ../../library/ctypes.rst:1526 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " -"calling the :meth:`LoadLibrary` method, or by retrieving the library as " -"attribute of the loader instance." +"calling the :meth:`~LibraryLoader.LoadLibrary` method, or by retrieving the " +"library as attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1531 +#: ../../library/ctypes.rst:1534 msgid "" "Class which loads shared libraries. *dlltype* should be one of the :class:" "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" -#: ../../library/ctypes.rst:1534 +#: ../../library/ctypes.rst:1537 msgid "" -":meth:`__getattr__` has special behavior: It allows loading a shared library " -"by accessing it as attribute of a library loader instance. The result is " -"cached, so repeated attribute accesses return the same library each time." +":meth:`!__getattr__` has special behavior: It allows loading a shared " +"library by accessing it as attribute of a library loader instance. The " +"result is cached, so repeated attribute accesses return the same library " +"each time." msgstr "" -#: ../../library/ctypes.rst:1540 +#: ../../library/ctypes.rst:1543 msgid "" "Load a shared library into the process and return it. This method always " "returns a new instance of the library." msgstr "" -#: ../../library/ctypes.rst:1544 +#: ../../library/ctypes.rst:1547 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1549 +#: ../../library/ctypes.rst:1552 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1555 +#: ../../library/ctypes.rst:1558 msgid "Windows only: Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1561 +#: ../../library/ctypes.rst:1564 msgid "Windows only: Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1567 +#: ../../library/ctypes.rst:1570 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1570 +#: ../../library/ctypes.rst:1573 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1576 +#: ../../library/ctypes.rst:1579 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " "attributes. Note that all these functions are assumed to return C :c:expr:" "`int`, which is of course not always the truth, so you have to assign the " -"correct :attr:`restype` attribute to use these functions." +"correct :attr:`!restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1581 +#: ../../library/ctypes.rst:1584 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " "``name``." msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``ctypes.dlopen``。" -#: ../../library/ctypes.rst:1583 +#: ../../library/ctypes.rst:1586 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" -#: ../../library/ctypes.rst:1587 +#: ../../library/ctypes.rst:1590 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " @@ -1547,14 +1556,14 @@ msgstr "" "引發一個附帶引數 ``library``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym``。" -#: ../../library/ctypes.rst:1589 +#: ../../library/ctypes.rst:1592 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1593 +#: ../../library/ctypes.rst:1596 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " @@ -1563,18 +1572,18 @@ msgstr "" "引發一個附帶引數 ``handle``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym/handle``。" -#: ../../library/ctypes.rst:1595 +#: ../../library/ctypes.rst:1598 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" -#: ../../library/ctypes.rst:1602 +#: ../../library/ctypes.rst:1605 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1604 +#: ../../library/ctypes.rst:1607 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -1583,39 +1592,39 @@ msgid "" "library loader. They are instances of a private class:" msgstr "" -#: ../../library/ctypes.rst:1613 +#: ../../library/ctypes.rst:1616 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1615 +#: ../../library/ctypes.rst:1618 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1618 +#: ../../library/ctypes.rst:1621 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1623 +#: ../../library/ctypes.rst:1626 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1626 +#: ../../library/ctypes.rst:1629 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:expr:`int`, and the " "callable will be called with this integer, allowing further processing or " "error checking. Using this is deprecated, for more flexible post processing " -"or error checking use a ctypes data type as :attr:`restype` and assign a " +"or error checking use a ctypes data type as :attr:`!restype` and assign a " "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1635 +#: ../../library/ctypes.rst:1638 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -1624,62 +1633,62 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1641 +#: ../../library/ctypes.rst:1644 msgid "" "When a foreign function is called, each actual argument is passed to the :" -"meth:`from_param` class method of the items in the :attr:`argtypes` tuple, " -"this method allows adapting the actual argument to an object that the " +"meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " +"tuple, this method allows adapting the actual argument to an object that the " "foreign function accepts. For example, a :class:`c_char_p` item in the :" "attr:`argtypes` tuple will convert a string passed as argument into a bytes " "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1648 +#: ../../library/ctypes.rst:1651 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " -"but each item must have a :meth:`from_param` method which returns a value " -"usable as argument (integer, string, ctypes instance). This allows defining " -"adapters that can adapt custom objects as function parameters." +"but each item must have a :meth:`~_CData.from_param` method which returns a " +"value usable as argument (integer, string, ctypes instance). This allows " +"defining adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1655 +#: ../../library/ctypes.rst:1658 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" msgstr "" -#: ../../library/ctypes.rst:1662 +#: ../../library/ctypes.rst:1665 msgid "" -"*result* is what the foreign function returns, as specified by the :attr:" -"`restype` attribute." +"*result* is what the foreign function returns, as specified by the :attr:`!" +"restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1665 +#: ../../library/ctypes.rst:1668 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." msgstr "" -#: ../../library/ctypes.rst:1669 +#: ../../library/ctypes.rst:1672 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." msgstr "" -#: ../../library/ctypes.rst:1673 +#: ../../library/ctypes.rst:1676 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " "if the foreign function call failed." msgstr "" -#: ../../library/ctypes.rst:1680 +#: ../../library/ctypes.rst:1683 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1684 +#: ../../library/ctypes.rst:1687 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_exception`` with " @@ -1688,7 +1697,7 @@ msgstr "" "引發一個附帶引數 ``code`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_exception``。" -#: ../../library/ctypes.rst:1686 +#: ../../library/ctypes.rst:1689 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -1697,7 +1706,7 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1692 +#: ../../library/ctypes.rst:1695 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.call_function`` with " @@ -1706,18 +1715,18 @@ msgstr "" "引發一個附帶引數 ``func_pointer``、``arguments`` 的\\ :ref:`稽核事件 " "` ``ctypes.call_function``。" -#: ../../library/ctypes.rst:1694 +#: ../../library/ctypes.rst:1697 msgid "" "Some ways to invoke foreign function calls may raise an auditing event " "``ctypes.call_function`` with arguments ``function pointer`` and " "``arguments``." msgstr "" -#: ../../library/ctypes.rst:1700 +#: ../../library/ctypes.rst:1703 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1702 +#: ../../library/ctypes.rst:1705 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -1728,7 +1737,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1713 +#: ../../library/ctypes.rst:1716 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -1737,37 +1746,37 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1723 +#: ../../library/ctypes.rst:1726 msgid "" "Windows only: The returned function prototype creates functions that use the " "``stdcall`` calling convention. The function will release the GIL during " "the call. *use_errno* and *use_last_error* have the same meaning as above." msgstr "" -#: ../../library/ctypes.rst:1731 +#: ../../library/ctypes.rst:1734 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." msgstr "" -#: ../../library/ctypes.rst:1734 +#: ../../library/ctypes.rst:1737 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " "call:" msgstr "" -#: ../../library/ctypes.rst:1742 +#: ../../library/ctypes.rst:1745 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1749 +#: ../../library/ctypes.rst:1752 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1756 +#: ../../library/ctypes.rst:1759 msgid "" "Returns a foreign function exported by a shared library. *func_spec* must be " "a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the " @@ -1775,7 +1784,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1766 +#: ../../library/ctypes.rst:1769 msgid "" "Returns a foreign function that will call a COM method. *vtbl_index* is the " "index into the virtual function table, a small non-negative integer. *name* " @@ -1783,85 +1792,87 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1771 +#: ../../library/ctypes.rst:1774 msgid "" "COM methods use a special calling convention: They require a pointer to the " "COM interface as first argument, in addition to those parameters that are " -"specified in the :attr:`argtypes` tuple." +"specified in the :attr:`!argtypes` tuple." msgstr "" -#: ../../library/ctypes.rst:1775 +#: ../../library/ctypes.rst:1778 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: ../../library/ctypes.rst:1778 -msgid "*paramflags* must be a tuple of the same length as :attr:`argtypes`." +#: ../../library/ctypes.rst:1781 +msgid "" +"*paramflags* must be a tuple of the same length as :attr:`~_FuncPtr." +"argtypes`." msgstr "" -#: ../../library/ctypes.rst:1780 +#: ../../library/ctypes.rst:1783 msgid "" "Each item in this tuple contains further information about a parameter, it " "must be a tuple containing one, two, or three items." msgstr "" -#: ../../library/ctypes.rst:1783 +#: ../../library/ctypes.rst:1786 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1787 +#: ../../library/ctypes.rst:1790 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1787 +#: ../../library/ctypes.rst:1790 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1790 +#: ../../library/ctypes.rst:1793 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1790 +#: ../../library/ctypes.rst:1793 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1796 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1796 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1795 +#: ../../library/ctypes.rst:1798 msgid "" "The optional second item is the parameter name as string. If this is " "specified, the foreign function can be called with named parameters." msgstr "" -#: ../../library/ctypes.rst:1798 +#: ../../library/ctypes.rst:1801 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1800 +#: ../../library/ctypes.rst:1803 msgid "" "This example demonstrates how to wrap the Windows ``MessageBoxW`` function " "so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" -#: ../../library/ctypes.rst:1811 ../../library/ctypes.rst:1834 +#: ../../library/ctypes.rst:1814 ../../library/ctypes.rst:1837 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1819 +#: ../../library/ctypes.rst:1822 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1825 +#: ../../library/ctypes.rst:1828 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -1869,7 +1880,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1843 +#: ../../library/ctypes.rst:1846 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -1877,35 +1888,35 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1848 +#: ../../library/ctypes.rst:1851 msgid "" -"Output parameters can be combined with the :attr:`errcheck` protocol to do " -"further output processing and error checking. The win32 ``GetWindowRect`` " -"api function returns a ``BOOL`` to signal success or failure, so this " -"function could do the error checking, and raises an exception when the api " -"call failed::" +"Output parameters can be combined with the :attr:`~_FuncPtr.errcheck` " +"protocol to do further output processing and error checking. The win32 " +"``GetWindowRect`` api function returns a ``BOOL`` to signal success or " +"failure, so this function could do the error checking, and raises an " +"exception when the api call failed::" msgstr "" -#: ../../library/ctypes.rst:1861 +#: ../../library/ctypes.rst:1864 msgid "" -"If the :attr:`errcheck` function returns the argument tuple it receives " -"unchanged, :mod:`ctypes` continues the normal processing it does on the " -"output parameters. If you want to return a tuple of window coordinates " +"If the :attr:`~_FuncPtr.errcheck` function returns the argument tuple it " +"receives unchanged, :mod:`ctypes` continues the normal processing it does on " +"the output parameters. If you want to return a tuple of window coordinates " "instead of a ``RECT`` instance, you can retrieve the fields in the function " "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1880 +#: ../../library/ctypes.rst:1883 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1884 +#: ../../library/ctypes.rst:1887 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1887 +#: ../../library/ctypes.rst:1890 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -1913,30 +1924,30 @@ msgstr "" "引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." "addressof``。" -#: ../../library/ctypes.rst:1892 +#: ../../library/ctypes.rst:1895 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1898 +#: ../../library/ctypes.rst:1901 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " "added to the internal pointer value." msgstr "" -#: ../../library/ctypes.rst:1902 +#: ../../library/ctypes.rst:1905 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1906 +#: ../../library/ctypes.rst:1909 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." msgstr "" -#: ../../library/ctypes.rst:1912 +#: ../../library/ctypes.rst:1915 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -1944,19 +1955,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1920 +#: ../../library/ctypes.rst:1923 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1923 +#: ../../library/ctypes.rst:1926 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a bytes object which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1926 +#: ../../library/ctypes.rst:1929 msgid "" "If a bytes object is specified as first argument, the buffer is made one " "item larger than its length so that the last element in the array is a NUL " @@ -1965,7 +1976,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1931 +#: ../../library/ctypes.rst:1934 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -1973,19 +1984,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:1936 +#: ../../library/ctypes.rst:1939 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1939 +#: ../../library/ctypes.rst:1942 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a string which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1942 +#: ../../library/ctypes.rst:1945 msgid "" "If a string is specified as first argument, the buffer is made one item " "larger than the length of the string so that the last element in the array " @@ -1994,7 +2005,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1948 +#: ../../library/ctypes.rst:1951 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -2002,21 +2013,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:1953 +#: ../../library/ctypes.rst:1956 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllCanUnloadNow function " "that the _ctypes extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1960 +#: ../../library/ctypes.rst:1963 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllGetClassObject function " "that the ``_ctypes`` extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1968 +#: ../../library/ctypes.rst:1971 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -2024,94 +2035,94 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1979 +#: ../../library/ctypes.rst:1982 msgid "" "Windows only: return the filename of the VC runtime library used by Python, " "and by the extension modules. If the name of the library cannot be " "determined, ``None`` is returned." msgstr "" -#: ../../library/ctypes.rst:1983 +#: ../../library/ctypes.rst:1986 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " "function in the same library that allocated the memory." msgstr "" -#: ../../library/ctypes.rst:1990 +#: ../../library/ctypes.rst:1993 msgid "" "Windows only: Returns a textual description of the error code *code*. If no " "error code is specified, the last error code is used by calling the Windows " "api function GetLastError." msgstr "" -#: ../../library/ctypes.rst:1997 +#: ../../library/ctypes.rst:2000 msgid "" "Windows only: Returns the last error code set by Windows in the calling " "thread. This function calls the Windows ``GetLastError()`` function " "directly, it does not return the ctypes-private copy of the error code." msgstr "" -#: ../../library/ctypes.rst:2003 +#: ../../library/ctypes.rst:2006 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2006 +#: ../../library/ctypes.rst:2009 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:2010 +#: ../../library/ctypes.rst:2013 msgid "" "Windows only: returns the current value of the ctypes-private copy of the " -"system :data:`LastError` variable in the calling thread." +"system :data:`!LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2013 +#: ../../library/ctypes.rst:2016 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:2017 +#: ../../library/ctypes.rst:2020 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " "can be converted to pointers." msgstr "" -#: ../../library/ctypes.rst:2024 +#: ../../library/ctypes.rst:2027 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " "specifying an address, or a ctypes instance." msgstr "" -#: ../../library/ctypes.rst:2031 +#: ../../library/ctypes.rst:2034 msgid "" -"This factory function creates and returns a new ctypes pointer type. Pointer " -"types are cached and reused internally, so calling this function repeatedly " -"is cheap. *type* must be a ctypes type." +"Create and return a new ctypes pointer type. Pointer types are cached and " +"reused internally, so calling this function repeatedly is cheap. *type* must " +"be a ctypes type." msgstr "" -#: ../../library/ctypes.rst:2038 +#: ../../library/ctypes.rst:2041 msgid "" -"This function creates a new pointer instance, pointing to *obj*. The " -"returned object is of the type ``POINTER(type(obj))``." +"Create a new pointer instance, pointing to *obj*. The returned object is of " +"the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2041 +#: ../../library/ctypes.rst:2044 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." msgstr "" -#: ../../library/ctypes.rst:2047 +#: ../../library/ctypes.rst:2050 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -2119,13 +2130,13 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2055 +#: ../../library/ctypes.rst:2058 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." msgstr "" -#: ../../library/ctypes.rst:2058 +#: ../../library/ctypes.rst:2061 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -2133,14 +2144,14 @@ msgstr "" "引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_errno``。" -#: ../../library/ctypes.rst:2063 +#: ../../library/ctypes.rst:2066 msgid "" "Windows only: set the current value of the ctypes-private copy of the " -"system :data:`LastError` variable in the calling thread to *value* and " +"system :data:`!LastError` variable in the calling thread to *value* and " "return the previous value." msgstr "" -#: ../../library/ctypes.rst:2067 +#: ../../library/ctypes.rst:2070 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -2148,20 +2159,20 @@ msgstr "" "引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." "get_last_error``。" -#: ../../library/ctypes.rst:2072 +#: ../../library/ctypes.rst:2075 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." msgstr "" -#: ../../library/ctypes.rst:2078 +#: ../../library/ctypes.rst:2081 msgid "" "This function returns the C string starting at memory address *address* as a " "bytes object. If size is specified, it is used as size, otherwise the string " "is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2082 +#: ../../library/ctypes.rst:2085 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``address``, ``size``." @@ -2169,7 +2180,7 @@ msgstr "" "引發一個附帶引數 ``error``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.string_at``。" -#: ../../library/ctypes.rst:2087 +#: ../../library/ctypes.rst:2090 msgid "" "Windows only: this function is probably the worst-named thing in ctypes. It " "creates an instance of OSError. If *code* is not specified, " @@ -2178,11 +2189,11 @@ msgid "" "error." msgstr "" -#: ../../library/ctypes.rst:2093 +#: ../../library/ctypes.rst:2096 msgid "An instance of :exc:`WindowsError` used to be created." msgstr "" -#: ../../library/ctypes.rst:2099 +#: ../../library/ctypes.rst:2102 msgid "" "This function returns the wide character string starting at memory address " "*address* as a string. If *size* is specified, it is used as the number of " @@ -2190,7 +2201,7 @@ msgid "" "terminated." msgstr "" -#: ../../library/ctypes.rst:2104 +#: ../../library/ctypes.rst:2107 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``address``, ``size``." @@ -2198,11 +2209,11 @@ msgstr "" "引發一個附帶引數 ``address``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.wstring_at``。" -#: ../../library/ctypes.rst:2110 +#: ../../library/ctypes.rst:2113 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2115 +#: ../../library/ctypes.rst:2118 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " @@ -2212,13 +2223,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2122 +#: ../../library/ctypes.rst:2125 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -#: ../../library/ctypes.rst:2127 +#: ../../library/ctypes.rst:2130 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -2227,7 +2238,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2133 ../../library/ctypes.rst:2143 +#: ../../library/ctypes.rst:2136 ../../library/ctypes.rst:2146 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -2235,7 +2246,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2137 +#: ../../library/ctypes.rst:2140 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -2243,13 +2254,13 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2147 +#: ../../library/ctypes.rst:2150 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2150 +#: ../../library/ctypes.rst:2153 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " "``address``." @@ -2257,39 +2268,39 @@ msgstr "" "引發一個附帶引數 ``address`` 的\\ :ref:`稽核事件 ` ``ctypes." "cdata``。" -#: ../../library/ctypes.rst:2152 +#: ../../library/ctypes.rst:2155 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2158 +#: ../../library/ctypes.rst:2161 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " -"foreign function's :attr:`argtypes` tuple; it must return an object that can " -"be used as a function call parameter." +"foreign function's :attr:`~_FuncPtr.argtypes` tuple; it must return an " +"object that can be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2163 +#: ../../library/ctypes.rst:2166 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " "accept other objects as well." msgstr "" -#: ../../library/ctypes.rst:2169 +#: ../../library/ctypes.rst:2172 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " "loaded shared library." msgstr "" -#: ../../library/ctypes.rst:2173 +#: ../../library/ctypes.rst:2176 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2177 +#: ../../library/ctypes.rst:2180 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " "instead they share part of the memory block of a base object. The :attr:" @@ -2297,13 +2308,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2184 +#: ../../library/ctypes.rst:2187 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2189 +#: ../../library/ctypes.rst:2192 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -2311,7 +2322,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2202 +#: ../../library/ctypes.rst:2205 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -2320,11 +2331,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2208 +#: ../../library/ctypes.rst:2211 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2212 +#: ../../library/ctypes.rst:2215 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -2332,7 +2343,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2217 +#: ../../library/ctypes.rst:2220 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -2340,42 +2351,43 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2223 +#: ../../library/ctypes.rst:2226 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " "transparently converted to native Python types. In other words, if a " -"foreign function has a :attr:`restype` of :class:`c_char_p`, you will always " -"receive a Python bytes object, *not* a :class:`c_char_p` instance." +"foreign function has a :attr:`~_FuncPtr.restype` of :class:`c_char_p`, you " +"will always receive a Python bytes object, *not* a :class:`c_char_p` " +"instance." msgstr "" -#: ../../library/ctypes.rst:2231 +#: ../../library/ctypes.rst:2234 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " -"a foreign functions :attr:`restype` is a subclass of :class:`c_void_p`, you " +"a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " "will receive an instance of this subclass from the function call. Of course, " "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2236 +#: ../../library/ctypes.rst:2239 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2240 +#: ../../library/ctypes.rst:2243 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2247 +#: ../../library/ctypes.rst:2250 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2254 +#: ../../library/ctypes.rst:2257 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -2383,224 +2395,224 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2262 +#: ../../library/ctypes.rst:2265 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2268 +#: ../../library/ctypes.rst:2271 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2274 +#: ../../library/ctypes.rst:2277 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2280 +#: ../../library/ctypes.rst:2283 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2287 +#: ../../library/ctypes.rst:2290 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2293 +#: ../../library/ctypes.rst:2296 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2299 +#: ../../library/ctypes.rst:2302 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2305 +#: ../../library/ctypes.rst:2308 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2311 +#: ../../library/ctypes.rst:2314 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2317 +#: ../../library/ctypes.rst:2320 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2323 +#: ../../library/ctypes.rst:2326 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2329 +#: ../../library/ctypes.rst:2332 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2334 +#: ../../library/ctypes.rst:2337 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2341 +#: ../../library/ctypes.rst:2344 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2348 +#: ../../library/ctypes.rst:2351 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2355 +#: ../../library/ctypes.rst:2358 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2362 +#: ../../library/ctypes.rst:2365 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2368 +#: ../../library/ctypes.rst:2371 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2374 +#: ../../library/ctypes.rst:2377 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2380 +#: ../../library/ctypes.rst:2383 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2386 +#: ../../library/ctypes.rst:2389 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2392 +#: ../../library/ctypes.rst:2395 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2398 +#: ../../library/ctypes.rst:2401 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2404 +#: ../../library/ctypes.rst:2407 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2410 +#: ../../library/ctypes.rst:2413 msgid "" "Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2417 +#: ../../library/ctypes.rst:2420 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2424 +#: ../../library/ctypes.rst:2427 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2431 +#: ../../library/ctypes.rst:2434 msgid "" -"Windows only: Represents a :c:type:`HRESULT` value, which contains success " +"Windows only: Represents a :c:type:`!HRESULT` value, which contains success " "or error information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2437 +#: ../../library/ctypes.rst:2440 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2440 +#: ../../library/ctypes.rst:2443 msgid "" -"The :mod:`ctypes.wintypes` module provides quite some other Windows specific " -"data types, for example :c:type:`HWND`, :c:type:`WPARAM`, or :c:type:" -"`DWORD`. Some useful structures like :c:type:`MSG` or :c:type:`RECT` are " -"also defined." +"The :mod:`!ctypes.wintypes` module provides quite some other Windows " +"specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" +"type:`!DWORD`. Some useful structures like :c:type:`!MSG` or :c:type:`!RECT` " +"are also defined." msgstr "" -#: ../../library/ctypes.rst:2448 +#: ../../library/ctypes.rst:2451 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2453 +#: ../../library/ctypes.rst:2456 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2458 +#: ../../library/ctypes.rst:2461 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2464 +#: ../../library/ctypes.rst:2467 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2470 +#: ../../library/ctypes.rst:2473 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2475 +#: ../../library/ctypes.rst:2478 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2477 +#: ../../library/ctypes.rst:2480 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2483 +#: ../../library/ctypes.rst:2486 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2485 +#: ../../library/ctypes.rst:2488 msgid "" "Concrete structure and union types must be created by subclassing one of " "these types, and at least define a :attr:`_fields_` class variable. :mod:" @@ -2608,34 +2620,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2493 +#: ../../library/ctypes.rst:2496 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " "the type of the field; it can be any ctypes data type." msgstr "" -#: ../../library/ctypes.rst:2497 +#: ../../library/ctypes.rst:2500 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " "field." msgstr "" -#: ../../library/ctypes.rst:2501 +#: ../../library/ctypes.rst:2504 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." msgstr "" -#: ../../library/ctypes.rst:2504 +#: ../../library/ctypes.rst:2507 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " "data types that directly or indirectly reference themselves::" msgstr "" -#: ../../library/ctypes.rst:2514 +#: ../../library/ctypes.rst:2517 msgid "" "The :attr:`_fields_` class variable must, however, be defined before the " "type is first used (an instance is created, :func:`sizeof` is called on it, " @@ -2643,14 +2655,14 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2519 +#: ../../library/ctypes.rst:2522 msgid "" "It is possible to define sub-subclasses of structure types, they inherit the " "fields of the base class plus the :attr:`_fields_` defined in the sub-" "subclass, if any." msgstr "" -#: ../../library/ctypes.rst:2526 +#: ../../library/ctypes.rst:2529 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" @@ -2658,14 +2670,14 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2534 +#: ../../library/ctypes.rst:2537 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2538 +#: ../../library/ctypes.rst:2541 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -2673,11 +2685,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2543 +#: ../../library/ctypes.rst:2546 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2556 +#: ../../library/ctypes.rst:2559 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -2687,7 +2699,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2568 +#: ../../library/ctypes.rst:2571 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -2695,7 +2707,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2573 +#: ../../library/ctypes.rst:2576 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -2705,15 +2717,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2584 +#: ../../library/ctypes.rst:2587 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2588 +#: ../../library/ctypes.rst:2591 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2590 +#: ../../library/ctypes.rst:2593 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -2723,34 +2735,34 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2600 +#: ../../library/ctypes.rst:2603 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:2607 +#: ../../library/ctypes.rst:2610 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2610 +#: ../../library/ctypes.rst:2613 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2616 +#: ../../library/ctypes.rst:2619 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2618 +#: ../../library/ctypes.rst:2621 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:2622 +#: ../../library/ctypes.rst:2625 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -2759,11 +2771,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2632 +#: ../../library/ctypes.rst:2635 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2636 +#: ../../library/ctypes.rst:2639 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/datetime.po b/library/datetime.po index 3f4ecc4e75..ae93d210f7 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -2966,7 +2966,7 @@ msgstr "\\(8), \\(9)" #: ../../library/datetime.rst:2459 ../../library/datetime.rst:2580 msgid "``%:z``" -msgstr "" +msgstr "``%:z``" #: ../../library/datetime.rst:2459 msgid "" diff --git a/library/dis.po b/library/dis.po index 73254c868c..a3c151150f 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-07-31 00:03+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -556,9 +556,9 @@ msgstr "" #: ../../library/dis.rst:546 ../../library/dis.rst:554 #: ../../library/dis.rst:566 ../../library/dis.rst:654 #: ../../library/dis.rst:664 ../../library/dis.rst:674 -#: ../../library/dis.rst:893 ../../library/dis.rst:903 -#: ../../library/dis.rst:1002 ../../library/dis.rst:1014 -#: ../../library/dis.rst:1026 +#: ../../library/dis.rst:894 ../../library/dis.rst:904 +#: ../../library/dis.rst:1003 ../../library/dis.rst:1015 +#: ../../library/dis.rst:1027 msgid "Implements::" msgstr "" @@ -797,7 +797,7 @@ msgid "" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:846 ../../library/dis.rst:1464 +#: ../../library/dis.rst:846 ../../library/dis.rst:1465 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." @@ -819,10 +819,10 @@ msgstr "" #: ../../library/dis.rst:866 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " -"stack right-to-left::" +"stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:874 +#: ../../library/dis.rst:875 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -830,11 +830,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:879 +#: ../../library/dis.rst:880 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:881 +#: ../../library/dis.rst:882 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 " @@ -843,46 +843,46 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:887 +#: ../../library/dis.rst:888 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:899 +#: ../../library/dis.rst:900 msgid "where *namei* is the index of name in :attr:`co_names`." msgstr "" -#: ../../library/dis.rst:908 +#: ../../library/dis.rst:909 msgid "where *namei* is the index of name into :attr:`co_names`." msgstr "" -#: ../../library/dis.rst:913 +#: ../../library/dis.rst:914 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:918 +#: ../../library/dis.rst:919 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:923 +#: ../../library/dis.rst:924 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:928 +#: ../../library/dis.rst:929 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:934 +#: ../../library/dis.rst:935 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:943 +#: ../../library/dis.rst:944 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -891,69 +891,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:954 +#: ../../library/dis.rst:955 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:964 +#: ../../library/dis.rst:965 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:969 +#: ../../library/dis.rst:970 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:974 +#: ../../library/dis.rst:975 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:978 +#: ../../library/dis.rst:979 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:985 +#: ../../library/dis.rst:986 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:994 +#: ../../library/dis.rst:995 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1007 +#: ../../library/dis.rst:1008 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1019 +#: ../../library/dis.rst:1020 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1031 +#: ../../library/dis.rst:1032 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1038 +#: ../../library/dis.rst:1039 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1045 +#: ../../library/dis.rst:1046 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:1048 +#: ../../library/dis.rst:1049 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -964,13 +964,13 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1056 +#: ../../library/dis.rst:1057 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:1063 +#: ../../library/dis.rst:1064 msgid "" "This opcode implements :func:`super` (e.g. ``super().method()`` and " "``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " @@ -980,33 +980,33 @@ msgid "" "class within which the current method was defined), and the global ``super``." msgstr "" -#: ../../library/dis.rst:1070 +#: ../../library/dis.rst:1071 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`." msgstr "" -#: ../../library/dis.rst:1073 +#: ../../library/dis.rst:1074 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:1081 +#: ../../library/dis.rst:1082 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1087 +#: ../../library/dis.rst:1088 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1094 +#: ../../library/dis.rst:1095 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1101 +#: ../../library/dis.rst:1102 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1015,68 +1015,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1109 +#: ../../library/dis.rst:1110 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:1116 +#: ../../library/dis.rst:1117 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1121 +#: ../../library/dis.rst:1122 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1128 +#: ../../library/dis.rst:1129 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1135 +#: ../../library/dis.rst:1136 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1138 ../../library/dis.rst:1151 +#: ../../library/dis.rst:1139 ../../library/dis.rst:1152 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:1143 ../../library/dis.rst:1156 -#: ../../library/dis.rst:1169 ../../library/dis.rst:1183 +#: ../../library/dis.rst:1144 ../../library/dis.rst:1157 +#: ../../library/dis.rst:1170 ../../library/dis.rst:1184 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1148 +#: ../../library/dis.rst:1149 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1161 +#: ../../library/dis.rst:1162 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1164 ../../library/dis.rst:1178 +#: ../../library/dis.rst:1165 ../../library/dis.rst:1179 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1175 +#: ../../library/dis.rst:1176 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1188 +#: ../../library/dis.rst:1189 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1084,83 +1084,83 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1193 +#: ../../library/dis.rst:1194 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1198 +#: ../../library/dis.rst:1199 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1200 +#: ../../library/dis.rst:1201 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:1206 +#: ../../library/dis.rst:1207 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1208 +#: ../../library/dis.rst:1209 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:1214 +#: ../../library/dis.rst:1215 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:1222 +#: ../../library/dis.rst:1223 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:1230 +#: ../../library/dis.rst:1231 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1235 +#: ../../library/dis.rst:1236 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1240 +#: ../../library/dis.rst:1241 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:1248 +#: ../../library/dis.rst:1249 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:1251 +#: ../../library/dis.rst:1252 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:1254 ../../library/dis.rst:1263 -#: ../../library/dis.rst:1285 ../../library/dis.rst:1296 +#: ../../library/dis.rst:1255 ../../library/dis.rst:1264 +#: ../../library/dis.rst:1286 ../../library/dis.rst:1297 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1260 +#: ../../library/dis.rst:1261 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:1269 +#: ../../library/dis.rst:1270 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1170,94 +1170,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1282 +#: ../../library/dis.rst:1283 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1291 +#: ../../library/dis.rst:1292 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1302 +#: ../../library/dis.rst:1303 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:1311 +#: ../../library/dis.rst:1312 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1314 +#: ../../library/dis.rst:1315 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1315 +#: ../../library/dis.rst:1316 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1316 +#: ../../library/dis.rst:1317 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:1322 +#: ../../library/dis.rst:1323 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:1327 +#: ../../library/dis.rst:1328 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1328 ../../library/dis.rst:1334 +#: ../../library/dis.rst:1329 ../../library/dis.rst:1335 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1329 +#: ../../library/dis.rst:1330 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1330 ../../library/dis.rst:1337 +#: ../../library/dis.rst:1331 ../../library/dis.rst:1338 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1332 +#: ../../library/dis.rst:1333 msgid "or:" -msgstr "" +msgstr "或:" -#: ../../library/dis.rst:1335 +#: ../../library/dis.rst:1336 msgid "``self``" -msgstr "" +msgstr "``self``" -#: ../../library/dis.rst:1336 +#: ../../library/dis.rst:1337 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1339 +#: ../../library/dis.rst:1340 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1342 +#: ../../library/dis.rst:1343 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:1351 +#: ../../library/dis.rst:1352 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1269,70 +1269,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1366 +#: ../../library/dis.rst:1367 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:1375 +#: ../../library/dis.rst:1376 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:1384 +#: ../../library/dis.rst:1385 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:1387 +#: ../../library/dis.rst:1388 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1389 +#: ../../library/dis.rst:1390 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1390 +#: ../../library/dis.rst:1391 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1391 +#: ../../library/dis.rst:1392 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1392 +#: ../../library/dis.rst:1393 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1394 +#: ../../library/dis.rst:1395 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1397 +#: ../../library/dis.rst:1398 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1405 +#: ../../library/dis.rst:1406 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1411 +#: ../../library/dis.rst:1412 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1418 +#: ../../library/dis.rst:1419 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1423 +#: ../../library/dis.rst:1424 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1340,54 +1340,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1431 +#: ../../library/dis.rst:1432 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:1435 +#: ../../library/dis.rst:1436 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1436 +#: ../../library/dis.rst:1437 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1438 +#: ../../library/dis.rst:1439 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1440 +#: ../../library/dis.rst:1441 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1442 +#: ../../library/dis.rst:1443 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1445 +#: ../../library/dis.rst:1446 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1453 +#: ../../library/dis.rst:1454 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:1457 +#: ../../library/dis.rst:1458 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1395,258 +1395,258 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1471 +#: ../../library/dis.rst:1472 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1473 +#: ../../library/dis.rst:1474 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1475 +#: ../../library/dis.rst:1476 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1477 +#: ../../library/dis.rst:1478 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1479 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1479 +#: ../../library/dis.rst:1480 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1486 +#: ../../library/dis.rst:1487 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:1495 +#: ../../library/dis.rst:1496 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1498 +#: ../../library/dis.rst:1499 msgid "" "If the call raises :exc:`StopIteration`, pop both items, push the " "exception's ``value`` attribute, and increment the bytecode counter by " "*delta*." msgstr "" -#: ../../library/dis.rst:1507 +#: ../../library/dis.rst:1508 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:1511 +#: ../../library/dis.rst:1512 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1514 +#: ../../library/dis.rst:1515 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:1518 +#: ../../library/dis.rst:1519 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:1526 +#: ../../library/dis.rst:1527 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1530 ../../library/dis.rst:1580 +#: ../../library/dis.rst:1531 ../../library/dis.rst:1581 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 +#: ../../library/dis.rst:1534 ../../library/dis.rst:1584 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 +#: ../../library/dis.rst:1534 ../../library/dis.rst:1584 msgid "Description" msgstr "" -#: ../../library/dis.rst:1535 +#: ../../library/dis.rst:1536 msgid "``INTRINSIC_1_INVALID``" -msgstr "" +msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1535 ../../library/dis.rst:1585 +#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1537 +#: ../../library/dis.rst:1538 msgid "``INTRINSIC_PRINT``" -msgstr "" +msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1537 +#: ../../library/dis.rst:1538 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1540 +#: ../../library/dis.rst:1541 msgid "``INTRINSIC_IMPORT_STAR``" -msgstr "" +msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1540 +#: ../../library/dis.rst:1541 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1544 msgid "``INTRINSIC_STOPITERATION_ERROR``" -msgstr "" +msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1544 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1547 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" -msgstr "" +msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1547 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1548 +#: ../../library/dis.rst:1549 msgid "``INTRINSIC_UNARY_POSITIVE``" -msgstr "" +msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1548 +#: ../../library/dis.rst:1549 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1552 msgid "``INTRINSIC_LIST_TO_TUPLE``" -msgstr "" +msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1552 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1553 +#: ../../library/dis.rst:1554 msgid "``INTRINSIC_TYPEVAR``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1553 +#: ../../library/dis.rst:1554 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1555 +#: ../../library/dis.rst:1556 msgid "``INTRINSIC_PARAMSPEC``" -msgstr "" +msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1555 +#: ../../library/dis.rst:1556 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1559 msgid "``INTRINSIC_TYPEVARTUPLE``" -msgstr "" +msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1559 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1562 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" -msgstr "" +msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1562 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1564 +#: ../../library/dis.rst:1565 msgid "``INTRINSIC_TYPEALIAS``" -msgstr "" +msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1564 +#: ../../library/dis.rst:1565 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:1576 +#: ../../library/dis.rst:1577 msgid "" "Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " "``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " "implement functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1585 +#: ../../library/dis.rst:1586 msgid "``INTRINSIC_2_INVALID``" -msgstr "" +msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1587 +#: ../../library/dis.rst:1588 msgid "``INTRINSIC_PREP_RERAISE_STAR``" -msgstr "" +msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1587 +#: ../../library/dis.rst:1588 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1591 +#: ../../library/dis.rst:1592 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1591 +#: ../../library/dis.rst:1592 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1595 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -msgstr "" +msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1595 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1598 +#: ../../library/dis.rst:1599 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -msgstr "" +msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1598 +#: ../../library/dis.rst:1599 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1605 +#: ../../library/dis.rst:1606 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1607 +#: ../../library/dis.rst:1608 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:1612 +#: ../../library/dis.rst:1613 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:1619 +#: ../../library/dis.rst:1620 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1655,75 +1655,75 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1628 +#: ../../library/dis.rst:1629 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:1632 +#: ../../library/dis.rst:1633 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:1639 +#: ../../library/dis.rst:1640 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1645 +#: ../../library/dis.rst:1646 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1650 +#: ../../library/dis.rst:1651 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1657 +#: ../../library/dis.rst:1658 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1659 +#: ../../library/dis.rst:1660 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1662 +#: ../../library/dis.rst:1663 msgid "" "The collections now contain pseudo instructions as well. These are opcodes " "with values ``>= MIN_PSEUDO_OPCODE``." msgstr "" -#: ../../library/dis.rst:1668 +#: ../../library/dis.rst:1669 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1673 +#: ../../library/dis.rst:1674 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1678 +#: ../../library/dis.rst:1679 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1683 +#: ../../library/dis.rst:1684 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1690 +#: ../../library/dis.rst:1691 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1695 +#: ../../library/dis.rst:1696 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1731,34 +1731,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1703 +#: ../../library/dis.rst:1704 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1708 +#: ../../library/dis.rst:1709 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1713 +#: ../../library/dis.rst:1714 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1718 +#: ../../library/dis.rst:1719 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1723 +#: ../../library/dis.rst:1724 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1727 +#: ../../library/dis.rst:1728 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1403 +#: ../../library/dis.rst:1404 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1403 +#: ../../library/dis.rst:1404 msgid "slice" msgstr "slice(切片)" diff --git a/library/enum.po b/library/enum.po index e045611996..3c8abf841a 100644 --- a/library/enum.po +++ b/library/enum.po @@ -531,7 +531,7 @@ msgstr "" #: ../../library/enum.rst:399 msgid "Added :ref:`enum-dataclass-support`" -msgstr "" +msgstr "新增 :ref:`enum-dataclass-support`" #: ../../library/enum.rst:404 msgid "" diff --git a/library/functions.po b/library/functions.po index 855f6a80f4..e26b4be9d6 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-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-07 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-" @@ -48,14 +48,14 @@ msgstr ":func:`aiter`" msgid ":func:`all`" msgstr ":func:`all`" -#: ../../library/functions.rst:0 -msgid ":func:`any`" -msgstr ":func:`any`" - #: ../../library/functions.rst:0 msgid ":func:`anext`" msgstr ":func:`anext`" +#: ../../library/functions.rst:0 +msgid ":func:`any`" +msgstr ":func:`any`" + #: ../../library/functions.rst:0 msgid ":func:`ascii`" msgstr ":func:`ascii`" diff --git a/library/functools.po b/library/functools.po index 83a9ae983a..3286029405 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-20 15:45+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-" @@ -53,7 +53,7 @@ msgid "" "`lru_cache()` with a size limit." msgstr "" -#: ../../library/functools.rst:39 ../../library/functools.rst:290 +#: ../../library/functools.rst:39 ../../library/functools.rst:291 msgid "For example::" msgstr "" "舉例來說:\n" @@ -83,7 +83,7 @@ msgid "" msgstr "" #: ../../library/functools.rst:70 ../../library/functools.rst:142 -#: ../../library/functools.rst:382 +#: ../../library/functools.rst:383 msgid "Example::" msgstr "" "範例:\n" @@ -288,47 +288,48 @@ msgid "" "In general, the LRU cache should only be used when you want to reuse " "previously computed values. Accordingly, it doesn't make sense to cache " "functions with side-effects, functions that need to create distinct mutable " -"objects on each call, or impure functions such as time() or random()." +"objects on each call (such as generators and async functions), or impure " +"functions such as time() or random()." msgstr "" -#: ../../library/functools.rst:232 +#: ../../library/functools.rst:233 msgid "Example of an LRU cache for static web content::" msgstr "" -#: ../../library/functools.rst:251 +#: ../../library/functools.rst:252 msgid "" "Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " "programming `_ technique::" msgstr "" -#: ../../library/functools.rst:271 +#: ../../library/functools.rst:272 msgid "Added the *typed* option." msgstr "新增 *typed* 選項。" -#: ../../library/functools.rst:274 +#: ../../library/functools.rst:275 msgid "Added the *user_function* option." msgstr "新增 *user_function* 選項。" -#: ../../library/functools.rst:277 +#: ../../library/functools.rst:278 msgid "Added the function :func:`cache_parameters`" msgstr "新增 :func:`cache_parameters` 函式。" -#: ../../library/functools.rst:282 +#: ../../library/functools.rst:283 msgid "" "Given a class defining one or more rich comparison ordering methods, this " "class decorator supplies the rest. This simplifies the effort involved in " "specifying all of the possible rich comparison operations:" msgstr "" -#: ../../library/functools.rst:286 +#: ../../library/functools.rst:287 msgid "" "The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, " "or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` " "method." msgstr "" -#: ../../library/functools.rst:310 +#: ../../library/functools.rst:311 msgid "" "While this decorator makes it easy to create well behaved totally ordered " "types, it *does* come at the cost of slower execution and more complex stack " @@ -337,7 +338,7 @@ msgid "" "rich comparison methods instead is likely to provide an easy speed boost." msgstr "" -#: ../../library/functools.rst:319 +#: ../../library/functools.rst:320 msgid "" "This decorator makes no attempt to override methods that have been declared " "in the class *or its superclasses*. Meaning that if a superclass defines a " @@ -345,13 +346,13 @@ msgid "" "the original method is abstract." msgstr "" -#: ../../library/functools.rst:326 +#: ../../library/functools.rst:327 msgid "" "Returning NotImplemented from the underlying comparison function for " "unrecognised types is now supported." msgstr "" -#: ../../library/functools.rst:332 +#: ../../library/functools.rst:333 msgid "" "Return a new :ref:`partial object` which when called will " "behave like *func* called with the positional arguments *args* and keyword " @@ -360,7 +361,7 @@ msgid "" "extend and override *keywords*. Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:348 +#: ../../library/functools.rst:349 msgid "" "The :func:`partial` is used for partial function application which " "\"freezes\" some portion of a function's arguments and/or keywords resulting " @@ -369,20 +370,20 @@ msgid "" "where the *base* argument defaults to two:" msgstr "" -#: ../../library/functools.rst:363 +#: ../../library/functools.rst:364 msgid "" "Return a new :class:`partialmethod` descriptor which behaves like :class:" "`partial` except that it is designed to be used as a method definition " "rather than being directly callable." msgstr "" -#: ../../library/functools.rst:367 +#: ../../library/functools.rst:368 msgid "" "*func* must be a :term:`descriptor` or a callable (objects which are both, " "like normal functions, are handled as descriptors)." msgstr "" -#: ../../library/functools.rst:370 +#: ../../library/functools.rst:371 msgid "" "When *func* is a descriptor (such as a normal Python function, :func:" "`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another " @@ -391,7 +392,7 @@ msgid "" "objects>` returned as the result." msgstr "" -#: ../../library/functools.rst:376 +#: ../../library/functools.rst:377 msgid "" "When *func* is a non-descriptor callable, an appropriate bound method is " "created dynamically. This behaves like a normal Python function when used as " @@ -400,7 +401,7 @@ msgid "" "`partialmethod` constructor." msgstr "" -#: ../../library/functools.rst:407 +#: ../../library/functools.rst:408 msgid "" "Apply *function* of two arguments cumulatively to the items of *iterable*, " "from left to right, so as to reduce the iterable to a single value. For " @@ -413,30 +414,30 @@ msgid "" "the first item is returned." msgstr "" -#: ../../library/functools.rst:416 +#: ../../library/functools.rst:417 msgid "Roughly equivalent to::" msgstr "" -#: ../../library/functools.rst:428 +#: ../../library/functools.rst:429 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " "intermediate values." msgstr "" -#: ../../library/functools.rst:433 +#: ../../library/functools.rst:434 msgid "" "Transform a function into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:436 +#: ../../library/functools.rst:437 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " "decorator. When defining a function using ``@singledispatch``, note that the " "dispatch happens on the type of the first argument::" msgstr "" -#: ../../library/functools.rst:447 +#: ../../library/functools.rst:448 msgid "" "To add overloaded implementations to the function, use the :func:`register` " "attribute of the generic function, which can be used as a decorator. For " @@ -444,36 +445,36 @@ msgid "" "first argument automatically::" msgstr "" -#: ../../library/functools.rst:465 +#: ../../library/functools.rst:466 msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::" msgstr "" -#: ../../library/functools.rst:482 +#: ../../library/functools.rst:483 msgid "" "For code which doesn't use type annotations, the appropriate type argument " "can be passed explicitly to the decorator itself::" msgstr "" -#: ../../library/functools.rst:493 +#: ../../library/functools.rst:494 msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " "the :func:`register` attribute can also be used in a functional form::" msgstr "" -#: ../../library/functools.rst:501 +#: ../../library/functools.rst:502 msgid "" "The :func:`register` attribute returns the undecorated function. This " "enables decorator stacking, :mod:`pickling`, and the creation of " "unit tests for each variant independently::" msgstr "" -#: ../../library/functools.rst:515 +#: ../../library/functools.rst:516 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "" -#: ../../library/functools.rst:535 +#: ../../library/functools.rst:536 msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " @@ -482,42 +483,42 @@ msgid "" "found." msgstr "" -#: ../../library/functools.rst:541 +#: ../../library/functools.rst:542 msgid "" "If an implementation is registered to an :term:`abstract base class`, " "virtual subclasses of the base class will be dispatched to that " "implementation::" msgstr "" -#: ../../library/functools.rst:556 +#: ../../library/functools.rst:557 msgid "" "To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" -#: ../../library/functools.rst:564 +#: ../../library/functools.rst:565 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "" -#: ../../library/functools.rst:578 +#: ../../library/functools.rst:579 msgid "The :func:`register` attribute now supports using type annotations." msgstr "" -#: ../../library/functools.rst:581 +#: ../../library/functools.rst:582 msgid "" "The :func:`register` attribute now supports :data:`types.UnionType` and :" "data:`typing.Union` as type annotations." msgstr "" -#: ../../library/functools.rst:588 +#: ../../library/functools.rst:589 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:591 +#: ../../library/functools.rst:592 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. When defining a function using ``@singledispatchmethod``, note " @@ -525,7 +526,7 @@ msgid "" "argument::" msgstr "" -#: ../../library/functools.rst:609 +#: ../../library/functools.rst:610 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" "func:`@classmethod`. Note that to allow for ``dispatcher." @@ -534,14 +535,14 @@ msgid "" "rather than an instance of the class::" msgstr "" -#: ../../library/functools.rst:631 +#: ../../library/functools.rst:632 msgid "" "The same pattern can be used for other similar decorators: :func:" "`@staticmethod`, :func:`@abstractmethod`, " "and others." msgstr "" -#: ../../library/functools.rst:640 +#: ../../library/functools.rst:641 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -555,7 +556,7 @@ msgid "" "``__dict__``, i.e. the instance dictionary)." msgstr "" -#: ../../library/functools.rst:650 +#: ../../library/functools.rst:651 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -563,7 +564,7 @@ msgid "" "that refers to the function being wrapped." msgstr "" -#: ../../library/functools.rst:655 +#: ../../library/functools.rst:656 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -572,7 +573,7 @@ msgid "" "is typically less than helpful." msgstr "" -#: ../../library/functools.rst:661 +#: ../../library/functools.rst:662 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -581,26 +582,26 @@ msgid "" "wrapper function itself is missing any attributes named in *updated*." msgstr "" -#: ../../library/functools.rst:667 +#: ../../library/functools.rst:668 msgid "Automatic addition of the ``__wrapped__`` attribute." msgstr "" -#: ../../library/functools.rst:670 +#: ../../library/functools.rst:671 msgid "Copying of the ``__annotations__`` attribute by default." msgstr "" -#: ../../library/functools.rst:673 +#: ../../library/functools.rst:674 msgid "Missing attributes no longer trigger an :exc:`AttributeError`." msgstr "" -#: ../../library/functools.rst:676 +#: ../../library/functools.rst:677 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -#: ../../library/functools.rst:684 +#: ../../library/functools.rst:685 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -608,42 +609,42 @@ msgid "" "updated=updated)``. For example::" msgstr "" -#: ../../library/functools.rst:710 +#: ../../library/functools.rst:711 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" "`example` would have been lost." msgstr "" -#: ../../library/functools.rst:718 +#: ../../library/functools.rst:719 msgid ":class:`partial` Objects" msgstr ":class:`partial` 物件" -#: ../../library/functools.rst:720 +#: ../../library/functools.rst:721 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" msgstr "" -#: ../../library/functools.rst:726 +#: ../../library/functools.rst:727 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." msgstr "" -#: ../../library/functools.rst:732 +#: ../../library/functools.rst:733 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." msgstr "" -#: ../../library/functools.rst:738 +#: ../../library/functools.rst:739 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" -#: ../../library/functools.rst:741 +#: ../../library/functools.rst:742 msgid "" ":class:`partial` objects are like :class:`function` objects in that they are " "callable, weak referencable, and can have attributes. There are some " diff --git a/library/gzip.po b/library/gzip.po index 21cfdbb063..703b7bda25 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -103,7 +103,7 @@ msgstr "" #: ../../library/gzip.rst:56 msgid "Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes." -msgstr "" +msgstr "新增 ``'x'``、``'xb'`` 和 ``'xt'`` 模式的支援。" #: ../../library/gzip.rst:59 ../../library/gzip.rst:171 msgid "Accepts a :term:`path-like object`." @@ -247,7 +247,7 @@ msgstr "" #: ../../library/gzip.rst:162 msgid "Added support for the ``'x'`` and ``'xb'`` modes." -msgstr "" +msgstr "新增 ``'x'`` 和 ``'xb'`` 模式的支援。" #: ../../library/gzip.rst:165 msgid "" diff --git a/library/io.po b/library/io.po index 738c69063a..c203f3ad5a 100644 --- a/library/io.po +++ b/library/io.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-18 18:13+0000\n" "PO-Revision-Date: 2023-08-01 12:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -60,14 +60,14 @@ msgstr "" #: ../../library/io.rst:40 msgid "" "All streams are careful about the type of data you give to them. For " -"example giving a :class:`str` object to the ``write()`` method of a binary " -"stream will raise a :exc:`TypeError`. So will giving a :class:`bytes` " -"object to the ``write()`` method of a text stream." +"example giving a :class:`str` object to the :meth:`!write` method of a " +"binary stream will raise a :exc:`TypeError`. So will giving a :class:" +"`bytes` object to the :meth:`!write` method of a text stream." msgstr "" "所有的資料串流都會謹慎處理你所提供的資料的型別。舉例來說,提供一個 :class:" -"`str` 物件給二進位資料串流的 ``write()`` 方法將會引發 :exc:`TypeError`。同樣" -"地,若提供一個 :class:`bytes` 物件給文字資料串流的 ``write()`` 方法,也會引發" -"同樣的錯誤。" +"`str` 物件給二進位資料串流的 :meth:`!write` 方法將會引發 :exc:`TypeError`。同" +"樣地,若提供一個 :class:`bytes` 物件給文字資料串流的 :meth:`!write` 方法,也" +"會引發同樣的錯誤。" #: ../../library/io.rst:45 msgid "" @@ -77,7 +77,7 @@ msgstr "" "原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :exc:" "`IOError` 現在是 :exc:`OSError` 的別名。" -#: ../../library/io.rst:51 ../../library/io.rst:855 ../../library/io.rst:1122 +#: ../../library/io.rst:51 ../../library/io.rst:856 ../../library/io.rst:1123 msgid "Text I/O" msgstr "文字 I/O" @@ -115,7 +115,7 @@ msgid "" "`TextIOBase`." msgstr "文字資料串流 API 的詳細說明在 :class:`TextIOBase` 文件當中。" -#: ../../library/io.rst:72 ../../library/io.rst:1110 +#: ../../library/io.rst:72 ../../library/io.rst:1111 msgid "Binary I/O" msgstr "二進位 (Binary) I/O" @@ -249,14 +249,15 @@ msgstr "更多資訊請見 :pep:`597`\\ 。" #: ../../library/io.rst:148 msgid "" -"To find where the default locale encoding is used, you can enable the ``-X " -"warn_default_encoding`` command line option or set the :envvar:" -"`PYTHONWARNDEFAULTENCODING` environment variable, which will emit an :exc:" -"`EncodingWarning` when the default encoding is used." +"To find where the default locale encoding is used, you can enable the :" +"option:`-X warn_default_encoding <-X>` command line option or set the :" +"envvar:`PYTHONWARNDEFAULTENCODING` environment variable, which will emit an :" +"exc:`EncodingWarning` when the default encoding is used." msgstr "" -"要找出哪些地方使用到預設的地區編碼,你可以啟用 ``-X warn_default_encoding`` " -"命令列選項,或者設定環境變數 :envvar:`PYTHONWARNDEFAULTENCODING`。當使用到預" -"設編碼時,會引發 :exc:`EncodingWarning`。" +"要找出哪些地方使用到預設的地區編碼,你可以啟用 :option:`-X " +"warn_default_encoding <-X>` 命令列選項,或者設定環境變數 :envvar:" +"`PYTHONWARNDEFAULTENCODING`。當使用到預設編碼時,會引發 :exc:" +"`EncodingWarning`。" #: ../../library/io.rst:153 msgid "" @@ -300,12 +301,12 @@ msgstr "" #: ../../library/io.rst:177 msgid "" "This function raises an :ref:`auditing event ` ``open`` with " -"arguments ``path``, ``mode`` and ``flags``. The ``mode`` and ``flags`` " -"arguments may have been modified or inferred from the original call." +"arguments *path*, *mode* and *flags*. The *mode* and *flags* arguments may " +"have been modified or inferred from the original call." msgstr "" -"此函式會引發一個帶有引數 ``path``、``mode`` 以及 ``flags`` 的\\ :ref:`稽核事件 " -"(auditing event) ` ``open``。``mode`` 與 ``flags`` 引數可能已經被修" -"改或者從原始呼叫中被推斷出來。" +"此函式會引發一個帶有引數 *path*、*mode* 以及 *flags* 的\\ :ref:`稽核事件 " +"(auditing event) ` ``open``。*mode* 與 *flags* 引數可能已經被修改或" +"者從原始呼叫中被推斷出來。" #: ../../library/io.rst:184 msgid "" @@ -316,13 +317,13 @@ msgstr "" "況下。" #: ../../library/io.rst:187 -msgid "``path`` should be a :class:`str` and an absolute path." -msgstr "``path`` 應該要屬於 :class:`str` 類別,且是個絕對路徑。" +msgid "*path* should be a :class:`str` and an absolute path." +msgstr "*path* 應該要屬於 :class:`str` 類別,且是個絕對路徑。" #: ../../library/io.rst:189 msgid "" "The behavior of this function may be overridden by an earlier call to the :c:" -"func:`PyFile_SetOpenCodeHook`. However, assuming that ``path`` is a :class:" +"func:`PyFile_SetOpenCodeHook`. However, assuming that *path* is a :class:" "`str` and an absolute path, ``open_code(path)`` should always behave the " "same as ``open(path, 'rb')``. Overriding the behavior is intended for " "additional validation or preprocessing of the file." @@ -393,8 +394,8 @@ msgid "" "contains the standard IO streams: :data:`sys.stdin`, :data:`sys.stdout`, " "and :data:`sys.stderr`." msgstr "" -"包含標準的 IO 資料串流::data:`sys.stdin`、:data:`sys.stdout` 以及 :data:`sys." -"stderr`。" +"包含標準的 IO 資料串流::data:`sys.stdin`、:data:`sys.stdout` 以及 :data:" +"`sys.stderr`。" #: ../../library/io.rst:249 msgid "Class hierarchy" @@ -413,7 +414,7 @@ msgid "" "The abstract base classes also provide default implementations of some " "methods in order to help implementation of concrete stream classes. For " "example, :class:`BufferedIOBase` provides unoptimized implementations of :" -"meth:`~IOBase.readinto` and :meth:`~IOBase.readline`." +"meth:`!readinto` and :meth:`!readline`." msgstr "" #: ../../library/io.rst:263 @@ -549,7 +550,7 @@ msgstr "" #: ../../library/io.rst:323 msgid "" -"Even though :class:`IOBase` does not declare :meth:`read` or :meth:`write` " +"Even though :class:`IOBase` does not declare :meth:`!read` or :meth:`!write` " "because their signatures will vary, implementations and clients should " "consider those methods part of the interface. Also, implementations may " "raise a :exc:`ValueError` (or :exc:`UnsupportedOperation`) when operations " @@ -627,7 +628,7 @@ msgstr "" #: ../../library/io.rst:382 msgid "" -"Return ``True`` if the stream can be read from. If ``False``, :meth:`read` " +"Return ``True`` if the stream can be read from. If ``False``, :meth:`!read` " "will raise :exc:`OSError`." msgstr "" @@ -659,39 +660,39 @@ msgstr "" #: ../../library/io.rst:403 msgid "" "Note that it's already possible to iterate on file objects using ``for line " -"in file: ...`` without calling ``file.readlines()``." +"in file: ...`` without calling :meth:`!file.readlines`." msgstr "" #: ../../library/io.rst:408 msgid "" "Change the stream position to the given byte *offset*. *offset* is " "interpreted relative to the position indicated by *whence*. The default " -"value for *whence* is :data:`SEEK_SET`. Values for *whence* are:" +"value for *whence* is :data:`!SEEK_SET`. Values for *whence* are:" msgstr "" #: ../../library/io.rst:412 msgid "" -":data:`SEEK_SET` or ``0`` -- start of the stream (the default); *offset* " +":data:`!SEEK_SET` or ``0`` -- start of the stream (the default); *offset* " "should be zero or positive" msgstr "" #: ../../library/io.rst:414 msgid "" -":data:`SEEK_CUR` or ``1`` -- current stream position; *offset* may be " +":data:`!SEEK_CUR` or ``1`` -- current stream position; *offset* may be " "negative" msgstr "" #: ../../library/io.rst:416 msgid "" -":data:`SEEK_END` or ``2`` -- end of the stream; *offset* is usually negative" +":data:`!SEEK_END` or ``2`` -- end of the stream; *offset* is usually negative" msgstr "" #: ../../library/io.rst:419 msgid "Return the new absolute position." msgstr "" -#: ../../library/io.rst:421 ../../library/io.rst:930 -msgid "The ``SEEK_*`` constants." +#: ../../library/io.rst:421 ../../library/io.rst:931 +msgid "The :data:`!SEEK_*` constants." msgstr "" #: ../../library/io.rst:424 @@ -726,8 +727,8 @@ msgstr "" #: ../../library/io.rst:452 msgid "" -"Return ``True`` if the stream supports writing. If ``False``, :meth:`write` " -"and :meth:`truncate` will raise :exc:`OSError`." +"Return ``True`` if the stream supports writing. If ``False``, :meth:`!" +"write` and :meth:`truncate` will raise :exc:`OSError`." msgstr "" #: ../../library/io.rst:457 @@ -990,11 +991,12 @@ msgstr "" #: ../../library/io.rst:657 msgid "" -"The :meth:`read` (when called with a positive argument), :meth:`readinto` " -"and :meth:`write` methods on this class will only make one system call." +"The :meth:`~RawIOBase.read` (when called with a positive argument), :meth:" +"`~RawIOBase.readinto` and :meth:`~RawIOBase.write` methods on this class " +"will only make one system call." msgstr "" -#: ../../library/io.rst:660 +#: ../../library/io.rst:661 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -1003,371 +1005,372 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/io.rst:666 +#: ../../library/io.rst:667 msgid "The newly created file is :ref:`non-inheritable `." msgstr "" -#: ../../library/io.rst:668 +#: ../../library/io.rst:669 msgid "" "See the :func:`open` built-in function for examples on using the *opener* " "parameter." msgstr "" -#: ../../library/io.rst:671 +#: ../../library/io.rst:672 msgid "The *opener* parameter was added. The ``'x'`` mode was added." msgstr "" -#: ../../library/io.rst:675 +#: ../../library/io.rst:676 msgid "The file is now non-inheritable." msgstr "" -#: ../../library/io.rst:678 +#: ../../library/io.rst:679 msgid "" ":class:`FileIO` provides these data attributes in addition to those from :" "class:`RawIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:683 +#: ../../library/io.rst:684 msgid "The mode as given in the constructor." msgstr "" -#: ../../library/io.rst:687 +#: ../../library/io.rst:688 msgid "" "The file name. This is the file descriptor of the file when no name is " "given in the constructor." msgstr "" -#: ../../library/io.rst:692 +#: ../../library/io.rst:693 msgid "Buffered Streams" msgstr "" -#: ../../library/io.rst:694 +#: ../../library/io.rst:695 msgid "" "Buffered I/O streams provide a higher-level interface to an I/O device than " "raw I/O does." msgstr "" -#: ../../library/io.rst:699 +#: ../../library/io.rst:700 msgid "" "A binary stream using an in-memory bytes buffer. It inherits :class:" "`BufferedIOBase`. The buffer is discarded when the :meth:`~IOBase.close` " "method is called." msgstr "" -#: ../../library/io.rst:703 +#: ../../library/io.rst:704 msgid "" "The optional argument *initial_bytes* is a :term:`bytes-like object` that " "contains initial data." msgstr "" -#: ../../library/io.rst:706 +#: ../../library/io.rst:707 msgid "" ":class:`BytesIO` provides or overrides these methods in addition to those " "from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:711 +#: ../../library/io.rst:712 msgid "" "Return a readable and writable view over the contents of the buffer without " "copying them. Also, mutating the view will transparently update the " "contents of the buffer::" msgstr "" -#: ../../library/io.rst:722 +#: ../../library/io.rst:723 msgid "" "As long as the view exists, the :class:`BytesIO` object cannot be resized or " "closed." msgstr "" -#: ../../library/io.rst:729 +#: ../../library/io.rst:730 msgid "Return :class:`bytes` containing the entire contents of the buffer." msgstr "" -#: ../../library/io.rst:734 +#: ../../library/io.rst:735 msgid "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.read`." msgstr "" -#: ../../library/io.rst:736 ../../library/io.rst:779 +#: ../../library/io.rst:737 ../../library/io.rst:780 msgid "The *size* argument is now optional." msgstr "" -#: ../../library/io.rst:741 +#: ../../library/io.rst:742 msgid "" "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.readinto`." msgstr "" -#: ../../library/io.rst:747 +#: ../../library/io.rst:748 msgid "" "A buffered binary stream providing higher-level access to a readable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:751 +#: ../../library/io.rst:752 msgid "" "When reading data from this object, a larger amount of data may be requested " "from the underlying raw stream, and kept in an internal buffer. The buffered " "data can then be returned directly on subsequent reads." msgstr "" -#: ../../library/io.rst:755 +#: ../../library/io.rst:756 msgid "" "The constructor creates a :class:`BufferedReader` for the given readable " "*raw* stream and *buffer_size*. If *buffer_size* is omitted, :data:" "`DEFAULT_BUFFER_SIZE` is used." msgstr "" -#: ../../library/io.rst:759 +#: ../../library/io.rst:760 msgid "" ":class:`BufferedReader` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:764 +#: ../../library/io.rst:765 msgid "" "Return bytes from the stream without advancing the position. At most one " "single read on the raw stream is done to satisfy the call. The number of " "bytes returned may be less or more than requested." msgstr "" -#: ../../library/io.rst:770 +#: ../../library/io.rst:771 msgid "" "Read and return *size* bytes, or if *size* is not given or negative, until " "EOF or if the read call would block in non-blocking mode." msgstr "" -#: ../../library/io.rst:775 +#: ../../library/io.rst:776 msgid "" "Read and return up to *size* bytes with only one call on the raw stream. If " "at least one byte is buffered, only buffered bytes are returned. Otherwise, " "one raw stream read call is made." msgstr "" -#: ../../library/io.rst:785 +#: ../../library/io.rst:786 msgid "" "A buffered binary stream providing higher-level access to a writeable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:789 +#: ../../library/io.rst:790 msgid "" "When writing to this object, data is normally placed into an internal " "buffer. The buffer will be written out to the underlying :class:`RawIOBase` " "object under various conditions, including:" msgstr "" -#: ../../library/io.rst:793 +#: ../../library/io.rst:794 msgid "when the buffer gets too small for all pending data;" msgstr "" -#: ../../library/io.rst:794 -msgid "when :meth:`flush()` is called;" +#: ../../library/io.rst:795 +msgid "when :meth:`flush` is called;" msgstr "" -#: ../../library/io.rst:795 +#: ../../library/io.rst:796 msgid "" -"when a :meth:`seek()` is requested (for :class:`BufferedRandom` objects);" +"when a :meth:`~IOBase.seek` is requested (for :class:`BufferedRandom` " +"objects);" msgstr "" -#: ../../library/io.rst:796 +#: ../../library/io.rst:797 msgid "when the :class:`BufferedWriter` object is closed or destroyed." msgstr "" -#: ../../library/io.rst:798 +#: ../../library/io.rst:799 msgid "" "The constructor creates a :class:`BufferedWriter` for the given writeable " "*raw* stream. If the *buffer_size* is not given, it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:802 +#: ../../library/io.rst:803 msgid "" ":class:`BufferedWriter` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:807 +#: ../../library/io.rst:808 msgid "" "Force bytes held in the buffer into the raw stream. A :exc:" "`BlockingIOError` should be raised if the raw stream blocks." msgstr "" -#: ../../library/io.rst:812 +#: ../../library/io.rst:813 msgid "" "Write the :term:`bytes-like object`, *b*, and return the number of bytes " "written. When in non-blocking mode, a :exc:`BlockingIOError` is raised if " "the buffer needs to be written out but the raw stream blocks." msgstr "" -#: ../../library/io.rst:820 +#: ../../library/io.rst:821 msgid "" "A buffered binary stream providing higher-level access to a seekable :class:" "`RawIOBase` raw binary stream. It inherits :class:`BufferedReader` and :" "class:`BufferedWriter`." msgstr "" -#: ../../library/io.rst:824 +#: ../../library/io.rst:825 msgid "" "The constructor creates a reader and writer for a seekable raw stream, given " "in the first argument. If the *buffer_size* is omitted it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:828 +#: ../../library/io.rst:829 msgid "" ":class:`BufferedRandom` is capable of anything :class:`BufferedReader` or :" -"class:`BufferedWriter` can do. In addition, :meth:`seek` and :meth:`tell` " -"are guaranteed to be implemented." +"class:`BufferedWriter` can do. In addition, :meth:`~IOBase.seek` and :meth:" +"`~IOBase.tell` are guaranteed to be implemented." msgstr "" -#: ../../library/io.rst:835 +#: ../../library/io.rst:836 msgid "" "A buffered binary stream providing higher-level access to two non seekable :" "class:`RawIOBase` raw binary streams---one readable, the other writeable. It " "inherits :class:`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:839 +#: ../../library/io.rst:840 msgid "" "*reader* and *writer* are :class:`RawIOBase` objects that are readable and " "writeable respectively. If the *buffer_size* is omitted it defaults to :" "data:`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:843 +#: ../../library/io.rst:844 msgid "" ":class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\\'s " "methods except for :meth:`~BufferedIOBase.detach`, which raises :exc:" "`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:849 +#: ../../library/io.rst:850 msgid "" ":class:`BufferedRWPair` does not attempt to synchronize accesses to its " "underlying raw streams. You should not pass it the same object as reader " "and writer; use :class:`BufferedRandom` instead." msgstr "" -#: ../../library/io.rst:859 +#: ../../library/io.rst:860 msgid "" "Base class for text streams. This class provides a character and line based " "interface to stream I/O. It inherits :class:`IOBase`." msgstr "" -#: ../../library/io.rst:862 +#: ../../library/io.rst:863 msgid "" ":class:`TextIOBase` provides or overrides these data attributes and methods " "in addition to those from :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:867 +#: ../../library/io.rst:868 msgid "" "The name of the encoding used to decode the stream's bytes into strings, and " "to encode strings into bytes." msgstr "" -#: ../../library/io.rst:872 +#: ../../library/io.rst:873 msgid "The error setting of the decoder or encoder." msgstr "" -#: ../../library/io.rst:876 +#: ../../library/io.rst:877 msgid "" "A string, a tuple of strings, or ``None``, indicating the newlines " "translated so far. Depending on the implementation and the initial " "constructor flags, this may not be available." msgstr "" -#: ../../library/io.rst:882 +#: ../../library/io.rst:883 msgid "" "The underlying binary buffer (a :class:`BufferedIOBase` instance) that :" "class:`TextIOBase` deals with. This is not part of the :class:`TextIOBase` " "API and may not exist in some implementations." msgstr "" -#: ../../library/io.rst:888 +#: ../../library/io.rst:889 msgid "" "Separate the underlying binary buffer from the :class:`TextIOBase` and " "return it." msgstr "" -#: ../../library/io.rst:891 +#: ../../library/io.rst:892 msgid "" "After the underlying buffer has been detached, the :class:`TextIOBase` is in " "an unusable state." msgstr "" -#: ../../library/io.rst:894 +#: ../../library/io.rst:895 msgid "" "Some :class:`TextIOBase` implementations, like :class:`StringIO`, may not " "have the concept of an underlying buffer and calling this method will raise :" "exc:`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:902 +#: ../../library/io.rst:903 msgid "" "Read and return at most *size* characters from the stream as a single :class:" "`str`. If *size* is negative or ``None``, reads until EOF." msgstr "" -#: ../../library/io.rst:907 +#: ../../library/io.rst:908 msgid "" -"Read until newline or EOF and return a single ``str``. If the stream is " -"already at EOF, an empty string is returned." +"Read until newline or EOF and return a single :class:`str`. If the stream " +"is already at EOF, an empty string is returned." msgstr "" -#: ../../library/io.rst:910 +#: ../../library/io.rst:911 msgid "If *size* is specified, at most *size* characters will be read." msgstr "" -#: ../../library/io.rst:914 +#: ../../library/io.rst:915 msgid "" "Change the stream position to the given *offset*. Behaviour depends on the " -"*whence* parameter. The default value for *whence* is :data:`SEEK_SET`." +"*whence* parameter. The default value for *whence* is :data:`!SEEK_SET`." msgstr "" -#: ../../library/io.rst:918 +#: ../../library/io.rst:919 msgid "" -":data:`SEEK_SET` or ``0``: seek from the start of the stream (the default); " +":data:`!SEEK_SET` or ``0``: seek from the start of the stream (the default); " "*offset* must either be a number returned by :meth:`TextIOBase.tell`, or " "zero. Any other *offset* value produces undefined behaviour." msgstr "" -#: ../../library/io.rst:922 +#: ../../library/io.rst:923 msgid "" -":data:`SEEK_CUR` or ``1``: \"seek\" to the current position; *offset* must " +":data:`!SEEK_CUR` or ``1``: \"seek\" to the current position; *offset* must " "be zero, which is a no-operation (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:925 +#: ../../library/io.rst:926 msgid "" -":data:`SEEK_END` or ``2``: seek to the end of the stream; *offset* must be " +":data:`!SEEK_END` or ``2``: seek to the end of the stream; *offset* must be " "zero (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:928 +#: ../../library/io.rst:929 msgid "Return the new absolute position as an opaque number." msgstr "" -#: ../../library/io.rst:935 +#: ../../library/io.rst:936 msgid "" "Return the current stream position as an opaque number. The number does not " "usually represent a number of bytes in the underlying binary storage." msgstr "" -#: ../../library/io.rst:941 +#: ../../library/io.rst:942 msgid "" "Write the string *s* to the stream and return the number of characters " "written." msgstr "" -#: ../../library/io.rst:948 +#: ../../library/io.rst:949 msgid "" "A buffered text stream providing higher-level access to a :class:" "`BufferedIOBase` buffered binary stream. It inherits :class:`TextIOBase`." msgstr "" -#: ../../library/io.rst:952 +#: ../../library/io.rst:953 msgid "" "*encoding* gives the name of the encoding that the stream will be decoded or " "encoded with. It defaults to :func:`locale.getencoding()`. " @@ -1375,7 +1378,7 @@ msgid "" "explicitly. See :ref:`io-text-encoding` for more information." msgstr "" -#: ../../library/io.rst:957 +#: ../../library/io.rst:958 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled. Pass ``'strict'`` to raise a :exc:`ValueError` " @@ -1390,13 +1393,13 @@ msgid "" "that has been registered with :func:`codecs.register_error` is also valid." msgstr "" -#: ../../library/io.rst:973 +#: ../../library/io.rst:974 msgid "" "*newline* controls how line endings are handled. It can be ``None``, " "``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as follows:" msgstr "" -#: ../../library/io.rst:976 +#: ../../library/io.rst:977 msgid "" "When reading input from the stream, if *newline* is ``None``, :term:" "`universal newlines` mode is enabled. Lines in the input can end in " @@ -1408,7 +1411,7 @@ msgid "" "returned to the caller untranslated." msgstr "" -#: ../../library/io.rst:985 +#: ../../library/io.rst:986 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -1417,24 +1420,25 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/io.rst:991 +#: ../../library/io.rst:992 msgid "" -"If *line_buffering* is ``True``, :meth:`flush` is implied when a call to " -"write contains a newline character or a carriage return." +"If *line_buffering* is ``True``, :meth:`~IOBase.flush` is implied when a " +"call to write contains a newline character or a carriage return." msgstr "" -#: ../../library/io.rst:994 +#: ../../library/io.rst:995 msgid "" -"If *write_through* is ``True``, calls to :meth:`write` are guaranteed not to " -"be buffered: any data written on the :class:`TextIOWrapper` object is " -"immediately handled to its underlying binary *buffer*." +"If *write_through* is ``True``, calls to :meth:`~BufferedIOBase.write` are " +"guaranteed not to be buffered: any data written on the :class:" +"`TextIOWrapper` object is immediately handled to its underlying binary " +"*buffer*." msgstr "" -#: ../../library/io.rst:998 +#: ../../library/io.rst:999 msgid "The *write_through* argument has been added." msgstr "" -#: ../../library/io.rst:1001 +#: ../../library/io.rst:1002 msgid "" "The default *encoding* is now ``locale.getpreferredencoding(False)`` instead " "of ``locale.getpreferredencoding()``. Don't change temporary the locale " @@ -1442,65 +1446,65 @@ msgid "" "instead of the user preferred encoding." msgstr "" -#: ../../library/io.rst:1007 +#: ../../library/io.rst:1008 msgid "" "The *encoding* argument now supports the ``\"locale\"`` dummy encoding name." msgstr "" -#: ../../library/io.rst:1010 +#: ../../library/io.rst:1011 msgid "" ":class:`TextIOWrapper` provides these data attributes and methods in " "addition to those from :class:`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1015 +#: ../../library/io.rst:1016 msgid "Whether line buffering is enabled." msgstr "" -#: ../../library/io.rst:1019 +#: ../../library/io.rst:1020 msgid "Whether writes are passed immediately to the underlying binary buffer." msgstr "" -#: ../../library/io.rst:1027 +#: ../../library/io.rst:1028 msgid "" "Reconfigure this text stream using new settings for *encoding*, *errors*, " "*newline*, *line_buffering* and *write_through*." msgstr "" -#: ../../library/io.rst:1030 +#: ../../library/io.rst:1031 msgid "" "Parameters not specified keep current settings, except ``errors='strict'`` " "is used when *encoding* is specified but *errors* is not specified." msgstr "" -#: ../../library/io.rst:1034 +#: ../../library/io.rst:1035 msgid "" "It is not possible to change the encoding or newline if some data has " "already been read from the stream. On the other hand, changing encoding " "after write is possible." msgstr "" -#: ../../library/io.rst:1038 +#: ../../library/io.rst:1039 msgid "" "This method does an implicit stream flush before setting the new parameters." msgstr "" -#: ../../library/io.rst:1043 +#: ../../library/io.rst:1044 msgid "The method supports ``encoding=\"locale\"`` option." msgstr "" -#: ../../library/io.rst:1049 +#: ../../library/io.rst:1050 msgid "" "A text stream using an in-memory text buffer. It inherits :class:" "`TextIOBase`." msgstr "" -#: ../../library/io.rst:1052 +#: ../../library/io.rst:1053 msgid "" "The text buffer is discarded when the :meth:`~IOBase.close` method is called." msgstr "" -#: ../../library/io.rst:1055 +#: ../../library/io.rst:1056 msgid "" "The initial value of the buffer can be set by providing *initial_value*. If " "newline translation is enabled, newlines will be encoded as if by :meth:" @@ -1512,50 +1516,50 @@ msgid "" "at the end of the buffer." msgstr "" -#: ../../library/io.rst:1064 +#: ../../library/io.rst:1065 msgid "" "The *newline* argument works like that of :class:`TextIOWrapper`, except " "that when writing output to the stream, if *newline* is ``None``, newlines " "are written as ``\\n`` on all platforms." msgstr "" -#: ../../library/io.rst:1068 +#: ../../library/io.rst:1069 msgid "" ":class:`StringIO` provides this method in addition to those from :class:" "`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1073 +#: ../../library/io.rst:1074 msgid "" -"Return a ``str`` containing the entire contents of the buffer. Newlines are " -"decoded as if by :meth:`~TextIOBase.read`, although the stream position is " -"not changed." +"Return a :class:`str` containing the entire contents of the buffer. Newlines " +"are decoded as if by :meth:`~TextIOBase.read`, although the stream position " +"is not changed." msgstr "" -#: ../../library/io.rst:1077 +#: ../../library/io.rst:1078 msgid "Example usage::" msgstr "" "使用範例:\n" "\n" "::" -#: ../../library/io.rst:1099 +#: ../../library/io.rst:1100 msgid "" "A helper codec that decodes newlines for :term:`universal newlines` mode. It " "inherits :class:`codecs.IncrementalDecoder`." msgstr "" -#: ../../library/io.rst:1104 +#: ../../library/io.rst:1105 msgid "Performance" msgstr "" -#: ../../library/io.rst:1106 +#: ../../library/io.rst:1107 msgid "" "This section discusses the performance of the provided concrete I/O " "implementations." msgstr "" -#: ../../library/io.rst:1112 +#: ../../library/io.rst:1113 msgid "" "By reading and writing only large chunks of data even when the user asks for " "a single byte, buffered I/O hides any inefficiency in calling and executing " @@ -1568,33 +1572,34 @@ msgid "" "data." msgstr "" -#: ../../library/io.rst:1124 +#: ../../library/io.rst:1125 msgid "" "Text I/O over a binary storage (such as a file) is significantly slower than " "binary I/O over the same storage, because it requires conversions between " "unicode and binary data using a character codec. This can become noticeable " "handling huge amounts of text data like large log files. Also, :meth:" -"`TextIOWrapper.tell` and :meth:`TextIOWrapper.seek` are both quite slow due " -"to the reconstruction algorithm used." +"`~TextIOBase.tell` and :meth:`~TextIOBase.seek` are both quite slow due to " +"the reconstruction algorithm used." msgstr "" -#: ../../library/io.rst:1131 +#: ../../library/io.rst:1132 msgid "" ":class:`StringIO`, however, is a native in-memory unicode container and will " "exhibit similar speed to :class:`BytesIO`." msgstr "" -#: ../../library/io.rst:1135 +#: ../../library/io.rst:1136 msgid "Multi-threading" msgstr "" -#: ../../library/io.rst:1137 +#: ../../library/io.rst:1138 msgid "" ":class:`FileIO` objects are thread-safe to the extent that the operating " -"system calls (such as ``read(2)`` under Unix) they wrap are thread-safe too." +"system calls (such as :manpage:`read(2)` under Unix) they wrap are thread-" +"safe too." msgstr "" -#: ../../library/io.rst:1140 +#: ../../library/io.rst:1141 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) " @@ -1602,15 +1607,15 @@ msgid "" "them from multiple threads at once." msgstr "" -#: ../../library/io.rst:1145 +#: ../../library/io.rst:1146 msgid ":class:`TextIOWrapper` objects are not thread-safe." msgstr "" -#: ../../library/io.rst:1148 +#: ../../library/io.rst:1149 msgid "Reentrancy" msgstr "" -#: ../../library/io.rst:1150 +#: ../../library/io.rst:1151 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) are " @@ -1621,7 +1626,7 @@ msgid "" "from entering the buffered object." msgstr "" -#: ../../library/io.rst:1158 +#: ../../library/io.rst:1159 msgid "" "The above implicitly extends to text files, since the :func:`open()` " "function will wrap a buffered object inside a :class:`TextIOWrapper`. This " @@ -1637,14 +1642,14 @@ msgstr "file object(檔案物件)" msgid "io module" msgstr "io 模組" -#: ../../library/io.rst:970 ../../library/io.rst:1094 +#: ../../library/io.rst:971 ../../library/io.rst:1095 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/io.rst:970 +#: ../../library/io.rst:971 msgid "io.TextIOWrapper class" msgstr "io.TextIOWrapper 類別" -#: ../../library/io.rst:1094 +#: ../../library/io.rst:1095 msgid "io.IncrementalNewlineDecoder class" msgstr "io.IncrementalNewlineDecoder 類別" diff --git a/library/logging.po b/library/logging.po index 8f4ec3c021..48729d0e13 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-08-14 13:46+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-" @@ -204,7 +204,7 @@ msgid "" "level." msgstr "" -#: ../../library/logging.rst:134 ../../library/logging.rst:459 +#: ../../library/logging.rst:134 ../../library/logging.rst:477 msgid "See :ref:`levels` for a list of levels." msgstr "層級清單請見 :ref:`levels`\\ 。" @@ -278,7 +278,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:201 ../../library/logging.rst:1088 +#: ../../library/logging.rst:201 ../../library/logging.rst:1106 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -290,14 +290,14 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:210 ../../library/logging.rst:1097 +#: ../../library/logging.rst:210 ../../library/logging.rst:1115 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:218 ../../library/logging.rst:1105 +#: ../../library/logging.rst:218 ../../library/logging.rst:1123 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." @@ -346,7 +346,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:258 ../../library/logging.rst:1136 +#: ../../library/logging.rst:258 ../../library/logging.rst:1154 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -364,7 +364,7 @@ msgid "" "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:269 ../../library/logging.rst:1147 +#: ../../library/logging.rst:269 ../../library/logging.rst:1165 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" @@ -512,35 +512,75 @@ msgstr "" msgid "Numeric value" msgstr "" +#: ../../library/logging.rst:401 +msgid "What it means / When to use it" +msgstr "" + #: ../../library/logging.rst:403 -msgid "50" -msgstr "50" +msgid "0" +msgstr "0" -#: ../../library/logging.rst:405 -msgid "40" -msgstr "40" +#: ../../library/logging.rst:403 +msgid "" +"When set on a logger, indicates that ancestor loggers are to be consulted to " +"determine the effective level. If that still resolves to :const:`!NOTSET`, " +"then all events are logged. When set on a handler, all events are handled." +msgstr "" -#: ../../library/logging.rst:407 -msgid "30" -msgstr "30" +#: ../../library/logging.rst:411 +msgid "10" +msgstr "10" -#: ../../library/logging.rst:409 +#: ../../library/logging.rst:411 +msgid "" +"Detailed information, typically only of interest to a developer trying to " +"diagnose a problem." +msgstr "" + +#: ../../library/logging.rst:415 msgid "20" msgstr "20" -#: ../../library/logging.rst:411 -msgid "10" -msgstr "10" +#: ../../library/logging.rst:415 +msgid "Confirmation that things are working as expected." +msgstr "" -#: ../../library/logging.rst:413 -msgid "0" -msgstr "0" +#: ../../library/logging.rst:418 +msgid "30" +msgstr "30" + +#: ../../library/logging.rst:418 +msgid "" +"An indication that something unexpected happened, or that a problem might " +"occur in the near future (e.g. 'disk space low'). The software is still " +"working as expected." +msgstr "" + +#: ../../library/logging.rst:425 +msgid "40" +msgstr "40" + +#: ../../library/logging.rst:425 +msgid "" +"Due to a more serious problem, the software has not been able to perform " +"some function." +msgstr "" -#: ../../library/logging.rst:420 +#: ../../library/logging.rst:429 +msgid "50" +msgstr "50" + +#: ../../library/logging.rst:429 +msgid "" +"A serious error, indicating that the program itself may be unable to " +"continue running." +msgstr "" + +#: ../../library/logging.rst:438 msgid "Handler Objects" msgstr "" -#: ../../library/logging.rst:422 +#: ../../library/logging.rst:440 msgid "" "Handlers have the following attributes and methods. Note that :class:" "`Handler` is never instantiated directly; this class acts as a base for more " @@ -548,53 +588,53 @@ msgid "" "to call :meth:`Handler.__init__`." msgstr "" -#: ../../library/logging.rst:431 +#: ../../library/logging.rst:449 msgid "" "Initializes the :class:`Handler` instance by setting its level, setting the " "list of filters to the empty list and creating a lock (using :meth:" "`createLock`) for serializing access to an I/O mechanism." msgstr "" -#: ../../library/logging.rst:438 +#: ../../library/logging.rst:456 msgid "" "Initializes a thread lock which can be used to serialize access to " "underlying I/O functionality which may not be threadsafe." msgstr "" -#: ../../library/logging.rst:444 +#: ../../library/logging.rst:462 msgid "Acquires the thread lock created with :meth:`createLock`." msgstr "" -#: ../../library/logging.rst:449 +#: ../../library/logging.rst:467 msgid "Releases the thread lock acquired with :meth:`acquire`." msgstr "" -#: ../../library/logging.rst:454 +#: ../../library/logging.rst:472 msgid "" "Sets the threshold for this handler to *level*. Logging messages which are " "less severe than *level* will be ignored. When a handler is created, the " "level is set to :const:`NOTSET` (which causes all messages to be processed)." msgstr "" -#: ../../library/logging.rst:461 +#: ../../library/logging.rst:479 msgid "" "The *level* parameter now accepts a string representation of the level such " "as 'INFO' as an alternative to the integer constants such as :const:`INFO`." msgstr "" -#: ../../library/logging.rst:469 +#: ../../library/logging.rst:487 msgid "Sets the :class:`Formatter` for this handler to *fmt*." msgstr "" -#: ../../library/logging.rst:474 +#: ../../library/logging.rst:492 msgid "Adds the specified filter *filter* to this handler." msgstr "" -#: ../../library/logging.rst:479 +#: ../../library/logging.rst:497 msgid "Removes the specified filter *filter* from this handler." msgstr "" -#: ../../library/logging.rst:484 +#: ../../library/logging.rst:502 msgid "" "Apply this handler's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -603,13 +643,13 @@ msgid "" "record." msgstr "" -#: ../../library/logging.rst:493 +#: ../../library/logging.rst:511 msgid "" "Ensure all logging output has been flushed. This version does nothing and is " "intended to be implemented by subclasses." msgstr "" -#: ../../library/logging.rst:499 +#: ../../library/logging.rst:517 msgid "" "Tidy up any resources used by the handler. This version does no output but " "removes the handler from an internal list of handlers which is closed when :" @@ -617,14 +657,14 @@ msgid "" "from overridden :meth:`close` methods." msgstr "" -#: ../../library/logging.rst:507 +#: ../../library/logging.rst:525 msgid "" "Conditionally emits the specified logging record, depending on filters which " "may have been added to the handler. Wraps the actual emission of the record " "with acquisition/release of the I/O thread lock." msgstr "" -#: ../../library/logging.rst:514 +#: ../../library/logging.rst:532 msgid "" "This method should be called from handlers when an exception is encountered " "during an :meth:`emit` call. If the module-level attribute " @@ -637,20 +677,20 @@ msgid "" "more useful during development)." msgstr "" -#: ../../library/logging.rst:527 +#: ../../library/logging.rst:545 msgid "" "Do formatting for a record - if a formatter is set, use it. Otherwise, use " "the default formatter for the module." msgstr "" -#: ../../library/logging.rst:533 +#: ../../library/logging.rst:551 msgid "" "Do whatever it takes to actually log the specified logging record. This " "version is intended to be implemented by subclasses and so raises a :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/logging.rst:537 +#: ../../library/logging.rst:555 msgid "" "This method is called after a handler-level lock is acquired, which is " "released after this method returns. When you override this method, note that " @@ -659,13 +699,13 @@ msgid "" "Specifically:" msgstr "" -#: ../../library/logging.rst:543 +#: ../../library/logging.rst:561 msgid "" "Logging configuration APIs acquire the module-level lock, and then " "individual handler-level locks as those handlers are configured." msgstr "" -#: ../../library/logging.rst:546 +#: ../../library/logging.rst:564 msgid "" "Many logging APIs lock the module-level lock. If such an API is called from " "this method, it could cause a deadlock if a configuration call is made on " @@ -675,16 +715,16 @@ msgid "" "method, the handler-level lock has already been acquired)." msgstr "" -#: ../../library/logging.rst:553 +#: ../../library/logging.rst:571 msgid "" "For a list of handlers included as standard, see :mod:`logging.handlers`." msgstr "" -#: ../../library/logging.rst:558 +#: ../../library/logging.rst:576 msgid "Formatter Objects" msgstr "" -#: ../../library/logging.rst:564 +#: ../../library/logging.rst:582 msgid "" "Responsible for converting a :class:`LogRecord` to an output string to be " "interpreted by a human or external system." @@ -694,7 +734,7 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/logging.rst:567 +#: ../../library/logging.rst:585 msgid "" "A format string in the given *style* for the logged output as a whole. The " "possible mapping keys are drawn from the :class:`LogRecord` object's :ref:" @@ -702,14 +742,14 @@ msgid "" "is just the logged message." msgstr "" -#: ../../library/logging.rst:575 +#: ../../library/logging.rst:593 msgid "" "A format string in the given *style* for the date/time portion of the logged " "output. If not specified, the default described in :meth:`formatTime` is " "used." msgstr "" -#: ../../library/logging.rst:580 +#: ../../library/logging.rst:598 msgid "" "Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines how the format " "string will be merged with its data: using one of :ref:`old-string-" @@ -720,32 +760,32 @@ msgid "" "use ``{``- and ``$``-formatting for log messages." msgstr "" -#: ../../library/logging.rst:590 +#: ../../library/logging.rst:608 msgid "" "If ``True`` (the default), incorrect or mismatched *fmt* and *style* will " "raise a :exc:`ValueError`; for example, ``logging.Formatter('%(asctime)s - " "%(message)s', style='{')``." msgstr "" -#: ../../library/logging.rst:595 +#: ../../library/logging.rst:613 msgid "" "A dictionary with default values to use in custom fields. For example, " "``logging.Formatter('%(ip)s %(message)s', defaults={\"ip\": None})``" msgstr "" -#: ../../library/logging.rst:600 +#: ../../library/logging.rst:618 msgid "The *style* parameter." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:603 +#: ../../library/logging.rst:621 msgid "The *validate* parameter." msgstr "新增 *validate* 參數。" -#: ../../library/logging.rst:606 +#: ../../library/logging.rst:624 msgid "The *defaults* parameter." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:612 +#: ../../library/logging.rst:630 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -764,13 +804,13 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:628 +#: ../../library/logging.rst:646 msgid "" "If stack information is available, it's appended after the exception " "information, using :meth:`formatStack` to transform it if necessary." msgstr "" -#: ../../library/logging.rst:634 +#: ../../library/logging.rst:652 msgid "" "This method should be called from :meth:`format` by a formatter which wants " "to make use of a formatted time. This method can be overridden in formatters " @@ -783,7 +823,7 @@ msgid "" "resulting string is returned." msgstr "" -#: ../../library/logging.rst:644 +#: ../../library/logging.rst:662 msgid "" "This function uses a user-configurable function to convert the creation time " "to a tuple. By default, :func:`time.localtime` is used; to change this for a " @@ -793,7 +833,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:652 +#: ../../library/logging.rst:670 msgid "" "Previously, the default format was hard-coded as in this example: " "``2010-09-06 22:38:15,292`` where the part before the comma is handled by a " @@ -808,11 +848,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:665 +#: ../../library/logging.rst:683 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:670 +#: ../../library/logging.rst:688 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -820,14 +860,14 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:677 +#: ../../library/logging.rst:695 msgid "" "Formats the specified stack information (a string as returned by :func:" "`traceback.print_stack`, but with the last newline removed) as a string. " "This default implementation just returns the input value." msgstr "" -#: ../../library/logging.rst:683 +#: ../../library/logging.rst:701 msgid "" "A base formatter class suitable for subclassing when you want to format a " "number of records. You can pass a :class:`Formatter` instance which you want " @@ -836,7 +876,7 @@ msgid "" "used as the line formatter." msgstr "" -#: ../../library/logging.rst:691 +#: ../../library/logging.rst:709 msgid "" "Return a header for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " @@ -844,14 +884,14 @@ msgid "" "separator line." msgstr "" -#: ../../library/logging.rst:698 +#: ../../library/logging.rst:716 msgid "" "Return a footer for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records or a separator line." msgstr "" -#: ../../library/logging.rst:705 +#: ../../library/logging.rst:723 msgid "" "Return formatted text for a list of *records*. The base implementation just " "returns the empty string if there are no records; otherwise, it returns the " @@ -859,11 +899,11 @@ msgid "" "and the footer." msgstr "" -#: ../../library/logging.rst:713 +#: ../../library/logging.rst:731 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:715 +#: ../../library/logging.rst:733 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -873,7 +913,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:725 +#: ../../library/logging.rst:743 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " @@ -881,7 +921,7 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:732 +#: ../../library/logging.rst:750 msgid "" "Is the specified record to be logged? Returns false for no, true for yes. " "Filters can either modify log records in-place or return a completely " @@ -889,7 +929,7 @@ msgid "" "future processing of the event." msgstr "" -#: ../../library/logging.rst:737 +#: ../../library/logging.rst:755 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -899,13 +939,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:744 +#: ../../library/logging.rst:762 msgid "" "You don't actually need to subclass ``Filter``: you can pass any instance " "which has a ``filter`` method with the same semantics." msgstr "" -#: ../../library/logging.rst:747 +#: ../../library/logging.rst:765 msgid "" "You don't need to create specialized ``Filter`` classes, or use other " "classes with a ``filter`` method: you can use a function (or other callable) " @@ -916,7 +956,7 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:757 +#: ../../library/logging.rst:775 msgid "" "You can now return a :class:`LogRecord` instance from filters to replace the " "log record rather than modifying it in place. This allows filters attached " @@ -924,7 +964,7 @@ msgid "" "having side effects on other handlers." msgstr "" -#: ../../library/logging.rst:763 +#: ../../library/logging.rst:781 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -936,11 +976,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:776 +#: ../../library/logging.rst:794 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:778 +#: ../../library/logging.rst:796 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -948,17 +988,17 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:786 +#: ../../library/logging.rst:804 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:788 +#: ../../library/logging.rst:806 msgid "" "The primary information is passed in *msg* and *args*, which are combined " "using ``msg % args`` to create the :attr:`!message` attribute of the record." msgstr "" -#: ../../library/logging.rst:792 +#: ../../library/logging.rst:810 msgid "" "The name of the logger used to log the event represented by this :class:`!" "LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " @@ -966,7 +1006,7 @@ msgid "" "different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:800 +#: ../../library/logging.rst:818 msgid "" "The :ref:`numeric level ` of the logging event (such as ``10`` for " "``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " @@ -974,46 +1014,46 @@ msgid "" "attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:807 +#: ../../library/logging.rst:825 msgid "" "The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:811 +#: ../../library/logging.rst:829 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:815 +#: ../../library/logging.rst:833 msgid "" "The event description message, which can be a %-format string with " "placeholders for variable data, or an arbitrary object (see :ref:`arbitrary-" "object-messages`)." msgstr "" -#: ../../library/logging.rst:820 +#: ../../library/logging.rst:838 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:824 +#: ../../library/logging.rst:842 msgid "" "An exception tuple with the current exception information, as returned by :" "func:`sys.exc_info`, or ``None`` if no exception information is available." msgstr "" -#: ../../library/logging.rst:829 +#: ../../library/logging.rst:847 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:833 +#: ../../library/logging.rst:851 msgid "" "A text string representing stack information from the base of the stack in " "the current thread, up to the logging call." msgstr "" -#: ../../library/logging.rst:840 +#: ../../library/logging.rst:858 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1022,7 +1062,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:847 +#: ../../library/logging.rst:865 msgid "" "The creation of a :class:`LogRecord` has been made more configurable by " "providing a factory which is used to create the record. The factory can be " @@ -1030,24 +1070,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:853 +#: ../../library/logging.rst:871 msgid "" "This functionality can be used to inject your own values into a :class:" "`LogRecord` at creation time. You can use the following pattern::" msgstr "" -#: ../../library/logging.rst:865 +#: ../../library/logging.rst:883 msgid "" "With this pattern, multiple factories could be chained, and as long as they " "don't overwrite each other's attributes or unintentionally overwrite the " "standard attributes listed above, there should be no surprises." msgstr "" -#: ../../library/logging.rst:874 +#: ../../library/logging.rst:892 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:876 +#: ../../library/logging.rst:894 msgid "" "The LogRecord has a number of attributes, most of which are derived from the " "parameters to the constructor. (Note that the names do not always correspond " @@ -1058,7 +1098,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:884 +#: ../../library/logging.rst:902 msgid "" "If you are using {}-formatting (:func:`str.format`), you can use ``{attrname}" "`` as the placeholder in the format string. If you are using $-formatting (:" @@ -1066,7 +1106,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:890 +#: ../../library/logging.rst:908 msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " @@ -1075,324 +1115,324 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:897 +#: ../../library/logging.rst:915 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:897 ../../library/logging.rst:1305 +#: ../../library/logging.rst:915 ../../library/logging.rst:1323 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:897 ../../library/logging.rst:1305 +#: ../../library/logging.rst:915 ../../library/logging.rst:1323 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:899 +#: ../../library/logging.rst:0 ../../library/logging.rst:917 msgid "args" msgstr "" -#: ../../library/logging.rst:899 ../../library/logging.rst:913 -#: ../../library/logging.rst:941 ../../library/logging.rst:959 +#: ../../library/logging.rst:917 ../../library/logging.rst:931 +#: ../../library/logging.rst:959 ../../library/logging.rst:977 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:899 +#: ../../library/logging.rst:917 msgid "" "The tuple of arguments merged into ``msg`` to produce ``message``, or a dict " "whose values are used for the merge (when there is only one argument, and it " "is a dictionary)." msgstr "" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:922 msgid "asctime" msgstr "" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:922 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:922 msgid "" "Human-readable time when the :class:`LogRecord` was created. By default " "this is of the form '2003-07-08 16:49:45,896' (the numbers after the comma " "are millisecond portion of the time)." msgstr "" -#: ../../library/logging.rst:910 +#: ../../library/logging.rst:928 msgid "created" msgstr "" -#: ../../library/logging.rst:910 +#: ../../library/logging.rst:928 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:910 +#: ../../library/logging.rst:928 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:913 +#: ../../library/logging.rst:0 ../../library/logging.rst:931 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:913 +#: ../../library/logging.rst:931 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:916 +#: ../../library/logging.rst:934 msgid "filename" msgstr "" -#: ../../library/logging.rst:916 +#: ../../library/logging.rst:934 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:916 +#: ../../library/logging.rst:934 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:936 msgid "funcName" msgstr "" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:936 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:936 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:938 msgid "levelname" msgstr "" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:938 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:938 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:924 +#: ../../library/logging.rst:942 msgid "levelno" msgstr "" -#: ../../library/logging.rst:924 +#: ../../library/logging.rst:942 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:924 +#: ../../library/logging.rst:942 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:929 +#: ../../library/logging.rst:947 msgid "lineno" msgstr "" -#: ../../library/logging.rst:929 +#: ../../library/logging.rst:947 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:929 +#: ../../library/logging.rst:947 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:932 +#: ../../library/logging.rst:950 msgid "message" msgstr "" -#: ../../library/logging.rst:932 +#: ../../library/logging.rst:950 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:932 +#: ../../library/logging.rst:950 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:954 msgid "module" msgstr "模組" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:954 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:954 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:956 msgid "msecs" msgstr "" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:956 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:956 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:941 +#: ../../library/logging.rst:0 ../../library/logging.rst:959 msgid "msg" msgstr "" -#: ../../library/logging.rst:941 +#: ../../library/logging.rst:959 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:946 +#: ../../library/logging.rst:0 ../../library/logging.rst:964 msgid "name" msgstr "" -#: ../../library/logging.rst:946 +#: ../../library/logging.rst:964 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:946 +#: ../../library/logging.rst:964 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:948 +#: ../../library/logging.rst:966 msgid "pathname" msgstr "" -#: ../../library/logging.rst:948 +#: ../../library/logging.rst:966 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:948 +#: ../../library/logging.rst:966 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:951 +#: ../../library/logging.rst:969 msgid "process" msgstr "" -#: ../../library/logging.rst:951 +#: ../../library/logging.rst:969 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:951 +#: ../../library/logging.rst:969 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:953 +#: ../../library/logging.rst:971 msgid "processName" msgstr "" -#: ../../library/logging.rst:953 +#: ../../library/logging.rst:971 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:953 +#: ../../library/logging.rst:971 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:955 +#: ../../library/logging.rst:973 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:955 +#: ../../library/logging.rst:973 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:955 +#: ../../library/logging.rst:973 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:959 +#: ../../library/logging.rst:977 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:959 +#: ../../library/logging.rst:977 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:965 +#: ../../library/logging.rst:983 msgid "thread" msgstr "" -#: ../../library/logging.rst:965 +#: ../../library/logging.rst:983 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:965 +#: ../../library/logging.rst:983 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:967 +#: ../../library/logging.rst:985 msgid "threadName" msgstr "" -#: ../../library/logging.rst:967 +#: ../../library/logging.rst:985 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:967 +#: ../../library/logging.rst:985 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:969 +#: ../../library/logging.rst:987 msgid "taskName" msgstr "taskName" -#: ../../library/logging.rst:969 +#: ../../library/logging.rst:987 msgid "``%(taskName)s``" msgstr "``%(taskName)s``" -#: ../../library/logging.rst:969 +#: ../../library/logging.rst:987 msgid ":class:`asyncio.Task` name (if available)." msgstr "" -#: ../../library/logging.rst:972 +#: ../../library/logging.rst:990 msgid "*processName* was added." msgstr "新增 *processName*。" -#: ../../library/logging.rst:975 +#: ../../library/logging.rst:993 msgid "*taskName* was added." msgstr "新增 *taskName*。" -#: ../../library/logging.rst:981 +#: ../../library/logging.rst:999 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:983 +#: ../../library/logging.rst:1001 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " "information into logging calls. For a usage example, see the section on :ref:" "`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:989 +#: ../../library/logging.rst:1007 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:994 +#: ../../library/logging.rst:1012 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1401,7 +1441,7 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1000 +#: ../../library/logging.rst:1018 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1413,24 +1453,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1009 +#: ../../library/logging.rst:1027 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1032 msgid "" "Attribute :attr:`manager` and method :meth:`_log` were added, which delegate " "to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:1020 +#: ../../library/logging.rst:1038 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1022 +#: ../../library/logging.rst:1040 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1439,7 +1479,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1045 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1447,17 +1487,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1052 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1054 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1042 +#: ../../library/logging.rst:1060 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1466,14 +1506,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:1047 +#: ../../library/logging.rst:1065 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1054 +#: ../../library/logging.rst:1072 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1482,24 +1522,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1083 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1085 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1072 +#: ../../library/logging.rst:1090 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1077 +#: ../../library/logging.rst:1095 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1508,7 +1548,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:1082 +#: ../../library/logging.rst:1100 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1518,7 +1558,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1108 +#: ../../library/logging.rst:1126 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1527,18 +1567,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1119 +#: ../../library/logging.rst:1137 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1125 +#: ../../library/logging.rst:1143 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1129 +#: ../../library/logging.rst:1147 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1549,58 +1589,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1143 +#: ../../library/logging.rst:1161 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1152 +#: ../../library/logging.rst:1170 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1158 +#: ../../library/logging.rst:1176 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1161 +#: ../../library/logging.rst:1179 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1168 +#: ../../library/logging.rst:1186 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1174 +#: ../../library/logging.rst:1192 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1180 +#: ../../library/logging.rst:1198 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1186 +#: ../../library/logging.rst:1204 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1191 +#: ../../library/logging.rst:1209 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1614,7 +1654,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1202 +#: ../../library/logging.rst:1220 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1622,13 +1662,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1207 +#: ../../library/logging.rst:1225 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1213 +#: ../../library/logging.rst:1231 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1638,24 +1678,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1220 +#: ../../library/logging.rst:1238 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1225 +#: ../../library/logging.rst:1243 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1233 +#: ../../library/logging.rst:1251 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1235 +#: ../../library/logging.rst:1253 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1665,20 +1705,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1242 +#: ../../library/logging.rst:1260 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1246 +#: ../../library/logging.rst:1264 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1249 +#: ../../library/logging.rst:1267 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " @@ -1687,7 +1727,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1255 +#: ../../library/logging.rst:1273 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1695,17 +1735,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1263 +#: ../../library/logging.rst:1281 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1270 +#: ../../library/logging.rst:1288 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1276 +#: ../../library/logging.rst:1294 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1713,7 +1753,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1284 +#: ../../library/logging.rst:1302 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1722,13 +1762,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1290 +#: ../../library/logging.rst:1308 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1293 +#: ../../library/logging.rst:1311 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1737,54 +1777,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1300 +#: ../../library/logging.rst:1318 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1307 +#: ../../library/logging.rst:1325 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1307 +#: ../../library/logging.rst:1325 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1311 +#: ../../library/logging.rst:1329 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1311 +#: ../../library/logging.rst:1329 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1333 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1333 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1320 +#: ../../library/logging.rst:1338 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1320 +#: ../../library/logging.rst:1338 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1323 +#: ../../library/logging.rst:1341 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1323 +#: ../../library/logging.rst:1341 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1334 +#: ../../library/logging.rst:1352 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1334 +#: ../../library/logging.rst:1352 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1340 +#: ../../library/logging.rst:1358 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1340 +#: ../../library/logging.rst:1358 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -1824,33 +1864,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1349 +#: ../../library/logging.rst:1367 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1349 +#: ../../library/logging.rst:1367 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1355 +#: ../../library/logging.rst:1373 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1355 +#: ../../library/logging.rst:1373 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1360 +#: ../../library/logging.rst:1378 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1360 +#: ../../library/logging.rst:1378 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -1859,39 +1899,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1371 +#: ../../library/logging.rst:1389 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1374 +#: ../../library/logging.rst:1392 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1398 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1383 +#: ../../library/logging.rst:1401 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1406 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1392 +#: ../../library/logging.rst:1410 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1399 +#: ../../library/logging.rst:1417 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`__init__` such that only a name " @@ -1903,32 +1943,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1410 +#: ../../library/logging.rst:1428 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1412 +#: ../../library/logging.rst:1430 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1414 +#: ../../library/logging.rst:1432 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1419 +#: ../../library/logging.rst:1437 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1421 +#: ../../library/logging.rst:1439 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1423 +#: ../../library/logging.rst:1441 msgid "The logger name." msgstr "" @@ -1936,7 +1976,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1424 +#: ../../library/logging.rst:1442 msgid "The logging level (numeric)." msgstr "" @@ -1944,7 +1984,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1425 +#: ../../library/logging.rst:1443 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1952,19 +1992,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1426 +#: ../../library/logging.rst:1444 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1427 +#: ../../library/logging.rst:1445 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1428 +#: ../../library/logging.rst:1446 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1429 +#: ../../library/logging.rst:1447 msgid "An exception tuple, or ``None``." msgstr "" @@ -1972,7 +2012,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1430 +#: ../../library/logging.rst:1448 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1980,7 +2020,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1432 +#: ../../library/logging.rst:1450 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1990,15 +2030,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1434 +#: ../../library/logging.rst:1452 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1438 +#: ../../library/logging.rst:1456 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1442 +#: ../../library/logging.rst:1460 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -2009,22 +2049,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1453 +#: ../../library/logging.rst:1471 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1455 +#: ../../library/logging.rst:1473 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1460 +#: ../../library/logging.rst:1478 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1463 +#: ../../library/logging.rst:1481 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2033,46 +2073,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1468 +#: ../../library/logging.rst:1486 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1476 +#: ../../library/logging.rst:1494 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1476 +#: ../../library/logging.rst:1494 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1479 +#: ../../library/logging.rst:1497 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1479 +#: ../../library/logging.rst:1497 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1483 +#: ../../library/logging.rst:1501 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1482 +#: ../../library/logging.rst:1500 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1488 +#: ../../library/logging.rst:1506 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1504 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " diff --git a/library/lzma.po b/library/lzma.po index aecb819a41..9ccd407592 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -103,7 +103,7 @@ msgstr "" #: ../../library/lzma.rst:65 msgid "Added support for the ``\"x\"``, ``\"xb\"`` and ``\"xt\"`` modes." -msgstr "" +msgstr "新增 ``\"x\"``、``\"xb\"`` 和 ``\"xt\"`` 模式的支援。" #: ../../library/lzma.rst:68 ../../library/lzma.rst:127 msgid "Accepts a :term:`path-like object`." @@ -172,7 +172,7 @@ msgstr "" #: ../../library/lzma.rst:120 msgid "Added support for the ``\"x\"`` and ``\"xb\"`` modes." -msgstr "" +msgstr "新增 ``\"x\"`` 和 ``\"xb\"`` 模式的支援。" #: ../../library/lzma.rst:123 msgid "" diff --git a/library/math.po b/library/math.po index fb3969ca2c..2a69da0cae 100644 --- a/library/math.po +++ b/library/math.po @@ -298,11 +298,11 @@ msgstr "" #: ../../library/math.rst:240 msgid "See also :func:`math.ulp`." -msgstr "另請參閱 :func:`math.ulp`\\ 。" +msgstr "另請參閱 :func:`math.ulp`。" #: ../../library/math.rst:242 msgid "Added the *steps* argument." -msgstr "" +msgstr "新增 *steps* 引數。" #: ../../library/math.rst:249 msgid "" diff --git a/library/optparse.po b/library/optparse.po index 6fb9346cbf..e1b0fcc815 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -1222,7 +1222,7 @@ msgstr "" #: ../../library/optparse.rst:1019 msgid "(default: ``\"store\"``)" -msgstr "" +msgstr "(預設值: ``\"store\"`` )" #: ../../library/optparse.rst:1021 msgid "" @@ -1233,7 +1233,7 @@ msgstr "" #: ../../library/optparse.rst:1027 msgid "(default: ``\"string\"``)" -msgstr "" +msgstr "(預設值: ``\"string\"`` )" #: ../../library/optparse.rst:1029 msgid "" @@ -1262,7 +1262,7 @@ msgstr "" #: ../../library/optparse.rst:1049 msgid "(default: 1)" -msgstr "" +msgstr "(預設值:1)" #: ../../library/optparse.rst:1051 msgid "" diff --git a/library/os.po b/library/os.po index 624383d5bb..c321c7d755 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-20 00:03+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -294,33 +294,33 @@ msgstr "" #: ../../library/os.rst:678 ../../library/os.rst:687 ../../library/os.rst:694 #: ../../library/os.rst:703 ../../library/os.rst:712 ../../library/os.rst:719 #: ../../library/os.rst:726 ../../library/os.rst:735 ../../library/os.rst:1161 -#: ../../library/os.rst:1305 ../../library/os.rst:1331 -#: ../../library/os.rst:1568 ../../library/os.rst:1607 -#: ../../library/os.rst:1616 ../../library/os.rst:1980 -#: ../../library/os.rst:2069 ../../library/os.rst:2109 -#: ../../library/os.rst:2389 ../../library/os.rst:2411 -#: ../../library/os.rst:3993 ../../library/os.rst:4000 -#: ../../library/os.rst:4007 ../../library/os.rst:4014 -#: ../../library/os.rst:4021 ../../library/os.rst:4028 -#: ../../library/os.rst:4035 ../../library/os.rst:4043 -#: ../../library/os.rst:4051 ../../library/os.rst:4058 -#: ../../library/os.rst:4065 ../../library/os.rst:4074 -#: ../../library/os.rst:4082 ../../library/os.rst:4090 -#: ../../library/os.rst:4097 ../../library/os.rst:4104 -#: ../../library/os.rst:4125 ../../library/os.rst:4142 -#: ../../library/os.rst:4182 ../../library/os.rst:4189 -#: ../../library/os.rst:4219 ../../library/os.rst:4346 -#: ../../library/os.rst:4395 ../../library/os.rst:4632 -#: ../../library/os.rst:4666 ../../library/os.rst:4724 -#: ../../library/os.rst:4738 ../../library/os.rst:4755 -#: ../../library/os.rst:4770 ../../library/os.rst:4781 -#: ../../library/os.rst:4793 ../../library/os.rst:4806 -#: ../../library/os.rst:4815 ../../library/os.rst:4825 -#: ../../library/os.rst:4838 ../../library/os.rst:4889 -#: ../../library/os.rst:4900 ../../library/os.rst:4912 -#: ../../library/os.rst:4919 ../../library/os.rst:4928 -#: ../../library/os.rst:4937 ../../library/os.rst:4946 -#: ../../library/os.rst:4955 +#: ../../library/os.rst:1345 ../../library/os.rst:1371 +#: ../../library/os.rst:1608 ../../library/os.rst:1647 +#: ../../library/os.rst:1656 ../../library/os.rst:2020 +#: ../../library/os.rst:2109 ../../library/os.rst:2149 +#: ../../library/os.rst:2429 ../../library/os.rst:2451 +#: ../../library/os.rst:4035 ../../library/os.rst:4042 +#: ../../library/os.rst:4049 ../../library/os.rst:4056 +#: ../../library/os.rst:4063 ../../library/os.rst:4070 +#: ../../library/os.rst:4077 ../../library/os.rst:4085 +#: ../../library/os.rst:4093 ../../library/os.rst:4100 +#: ../../library/os.rst:4107 ../../library/os.rst:4116 +#: ../../library/os.rst:4124 ../../library/os.rst:4132 +#: ../../library/os.rst:4139 ../../library/os.rst:4146 +#: ../../library/os.rst:4167 ../../library/os.rst:4184 +#: ../../library/os.rst:4224 ../../library/os.rst:4231 +#: ../../library/os.rst:4261 ../../library/os.rst:4388 +#: ../../library/os.rst:4437 ../../library/os.rst:4674 +#: ../../library/os.rst:4708 ../../library/os.rst:4766 +#: ../../library/os.rst:4780 ../../library/os.rst:4797 +#: ../../library/os.rst:4812 ../../library/os.rst:4823 +#: ../../library/os.rst:4835 ../../library/os.rst:4848 +#: ../../library/os.rst:4857 ../../library/os.rst:4867 +#: ../../library/os.rst:4880 ../../library/os.rst:4931 +#: ../../library/os.rst:4942 ../../library/os.rst:4954 +#: ../../library/os.rst:4961 ../../library/os.rst:4970 +#: ../../library/os.rst:4979 ../../library/os.rst:4988 +#: ../../library/os.rst:4997 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -371,7 +371,7 @@ msgstr "" #: ../../library/os.rst:216 msgid "" "On some platforms, including FreeBSD and macOS, setting ``environ`` may " -"cause memory leaks. Refer to the system documentation for :c:func:`putenv`." +"cause memory leaks. Refer to the system documentation for :c:func:`!putenv`." msgstr "" #: ../../library/os.rst:220 @@ -476,12 +476,12 @@ msgid "" msgstr "" #: ../../library/os.rst:322 ../../library/os.rst:1086 ../../library/os.rst:1097 -#: ../../library/os.rst:1110 ../../library/os.rst:1317 -#: ../../library/os.rst:1588 ../../library/os.rst:1756 -#: ../../library/os.rst:2489 ../../library/os.rst:3332 -#: ../../library/os.rst:3369 ../../library/os.rst:3985 -#: ../../library/os.rst:4483 ../../library/os.rst:4494 -#: ../../library/os.rst:4611 +#: ../../library/os.rst:1110 ../../library/os.rst:1357 +#: ../../library/os.rst:1628 ../../library/os.rst:1796 +#: ../../library/os.rst:2529 ../../library/os.rst:3374 +#: ../../library/os.rst:3411 ../../library/os.rst:4027 +#: ../../library/os.rst:4525 ../../library/os.rst:4536 +#: ../../library/os.rst:4653 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -504,17 +504,17 @@ msgstr "" #: ../../library/os.rst:787 ../../library/os.rst:1004 ../../library/os.rst:1019 #: ../../library/os.rst:1030 ../../library/os.rst:1053 #: ../../library/os.rst:1074 ../../library/os.rst:1138 -#: ../../library/os.rst:1150 ../../library/os.rst:1356 -#: ../../library/os.rst:1371 ../../library/os.rst:1384 -#: ../../library/os.rst:1453 ../../library/os.rst:1667 -#: ../../library/os.rst:1694 ../../library/os.rst:1729 -#: ../../library/os.rst:2052 ../../library/os.rst:2083 -#: ../../library/os.rst:2124 ../../library/os.rst:2137 -#: ../../library/os.rst:2455 ../../library/os.rst:2467 -#: ../../library/os.rst:3198 ../../library/os.rst:3355 -#: ../../library/os.rst:3588 ../../library/os.rst:5101 -#: ../../library/os.rst:5110 ../../library/os.rst:5131 -#: ../../library/os.rst:5141 ../../library/os.rst:5150 +#: ../../library/os.rst:1150 ../../library/os.rst:1396 +#: ../../library/os.rst:1411 ../../library/os.rst:1424 +#: ../../library/os.rst:1493 ../../library/os.rst:1707 +#: ../../library/os.rst:1734 ../../library/os.rst:1769 +#: ../../library/os.rst:2092 ../../library/os.rst:2123 +#: ../../library/os.rst:2164 ../../library/os.rst:2177 +#: ../../library/os.rst:2495 ../../library/os.rst:2507 +#: ../../library/os.rst:3240 ../../library/os.rst:3397 +#: ../../library/os.rst:3630 ../../library/os.rst:5143 +#: ../../library/os.rst:5152 ../../library/os.rst:5173 +#: ../../library/os.rst:5183 ../../library/os.rst:5192 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -586,10 +586,10 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3950 -#: ../../library/os.rst:4166 ../../library/os.rst:4464 -#: ../../library/os.rst:4588 ../../library/os.rst:4704 -#: ../../library/os.rst:4873 +#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3992 +#: ../../library/os.rst:4208 ../../library/os.rst:4506 +#: ../../library/os.rst:4630 ../../library/os.rst:4746 +#: ../../library/os.rst:4915 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -682,7 +682,7 @@ msgstr "" #: ../../library/os.rst:566 msgid "" "On some platforms, including FreeBSD and macOS, setting ``environ`` may " -"cause memory leaks. Refer to the system documentation for :c:func:`putenv`." +"cause memory leaks. Refer to the system documentation for :c:func:`!putenv`." msgstr "" #: ../../library/os.rst:569 @@ -773,14 +773,14 @@ msgstr ":func:`~os.unshare` 函式。" #: ../../library/os.rst:649 msgid "" -"Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on " +"Call the system call :c:func:`!setpgrp` or ``setpgrp(0, 0)`` depending on " "which version is implemented (if any). See the Unix manual for the " "semantics." msgstr "" #: ../../library/os.rst:657 msgid "" -"Call the system call :c:func:`setpgid` to set the process group id of the " +"Call the system call :c:func:`!setpgid` to set the process group id of the " "process with id *pid* to the process group with id *pgrp*. See the Unix " "manual for the semantics." msgstr "" @@ -887,7 +887,7 @@ msgid "" "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:789 ../../library/os.rst:4613 +#: ../../library/os.rst:789 ../../library/os.rst:4655 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1089,7 +1089,7 @@ msgstr "" msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" -#: ../../library/os.rst:976 ../../library/os.rst:1204 +#: ../../library/os.rst:976 ../../library/os.rst:1244 msgid "The new file descriptor is now non-inheritable." msgstr "" @@ -1116,8 +1116,8 @@ msgid "" "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:1002 ../../library/os.rst:2028 -#: ../../library/os.rst:2122 +#: ../../library/os.rst:1002 ../../library/os.rst:2068 +#: ../../library/os.rst:2162 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -1126,9 +1126,9 @@ msgstr "" "` ``os.chmod``。" #: ../../library/os.rst:1006 ../../library/os.rst:1021 -#: ../../library/os.rst:1112 ../../library/os.rst:1590 -#: ../../library/os.rst:2025 ../../library/os.rst:2054 -#: ../../library/os.rst:3334 +#: ../../library/os.rst:1112 ../../library/os.rst:1630 +#: ../../library/os.rst:2065 ../../library/os.rst:2094 +#: ../../library/os.rst:3376 msgid "" "The function is limited on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." @@ -1141,8 +1141,8 @@ msgid "" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:1017 ../../library/os.rst:2050 -#: ../../library/os.rst:2135 +#: ../../library/os.rst:1017 ../../library/os.rst:2090 +#: ../../library/os.rst:2175 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." @@ -1171,7 +1171,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:1046 ../../library/os.rst:2447 +#: ../../library/os.rst:1046 ../../library/os.rst:2487 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -1193,7 +1193,7 @@ msgstr "" msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:1065 ../../library/os.rst:2282 +#: ../../library/os.rst:1065 ../../library/os.rst:2322 msgid "The :func:`.stat` function." msgstr "" @@ -1207,7 +1207,7 @@ msgstr "" #: ../../library/os.rst:1079 msgid "" "Force write of file with filedescriptor *fd* to disk. On Unix, this calls " -"the native :c:func:`fsync` function; on Windows, the MS :c:func:`_commit` " +"the native :c:func:`!fsync` function; on Windows, the MS :c:func:`!_commit` " "function." msgstr "" @@ -1233,7 +1233,7 @@ msgstr "" "引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:1099 ../../library/os.rst:3373 +#: ../../library/os.rst:1099 ../../library/os.rst:3415 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" @@ -1248,11 +1248,11 @@ msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`set_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1115 ../../library/os.rst:1593 +#: ../../library/os.rst:1115 ../../library/os.rst:1633 msgid "On Windows, this function is limited to pipes." msgstr "" -#: ../../library/os.rst:1119 ../../library/os.rst:1597 +#: ../../library/os.rst:1119 ../../library/os.rst:1637 msgid "Added support for pipes on Windows." msgstr "新增對 Windows 上的 pipe 支援。" @@ -1290,26 +1290,109 @@ msgstr "" #: ../../library/os.rst:1168 msgid "" "Set the current position of file descriptor *fd* to position *pos*, modified " -"by *how*: :const:`SEEK_SET` or ``0`` to set the position relative to the " -"beginning of the file; :const:`SEEK_CUR` or ``1`` to set it relative to the " -"current position; :const:`SEEK_END` or ``2`` to set it relative to the end " -"of the file. Return the new cursor position in bytes, starting from the " -"beginning." +"by *whence*, and return the new position in bytes relative to the start of " +"the file. Valid values for *whence* are:" msgstr "" -#: ../../library/os.rst:1179 +#: ../../library/os.rst:1173 msgid "" -"Parameters to the :func:`lseek` function. Their values are 0, 1, and 2, " -"respectively." +":const:`SEEK_SET` or ``0`` -- set *pos* relative to the beginning of the file" +msgstr "" + +#: ../../library/os.rst:1174 +msgid "" +":const:`SEEK_CUR` or ``1`` -- set *pos* relative to the current file position" +msgstr "" + +#: ../../library/os.rst:1175 +msgid ":const:`SEEK_END` or ``2`` -- set *pos* relative to the end of the file" msgstr "" -#: ../../library/os.rst:1182 +#: ../../library/os.rst:1176 msgid "" -"Some operating systems could support additional values, like :const:`os." -"SEEK_HOLE` or :const:`os.SEEK_DATA`." +":const:`SEEK_HOLE` -- set *pos* to the next data location, relative to *pos*" msgstr "" -#: ../../library/os.rst:1189 +#: ../../library/os.rst:1177 +msgid "" +":const:`SEEK_DATA` -- set *pos* to the next data hole, relative to *pos*" +msgstr "" + +#: ../../library/os.rst:1181 +msgid "Add support for :const:`!SEEK_HOLE` and :const:`!SEEK_DATA`." +msgstr "" + +#: ../../library/os.rst:1188 +msgid "" +"Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek` " +"method on :term:`file-like objects `, for whence to adjust the " +"file position indicator." +msgstr "" + +#: ../../library/os.rst:1192 +msgid ":const:`SEEK_SET`" +msgstr ":const:`SEEK_SET`" + +#: ../../library/os.rst:1193 +msgid "Adjust the file position relative to the beginning of the file." +msgstr "" + +#: ../../library/os.rst:1194 +msgid ":const:`SEEK_CUR`" +msgstr ":const:`SEEK_CUR`" + +#: ../../library/os.rst:1195 +msgid "Adjust the file position relative to the current file position." +msgstr "" + +#: ../../library/os.rst:1197 +msgid ":const:`SEEK_END`" +msgstr ":const:`SEEK_END`" + +#: ../../library/os.rst:1197 +msgid "Adjust the file position relative to the end of the file." +msgstr "" + +#: ../../library/os.rst:1199 +msgid "Their values are 0, 1, and 2, respectively." +msgstr "" + +#: ../../library/os.rst:1205 +msgid "" +"Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek` " +"method on :term:`file-like objects `, for seeking file data and " +"holes on sparsely allocated files." +msgstr "" + +#: ../../library/os.rst:1211 +msgid ":data:`!SEEK_DATA`" +msgstr ":data:`!SEEK_DATA`" + +#: ../../library/os.rst:1210 +msgid "" +"Adjust the file offset to the next location containing data, relative to the " +"seek position." +msgstr "" + +#: ../../library/os.rst:1216 +msgid ":data:`!SEEK_HOLE`" +msgstr "" + +#: ../../library/os.rst:1214 +msgid "" +"Adjust the file offset to the next location containing a hole, relative to " +"the seek position. A hole is defined as a sequence of zeros." +msgstr "" + +#: ../../library/os.rst:1220 +msgid "These operations only make sense for filesystems that support them." +msgstr "" + +#: ../../library/os.rst:1222 +msgid ":ref:`Availability `: Linux >= 3.1, macOS, Unix" +msgstr ":ref:`適用 `:Linux 3.1 以上、macOS、Unix。" + +#: ../../library/os.rst:1229 msgid "" "Open the file *path* and set various flags according to *flags* and possibly " "its mode according to *mode*. When computing *mode*, the current umask " @@ -1317,7 +1400,7 @@ msgid "" "file. The new file descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:1194 +#: ../../library/os.rst:1234 msgid "" "For a description of the flag and mode values, see the C run-time " "documentation; flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) " @@ -1325,13 +1408,13 @@ msgid "" "const:`O_BINARY` is needed to open files in binary mode." msgstr "" -#: ../../library/os.rst:1199 +#: ../../library/os.rst:1239 msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." msgstr "" -#: ../../library/os.rst:1202 +#: ../../library/os.rst:1242 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -1339,7 +1422,7 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``flags`` 的\\ :ref:`稽核事件 " "` ``open``。" -#: ../../library/os.rst:1209 +#: ../../library/os.rst:1249 msgid "" "This function is intended for low-level I/O. For normal usage, use the " "built-in function :func:`open`, which returns a :term:`file object` with :" @@ -1347,39 +1430,39 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1214 ../../library/os.rst:2323 -#: ../../library/os.rst:2391 ../../library/os.rst:2413 -#: ../../library/os.rst:2494 ../../library/os.rst:2525 +#: ../../library/os.rst:1254 ../../library/os.rst:2363 +#: ../../library/os.rst:2431 ../../library/os.rst:2453 +#: ../../library/os.rst:2534 ../../library/os.rst:2565 msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" -#: ../../library/os.rst:1217 ../../library/os.rst:1536 -#: ../../library/os.rst:1711 ../../library/os.rst:4706 +#: ../../library/os.rst:1257 ../../library/os.rst:1576 +#: ../../library/os.rst:1751 ../../library/os.rst:4748 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" "exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/os.rst:1222 ../../library/os.rst:1922 -#: ../../library/os.rst:1954 ../../library/os.rst:1985 -#: ../../library/os.rst:2034 ../../library/os.rst:2071 -#: ../../library/os.rst:2111 ../../library/os.rst:2126 -#: ../../library/os.rst:2139 ../../library/os.rst:2198 -#: ../../library/os.rst:2290 ../../library/os.rst:2326 -#: ../../library/os.rst:2367 ../../library/os.rst:2394 -#: ../../library/os.rst:2416 ../../library/os.rst:2457 -#: ../../library/os.rst:2528 ../../library/os.rst:2547 -#: ../../library/os.rst:2635 ../../library/os.rst:2925 -#: ../../library/os.rst:3212 ../../library/os.rst:3376 -#: ../../library/os.rst:3392 ../../library/os.rst:3432 -#: ../../library/os.rst:3531 ../../library/os.rst:3592 -#: ../../library/os.rst:3776 ../../library/os.rst:3956 -#: ../../library/os.rst:4471 +#: ../../library/os.rst:1262 ../../library/os.rst:1962 +#: ../../library/os.rst:1994 ../../library/os.rst:2025 +#: ../../library/os.rst:2074 ../../library/os.rst:2111 +#: ../../library/os.rst:2151 ../../library/os.rst:2166 +#: ../../library/os.rst:2179 ../../library/os.rst:2238 +#: ../../library/os.rst:2330 ../../library/os.rst:2366 +#: ../../library/os.rst:2407 ../../library/os.rst:2434 +#: ../../library/os.rst:2456 ../../library/os.rst:2497 +#: ../../library/os.rst:2568 ../../library/os.rst:2587 +#: ../../library/os.rst:2675 ../../library/os.rst:2965 +#: ../../library/os.rst:3254 ../../library/os.rst:3418 +#: ../../library/os.rst:3434 ../../library/os.rst:3474 +#: ../../library/os.rst:3573 ../../library/os.rst:3634 +#: ../../library/os.rst:3818 ../../library/os.rst:3998 +#: ../../library/os.rst:4513 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1225 +#: ../../library/os.rst:1265 msgid "" "The following constants are options for the *flags* parameter to the :func:" "`~os.open` function. They can be combined using the bitwise OR operator ``|" @@ -1389,45 +1472,45 @@ msgid "" "on Windows." msgstr "" -#: ../../library/os.rst:1240 +#: ../../library/os.rst:1280 msgid "The above constants are available on Unix and Windows." msgstr "" -#: ../../library/os.rst:1251 +#: ../../library/os.rst:1291 msgid "The above constants are only available on Unix." msgstr "" -#: ../../library/os.rst:1253 +#: ../../library/os.rst:1293 msgid "Add :data:`O_CLOEXEC` constant." msgstr "" -#: ../../library/os.rst:1264 +#: ../../library/os.rst:1304 msgid "The above constants are only available on Windows." msgstr "" -#: ../../library/os.rst:1271 +#: ../../library/os.rst:1311 msgid "The above constants are only available on macOS." msgstr "" -#: ../../library/os.rst:1273 +#: ../../library/os.rst:1313 msgid "" "Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK` and :data:" "`O_NOFOLLOW_ANY` constants." msgstr "" -#: ../../library/os.rst:1287 +#: ../../library/os.rst:1327 msgid "" "The above constants are extensions and not present if they are not defined " "by the C library." msgstr "" -#: ../../library/os.rst:1290 +#: ../../library/os.rst:1330 msgid "" "Add :data:`O_PATH` on systems that support it. Add :data:`O_TMPFILE`, only " "available on Linux Kernel 3.11 or newer." msgstr "" -#: ../../library/os.rst:1300 +#: ../../library/os.rst:1340 msgid "" "Open a new pseudo-terminal pair. Return a pair of file descriptors " "``(master, slave)`` for the pty and the tty, respectively. The new file " @@ -1435,18 +1518,18 @@ msgid "" "more portable approach, use the :mod:`pty` module." msgstr "" -#: ../../library/os.rst:1307 ../../library/os.rst:1319 +#: ../../library/os.rst:1347 ../../library/os.rst:1359 msgid "The new file descriptors are now non-inheritable." msgstr "" -#: ../../library/os.rst:1313 +#: ../../library/os.rst:1353 msgid "" "Create a pipe. Return a pair of file descriptors ``(r, w)`` usable for " "reading and writing, respectively. The new file descriptor is :ref:`non-" "inheritable `." msgstr "" -#: ../../library/os.rst:1325 +#: ../../library/os.rst:1365 msgid "" "Create a pipe with *flags* set atomically. *flags* can be constructed by " "ORing together one or more of these values: :data:`O_NONBLOCK`, :data:" @@ -1454,17 +1537,17 @@ msgid "" "and writing, respectively." msgstr "" -#: ../../library/os.rst:1338 +#: ../../library/os.rst:1378 msgid "" "Ensures that enough disk space is allocated for the file specified by *fd* " "starting from *offset* and continuing for *len* bytes." msgstr "" -#: ../../library/os.rst:1341 +#: ../../library/os.rst:1381 msgid ":ref:`Availability `: Unix, not Emscripten." msgstr ":ref:`適用 `:Unix、非 Emscripten。" -#: ../../library/os.rst:1348 +#: ../../library/os.rst:1388 msgid "" "Announces an intention to access data in a specific pattern thus allowing " "the kernel to make optimizations. The advice applies to the region of the " @@ -1475,25 +1558,25 @@ msgid "" "`POSIX_FADV_DONTNEED`." msgstr "" -#: ../../library/os.rst:1368 +#: ../../library/os.rst:1408 msgid "" "Flags that can be used in *advice* in :func:`posix_fadvise` that specify the " "access pattern that is likely to be used." msgstr "" -#: ../../library/os.rst:1378 +#: ../../library/os.rst:1418 msgid "" "Read at most *n* bytes from file descriptor *fd* at a position of *offset*, " "leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1381 ../../library/os.rst:1525 +#: ../../library/os.rst:1421 ../../library/os.rst:1565 msgid "" "Return a bytestring containing the bytes read. If the end of the file " "referred to by *fd* has been reached, an empty bytes object is returned." msgstr "" -#: ../../library/os.rst:1391 +#: ../../library/os.rst:1431 msgid "" "Read from a file descriptor *fd* at a position of *offset* into mutable :" "term:`bytes-like objects ` *buffers*, leaving the file " @@ -1501,38 +1584,38 @@ msgid "" "move on to the next buffer in the sequence to hold the rest of the data." msgstr "" -#: ../../library/os.rst:1396 ../../library/os.rst:1466 +#: ../../library/os.rst:1436 ../../library/os.rst:1506 msgid "" "The flags argument contains a bitwise OR of zero or more of the following " "flags:" msgstr "" -#: ../../library/os.rst:1399 +#: ../../library/os.rst:1439 msgid ":data:`RWF_HIPRI`" msgstr ":data:`RWF_HIPRI`" -#: ../../library/os.rst:1400 +#: ../../library/os.rst:1440 msgid ":data:`RWF_NOWAIT`" msgstr ":data:`RWF_NOWAIT`" -#: ../../library/os.rst:1402 ../../library/os.rst:1661 +#: ../../library/os.rst:1442 ../../library/os.rst:1701 msgid "" "Return the total number of bytes actually read which can be less than the " "total capacity of all the objects." msgstr "" -#: ../../library/os.rst:1405 ../../library/os.rst:1475 -#: ../../library/os.rst:1664 ../../library/os.rst:1726 +#: ../../library/os.rst:1445 ../../library/os.rst:1515 +#: ../../library/os.rst:1704 ../../library/os.rst:1766 msgid "" "The operating system may set a limit (:func:`sysconf` value " "``'SC_IOV_MAX'``) on the number of buffers that can be used." msgstr "" -#: ../../library/os.rst:1408 +#: ../../library/os.rst:1448 msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: ../../library/os.rst:1410 ../../library/os.rst:1480 +#: ../../library/os.rst:1450 ../../library/os.rst:1520 msgid "" ":ref:`Availability `: Linux >= 2.6.30, FreeBSD >= 6.0, OpenBSD " ">= 2.7, AIX >= 7.1." @@ -1540,55 +1623,55 @@ msgstr "" ":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD 2.7 " "以上、AIX 7.1 以上。" -#: ../../library/os.rst:1412 ../../library/os.rst:1482 +#: ../../library/os.rst:1452 ../../library/os.rst:1522 msgid "Using flags requires Linux >= 4.6." msgstr "" -#: ../../library/os.rst:1419 +#: ../../library/os.rst:1459 msgid "" "Do not wait for data which is not immediately available. If this flag is " "specified, the system call will return instantly if it would have to read " "data from the backing storage or wait for a lock." msgstr "" -#: ../../library/os.rst:1423 +#: ../../library/os.rst:1463 msgid "" "If some data was successfully read, it will return the number of bytes read. " "If no bytes were read, it will return ``-1`` and set errno to :const:`errno." "EAGAIN`." msgstr "" -#: ../../library/os.rst:1427 +#: ../../library/os.rst:1467 msgid ":ref:`Availability `: Linux >= 4.14." msgstr ":ref:`適用 `:Linux 4.14 以上。" -#: ../../library/os.rst:1434 +#: ../../library/os.rst:1474 msgid "" "High priority read/write. Allows block-based filesystems to use polling of " "the device, which provides lower latency, but may use additional resources." msgstr "" -#: ../../library/os.rst:1438 +#: ../../library/os.rst:1478 msgid "" "Currently, on Linux, this feature is usable only on a file descriptor opened " "using the :data:`O_DIRECT` flag." msgstr "" -#: ../../library/os.rst:1441 +#: ../../library/os.rst:1481 msgid ":ref:`Availability `: Linux >= 4.6." msgstr ":ref:`適用 `:Linux 4.6 以上。" -#: ../../library/os.rst:1448 +#: ../../library/os.rst:1488 msgid "" "Write the bytestring in *str* to file descriptor *fd* at position of " "*offset*, leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1451 ../../library/os.rst:1701 +#: ../../library/os.rst:1491 ../../library/os.rst:1741 msgid "Return the number of bytes actually written." msgstr "" -#: ../../library/os.rst:1460 +#: ../../library/os.rst:1500 msgid "" "Write the *buffers* contents to file descriptor *fd* at a offset *offset*, " "leaving the file offset unchanged. *buffers* must be a sequence of :term:" @@ -1597,43 +1680,43 @@ msgid "" "the second, and so on." msgstr "" -#: ../../library/os.rst:1469 +#: ../../library/os.rst:1509 msgid ":data:`RWF_DSYNC`" msgstr ":data:`RWF_DSYNC`" -#: ../../library/os.rst:1470 +#: ../../library/os.rst:1510 msgid ":data:`RWF_SYNC`" msgstr ":data:`RWF_SYNC`" -#: ../../library/os.rst:1471 +#: ../../library/os.rst:1511 msgid ":data:`RWF_APPEND`" msgstr ":data:`RWF_APPEND`" -#: ../../library/os.rst:1473 +#: ../../library/os.rst:1513 msgid "Return the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1478 +#: ../../library/os.rst:1518 msgid "Combine the functionality of :func:`os.writev` and :func:`os.pwrite`." msgstr "" -#: ../../library/os.rst:1489 +#: ../../library/os.rst:1529 msgid "" "Provide a per-write equivalent of the :data:`O_DSYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1492 ../../library/os.rst:1502 +#: ../../library/os.rst:1532 ../../library/os.rst:1542 msgid ":ref:`Availability `: Linux >= 4.7." msgstr ":ref:`適用 `:Linux 4.7 以上。" -#: ../../library/os.rst:1499 +#: ../../library/os.rst:1539 msgid "" "Provide a per-write equivalent of the :data:`O_SYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1509 +#: ../../library/os.rst:1549 msgid "" "Provide a per-write equivalent of the :data:`O_APPEND` :func:`os.open` flag. " "This flag is meaningful only for :func:`os.pwritev`, and its effect applies " @@ -1643,15 +1726,15 @@ msgid "" "*offset* is updated." msgstr "" -#: ../../library/os.rst:1516 +#: ../../library/os.rst:1556 msgid ":ref:`Availability `: Linux >= 4.16." msgstr ":ref:`適用 `:Linux 4.16 以上。" -#: ../../library/os.rst:1523 +#: ../../library/os.rst:1563 msgid "Read at most *n* bytes from file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1530 +#: ../../library/os.rst:1570 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To read a \"file " @@ -1660,26 +1743,26 @@ msgid "" "`~file.readline` methods." msgstr "" -#: ../../library/os.rst:1545 +#: ../../library/os.rst:1585 msgid "" "Copy *count* bytes from file descriptor *in_fd* to file descriptor *out_fd* " "starting at *offset*. Return the number of bytes sent. When EOF is reached " "return ``0``." msgstr "" -#: ../../library/os.rst:1549 +#: ../../library/os.rst:1589 msgid "" "The first function notation is supported by all platforms that define :func:" "`sendfile`." msgstr "" -#: ../../library/os.rst:1552 +#: ../../library/os.rst:1592 msgid "" "On Linux, if *offset* is given as ``None``, the bytes are read from the " "current position of *in_fd* and the position of *in_fd* is updated." msgstr "" -#: ../../library/os.rst:1555 +#: ../../library/os.rst:1595 msgid "" "The second case may be used on macOS and FreeBSD where *headers* and " "*trailers* are arbitrary sequences of buffers that are written before and " @@ -1687,59 +1770,59 @@ msgid "" "case." msgstr "" -#: ../../library/os.rst:1559 +#: ../../library/os.rst:1599 msgid "" "On macOS and FreeBSD, a value of ``0`` for *count* specifies to send until " "the end of *in_fd* is reached." msgstr "" -#: ../../library/os.rst:1562 +#: ../../library/os.rst:1602 msgid "" "All platforms support sockets as *out_fd* file descriptor, and some " "platforms allow other types (e.g. regular file, pipe) as well." msgstr "" -#: ../../library/os.rst:1565 +#: ../../library/os.rst:1605 msgid "" "Cross-platform applications should not use *headers*, *trailers* and *flags* " "arguments." msgstr "" -#: ../../library/os.rst:1572 +#: ../../library/os.rst:1612 msgid "" "For a higher-level wrapper of :func:`sendfile`, see :meth:`socket.socket." "sendfile`." msgstr "" -#: ../../library/os.rst:1577 +#: ../../library/os.rst:1617 msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: ../../library/os.rst:1583 +#: ../../library/os.rst:1623 msgid "" "Set the blocking mode of the specified file descriptor. Set the :data:" "`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise." msgstr "" -#: ../../library/os.rst:1586 +#: ../../library/os.rst:1626 msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1604 +#: ../../library/os.rst:1644 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: ../../library/os.rst:1613 +#: ../../library/os.rst:1653 msgid "" "Parameter to the :func:`sendfile` function, if the implementation supports " "it. The data won't be cached in the virtual memory and will be freed " "afterwards." msgstr "" -#: ../../library/os.rst:1623 +#: ../../library/os.rst:1663 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1751,7 +1834,7 @@ msgid "" "`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:1632 +#: ../../library/os.rst:1672 msgid "" "This copy is done without the additional cost of transferring data from the " "kernel to user space and then back into the kernel. Additionally, some " @@ -1759,7 +1842,7 @@ msgid "" "files are opened as binary." msgstr "" -#: ../../library/os.rst:1637 +#: ../../library/os.rst:1677 msgid "" "Upon successful completion, returns the number of bytes spliced to or from " "the pipe. A return value of 0 means end of input. If *src* refers to a pipe, " @@ -1768,11 +1851,11 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1643 +#: ../../library/os.rst:1683 msgid ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" -#: ../../library/os.rst:1656 +#: ../../library/os.rst:1696 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects ` *buffers*. Transfer data into each buffer until " @@ -1780,34 +1863,34 @@ msgid "" "rest of the data." msgstr "" -#: ../../library/os.rst:1674 +#: ../../library/os.rst:1714 msgid "" "Return the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`)." msgstr "" -#: ../../library/os.rst:1677 ../../library/os.rst:1685 +#: ../../library/os.rst:1717 ../../library/os.rst:1725 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/os.rst:1682 +#: ../../library/os.rst:1722 msgid "" "Set the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`) to *pg*." msgstr "" -#: ../../library/os.rst:1690 +#: ../../library/os.rst:1730 msgid "" "Return a string which specifies the terminal device associated with file " "descriptor *fd*. If *fd* is not associated with a terminal device, an " "exception is raised." msgstr "" -#: ../../library/os.rst:1699 +#: ../../library/os.rst:1739 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1705 +#: ../../library/os.rst:1745 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To write a " @@ -1816,7 +1899,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: ../../library/os.rst:1719 +#: ../../library/os.rst:1759 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects `. Buffers are " @@ -1824,70 +1907,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: ../../library/os.rst:1724 +#: ../../library/os.rst:1764 msgid "Returns the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1737 +#: ../../library/os.rst:1777 msgid "Querying the size of a terminal" msgstr "" -#: ../../library/os.rst:1743 +#: ../../library/os.rst:1783 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: ../../library/os.rst:1746 +#: ../../library/os.rst:1786 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: ../../library/os.rst:1749 +#: ../../library/os.rst:1789 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: ../../library/os.rst:1752 +#: ../../library/os.rst:1792 msgid "" ":func:`shutil.get_terminal_size` is the high-level function which should " "normally be used, ``os.get_terminal_size`` is the low-level implementation." msgstr "" -#: ../../library/os.rst:1760 +#: ../../library/os.rst:1800 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: ../../library/os.rst:1764 +#: ../../library/os.rst:1804 msgid "Width of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1768 +#: ../../library/os.rst:1808 msgid "Height of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1774 +#: ../../library/os.rst:1814 msgid "Inheritance of File Descriptors" msgstr "" -#: ../../library/os.rst:1778 +#: ../../library/os.rst:1818 msgid "" "A file descriptor has an \"inheritable\" flag which indicates if the file " "descriptor can be inherited by child processes. Since Python 3.4, file " "descriptors created by Python are non-inheritable by default." msgstr "" -#: ../../library/os.rst:1782 +#: ../../library/os.rst:1822 msgid "" "On UNIX, non-inheritable file descriptors are closed in child processes at " "the execution of a new program, other file descriptors are inherited." msgstr "" -#: ../../library/os.rst:1785 +#: ../../library/os.rst:1825 msgid "" "On Windows, non-inheritable handles and file descriptors are closed in child " "processes, except for standard streams (file descriptors 0, 1 and 2: stdin, " @@ -1898,46 +1981,46 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1793 +#: ../../library/os.rst:1833 msgid "" "On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, the file " "descriptor cannot be modified." msgstr "" -#: ../../library/os.rst:1798 +#: ../../library/os.rst:1838 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1802 +#: ../../library/os.rst:1842 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1806 +#: ../../library/os.rst:1846 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1808 ../../library/os.rst:1814 -#: ../../library/os.rst:3881 ../../library/os.rst:4506 -#: ../../library/os.rst:4551 +#: ../../library/os.rst:1848 ../../library/os.rst:1854 +#: ../../library/os.rst:3923 ../../library/os.rst:4548 +#: ../../library/os.rst:4593 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:1812 +#: ../../library/os.rst:1852 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:1820 +#: ../../library/os.rst:1860 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:1822 +#: ../../library/os.rst:1862 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:1827 +#: ../../library/os.rst:1867 msgid "" "**specifying a file descriptor:** Normally the *path* argument provided to " "functions in the :mod:`os` module must be a string specifying a file path. " @@ -1948,7 +2031,7 @@ msgid "" "``chdir``).)" msgstr "" -#: ../../library/os.rst:1835 +#: ../../library/os.rst:1875 msgid "" "You can check whether or not *path* can be specified as a file descriptor " "for a particular function on your platform using :data:`os.supports_fd`. If " @@ -1956,13 +2039,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1840 +#: ../../library/os.rst:1880 msgid "" "If the function also supports *dir_fd* or *follow_symlinks* arguments, it's " "an error to specify one of those when supplying *path* as a file descriptor." msgstr "" -#: ../../library/os.rst:1845 +#: ../../library/os.rst:1885 msgid "" "**paths relative to directory descriptors:** If *dir_fd* is not ``None``, it " "should be a file descriptor referring to a directory, and the path to " @@ -1973,14 +2056,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:1852 +#: ../../library/os.rst:1892 msgid "" "You can check whether or not *dir_fd* is supported for a particular function " "on your platform using :data:`os.supports_dir_fd`. If it's unavailable, " "using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1858 +#: ../../library/os.rst:1898 msgid "" "**not following symlinks:** If *follow_symlinks* is ``False``, and the last " "element of the path to operate on is a symbolic link, the function will " @@ -1989,14 +2072,14 @@ msgid "" "function.)" msgstr "" -#: ../../library/os.rst:1864 +#: ../../library/os.rst:1904 msgid "" "You can check whether or not *follow_symlinks* is supported for a particular " "function on your platform using :data:`os.supports_follow_symlinks`. If it's " "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1872 +#: ../../library/os.rst:1912 msgid "" "Use the real uid/gid to test for access to *path*. Note that most " "operations will use the effective uid/gid, therefore this routine can be " @@ -2008,13 +2091,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:1881 +#: ../../library/os.rst:1921 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1884 +#: ../../library/os.rst:1924 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -2023,7 +2106,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1892 +#: ../../library/os.rst:1932 msgid "" "Using :func:`access` to check if a user is authorized to e.g. open a file " "before actually doing so using :func:`open` creates a security hole, because " @@ -2032,117 +2115,117 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:1903 +#: ../../library/os.rst:1943 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:1915 +#: ../../library/os.rst:1955 msgid "" "I/O operations may fail even when :func:`access` indicates that they would " "succeed, particularly for operations on network filesystems which may have " "permissions semantics beyond the usual POSIX permission-bit model." msgstr "" -#: ../../library/os.rst:1919 +#: ../../library/os.rst:1959 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "新增 *dir_fd*\\ 、\\ *effective_ids* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:1931 +#: ../../library/os.rst:1971 msgid "" "Values to pass as the *mode* parameter of :func:`access` to test the " "existence, readability, writability and executability of *path*, " "respectively." msgstr "" -#: ../../library/os.rst:1940 +#: ../../library/os.rst:1980 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:1942 +#: ../../library/os.rst:1982 msgid "" "This function can support :ref:`specifying a file descriptor `. " "The descriptor must refer to an opened directory, not an open file." msgstr "" -#: ../../library/os.rst:1945 +#: ../../library/os.rst:1985 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:1948 ../../library/os.rst:2081 +#: ../../library/os.rst:1988 ../../library/os.rst:2121 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.chdir``。" -#: ../../library/os.rst:1950 +#: ../../library/os.rst:1990 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:1960 +#: ../../library/os.rst:2000 msgid "" "Set the flags of *path* to the numeric *flags*. *flags* may take a " "combination (bitwise OR) of the following values (as defined in the :mod:" "`stat` module):" msgstr "" -#: ../../library/os.rst:1963 +#: ../../library/os.rst:2003 msgid ":const:`stat.UF_NODUMP`" msgstr ":const:`stat.UF_NODUMP`" -#: ../../library/os.rst:1964 +#: ../../library/os.rst:2004 msgid ":const:`stat.UF_IMMUTABLE`" msgstr ":const:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:1965 +#: ../../library/os.rst:2005 msgid ":const:`stat.UF_APPEND`" msgstr ":const:`stat.UF_APPEND`" -#: ../../library/os.rst:1966 +#: ../../library/os.rst:2006 msgid ":const:`stat.UF_OPAQUE`" msgstr ":const:`stat.UF_OPAQUE`" -#: ../../library/os.rst:1967 +#: ../../library/os.rst:2007 msgid ":const:`stat.UF_NOUNLINK`" msgstr ":const:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:1968 +#: ../../library/os.rst:2008 msgid ":const:`stat.UF_COMPRESSED`" msgstr ":const:`stat.UF_COMPRESSED`" -#: ../../library/os.rst:1969 +#: ../../library/os.rst:2009 msgid ":const:`stat.UF_HIDDEN`" msgstr ":const:`stat.UF_HIDDEN`" -#: ../../library/os.rst:1970 +#: ../../library/os.rst:2010 msgid ":const:`stat.SF_ARCHIVED`" msgstr ":const:`stat.SF_ARCHIVED`" -#: ../../library/os.rst:1971 +#: ../../library/os.rst:2011 msgid ":const:`stat.SF_IMMUTABLE`" msgstr ":const:`stat.SF_IMMUTABLE`" -#: ../../library/os.rst:1972 +#: ../../library/os.rst:2012 msgid ":const:`stat.SF_APPEND`" msgstr ":const:`stat.SF_APPEND`" -#: ../../library/os.rst:1973 +#: ../../library/os.rst:2013 msgid ":const:`stat.SF_NOUNLINK`" msgstr ":const:`stat.SF_NOUNLINK`" -#: ../../library/os.rst:1974 +#: ../../library/os.rst:2014 msgid ":const:`stat.SF_SNAPSHOT`" msgstr ":const:`stat.SF_SNAPSHOT`" -#: ../../library/os.rst:1976 +#: ../../library/os.rst:2016 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1978 ../../library/os.rst:2107 +#: ../../library/os.rst:2018 ../../library/os.rst:2147 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." @@ -2150,164 +2233,164 @@ msgstr "" "引發一個附帶引數 ``path``、``flags`` 的\\ :ref:`稽核事件 ` ``os." "chflags``。" -#: ../../library/os.rst:1982 +#: ../../library/os.rst:2022 msgid "The *follow_symlinks* argument." msgstr "*follow_symlinks* 引數。" -#: ../../library/os.rst:1991 +#: ../../library/os.rst:2031 msgid "" "Change the mode of *path* to the numeric *mode*. *mode* may take one of the " "following values (as defined in the :mod:`stat` module) or bitwise ORed " "combinations of them:" msgstr "" -#: ../../library/os.rst:1995 +#: ../../library/os.rst:2035 msgid ":const:`stat.S_ISUID`" msgstr ":const:`stat.S_ISUID`" -#: ../../library/os.rst:1996 +#: ../../library/os.rst:2036 msgid ":const:`stat.S_ISGID`" msgstr ":const:`stat.S_ISGID`" -#: ../../library/os.rst:1997 +#: ../../library/os.rst:2037 msgid ":const:`stat.S_ENFMT`" msgstr ":const:`stat.S_ENFMT`" -#: ../../library/os.rst:1998 +#: ../../library/os.rst:2038 msgid ":const:`stat.S_ISVTX`" msgstr ":const:`stat.S_ISVTX`" -#: ../../library/os.rst:1999 +#: ../../library/os.rst:2039 msgid ":const:`stat.S_IREAD`" msgstr ":const:`stat.S_IREAD`" -#: ../../library/os.rst:2000 +#: ../../library/os.rst:2040 msgid ":const:`stat.S_IWRITE`" msgstr ":const:`stat.S_IWRITE`" -#: ../../library/os.rst:2001 +#: ../../library/os.rst:2041 msgid ":const:`stat.S_IEXEC`" msgstr ":const:`stat.S_IEXEC`" -#: ../../library/os.rst:2002 +#: ../../library/os.rst:2042 msgid ":const:`stat.S_IRWXU`" msgstr ":const:`stat.S_IRWXU`" -#: ../../library/os.rst:2003 +#: ../../library/os.rst:2043 msgid ":const:`stat.S_IRUSR`" msgstr ":const:`stat.S_IRUSR`" -#: ../../library/os.rst:2004 +#: ../../library/os.rst:2044 msgid ":const:`stat.S_IWUSR`" msgstr ":const:`stat.S_IWUSR`" -#: ../../library/os.rst:2005 +#: ../../library/os.rst:2045 msgid ":const:`stat.S_IXUSR`" msgstr ":const:`stat.S_IXUSR`" -#: ../../library/os.rst:2006 +#: ../../library/os.rst:2046 msgid ":const:`stat.S_IRWXG`" msgstr ":const:`stat.S_IRWXG`" -#: ../../library/os.rst:2007 +#: ../../library/os.rst:2047 msgid ":const:`stat.S_IRGRP`" msgstr ":const:`stat.S_IRGRP`" -#: ../../library/os.rst:2008 +#: ../../library/os.rst:2048 msgid ":const:`stat.S_IWGRP`" msgstr ":const:`stat.S_IWGRP`" -#: ../../library/os.rst:2009 +#: ../../library/os.rst:2049 msgid ":const:`stat.S_IXGRP`" msgstr ":const:`stat.S_IXGRP`" -#: ../../library/os.rst:2010 +#: ../../library/os.rst:2050 msgid ":const:`stat.S_IRWXO`" msgstr ":const:`stat.S_IRWXO`" -#: ../../library/os.rst:2011 +#: ../../library/os.rst:2051 msgid ":const:`stat.S_IROTH`" msgstr ":const:`stat.S_IROTH`" -#: ../../library/os.rst:2012 +#: ../../library/os.rst:2052 msgid ":const:`stat.S_IWOTH`" msgstr ":const:`stat.S_IWOTH`" -#: ../../library/os.rst:2013 +#: ../../library/os.rst:2053 msgid ":const:`stat.S_IXOTH`" msgstr ":const:`stat.S_IXOTH`" -#: ../../library/os.rst:2015 ../../library/os.rst:2043 -#: ../../library/os.rst:3422 +#: ../../library/os.rst:2055 ../../library/os.rst:2083 +#: ../../library/os.rst:3464 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " "following symlinks `." msgstr "" -#: ../../library/os.rst:2021 +#: ../../library/os.rst:2061 msgid "" "Although Windows supports :func:`chmod`, you can only set the file's read-" "only flag with it (via the ``stat.S_IWRITE`` and ``stat.S_IREAD`` constants " "or a corresponding integer value). All other bits are ignored." msgstr "" -#: ../../library/os.rst:2030 ../../library/os.rst:2057 +#: ../../library/os.rst:2070 ../../library/os.rst:2097 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:2040 +#: ../../library/os.rst:2080 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. To " "leave one of the ids unchanged, set it to -1." msgstr "" -#: ../../library/os.rst:2047 +#: ../../library/os.rst:2087 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:2061 +#: ../../library/os.rst:2101 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2067 +#: ../../library/os.rst:2107 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:2077 +#: ../../library/os.rst:2117 msgid "" "Change the current working directory to the directory represented by the " "file descriptor *fd*. The descriptor must refer to an opened directory, not " "an open file. As of Python 3.3, this is equivalent to ``os.chdir(fd)``." msgstr "" -#: ../../library/os.rst:2088 +#: ../../library/os.rst:2128 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:2093 +#: ../../library/os.rst:2133 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:2095 +#: ../../library/os.rst:2135 msgid "" "The function now uses the UTF-8 encoding on Windows, rather than the ANSI " "code page: see :pep:`529` for the rationale. The function is no longer " "deprecated on Windows." msgstr "" -#: ../../library/os.rst:2103 +#: ../../library/os.rst:2143 msgid "" "Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do " "not follow symbolic links. As of Python 3.3, this is equivalent to ``os." "chflags(path, flags, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2117 +#: ../../library/os.rst:2157 msgid "" "Change the mode of *path* to the numeric *mode*. If path is a symlink, this " "affects the symlink rather than the target. See the docs for :func:`chmod` " @@ -2315,25 +2398,25 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2131 +#: ../../library/os.rst:2171 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. " "This function will not follow symbolic links. As of Python 3.3, this is " "equivalent to ``os.chown(path, uid, gid, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2145 +#: ../../library/os.rst:2185 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2147 +#: ../../library/os.rst:2187 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `, and :ref:" "`not following symlinks `." msgstr "" -#: ../../library/os.rst:2151 +#: ../../library/os.rst:2191 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2341,24 +2424,24 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.link``。" -#: ../../library/os.rst:2153 +#: ../../library/os.rst:2193 msgid ":ref:`Availability `: Unix, Windows, not Emscripten." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten。" -#: ../../library/os.rst:2155 +#: ../../library/os.rst:2195 msgid "Added Windows support." msgstr "新支援 Windows。" -#: ../../library/os.rst:2158 +#: ../../library/os.rst:2198 msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* arguments." msgstr "增加 *src_dir_fd*\\ 、\\ *dst_dir_fd* 與 *follow_symlinks* 引數。" -#: ../../library/os.rst:2161 ../../library/os.rst:2579 -#: ../../library/os.rst:2616 ../../library/os.rst:3344 +#: ../../library/os.rst:2201 ../../library/os.rst:2619 +#: ../../library/os.rst:2656 ../../library/os.rst:3386 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:2167 +#: ../../library/os.rst:2207 msgid "" "Return a list containing the names of the entries in the directory given by " "*path*. The list is in arbitrary order, and does not include the special " @@ -2367,7 +2450,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:2173 +#: ../../library/os.rst:2213 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2375,42 +2458,42 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2178 ../../library/os.rst:2664 +#: ../../library/os.rst:2218 ../../library/os.rst:2704 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:2181 +#: ../../library/os.rst:2221 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listdir``。" -#: ../../library/os.rst:2184 +#: ../../library/os.rst:2224 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:2188 +#: ../../library/os.rst:2228 msgid "" "The :func:`scandir` function returns directory entries along with file " "attribute information, giving better performance for many common use cases." msgstr "" -#: ../../library/os.rst:2192 +#: ../../library/os.rst:2232 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2195 ../../library/os.rst:3203 +#: ../../library/os.rst:2235 ../../library/os.rst:3245 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2204 +#: ../../library/os.rst:2244 msgid "Return a list containing the names of drives on a Windows system." msgstr "" -#: ../../library/os.rst:2206 +#: ../../library/os.rst:2246 msgid "" "A drive name typically looks like ``'C:\\\\'``. Not every drive name will be " "associated with a volume, and some may be inaccessible for a variety of " @@ -2418,27 +2501,27 @@ msgid "" "function does not test for access." msgstr "" -#: ../../library/os.rst:2211 +#: ../../library/os.rst:2251 msgid "May raise :exc:`OSError` if an error occurs collecting the drive names." msgstr "" -#: ../../library/os.rst:2214 +#: ../../library/os.rst:2254 msgid "" "Raises an :ref:`auditing event ` ``os.listdrives`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listdrives``。" -#: ../../library/os.rst:2216 ../../library/os.rst:2240 -#: ../../library/os.rst:2260 +#: ../../library/os.rst:2256 ../../library/os.rst:2280 +#: ../../library/os.rst:2300 msgid ":ref:`Availability `: Windows" msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:2223 +#: ../../library/os.rst:2263 msgid "" "Return a list containing the mount points for a volume on a Windows system." msgstr "" -#: ../../library/os.rst:2226 +#: ../../library/os.rst:2266 msgid "" "*volume* must be represented as a GUID path, like those returned by :func:" "`os.listvolumes`. Volumes may be mounted in multiple locations or not at " @@ -2446,19 +2529,19 @@ msgid "" "associated with a volume will not be returned by this function." msgstr "" -#: ../../library/os.rst:2232 +#: ../../library/os.rst:2272 msgid "" "The mount points return by this function will be absolute paths, and may be " "longer than the drive name." msgstr "" -#: ../../library/os.rst:2235 +#: ../../library/os.rst:2275 msgid "" "Raises :exc:`OSError` if the volume is not recognized or if an error occurs " "collecting the paths." msgstr "" -#: ../../library/os.rst:2238 +#: ../../library/os.rst:2278 msgid "" "Raises an :ref:`auditing event ` ``os.listmounts`` with argument " "``volume``." @@ -2466,11 +2549,11 @@ msgstr "" "引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 ` ``os." "listmounts``。" -#: ../../library/os.rst:2247 +#: ../../library/os.rst:2287 msgid "Return a list containing the volumes in the system." msgstr "" -#: ../../library/os.rst:2249 +#: ../../library/os.rst:2289 msgid "" "Volumes are typically represented as a GUID path that looks like ``\\\\?" "\\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\\``. Files can usually be " @@ -2479,53 +2562,53 @@ msgid "" "function is to retrieve mount points using :func:`os.listmounts`." msgstr "" -#: ../../library/os.rst:2256 +#: ../../library/os.rst:2296 msgid "May raise :exc:`OSError` if an error occurs collecting the volumes." msgstr "" -#: ../../library/os.rst:2258 +#: ../../library/os.rst:2298 msgid "" "Raises an :ref:`auditing event ` ``os.listvolumes`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listvolumes``。" -#: ../../library/os.rst:2267 +#: ../../library/os.rst:2307 msgid "" -"Perform the equivalent of an :c:func:`lstat` system call on the given path. " +"Perform the equivalent of an :c:func:`!lstat` system call on the given path. " "Similar to :func:`~os.stat`, but does not follow symbolic links. Return a :" "class:`stat_result` object." msgstr "" -#: ../../library/os.rst:2271 +#: ../../library/os.rst:2311 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2274 +#: ../../library/os.rst:2314 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2277 ../../library/os.rst:2315 -#: ../../library/os.rst:2380 ../../library/os.rst:2408 -#: ../../library/os.rst:2482 +#: ../../library/os.rst:2317 ../../library/os.rst:2355 +#: ../../library/os.rst:2420 ../../library/os.rst:2448 +#: ../../library/os.rst:2522 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2284 ../../library/os.rst:2491 -#: ../../library/os.rst:3337 +#: ../../library/os.rst:2324 ../../library/os.rst:2531 +#: ../../library/os.rst:3379 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2287 +#: ../../library/os.rst:2327 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" -#: ../../library/os.rst:2293 +#: ../../library/os.rst:2333 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2533,18 +2616,18 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2302 +#: ../../library/os.rst:2342 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2304 +#: ../../library/os.rst:2344 msgid "" "If the directory already exists, :exc:`FileExistsError` is raised. If a " "parent directory in the path does not exist, :exc:`FileNotFoundError` is " "raised." msgstr "" -#: ../../library/os.rst:2309 +#: ../../library/os.rst:2349 msgid "" "On some systems, *mode* is ignored. Where it is used, the current umask " "value is first masked out. If bits other than the last 9 (i.e. the last 3 " @@ -2553,13 +2636,13 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2318 +#: ../../library/os.rst:2358 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:2321 ../../library/os.rst:2355 +#: ../../library/os.rst:2361 ../../library/os.rst:2395 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -2567,13 +2650,13 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.mkdir``。" -#: ../../library/os.rst:2336 +#: ../../library/os.rst:2376 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2339 +#: ../../library/os.rst:2379 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2582,27 +2665,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2345 +#: ../../library/os.rst:2385 msgid "" "If *exist_ok* is ``False`` (the default), a :exc:`FileExistsError` is raised " "if the target directory already exists." msgstr "" -#: ../../library/os.rst:2350 +#: ../../library/os.rst:2390 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2353 +#: ../../library/os.rst:2393 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2357 +#: ../../library/os.rst:2397 msgid "The *exist_ok* parameter." msgstr "*exist_ok* 參數。" -#: ../../library/os.rst:2362 +#: ../../library/os.rst:2402 msgid "" "Before Python 3.4.1, if *exist_ok* was ``True`` and the directory existed, :" "func:`makedirs` would still raise an error if *mode* did not match the mode " @@ -2610,19 +2693,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2370 +#: ../../library/os.rst:2410 msgid "" "The *mode* argument no longer affects the file permission bits of newly " "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2377 +#: ../../library/os.rst:2417 msgid "" "Create a FIFO (a named pipe) named *path* with numeric mode *mode*. The " "current umask value is first masked out from the mode." msgstr "" -#: ../../library/os.rst:2383 +#: ../../library/os.rst:2423 msgid "" "FIFOs are pipes that can be accessed like regular files. FIFOs exist until " "they are deleted (for example with :func:`os.unlink`). Generally, FIFOs are " @@ -2632,7 +2715,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2400 +#: ../../library/os.rst:2440 msgid "" "Create a filesystem node (file, device special file or named pipe) named " "*path*. *mode* specifies both the permissions to use and the type of node to " @@ -2643,23 +2726,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2422 +#: ../../library/os.rst:2462 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2428 +#: ../../library/os.rst:2468 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2434 +#: ../../library/os.rst:2474 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2439 +#: ../../library/os.rst:2479 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2670,20 +2753,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2452 ../../library/os.rst:3196 -#: ../../library/os.rst:3365 +#: ../../library/os.rst:2492 ../../library/os.rst:3238 +#: ../../library/os.rst:3407 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2463 +#: ../../library/os.rst:2503 msgid "" "Dictionary mapping names accepted by :func:`pathconf` and :func:`fpathconf` " "to the integer values defined for those names by the host operating system. " "This can be used to determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:2472 +#: ../../library/os.rst:2512 msgid "" "Return a string representing the path to which the symbolic link points. " "The result may be either an absolute or relative pathname; if it is " @@ -2691,7 +2774,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2477 +#: ../../library/os.rst:2517 msgid "" "If the *path* is a string object (directly or indirectly through a :class:" "`PathLike` interface), the result will also be a string object, and the call " @@ -2699,42 +2782,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2485 +#: ../../library/os.rst:2525 msgid "" "When trying to resolve a path that may contain links, use :func:`~os.path." "realpath` to properly handle recursion and platform differences." msgstr "" -#: ../../library/os.rst:2497 +#: ../../library/os.rst:2537 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2500 +#: ../../library/os.rst:2540 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2503 +#: ../../library/os.rst:2543 msgid "" "Added support for directory junctions, and changed to return the " "substitution path (which typically includes ``\\\\?\\`` prefix) rather than " "the optional \"print name\" field that was previously returned." msgstr "" -#: ../../library/os.rst:2510 +#: ../../library/os.rst:2550 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " "does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/os.rst:2514 ../../library/os.rst:2627 -#: ../../library/os.rst:3316 +#: ../../library/os.rst:2554 ../../library/os.rst:2667 +#: ../../library/os.rst:3358 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2517 +#: ../../library/os.rst:2557 msgid "" "On Windows, attempting to remove a file that is in use causes an exception " "to be raised; on Unix, the directory entry is removed but the storage " @@ -2742,12 +2825,12 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2521 +#: ../../library/os.rst:2561 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2523 ../../library/os.rst:2545 -#: ../../library/os.rst:3387 +#: ../../library/os.rst:2563 ../../library/os.rst:2585 +#: ../../library/os.rst:3429 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -2755,7 +2838,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "remove``。" -#: ../../library/os.rst:2536 +#: ../../library/os.rst:2576 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2767,20 +2850,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2553 +#: ../../library/os.rst:2593 msgid "" "Rename the file or directory *src* to *dst*. If *dst* exists, the operation " "will fail with an :exc:`OSError` subclass in a number of cases:" msgstr "" -#: ../../library/os.rst:2556 +#: ../../library/os.rst:2596 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " "operation may fail if *src* and *dst* are on different filesystems. Use :" "func:`shutil.move` to support moves to a different filesystem." msgstr "" -#: ../../library/os.rst:2560 +#: ../../library/os.rst:2600 msgid "" "On Unix, if *src* is a file and *dst* is a directory or vice-versa, an :exc:" "`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " @@ -2792,20 +2875,20 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2569 ../../library/os.rst:2609 +#: ../../library/os.rst:2609 ../../library/os.rst:2649 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `." msgstr "" -#: ../../library/os.rst:2572 +#: ../../library/os.rst:2612 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2574 ../../library/os.rst:2595 -#: ../../library/os.rst:2612 +#: ../../library/os.rst:2614 ../../library/os.rst:2635 +#: ../../library/os.rst:2652 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2813,11 +2896,11 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.rename``。" -#: ../../library/os.rst:2576 +#: ../../library/os.rst:2616 msgid "The *src_dir_fd* and *dst_dir_fd* arguments." msgstr "*src_dir_fd* 與 *dst_dir_fd* 引數。" -#: ../../library/os.rst:2585 +#: ../../library/os.rst:2625 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2826,17 +2909,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2592 +#: ../../library/os.rst:2632 msgid "" "This function can fail with the new directory structure made if you lack " "permissions needed to remove the leaf directory or file." msgstr "" -#: ../../library/os.rst:2597 +#: ../../library/os.rst:2637 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2603 +#: ../../library/os.rst:2643 msgid "" "Rename the file or directory *src* to *dst*. If *dst* is a non-empty " "directory, :exc:`OSError` will be raised. If *dst* exists and is a file, it " @@ -2845,7 +2928,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2622 +#: ../../library/os.rst:2662 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2853,7 +2936,7 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2630 +#: ../../library/os.rst:2670 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." @@ -2861,11 +2944,11 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "rmdir``。" -#: ../../library/os.rst:2632 ../../library/os.rst:3389 +#: ../../library/os.rst:2672 ../../library/os.rst:3431 msgid "The *dir_fd* parameter." msgstr "*dir_fd* 參數。" -#: ../../library/os.rst:2641 +#: ../../library/os.rst:2681 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2875,7 +2958,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2648 +#: ../../library/os.rst:2688 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2887,7 +2970,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2658 +#: ../../library/os.rst:2698 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the type " @@ -2896,31 +2979,31 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2667 +#: ../../library/os.rst:2707 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.scandir``。" -#: ../../library/os.rst:2669 +#: ../../library/os.rst:2709 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2674 +#: ../../library/os.rst:2714 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2676 +#: ../../library/os.rst:2716 msgid "" "This is called automatically when the iterator is exhausted or garbage " "collected, or when an error happens during iterating. However it is " "advisable to call it explicitly or use the :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:2683 +#: ../../library/os.rst:2723 msgid "" "The following example shows a simple use of :func:`scandir` to display all " "the files (excluding directories) in the given *path* that don't start with " @@ -2928,7 +3011,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2695 +#: ../../library/os.rst:2735 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -2939,7 +3022,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2707 +#: ../../library/os.rst:2747 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -2947,28 +3030,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2713 +#: ../../library/os.rst:2753 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2715 +#: ../../library/os.rst:2755 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2721 +#: ../../library/os.rst:2761 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2724 +#: ../../library/os.rst:2764 msgid "" ":func:`scandir` will provide as much of this information as possible without " "making additional system calls. When a ``stat()`` or ``lstat()`` system call " "is made, the ``os.DirEntry`` object will cache the result." msgstr "" -#: ../../library/os.rst:2728 +#: ../../library/os.rst:2768 msgid "" "``os.DirEntry`` instances are not intended to be stored in long-lived data " "structures; if you know the file metadata has changed or if a long time has " @@ -2976,7 +3059,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2733 +#: ../../library/os.rst:2773 msgid "" "Because the ``os.DirEntry`` methods can make operating system calls, they " "may also raise :exc:`OSError`. If you need very fine-grained control over " @@ -2984,29 +3067,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2738 +#: ../../library/os.rst:2778 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2741 +#: ../../library/os.rst:2781 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2745 +#: ../../library/os.rst:2785 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2748 +#: ../../library/os.rst:2788 msgid "" "The :attr:`name` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2754 +#: ../../library/os.rst:2794 msgid "" "The entry's full path name: equivalent to ``os.path.join(scandir_path, entry." "name)`` where *scandir_path* is the :func:`scandir` *path* argument. The " @@ -3016,51 +3099,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2761 +#: ../../library/os.rst:2801 msgid "" "The :attr:`path` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2767 +#: ../../library/os.rst:2807 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2769 +#: ../../library/os.rst:2809 msgid "" "The result is cached on the ``os.DirEntry`` object. Use ``os.stat(entry." "path, follow_symlinks=False).st_ino`` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2773 +#: ../../library/os.rst:2813 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2778 +#: ../../library/os.rst:2818 msgid "" "Return ``True`` if this entry is a directory or a symbolic link pointing to " "a directory; return ``False`` if the entry is or points to any other kind of " "file, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2782 +#: ../../library/os.rst:2822 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "directory (without following symlinks); return ``False`` if the entry is any " "other kind of file or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2786 +#: ../../library/os.rst:2826 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` along " "with :func:`stat.S_ISDIR` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2790 +#: ../../library/os.rst:2830 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, for non-symlinks, neither Windows or Unix require a system " @@ -3070,46 +3153,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2797 ../../library/os.rst:2827 +#: ../../library/os.rst:2837 ../../library/os.rst:2867 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2802 +#: ../../library/os.rst:2842 msgid "" "Return ``True`` if this entry is a file or a symbolic link pointing to a " "file; return ``False`` if the entry is or points to a directory or other non-" "file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2806 +#: ../../library/os.rst:2846 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "file (without following symlinks); return ``False`` if the entry is a " "directory or other non-file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2810 +#: ../../library/os.rst:2850 msgid "" "The result is cached on the ``os.DirEntry`` object. Caching, system calls " "made, and exceptions raised are as per :func:`~os.DirEntry.is_dir`." msgstr "" -#: ../../library/os.rst:2815 +#: ../../library/os.rst:2855 msgid "" "Return ``True`` if this entry is a symbolic link (even if broken); return " "``False`` if the entry points to a directory or any kind of file, or if it " "doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2819 +#: ../../library/os.rst:2859 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "islink` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2822 +#: ../../library/os.rst:2862 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, neither Windows or Unix require a system call, except on " @@ -3117,48 +3200,48 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2832 +#: ../../library/os.rst:2872 msgid "" "Return ``True`` if this entry is a junction (even if broken); return " "``False`` if the entry points to a regular directory, any kind of file, a " "symlink, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2836 +#: ../../library/os.rst:2876 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "isjunction` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2843 +#: ../../library/os.rst:2883 msgid "" "Return a :class:`stat_result` object for this entry. This method follows " "symbolic links by default; to stat a symbolic link add the " "``follow_symlinks=False`` argument." msgstr "" -#: ../../library/os.rst:2847 +#: ../../library/os.rst:2887 msgid "" "On Unix, this method always requires a system call. On Windows, it only " "requires a system call if *follow_symlinks* is ``True`` and the entry is a " "reparse point (for example, a symbolic link or directory junction)." msgstr "" -#: ../../library/os.rst:2852 +#: ../../library/os.rst:2892 msgid "" "On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of the :" "class:`stat_result` are always set to zero. Call :func:`os.stat` to get " "these attributes." msgstr "" -#: ../../library/os.rst:2856 +#: ../../library/os.rst:2896 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` to fetch " "up-to-date information." msgstr "" -#: ../../library/os.rst:2860 +#: ../../library/os.rst:2900 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -3166,13 +3249,13 @@ msgid "" "``is_file()``, ``is_symlink()``, ``is_junction()``, and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2868 +#: ../../library/os.rst:2908 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2872 +#: ../../library/os.rst:2912 msgid "" "The ``st_ctime`` attribute of a stat result is deprecated on Windows. The " "file creation time is properly available as ``st_birthtime``, and in the " @@ -3180,7 +3263,7 @@ msgid "" "time, if available." msgstr "" -#: ../../library/os.rst:2881 +#: ../../library/os.rst:2921 msgid "" "Get the status of a file or a file descriptor. Perform the equivalent of a :" "c:func:`stat` system call on the given path. *path* may be specified as " @@ -3189,21 +3272,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2887 +#: ../../library/os.rst:2927 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2890 ../../library/os.rst:3755 -#: ../../library/os.rst:3771 ../../library/os.rst:3787 -#: ../../library/os.rst:3807 +#: ../../library/os.rst:2930 ../../library/os.rst:3797 +#: ../../library/os.rst:3813 ../../library/os.rst:3829 +#: ../../library/os.rst:3849 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2893 +#: ../../library/os.rst:2933 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -3217,24 +3300,24 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2906 ../../library/os.rst:3675 +#: ../../library/os.rst:2946 ../../library/os.rst:3717 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/os.rst:2919 +#: ../../library/os.rst:2959 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:2921 +#: ../../library/os.rst:2961 msgid "" "Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " "descriptor instead of a path." msgstr "" -#: ../../library/os.rst:2928 +#: ../../library/os.rst:2968 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -3244,122 +3327,122 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2939 +#: ../../library/os.rst:2979 msgid "" "Object whose attributes correspond roughly to the members of the :c:struct:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:2943 +#: ../../library/os.rst:2983 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2947 +#: ../../library/os.rst:2987 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2951 +#: ../../library/os.rst:2991 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2954 +#: ../../library/os.rst:2994 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2955 +#: ../../library/os.rst:2995 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:2961 +#: ../../library/os.rst:3001 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:2965 +#: ../../library/os.rst:3005 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:2969 +#: ../../library/os.rst:3009 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:2973 +#: ../../library/os.rst:3013 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:2977 +#: ../../library/os.rst:3017 msgid "" "Size of the file in bytes, if it is a regular file or a symbolic link. The " "size of a symbolic link is the length of the pathname it contains, without a " "terminating null byte." msgstr "" -#: ../../library/os.rst:2981 +#: ../../library/os.rst:3021 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:2985 +#: ../../library/os.rst:3025 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:2989 +#: ../../library/os.rst:3029 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:2993 +#: ../../library/os.rst:3033 msgid "Time of most recent metadata change expressed in seconds." msgstr "" -#: ../../library/os.rst:2995 +#: ../../library/os.rst:3035 msgid "" "``st_ctime`` is deprecated on Windows. Use ``st_birthtime`` for the file " "creation time. In the future, ``st_ctime`` will contain the time of the most " "recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3002 +#: ../../library/os.rst:3042 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3006 +#: ../../library/os.rst:3046 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:3011 +#: ../../library/os.rst:3051 msgid "" "Time of most recent metadata change expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3014 +#: ../../library/os.rst:3054 msgid "" "``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns`` for the " "file creation time. In the future, ``st_ctime`` will contain the time of the " "most recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3021 +#: ../../library/os.rst:3061 msgid "" "Time of file creation expressed in seconds. This attribute is not always " "available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3024 +#: ../../library/os.rst:3064 msgid "``st_birthtime`` is now available on Windows." msgstr "" -#: ../../library/os.rst:3029 +#: ../../library/os.rst:3069 msgid "" "Time of file creation expressed in nanoseconds as an integer. This attribute " "is not always available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3037 +#: ../../library/os.rst:3077 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" "attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " @@ -3369,7 +3452,7 @@ msgid "" "details." msgstr "" -#: ../../library/os.rst:3044 +#: ../../library/os.rst:3084 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" "`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " @@ -3382,96 +3465,97 @@ msgid "" "`st_birthtime_ns`." msgstr "" -#: ../../library/os.rst:3054 +#: ../../library/os.rst:3094 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:3059 +#: ../../library/os.rst:3099 msgid "" "Number of 512-byte blocks allocated for file. This may be smaller than :attr:" "`st_size`/512 when the file has holes." msgstr "" -#: ../../library/os.rst:3064 +#: ../../library/os.rst:3104 msgid "" "\"Preferred\" blocksize for efficient file system I/O. Writing to a file in " "smaller chunks may cause an inefficient read-modify-rewrite." msgstr "" -#: ../../library/os.rst:3069 +#: ../../library/os.rst:3109 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:3073 +#: ../../library/os.rst:3113 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:3075 +#: ../../library/os.rst:3115 msgid "" "On other Unix systems (such as FreeBSD), the following attributes may be " "available (but may be only filled out if root tries to use them):" msgstr "" -#: ../../library/os.rst:3080 +#: ../../library/os.rst:3120 msgid "File generation number." msgstr "" -#: ../../library/os.rst:3082 +#: ../../library/os.rst:3122 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3087 +#: ../../library/os.rst:3127 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:3090 +#: ../../library/os.rst:3130 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3094 +#: ../../library/os.rst:3134 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:3098 +#: ../../library/os.rst:3138 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:3102 +#: ../../library/os.rst:3142 msgid "File type." msgstr "" -#: ../../library/os.rst:3104 +#: ../../library/os.rst:3144 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:3108 +#: ../../library/os.rst:3148 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " -"``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:" -"`GetFileInformationByHandle`. See the ``FILE_ATTRIBUTE_*`` constants in the :" -"mod:`stat` module." +"``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:`!" +"GetFileInformationByHandle`. See the :const:`!FILE_ATTRIBUTE_* ` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3115 +#: ../../library/os.rst:3156 msgid "" -"When :attr:`st_file_attributes` has the ``FILE_ATTRIBUTE_REPARSE_POINT`` " -"set, this field contains the tag identifying the type of reparse point. See " -"the ``IO_REPARSE_TAG_*`` constants in the :mod:`stat` module." +"When :attr:`st_file_attributes` has the :const:`~stat." +"FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the tag identifying " +"the type of reparse point. See the :const:`IO_REPARSE_TAG_* ` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3119 +#: ../../library/os.rst:3161 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:struct:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:3123 +#: ../../library/os.rst:3165 msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " @@ -3483,69 +3567,69 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:3132 +#: ../../library/os.rst:3174 msgid "" "Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " "members." msgstr "" -#: ../../library/os.rst:3136 +#: ../../library/os.rst:3178 msgid "Added the :attr:`st_file_attributes` member on Windows." -msgstr "" +msgstr "在 Windows 上新增 :attr:`st_file_attributes` 成員。" -#: ../../library/os.rst:3139 +#: ../../library/os.rst:3181 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:3143 +#: ../../library/os.rst:3185 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:3146 +#: ../../library/os.rst:3188 msgid "Added the :attr:`st_reparse_tag` member on Windows." -msgstr "" +msgstr "在 Windows 上新增 :attr:`st_reparse_tag` 成員。" -#: ../../library/os.rst:3149 +#: ../../library/os.rst:3191 msgid "" "On Windows, the :attr:`st_mode` member now identifies special files as :" "const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" -#: ../../library/os.rst:3154 +#: ../../library/os.rst:3196 msgid "" "On Windows, :attr:`st_ctime` is deprecated. Eventually, it will contain the " "last metadata change time, for consistency with other platforms, but for now " "still contains creation time. Use :attr:`st_birthtime` for the creation time." msgstr "" -#: ../../library/os.rst:3160 +#: ../../library/os.rst:3202 msgid "" "On Windows, :attr:`st_ino` may now be up to 128 bits, depending on the file " "system. Previously it would not be above 64 bits, and larger file " "identifiers would be arbitrarily packed." msgstr "" -#: ../../library/os.rst:3165 +#: ../../library/os.rst:3207 msgid "" "On Windows, :attr:`st_rdev` no longer returns a value. Previously it would " "contain the same as :attr:`st_dev`, which was incorrect." msgstr "" -#: ../../library/os.rst:3169 +#: ../../library/os.rst:3211 msgid "Added the :attr:`st_birthtime` member on Windows." msgstr "" -#: ../../library/os.rst:3175 +#: ../../library/os.rst:3217 msgid "" -"Perform a :c:func:`statvfs` system call on the given path. The return value " -"is an object whose attributes describe the filesystem on the given path, and " -"correspond to the members of the :c:struct:`statvfs` structure, namely: :" -"attr:`f_bsize`, :attr:`f_frsize`, :attr:`f_blocks`, :attr:`f_bfree`, :attr:" -"`f_bavail`, :attr:`f_files`, :attr:`f_ffree`, :attr:`f_favail`, :attr:" -"`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." +"Perform a :c:func:`!statvfs` system call on the given path. The return " +"value is an object whose attributes describe the filesystem on the given " +"path, and correspond to the members of the :c:struct:`statvfs` structure, " +"namely: :attr:`f_bsize`, :attr:`f_frsize`, :attr:`f_blocks`, :attr:" +"`f_bfree`, :attr:`f_bavail`, :attr:`f_files`, :attr:`f_ffree`, :attr:" +"`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:3182 +#: ../../library/os.rst:3224 msgid "" "Two module-level constants are defined for the :attr:`f_flag` attribute's " "bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted read-" @@ -3553,7 +3637,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:3187 +#: ../../library/os.rst:3229 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3566,11 +3650,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:3200 +#: ../../library/os.rst:3242 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:3206 +#: ../../library/os.rst:3248 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3578,11 +3662,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:3215 +#: ../../library/os.rst:3257 msgid "Added :attr:`f_fsid`." msgstr "新增 :attr:`f_fsid`\\ 。" -#: ../../library/os.rst:3221 +#: ../../library/os.rst:3263 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3594,7 +3678,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:3231 +#: ../../library/os.rst:3273 msgid "" "To check whether a particular function accepts an open file descriptor for " "its *dir_fd* parameter, use the ``in`` operator on ``supports_dir_fd``. As " @@ -3602,13 +3686,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3238 +#: ../../library/os.rst:3280 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3246 +#: ../../library/os.rst:3288 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3617,19 +3701,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3252 +#: ../../library/os.rst:3294 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3257 +#: ../../library/os.rst:3299 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3265 +#: ../../library/os.rst:3307 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "permit specifying their *path* parameter as an open file descriptor on the " @@ -3638,7 +3722,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3272 +#: ../../library/os.rst:3314 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3647,7 +3731,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3285 +#: ../../library/os.rst:3327 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3660,7 +3744,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3295 +#: ../../library/os.rst:3337 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3669,11 +3753,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3308 +#: ../../library/os.rst:3350 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3310 +#: ../../library/os.rst:3352 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -3683,7 +3767,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3321 +#: ../../library/os.rst:3363 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3691,12 +3775,12 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3327 +#: ../../library/os.rst:3369 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3330 +#: ../../library/os.rst:3372 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -3704,27 +3788,27 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.symlink``。" -#: ../../library/os.rst:3340 +#: ../../library/os.rst:3382 msgid "" "Added the *dir_fd* argument, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3347 +#: ../../library/os.rst:3389 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3353 +#: ../../library/os.rst:3395 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3362 +#: ../../library/os.rst:3404 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3367 +#: ../../library/os.rst:3409 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -3732,46 +3816,46 @@ msgstr "" "引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:3382 +#: ../../library/os.rst:3424 msgid "" "Remove (delete) the file *path*. This function is semantically identical " "to :func:`remove`; the ``unlink`` name is its traditional Unix name. Please " "see the documentation for :func:`remove` for further information." msgstr "" -#: ../../library/os.rst:3398 +#: ../../library/os.rst:3440 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3400 +#: ../../library/os.rst:3442 msgid "" ":func:`utime` takes two optional parameters, *times* and *ns*. These specify " "the times set on *path* and are used as follows:" msgstr "" -#: ../../library/os.rst:3403 +#: ../../library/os.rst:3445 msgid "" "If *ns* is specified, it must be a 2-tuple of the form ``(atime_ns, " "mtime_ns)`` where each member is an int expressing nanoseconds." msgstr "" -#: ../../library/os.rst:3406 +#: ../../library/os.rst:3448 msgid "" "If *times* is not ``None``, it must be a 2-tuple of the form ``(atime, " "mtime)`` where each member is an int or float expressing seconds." msgstr "" -#: ../../library/os.rst:3409 +#: ../../library/os.rst:3451 msgid "" "If *times* is ``None`` and *ns* is unspecified, this is equivalent to " "specifying ``ns=(atime_ns, mtime_ns)`` where both times are the current time." msgstr "" -#: ../../library/os.rst:3413 +#: ../../library/os.rst:3455 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3415 +#: ../../library/os.rst:3457 msgid "" "Note that the exact times you set here may not be returned by a subsequent :" "func:`~os.stat` call, depending on the resolution with which your operating " @@ -3781,7 +3865,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:3426 +#: ../../library/os.rst:3468 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -3789,13 +3873,13 @@ msgstr "" "引發一個附帶引數 ``path``、``times``、``ns``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.utime``。" -#: ../../library/os.rst:3428 +#: ../../library/os.rst:3470 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3442 +#: ../../library/os.rst:3484 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up. For each directory in the tree rooted at directory *top* " @@ -3803,7 +3887,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3447 +#: ../../library/os.rst:3489 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -3817,7 +3901,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3458 +#: ../../library/os.rst:3500 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -3828,7 +3912,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3466 +#: ../../library/os.rst:3508 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3841,7 +3925,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3475 +#: ../../library/os.rst:3517 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -3851,42 +3935,42 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3481 +#: ../../library/os.rst:3523 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: ../../library/os.rst:3487 +#: ../../library/os.rst:3529 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: ../../library/os.rst:3493 +#: ../../library/os.rst:3535 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3497 ../../library/os.rst:3558 +#: ../../library/os.rst:3539 ../../library/os.rst:3600 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any CVS subdirectory::" msgstr "" -#: ../../library/os.rst:3510 +#: ../../library/os.rst:3552 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3525 +#: ../../library/os.rst:3567 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -3894,25 +3978,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 ` ``os.walk``。" -#: ../../library/os.rst:3527 +#: ../../library/os.rst:3569 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: ../../library/os.rst:3541 +#: ../../library/os.rst:3583 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: ../../library/os.rst:3544 +#: ../../library/os.rst:3586 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: ../../library/os.rst:3547 +#: ../../library/os.rst:3589 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -3920,20 +4004,20 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3554 +#: ../../library/os.rst:3596 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: ../../library/os.rst:3571 +#: ../../library/os.rst:3613 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3586 +#: ../../library/os.rst:3628 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -3941,11 +4025,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 ` ``os.fwalk``。" -#: ../../library/os.rst:3595 +#: ../../library/os.rst:3637 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3601 +#: ../../library/os.rst:3643 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -3953,7 +4037,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3606 +#: ../../library/os.rst:3648 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -3963,23 +4047,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3613 +#: ../../library/os.rst:3655 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:3636 +#: ../../library/os.rst:3678 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3638 +#: ../../library/os.rst:3680 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" -#: ../../library/os.rst:3640 +#: ../../library/os.rst:3682 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: ../../library/os.rst:3647 +#: ../../library/os.rst:3689 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -3988,7 +4072,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3653 +#: ../../library/os.rst:3695 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be an 32 bit unsigned integer. Please note that the initial value is limited " @@ -3996,87 +4080,87 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3658 +#: ../../library/os.rst:3700 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3661 +#: ../../library/os.rst:3703 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: ../../library/os.rst:3664 +#: ../../library/os.rst:3706 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: ../../library/os.rst:3668 +#: ../../library/os.rst:3710 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3671 +#: ../../library/os.rst:3713 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3692 +#: ../../library/os.rst:3734 msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" -#: ../../library/os.rst:3698 +#: ../../library/os.rst:3740 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3701 ../../library/os.rst:3710 -#: ../../library/os.rst:3718 ../../library/os.rst:3727 +#: ../../library/os.rst:3743 ../../library/os.rst:3752 +#: ../../library/os.rst:3760 ../../library/os.rst:3769 msgid ":ref:`Availability `: Linux >= 2.6.27" msgstr ":ref:`適用 `:Linux 2.6.27 以上" -#: ../../library/os.rst:3707 +#: ../../library/os.rst:3749 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3716 +#: ../../library/os.rst:3758 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3724 +#: ../../library/os.rst:3766 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3733 +#: ../../library/os.rst:3775 msgid "" "Provide semaphore-like semantics for reads from a :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3736 +#: ../../library/os.rst:3778 msgid ":ref:`Availability `: Linux >= 2.6.30" msgstr ":ref:`適用 `:Linux 2.6.30 以上" -#: ../../library/os.rst:3742 +#: ../../library/os.rst:3784 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3746 +#: ../../library/os.rst:3788 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3750 +#: ../../library/os.rst:3792 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4084,7 +4168,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3758 +#: ../../library/os.rst:3800 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -4092,12 +4176,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.getxattr``。" -#: ../../library/os.rst:3760 ../../library/os.rst:3792 -#: ../../library/os.rst:3817 +#: ../../library/os.rst:3802 ../../library/os.rst:3834 +#: ../../library/os.rst:3859 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3766 +#: ../../library/os.rst:3808 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4105,14 +4189,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3774 +#: ../../library/os.rst:3816 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" -#: ../../library/os.rst:3782 +#: ../../library/os.rst:3824 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4120,7 +4204,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:3790 +#: ../../library/os.rst:3832 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -4128,7 +4212,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.removexattr``。" -#: ../../library/os.rst:3798 +#: ../../library/os.rst:3840 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4140,13 +4224,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3812 +#: ../../library/os.rst:3854 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:3815 +#: ../../library/os.rst:3857 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -4154,33 +4238,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 ` ``os.setxattr``。" -#: ../../library/os.rst:3823 +#: ../../library/os.rst:3865 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3829 +#: ../../library/os.rst:3871 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: ../../library/os.rst:3835 +#: ../../library/os.rst:3877 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: ../../library/os.rst:3842 +#: ../../library/os.rst:3884 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3844 +#: ../../library/os.rst:3886 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3846 +#: ../../library/os.rst:3888 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -4191,7 +4275,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3857 +#: ../../library/os.rst:3899 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -4200,31 +4284,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3866 +#: ../../library/os.rst:3908 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3868 +#: ../../library/os.rst:3910 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through :data:`sys.path`), and also " "by :mod:`ctypes`." msgstr "" -#: ../../library/os.rst:3872 +#: ../../library/os.rst:3914 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3875 +#: ../../library/os.rst:3917 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3879 +#: ../../library/os.rst:3921 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -4232,7 +4316,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." "add_dll_directory``。" -#: ../../library/os.rst:3883 +#: ../../library/os.rst:3925 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4240,14 +4324,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3890 +#: ../../library/os.rst:3932 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:3905 +#: ../../library/os.rst:3947 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -4255,7 +4339,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3910 +#: ../../library/os.rst:3952 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -4263,7 +4347,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3916 +#: ../../library/os.rst:3958 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4276,7 +4360,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3925 +#: ../../library/os.rst:3967 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4290,7 +4374,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:3936 +#: ../../library/os.rst:3978 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4300,7 +4384,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3943 +#: ../../library/os.rst:3985 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -4309,7 +4393,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3948 +#: ../../library/os.rst:3990 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4317,25 +4401,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:3952 +#: ../../library/os.rst:3994 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3961 +#: ../../library/os.rst:4003 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:3966 +#: ../../library/os.rst:4008 msgid "" "The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " "should normally only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:3969 +#: ../../library/os.rst:4011 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -4343,125 +4427,125 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:3975 +#: ../../library/os.rst:4017 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: ../../library/os.rst:3982 +#: ../../library/os.rst:4024 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: ../../library/os.rst:3990 +#: ../../library/os.rst:4032 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:3998 +#: ../../library/os.rst:4040 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:4005 +#: ../../library/os.rst:4047 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:4012 +#: ../../library/os.rst:4054 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:4019 +#: ../../library/os.rst:4061 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:4026 +#: ../../library/os.rst:4068 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:4033 +#: ../../library/os.rst:4075 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:4040 +#: ../../library/os.rst:4082 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: ../../library/os.rst:4048 +#: ../../library/os.rst:4090 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: ../../library/os.rst:4056 +#: ../../library/os.rst:4098 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:4063 +#: ../../library/os.rst:4105 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:4070 +#: ../../library/os.rst:4112 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: ../../library/os.rst:4079 +#: ../../library/os.rst:4121 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:4087 +#: ../../library/os.rst:4129 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: ../../library/os.rst:4095 +#: ../../library/os.rst:4137 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:4102 +#: ../../library/os.rst:4144 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:4109 +#: ../../library/os.rst:4151 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4112 +#: ../../library/os.rst:4154 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:4115 +#: ../../library/os.rst:4157 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4117 +#: ../../library/os.rst:4159 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4123 +#: ../../library/os.rst:4165 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:4130 +#: ../../library/os.rst:4172 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -4470,24 +4554,24 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4136 +#: ../../library/os.rst:4178 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4138 +#: ../../library/os.rst:4180 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4151 +#: ../../library/os.rst:4193 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:4154 +#: ../../library/os.rst:4196 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -4498,11 +4582,11 @@ msgid "" "process handles to be killed." msgstr "" -#: ../../library/os.rst:4162 +#: ../../library/os.rst:4204 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:4164 +#: ../../library/os.rst:4206 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4510,15 +4594,15 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4168 +#: ../../library/os.rst:4210 msgid "Windows support." msgstr "" -#: ../../library/os.rst:4178 +#: ../../library/os.rst:4220 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4180 +#: ../../library/os.rst:4222 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4526,27 +4610,27 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4187 +#: ../../library/os.rst:4229 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4194 +#: ../../library/os.rst:4236 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4198 +#: ../../library/os.rst:4240 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4200 +#: ../../library/os.rst:4242 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:4205 +#: ../../library/os.rst:4247 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -4554,17 +4638,17 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4210 +#: ../../library/os.rst:4252 msgid ":ref:`Availability `: Linux >= 5.10" msgstr ":ref:`適用 `:Linux 5.10 以上" -#: ../../library/os.rst:4216 +#: ../../library/os.rst:4258 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4224 +#: ../../library/os.rst:4266 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4574,7 +4658,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4232 +#: ../../library/os.rst:4274 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4586,60 +4670,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4242 +#: ../../library/os.rst:4284 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:4247 +#: ../../library/os.rst:4289 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:4251 +#: ../../library/os.rst:4293 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4254 +#: ../../library/os.rst:4296 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4257 +#: ../../library/os.rst:4299 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4266 -msgid "Wraps the :c:func:`posix_spawn` C library API for use from Python." +#: ../../library/os.rst:4308 +msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4268 +#: ../../library/os.rst:4310 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4270 +#: ../../library/os.rst:4312 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4273 +#: ../../library/os.rst:4315 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:4277 +#: ../../library/os.rst:4319 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4648,49 +4732,49 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4285 +#: ../../library/os.rst:4327 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4287 +#: ../../library/os.rst:4329 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4291 +#: ../../library/os.rst:4333 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4293 +#: ../../library/os.rst:4335 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4297 +#: ../../library/os.rst:4339 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4299 +#: ../../library/os.rst:4341 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4301 +#: ../../library/os.rst:4343 msgid "" -"These tuples correspond to the C library :c:func:" -"`posix_spawn_file_actions_addopen`, :c:func:" -"`posix_spawn_file_actions_addclose`, and :c:func:" -"`posix_spawn_file_actions_adddup2` API calls used to prepare for the :c:func:" -"`posix_spawn` call itself." +"These tuples correspond to the C library :c:func:`!" +"posix_spawn_file_actions_addopen`, :c:func:`!" +"posix_spawn_file_actions_addclose`, and :c:func:`!" +"posix_spawn_file_actions_adddup2` API calls used to prepare for the :c:func:" +"`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4307 +#: ../../library/os.rst:4349 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " "will be made the same as its process ID. If the value of *setpgroup* is not " "set, the child will inherit the parent's process group ID. This argument " -"corresponds to the C library :c:macro:`POSIX_SPAWN_SETPGROUP` flag." +"corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4313 +#: ../../library/os.rst:4355 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4698,43 +4782,43 @@ msgid "" "the parent. In either case, if the set-user-ID and set-group-ID permission " "bits are enabled on the executable file, their effect will override the " "setting of the effective UID and GID. This argument corresponds to the C " -"library :c:macro:`POSIX_SPAWN_RESETIDS` flag." +"library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4321 +#: ../../library/os.rst:4363 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " -"``posix_spawn``. *setsid* requires :c:macro:`POSIX_SPAWN_SETSID` or :c:macro:" -"`POSIX_SPAWN_SETSID_NP` flag. Otherwise, :exc:`NotImplementedError` is " -"raised." +"``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" +"macro:`!POSIX_SPAWN_SETSID_NP` flag. Otherwise, :exc:`NotImplementedError` " +"is raised." msgstr "" -#: ../../library/os.rst:4326 +#: ../../library/os.rst:4368 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " -"parent's signal mask. This argument corresponds to the C library :c:macro:" -"`POSIX_SPAWN_SETSIGMASK` flag." +"parent's signal mask. This argument corresponds to the C library :c:macro:`!" +"POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4331 +#: ../../library/os.rst:4373 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " -"specified. This argument corresponds to the C library :c:macro:" -"`POSIX_SPAWN_SETSIGDEF` flag." +"specified. This argument corresponds to the C library :c:macro:`!" +"POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4335 +#: ../../library/os.rst:4377 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " "parameters. A value of ``None`` in the place of the scheduler policy " "indicates that is not being provided. This argument is a combination of the " -"C library :c:macro:`POSIX_SPAWN_SETSCHEDPARAM` and :c:macro:" -"`POSIX_SPAWN_SETSCHEDULER` flags." +"C library :c:macro:`!POSIX_SPAWN_SETSCHEDPARAM` and :c:macro:`!" +"POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4342 ../../library/os.rst:4358 +#: ../../library/os.rst:4384 ../../library/os.rst:4400 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4742,76 +4826,76 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4352 -msgid "Wraps the :c:func:`posix_spawnp` C library API for use from Python." +#: ../../library/os.rst:4394 +msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4354 +#: ../../library/os.rst:4396 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4362 +#: ../../library/os.rst:4404 msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" -#: ../../library/os.rst:4364 +#: ../../library/os.rst:4406 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4370 +#: ../../library/os.rst:4412 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4375 +#: ../../library/os.rst:4417 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4376 +#: ../../library/os.rst:4418 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4378 +#: ../../library/os.rst:4420 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4380 +#: ../../library/os.rst:4422 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4384 +#: ../../library/os.rst:4426 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4389 +#: ../../library/os.rst:4431 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4393 +#: ../../library/os.rst:4435 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4409 +#: ../../library/os.rst:4451 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4411 +#: ../../library/os.rst:4453 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4819,7 +4903,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4416 +#: ../../library/os.rst:4458 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4828,13 +4912,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4422 +#: ../../library/os.rst:4464 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4425 +#: ../../library/os.rst:4467 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4846,7 +4930,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4434 +#: ../../library/os.rst:4476 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4859,7 +4943,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4444 +#: ../../library/os.rst:4486 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4871,13 +4955,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4453 +#: ../../library/os.rst:4495 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4462 +#: ../../library/os.rst:4504 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -4885,7 +4969,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4466 +#: ../../library/os.rst:4508 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4893,7 +4977,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4478 +#: ../../library/os.rst:4520 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4901,7 +4985,7 @@ msgid "" "created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4488 +#: ../../library/os.rst:4530 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -4910,7 +4994,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4500 +#: ../../library/os.rst:4542 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -4920,11 +5004,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4511 +#: ../../library/os.rst:4553 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4513 +#: ../../library/os.rst:4555 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -4932,7 +5016,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4518 +#: ../../library/os.rst:4560 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -4940,28 +5024,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4523 +#: ../../library/os.rst:4565 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4527 +#: ../../library/os.rst:4569 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4531 +#: ../../library/os.rst:4573 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " -"supported by the Win32 :c:func:`ShellExecute` function." +"supported by the Win32 :c:func:`!ShellExecute` function." msgstr "" -#: ../../library/os.rst:4535 +#: ../../library/os.rst:4577 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -4972,14 +5056,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4543 +#: ../../library/os.rst:4585 msgid "" -"To reduce interpreter startup overhead, the Win32 :c:func:`ShellExecute` " +"To reduce interpreter startup overhead, the Win32 :c:func:`!ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:4547 +#: ../../library/os.rst:4589 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -4987,7 +5071,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:4549 +#: ../../library/os.rst:4591 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -4995,13 +5079,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:4553 +#: ../../library/os.rst:4595 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4560 +#: ../../library/os.rst:4602 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -5012,13 +5096,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4568 +#: ../../library/os.rst:4610 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4571 +#: ../../library/os.rst:4613 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -5027,7 +5111,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4577 +#: ../../library/os.rst:4619 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5035,54 +5119,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4582 +#: ../../library/os.rst:4624 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: ../../library/os.rst:4586 +#: ../../library/os.rst:4628 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:4593 +#: ../../library/os.rst:4635 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4596 +#: ../../library/os.rst:4638 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4597 +#: ../../library/os.rst:4639 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4598 +#: ../../library/os.rst:4640 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4599 +#: ../../library/os.rst:4641 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4600 +#: ../../library/os.rst:4642 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4602 +#: ../../library/os.rst:4644 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: ../../library/os.rst:4606 +#: ../../library/os.rst:4648 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5092,7 +5176,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4620 +#: ../../library/os.rst:4662 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5101,83 +5185,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4626 +#: ../../library/os.rst:4668 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4629 ../../library/os.rst:4701 +#: ../../library/os.rst:4671 ../../library/os.rst:4743 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4636 +#: ../../library/os.rst:4678 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4643 +#: ../../library/os.rst:4685 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4645 +#: ../../library/os.rst:4687 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4648 +#: ../../library/os.rst:4690 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4652 +#: ../../library/os.rst:4694 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4655 +#: ../../library/os.rst:4697 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4656 +#: ../../library/os.rst:4698 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4657 +#: ../../library/os.rst:4699 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4658 +#: ../../library/os.rst:4700 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4659 +#: ../../library/os.rst:4701 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4661 +#: ../../library/os.rst:4703 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4673 +#: ../../library/os.rst:4715 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4675 +#: ../../library/os.rst:4717 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -5186,7 +5270,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4680 +#: ../../library/os.rst:4722 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -5196,7 +5280,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4687 +#: ../../library/os.rst:4729 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5205,7 +5289,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4693 +#: ../../library/os.rst:4735 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -5217,7 +5301,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4714 +#: ../../library/os.rst:4756 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -5226,13 +5310,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4721 ../../library/os.rst:4735 +#: ../../library/os.rst:4763 ../../library/os.rst:4777 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4729 +#: ../../library/os.rst:4771 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5241,118 +5325,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4746 +#: ../../library/os.rst:4788 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4749 +#: ../../library/os.rst:4791 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4750 +#: ../../library/os.rst:4792 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4751 +#: ../../library/os.rst:4793 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4752 +#: ../../library/os.rst:4794 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4757 +#: ../../library/os.rst:4799 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4760 +#: ../../library/os.rst:4802 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4766 +#: ../../library/os.rst:4808 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4775 +#: ../../library/os.rst:4817 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4778 +#: ../../library/os.rst:4820 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4788 +#: ../../library/os.rst:4830 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4791 ../../library/os.rst:4823 +#: ../../library/os.rst:4833 ../../library/os.rst:4865 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4800 +#: ../../library/os.rst:4842 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4804 +#: ../../library/os.rst:4846 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4811 +#: ../../library/os.rst:4853 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4820 +#: ../../library/os.rst:4862 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4835 +#: ../../library/os.rst:4877 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4842 +#: ../../library/os.rst:4884 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4848 +#: ../../library/os.rst:4890 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4850 +#: ../../library/os.rst:4892 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4852 +#: ../../library/os.rst:4894 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4855 +#: ../../library/os.rst:4897 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -5360,15 +5444,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4859 +#: ../../library/os.rst:4901 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4861 +#: ../../library/os.rst:4903 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4863 +#: ../../library/os.rst:4905 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -5376,217 +5460,217 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4870 +#: ../../library/os.rst:4912 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4878 +#: ../../library/os.rst:4920 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4884 +#: ../../library/os.rst:4926 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4887 ../../library/os.rst:4953 +#: ../../library/os.rst:4929 ../../library/os.rst:4995 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4894 +#: ../../library/os.rst:4936 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4898 +#: ../../library/os.rst:4940 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4905 +#: ../../library/os.rst:4947 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4908 +#: ../../library/os.rst:4950 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:4916 +#: ../../library/os.rst:4958 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4924 +#: ../../library/os.rst:4966 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4933 +#: ../../library/os.rst:4975 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4935 +#: ../../library/os.rst:4977 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4942 +#: ../../library/os.rst:4984 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4944 +#: ../../library/os.rst:4986 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4951 +#: ../../library/os.rst:4993 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:4959 +#: ../../library/os.rst:5001 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:4961 +#: ../../library/os.rst:5003 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:4967 +#: ../../library/os.rst:5009 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:4972 +#: ../../library/os.rst:5014 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:4976 +#: ../../library/os.rst:5018 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:4981 +#: ../../library/os.rst:5023 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:4985 +#: ../../library/os.rst:5027 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:4989 +#: ../../library/os.rst:5031 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:4993 +#: ../../library/os.rst:5035 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:4997 +#: ../../library/os.rst:5039 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:5004 +#: ../../library/os.rst:5046 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:5008 +#: ../../library/os.rst:5050 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5012 +#: ../../library/os.rst:5054 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5017 +#: ../../library/os.rst:5059 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5023 +#: ../../library/os.rst:5065 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5029 +#: ../../library/os.rst:5071 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5036 +#: ../../library/os.rst:5078 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:5043 +#: ../../library/os.rst:5085 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5049 +#: ../../library/os.rst:5091 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5055 +#: ../../library/os.rst:5097 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5061 +#: ../../library/os.rst:5103 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:5066 +#: ../../library/os.rst:5108 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:5073 +#: ../../library/os.rst:5115 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:5080 +#: ../../library/os.rst:5122 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5085 +#: ../../library/os.rst:5127 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -5597,13 +5681,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5093 +#: ../../library/os.rst:5135 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5096 +#: ../../library/os.rst:5138 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -5611,33 +5695,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5106 +#: ../../library/os.rst:5148 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5115 +#: ../../library/os.rst:5157 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:5117 +#: ../../library/os.rst:5159 msgid "" "This number is not equivalent to the number of CPUs the current process can " "use. The number of usable CPUs can be obtained with ``len(os." "sched_getaffinity(0))``" msgstr "" -#: ../../library/os.rst:5127 +#: ../../library/os.rst:5169 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:5136 +#: ../../library/os.rst:5178 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5646,44 +5730,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5146 +#: ../../library/os.rst:5188 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5152 +#: ../../library/os.rst:5194 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5155 +#: ../../library/os.rst:5197 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5158 +#: ../../library/os.rst:5200 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5164 +#: ../../library/os.rst:5206 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5172 +#: ../../library/os.rst:5214 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5181 +#: ../../library/os.rst:5223 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5692,7 +5776,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5191 +#: ../../library/os.rst:5233 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5700,27 +5784,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5200 +#: ../../library/os.rst:5242 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5208 +#: ../../library/os.rst:5250 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5215 +#: ../../library/os.rst:5257 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:" "`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5222 +#: ../../library/os.rst:5264 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -5729,36 +5813,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5231 +#: ../../library/os.rst:5273 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5242 +#: ../../library/os.rst:5284 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:5250 +#: ../../library/os.rst:5292 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5255 +#: ../../library/os.rst:5297 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5258 +#: ../../library/os.rst:5300 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5261 +#: ../../library/os.rst:5303 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5766,36 +5850,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5266 +#: ../../library/os.rst:5308 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5270 +#: ../../library/os.rst:5312 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5273 +#: ../../library/os.rst:5315 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5279 +#: ../../library/os.rst:5321 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5281 +#: ../../library/os.rst:5323 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:5285 +#: ../../library/os.rst:5327 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5805,63 +5889,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5292 +#: ../../library/os.rst:5334 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:5296 +#: ../../library/os.rst:5338 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5299 +#: ../../library/os.rst:5341 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:5303 +#: ../../library/os.rst:5345 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5307 +#: ../../library/os.rst:5349 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:5311 +#: ../../library/os.rst:5353 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:5317 +#: ../../library/os.rst:5359 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5323 +#: ../../library/os.rst:5365 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:5327 +#: ../../library/os.rst:5369 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:5334 +#: ../../library/os.rst:5376 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -5877,7 +5961,7 @@ msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 #: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 -#: ../../library/os.rst:4147 ../../library/os.rst:4174 +#: ../../library/os.rst:4189 ../../library/os.rst:4216 msgid "process" msgstr "process" @@ -5917,94 +6001,94 @@ msgstr "gethostname()(於 socket 模組)" msgid "gethostbyaddr() (in module socket)" msgstr "gethostbyaddr()(於 socket 模組)" -#: ../../library/os.rst:796 ../../library/os.rst:2534 +#: ../../library/os.rst:796 ../../library/os.rst:2574 msgid "deleting" msgstr "deleting(刪除)" -#: ../../library/os.rst:1298 ../../library/os.rst:2904 +#: ../../library/os.rst:1338 ../../library/os.rst:2944 msgid "module" msgstr "module(模組)" -#: ../../library/os.rst:1298 +#: ../../library/os.rst:1338 msgid "pty" msgstr "pty" -#: ../../library/os.rst:1938 ../../library/os.rst:2332 -#: ../../library/os.rst:2534 ../../library/os.rst:3438 -#: ../../library/os.rst:3537 +#: ../../library/os.rst:1978 ../../library/os.rst:2372 +#: ../../library/os.rst:2574 ../../library/os.rst:3480 +#: ../../library/os.rst:3579 msgid "directory" msgstr "directory(目錄)" -#: ../../library/os.rst:1938 +#: ../../library/os.rst:1978 msgid "changing" msgstr "changing(改變)" -#: ../../library/os.rst:2332 +#: ../../library/os.rst:2372 msgid "creating" msgstr "creating(建立)" -#: ../../library/os.rst:2332 +#: ../../library/os.rst:2372 msgid "UNC paths" msgstr "UNC paths(UNC 路徑)" -#: ../../library/os.rst:2332 +#: ../../library/os.rst:2372 msgid "and os.makedirs()" msgstr "以及 os.makedirs()" -#: ../../library/os.rst:2904 +#: ../../library/os.rst:2944 msgid "stat" msgstr "stat" -#: ../../library/os.rst:3438 ../../library/os.rst:3537 +#: ../../library/os.rst:3480 ../../library/os.rst:3579 msgid "walking" msgstr "" -#: ../../library/os.rst:3438 ../../library/os.rst:3537 +#: ../../library/os.rst:3480 ../../library/os.rst:3579 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4147 ../../library/os.rst:4174 +#: ../../library/os.rst:4189 ../../library/os.rst:4216 msgid "killing" msgstr "" -#: ../../library/os.rst:4147 ../../library/os.rst:4174 +#: ../../library/os.rst:4189 ../../library/os.rst:4216 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5161 ../../library/os.rst:5197 +#: ../../library/os.rst:5203 ../../library/os.rst:5239 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5161 ../../library/os.rst:5169 -#: ../../library/os.rst:5177 ../../library/os.rst:5188 -#: ../../library/os.rst:5197 +#: ../../library/os.rst:5203 ../../library/os.rst:5211 +#: ../../library/os.rst:5219 ../../library/os.rst:5230 +#: ../../library/os.rst:5239 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5169 +#: ../../library/os.rst:5211 msgid ".." msgstr ".." -#: ../../library/os.rst:5177 ../../library/os.rst:5188 +#: ../../library/os.rst:5219 ../../library/os.rst:5230 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5178 +#: ../../library/os.rst:5220 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5178 +#: ../../library/os.rst:5220 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5204 +#: ../../library/os.rst:5246 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5204 +#: ../../library/os.rst:5246 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5204 +#: ../../library/os.rst:5246 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/profile.po b/library/profile.po index 07d71efeb7..220591bbab 100644 --- a/library/profile.po +++ b/library/profile.po @@ -197,11 +197,11 @@ msgstr "" #: ../../library/profile.rst:136 msgid "Added the ``-m`` option to :mod:`cProfile`." -msgstr "" +msgstr "新增 ``-m`` 選項到 :mod:`cProfile`。" #: ../../library/profile.rst:139 msgid "Added the ``-m`` option to :mod:`profile`." -msgstr "" +msgstr "新增 ``-m`` 選項到 :mod:`profile`。" #: ../../library/profile.rst:142 msgid "" @@ -354,7 +354,7 @@ msgstr "" #: ../../library/profile.rst:279 msgid "Added context manager support." -msgstr "" +msgstr "新增情境管理器的支援。" #: ../../library/profile.rst:284 msgid "Start collecting profiling data. Only in :mod:`cProfile`." diff --git a/library/random.po b/library/random.po index d61258b9d7..a8f2db6573 100644 --- a/library/random.po +++ b/library/random.po @@ -551,7 +551,7 @@ msgstr "" #: ../../library/random.rst:331 msgid "Added the default value for ``lambd``." -msgstr "" +msgstr "新增 ``lambd`` 的預設值。" #: ../../library/random.rst:337 msgid "" diff --git a/library/re.po b/library/re.po index e7d4eef380..e55587d2b6 100644 --- a/library/re.po +++ b/library/re.po @@ -1190,7 +1190,7 @@ msgstr "" #: ../../library/re.rst:926 ../../library/re.rst:1017 ../../library/re.rst:1046 msgid "Added the optional flags argument." -msgstr "" +msgstr "新增可選的旗標引數。" #: ../../library/re.rst:929 msgid "" diff --git a/library/runpy.po b/library/runpy.po index 43339e044b..1e22ec3f77 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-07 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-" @@ -65,8 +65,8 @@ msgstr "" msgid "" "The *mod_name* argument should be an absolute module name. If the module " "name refers to a package rather than a normal module, then that package is " -"imported and the ``__main__`` submodule within that package is then executed " -"and the resulting module globals dictionary returned." +"imported and the :mod:`__main__` submodule within that package is then " +"executed and the resulting module globals dictionary returned." msgstr "" #: ../../library/runpy.rst:46 @@ -78,7 +78,7 @@ msgid "" "overridden by :func:`run_module`." msgstr "" -#: ../../library/runpy.rst:52 ../../library/runpy.rst:126 +#: ../../library/runpy.rst:52 ../../library/runpy.rst:127 msgid "" "The special global variables ``__name__``, ``__spec__``, ``__file__``, " "``__cached__``, ``__loader__`` and ``__package__`` are set in the globals " @@ -120,7 +120,7 @@ msgstr "" msgid "" "Note that this manipulation of :mod:`sys` is not thread-safe. Other threads " "may see the partially initialised module, as well as the altered list of " -"arguments. It is recommended that the :mod:`sys` module be left alone when " +"arguments. It is recommended that the ``sys`` module be left alone when " "invoking this function from threaded code." msgstr "" @@ -132,7 +132,7 @@ msgstr "" #: ../../library/runpy.rst:84 msgid "" -"Added ability to execute packages by looking for a ``__main__`` submodule." +"Added ability to execute packages by looking for a :mod:`__main__` submodule." msgstr "" #: ../../library/runpy.rst:87 @@ -158,22 +158,23 @@ msgid "" "Execute the code at the named filesystem location and return the resulting " "module globals dictionary. As with a script name supplied to the CPython " "command line, the supplied path may refer to a Python source file, a " -"compiled bytecode file or a valid sys.path entry containing a ``__main__`` " -"module (e.g. a zipfile containing a top-level ``__main__.py`` file)." +"compiled bytecode file or a valid :data:`sys.path` entry containing a :mod:" +"`__main__` module (e.g. a zipfile containing a top-level ``__main__.py`` " +"file)." msgstr "" -#: ../../library/runpy.rst:112 +#: ../../library/runpy.rst:113 msgid "" "For a simple script, the specified code is simply executed in a fresh module " -"namespace. For a valid sys.path entry (typically a zipfile or directory), " -"the entry is first added to the beginning of ``sys.path``. The function then " -"looks for and executes a :mod:`__main__` module using the updated path. Note " -"that there is no special protection against invoking an existing :mod:" -"`__main__` entry located elsewhere on ``sys.path`` if there is no such " -"module at the specified location." +"namespace. For a valid :data:`sys.path` entry (typically a zipfile or " +"directory), the entry is first added to the beginning of ``sys.path``. The " +"function then looks for and executes a :mod:`__main__` module using the " +"updated path. Note that there is no special protection against invoking an " +"existing ``__main__`` entry located elsewhere on ``sys.path`` if there is no " +"such module at the specified location." msgstr "" -#: ../../library/runpy.rst:120 +#: ../../library/runpy.rst:121 msgid "" "The optional dictionary argument *init_globals* may be used to pre-populate " "the module's globals dictionary before the code is executed. The supplied " @@ -182,13 +183,13 @@ msgid "" "overridden by :func:`run_path`." msgstr "" -#: ../../library/runpy.rst:132 +#: ../../library/runpy.rst:133 msgid "" "``__name__`` is set to *run_name* if this optional argument is not :const:" "`None` and to ``''`` otherwise." msgstr "" -#: ../../library/runpy.rst:135 +#: ../../library/runpy.rst:136 msgid "" "If the supplied path directly references a script file (whether as source or " "as precompiled byte code), then ``__file__`` will be set to the supplied " @@ -196,79 +197,79 @@ msgid "" "will all be set to :const:`None`." msgstr "" -#: ../../library/runpy.rst:140 +#: ../../library/runpy.rst:141 msgid "" -"If the supplied path is a reference to a valid sys.path entry, then " -"``__spec__`` will be set appropriately for the imported ``__main__`` module " -"(that is, ``__spec__.name`` will always be ``__main__``). ``__file__``, " -"``__cached__``, ``__loader__`` and ``__package__`` will be :ref:`set as " -"normal ` based on the module spec." +"If the supplied path is a reference to a valid :data:`sys.path` entry, then " +"``__spec__`` will be set appropriately for the imported :mod:`__main__` " +"module (that is, ``__spec__.name`` will always be ``__main__``). " +"``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` will be :" +"ref:`set as normal ` based on the module spec." msgstr "" -#: ../../library/runpy.rst:146 +#: ../../library/runpy.rst:147 msgid "" -"A number of alterations are also made to the :mod:`sys` module. Firstly, " -"``sys.path`` may be altered as described above. ``sys.argv[0]`` is updated " -"with the value of ``path_name`` and ``sys.modules[__name__]`` is updated " -"with a temporary module object for the module being executed. All " +"A number of alterations are also made to the :mod:`sys` module. Firstly, :" +"data:`sys.path` may be altered as described above. ``sys.argv[0]`` is " +"updated with the value of ``path_name`` and ``sys.modules[__name__]`` is " +"updated with a temporary module object for the module being executed. All " "modifications to items in :mod:`sys` are reverted before the function " "returns." msgstr "" -#: ../../library/runpy.rst:153 +#: ../../library/runpy.rst:154 msgid "" "Note that, unlike :func:`run_module`, the alterations made to :mod:`sys` are " "not optional in this function as these adjustments are essential to allowing " -"the execution of sys.path entries. As the thread-safety limitations still " -"apply, use of this function in threaded code should be either serialised " -"with the import lock or delegated to a separate process." +"the execution of :data:`sys.path` entries. As the thread-safety limitations " +"still apply, use of this function in threaded code should be either " +"serialised with the import lock or delegated to a separate process." msgstr "" -#: ../../library/runpy.rst:160 +#: ../../library/runpy.rst:161 msgid "" ":ref:`using-on-interface-options` for equivalent functionality on the " "command line (``python path/to/script``)." msgstr "" -#: ../../library/runpy.rst:165 +#: ../../library/runpy.rst:166 msgid "" "Updated to take advantage of the module spec feature added by :pep:`451`. " "This allows ``__cached__`` to be set correctly in the case where " -"``__main__`` is imported from a valid sys.path entry rather than being " -"executed directly." +"``__main__`` is imported from a valid :data:`sys.path` entry rather than " +"being executed directly." msgstr "" -#: ../../library/runpy.rst:171 +#: ../../library/runpy.rst:172 msgid "" "The setting of ``__cached__``, ``__loader__``, and ``__package__`` are " "deprecated." msgstr "" -#: ../../library/runpy.rst:178 +#: ../../library/runpy.rst:179 msgid ":pep:`338` -- Executing modules as scripts" msgstr "" -#: ../../library/runpy.rst:178 ../../library/runpy.rst:181 +#: ../../library/runpy.rst:179 ../../library/runpy.rst:182 msgid "PEP written and implemented by Nick Coghlan." msgstr "" -#: ../../library/runpy.rst:181 +#: ../../library/runpy.rst:182 msgid ":pep:`366` -- Main module explicit relative imports" msgstr "" -#: ../../library/runpy.rst:184 +#: ../../library/runpy.rst:185 msgid ":pep:`451` -- A ModuleSpec Type for the Import System" msgstr "" -#: ../../library/runpy.rst:184 +#: ../../library/runpy.rst:185 msgid "PEP written and implemented by Eric Snow" msgstr "" -#: ../../library/runpy.rst:186 +#: ../../library/runpy.rst:187 msgid ":ref:`using-on-general` - CPython command line details" msgstr "" -#: ../../library/runpy.rst:188 +#: ../../library/runpy.rst:189 msgid "The :func:`importlib.import_module` function" msgstr "" diff --git a/library/shelve.po b/library/shelve.po index b669a8f6f7..cc3258444d 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -191,7 +191,7 @@ msgstr "" #: ../../library/shelve.rst:142 msgid "Added context manager support." -msgstr "" +msgstr "新增情境管理器的支援。" #: ../../library/shelve.rst:152 msgid "" diff --git a/library/shutil.po b/library/shutil.po index 83786bf0f4..9a21435530 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -446,7 +446,7 @@ msgstr "*dir_fd* 參數。" #: ../../library/shutil.rst:343 msgid "Added the *onexc* parameter, deprecated *onerror*." -msgstr "" +msgstr "新增 *onexc* 參數並棄用 *onerror*。" #: ../../library/shutil.rst:348 msgid "" diff --git a/library/site.po b/library/site.po index 37bb58f89f..8e1b8bb8fc 100644 --- a/library/site.po +++ b/library/site.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-18 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-" @@ -214,10 +214,9 @@ msgid "" "func:`getuserbase` hasn't been called yet. Default value is :file:`~/." "local` for UNIX and macOS non-framework builds, :file:`~/Library/Python/{X.Y}" "` for macOS framework builds, and :file:`{%APPDATA%}\\\\Python` for " -"Windows. This value is used by Distutils to compute the installation " -"directories for scripts, data files, Python modules, etc. for the :ref:`user " -"installation scheme `. See also :envvar:" -"`PYTHONUSERBASE`." +"Windows. This value is used to compute the installation directories for " +"scripts, data files, Python modules, etc. for the user installation scheme. " +"See also :envvar:`PYTHONUSERBASE`." msgstr "" #: ../../library/site.rst:200 diff --git a/library/socket.po b/library/socket.po index 7bc624ab87..ab9e6f8da9 100644 --- a/library/socket.po +++ b/library/socket.po @@ -423,11 +423,11 @@ msgstr "" #: ../../library/socket.rst:247 msgid "``HV_GUID_ZERO``" -msgstr "" +msgstr "``HV_GUID_ZERO``" #: ../../library/socket.rst:248 msgid "``HV_GUID_BROADCAST``" -msgstr "" +msgstr "``HV_GUID_BROADCAST``" #: ../../library/socket.rst:249 msgid "" diff --git a/library/sqlite3.po b/library/sqlite3.po index d2781b6b84..0e6a2ccf5f 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -1657,7 +1657,7 @@ msgstr "" #: ../../library/sqlite3.rst:1749 msgid "Added support of slicing." -msgstr "" +msgstr "新增對切片的支援。" #: ../../library/sqlite3.rst:1756 msgid "Blob objects" diff --git a/library/statistics.po b/library/statistics.po index 6f8f10c91f..7858cc8acd 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-08-15 00:03+0000\n" "PO-Revision-Date: 2023-07-22 21:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1275,11 +1275,15 @@ msgstr "" msgid ":class:`NormalDist` Examples and Recipes" msgstr ":class:`NormalDist` 範例與錦囊妙計" -#: ../../library/statistics.rst:925 +#: ../../library/statistics.rst:927 +msgid "Classic probability problems" +msgstr "" + +#: ../../library/statistics.rst:929 msgid ":class:`NormalDist` readily solves classic probability problems." msgstr ":class:`NormalDist` 可以輕易地解決經典的機率問題。" -#: ../../library/statistics.rst:927 +#: ../../library/statistics.rst:931 msgid "" "For example, given `historical data for SAT exams `_ showing that scores are " @@ -1291,7 +1295,7 @@ msgstr "" "tables/dt17_226.40.asp>`_,顯示成績為平均 1060、標準差 195 的常態分布。我們要" "求出分數在 1100 與 1200 之間(四捨五入至最接近的整數)的學生的百分比:" -#: ../../library/statistics.rst:940 +#: ../../library/statistics.rst:944 msgid "" "Find the `quartiles `_ and `deciles " "`_ for the SAT scores:" @@ -1299,7 +1303,11 @@ msgstr "" "找出 SAT 分數的\\ `四分位數 `_\\ 以及" "\\ `十分位數 `_:" -#: ../../library/statistics.rst:950 +#: ../../library/statistics.rst:956 +msgid "Monte Carlo inputs for simulations" +msgstr "" + +#: ../../library/statistics.rst:958 msgid "" "To estimate the distribution for a model than isn't easy to solve " "analytically, :class:`NormalDist` can generate input samples for a `Monte " @@ -1309,7 +1317,11 @@ msgstr "" "樣本以進行 `Monte Carlo 模擬 `_:" -#: ../../library/statistics.rst:966 +#: ../../library/statistics.rst:975 +msgid "Approximating binomial distributions" +msgstr "" + +#: ../../library/statistics.rst:977 msgid "" "Normal distributions can be used to approximate `Binomial distributions " "`_ when the sample " @@ -1319,7 +1331,7 @@ msgstr "" "(Binomial distributions) `_。" -#: ../../library/statistics.rst:971 +#: ../../library/statistics.rst:982 msgid "" "For example, an open source conference has 750 attendees and two rooms with " "a 500 person capacity. There is a talk about Python and another about Ruby. " @@ -1332,11 +1344,15 @@ msgstr "" "向參與 Python 講座。假設參與者的偏好沒有改變,那麼 Python 會議室未超過自身容" "量限制的機率是?" -#: ../../library/statistics.rst:1003 +#: ../../library/statistics.rst:1016 +msgid "Naive bayesian classifier" +msgstr "" + +#: ../../library/statistics.rst:1018 msgid "Normal distributions commonly arise in machine learning problems." msgstr "常態分布常在機器學習問題中出現。" -#: ../../library/statistics.rst:1005 +#: ../../library/statistics.rst:1020 msgid "" "Wikipedia has a `nice example of a Naive Bayesian Classifier `_. The " @@ -1347,7 +1363,7 @@ msgstr "" "wiki/Naive_Bayes_classifier#Person_classification>`_。課題為從身高、體重與鞋" "子尺寸等符合常態分布的特徵量測值中判斷一個人的性別。" -#: ../../library/statistics.rst:1010 +#: ../../library/statistics.rst:1025 msgid "" "We're given a training dataset with measurements for eight people. The " "measurements are assumed to be normally distributed, so we summarize the " @@ -1356,13 +1372,13 @@ msgstr "" "給定一組包含八個人的量測值的訓練資料集。假設這些量測值服從常態分布,我們可以" "利用 :class:`NormalDist` 來總結資料:" -#: ../../library/statistics.rst:1023 +#: ../../library/statistics.rst:1038 msgid "" "Next, we encounter a new person whose feature measurements are known but " "whose gender is unknown:" msgstr "接著,我們遇到一個新的人,他的特徵量測值已知,但性別未知:" -#: ../../library/statistics.rst:1032 +#: ../../library/statistics.rst:1047 msgid "" "Starting with a 50% `prior probability `_ of being male or female, we compute the posterior as " @@ -1373,7 +1389,7 @@ msgstr "" "org/wiki/Prior_probability>`_ 為開端,我們將後驗機率 (posterior probability) " "計算為先驗機率乘以給定性別下,各特徵量測值的概度乘積:" -#: ../../library/statistics.rst:1047 +#: ../../library/statistics.rst:1062 msgid "" "The final prediction goes to the largest posterior. This is known as the " "`maximum a posteriori `_ 或者 MAP:" + +#: ../../library/statistics.rst:1073 +msgid "Kernel density estimation" +msgstr "" + +#: ../../library/statistics.rst:1075 +msgid "" +"It is possible to estimate a continuous probability density function from a " +"fixed number of discrete samples." +msgstr "" + +#: ../../library/statistics.rst:1078 +msgid "" +"The basic idea is to smooth the data using `a kernel function such as a " +"normal distribution, triangular distribution, or uniform distribution " +"`_. The degree of " +"smoothing is controlled by a single parameter, ``h``, representing the " +"variance of the kernel function." +msgstr "" + +#: ../../library/statistics.rst:1097 +msgid "" +"`Wikipedia has an example `_ where we can use the ``kde_normal()`` " +"recipe to generate and plot a probability density function estimated from a " +"small sample:" +msgstr "" + +#: ../../library/statistics.rst:1109 +msgid "The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:" +msgstr "" + +#: ../../library/statistics.rst:-1 +msgid "Scatter plot of the estimated probability density function." +msgstr "" diff --git a/library/subprocess.po b/library/subprocess.po index 7f62188dbe..3aaa6cf07c 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -893,7 +893,7 @@ msgstr "" #: ../../library/subprocess.rst:704 msgid "Added context manager support." -msgstr "" +msgstr "新增情境管理器的支援。" #: ../../library/subprocess.rst:707 msgid "" diff --git a/library/sys.po b/library/sys.po index 7f8d4f11b0..c8381f9521 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-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-20 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-" @@ -368,8 +368,8 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:282 ../../library/sys.rst:910 -#: ../../library/sys.rst:1647 ../../library/sys.rst:1880 +#: ../../library/sys.rst:282 ../../library/sys.rst:940 +#: ../../library/sys.rst:1677 ../../library/sys.rst:1914 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -414,13 +414,13 @@ msgid "" "in the future." msgstr "" -#: ../../library/sys.rst:339 ../../library/sys.rst:1057 -#: ../../library/sys.rst:1763 +#: ../../library/sys.rst:339 ../../library/sys.rst:1087 +#: ../../library/sys.rst:1793 msgid "Attribute" msgstr "屬性" -#: ../../library/sys.rst:339 ../../library/sys.rst:1057 -#: ../../library/sys.rst:1763 +#: ../../library/sys.rst:339 ../../library/sys.rst:1087 +#: ../../library/sys.rst:1793 msgid "Explanation" msgstr "解釋" @@ -658,7 +658,7 @@ msgid "" msgstr "" #: ../../library/sys.rst:519 ../../library/sys.rst:580 -#: ../../library/sys.rst:956 +#: ../../library/sys.rst:986 msgid "attribute" msgstr "屬性" @@ -857,191 +857,171 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:580 +#: ../../library/sys.rst:577 +msgid "Attributes of the :data:`!float_info` :term:`named tuple`" +msgstr "" + +#: ../../library/sys.rst:581 msgid "float.h macro" msgstr "float.h macro" -#: ../../library/sys.rst:580 ../../library/sys.rst:956 +#: ../../library/sys.rst:582 ../../library/sys.rst:986 msgid "explanation" msgstr "解釋" -#: ../../library/sys.rst:582 -msgid "``epsilon``" -msgstr "``epsilon``" - -#: ../../library/sys.rst:582 -msgid "``DBL_EPSILON``" -msgstr "``DBL_EPSILON``" +#: ../../library/sys.rst:585 +msgid ":c:macro:`!DBL_EPSILON`" +msgstr ":c:macro:`!DBL_EPSILON`" -#: ../../library/sys.rst:582 +#: ../../library/sys.rst:586 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " -"representable as a float" +"representable as a float." msgstr "" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:589 msgid "See also :func:`math.ulp`." -msgstr "另請參閱 :func:`math.ulp`\\ 。" +msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/sys.rst:587 -msgid "``dig``" -msgstr "``dig``" +#: ../../library/sys.rst:592 +msgid ":c:macro:`!DBL_DIG`" +msgstr ":c:macro:`!DBL_DIG`" -#: ../../library/sys.rst:587 -msgid "``DBL_DIG``" -msgstr "``DBL_DIG``" - -#: ../../library/sys.rst:587 +#: ../../library/sys.rst:593 msgid "" -"maximum number of decimal digits that can be faithfully represented in a " -"float; see below" +"The maximum number of decimal digits that can be faithfully represented in a " +"float; see below." msgstr "" -#: ../../library/sys.rst:590 -msgid "``mant_dig``" -msgstr "``mant_dig``" - -#: ../../library/sys.rst:590 -msgid "``DBL_MANT_DIG``" -msgstr "``DBL_MANT_DIG``" +#: ../../library/sys.rst:597 +msgid ":c:macro:`!DBL_MANT_DIG`" +msgstr ":c:macro:`!DBL_MANT_DIG`" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:598 msgid "" -"float precision: the number of base-``radix`` digits in the significand of a " -"float" +"Float precision: the number of base-``radix`` digits in the significand of a " +"float." msgstr "" -#: ../../library/sys.rst:593 -msgid "``max``" -msgstr "``max``" +#: ../../library/sys.rst:602 +msgid ":c:macro:`!DBL_MAX`" +msgstr ":c:macro:`!DBL_MAX`" -#: ../../library/sys.rst:593 -msgid "``DBL_MAX``" -msgstr "``DBL_MAX``" - -#: ../../library/sys.rst:593 -msgid "maximum representable positive finite float" +#: ../../library/sys.rst:603 +msgid "The maximum representable positive finite float." msgstr "" -#: ../../library/sys.rst:595 -msgid "``max_exp``" -msgstr "``max_exp``" - -#: ../../library/sys.rst:595 -msgid "``DBL_MAX_EXP``" -msgstr "``DBL_MAX_EXP``" +#: ../../library/sys.rst:606 +msgid ":c:macro:`!DBL_MAX_EXP`" +msgstr ":c:macro:`!DBL_MAX_EXP`" -#: ../../library/sys.rst:595 +#: ../../library/sys.rst:607 msgid "" -"maximum integer *e* such that ``radix**(e-1)`` is a representable finite " -"float" +"The maximum integer *e* such that ``radix**(e-1)`` is a representable finite " +"float." msgstr "" -#: ../../library/sys.rst:598 -msgid "``max_10_exp``" -msgstr "``max_10_exp``" +#: ../../library/sys.rst:611 +msgid ":c:macro:`!DBL_MAX_10_EXP`" +msgstr ":c:macro:`!DBL_MAX_10_EXP`" -#: ../../library/sys.rst:598 -msgid "``DBL_MAX_10_EXP``" -msgstr "``DBL_MAX_10_EXP``" - -#: ../../library/sys.rst:598 +#: ../../library/sys.rst:612 msgid "" -"maximum integer *e* such that ``10**e`` is in the range of representable " -"finite floats" +"The maximum integer *e* such that ``10**e`` is in the range of representable " +"finite floats." msgstr "" -#: ../../library/sys.rst:601 -msgid "``min``" -msgstr "``min``" +#: ../../library/sys.rst:616 +msgid ":c:macro:`!DBL_MIN`" +msgstr ":c:macro:`!DBL_MIN`" -#: ../../library/sys.rst:601 -msgid "``DBL_MIN``" -msgstr "``DBL_MIN``" - -#: ../../library/sys.rst:601 -msgid "minimum representable positive *normalized* float" +#: ../../library/sys.rst:617 +msgid "The minimum representable positive *normalized* float." msgstr "" -#: ../../library/sys.rst:603 +#: ../../library/sys.rst:619 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:607 -msgid "``min_exp``" -msgstr "``min_exp``" - -#: ../../library/sys.rst:607 -msgid "``DBL_MIN_EXP``" -msgstr "``DBL_MIN_EXP``" +#: ../../library/sys.rst:623 +msgid ":c:macro:`!DBL_MIN_EXP`" +msgstr ":c:macro:`!DBL_MIN_EXP`" -#: ../../library/sys.rst:607 -msgid "minimum integer *e* such that ``radix**(e-1)`` is a normalized float" +#: ../../library/sys.rst:624 +msgid "" +"The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." msgstr "" -#: ../../library/sys.rst:610 -msgid "``min_10_exp``" -msgstr "``min_10_exp``" +#: ../../library/sys.rst:628 +msgid ":c:macro:`!DBL_MIN_10_EXP`" +msgstr ":c:macro:`!DBL_MIN_10_EXP`" -#: ../../library/sys.rst:610 -msgid "``DBL_MIN_10_EXP``" -msgstr "``DBL_MIN_10_EXP``" +#: ../../library/sys.rst:629 +msgid "The minimum integer *e* such that ``10**e`` is a normalized float." +msgstr "" -#: ../../library/sys.rst:610 -msgid "minimum integer *e* such that ``10**e`` is a normalized float" +#: ../../library/sys.rst:632 +msgid ":c:macro:`!FLT_RADIX`" +msgstr ":c:macro:`!FLT_RADIX`" + +#: ../../library/sys.rst:633 +msgid "The radix of exponent representation." msgstr "" -#: ../../library/sys.rst:613 -msgid "``radix``" -msgstr "``radix``" +#: ../../library/sys.rst:636 +msgid ":c:macro:`!FLT_ROUNDS`" +msgstr ":c:macro:`!FLT_ROUNDS`" -#: ../../library/sys.rst:613 -msgid "``FLT_RADIX``" -msgstr "``FLT_RADIX``" +#: ../../library/sys.rst:637 +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:613 -msgid "radix of exponent representation" +#: ../../library/sys.rst:641 +msgid "``-1``: indeterminable" msgstr "" -#: ../../library/sys.rst:615 -msgid "``rounds``" -msgstr "``rounds``" +#: ../../library/sys.rst:642 +msgid "``0``: toward zero" +msgstr "" -#: ../../library/sys.rst:615 -msgid "``FLT_ROUNDS``" -msgstr "``FLT_ROUNDS``" +#: ../../library/sys.rst:643 +msgid "``1``: to nearest" +msgstr "" -#: ../../library/sys.rst:615 -msgid "" -"integer representing the rounding mode for floating-point arithmetic. This " -"reflects the value of the system ``FLT_ROUNDS`` macro at interpreter startup " -"time: ``-1`` indeterminable, ``0`` toward zero, ``1`` to nearest, ``2`` " -"toward positive infinity, ``3`` toward negative infinity" +#: ../../library/sys.rst:644 +msgid "``2``: toward positive infinity" msgstr "" -#: ../../library/sys.rst:625 +#: ../../library/sys.rst:645 +msgid "``3``: toward negative infinity" +msgstr "" + +#: ../../library/sys.rst:647 msgid "" -"All other values for ``FLT_ROUNDS`` characterize implementation-defined " -"rounding behavior." +"All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-" +"defined rounding behavior." msgstr "" -#: ../../library/sys.rst:629 +#: ../../library/sys.rst:650 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." +"``s`` is any string representing a decimal number with at most :attr:`!sys." "float_info.dig` significant digits, then converting ``s`` to a float and " "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:642 +#: ../../library/sys.rst:663 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:651 +#: ../../library/sys.rst:672 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)`` " @@ -1051,7 +1031,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:664 +#: ../../library/sys.rst:685 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -1061,42 +1041,42 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:671 +#: ../../library/sys.rst:692 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:679 +#: ../../library/sys.rst:700 msgid "Return the number of unicode objects that have been interned." msgstr "" -#: ../../library/sys.rst:686 +#: ../../library/sys.rst:707 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:688 +#: ../../library/sys.rst:709 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:695 +#: ../../library/sys.rst:716 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:701 +#: ../../library/sys.rst:722 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (``RTLD_xxx`` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:706 ../../library/sys.rst:1377 +#: ../../library/sys.rst:727 ../../library/sys.rst:1407 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:711 +#: ../../library/sys.rst:732 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:744 +#: ../../library/sys.rst:765 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1151,20 +1131,35 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:762 +#: ../../library/sys.rst:783 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:769 +#: ../../library/sys.rst:790 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:776 +#: ../../library/sys.rst:794 +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\" " +"and have a very high refcount that does not reflect the actual number of " +"references. Consequently, do not rely on the returned value to be accurate, " +"other than a value of 0 or 1." +msgstr "" + +#: ../../library/sys.rst:800 +msgid "" +"Immortal objects have very large refcounts that do not match the actual " +"number of references to the object." +msgstr "" + +#: ../../library/sys.rst:806 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1172,46 +1167,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:784 +#: ../../library/sys.rst:814 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:789 +#: ../../library/sys.rst:819 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:792 +#: ../../library/sys.rst:822 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:795 +#: ../../library/sys.rst:825 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:799 +#: ../../library/sys.rst:829 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:805 +#: ../../library/sys.rst:835 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:813 +#: ../../library/sys.rst:843 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. " @@ -1220,7 +1215,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:818 +#: ../../library/sys.rst:848 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1228,13 +1223,13 @@ msgstr "" "引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." "_getframe``。" -#: ../../library/sys.rst:822 ../../library/sys.rst:838 +#: ../../library/sys.rst:852 ../../library/sys.rst:868 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:828 +#: ../../library/sys.rst:858 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 " @@ -1243,7 +1238,7 @@ msgid "" "returning the module at the top of the call stack." msgstr "" -#: ../../library/sys.rst:834 +#: ../../library/sys.rst:864 msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." @@ -1251,15 +1246,15 @@ msgstr "" "引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." "_getframemodulename``。" -#: ../../library/sys.rst:848 +#: ../../library/sys.rst:878 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:857 +#: ../../library/sys.rst:887 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:861 +#: ../../library/sys.rst:891 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1267,7 +1262,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:869 +#: ../../library/sys.rst:899 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1279,54 +1274,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:880 +#: ../../library/sys.rst:910 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" -#: ../../library/sys.rst:882 +#: ../../library/sys.rst:912 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:885 +#: ../../library/sys.rst:915 msgid "Constant" msgstr "" -#: ../../library/sys.rst:885 +#: ../../library/sys.rst:915 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:887 +#: ../../library/sys.rst:917 msgid "``1`` (VER_NT_WORKSTATION)" msgstr "``1`` (VER_NT_WORKSTATION)" -#: ../../library/sys.rst:887 +#: ../../library/sys.rst:917 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:889 +#: ../../library/sys.rst:919 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" -#: ../../library/sys.rst:889 +#: ../../library/sys.rst:919 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:892 +#: ../../library/sys.rst:922 msgid "``3`` (VER_NT_SERVER)" msgstr "``3`` (VER_NT_SERVER)" -#: ../../library/sys.rst:892 +#: ../../library/sys.rst:922 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:896 +#: ../../library/sys.rst:926 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:900 +#: ../../library/sys.rst:930 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1334,24 +1329,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:906 +#: ../../library/sys.rst:936 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:912 +#: ../../library/sys.rst:942 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:916 +#: ../../library/sys.rst:946 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:922 +#: ../../library/sys.rst:952 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1361,103 +1356,103 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:929 +#: ../../library/sys.rst:959 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:933 ../../library/sys.rst:1579 +#: ../../library/sys.rst:963 ../../library/sys.rst:1609 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:939 +#: ../../library/sys.rst:969 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:945 ../../library/sys.rst:1600 +#: ../../library/sys.rst:975 ../../library/sys.rst:1630 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:951 +#: ../../library/sys.rst:981 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:958 +#: ../../library/sys.rst:988 msgid ":const:`width`" msgstr ":const:`width`" -#: ../../library/sys.rst:958 +#: ../../library/sys.rst:988 msgid "width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:960 +#: ../../library/sys.rst:990 msgid ":const:`modulus`" msgstr ":const:`modulus`" -#: ../../library/sys.rst:960 +#: ../../library/sys.rst:990 msgid "prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:962 +#: ../../library/sys.rst:992 msgid ":const:`inf`" msgstr ":const:`inf`" -#: ../../library/sys.rst:962 +#: ../../library/sys.rst:992 msgid "hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:964 +#: ../../library/sys.rst:994 msgid ":const:`nan`" msgstr ":const:`nan`" -#: ../../library/sys.rst:964 +#: ../../library/sys.rst:994 msgid "(this attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:966 +#: ../../library/sys.rst:996 msgid ":const:`imag`" msgstr ":const:`imag`" -#: ../../library/sys.rst:966 +#: ../../library/sys.rst:996 msgid "multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:969 +#: ../../library/sys.rst:999 msgid ":const:`algorithm`" msgstr ":const:`algorithm`" -#: ../../library/sys.rst:969 +#: ../../library/sys.rst:999 msgid "name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:972 +#: ../../library/sys.rst:1002 msgid ":const:`hash_bits`" msgstr ":const:`hash_bits`" -#: ../../library/sys.rst:972 +#: ../../library/sys.rst:1002 msgid "internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:974 +#: ../../library/sys.rst:1004 msgid ":const:`seed_bits`" msgstr ":const:`seed_bits`" -#: ../../library/sys.rst:974 +#: ../../library/sys.rst:1004 msgid "size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:980 +#: ../../library/sys.rst:1010 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:986 +#: ../../library/sys.rst:1016 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1465,7 +1460,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:997 +#: ../../library/sys.rst:1027 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. " @@ -1473,25 +1468,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:1002 +#: ../../library/sys.rst:1032 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1007 +#: ../../library/sys.rst:1037 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:1011 +#: ../../library/sys.rst:1041 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:1015 +#: ../../library/sys.rst:1045 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 " @@ -1503,13 +1498,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1025 +#: ../../library/sys.rst:1055 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1028 +#: ../../library/sys.rst:1058 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 " @@ -1518,7 +1513,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1035 +#: ../../library/sys.rst:1065 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1528,61 +1523,61 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1046 +#: ../../library/sys.rst:1076 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1051 +#: ../../library/sys.rst:1081 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1059 +#: ../../library/sys.rst:1089 msgid ":const:`bits_per_digit`" msgstr ":const:`bits_per_digit`" -#: ../../library/sys.rst:1059 +#: ../../library/sys.rst:1089 msgid "" "number of bits held in each digit. Python integers are stored internally in " "base ``2**int_info.bits_per_digit``" msgstr "" -#: ../../library/sys.rst:1063 +#: ../../library/sys.rst:1093 msgid ":const:`sizeof_digit`" msgstr ":const:`sizeof_digit`" -#: ../../library/sys.rst:1063 +#: ../../library/sys.rst:1093 msgid "size in bytes of the C type used to represent a digit" msgstr "" -#: ../../library/sys.rst:1066 +#: ../../library/sys.rst:1096 msgid ":const:`default_max_str_digits`" msgstr ":const:`default_max_str_digits`" -#: ../../library/sys.rst:1066 +#: ../../library/sys.rst:1096 msgid "" "default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1070 +#: ../../library/sys.rst:1100 msgid ":const:`str_digits_check_threshold`" msgstr ":const:`str_digits_check_threshold`" -#: ../../library/sys.rst:1070 +#: ../../library/sys.rst:1100 msgid "" "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:1078 +#: ../../library/sys.rst:1108 msgid "Added ``default_max_str_digits`` and ``str_digits_check_threshold``." msgstr "新增 ``default_max_str_digits`` 和 ``str_digits_check_threshold``。" -#: ../../library/sys.rst:1084 +#: ../../library/sys.rst:1114 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:1090 +#: ../../library/sys.rst:1120 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1599,13 +1594,13 @@ msgstr "" "引發一個附帶引數 ``hook`` 的\\ :ref:`稽核事件 ` ``cpython." "run_interactivehook``。" -#: ../../library/sys.rst:1092 +#: ../../library/sys.rst:1122 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:1101 +#: ../../library/sys.rst:1131 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 " @@ -1617,19 +1612,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1109 +#: ../../library/sys.rst:1139 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:1115 +#: ../../library/sys.rst:1145 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1122 +#: ../../library/sys.rst:1152 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 " @@ -1640,34 +1635,34 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1166 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:1142 +#: ../../library/sys.rst:1172 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:1149 +#: ../../library/sys.rst:1179 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1152 +#: ../../library/sys.rst:1182 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:1160 +#: ../../library/sys.rst:1190 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 " @@ -1680,27 +1675,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1173 +#: ../../library/sys.rst:1203 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1173 +#: ../../library/sys.rst:1203 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1177 +#: ../../library/sys.rst:1207 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1176 +#: ../../library/sys.rst:1206 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1182 +#: ../../library/sys.rst:1212 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:`!" @@ -1708,7 +1703,7 @@ msgid "" "entry doesn't have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1190 +#: ../../library/sys.rst:1220 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 " @@ -1720,78 +1715,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1202 +#: ../../library/sys.rst:1232 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1205 +#: ../../library/sys.rst:1235 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1214 +#: ../../library/sys.rst:1244 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:1218 +#: ../../library/sys.rst:1248 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:1222 +#: ../../library/sys.rst:1252 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1224 +#: ../../library/sys.rst:1254 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1226 +#: ../../library/sys.rst:1256 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1229 +#: ../../library/sys.rst:1259 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:1232 +#: ../../library/sys.rst:1262 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:1238 +#: ../../library/sys.rst:1268 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1273 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:1247 ../../library/sys.rst:1258 +#: ../../library/sys.rst:1277 ../../library/sys.rst:1288 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1282 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 " @@ -1799,13 +1794,13 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1263 +#: ../../library/sys.rst:1293 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:1266 +#: ../../library/sys.rst:1296 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 " @@ -1814,75 +1809,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1279 +#: ../../library/sys.rst:1309 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1312 msgid "System" msgstr "" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1312 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1314 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1314 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1285 +#: ../../library/sys.rst:1315 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1285 +#: ../../library/sys.rst:1315 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1316 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1316 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1287 +#: ../../library/sys.rst:1317 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1287 +#: ../../library/sys.rst:1317 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1288 +#: ../../library/sys.rst:1318 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1288 +#: ../../library/sys.rst:1318 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1289 +#: ../../library/sys.rst:1319 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1289 +#: ../../library/sys.rst:1319 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1290 +#: ../../library/sys.rst:1320 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1290 +#: ../../library/sys.rst:1320 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1293 +#: ../../library/sys.rst:1323 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1890,7 +1885,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1299 +#: ../../library/sys.rst:1329 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1898,57 +1893,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1307 +#: ../../library/sys.rst:1337 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1310 +#: ../../library/sys.rst:1340 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1316 +#: ../../library/sys.rst:1346 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:1319 +#: ../../library/sys.rst:1349 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:1323 +#: ../../library/sys.rst:1353 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1325 +#: ../../library/sys.rst:1355 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:1328 +#: ../../library/sys.rst:1358 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1330 +#: ../../library/sys.rst:1360 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1338 +#: ../../library/sys.rst:1368 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1957,14 +1952,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1344 +#: ../../library/sys.rst:1374 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:1359 +#: ../../library/sys.rst:1389 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1974,7 +1969,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1369 +#: ../../library/sys.rst:1399 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 " @@ -1985,14 +1980,14 @@ msgid "" "const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1381 +#: ../../library/sys.rst:1411 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:1393 +#: ../../library/sys.rst:1423 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 " @@ -2007,7 +2002,7 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1404 +#: ../../library/sys.rst:1434 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2015,71 +2010,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1409 +#: ../../library/sys.rst:1439 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1411 ../../library/sys.rst:1492 +#: ../../library/sys.rst:1441 ../../library/sys.rst:1522 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1415 ../../library/sys.rst:1497 +#: ../../library/sys.rst:1445 ../../library/sys.rst:1527 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1414 +#: ../../library/sys.rst:1444 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1420 ../../library/sys.rst:1512 +#: ../../library/sys.rst:1450 ../../library/sys.rst:1542 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1418 +#: ../../library/sys.rst:1448 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:1424 +#: ../../library/sys.rst:1454 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1453 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:1427 +#: ../../library/sys.rst:1457 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1427 +#: ../../library/sys.rst:1457 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1429 +#: ../../library/sys.rst:1459 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1430 +#: ../../library/sys.rst:1460 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1434 +#: ../../library/sys.rst:1464 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:1438 +#: ../../library/sys.rst:1468 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 " @@ -2087,19 +2082,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1443 +#: ../../library/sys.rst:1473 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1446 +#: ../../library/sys.rst:1476 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1453 +#: ../../library/sys.rst:1483 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2110,7 +2105,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1470 +#: ../../library/sys.rst:1500 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 " @@ -2119,7 +2114,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1475 +#: ../../library/sys.rst:1505 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2127,7 +2122,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1480 +#: ../../library/sys.rst:1510 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 " @@ -2135,31 +2130,31 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1485 +#: ../../library/sys.rst:1515 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." msgstr "" -#: ../../library/sys.rst:1489 +#: ../../library/sys.rst:1519 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:1495 +#: ../../library/sys.rst:1525 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:1506 +#: ../../library/sys.rst:1536 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1530 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``; " @@ -2169,7 +2164,7 @@ msgid "" "const:`False` on that frame." msgstr "" -#: ../../library/sys.rst:1509 +#: ../../library/sys.rst:1539 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 " @@ -2177,22 +2172,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1517 +#: ../../library/sys.rst:1547 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1515 +#: ../../library/sys.rst:1545 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:1525 +#: ../../library/sys.rst:1555 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1520 +#: ../../library/sys.rst:1550 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 " @@ -2201,13 +2196,13 @@ msgid "" "`f_trace_opcodes` to :const:`True` on the frame." msgstr "" -#: ../../library/sys.rst:1527 +#: ../../library/sys.rst:1557 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:1530 +#: ../../library/sys.rst:1560 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 " @@ -2221,17 +2216,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1541 +#: ../../library/sys.rst:1571 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1543 +#: ../../library/sys.rst:1573 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1547 +#: ../../library/sys.rst:1577 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2239,13 +2234,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1554 +#: ../../library/sys.rst:1584 msgid "" "``'opcode'`` event type added; :attr:`f_trace_lines` and :attr:" "`f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1559 +#: ../../library/sys.rst:1589 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2254,7 +2249,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1565 +#: ../../library/sys.rst:1595 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2262,7 +2257,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1567 +#: ../../library/sys.rst:1597 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2270,20 +2265,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1569 +#: ../../library/sys.rst:1599 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:1572 +#: ../../library/sys.rst:1602 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:1584 +#: ../../library/sys.rst:1614 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2292,105 +2287,105 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1591 +#: ../../library/sys.rst:1621 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:1595 +#: ../../library/sys.rst:1625 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1605 +#: ../../library/sys.rst:1635 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1608 ../../library/sys.rst:1623 -#: ../../library/sys.rst:1631 +#: ../../library/sys.rst:1638 ../../library/sys.rst:1653 +#: ../../library/sys.rst:1661 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/sys.rst:1614 +#: ../../library/sys.rst:1644 msgid ":ref:`perf_profiling`" msgstr "" -#: ../../library/sys.rst:1615 +#: ../../library/sys.rst:1645 msgid "https://perf.wiki.kernel.org" msgstr "" -#: ../../library/sys.rst:1619 +#: ../../library/sys.rst:1649 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1621 +#: ../../library/sys.rst:1651 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1629 +#: ../../library/sys.rst:1659 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1667 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:1641 +#: ../../library/sys.rst:1671 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1644 +#: ../../library/sys.rst:1674 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1649 +#: ../../library/sys.rst:1679 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1656 +#: ../../library/sys.rst:1686 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1659 +#: ../../library/sys.rst:1689 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1661 +#: ../../library/sys.rst:1691 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:1663 +#: ../../library/sys.rst:1693 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1665 +#: ../../library/sys.rst:1695 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:1669 +#: ../../library/sys.rst:1699 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:1672 +#: ../../library/sys.rst:1702 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 " @@ -2401,14 +2396,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1681 +#: ../../library/sys.rst:1711 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:1686 +#: ../../library/sys.rst:1716 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2417,7 +2412,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1693 +#: ../../library/sys.rst:1723 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2426,19 +2421,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1699 +#: ../../library/sys.rst:1729 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1705 +#: ../../library/sys.rst:1735 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:1709 +#: ../../library/sys.rst:1739 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 " @@ -2446,7 +2441,7 @@ msgid "" "support the :attr:`~io.BufferedIOBase.buffer` attribute." msgstr "" -#: ../../library/sys.rst:1719 +#: ../../library/sys.rst:1749 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2454,7 +2449,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1724 +#: ../../library/sys.rst:1754 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, " @@ -2462,7 +2457,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1730 +#: ../../library/sys.rst:1760 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2470,12 +2465,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1738 +#: ../../library/sys.rst:1768 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1740 +#: ../../library/sys.rst:1770 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 " @@ -2483,7 +2478,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1745 +#: ../../library/sys.rst:1775 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 " @@ -2491,72 +2486,72 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1750 +#: ../../library/sys.rst:1780 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1757 +#: ../../library/sys.rst:1787 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1765 +#: ../../library/sys.rst:1795 msgid ":const:`name`" msgstr ":const:`name`" -#: ../../library/sys.rst:1765 +#: ../../library/sys.rst:1795 msgid "Name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1767 +#: ../../library/sys.rst:1797 msgid "``'nt'``: Windows threads" msgstr "``'nt'``: Windows 執行緒" -#: ../../library/sys.rst:1768 +#: ../../library/sys.rst:1798 msgid "``'pthread'``: POSIX threads" msgstr "``'pthread'``: POSIX 執行緒" -#: ../../library/sys.rst:1769 +#: ../../library/sys.rst:1799 msgid "" "``'pthread-stubs'``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1771 +#: ../../library/sys.rst:1801 msgid "``'solaris'``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1773 +#: ../../library/sys.rst:1803 msgid ":const:`lock`" msgstr ":const:`lock`" -#: ../../library/sys.rst:1773 +#: ../../library/sys.rst:1803 msgid "Name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1775 +#: ../../library/sys.rst:1805 msgid "``'semaphore'``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1776 +#: ../../library/sys.rst:1806 msgid "``'mutex+cond'``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1778 +#: ../../library/sys.rst:1808 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1780 +#: ../../library/sys.rst:1810 msgid ":const:`version`" msgstr ":const:`version`" -#: ../../library/sys.rst:1780 +#: ../../library/sys.rst:1810 msgid "" "Name and version of the thread library. It is a string, or ``None`` if this " "information is unknown." msgstr "" -#: ../../library/sys.rst:1789 +#: ../../library/sys.rst:1819 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2565,72 +2560,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1797 +#: ../../library/sys.rst:1827 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1799 +#: ../../library/sys.rst:1829 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:1803 +#: ../../library/sys.rst:1833 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1805 -msgid "*exc_type*: Exception type." -msgstr "*exc_type*: 例外型別。" +#: ../../library/sys.rst:1835 +msgid ":attr:`!exc_type`: Exception type." +msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1806 -msgid "*exc_value*: Exception value, can be ``None``." -msgstr "*exc_value*: 例外值,可以為 ``None``。" +#: ../../library/sys.rst:1836 +msgid ":attr:`!exc_value`: Exception value, can be ``None``." +msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1807 -msgid "*exc_traceback*: Exception traceback, can be ``None``." -msgstr "*exc_traceback*: 例外追蹤,可以為 ``None``。" +#: ../../library/sys.rst:1837 +msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." +msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1808 -msgid "*err_msg*: Error message, can be ``None``." -msgstr "*err_msg*: 錯誤訊息,可以為 ``None``。" +#: ../../library/sys.rst:1838 +msgid ":attr:`!err_msg`: Error message, can be ``None``." +msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1809 -msgid "*object*: Object causing the exception, can be ``None``." -msgstr "*object*: 導致例外的物件,可以為 ``None``。" +#: ../../library/sys.rst:1839 +msgid ":attr:`!object`: Object causing the exception, can be ``None``." +msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1811 +#: ../../library/sys.rst:1841 msgid "" -"The default hook formats *err_msg* and *object* as: ``f'{err_msg}: {object!" -"r}'``; use \"Exception ignored in\" error message if *err_msg* is ``None``." +"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:1815 +#: ../../library/sys.rst:1845 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1818 +#: ../../library/sys.rst:1850 +msgid ":func:`excepthook` which handles uncaught exceptions." +msgstr "處理未被捕捉到例外的 :func:`excepthook`。" + +#: ../../library/sys.rst:1854 msgid "" -"Storing *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." +"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:1822 +#: ../../library/sys.rst:1858 msgid "" -"Storing *object* using a custom hook can resurrect it if it is set to an " -"object which is being finalized. Avoid storing *object* after the custom " -"hook completes to avoid resurrecting objects." +"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:1826 -msgid "See also :func:`excepthook` which handles uncaught exceptions." -msgstr "關於處理未捕捉得例外,另請參閱 :func:`excepthook`。" - -#: ../../library/sys.rst:1828 +#: ../../library/sys.rst:1862 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2639,15 +2635,15 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1830 +#: ../../library/sys.rst:1864 msgid "" -"Raise an auditing event ``sys.unraisablehook`` with arguments ``hook``, " -"``unraisable`` when an exception that cannot be handled occurs. The " -"``unraisable`` object is the same as what will be passed to the hook. If no " -"hook has been set, ``hook`` may be ``None``." +"Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " +"*unraisable* when an exception that cannot be handled occurs. The " +"*unraisable* object is the same as what will be passed to the hook. If no " +"hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1839 +#: ../../library/sys.rst:1873 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2656,13 +2652,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1848 +#: ../../library/sys.rst:1882 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:1854 +#: ../../library/sys.rst:1888 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2673,18 +2669,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1862 +#: ../../library/sys.rst:1896 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1867 +#: ../../library/sys.rst:1901 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:1874 +#: ../../library/sys.rst:1908 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 " @@ -2693,25 +2689,25 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1885 +#: ../../library/sys.rst:1919 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:1901 +#: ../../library/sys.rst:1935 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:1909 +#: ../../library/sys.rst:1943 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1910 +#: ../../library/sys.rst:1944 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/" @@ -2732,50 +2728,50 @@ msgstr "object(物件)" msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:844 ../../library/sys.rst:1389 +#: ../../library/sys.rst:874 ../../library/sys.rst:1419 msgid "profile function" msgstr "" -#: ../../library/sys.rst:844 ../../library/sys.rst:1389 +#: ../../library/sys.rst:874 ../../library/sys.rst:1419 msgid "profiler" msgstr "" -#: ../../library/sys.rst:853 ../../library/sys.rst:1466 +#: ../../library/sys.rst:883 ../../library/sys.rst:1496 msgid "trace function" msgstr "" -#: ../../library/sys.rst:853 ../../library/sys.rst:1466 +#: ../../library/sys.rst:883 ../../library/sys.rst:1496 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1242 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1242 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1242 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1383 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1383 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1383 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1383 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1383 msgid "..." msgstr "..." diff --git a/library/sysconfig.po b/library/sysconfig.po index 7dc03abf28..ed92e796c6 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.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-08-20 15:45+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-" @@ -134,7 +134,7 @@ msgstr "" #: ../../library/sysconfig.rst:86 msgid "" "*posix_venv*: scheme for :mod:`Python virtual environments ` on POSIX " -"platforms; by default it is the same as *posix_prefix* ." +"platforms; by default it is the same as *posix_prefix*." msgstr "" #: ../../library/sysconfig.rst:88 @@ -148,13 +148,13 @@ msgstr "" #: ../../library/sysconfig.rst:90 msgid "" "*nt_venv*: scheme for :mod:`Python virtual environments ` on NT " -"platforms; by default it is the same as *nt* ." +"platforms; by default it is the same as *nt*." msgstr "" #: ../../library/sysconfig.rst:92 msgid "" -"*venv*: a scheme with values from ether *posix_venv* or *nt_venv* depending " -"on the platform Python runs on" +"*venv*: a scheme with values from either *posix_venv* or *nt_venv* depending " +"on the platform Python runs on." msgstr "" #: ../../library/sysconfig.rst:94 @@ -311,7 +311,7 @@ msgstr "" #: ../../library/sysconfig.rst:189 msgid "" "If *vars* is provided, it must be a dictionary of variables that will update " -"the dictionary return by :func:`get_config_vars`." +"the dictionary returned by :func:`get_config_vars`." msgstr "" #: ../../library/sysconfig.rst:192 diff --git a/library/test.po b/library/test.po index a645b8a761..42104f34c1 100644 --- a/library/test.po +++ b/library/test.po @@ -1472,7 +1472,7 @@ msgstr "" #: ../../library/test.rst:1440 msgid "Added dictionary interface." -msgstr "" +msgstr "新增字典介面。" #: ../../library/test.rst:1446 msgid "" diff --git a/library/time.po b/library/time.po index 001fe0f4e4..994feb6c80 100644 --- a/library/time.po +++ b/library/time.po @@ -859,7 +859,7 @@ msgstr ":attr:`tm_year`" #: ../../library/time.rst:572 msgid "(for example, 1993)" -msgstr "" +msgstr "(例如 1993)" #: ../../library/time.rst:574 msgid "1" diff --git a/library/tkinter.po b/library/tkinter.po index 8e14e38bc9..30c7155ee1 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -257,7 +257,7 @@ msgstr "" #: ../../library/tkinter.rst:137 msgid "*screenName*" -msgstr "" +msgstr "*screenName*" #: ../../library/tkinter.rst:137 msgid "" @@ -267,7 +267,7 @@ msgstr "" #: ../../library/tkinter.rst:140 msgid "*baseName*" -msgstr "" +msgstr "*baseName*" #: ../../library/tkinter.rst:140 msgid "" @@ -277,7 +277,7 @@ msgstr "" #: ../../library/tkinter.rst:143 msgid "*className*" -msgstr "" +msgstr "*className*" #: ../../library/tkinter.rst:143 msgid "" @@ -287,7 +287,7 @@ msgstr "" #: ../../library/tkinter.rst:146 msgid "*useTk*" -msgstr "" +msgstr "*useTk*" #: ../../library/tkinter.rst:146 msgid "" @@ -297,7 +297,7 @@ msgstr "" #: ../../library/tkinter.rst:149 msgid "*sync*" -msgstr "" +msgstr "*sync*" #: ../../library/tkinter.rst:149 msgid "" @@ -307,7 +307,7 @@ msgstr "" #: ../../library/tkinter.rst:159 msgid "*use*" -msgstr "" +msgstr "*use*" #: ../../library/tkinter.rst:152 msgid "" diff --git a/library/tokenize.po b/library/tokenize.po index d8b04edc57..fed2840797 100644 --- a/library/tokenize.po +++ b/library/tokenize.po @@ -89,11 +89,11 @@ msgstr "" #: ../../library/tokenize.rst:60 msgid "Added support for named tuples." -msgstr "" +msgstr "新增附名元組 (named tuple) 的支援。" #: ../../library/tokenize.rst:63 msgid "Added support for ``exact_type``." -msgstr "" +msgstr "新增 ``exact_type`` 的支援。" #: ../../library/tokenize.rst:66 msgid "" diff --git a/library/traceback.po b/library/traceback.po index eda90a6d58..775bdb77a3 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -76,7 +76,7 @@ msgstr "" #: ../../library/traceback.rst:41 ../../library/traceback.rst:103 msgid "Added negative *limit* support." -msgstr "" +msgstr "新增負數 *limit* 的支援。" #: ../../library/traceback.rst:48 msgid "" @@ -403,7 +403,7 @@ msgstr "新增 *compact* 參數。" #: ../../library/traceback.rst:353 msgid "Added the *max_group_width* and *max_group_depth* parameters." -msgstr "" +msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" #: ../../library/traceback.rst:358 msgid ":class:`StackSummary` Objects" diff --git a/library/typing.po b/library/typing.po index 5d4181011d..88e5ca116c 100644 --- a/library/typing.po +++ b/library/typing.po @@ -2210,7 +2210,7 @@ msgstr "" #: ../../library/typing.rst:2410 msgid "``init``" -msgstr "" +msgstr "``init``" #: ../../library/typing.rst:2411 msgid "" @@ -2220,7 +2220,7 @@ msgstr "" #: ../../library/typing.rst:2414 msgid "``default``" -msgstr "" +msgstr "``default``" #: ../../library/typing.rst:2415 msgid "Provides the default value for the field." @@ -2228,7 +2228,7 @@ msgstr "" #: ../../library/typing.rst:2416 msgid "``default_factory``" -msgstr "" +msgstr "``default_factory``" #: ../../library/typing.rst:2417 msgid "" @@ -2240,7 +2240,7 @@ msgstr "" #: ../../library/typing.rst:2422 msgid "``factory``" -msgstr "" +msgstr "``factory``" #: ../../library/typing.rst:2423 msgid "An alias for the ``default_factory`` parameter on field specifiers." @@ -2248,7 +2248,7 @@ msgstr "" #: ../../library/typing.rst:2424 msgid "``kw_only``" -msgstr "" +msgstr "``kw_only``" #: ../../library/typing.rst:2425 msgid "" @@ -2262,7 +2262,7 @@ msgstr "" #: ../../library/typing.rst:2431 msgid "``alias``" -msgstr "" +msgstr "``alias``" #: ../../library/typing.rst:2432 msgid "" diff --git a/library/unittest.po b/library/unittest.po index f01c6aabbf..daf13a07ff 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -1320,7 +1320,7 @@ msgstr "" #: ../../library/unittest.rst:1025 msgid "Added the ability to use :meth:`assertRaises` as a context manager." -msgstr "" +msgstr "新增 :meth:`assertRaises` 可作為情境管理器使用的能力。" #: ../../library/unittest.rst:1028 msgid "Added the :attr:`exception` attribute." @@ -1329,7 +1329,7 @@ msgstr "新增 :attr:`exception` 屬性。" #: ../../library/unittest.rst:1031 ../../library/unittest.rst:1057 #: ../../library/unittest.rst:1098 ../../library/unittest.rst:1121 msgid "Added the *msg* keyword argument when used as a context manager." -msgstr "" +msgstr "新增作為情境管理器使用時的 *msg* 引數。" #: ../../library/unittest.rst:1038 msgid "" @@ -1348,11 +1348,11 @@ msgstr "" #: ../../library/unittest.rst:1051 msgid "Added under the name ``assertRaisesRegexp``." -msgstr "" +msgstr "以 ``assertRaisesRegexp`` 為名新增。" #: ../../library/unittest.rst:1054 msgid "Renamed to :meth:`assertRaisesRegex`." -msgstr "重新命名為 :meth:`assertRaisesRegex`\\ 。" +msgstr "重新命名為 :meth:`assertRaisesRegex`。" #: ../../library/unittest.rst:1064 msgid "" @@ -1589,7 +1589,7 @@ msgstr "" #: ../../library/unittest.rst:1263 msgid "Added under the name ``assertRegexpMatches``." -msgstr "" +msgstr "以 ``assertRegexpMatches`` 為名新增。" #: ../../library/unittest.rst:1265 msgid "" @@ -1599,7 +1599,7 @@ msgstr "" #: ../../library/unittest.rst:1268 msgid ":meth:`.assertNotRegex`." -msgstr ":meth:`.assertNotRegex`\\ 。" +msgstr ":meth:`.assertNotRegex`。" #: ../../library/unittest.rst:1274 msgid "" @@ -2619,7 +2619,7 @@ msgstr "" #: ../../library/unittest.rst:2191 msgid "Added *durations* keyword argument." -msgstr "" +msgstr "新增 *durations* 關鍵字引數。" #: ../../library/unittest.rst:2196 msgid "" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 0471ef6215..83389d4993 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -286,7 +286,7 @@ msgstr "" #: ../../library/urllib.parse.rst:167 msgid "Added IPv6 URL parsing capabilities." -msgstr "" +msgstr "新增剖析 IPv6 URL 的能力。" #: ../../library/urllib.parse.rst:170 msgid "" diff --git a/library/warnings.po b/library/warnings.po index e0776df6ea..6dca98010a 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -620,7 +620,7 @@ msgstr "新增 *source* 參數。" #: ../../library/warnings.rst:450 msgid "Added *skip_file_prefixes*." -msgstr "" +msgstr "新增 *skip_file_prefixes*。" #: ../../library/warnings.rst:456 msgid "" @@ -733,7 +733,7 @@ msgstr "" #: ../../library/warnings.rst:558 msgid "Added the *action*, *category*, *lineno*, and *append* parameters." -msgstr "" +msgstr "新增 *action*、*category*、*lineno* 和 *append* 參數。" #: ../../library/warnings.rst:9 msgid "warnings" diff --git a/library/xml.sax.reader.po b/library/xml.sax.reader.po index 33d977be06..081eadaaaa 100644 --- a/library/xml.sax.reader.po +++ b/library/xml.sax.reader.po @@ -144,11 +144,11 @@ msgstr "" #: ../../library/xml.sax.reader.rst:110 msgid "Added support of character streams." -msgstr "" +msgstr "新增對字元串流的支援。" #: ../../library/xml.sax.reader.rst:113 msgid "Added support of path-like objects." -msgstr "" +msgstr "新增對類路徑物件的支援。" #: ../../library/xml.sax.reader.rst:119 msgid "Return the current :class:`~xml.sax.handler.ContentHandler`." diff --git a/library/zipfile.po b/library/zipfile.po index 5837948100..311b00b85b 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -253,11 +253,11 @@ msgstr "" #: ../../library/zipfile.rst:216 msgid "Added the ability to use :class:`ZipFile` as a context manager." -msgstr "" +msgstr "新增 :class:`ZipFile` 作為情境管理器使用的能力。" #: ../../library/zipfile.rst:219 msgid "Added support for :mod:`bzip2 ` and :mod:`lzma` compression." -msgstr "" +msgstr "新增對於 :mod:`bzip2 ` 和 :mod:`lzma` 壓縮的支援。" #: ../../library/zipfile.rst:222 ../../library/zipfile.rst:648 msgid "ZIP64 extensions are enabled by default." @@ -676,7 +676,7 @@ msgstr "" #: ../../library/zipfile.rst:582 msgid "Added :data:`Path.suffix` property." -msgstr "" +msgstr "新增 :data:`Path.suffix` 特性。" #: ../../library/zipfile.rst:587 msgid "The final path component, without its suffix." @@ -684,7 +684,7 @@ msgstr "" #: ../../library/zipfile.rst:589 msgid "Added :data:`Path.stem` property." -msgstr "" +msgstr "新增 :data:`Path.stem` 特性。" #: ../../library/zipfile.rst:594 msgid "A list of the path’s file extensions." @@ -692,7 +692,7 @@ msgstr "" #: ../../library/zipfile.rst:596 msgid "Added :data:`Path.suffixes` property." -msgstr "" +msgstr "新增 :data:`Path.suffixes` 特性。" #: ../../library/zipfile.rst:601 msgid "" diff --git a/license.po b/license.po index 1cb146b32e..25935edd95 100644 --- a/license.po +++ b/license.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-20 15:45+0000\n" "PO-Revision-Date: 2022-06-27 09:40+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -321,12 +321,13 @@ msgstr "Sockets" #: ../../license.rst:355 msgid "" -"The :mod:`socket` module uses the functions, :func:`getaddrinfo`, and :func:" -"`getnameinfo`, which are coded in separate source files from the WIDE " +"The :mod:`socket` module uses the functions, :c:func:`!getaddrinfo`, and :c:" +"func:`!getnameinfo`, which are coded in separate source files from the WIDE " "Project, https://www.wide.ad.jp/. ::" msgstr "" -":mod:`socket` 模組使用 :func:`getaddrinfo` 和 :func:`getnameinfo` 函式,它們" -"在 WIDE 專案(https://www.wide.ad.jp/)內,於不同的原始檔案中被編碼:\n" +":mod:`socket` 模組使用 :c:func:`!getaddrinfo` 和 :c:func:`!getnameinfo` 函" +"式,它們在 WIDE 專案(https://www.wide.ad.jp/)內,於不同的原始檔案中被編" +"碼:\n" "\n" "::" @@ -336,10 +337,10 @@ msgstr "非同步 socket 服務" #: ../../license.rst:390 msgid "" -"The :mod:`test.support.asynchat` and :mod:`test.support.asyncore` modules " +"The :mod:`!test.support.asynchat` and :mod:`!test.support.asyncore` modules " "contain the following notice::" msgstr "" -":mod:`test.support.asynchat` 和 :mod:`test.support.asyncore` 模組包含以下聲" +":mod:`!test.support.asynchat` 和 :mod:`!test.support.asyncore` 模組包含以下聲" "明:\n" "\n" "::" @@ -393,9 +394,9 @@ msgid "test_epoll" msgstr "test_epoll" #: ../../license.rst:542 -msgid "The :mod:`test_epoll` module contains the following notice::" +msgid "The :mod:`!test.test_epoll` module contains the following notice::" msgstr "" -":mod:`test_epoll` 模組包含以下聲明:\n" +":mod:`!test.test_epoll` 模組包含以下聲明:\n" "\n" "::" @@ -456,34 +457,37 @@ msgid "" "OpenSSL library for added performance if made available by the operating " "system. Additionally, the Windows and macOS installers for Python may " "include a copy of the OpenSSL libraries, so we include a copy of the OpenSSL " -"license here::" +"license here. For the OpenSSL 3.0 release, and later releases derived from " +"that, the Apache License v2 applies::" msgstr "" -"如果 OpenSSL 函式庫可被作業系統使用,則 :mod:`hashlib`\\ 、\\ :mod:" -"`posix`\\ 、\\ :mod:`ssl`\\ 、\\ :mod:`crypt` 模組會使用它來提升效能。此外," -"因為 Windows 和 macOS 的 Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我" -"們也在此收錄 OpenSSL 授權的副本:\n" +"如果 OpenSSL 函式庫可被作業系統使用,則 :mod:`hashlib`、:mod:`posix`、:mod:" +"`ssl`、:mod:`crypt` 模組會使用它來提升效能。此外,因為 Windows 和 macOS 的 " +"Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我們也在此收錄 OpenSSL 授權" +"的副本。對於 OpenSSL 3.0 版本以及由此衍生的更新版本則適用 Apache 許可證 " +"v2:\n" "\n" "::" -#: ../../license.rst:793 +#: ../../license.rst:845 msgid "expat" msgstr "expat" -#: ../../license.rst:795 +#: ../../license.rst:847 msgid "" -"The :mod:`pyexpat` extension is built using an included copy of the expat " -"sources unless the build is configured ``--with-system-expat``::" +"The :mod:`pyexpat ` extension is built using an included " +"copy of the expat sources unless the build is configured ``--with-system-" +"expat``::" msgstr "" -"除非在建置 :mod:`pyexpat` 擴充時設定為 ``--with-system-expat``\\ ,否則該擴充" -"會用一個內含 expat 原始碼的副本來建置:\n" +"除非在建置 :mod:`pyexpat ` 擴充時設定為 ``--with-system-" +"expat``\\ ,否則該擴充會用一個內含 expat 原始碼的副本來建置:\n" "\n" "::" -#: ../../license.rst:822 +#: ../../license.rst:874 msgid "libffi" msgstr "libffi" -#: ../../license.rst:824 +#: ../../license.rst:876 msgid "" "The :mod:`!_ctypes` C extension underlying the :mod:`ctypes` module is built " "using an included copy of the libffi sources unless the build is configured " @@ -494,11 +498,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:852 +#: ../../license.rst:904 msgid "zlib" msgstr "zlib" -#: ../../license.rst:854 +#: ../../license.rst:906 msgid "" "The :mod:`zlib` extension is built using an included copy of the zlib " "sources if the zlib version found on the system is too old to be used for " @@ -509,11 +513,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:883 +#: ../../license.rst:935 msgid "cfuhash" msgstr "cfuhash" -#: ../../license.rst:885 +#: ../../license.rst:937 msgid "" "The implementation of the hash table used by the :mod:`tracemalloc` is based " "on the cfuhash project::" @@ -523,11 +527,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:924 +#: ../../license.rst:976 msgid "libmpdec" msgstr "libmpdec" -#: ../../license.rst:926 +#: ../../license.rst:978 msgid "" "The :mod:`!_decimal` C extension underlying the :mod:`decimal` module is " "built using an included copy of the libmpdec library unless the build is " @@ -539,11 +543,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:957 +#: ../../license.rst:1009 msgid "W3C C14N test suite" msgstr "W3C C14N 測試套件" -#: ../../license.rst:959 +#: ../../license.rst:1011 msgid "" "The C14N 2.0 test suite in the :mod:`test` package (``Lib/test/xmltestdata/" "c14n-20/``) was retrieved from the W3C website at https://www.w3.org/TR/xml-" @@ -555,11 +559,11 @@ msgstr "" "\n" "::" -#: ../../license.rst:994 +#: ../../license.rst:1046 msgid "Audioop" -msgstr "" +msgstr "Audioop" -#: ../../license.rst:996 +#: ../../license.rst:1048 msgid "" "The audioop module uses the code base in g771.c file of the SoX project::" -msgstr "" +msgstr "audioop 模組使用 SoX 專案的 g771.c 檔案中的程式碼: ::" diff --git a/tutorial/venv.po b/tutorial/venv.po index 56e7eb3ec9..832d03b91f 100644 --- a/tutorial/venv.po +++ b/tutorial/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-04 00:16+0000\n" +"POT-Creation-Date: 2023-08-18 00:03+0000\n" "PO-Revision-Date: 2022-10-16 05:35+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -261,9 +261,9 @@ msgstr "" msgid "" "``pip`` has many more options. Consult the :ref:`installing-index` guide " "for complete documentation for ``pip``. When you've written a package and " -"want to make it available on the Python Package Index, consult the :ref:" -"`distributing-index` guide." +"want to make it available on the Python Package Index, consult the `Python " +"packaging user guide`_." msgstr "" "``pip`` 還有更多功能。可以參考\\ :ref:`installing-index`\\ 指南,來取得完整" "的 ``pip`` 說明文件。當你撰寫了一個套件並且想要讓它在 Python Package Index 上" -"可以取得的話,可以參考\\ :ref:`distributing-index`\\ 指南。" +"可以取得的話,可以參考 `Python packaging user guide`_。" diff --git a/using/cmdline.po b/using/cmdline.po index fe3c4326c9..06d0f4d366 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-18 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-" @@ -1061,8 +1061,7 @@ msgstr "" msgid "" "Defines the :data:`user base directory `, which is used to " "compute the path of the :data:`user site-packages directory ` and :ref:`Distutils installation paths ` " -"for ``python setup.py install --user``." +"USER_SITE>` and installation paths for ``python -m pip install --user``." msgstr "" #: ../../using/cmdline.rst:824 diff --git a/using/configure.po b/using/configure.po index 27c4a13987..27dd931962 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-18 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-" @@ -525,11 +525,11 @@ msgstr "" #: ../../using/configure.rst:371 msgid "Add :func:`sys.gettotalrefcount` function." -msgstr "" +msgstr "新增 :func:`sys.gettotalrefcount` 函式。" #: ../../using/configure.rst:372 msgid "Add :option:`-X showrefcount <-X>` command line option." -msgstr "" +msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" #: ../../using/configure.rst:373 msgid "" @@ -551,7 +551,7 @@ msgstr "" #: ../../using/configure.rst:379 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." -msgstr "" +msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" #: ../../using/configure.rst:380 msgid "" @@ -627,15 +627,15 @@ msgstr "" #: ../../using/configure.rst:420 msgid "Define the ``Py_TRACE_REFS`` macro." -msgstr "" +msgstr "定義 ``Py_TRACE_REFS`` 巨集。" #: ../../using/configure.rst:421 msgid "Add :func:`sys.getobjects` function." -msgstr "" +msgstr "新增 :func:`sys.getobjects` 函式。" #: ../../using/configure.rst:422 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." -msgstr "" +msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" #: ../../using/configure.rst:424 msgid "" @@ -663,11 +663,11 @@ msgstr "" #: ../../using/configure.rst:444 msgid "Enable Valgrind support (default is no)." -msgstr "" +msgstr "啟用 Valgrind 支援(預設不啟用)。" #: ../../using/configure.rst:448 msgid "Enable DTrace support (default is no)." -msgstr "" +msgstr "啟用 DTrace 支援(預設不啟用)。" #: ../../using/configure.rst:450 msgid "" @@ -730,7 +730,7 @@ msgstr "" #: ../../using/configure.rst:513 msgid "Define the ``WITH_EDITLINE`` macro." -msgstr "" +msgstr "定義 ``WITH_EDITLINE`` 巨集。" #: ../../using/configure.rst:519 msgid "Don't build the :mod:`readline` module (built by default)." @@ -738,7 +738,7 @@ msgstr "" #: ../../using/configure.rst:521 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." -msgstr "" +msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" #: ../../using/configure.rst:527 msgid "" @@ -784,11 +784,11 @@ msgstr "" #: ../../using/configure.rst:559 msgid "``siphash24``;" -msgstr "" +msgstr "``siphash24``;" #: ../../using/configure.rst:560 msgid "``fnv``." -msgstr "" +msgstr "``fnv``。" #: ../../using/configure.rst:564 msgid "``siphash13`` is added and it is the new default." @@ -796,7 +796,7 @@ msgstr "" #: ../../using/configure.rst:569 msgid "Built-in hash modules:" -msgstr "" +msgstr "內建雜湊模組:" #: ../../using/configure.rst:571 msgid "``md5``;" @@ -840,7 +840,7 @@ msgstr "" #: ../../using/configure.rst:588 msgid "See the :mod:`ssl` module." -msgstr "" +msgstr "請見 :mod:`ssl` 模組。" #: ../../using/configure.rst:594 msgid "" @@ -850,11 +850,11 @@ msgstr "" #: ../../using/configure.rst:598 msgid "macOS Options" -msgstr "" +msgstr "macOS 選項" #: ../../using/configure.rst:600 msgid "See ``Mac/README.rst``." -msgstr "參閱 ``Mac/README.rst``\\ 。" +msgstr "參閱 ``Mac/README.rst``。" #: ../../using/configure.rst:605 msgid "" @@ -876,7 +876,7 @@ msgstr "" #: ../../using/configure.rst:619 msgid "Options:" -msgstr "" +msgstr "選項:" #: ../../using/configure.rst:621 msgid "``universal2``;" @@ -980,49 +980,43 @@ msgid "" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:689 -msgid ":file:`setup.py`: C extensions built using the ``setuptools`` package." -msgstr "" - -#: ../../using/configure.rst:692 +#: ../../using/configure.rst:691 msgid "Main build steps" msgstr "" -#: ../../using/configure.rst:694 +#: ../../using/configure.rst:693 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:695 +#: ../../using/configure.rst:694 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:696 +#: ../../using/configure.rst:695 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:698 -msgid "" -"C extensions are built by the Makefile (see :file:`Modules/Setup`) and " -"``python setup.py build``." +#: ../../using/configure.rst:697 +msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:702 +#: ../../using/configure.rst:700 msgid "Main Makefile targets" msgstr "" -#: ../../using/configure.rst:704 +#: ../../using/configure.rst:702 msgid "``make``: Build Python with the standard library." msgstr "" -#: ../../using/configure.rst:705 +#: ../../using/configure.rst:703 msgid "" "``make platform:``: build the ``python`` program, but don't build the " "standard library extension modules." msgstr "" -#: ../../using/configure.rst:707 +#: ../../using/configure.rst:705 msgid "" "``make profile-opt``: build Python using Profile Guided Optimization (PGO). " "You can use the configure :option:`--enable-optimizations` option to make " @@ -1030,53 +1024,53 @@ msgid "" "``make``)." msgstr "" -#: ../../using/configure.rst:711 +#: ../../using/configure.rst:709 msgid "" "``make buildbottest``: Build Python and run the Python test suite, the same " "way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds) to " "change the test timeout (1200 by default: 20 minutes)." msgstr "" -#: ../../using/configure.rst:714 +#: ../../using/configure.rst:712 msgid "``make install``: Build and install Python." msgstr "" -#: ../../using/configure.rst:715 +#: ../../using/configure.rst:713 msgid "" "``make regen-all``: Regenerate (almost) all generated files; ``make regen-" "stdlib-module-names`` and ``autoconf`` must be run separately for the " "remaining generated files." msgstr "" -#: ../../using/configure.rst:718 +#: ../../using/configure.rst:716 msgid "``make clean``: Remove built files." msgstr "" -#: ../../using/configure.rst:719 +#: ../../using/configure.rst:717 msgid "" "``make distclean``: Same than ``make clean``, but remove also files created " "by the configure script." msgstr "" -#: ../../using/configure.rst:723 +#: ../../using/configure.rst:721 msgid "C extensions" msgstr "" -#: ../../using/configure.rst:725 +#: ../../using/configure.rst:723 msgid "" "Some C extensions are built as built-in modules, like the ``sys`` module. " "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute::" msgstr "" -#: ../../using/configure.rst:737 +#: ../../using/configure.rst:735 msgid "" "Other C extensions are built as dynamic libraries, like the ``_asyncio`` " "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64::" msgstr "" -#: ../../using/configure.rst:747 +#: ../../using/configure.rst:745 msgid "" ":file:`Modules/Setup` is used to generate Makefile targets to build C " "extensions. At the beginning of the files, C extensions are built as built-" @@ -1084,309 +1078,303 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:751 +#: ../../using/configure.rst:749 msgid "" -"The :file:`setup.py` script only builds C extensions as shared libraries " -"using the :mod:`distutils` module." +"The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_DATA()` and :c:macro:" +"`PyMODINIT_FUNC` macros of :file:`Include/pyport.h` are defined differently " +"depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:754 -msgid "" -"The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_API()` and :c:macro:" -"`PyMODINIT_FUNC()` macros of :file:`Include/pyport.h` are defined " -"differently depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" -msgstr "" - -#: ../../using/configure.rst:758 +#: ../../using/configure.rst:753 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "" -#: ../../using/configure.rst:759 +#: ../../using/configure.rst:754 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "" -#: ../../using/configure.rst:761 +#: ../../using/configure.rst:756 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its ``PyInit_xxx()`` function is not exported, " "causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:767 +#: ../../using/configure.rst:762 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:769 +#: ../../using/configure.rst:764 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:773 +#: ../../using/configure.rst:768 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:777 +#: ../../using/configure.rst:772 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:783 +#: ../../using/configure.rst:778 msgid "" "(Objective) C/C++ preprocessor flags, e.g. ``-I`` if you have " "headers in a nonstandard directory ````." msgstr "" -#: ../../using/configure.rst:786 ../../using/configure.rst:976 +#: ../../using/configure.rst:781 ../../using/configure.rst:971 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " -"value for setup.py to be able to build extension modules using the " -"directories specified in the environment variables." +"value to be able to build extension modules using the directories specified " +"in the environment variables." msgstr "" -#: ../../using/configure.rst:796 +#: ../../using/configure.rst:791 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:798 +#: ../../using/configure.rst:793 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:803 +#: ../../using/configure.rst:798 msgid "Compiler flags" -msgstr "" +msgstr "編譯器旗標" -#: ../../using/configure.rst:807 +#: ../../using/configure.rst:802 msgid "C compiler command." -msgstr "" +msgstr "C 編譯器指令。" -#: ../../using/configure.rst:809 +#: ../../using/configure.rst:804 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:813 +#: ../../using/configure.rst:808 msgid "C++ compiler command." -msgstr "" +msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:815 +#: ../../using/configure.rst:810 msgid "Example: ``g++ -pthread``." msgstr "" -#: ../../using/configure.rst:819 +#: ../../using/configure.rst:814 msgid "C compiler flags." -msgstr "" +msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:823 +#: ../../using/configure.rst:818 msgid "" ":envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C " -"extensions. Use it when a compiler flag should *not* be part of the " -"distutils :envvar:`CFLAGS` once Python is installed (:issue:`21121`)." +"extensions. Use it when a compiler flag should *not* be part of :envvar:" +"`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:827 +#: ../../using/configure.rst:822 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:829 +#: ../../using/configure.rst:824 msgid "" "the compiler flag ``-I`` (for setting the search path for include files). " "The ``-I`` flags are processed from left to right, and any flags in :envvar:" "`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." msgstr "" -#: ../../using/configure.rst:834 +#: ../../using/configure.rst:829 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:842 +#: ../../using/configure.rst:837 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:849 +#: ../../using/configure.rst:844 msgid "Extra C compiler flags." -msgstr "" +msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:853 +#: ../../using/configure.rst:848 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:860 +#: ../../using/configure.rst:855 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:867 +#: ../../using/configure.rst:862 msgid "Base compiler flags." msgstr "" -#: ../../using/configure.rst:871 +#: ../../using/configure.rst:866 msgid "Optimization flags." -msgstr "" +msgstr "最佳化旗標。" -#: ../../using/configure.rst:875 +#: ../../using/configure.rst:870 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:881 +#: ../../using/configure.rst:876 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:883 +#: ../../using/configure.rst:878 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:887 +#: ../../using/configure.rst:882 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:889 +#: ../../using/configure.rst:884 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:894 +#: ../../using/configure.rst:889 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:898 +#: ../../using/configure.rst:893 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:904 +#: ../../using/configure.rst:899 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:906 +#: ../../using/configure.rst:901 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:912 +#: ../../using/configure.rst:907 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:918 +#: ../../using/configure.rst:913 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:921 +#: ../../using/configure.rst:916 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:927 +#: ../../using/configure.rst:922 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:929 +#: ../../using/configure.rst:924 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:933 +#: ../../using/configure.rst:928 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:937 +#: ../../using/configure.rst:932 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:939 +#: ../../using/configure.rst:934 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:943 +#: ../../using/configure.rst:938 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:945 +#: ../../using/configure.rst:940 msgid "" "Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use " "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" -#: ../../using/configure.rst:953 +#: ../../using/configure.rst:948 msgid "" ":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" -"`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of the " -"distutils :envvar:`LDFLAGS` once Python is installed (:issue:`35257`)." +"`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of :envvar:" +"`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:957 +#: ../../using/configure.rst:952 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:959 +#: ../../using/configure.rst:954 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" -#: ../../using/configure.rst:966 +#: ../../using/configure.rst:961 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:973 +#: ../../using/configure.rst:968 msgid "" "Linker flags, e.g. ``-L`` if you have libraries in a nonstandard " "directory ````." msgstr "" -#: ../../using/configure.rst:982 +#: ../../using/configure.rst:977 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:985 +#: ../../using/configure.rst:980 msgid "Example: ``-lrt``." msgstr "" -#: ../../using/configure.rst:989 +#: ../../using/configure.rst:984 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:991 +#: ../../using/configure.rst:986 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." -msgstr "" +msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:995 +#: ../../using/configure.rst:990 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:997 +#: ../../using/configure.rst:992 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." -msgstr "" +msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1001 +#: ../../using/configure.rst:996 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." -msgstr "" +msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1005 +#: ../../using/configure.rst:1000 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." -msgstr "" +msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1011 +#: ../../using/configure.rst:1006 msgid "Linker flags used for building the interpreter object files." msgstr "" diff --git a/using/mac.po b/using/mac.po index 636fdd92ee..9b4760d661 100644 --- a/using/mac.po +++ b/using/mac.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-08-17 00:04+0000\n" "PO-Revision-Date: 2022-08-31 22:26+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -249,36 +249,20 @@ msgid "Installing Additional Python Packages" msgstr "安裝額外的 Python 套件" #: ../../using/mac.rst:128 -msgid "There are several methods to install additional Python packages:" -msgstr "有幾個方法可以安裝額外的 Python 套件:" +msgid "This section has moved to the `Python Packaging User Guide`_." +msgstr "這個章節已經被移動到 `Python Packaging User Guide`_。" -#: ../../using/mac.rst:130 -msgid "" -"Packages can be installed via the standard Python distutils mode (``python " -"setup.py install``)." -msgstr "" -"可以透過標準的 Python distutils 模式(\\ ``python setup.py install``\\ )安裝" -"套件。" - -#: ../../using/mac.rst:133 -msgid "" -"Many packages can also be installed via the :program:`setuptools` extension " -"or :program:`pip` wrapper, see https://pip.pypa.io/." -msgstr "" -"許多套件也可以透過 :program:`setuptools` 擴充套件或 :program:`pip` 包裝器 " -"(wrapper) 安裝,請參閱 https://pip.pypa.io/\\ 。" - -#: ../../using/mac.rst:138 +#: ../../using/mac.rst:134 msgid "GUI Programming on the Mac" msgstr "於 Mac 上開發 GUI 程式" -#: ../../using/mac.rst:140 +#: ../../using/mac.rst:136 msgid "" "There are several options for building GUI applications on the Mac with " "Python." msgstr "於 Mac 上使用 Python 來建立 GUI 應用程式有許多選項。" -#: ../../using/mac.rst:142 +#: ../../using/mac.rst:138 msgid "" "*PyObjC* is a Python binding to Apple's Objective-C/Cocoa framework, which " "is the foundation of most modern Mac development. Information on PyObjC is " @@ -288,7 +272,7 @@ msgstr "" "多數現代 Mac 開發的基礎。有關 PyObjC 的資訊,請見 https://pypi.org/project/" "pyobjc/。" -#: ../../using/mac.rst:146 +#: ../../using/mac.rst:142 msgid "" "The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-" "platform Tk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is " @@ -299,7 +283,7 @@ msgstr "" "(https://www.tcl.tk)。Apple 的 macOS 包含了 Aqua 原生版本的 Tk,最新版本可以" "從 https://www.activestate.com 下載和安裝;它也可以從原始碼開始建置。" -#: ../../using/mac.rst:151 +#: ../../using/mac.rst:147 msgid "" "*wxPython* is another popular cross-platform GUI toolkit that runs natively " "on macOS. Packages and documentation are available from https://www.wxpython." @@ -308,7 +292,7 @@ msgstr "" "*wxPython* 是另一種流行的跨平臺 GUI 工具套件,可在 macOS 上本機執行。套件和文" "件可從 https://www.wxpython.org 獲得。" -#: ../../using/mac.rst:154 +#: ../../using/mac.rst:150 msgid "" "*PyQt* is another popular cross-platform GUI toolkit that runs natively on " "macOS. More information can be found at https://riverbankcomputing.com/" @@ -317,11 +301,11 @@ msgstr "" "*PyQt* 是另一種流行的跨平臺 GUI 工具套件,可在原生 macOS 上執行。更多資訊可" "在 https://riverbankcomputing.com/software/pyqt/intro 上找到。" -#: ../../using/mac.rst:160 +#: ../../using/mac.rst:156 msgid "Distributing Python Applications on the Mac" msgstr "於 Mac 上發行 Python 應用程式" -#: ../../using/mac.rst:162 +#: ../../using/mac.rst:158 msgid "" "The standard tool for deploying standalone Python applications on the Mac " "is :program:`py2app`. More information on installing and using py2app can be " @@ -330,25 +314,25 @@ msgstr "" "在 Mac 上部署獨立 Python 應用程式的標準工具是 :program:`py2app`\\ 。有關安裝" "和使用 py2app 的更多資訊,請參考 https://pypi.org/project/py2app/\\ 。" -#: ../../using/mac.rst:168 +#: ../../using/mac.rst:164 msgid "Other Resources" msgstr "其他資源" -#: ../../using/mac.rst:170 +#: ../../using/mac.rst:166 msgid "" "The MacPython mailing list is an excellent support resource for Python users " "and developers on the Mac:" msgstr "" "MacPython 郵件清單對於 Mac 上的 Python 使用者和開發者是一個極佳的支援資源:" -#: ../../using/mac.rst:173 +#: ../../using/mac.rst:169 msgid "https://www.python.org/community/sigs/current/pythonmac-sig/" msgstr "https://www.python.org/community/sigs/current/pythonmac-sig/" -#: ../../using/mac.rst:175 +#: ../../using/mac.rst:171 msgid "Another useful resource is the MacPython wiki:" msgstr "另一個好用資源是 MacPython wiki:" -#: ../../using/mac.rst:177 +#: ../../using/mac.rst:173 msgid "https://wiki.python.org/moin/MacPython" msgstr "https://wiki.python.org/moin/MacPython" diff --git a/using/windows.po b/using/windows.po index a0ab02d8eb..a210a5b577 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-17 00:04+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-" @@ -2060,10 +2060,10 @@ msgstr "cx_Freeze" #: ../../using/windows.rst:1249 msgid "" -"`cx_Freeze `_ is a " -"``distutils`` extension which wraps Python scripts into executable Windows " -"programs (:file:`{*}.exe` files). When you have done this, you can " -"distribute your application without requiring your users to install Python." +"`cx_Freeze `_ wraps Python " +"scripts into executable Windows programs (:file:`{*}.exe` files). When you " +"have done this, you can distribute your application without requiring your " +"users to install Python." msgstr "" #: ../../using/windows.rst:1256 diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index f96663c5b7..bbf65b2517 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-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-18 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-" @@ -1319,7 +1319,7 @@ msgid "" "method definition tables to simplify implementation of methods with no " "arguments or a single untyped argument. Calling such methods is more " "efficient than calling a corresponding method that uses :c:macro:" -"`METH_VARARGS`. Also, the old :c:macro:`METH_OLDARGS` style of writing C " +"`METH_VARARGS`. Also, the old :c:macro:`!METH_OLDARGS` style of writing C " "methods is now officially deprecated." msgstr "" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 685e9a2976..186727b21f 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-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 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-" @@ -1079,7 +1079,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1037 msgid "(Contributed by Just van Rossum.)" -msgstr "" +msgstr "(由 Just van Rossum 所貢獻。)" #: ../../whatsnew/2.3.rst:1039 msgid "" @@ -1228,7 +1228,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1174 msgid "(Contributed by Walter Dörwald.)" -msgstr "" +msgstr "(由 Walter Dörwald 所貢獻。)" #: ../../whatsnew/2.3.rst:1176 msgid "" @@ -1247,7 +1247,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1189 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/2.3.rst:1191 msgid "" @@ -1405,7 +1405,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1294 msgid "(Contributed by Peter Åstrand.)" -msgstr "" +msgstr "(由 Peter Åstrand 所貢獻。)" #: ../../whatsnew/2.3.rst:1296 msgid "" @@ -1438,7 +1438,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1332 msgid "(Contributed by Kevin O'Connor.)" -msgstr "" +msgstr "(由 Kevin O'Connor 所貢獻。)" #: ../../whatsnew/2.3.rst:1334 msgid "" @@ -1776,7 +1776,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1639 msgid "(Contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(由 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.3.rst:1641 msgid "" @@ -2066,10 +2066,11 @@ msgstr "" #: ../../whatsnew/2.3.rst:1889 msgid "" -"The :c:macro:`DL_EXPORT` and :c:macro:`DL_IMPORT` macros are now deprecated. " -"Initialization functions for Python extension modules should now be declared " -"using the new macro :c:macro:`PyMODINIT_FUNC`, while the Python core will " -"generally use the :c:macro:`PyAPI_FUNC` and :c:macro:`PyAPI_DATA` macros." +"The :c:macro:`!DL_EXPORT` and :c:macro:`!DL_IMPORT` macros are now " +"deprecated. Initialization functions for Python extension modules should now " +"be declared using the new macro :c:macro:`PyMODINIT_FUNC`, while the Python " +"core will generally use the :c:macro:`PyAPI_FUNC` and :c:macro:`PyAPI_DATA` " +"macros." msgstr "" #: ../../whatsnew/2.3.rst:1894 diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index 2dbfd429e4..d442af8ca9 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-27 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 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-" @@ -995,7 +995,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:891 ../../whatsnew/2.4.rst:919 #: ../../whatsnew/2.4.rst:1212 msgid "(Contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(由 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.4.rst:893 ../../whatsnew/2.4.rst:1519 msgid "" @@ -1043,7 +1043,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:933 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/2.4.rst:935 msgid "" @@ -1294,7 +1294,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:1140 msgid "(Contributed by Hye-Shik Chang.)" -msgstr "" +msgstr "(由 Hye-Shik Chang 所貢獻。)" #: ../../whatsnew/2.4.rst:1142 msgid "" @@ -1682,7 +1682,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:1479 msgid "" -"A new method flag, :c:macro:`METH_COEXISTS`, allows a function defined in " +"A new method flag, :c:macro:`METH_COEXIST`, allows a function defined in " "slots to co-exist with a :c:type:`PyCFunction` having the same name. This " "can halve the access time for a method such as :meth:`set.__contains__`. " "(Contributed by Raymond Hettinger.)" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index 17d26a33fd..88fbcaede3 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -1192,7 +1192,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1043 msgid "(Contributed by Steven Bethard and Raymond Hettinger.)" -msgstr "" +msgstr "(由 Steven Bethard 和 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.5.rst:1045 msgid "" @@ -1303,7 +1303,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1139 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/2.5.rst:1141 msgid "" @@ -1455,7 +1455,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1269 msgid "(Contributed by Guido van Rossum.)" -msgstr "" +msgstr "(由 Guido van Rossum 所貢獻。)" #: ../../whatsnew/2.5.rst:1271 msgid "" @@ -1517,7 +1517,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1309 msgid "(Contributed by Skip Montanaro and Andrew McNamara.)" -msgstr "" +msgstr "(由 Skip Montanaro 和 Andrew McNamara 所貢獻。)" #: ../../whatsnew/2.5.rst:1311 msgid "" @@ -1589,7 +1589,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1373 ../../whatsnew/2.5.rst:1382 msgid "(Contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(由 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.5.rst:1375 msgid "" @@ -1629,7 +1629,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1400 msgid "(Contributed by Georg Brandl.)" -msgstr "" +msgstr "(由 Georg Brandl 所貢獻。)" #: ../../whatsnew/2.5.rst:1404 msgid "" @@ -1929,7 +1929,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1632 msgid "(Contributed by Ka-Ping Yee.)" -msgstr "" +msgstr "(由 Ka-Ping Yee 所貢獻。)" #: ../../whatsnew/2.5.rst:1634 msgid "" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index dde7069360..dd902227eb 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-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 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-" @@ -1647,7 +1647,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1517 msgid "(Contributed by Alexander Belopolsky; :issue:`1686487`.)" -msgstr "" +msgstr "(由 Alexander Belopolsky 所貢獻;:issue:`1686487`。)" #: ../../whatsnew/2.6.rst:1519 msgid "" @@ -1677,7 +1677,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1546 msgid "(Contributed by Raymond Hettinger)" -msgstr "" +msgstr "(由 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.6.rst:1548 msgid "" @@ -1705,7 +1705,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1596 ../../whatsnew/2.6.rst:1880 #: ../../whatsnew/2.6.rst:1901 msgid "(Contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(由 Raymond Hettinger 所貢獻。)" #: ../../whatsnew/2.6.rst:1598 msgid "" @@ -1827,7 +1827,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1693 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/2.6.rst:1695 msgid "" @@ -2352,7 +2352,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2132 msgid "(Contributed by Christian Heimes and Mark Dickinson.)" -msgstr "" +msgstr "(由 Christian Heimes 和 Mark Dickinson 所貢獻。)" #: ../../whatsnew/2.6.rst:2134 msgid "" @@ -2371,7 +2371,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2150 msgid "(Contributed by Georg Brandl, after a suggestion by Gregory Petrosyan.)" -msgstr "" +msgstr "(經 Gregory Petrosyan 建議後由 Georg Brandl 所貢獻。)" #: ../../whatsnew/2.6.rst:2152 msgid "" @@ -2381,7 +2381,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2162 msgid "(Contributed by Georg Brandl, after a suggestion by Barry Warsaw.)" -msgstr "" +msgstr "(經 Barry Warsaw 建議後由 Georg Brandl 所貢獻。)" #: ../../whatsnew/2.6.rst:2164 msgid "" @@ -2481,7 +2481,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2241 msgid "(Contributed by Paul Moore; :issue:`2439`.)" -msgstr "" +msgstr "(由 Paul Moore 貢獻;:issue:`2439`。)" #: ../../whatsnew/2.6.rst:2243 msgid "" @@ -2578,7 +2578,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2315 msgid "(Contributed by Tarek Ziadé; :issue:`2663`.)" -msgstr "" +msgstr "(由 Tarek Ziadé 貢獻;:issue:`2663`。)" #: ../../whatsnew/2.6.rst:2317 msgid "" @@ -2604,7 +2604,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2335 msgid "(Contributed by Adam Olsen; :issue:`1583`.)" -msgstr "" +msgstr "(由 Adam Olsen 貢獻;:issue:`1583`。)" #: ../../whatsnew/2.6.rst:2337 msgid "" @@ -2843,7 +2843,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2534 msgid "(Contributed by Dwayne Bailey; :issue:`1581073`.)" -msgstr "" +msgstr "(由 Dwayne Bailey 貢獻;:issue:`1581073`。)" #: ../../whatsnew/2.6.rst:2536 msgid "" @@ -3006,7 +3006,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2653 msgid "(Contributed by Alan McIntyre; :issue:`467924`.)" -msgstr "" +msgstr "(由 Alan McIntyre 貢獻;:issue:`467924`。)" #: ../../whatsnew/2.6.rst:2655 msgid "" @@ -3427,10 +3427,10 @@ msgstr "" #: ../../whatsnew/2.6.rst:3061 msgid "" "Some macros were renamed in both 3.0 and 2.6 to make it clearer that they " -"are macros, not functions. :c:macro:`Py_Size()` became :c:macro:" -"`Py_SIZE()`, :c:macro:`Py_Type()` became :c:macro:`Py_TYPE()`, and :c:macro:" -"`Py_Refcnt()` became :c:macro:`Py_REFCNT()`. The mixed-case macros are still " -"available in Python 2.6 for backward compatibility. (:issue:`1629`)" +"are macros, not functions. :c:macro:`!Py_Size()` became :c:macro:" +"`Py_SIZE()`, :c:macro:`!Py_Type()` became :c:macro:`Py_TYPE()`, and :c:macro:" +"`!Py_Refcnt()` became :c:macro:`Py_REFCNT()`. The mixed-case macros are " +"still available in Python 2.6 for backward compatibility. (:issue:`1629`)" msgstr "" #: ../../whatsnew/2.6.rst:3070 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index e5008d3cd9..ce47e5c2bc 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-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 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-" @@ -849,7 +849,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:843 msgid "(Contributed by Fredrik Johansson and Victor Stinner; :issue:`3439`.)" -msgstr "" +msgstr "(由 Fredrik Johansson 和 Victor Stinner 貢獻;:issue:`3439`。)" #: ../../whatsnew/2.7.rst:845 msgid "" @@ -957,7 +957,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:928 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/2.7.rst:930 msgid "Several performance enhancements have been added:" @@ -1017,7 +1017,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:976 msgid "(Contributed by Mark Dickinson; :issue:`4258`.)" -msgstr "" +msgstr "(由 Mark Dickinson 貢獻;:issue:`4258`。)" #: ../../whatsnew/2.7.rst:978 msgid "" @@ -1195,7 +1195,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:1157 msgid "(Contributed by Mats Kindahl; :issue:`7005`.)" -msgstr "" +msgstr "(由 Mats Kindahl 貢獻;:issue:`7005`。)" #: ../../whatsnew/2.7.rst:1159 msgid "" @@ -1765,7 +1765,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:1588 msgid "(Contributed by Gregory P. Smith.)" -msgstr "" +msgstr "(由 Gregory P. Smith 所貢獻。)" #: ../../whatsnew/2.7.rst:1590 msgid "" @@ -2693,11 +2693,12 @@ msgstr "" #: ../../whatsnew/2.7.rst:2289 msgid "" -"There is an existing data type already used for this, :c:type:`PyCObject`, " +"There is an existing data type already used for this, :c:type:`!PyCObject`, " "but it doesn't provide type safety. Evil code written in pure Python could " -"cause a segmentation fault by taking a :c:type:`PyCObject` from module A and " -"somehow substituting it for the :c:type:`PyCObject` in module B. Capsules " -"know their own name, and getting the pointer requires providing the name:" +"cause a segmentation fault by taking a :c:type:`!PyCObject` from module A " +"and somehow substituting it for the :c:type:`!PyCObject` in module B. " +"Capsules know their own name, and getting the pointer requires providing the " +"name:" msgstr "" #: ../../whatsnew/2.7.rst:2307 @@ -2711,10 +2712,10 @@ msgstr "" #: ../../whatsnew/2.7.rst:2312 msgid "" "Python 2.7 now uses capsules internally to provide various extension-module " -"APIs, but the :c:func:`PyCObject_AsVoidPtr` was modified to handle capsules, " -"preserving compile-time compatibility with the :c:type:`CObject` interface. " -"Use of :c:func:`PyCObject_AsVoidPtr` will signal a :exc:" -"`PendingDeprecationWarning`, which is silent by default." +"APIs, but the :c:func:`!PyCObject_AsVoidPtr` was modified to handle " +"capsules, preserving compile-time compatibility with the :c:type:`!" +"PyCObject` interface. Use of :c:func:`!PyCObject_AsVoidPtr` will signal a :" +"exc:`PendingDeprecationWarning`, which is silent by default." msgstr "" #: ../../whatsnew/2.7.rst:2319 @@ -3283,7 +3284,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:2773 ../../whatsnew/2.7.rst:2786 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`23404` 中貢獻。)" #: ../../whatsnew/2.7.rst:2779 msgid "Removal of ``make touch`` build target" diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index fe738984c0..c533da625c 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-08-18 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-" @@ -1260,8 +1260,10 @@ msgstr "" #: ../../whatsnew/3.0.rst:878 msgid "" -"Removed :c:macro:`METH_OLDARGS` and :c:macro:`WITH_CYCLE_GC` from the C API." -msgstr "移除 C API 中的 :c:macro:`METH_OLDARGS` 和 :c:macro:`WITH_CYCLE_GC`。" +"Removed :c:macro:`!METH_OLDARGS` and :c:macro:`!WITH_CYCLE_GC` from the C " +"API." +msgstr "" +"移除 C API 中的 :c:macro:`!METH_OLDARGS` 和 :c:macro:`!WITH_CYCLE_GC`。" #: ../../whatsnew/3.0.rst:884 msgid "Performance" diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index eb995e6eb8..5e5a29c54c 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-18 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-" @@ -194,8 +194,8 @@ msgid "" "(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 " "`_.)" msgstr "" -"(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 " -"`_。)" +"(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 `_。)" #: ../../whatsnew/3.1.rst:178 msgid "" @@ -568,8 +568,8 @@ msgid "" "(Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou and " "Benjamin Peterson; :issue:`4136`.)" msgstr "" -"(由 Bob Ippolito 貢獻,由 Antoine Pitrou 和 Benjamin Peterson 轉換為 Py3." -"1;:issue:`4136`。)" +"(由 Bob Ippolito 貢獻,由 Antoine Pitrou 和 Benjamin Peterson 轉換為 " +"Py3.1;:issue:`4136`。)" #: ../../whatsnew/3.1.rst:460 msgid "" @@ -660,7 +660,7 @@ msgstr "(由 Mark Dickinson 貢獻;:issue:`5914`。)" #: ../../whatsnew/3.1.rst:513 msgid "" -"Added :c:type:`PyCapsule` as a replacement for the :c:type:`PyCObject` API. " +"Added :c:type:`PyCapsule` as a replacement for the :c:type:`!PyCObject` API. " "The principal difference is that the new type has a well defined interface " "for passing typing safety information and a less complicated signature for " "calling a destructor. The old type had a problematic API and is now " diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 733d5754b4..b130430e5e 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-14 13:46+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -66,52 +66,60 @@ msgid ":pep:`701`: Syntactic formalization of f-strings" msgstr "" #: ../../whatsnew/3.12.rst:73 +msgid "Interpreter improvements:" +msgstr "" + +#: ../../whatsnew/3.12.rst:75 +msgid ":ref:`whatsnew312-pep684`" +msgstr "" + +#: ../../whatsnew/3.12.rst:77 msgid "New typing features:" msgstr "新增型別特性:" -#: ../../whatsnew/3.12.rst:75 +#: ../../whatsnew/3.12.rst:79 msgid ":pep:`688`: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:77 +#: ../../whatsnew/3.12.rst:81 msgid ":ref:`whatsnew312-pep692`" msgstr ":ref:`whatsnew312-pep692`" -#: ../../whatsnew/3.12.rst:79 +#: ../../whatsnew/3.12.rst:83 msgid ":ref:`whatsnew312-pep695`" msgstr ":ref:`whatsnew312-pep695`" -#: ../../whatsnew/3.12.rst:81 +#: ../../whatsnew/3.12.rst:85 msgid ":pep:`698`: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:83 +#: ../../whatsnew/3.12.rst:87 msgid "Important deprecations, removals or restrictions:" msgstr "" -#: ../../whatsnew/3.12.rst:85 +#: ../../whatsnew/3.12.rst:89 msgid ":pep:`623`: Remove wstr from Unicode" msgstr "" -#: ../../whatsnew/3.12.rst:87 +#: ../../whatsnew/3.12.rst:91 msgid "" ":pep:`632`: Remove the ``distutils`` package. See `the migration guide " "`_ for advice on its " "replacement." msgstr "" -#: ../../whatsnew/3.12.rst:92 +#: ../../whatsnew/3.12.rst:96 msgid "Improved Error Messages" msgstr "" -#: ../../whatsnew/3.12.rst:94 +#: ../../whatsnew/3.12.rst:98 msgid "" "Modules from the standard library are now potentially suggested as part of " "the error messages displayed by the interpreter when a :exc:`NameError` is " "raised to the top level. Contributed by Pablo Galindo in :gh:`98254`." msgstr "" -#: ../../whatsnew/3.12.rst:103 +#: ../../whatsnew/3.12.rst:107 msgid "" "Improve the error suggestion for :exc:`NameError` exceptions for instances. " "Now if a :exc:`NameError` is raised in a method and the instance has an " @@ -120,14 +128,14 @@ msgid "" "scope. Contributed by Pablo Galindo in :gh:`99139`." msgstr "" -#: ../../whatsnew/3.12.rst:124 +#: ../../whatsnew/3.12.rst:128 msgid "" "Improve the :exc:`SyntaxError` error message when the user types ``import x " "from y`` instead of ``from y import x``. Contributed by Pablo Galindo in :gh:" "`98931`." msgstr "" -#: ../../whatsnew/3.12.rst:134 +#: ../../whatsnew/3.12.rst:138 msgid "" ":exc:`ImportError` exceptions raised from failed ``from import " "`` statements now include suggestions for the value of ```` " @@ -135,15 +143,15 @@ msgid "" "in :gh:`91058`." msgstr "" -#: ../../whatsnew/3.12.rst:145 ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:149 ../../whatsnew/3.12.rst:1639 msgid "New Features" msgstr "新增特性" -#: ../../whatsnew/3.12.rst:150 +#: ../../whatsnew/3.12.rst:154 msgid "PEP 701: Syntactic formalization of f-strings" msgstr "" -#: ../../whatsnew/3.12.rst:152 +#: ../../whatsnew/3.12.rst:156 msgid "" ":pep:`701` lifts some restrictions on the usage of f-strings. Expression " "components inside f-strings can now be any valid Python expression including " @@ -152,7 +160,7 @@ msgid "" "in detail:" msgstr "" -#: ../../whatsnew/3.12.rst:157 +#: ../../whatsnew/3.12.rst:161 msgid "" "Quote reuse: in Python 3.11, reusing the same quotes as the containing f-" "string raises a :exc:`SyntaxError`, forcing the user to either use other " @@ -160,7 +168,7 @@ msgid "" "uses single quotes). In Python 3.12, you can now do things like this:" msgstr "" -#: ../../whatsnew/3.12.rst:166 +#: ../../whatsnew/3.12.rst:170 msgid "" "Note that before this change there was no explicit limit in how f-strings " "can be nested, but the fact that string quotes cannot be reused inside the " @@ -168,13 +176,13 @@ msgid "" "arbitrarily. In fact, this is the most nested f-string that could be written:" msgstr "" -#: ../../whatsnew/3.12.rst:174 +#: ../../whatsnew/3.12.rst:178 msgid "" "As now f-strings can contain any valid Python expression inside expression " "components, it is now possible to nest f-strings arbitrarily:" msgstr "" -#: ../../whatsnew/3.12.rst:180 +#: ../../whatsnew/3.12.rst:184 msgid "" "Multi-line expressions and comments: In Python 3.11, f-strings expressions " "must be defined in a single line even if outside f-strings expressions could " @@ -183,7 +191,7 @@ msgid "" "spanning multiple lines and include comments on them:" msgstr "" -#: ../../whatsnew/3.12.rst:193 +#: ../../whatsnew/3.12.rst:197 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " "couldn't contain any ``\\`` character. This also affected unicode escaped " @@ -192,11 +200,11 @@ msgid "" "can define expressions like this:" msgstr "" -#: ../../whatsnew/3.12.rst:206 +#: ../../whatsnew/3.12.rst:210 msgid "See :pep:`701` for more details." msgstr "詳情請見 :pep:`701`。" -#: ../../whatsnew/3.12.rst:208 +#: ../../whatsnew/3.12.rst:212 msgid "" "As a positive side-effect of how this feature has been implemented (by " "parsing f-strings with the PEG parser (see :pep:`617`), now error messages " @@ -205,7 +213,7 @@ msgid "" "`SyntaxError`:" msgstr "" -#: ../../whatsnew/3.12.rst:221 +#: ../../whatsnew/3.12.rst:225 msgid "" "but the error message doesn't include the exact location of the error within " "the line and also has the expression artificially surrounded by parentheses. " @@ -213,25 +221,25 @@ msgid "" "can be more precise and show the entire line:" msgstr "" -#: ../../whatsnew/3.12.rst:233 +#: ../../whatsnew/3.12.rst:237 msgid "" "(Contributed by Pablo Galindo, Batuhan Taskaya, Lysandros Nikolaou, Cristián " "Maureira-Fredes and Marta Gómez in :gh:`102856`. PEP written by Pablo " "Galindo, Batuhan Taskaya, Lysandros Nikolaou and Marta Gómez)." msgstr "" -#: ../../whatsnew/3.12.rst:240 +#: ../../whatsnew/3.12.rst:244 msgid "PEP 709: Comprehension inlining" msgstr "" -#: ../../whatsnew/3.12.rst:242 +#: ../../whatsnew/3.12.rst:246 msgid "" "Dictionary, list, and set comprehensions are now inlined, rather than " "creating a new single-use function object for each execution of the " "comprehension. This speeds up execution of a comprehension by up to 2x." msgstr "" -#: ../../whatsnew/3.12.rst:246 +#: ../../whatsnew/3.12.rst:250 msgid "" "Comprehension iteration variables remain isolated; they don't overwrite a " "variable of the same name in the outer scope, nor are they visible after the " @@ -239,24 +247,24 @@ msgid "" "manipulation, not via separate function scope." msgstr "" -#: ../../whatsnew/3.12.rst:251 +#: ../../whatsnew/3.12.rst:255 msgid "Inlining does result in a few visible behavior changes:" msgstr "" -#: ../../whatsnew/3.12.rst:253 +#: ../../whatsnew/3.12.rst:257 msgid "" "There is no longer a separate frame for the comprehension in tracebacks, and " "tracing/profiling no longer shows the comprehension as a function call." msgstr "" -#: ../../whatsnew/3.12.rst:255 +#: ../../whatsnew/3.12.rst:259 msgid "" "Calling :func:`locals` inside a comprehension now includes variables from " "outside the comprehension, and no longer includes the synthetic ``.0`` " "variable for the comprehension \"argument\"." msgstr "" -#: ../../whatsnew/3.12.rst:258 +#: ../../whatsnew/3.12.rst:262 msgid "" "A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " "locals()]``) may see \"RuntimeError: dictionary changed size during " @@ -266,22 +274,22 @@ msgid "" "[k for k in keys]``." msgstr "" -#: ../../whatsnew/3.12.rst:265 +#: ../../whatsnew/3.12.rst:269 msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." msgstr "" -#: ../../whatsnew/3.12.rst:268 +#: ../../whatsnew/3.12.rst:272 msgid "PEP 688: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:270 +#: ../../whatsnew/3.12.rst:274 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" -#: ../../whatsnew/3.12.rst:274 +#: ../../whatsnew/3.12.rst:278 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" @@ -289,46 +297,76 @@ msgid "" "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" -#: ../../whatsnew/3.12.rst:281 +#: ../../whatsnew/3.12.rst:287 +msgid "PEP 684: A Per-Interpreter GIL" +msgstr "" + +#: ../../whatsnew/3.12.rst:289 +msgid "" +"Sub-interpreters may now be created with a unique GIL per interpreter. This " +"allows Python programs to take full advantage of multiple CPU cores." +msgstr "" + +#: ../../whatsnew/3.12.rst:293 +msgid "" +"Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " +"interpreter with its own GIL::" +msgstr "" + +#: ../../whatsnew/3.12.rst:307 +msgid "" +"For further examples how to use the C-API for sub-interpreters with a per-" +"interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." +msgstr "" + +#: ../../whatsnew/3.12.rst:310 +msgid "A Python API is anticipated for 3.13. (See :pep:`554`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:312 +msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" +msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" + +#: ../../whatsnew/3.12.rst:315 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.12.rst:283 +#: ../../whatsnew/3.12.rst:317 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.12.rst:289 +#: ../../whatsnew/3.12.rst:323 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" msgstr "" -#: ../../whatsnew/3.12.rst:291 +#: ../../whatsnew/3.12.rst:325 msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" -#: ../../whatsnew/3.12.rst:295 +#: ../../whatsnew/3.12.rst:329 msgid "" "This PEP specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" -#: ../../whatsnew/3.12.rst:306 +#: ../../whatsnew/3.12.rst:340 msgid "See :pep:`692` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:308 +#: ../../whatsnew/3.12.rst:342 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" -msgstr "" +msgstr "(由 Franek Magiera 於 :gh:`103629` 中貢獻。)" -#: ../../whatsnew/3.12.rst:311 +#: ../../whatsnew/3.12.rst:345 msgid "PEP 698: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:313 +#: ../../whatsnew/3.12.rst:347 msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -337,51 +375,51 @@ msgid "" "class does not in fact do so." msgstr "" -#: ../../whatsnew/3.12.rst:319 +#: ../../whatsnew/3.12.rst:353 msgid "Example::" msgstr "" -#: ../../whatsnew/3.12.rst:337 +#: ../../whatsnew/3.12.rst:371 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" -msgstr "" +msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" -#: ../../whatsnew/3.12.rst:342 +#: ../../whatsnew/3.12.rst:376 msgid "PEP 695: Type Parameter Syntax" msgstr "" -#: ../../whatsnew/3.12.rst:344 +#: ../../whatsnew/3.12.rst:378 msgid "" "Generic classes and functions under :pep:`484` were declared using a verbose " "syntax that left the scope of type parameters unclear and required explicit " "declarations of variance." msgstr "" -#: ../../whatsnew/3.12.rst:348 +#: ../../whatsnew/3.12.rst:382 msgid "" ":pep:`695` introduces a new, more compact and explicit way to create :ref:" "`generic classes ` and :ref:`functions `::" msgstr "" -#: ../../whatsnew/3.12.rst:361 +#: ../../whatsnew/3.12.rst:395 msgid "" "In addition, the PEP introduces a new way to declare :ref:`type aliases " "` using the :keyword:`type` statement, which creates an " "instance of :class:`~typing.TypeAliasType`::" msgstr "" -#: ../../whatsnew/3.12.rst:367 +#: ../../whatsnew/3.12.rst:401 msgid "Type aliases can also be :ref:`generic `::" msgstr "" -#: ../../whatsnew/3.12.rst:371 +#: ../../whatsnew/3.12.rst:405 msgid "" "The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" "`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " "parameters with bounds or constraints::" msgstr "" -#: ../../whatsnew/3.12.rst:380 +#: ../../whatsnew/3.12.rst:414 msgid "" "The value of type aliases and the bound and constraints of type variables " "created through this syntax are evaluated only on demand (see :ref:`lazy-" @@ -389,7 +427,7 @@ msgid "" "defined later in the file." msgstr "" -#: ../../whatsnew/3.12.rst:385 +#: ../../whatsnew/3.12.rst:419 msgid "" "Type parameters declared through a type parameter list are visible within " "the scope of the declaration and any nested scopes, but not in the outer " @@ -399,7 +437,7 @@ msgid "" "detailed description of the runtime semantics of type parameters." msgstr "" -#: ../../whatsnew/3.12.rst:392 +#: ../../whatsnew/3.12.rst:426 msgid "" "In order to support these scoping semantics, a new kind of scope is " "introduced, the :ref:`annotation scope `. Annotation " @@ -408,21 +446,21 @@ msgid "" "` will also be evaluated in annotation scopes." msgstr "" -#: ../../whatsnew/3.12.rst:398 +#: ../../whatsnew/3.12.rst:432 msgid "See :pep:`695` for more details." msgstr "詳情請見 :pep:`695`。" -#: ../../whatsnew/3.12.rst:400 +#: ../../whatsnew/3.12.rst:434 msgid "" "(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " "and others in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:404 +#: ../../whatsnew/3.12.rst:438 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.12.rst:406 +#: ../../whatsnew/3.12.rst:440 msgid "" "Add :ref:`perf_profiling` through the new environment variable :envvar:" "`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " @@ -433,7 +471,7 @@ msgid "" "in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:416 +#: ../../whatsnew/3.12.rst:450 msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " @@ -443,32 +481,32 @@ msgid "" "`706`.)" msgstr "" -#: ../../whatsnew/3.12.rst:424 +#: ../../whatsnew/3.12.rst:458 msgid "" ":class:`types.MappingProxyType` instances are now hashable if the underlying " "mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" msgstr "" -#: ../../whatsnew/3.12.rst:428 +#: ../../whatsnew/3.12.rst:462 msgid "" ":class:`memoryview` now supports the half-float type (the \"e\" format " "code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" -#: ../../whatsnew/3.12.rst:431 +#: ../../whatsnew/3.12.rst:465 msgid "" "The parser now raises :exc:`SyntaxError` when parsing source code containing " "null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:434 +#: ../../whatsnew/3.12.rst:468 msgid "" ":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " "when parsing source code containing null bytes. (Contributed by Pablo " "Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:438 +#: ../../whatsnew/3.12.rst:472 msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -478,7 +516,7 @@ msgid "" "`97922`.)" msgstr "" -#: ../../whatsnew/3.12.rst:445 +#: ../../whatsnew/3.12.rst:479 msgid "" "A backslash-character pair that is not a valid escape sequence now generates " "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " @@ -489,7 +527,7 @@ msgid "" "`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:454 +#: ../../whatsnew/3.12.rst:488 msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " "deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" @@ -497,14 +535,14 @@ msgid "" "a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:460 +#: ../../whatsnew/3.12.rst:494 msgid "" "All builtin and extension callables expecting boolean parameters now accept " "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" -#: ../../whatsnew/3.12.rst:464 +#: ../../whatsnew/3.12.rst:498 msgid "" "Variables used in the target part of comprehensions that are not stored to " "can now be used in assignment expressions (``:=``). For example, in ``[(b := " @@ -514,28 +552,28 @@ msgid "" "(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" -#: ../../whatsnew/3.12.rst:471 +#: ../../whatsnew/3.12.rst:505 msgid "" ":class:`slice` objects are now hashable, allowing them to be used as dict " "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" -#: ../../whatsnew/3.12.rst:474 +#: ../../whatsnew/3.12.rst:508 msgid "" ":func:`sum` now uses Neumaier summation to improve accuracy when summing " "floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" "`100425`.)" msgstr "" -#: ../../whatsnew/3.12.rst:478 +#: ../../whatsnew/3.12.rst:512 msgid "" "Exceptions raised in a typeobject's ``__set_name__`` method are no longer " "wrapped by a :exc:`RuntimeError`. Context information is added to the " "exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" -#: ../../whatsnew/3.12.rst:482 +#: ../../whatsnew/3.12.rst:516 msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " "and raises one other exception, that exception is no longer wrapped in an :" @@ -543,33 +581,33 @@ msgid "" "Katriel in :gh:`103590`.)" msgstr "" -#: ../../whatsnew/3.12.rst:489 +#: ../../whatsnew/3.12.rst:523 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.12.rst:491 +#: ../../whatsnew/3.12.rst:525 msgid "None." msgstr "" -#: ../../whatsnew/3.12.rst:495 +#: ../../whatsnew/3.12.rst:529 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.12.rst:498 +#: ../../whatsnew/3.12.rst:532 msgid "array" msgstr "array" -#: ../../whatsnew/3.12.rst:500 +#: ../../whatsnew/3.12.rst:534 msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" -#: ../../whatsnew/3.12.rst:504 +#: ../../whatsnew/3.12.rst:538 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.12.rst:506 +#: ../../whatsnew/3.12.rst:540 msgid "" "The performance of writing to sockets in :mod:`asyncio` has been " "significantly improved. ``asyncio`` now avoids unnecessary copying when " @@ -577,7 +615,7 @@ msgid "" "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" -#: ../../whatsnew/3.12.rst:511 +#: ../../whatsnew/3.12.rst:545 msgid "" "Added :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " @@ -585,7 +623,7 @@ msgid "" "Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" -#: ../../whatsnew/3.12.rst:516 +#: ../../whatsnew/3.12.rst:550 msgid "" "On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default " "if :func:`os.pidfd_open` is available and functional instead of :class:" @@ -593,7 +631,7 @@ msgid "" "`98024`.)" msgstr "" -#: ../../whatsnew/3.12.rst:521 +#: ../../whatsnew/3.12.rst:555 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -605,7 +643,7 @@ msgid "" "`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:530 +#: ../../whatsnew/3.12.rst:564 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -613,57 +651,57 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:536 +#: ../../whatsnew/3.12.rst:570 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:540 +#: ../../whatsnew/3.12.rst:574 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " "(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" -#: ../../whatsnew/3.12.rst:543 +#: ../../whatsnew/3.12.rst:577 msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" -#: ../../whatsnew/3.12.rst:547 +#: ../../whatsnew/3.12.rst:581 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" -#: ../../whatsnew/3.12.rst:552 +#: ../../whatsnew/3.12.rst:586 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.12.rst:554 +#: ../../whatsnew/3.12.rst:588 msgid "" "Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " "Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:558 +#: ../../whatsnew/3.12.rst:592 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.12.rst:560 +#: ../../whatsnew/3.12.rst:594 msgid "" "Add :const:`~csv.QUOTE_NOTNULL` and :const:`~csv.QUOTE_STRINGS` flags to " "provide finer grained control of ``None`` and empty strings by :class:`~csv." "writer` objects." msgstr "" -#: ../../whatsnew/3.12.rst:565 +#: ../../whatsnew/3.12.rst:599 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.12.rst:567 +#: ../../whatsnew/3.12.rst:601 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" @@ -672,35 +710,35 @@ msgid "" "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:576 +#: ../../whatsnew/3.12.rst:610 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.12.rst:578 +#: ../../whatsnew/3.12.rst:612 msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" -#: ../../whatsnew/3.12.rst:582 +#: ../../whatsnew/3.12.rst:616 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:584 +#: ../../whatsnew/3.12.rst:618 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:588 +#: ../../whatsnew/3.12.rst:622 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :issue:`35759`.)" msgstr "" -#: ../../whatsnew/3.12.rst:592 +#: ../../whatsnew/3.12.rst:626 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 " @@ -708,60 +746,60 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:598 +#: ../../whatsnew/3.12.rst:632 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:600 +#: ../../whatsnew/3.12.rst:634 msgid "" "Added :class:`itertools.batched()` for collecting into even-sized tuples " "where the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:605 +#: ../../whatsnew/3.12.rst:639 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:607 +#: ../../whatsnew/3.12.rst:641 msgid "" "Added :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -#: ../../whatsnew/3.12.rst:610 +#: ../../whatsnew/3.12.rst:644 msgid "" "Extended :func:`math.nextafter` to include a *steps* argument for moving up " "or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:615 +#: ../../whatsnew/3.12.rst:649 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:617 +#: ../../whatsnew/3.12.rst:651 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:621 +#: ../../whatsnew/3.12.rst:655 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:625 +#: ../../whatsnew/3.12.rst:659 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:629 +#: ../../whatsnew/3.12.rst:663 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 " @@ -774,27 +812,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:640 +#: ../../whatsnew/3.12.rst:674 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:642 +#: ../../whatsnew/3.12.rst:676 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:645 +#: ../../whatsnew/3.12.rst:679 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:649 +#: ../../whatsnew/3.12.rst:683 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:651 +#: ../../whatsnew/3.12.rst:685 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -802,14 +840,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:656 +#: ../../whatsnew/3.12.rst:690 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:660 +#: ../../whatsnew/3.12.rst:694 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 " @@ -817,13 +855,13 @@ msgid "" "issue:`40358`.)" msgstr "" -#: ../../whatsnew/3.12.rst:665 +#: ../../whatsnew/3.12.rst:699 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:668 +#: ../../whatsnew/3.12.rst:702 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -831,38 +869,38 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:673 +#: ../../whatsnew/3.12.rst:707 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:675 +#: ../../whatsnew/3.12.rst:709 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:681 +#: ../../whatsnew/3.12.rst:715 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:683 +#: ../../whatsnew/3.12.rst:717 msgid "" "Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" "gh:`81620`.)" msgstr "" -#: ../../whatsnew/3.12.rst:686 +#: ../../whatsnew/3.12.rst:720 msgid "" "Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:690 +#: ../../whatsnew/3.12.rst:724 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:692 +#: ../../whatsnew/3.12.rst:726 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 " @@ -870,7 +908,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:698 +#: ../../whatsnew/3.12.rst:732 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 " @@ -878,14 +916,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:704 +#: ../../whatsnew/3.12.rst:738 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:709 +#: ../../whatsnew/3.12.rst:743 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -893,24 +931,24 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:714 +#: ../../whatsnew/3.12.rst:748 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:720 +#: ../../whatsnew/3.12.rst:754 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:722 +#: ../../whatsnew/3.12.rst:756 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -#: ../../whatsnew/3.12.rst:725 +#: ../../whatsnew/3.12.rst:759 msgid "" "Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." "Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " @@ -918,36 +956,36 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:732 +#: ../../whatsnew/3.12.rst:766 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:737 +#: ../../whatsnew/3.12.rst:771 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:743 +#: ../../whatsnew/3.12.rst:777 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:745 +#: ../../whatsnew/3.12.rst:779 msgid "" "Extended :func:`statistics.correlation` to include as a ``ranked`` method " "for computing the Spearman correlation of ranked data. (Contributed by " "Raymond Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:750 +#: ../../whatsnew/3.12.rst:784 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:752 +#: ../../whatsnew/3.12.rst:786 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -957,7 +995,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:761 +#: ../../whatsnew/3.12.rst:795 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 " @@ -966,34 +1004,42 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:767 ../../whatsnew/3.12.rst:1504 +#: ../../whatsnew/3.12.rst:801 ../../whatsnew/3.12.rst:1547 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:772 +#: ../../whatsnew/3.12.rst:805 +msgid "" +":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " +"recursion limit now applies only to Python code. Builtin functions do not " +"use the recursion limit, but are protected by a different mechanism that " +"prevents recursion from causing a virtual machine crash." +msgstr "" + +#: ../../whatsnew/3.12.rst:811 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:774 +#: ../../whatsnew/3.12.rst:813 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:776 +#: ../../whatsnew/3.12.rst:815 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:782 +#: ../../whatsnew/3.12.rst:821 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:784 +#: ../../whatsnew/3.12.rst:823 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1001,11 +1047,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:790 +#: ../../whatsnew/3.12.rst:829 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:792 +#: ../../whatsnew/3.12.rst:831 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1015,11 +1061,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:801 +#: ../../whatsnew/3.12.rst:840 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:803 +#: ../../whatsnew/3.12.rst:842 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 :" @@ -1027,22 +1073,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:809 +#: ../../whatsnew/3.12.rst:848 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:811 +#: ../../whatsnew/3.12.rst:850 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:816 +#: ../../whatsnew/3.12.rst:855 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:818 +#: ../../whatsnew/3.12.rst:857 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1055,7 +1101,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:829 +#: ../../whatsnew/3.12.rst:868 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 " @@ -1063,13 +1109,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:851 +#: ../../whatsnew/3.12.rst:890 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:854 +#: ../../whatsnew/3.12.rst:893 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1080,71 +1126,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:862 +#: ../../whatsnew/3.12.rst:901 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:866 +#: ../../whatsnew/3.12.rst:905 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:870 +#: ../../whatsnew/3.12.rst:909 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:872 +#: ../../whatsnew/3.12.rst:911 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:876 +#: ../../whatsnew/3.12.rst:915 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:878 +#: ../../whatsnew/3.12.rst:917 msgid "" "Added ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:894 +#: ../../whatsnew/3.12.rst:933 msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" -msgstr "" +msgstr "(由 Giampaolo Rodola 於 :issue:`4080` 中貢獻。)" -#: ../../whatsnew/3.12.rst:897 +#: ../../whatsnew/3.12.rst:936 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:899 +#: ../../whatsnew/3.12.rst:938 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:904 +#: ../../whatsnew/3.12.rst:943 msgid "Optimizations" -msgstr "" +msgstr "最佳化" -#: ../../whatsnew/3.12.rst:906 +#: ../../whatsnew/3.12.rst:945 msgid "" "Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " "reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " "(Contributed by Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:910 +#: ../../whatsnew/3.12.rst:949 msgid "" "Added experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:914 +#: ../../whatsnew/3.12.rst:953 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1152,13 +1198,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:919 +#: ../../whatsnew/3.12.rst:958 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar O in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:922 +#: ../../whatsnew/3.12.rst:961 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:" @@ -1166,18 +1212,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:927 +#: ../../whatsnew/3.12.rst:966 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:933 +#: ../../whatsnew/3.12.rst:972 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:935 +#: ../../whatsnew/3.12.rst:974 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:" @@ -1185,20 +1231,20 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:940 +#: ../../whatsnew/3.12.rst:979 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:943 +#: ../../whatsnew/3.12.rst:982 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:946 +#: ../../whatsnew/3.12.rst:985 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1207,35 +1253,35 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:952 +#: ../../whatsnew/3.12.rst:991 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:956 +#: ../../whatsnew/3.12.rst:995 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:958 +#: ../../whatsnew/3.12.rst:997 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:963 +#: ../../whatsnew/3.12.rst:1002 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:970 ../../whatsnew/3.12.rst:1869 +#: ../../whatsnew/3.12.rst:1009 ../../whatsnew/3.12.rst:1938 msgid "Deprecated" -msgstr "" +msgstr "已棄用" -#: ../../whatsnew/3.12.rst:972 +#: ../../whatsnew/3.12.rst:1011 msgid "" ":mod:`asyncio`: The :meth:`~asyncio.get_event_loop` method of the default " "event loop policy now emits a :exc:`DeprecationWarning` if there is no " @@ -1243,14 +1289,14 @@ msgid "" "Storchaka and Guido van Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:977 +#: ../../whatsnew/3.12.rst:1016 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.Month.JANUARY` and :data:" "`calendar.Month.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:981 +#: ../../whatsnew/3.12.rst:1020 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1260,7 +1306,7 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:989 +#: ../../whatsnew/3.12.rst:1028 msgid "" ":mod:`os`: The ``st_ctime`` fields return by :func:`os.stat` and :func:`os." "lstat` on Windows are deprecated. In a future release, they will contain the " @@ -1269,25 +1315,25 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:995 +#: ../../whatsnew/3.12.rst:1034 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " "Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1010 +#: ../../whatsnew/3.12.rst:1049 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.12.rst:999 +#: ../../whatsnew/3.12.rst:1038 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:1005 +#: ../../whatsnew/3.12.rst:1044 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1297,28 +1343,28 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1012 +#: ../../whatsnew/3.12.rst:1051 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:1016 +#: ../../whatsnew/3.12.rst:1055 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:1020 +#: ../../whatsnew/3.12.rst:1059 msgid "" ":mod:`typing`: :class:`typing.Hashable` and :class:`typing.Sized` aliases " "for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:" "gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1023 +#: ../../whatsnew/3.12.rst:1062 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -1326,7 +1372,7 @@ msgid "" "implementation emitted nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1028 +#: ../../whatsnew/3.12.rst:1067 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" "meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " @@ -1334,14 +1380,14 @@ msgid "" "functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1033 +#: ../../whatsnew/3.12.rst:1072 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:1038 +#: ../../whatsnew/3.12.rst:1077 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -1350,7 +1396,7 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:1043 +#: ../../whatsnew/3.12.rst:1082 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. " @@ -1359,148 +1405,148 @@ msgid "" "by Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1050 +#: ../../whatsnew/3.12.rst:1089 msgid "Pending Removal in Python 3.13" msgstr "" -#: ../../whatsnew/3.12.rst:1052 +#: ../../whatsnew/3.12.rst:1091 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:1055 +#: ../../whatsnew/3.12.rst:1094 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1057 +#: ../../whatsnew/3.12.rst:1096 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1058 +#: ../../whatsnew/3.12.rst:1097 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1059 +#: ../../whatsnew/3.12.rst:1098 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1060 +#: ../../whatsnew/3.12.rst:1099 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1061 +#: ../../whatsnew/3.12.rst:1100 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1062 +#: ../../whatsnew/3.12.rst:1101 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1063 +#: ../../whatsnew/3.12.rst:1102 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1064 +#: ../../whatsnew/3.12.rst:1103 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1065 +#: ../../whatsnew/3.12.rst:1104 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1066 +#: ../../whatsnew/3.12.rst:1105 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1067 +#: ../../whatsnew/3.12.rst:1106 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1068 +#: ../../whatsnew/3.12.rst:1107 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1069 +#: ../../whatsnew/3.12.rst:1108 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1070 +#: ../../whatsnew/3.12.rst:1109 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1071 +#: ../../whatsnew/3.12.rst:1110 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1072 +#: ../../whatsnew/3.12.rst:1111 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1073 +#: ../../whatsnew/3.12.rst:1112 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1074 +#: ../../whatsnew/3.12.rst:1113 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1075 +#: ../../whatsnew/3.12.rst:1114 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1077 +#: ../../whatsnew/3.12.rst:1116 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1079 +#: ../../whatsnew/3.12.rst:1118 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1080 +#: ../../whatsnew/3.12.rst:1119 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1081 +#: ../../whatsnew/3.12.rst:1120 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1121 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1083 +#: ../../whatsnew/3.12.rst:1122 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1084 +#: ../../whatsnew/3.12.rst:1123 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1085 +#: ../../whatsnew/3.12.rst:1124 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1086 +#: ../../whatsnew/3.12.rst:1125 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1087 +#: ../../whatsnew/3.12.rst:1126 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1090 +#: ../../whatsnew/3.12.rst:1129 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1092 +#: ../../whatsnew/3.12.rst:1131 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:1097 +#: ../../whatsnew/3.12.rst:1136 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1508,33 +1554,33 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1101 +#: ../../whatsnew/3.12.rst:1140 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1102 +#: ../../whatsnew/3.12.rst:1141 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1103 +#: ../../whatsnew/3.12.rst:1142 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1104 +#: ../../whatsnew/3.12.rst:1143 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1105 +#: ../../whatsnew/3.12.rst:1144 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1107 +#: ../../whatsnew/3.12.rst:1146 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1110 +#: ../../whatsnew/3.12.rst:1149 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1542,47 +1588,47 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1115 +#: ../../whatsnew/3.12.rst:1154 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1118 +#: ../../whatsnew/3.12.rst:1157 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1121 +#: ../../whatsnew/3.12.rst:1160 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1161 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1162 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1164 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1127 +#: ../../whatsnew/3.12.rst:1166 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1167 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1169 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" -msgstr "" +msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1132 +#: ../../whatsnew/3.12.rst:1171 msgid "" ":mod:`itertools`: The module had undocumented, inefficient, historically " "buggy, and inconsistent support for copy, deepcopy, and pickle operations. " @@ -1590,7 +1636,7 @@ msgid "" "maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1138 +#: ../../whatsnew/3.12.rst:1177 msgid "" ":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " "change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " @@ -1601,52 +1647,52 @@ msgid "" "code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../whatsnew/3.12.rst:1146 +#: ../../whatsnew/3.12.rst:1185 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1151 +#: ../../whatsnew/3.12.rst:1190 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " "gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1155 +#: ../../whatsnew/3.12.rst:1194 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "in 3.12, and will be removed in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1158 +#: ../../whatsnew/3.12.rst:1197 msgid "" ":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../whatsnew/3.12.rst:1161 +#: ../../whatsnew/3.12.rst:1200 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element` is deprecated and will raise an exception in " "Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1164 +#: ../../whatsnew/3.12.rst:1203 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases using the C API." msgstr "" -#: ../../whatsnew/3.12.rst:1167 +#: ../../whatsnew/3.12.rst:1206 msgid "" "``__package__`` and ``__cached__`` will cease to be set or taken into " "consideration by the import system (:gh:`97879`)." msgstr "" -#: ../../whatsnew/3.12.rst:1170 +#: ../../whatsnew/3.12.rst:1209 msgid "" "Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " "planned to be removed in 3.12 but it only got a proper :exc:" @@ -1654,21 +1700,21 @@ msgid "" "Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1177 +#: ../../whatsnew/3.12.rst:1216 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1179 +#: ../../whatsnew/3.12.rst:1218 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:1182 +#: ../../whatsnew/3.12.rst:1221 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1184 +#: ../../whatsnew/3.12.rst:1223 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1680,42 +1726,42 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1195 ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:1234 ../../whatsnew/3.12.rst:2020 msgid "Removed" -msgstr "" +msgstr "已移除" -#: ../../whatsnew/3.12.rst:1197 +#: ../../whatsnew/3.12.rst:1236 msgid "" "``asynchat`` and ``asyncore``: These two modules have been removed according " "to the schedule in :pep:`594`, having been deprecated in Python 3.6. Use :" "mod:`asyncio` instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1203 +#: ../../whatsnew/3.12.rst:1242 msgid "" ":mod:`configparser`: Several names deprecated in the :mod:`configparser` way " "back in 3.2 have been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1206 +#: ../../whatsnew/3.12.rst:1245 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1208 +#: ../../whatsnew/3.12.rst:1247 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1210 +#: ../../whatsnew/3.12.rst:1249 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1213 +#: ../../whatsnew/3.12.rst:1252 msgid "" "``distutils``: Remove the ``distutils`` package. It was deprecated in Python " "3.10 by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -1724,13 +1770,13 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1219 +#: ../../whatsnew/3.12.rst:1258 msgid "" ":mod:`ensurepip`: Remove the bundled setuptools wheel from :mod:`ensurepip`, " "and stop installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1222 +#: ../../whatsnew/3.12.rst:1261 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1738,7 +1784,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1228 +#: ../../whatsnew/3.12.rst:1267 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1748,17 +1794,23 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1235 +#: ../../whatsnew/3.12.rst:1274 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" +msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" + +#: ../../whatsnew/3.12.rst:1276 +msgid "" +":mod:`enum`: Remove ``EnumMeta.__getattr__``, which is no longer needed for " +"enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1237 +#: ../../whatsnew/3.12.rst:1280 msgid "" ":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1241 +#: ../../whatsnew/3.12.rst:1284 msgid "" ":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -1767,7 +1819,7 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1247 +#: ../../whatsnew/3.12.rst:1290 msgid "" ":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -1776,178 +1828,178 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1253 +#: ../../whatsnew/3.12.rst:1296 msgid "" ":mod:`importlib`: Many previously deprecated cleanups in :mod:`importlib` " "have now been completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1256 +#: ../../whatsnew/3.12.rst:1299 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1259 +#: ../../whatsnew/3.12.rst:1302 msgid "" "``importlib.util.set_package`` has been removed. (Contributed by Brett " "Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1262 +#: ../../whatsnew/3.12.rst:1305 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1265 +#: ../../whatsnew/3.12.rst:1308 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1268 +#: ../../whatsnew/3.12.rst:1311 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1271 +#: ../../whatsnew/3.12.rst:1314 msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1317 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1317 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1276 +#: ../../whatsnew/3.12.rst:1319 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1276 +#: ../../whatsnew/3.12.rst:1319 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1277 +#: ../../whatsnew/3.12.rst:1320 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1277 +#: ../../whatsnew/3.12.rst:1320 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1278 +#: ../../whatsnew/3.12.rst:1321 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1278 +#: ../../whatsnew/3.12.rst:1321 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1279 +#: ../../whatsnew/3.12.rst:1322 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1279 +#: ../../whatsnew/3.12.rst:1322 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1280 +#: ../../whatsnew/3.12.rst:1323 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1280 +#: ../../whatsnew/3.12.rst:1323 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1281 +#: ../../whatsnew/3.12.rst:1324 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1281 +#: ../../whatsnew/3.12.rst:1324 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1282 +#: ../../whatsnew/3.12.rst:1325 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1282 +#: ../../whatsnew/3.12.rst:1325 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1283 +#: ../../whatsnew/3.12.rst:1326 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1283 +#: ../../whatsnew/3.12.rst:1326 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1284 +#: ../../whatsnew/3.12.rst:1327 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1284 +#: ../../whatsnew/3.12.rst:1327 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1285 +#: ../../whatsnew/3.12.rst:1328 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1285 +#: ../../whatsnew/3.12.rst:1328 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1288 +#: ../../whatsnew/3.12.rst:1331 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1303 +#: ../../whatsnew/3.12.rst:1346 msgid "Removed :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1305 +#: ../../whatsnew/3.12.rst:1348 msgid "undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1307 +#: ../../whatsnew/3.12.rst:1350 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1308 +#: ../../whatsnew/3.12.rst:1351 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1309 +#: ../../whatsnew/3.12.rst:1352 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1310 +#: ../../whatsnew/3.12.rst:1353 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1312 +#: ../../whatsnew/3.12.rst:1355 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:1314 +#: ../../whatsnew/3.12.rst:1357 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:1318 +#: ../../whatsnew/3.12.rst:1361 msgid "" ":mod:`io`: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -1956,14 +2008,14 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1324 +#: ../../whatsnew/3.12.rst:1367 msgid "" ":mod:`locale`: Remove the :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:1328 +#: ../../whatsnew/3.12.rst:1371 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 " @@ -1971,27 +2023,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1379 msgid "" ":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " "deprecated in Python 3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1382 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1383 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1385 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:1345 +#: ../../whatsnew/3.12.rst:1388 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 " @@ -1999,22 +2051,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1393 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" -msgstr "" +msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1352 +#: ../../whatsnew/3.12.rst:1395 msgid ":mod:`ssl`:" msgstr "" -#: ../../whatsnew/3.12.rst:1354 +#: ../../whatsnew/3.12.rst:1397 msgid "" "Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " "3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " "by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1401 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 " @@ -2022,7 +2074,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1407 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." @@ -2033,174 +2085,174 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1373 +#: ../../whatsnew/3.12.rst:1416 msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1375 +#: ../../whatsnew/3.12.rst:1418 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1421 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1421 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1421 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1380 +#: ../../whatsnew/3.12.rst:1423 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1380 ../../whatsnew/3.12.rst:1387 +#: ../../whatsnew/3.12.rst:1423 ../../whatsnew/3.12.rst:1430 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1380 ../../whatsnew/3.12.rst:1381 -#: ../../whatsnew/3.12.rst:1382 ../../whatsnew/3.12.rst:1383 -#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1385 -#: ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1423 ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1425 ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1427 ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1429 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1424 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1424 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1382 +#: ../../whatsnew/3.12.rst:1425 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1382 ../../whatsnew/3.12.rst:1388 +#: ../../whatsnew/3.12.rst:1425 ../../whatsnew/3.12.rst:1431 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1383 +#: ../../whatsnew/3.12.rst:1426 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1383 ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1426 ../../whatsnew/3.12.rst:1432 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1427 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1427 ../../whatsnew/3.12.rst:1433 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1385 +#: ../../whatsnew/3.12.rst:1428 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1385 ../../whatsnew/3.12.rst:1391 +#: ../../whatsnew/3.12.rst:1428 ../../whatsnew/3.12.rst:1434 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1429 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1429 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1387 +#: ../../whatsnew/3.12.rst:1430 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1387 ../../whatsnew/3.12.rst:1388 -#: ../../whatsnew/3.12.rst:1389 ../../whatsnew/3.12.rst:1390 -#: ../../whatsnew/3.12.rst:1391 ../../whatsnew/3.12.rst:1392 -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1430 ../../whatsnew/3.12.rst:1431 +#: ../../whatsnew/3.12.rst:1432 ../../whatsnew/3.12.rst:1433 +#: ../../whatsnew/3.12.rst:1434 ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1436 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1388 +#: ../../whatsnew/3.12.rst:1431 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1432 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1433 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1391 +#: ../../whatsnew/3.12.rst:1434 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1435 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1435 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1436 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1436 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1437 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1437 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1437 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1440 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1443 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1403 +#: ../../whatsnew/3.12.rst:1446 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1407 +#: ../../whatsnew/3.12.rst:1450 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1410 +#: ../../whatsnew/3.12.rst:1453 msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" -msgstr "" +msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1412 +#: ../../whatsnew/3.12.rst:1455 msgid "" ":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" "`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " @@ -2208,7 +2260,7 @@ msgid "" "`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1416 +#: ../../whatsnew/3.12.rst:1459 msgid "" ":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " "method of the pure Python implementation, deprecated in Python 3.10, use " @@ -2217,21 +2269,21 @@ msgid "" "(Contributed by Victor Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1422 +#: ../../whatsnew/3.12.rst:1465 msgid "" ":mod:`zipimport`: Remove ``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:1427 +#: ../../whatsnew/3.12.rst:1470 msgid "" "Removed the ``suspicious`` rule from the documentation Makefile, and removed " "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1432 +#: ../../whatsnew/3.12.rst:1475 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2241,21 +2293,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1443 ../../whatsnew/3.12.rst:1747 +#: ../../whatsnew/3.12.rst:1486 ../../whatsnew/3.12.rst:1798 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1445 +#: ../../whatsnew/3.12.rst:1488 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1492 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1451 +#: ../../whatsnew/3.12.rst:1494 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2264,7 +2316,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1458 +#: ../../whatsnew/3.12.rst:1501 msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -2276,7 +2328,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1509 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2286,21 +2338,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1515 msgid "" "Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1476 +#: ../../whatsnew/3.12.rst:1519 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1481 +#: ../../whatsnew/3.12.rst:1524 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2308,7 +2360,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1486 +#: ../../whatsnew/3.12.rst:1529 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2320,7 +2372,7 @@ msgid "" "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1495 +#: ../../whatsnew/3.12.rst:1538 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2332,14 +2384,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1508 +#: ../../whatsnew/3.12.rst:1551 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1513 +#: ../../whatsnew/3.12.rst:1556 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2351,45 +2403,45 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1567 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1536 +#: ../../whatsnew/3.12.rst:1579 msgid "" -"Additionally, there may be some minor behavioral changes as a consecuence of " +"Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1539 +#: ../../whatsnew/3.12.rst:1582 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1542 +#: ../../whatsnew/3.12.rst:1585 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1545 +#: ../../whatsnew/3.12.rst:1588 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1548 +#: ../../whatsnew/3.12.rst:1591 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1552 +#: ../../whatsnew/3.12.rst:1595 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1554 +#: ../../whatsnew/3.12.rst:1597 msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2398,21 +2450,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:1603 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1565 +#: ../../whatsnew/3.12.rst:1608 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1612 msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2421,41 +2473,46 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1618 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1577 +#: ../../whatsnew/3.12.rst:1620 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1621 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1622 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1624 msgid "(Contributed by Zhang Na in :gh:`90656`.)" -msgstr "" +msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1583 +#: ../../whatsnew/3.12.rst:1626 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1628 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1632 +msgid "" +"Windows builds and macOS installers from python.org now use OpenSSL 3.0." +msgstr "" + +#: ../../whatsnew/3.12.rst:1636 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1642 msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2463,84 +2520,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1648 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1605 +#: ../../whatsnew/3.12.rst:1650 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1606 +#: ../../whatsnew/3.12.rst:1651 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1653 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1610 +#: ../../whatsnew/3.12.rst:1655 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1611 +#: ../../whatsnew/3.12.rst:1656 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1612 +#: ../../whatsnew/3.12.rst:1657 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1614 +#: ../../whatsnew/3.12.rst:1659 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1617 +#: ../../whatsnew/3.12.rst:1662 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" -msgstr "" +msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1619 +#: ../../whatsnew/3.12.rst:1664 msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1622 +#: ../../whatsnew/3.12.rst:1667 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:1624 +#: ../../whatsnew/3.12.rst:1669 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1626 +#: ../../whatsnew/3.12.rst:1671 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:1629 +#: ../../whatsnew/3.12.rst:1674 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:1632 +#: ../../whatsnew/3.12.rst:1677 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" -msgstr "" +msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1634 +#: ../../whatsnew/3.12.rst:1679 msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -2548,29 +2605,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1684 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:1643 +#: ../../whatsnew/3.12.rst:1688 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1644 +#: ../../whatsnew/3.12.rst:1689 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1690 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1646 +#: ../../whatsnew/3.12.rst:1691 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1648 +#: ../../whatsnew/3.12.rst:1693 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 " @@ -2581,7 +2638,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1701 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2589,32 +2646,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1661 +#: ../../whatsnew/3.12.rst:1706 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1665 +#: ../../whatsnew/3.12.rst:1710 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1666 +#: ../../whatsnew/3.12.rst:1711 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1667 +#: ../../whatsnew/3.12.rst:1712 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr "" -#: ../../whatsnew/3.12.rst:1669 +#: ../../whatsnew/3.12.rst:1714 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:1673 +#: ../../whatsnew/3.12.rst:1718 msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -2622,14 +2679,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1679 +#: ../../whatsnew/3.12.rst:1724 msgid "" "Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " "sets the vectorcall field of a given :c:type:`PyFunctionObject`. " "(Contributed by Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1683 +#: ../../whatsnew/3.12.rst:1728 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2638,28 +2695,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1689 +#: ../../whatsnew/3.12.rst:1734 msgid "" "Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1693 +#: ../../whatsnew/3.12.rst:1738 msgid "" "Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1743 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:1702 +#: ../../whatsnew/3.12.rst:1747 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2669,14 +2726,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1710 +#: ../../whatsnew/3.12.rst:1755 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:1714 +#: ../../whatsnew/3.12.rst:1759 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2684,91 +2741,99 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1764 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:1723 +#: ../../whatsnew/3.12.rst:1768 msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1726 +#: ../../whatsnew/3.12.rst:1771 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1727 +#: ../../whatsnew/3.12.rst:1772 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1728 +#: ../../whatsnew/3.12.rst:1773 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1729 +#: ../../whatsnew/3.12.rst:1774 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1730 +#: ../../whatsnew/3.12.rst:1775 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1731 +#: ../../whatsnew/3.12.rst:1776 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1732 +#: ../../whatsnew/3.12.rst:1777 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1733 +#: ../../whatsnew/3.12.rst:1778 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1734 +#: ../../whatsnew/3.12.rst:1779 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1737 +#: ../../whatsnew/3.12.rst:1782 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1736 +#: ../../whatsnew/3.12.rst:1781 msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1739 +#: ../../whatsnew/3.12.rst:1784 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" +msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" + +#: ../../whatsnew/3.12.rst:1786 +msgid "" +":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " +"and :c:type:`PyInterpreterConfig`, which may be used to create sub-" +"interpreters with their own GILs. (See :ref:`whatsnew312-pep684` for more " +"info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1741 +#: ../../whatsnew/3.12.rst:1792 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:1749 +#: ../../whatsnew/3.12.rst:1800 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:1752 +#: ../../whatsnew/3.12.rst:1803 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:1756 +#: ../../whatsnew/3.12.rst:1807 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 " @@ -2777,7 +2842,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1763 +#: ../../whatsnew/3.12.rst:1814 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 " @@ -2785,13 +2850,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1768 +#: ../../whatsnew/3.12.rst:1819 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:1772 +#: ../../whatsnew/3.12.rst:1823 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 " @@ -2800,7 +2865,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1778 +#: ../../whatsnew/3.12.rst:1829 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2809,13 +2874,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1835 msgid "" "Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1788 +#: ../../whatsnew/3.12.rst:1839 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -2829,7 +2894,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1800 +#: ../../whatsnew/3.12.rst:1851 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -2837,7 +2902,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1805 +#: ../../whatsnew/3.12.rst:1856 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 " @@ -2845,7 +2910,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1810 +#: ../../whatsnew/3.12.rst:1861 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 " @@ -2853,7 +2918,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1815 +#: ../../whatsnew/3.12.rst:1866 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 " @@ -2861,25 +2926,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1820 +#: ../../whatsnew/3.12.rst:1871 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1823 +#: ../../whatsnew/3.12.rst:1874 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1824 +#: ../../whatsnew/3.12.rst:1875 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1825 +#: ../../whatsnew/3.12.rst:1876 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1827 +#: ../../whatsnew/3.12.rst:1878 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 " @@ -2887,14 +2952,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1832 +#: ../../whatsnew/3.12.rst:1883 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:1836 +#: ../../whatsnew/3.12.rst:1887 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -2903,17 +2968,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1843 +#: ../../whatsnew/3.12.rst:1894 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1845 +#: ../../whatsnew/3.12.rst:1896 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1847 +#: ../../whatsnew/3.12.rst:1898 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -2921,20 +2986,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:1852 +#: ../../whatsnew/3.12.rst:1903 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:1856 +#: ../../whatsnew/3.12.rst:1907 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:1859 +#: ../../whatsnew/3.12.rst:1910 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -2942,288 +3007,316 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:1864 +#: ../../whatsnew/3.12.rst:1915 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:1871 +#: ../../whatsnew/3.12.rst:1919 +msgid "" +":c:struct:`PyLongObject` has had its internals changed for better " +"performance. Although the internals of :c:struct:`PyLongObject` are private, " +"they are used by some extension modules. The internal fields should no " +"longer be accessed directly, instead the API functions beginning ``PyLong_..." +"`` should be used instead. Two new *unstable* API functions are provided for " +"efficient access to the value of :c:struct:`PyLongObject`\\s which fit into " +"a single machine word:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1927 +msgid ":c:func:`PyUnstable_Long_IsCompact`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1928 +msgid ":c:func:`PyUnstable_Long_CompactValue`" +msgstr "" + +#: ../../whatsnew/3.12.rst:1930 +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 " +"their own state, including \"hooks\", are not affected. If your custom " +"allocator is not already thread-safe and you need guidance then please " +"create a new GitHub issue and CC ``@ericsnowcurrently``." +msgstr "" + +#: ../../whatsnew/3.12.rst:1940 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:1873 +#: ../../whatsnew/3.12.rst:1942 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:1874 +#: ../../whatsnew/3.12.rst:1943 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:1875 +#: ../../whatsnew/3.12.rst:1944 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:1876 +#: ../../whatsnew/3.12.rst:1945 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:1877 +#: ../../whatsnew/3.12.rst:1946 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:1878 +#: ../../whatsnew/3.12.rst:1947 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:1879 +#: ../../whatsnew/3.12.rst:1948 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:1880 +#: ../../whatsnew/3.12.rst:1949 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:1881 +#: ../../whatsnew/3.12.rst:1950 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:1882 +#: ../../whatsnew/3.12.rst:1951 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:1883 +#: ../../whatsnew/3.12.rst:1952 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:1884 +#: ../../whatsnew/3.12.rst:1953 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:1885 +#: ../../whatsnew/3.12.rst:1954 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1886 +#: ../../whatsnew/3.12.rst:1955 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:1888 +#: ../../whatsnew/3.12.rst:1957 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:1889 +#: ../../whatsnew/3.12.rst:1958 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1890 +#: ../../whatsnew/3.12.rst:1959 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1891 +#: ../../whatsnew/3.12.rst:1960 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1892 +#: ../../whatsnew/3.12.rst:1961 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1893 +#: ../../whatsnew/3.12.rst:1962 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:1894 +#: ../../whatsnew/3.12.rst:1963 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:1896 +#: ../../whatsnew/3.12.rst:1965 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1900 +#: ../../whatsnew/3.12.rst:1969 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1903 +#: ../../whatsnew/3.12.rst:1972 msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:1906 +#: ../../whatsnew/3.12.rst:1975 msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:1909 +#: ../../whatsnew/3.12.rst:1978 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" -#: ../../whatsnew/3.12.rst:1911 +#: ../../whatsnew/3.12.rst:1980 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:1913 +#: ../../whatsnew/3.12.rst:1982 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:1916 +#: ../../whatsnew/3.12.rst:1985 msgid "Several items are not exposed from ``Python.h``:" msgstr "" -#: ../../whatsnew/3.12.rst:1918 +#: ../../whatsnew/3.12.rst:1987 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:1919 +#: ../../whatsnew/3.12.rst:1988 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:1920 +#: ../../whatsnew/3.12.rst:1989 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1921 +#: ../../whatsnew/3.12.rst:1990 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:1923 +#: ../../whatsnew/3.12.rst:1992 msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:1926 +#: ../../whatsnew/3.12.rst:1995 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:1931 +#: ../../whatsnew/3.12.rst:2000 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:1934 +#: ../../whatsnew/3.12.rst:2003 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:1939 +#: ../../whatsnew/3.12.rst:2008 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1942 +#: ../../whatsnew/3.12.rst:2011 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1945 +#: ../../whatsnew/3.12.rst:2014 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:1953 +#: ../../whatsnew/3.12.rst:2022 msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``token.h`` header file was only designed to be used by Python " "internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:2027 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:2029 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:2030 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:2031 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:2032 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:2033 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:2034 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:2035 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:2036 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:2037 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:2039 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1973 +#: ../../whatsnew/3.12.rst:2042 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:2045 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 904feb82e4..74ef2a0d5b 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-27 00:03+0000\n" +"POT-Creation-Date: 2023-08-18 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-" @@ -623,8 +623,8 @@ msgid "" "(Contributed by Daniel Stutzbach in :issue:`9213`, by Alexander Belopolsky " "in :issue:`2690`, and by Nick Coghlan in :issue:`10889`.)" msgstr "" -"(由 Daniel Stutzbach 在 :issue:`9213`、Alexander Belopolsky 在 " -":issue:`2690`、Nick Coghlan 在 :issue:`10889` 中貢獻。)" +"(由 Daniel Stutzbach 在 :issue:`9213`、Alexander Belopolsky 在 :issue:" +"`2690`、Nick Coghlan 在 :issue:`10889` 中貢獻。)" #: ../../whatsnew/3.2.rst:640 msgid "" @@ -1129,9 +1129,9 @@ msgid "" "`1289118`, :issue:`5094`, :issue:`6641`, :issue:`2706`, :issue:`1777412`, :" "issue:`8013`, and :issue:`10827`.)" msgstr "" -"(由 Alexander Belopolsky 和 Victor Stinner 在 :issue:`1289118`" -"、:issue:`5094`、:issue:`6641`、:issue:`2706`、:issue:`1777412`、:issue:`8013` " -"和 :issue:`10827` 中貢獻。)" +"(由 Alexander Belopolsky 和 Victor Stinner 在 :issue:`1289118`、:issue:" +"`5094`、:issue:`6641`、:issue:`2706`、:issue:`1777412`、:issue:`8013` 和 :" +"issue:`10827` 中貢獻。)" #: ../../whatsnew/3.2.rst:1046 msgid "math" @@ -1494,7 +1494,8 @@ msgid "" "(Contributed by Antoine Pitrou and Brian Curtin in :issue:`7461` and :issue:" "`10554`.)" msgstr "" -"(由 Antoine Pitrou 和 Brian Curtin 在 :issue:`7461` 和 :issue:`10554` 中貢獻。)" +"(由 Antoine Pitrou 和 Brian Curtin 在 :issue:`7461` 和 :issue:`10554` 中貢" +"獻。)" #: ../../whatsnew/3.2.rst:1388 msgid "select" @@ -1818,8 +1819,8 @@ msgid "" "(Contributed by Antoine Pitrou in :issue:`8850`, :issue:`1589`, :issue:" "`8322`, :issue:`5639`, :issue:`4870`, :issue:`8484`, and :issue:`8321`.)" msgstr "" -"(由 Antoine Pitrou 在 :issue:`8850`、:issue:`1589`、:issue:`8322`、:issue:`5" -"639`、:issue:`4870`、:issue:`8484` 和 :issue:`8321` 中貢獻。)" +"(由 Antoine Pitrou 在 :issue:`8850`、:issue:`1589`、:issue:`8322`、:issue:" +"`5639`、:issue:`4870`、:issue:`8484` 和 :issue:`8321` 中貢獻。)" #: ../../whatsnew/3.2.rst:1677 msgid "nntp" @@ -1844,7 +1845,9 @@ msgstr "" msgid "" "(Contributed by Antoine Pitrou in :issue:`9360` and Andrew Vant in :issue:" "`1926`.)" -msgstr "(由 Antoine Pitrou 在 :issue:`9360` 中和 Andrew Vant 在 :issue:`1926` 中貢獻。)" +msgstr "" +"(由 Antoine Pitrou 在 :issue:`9360` 中和 Andrew Vant 在 :issue:`1926` 中貢" +"獻。)" #: ../../whatsnew/3.2.rst:1691 msgid "certificates" @@ -2604,7 +2607,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2349 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.2.rst:2351 msgid "A number of small performance enhancements have been added:" @@ -2640,8 +2643,8 @@ msgid "" "(Contributed by Alexandre Vassalotti, Antoine Pitrou and the Unladen Swallow " "team in :issue:`9410` and :issue:`3873`.)" msgstr "" -"(由 Alexandre Vassalotti、Antoine Pitrou 和 Unladen Swallow 團隊在 :issue:`9410` " -"和 :issue:`3873` 中貢獻。)" +"(由 Alexandre Vassalotti、Antoine Pitrou 和 Unladen Swallow 團隊在 :issue:" +"`9410` 和 :issue:`3873` 中貢獻。)" #: ../../whatsnew/3.2.rst:2373 msgid "" @@ -2670,8 +2673,8 @@ msgid "" "(Contributed by Antoine Pitrou in :issue:`7451` and by Raymond Hettinger and " "Antoine Pitrou in :issue:`10314`.)" msgstr "" -"(由 Antoine Pitrou 在 :issue:`7451` 中貢獻、由 Raymond Hettinger 和 Antoine Pitrou " -"在 :issue:`10314` 中貢獻。)" +"(由 Antoine Pitrou 在 :issue:`7451` 中貢獻、由 Raymond Hettinger 和 Antoine " +"Pitrou 在 :issue:`10314` 中貢獻。)" #: ../../whatsnew/3.2.rst:2390 msgid "" @@ -2866,7 +2869,8 @@ msgstr "" #: ../../whatsnew/3.2.rst:2507 msgid "" "(Contributed by Kevin Walzer, Ned Deily, and Ronald Oussoren; :issue:`6075`.)" -msgstr "(由 Kevin Walzer、Ned Deily 和 Ronald Oussoren 貢獻;:issue:`6075`。)" +msgstr "" +"(由 Kevin Walzer、Ned Deily 和 Ronald Oussoren 貢獻;:issue:`6075`。)" #: ../../whatsnew/3.2.rst:2510 msgid "Code Repository" @@ -3130,7 +3134,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2661 msgid "" -"The :c:type:`PyCObject` type, deprecated in 3.1, has been removed. To wrap " +"The :c:type:`!PyCObject` type, deprecated in 3.1, has been removed. To wrap " "opaque C pointers in Python objects, the :c:type:`PyCapsule` API should be " "used instead; the new type has a well-defined interface for passing typing " "safety information and a less complicated signature for calling a destructor." @@ -3178,8 +3182,8 @@ msgid "" "(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 " "`_.)" msgstr "" -"(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 " -"`_。)" +"(由 Georg Brandl 和 Mattias Brändström 貢獻;`appspot 問題 53094 `_。)" #: ../../whatsnew/3.2.rst:2698 msgid "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index f99076c0d2..4d7fa2d5d6 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -3147,7 +3147,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2150 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.3.rst:2152 msgid "Major performance enhancements have been added:" @@ -3297,7 +3297,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2210 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.3.rst:2213 msgid "Unsupported Operating Systems" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index c4446f704f..a0e58c3027 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -2828,7 +2828,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2067 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.4.rst:2069 msgid "" @@ -2954,7 +2954,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2157 msgid "Removed" -msgstr "" +msgstr "已移除" #: ../../whatsnew/3.4.rst:2161 msgid "Operating Systems No Longer Supported" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index a1af180a8a..4ebf6aad9c 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -2629,7 +2629,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2105 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.5.rst:2107 msgid "" @@ -2900,7 +2900,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2262 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.5.rst:2265 msgid "New Keywords" @@ -3038,7 +3038,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2352 msgid "Removed" -msgstr "" +msgstr "已移除" #: ../../whatsnew/3.5.rst:2355 msgid "API and Feature Removals" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 47fd83b3b1..ff85eacb82 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -791,7 +791,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:707 msgid "(Contributed by Victor Stinner in :issue:`26516` and :issue:`26564`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`26516` 和 :issue:`26564` 中貢獻。)" #: ../../whatsnew/3.6.rst:713 msgid "DTrace and SystemTap probing support" @@ -1229,7 +1229,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1007 msgid "(Contributed by Stefan Krah amd Mark Dickinson in :issue:`25928`.)" -msgstr "" +msgstr "(由 Stefan Krah 和 Mark Dickinson 於 :issue:`25928` 中貢獻。)" #: ../../whatsnew/3.6.rst:1012 ../../whatsnew/3.6.rst:1986 msgid "distutils" @@ -2020,7 +2020,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1580 msgid "(Contributed by Emanuel Barry in :issue:`26823`.)" -msgstr "" +msgstr "(由 Emanuel Barry 於 :issue:`26823` 中貢獻。)" #: ../../whatsnew/3.6.rst:1584 msgid "tracemalloc" @@ -2040,7 +2040,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1592 msgid "(Contributed by Victor Stinner in :issue:`26588`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`26588` 中貢獻。)" #: ../../whatsnew/3.6.rst:1598 msgid "typing" @@ -2272,7 +2272,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1779 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.6.rst:1781 msgid "" @@ -2503,7 +2503,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1923 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.6.rst:1926 msgid "New Keywords" @@ -2704,7 +2704,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2086 msgid "Removed" -msgstr "" +msgstr "已移除" #: ../../whatsnew/3.6.rst:2089 msgid "API and Feature Removals" @@ -3154,7 +3154,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2398 ../../whatsnew/3.6.rst:2411 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`23404` 中貢獻。)" #: ../../whatsnew/3.6.rst:2404 msgid "Removal of ``make touch`` build target" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 237fc0e345..1c567304b2 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -2513,7 +2513,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:1771 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.7.rst:1773 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 56b4ba2e38..c950b96b9c 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -1779,7 +1779,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1458 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.8.rst:1460 msgid "" @@ -2077,7 +2077,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1638 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.8.rst:1640 msgid "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 2dd9c0da9f..35ad207120 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -1106,7 +1106,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:746 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.9.rst:748 msgid "" @@ -1214,7 +1214,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:856 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.9.rst:858 msgid "" @@ -1364,7 +1364,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:955 ../../whatsnew/3.9.rst:1410 msgid "Removed" -msgstr "" +msgstr "已移除" #: ../../whatsnew/3.9.rst:957 msgid ""