diff --git a/c-api/call.po b/c-api/call.po index 4fc109baa2..a49337f6e6 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2022-06-11 00:15+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-" @@ -213,13 +213,7 @@ msgid "" "future extensions." msgstr "" -#: ../../c-api/call.rst:147 ../../c-api/call.rst:161 ../../c-api/call.rst:175 -#: ../../c-api/call.rst:259 ../../c-api/call.rst:346 ../../c-api/call.rst:360 -#: ../../c-api/call.rst:375 ../../c-api/call.rst:391 ../../c-api/call.rst:413 -msgid "This function is not part of the :ref:`limited API `." -msgstr "" - -#: ../../c-api/call.rst:153 +#: ../../c-api/call.rst:151 msgid "" "If *op* does not support the vectorcall protocol (either because the type " "does not or because the specific instance does not), return *NULL*. " @@ -227,19 +221,19 @@ msgid "" "function never raises an exception." msgstr "" -#: ../../c-api/call.rst:158 +#: ../../c-api/call.rst:156 msgid "" "This is mostly useful to check whether or not *op* supports vectorcall, " "which can be done by checking ``PyVectorcall_Function(op) != NULL``." msgstr "" -#: ../../c-api/call.rst:167 +#: ../../c-api/call.rst:163 msgid "" "Call *callable*'s :c:type:`vectorcallfunc` with positional and keyword " "arguments given in a tuple and dict, respectively." msgstr "" -#: ../../c-api/call.rst:170 +#: ../../c-api/call.rst:166 msgid "" "This is a specialized function, intended to be put in the :c:member:" "`~PyTypeObject.tp_call` slot or be used in an implementation of ``tp_call``. " @@ -247,11 +241,11 @@ msgid "" "not fall back to ``tp_call``." msgstr "" -#: ../../c-api/call.rst:183 +#: ../../c-api/call.rst:177 msgid "Object Calling API" msgstr "" -#: ../../c-api/call.rst:185 +#: ../../c-api/call.rst:179 msgid "" "Various functions are available for calling a Python object. Each converts " "its arguments to a convention supported by the called object – either " @@ -259,182 +253,182 @@ msgid "" "pick one that best fits the format of data you have available." msgstr "" -#: ../../c-api/call.rst:191 +#: ../../c-api/call.rst:185 msgid "" "The following table summarizes the available functions; please see " "individual documentation for details." msgstr "" -#: ../../c-api/call.rst:195 +#: ../../c-api/call.rst:189 msgid "Function" msgstr "函式" -#: ../../c-api/call.rst:195 +#: ../../c-api/call.rst:189 msgid "callable" msgstr "callable" -#: ../../c-api/call.rst:195 +#: ../../c-api/call.rst:189 msgid "args" msgstr "args" -#: ../../c-api/call.rst:195 +#: ../../c-api/call.rst:189 msgid "kwargs" msgstr "kwargs" -#: ../../c-api/call.rst:197 +#: ../../c-api/call.rst:191 msgid ":c:func:`PyObject_Call`" msgstr ":c:func:`PyObject_Call`" -#: ../../c-api/call.rst:197 ../../c-api/call.rst:199 ../../c-api/call.rst:201 -#: ../../c-api/call.rst:203 ../../c-api/call.rst:205 ../../c-api/call.rst:209 -#: ../../c-api/call.rst:217 ../../c-api/call.rst:219 +#: ../../c-api/call.rst:191 ../../c-api/call.rst:193 ../../c-api/call.rst:195 +#: ../../c-api/call.rst:197 ../../c-api/call.rst:199 ../../c-api/call.rst:203 +#: ../../c-api/call.rst:211 ../../c-api/call.rst:213 msgid "``PyObject *``" msgstr "``PyObject *``" -#: ../../c-api/call.rst:197 +#: ../../c-api/call.rst:191 msgid "tuple" msgstr "" -#: ../../c-api/call.rst:197 ../../c-api/call.rst:219 +#: ../../c-api/call.rst:191 ../../c-api/call.rst:213 msgid "dict/``NULL``" msgstr "dict/``NULL``" -#: ../../c-api/call.rst:199 +#: ../../c-api/call.rst:193 msgid ":c:func:`PyObject_CallNoArgs`" msgstr ":c:func:`PyObject_CallNoArgs`" +#: ../../c-api/call.rst:193 ../../c-api/call.rst:195 ../../c-api/call.rst:197 #: ../../c-api/call.rst:199 ../../c-api/call.rst:201 ../../c-api/call.rst:203 #: ../../c-api/call.rst:205 ../../c-api/call.rst:207 ../../c-api/call.rst:209 -#: ../../c-api/call.rst:211 ../../c-api/call.rst:213 ../../c-api/call.rst:215 msgid "---" msgstr "---" -#: ../../c-api/call.rst:201 +#: ../../c-api/call.rst:195 msgid ":c:func:`PyObject_CallOneArg`" msgstr ":c:func:`PyObject_CallOneArg`" -#: ../../c-api/call.rst:201 ../../c-api/call.rst:215 +#: ../../c-api/call.rst:195 ../../c-api/call.rst:209 msgid "1 object" msgstr "" -#: ../../c-api/call.rst:203 +#: ../../c-api/call.rst:197 msgid ":c:func:`PyObject_CallObject`" msgstr ":c:func:`PyObject_CallObject`" -#: ../../c-api/call.rst:203 +#: ../../c-api/call.rst:197 msgid "tuple/``NULL``" msgstr "" -#: ../../c-api/call.rst:205 +#: ../../c-api/call.rst:199 msgid ":c:func:`PyObject_CallFunction`" msgstr ":c:func:`PyObject_CallFunction`" -#: ../../c-api/call.rst:205 ../../c-api/call.rst:207 +#: ../../c-api/call.rst:199 ../../c-api/call.rst:201 msgid "format" msgstr "" -#: ../../c-api/call.rst:207 +#: ../../c-api/call.rst:201 msgid ":c:func:`PyObject_CallMethod`" msgstr ":c:func:`PyObject_CallMethod`" -#: ../../c-api/call.rst:207 +#: ../../c-api/call.rst:201 msgid "obj + ``char*``" msgstr "物件 + ``char*``" -#: ../../c-api/call.rst:209 +#: ../../c-api/call.rst:203 msgid ":c:func:`PyObject_CallFunctionObjArgs`" msgstr ":c:func:`PyObject_CallFunctionObjArgs`" -#: ../../c-api/call.rst:209 ../../c-api/call.rst:211 +#: ../../c-api/call.rst:203 ../../c-api/call.rst:205 msgid "variadic" msgstr "" -#: ../../c-api/call.rst:211 +#: ../../c-api/call.rst:205 msgid ":c:func:`PyObject_CallMethodObjArgs`" msgstr ":c:func:`PyObject_CallMethodObjArgs`" -#: ../../c-api/call.rst:211 ../../c-api/call.rst:213 ../../c-api/call.rst:215 +#: ../../c-api/call.rst:205 ../../c-api/call.rst:207 ../../c-api/call.rst:209 msgid "obj + name" msgstr "物件 + 名稱" -#: ../../c-api/call.rst:213 +#: ../../c-api/call.rst:207 msgid ":c:func:`PyObject_CallMethodNoArgs`" msgstr ":c:func:`PyObject_CallMethodNoArgs`" -#: ../../c-api/call.rst:215 +#: ../../c-api/call.rst:209 msgid ":c:func:`PyObject_CallMethodOneArg`" msgstr ":c:func:`PyObject_CallMethodOneArg`" -#: ../../c-api/call.rst:217 +#: ../../c-api/call.rst:211 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../c-api/call.rst:217 ../../c-api/call.rst:219 ../../c-api/call.rst:221 +#: ../../c-api/call.rst:211 ../../c-api/call.rst:213 ../../c-api/call.rst:215 msgid "vectorcall" msgstr "" -#: ../../c-api/call.rst:219 +#: ../../c-api/call.rst:213 msgid ":c:func:`PyObject_VectorcallDict`" msgstr ":c:func:`PyObject_VectorcallDict`" -#: ../../c-api/call.rst:221 +#: ../../c-api/call.rst:215 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../c-api/call.rst:221 +#: ../../c-api/call.rst:215 msgid "arg + name" msgstr "" -#: ../../c-api/call.rst:227 +#: ../../c-api/call.rst:221 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*, and named arguments given by the dictionary *kwargs*." msgstr "" -#: ../../c-api/call.rst:230 +#: ../../c-api/call.rst:224 msgid "" "*args* must not be *NULL*; use an empty tuple if no arguments are needed. If " "no named arguments are needed, *kwargs* can be *NULL*." msgstr "" -#: ../../c-api/call.rst:233 ../../c-api/call.rst:245 ../../c-api/call.rst:256 -#: ../../c-api/call.rst:269 ../../c-api/call.rst:281 ../../c-api/call.rst:301 -#: ../../c-api/call.rst:320 ../../c-api/call.rst:334 ../../c-api/call.rst:343 -#: ../../c-api/call.rst:357 ../../c-api/call.rst:372 ../../c-api/call.rst:410 +#: ../../c-api/call.rst:227 ../../c-api/call.rst:239 ../../c-api/call.rst:250 +#: ../../c-api/call.rst:261 ../../c-api/call.rst:273 ../../c-api/call.rst:293 +#: ../../c-api/call.rst:312 ../../c-api/call.rst:326 ../../c-api/call.rst:335 +#: ../../c-api/call.rst:347 ../../c-api/call.rst:360 ../../c-api/call.rst:394 msgid "" "Return the result of the call on success, or raise an exception and return " "*NULL* on failure." msgstr "" -#: ../../c-api/call.rst:236 +#: ../../c-api/call.rst:230 msgid "" "This is the equivalent of the Python expression: ``callable(*args, " "**kwargs)``." msgstr "" -#: ../../c-api/call.rst:242 +#: ../../c-api/call.rst:236 msgid "" "Call a callable Python object *callable* without any arguments. It is the " "most efficient way to call a callable Python object without any argument." msgstr "" -#: ../../c-api/call.rst:253 +#: ../../c-api/call.rst:247 msgid "" "Call a callable Python object *callable* with exactly 1 positional argument " "*arg* and no keyword arguments." msgstr "" -#: ../../c-api/call.rst:266 +#: ../../c-api/call.rst:258 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*. If no arguments are needed, then *args* can be *NULL*." msgstr "" -#: ../../c-api/call.rst:272 ../../c-api/call.rst:284 +#: ../../c-api/call.rst:264 ../../c-api/call.rst:276 msgid "This is the equivalent of the Python expression: ``callable(*args)``." msgstr "" -#: ../../c-api/call.rst:277 +#: ../../c-api/call.rst:269 msgid "" "Call a callable Python object *callable*, with a variable number of C " "arguments. The C arguments are described using a :c:func:`Py_BuildValue` " @@ -442,57 +436,57 @@ msgid "" "are provided." msgstr "" -#: ../../c-api/call.rst:286 +#: ../../c-api/call.rst:278 msgid "" "Note that if you only pass :c:type:`PyObject *` args, :c:func:" "`PyObject_CallFunctionObjArgs` is a faster alternative." msgstr "" -#: ../../c-api/call.rst:289 +#: ../../c-api/call.rst:281 msgid "The type of *format* was changed from ``char *``." msgstr "" -#: ../../c-api/call.rst:295 +#: ../../c-api/call.rst:287 msgid "" "Call the method named *name* of object *obj* with a variable number of C " "arguments. The C arguments are described by a :c:func:`Py_BuildValue` " "format string that should produce a tuple." msgstr "" -#: ../../c-api/call.rst:299 +#: ../../c-api/call.rst:291 msgid "The format can be *NULL*, indicating that no arguments are provided." msgstr "" -#: ../../c-api/call.rst:304 +#: ../../c-api/call.rst:296 msgid "" "This is the equivalent of the Python expression: ``obj.name(arg1, " "arg2, ...)``." msgstr "" -#: ../../c-api/call.rst:307 +#: ../../c-api/call.rst:299 msgid "" "Note that if you only pass :c:type:`PyObject *` args, :c:func:" "`PyObject_CallMethodObjArgs` is a faster alternative." msgstr "" -#: ../../c-api/call.rst:310 +#: ../../c-api/call.rst:302 msgid "The types of *name* and *format* were changed from ``char *``." msgstr "" -#: ../../c-api/call.rst:316 +#: ../../c-api/call.rst:308 msgid "" "Call a callable Python object *callable*, with a variable number of :c:type:" "`PyObject *` arguments. The arguments are provided as a variable number of " "parameters followed by *NULL*." msgstr "" -#: ../../c-api/call.rst:323 +#: ../../c-api/call.rst:315 msgid "" "This is the equivalent of the Python expression: ``callable(arg1, " "arg2, ...)``." msgstr "" -#: ../../c-api/call.rst:329 +#: ../../c-api/call.rst:321 msgid "" "Call a method of the Python object *obj*, where the name of the method is " "given as a Python string object in *name*. It is called with a variable " @@ -500,34 +494,34 @@ msgid "" "variable number of parameters followed by *NULL*." msgstr "" -#: ../../c-api/call.rst:340 +#: ../../c-api/call.rst:332 msgid "" "Call a method of the Python object *obj* without arguments, where the name " "of the method is given as a Python string object in *name*." msgstr "" -#: ../../c-api/call.rst:353 +#: ../../c-api/call.rst:343 msgid "" "Call a method of the Python object *obj* with a single positional argument " "*arg*, where the name of the method is given as a Python string object in " "*name*." msgstr "" -#: ../../c-api/call.rst:367 +#: ../../c-api/call.rst:355 msgid "" "Call a callable Python object *callable*. The arguments are the same as for :" "c:type:`vectorcallfunc`. If *callable* supports vectorcall_, this directly " "calls the vectorcall function stored in *callable*." msgstr "" -#: ../../c-api/call.rst:381 +#: ../../c-api/call.rst:367 msgid "" "Call *callable* with positional arguments passed exactly as in the " "vectorcall_ protocol, but with keyword arguments passed as a dictionary " "*kwdict*. The *args* array contains only the positional arguments." msgstr "" -#: ../../c-api/call.rst:385 +#: ../../c-api/call.rst:371 msgid "" "Regardless of which protocol is used internally, a conversion of arguments " "needs to be done. Therefore, this function should only be used if the caller " @@ -535,7 +529,7 @@ msgid "" "tuple for the positional arguments." msgstr "" -#: ../../c-api/call.rst:397 +#: ../../c-api/call.rst:381 msgid "" "Call a method using the vectorcall calling convention. The name of the " "method is given as a Python string *name*. The object whose method is called " @@ -547,17 +541,17 @@ msgid "" "`PyObject_Vectorcall`." msgstr "" -#: ../../c-api/call.rst:406 +#: ../../c-api/call.rst:390 msgid "" "If the object has the :const:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " "will call the unbound method object with the full *args* vector as arguments." msgstr "" -#: ../../c-api/call.rst:419 +#: ../../c-api/call.rst:401 msgid "Call Support API" msgstr "" -#: ../../c-api/call.rst:423 +#: ../../c-api/call.rst:405 msgid "" "Determine if the object *o* is callable. Return ``1`` if the object is " "callable and ``0`` otherwise. This function always succeeds." diff --git a/c-api/init_config.po b/c-api/init_config.po index 774f034ab5..7089f178bb 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2022-06-10 00:16+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -338,7 +338,7 @@ msgid "" msgstr "" #: ../../c-api/init_config.rst:288 ../../c-api/init_config.rst:633 -#: ../../c-api/init_config.rst:675 ../../c-api/init_config.rst:1094 +#: ../../c-api/init_config.rst:675 ../../c-api/init_config.rst:1093 msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" @@ -346,7 +346,7 @@ msgstr "" msgid "Isolated mode: see :c:member:`PyConfig.isolated`." msgstr "" -#: ../../c-api/init_config.rst:294 ../../c-api/init_config.rst:798 +#: ../../c-api/init_config.rst:294 ../../c-api/init_config.rst:797 msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." msgstr "" @@ -372,7 +372,7 @@ msgid "" "variable value." msgstr "" -#: ../../c-api/init_config.rst:307 ../../c-api/init_config.rst:811 +#: ../../c-api/init_config.rst:307 ../../c-api/init_config.rst:810 msgid "" "Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " "Windows specific code." @@ -380,12 +380,12 @@ msgstr "" #: ../../c-api/init_config.rst:310 ../../c-api/init_config.rst:588 #: ../../c-api/init_config.rst:595 ../../c-api/init_config.rst:646 -#: ../../c-api/init_config.rst:756 ../../c-api/init_config.rst:770 -#: ../../c-api/init_config.rst:784 ../../c-api/init_config.rst:814 -#: ../../c-api/init_config.rst:828 ../../c-api/init_config.rst:881 -#: ../../c-api/init_config.rst:930 ../../c-api/init_config.rst:990 -#: ../../c-api/init_config.rst:1029 ../../c-api/init_config.rst:1058 -#: ../../c-api/init_config.rst:1129 +#: ../../c-api/init_config.rst:755 ../../c-api/init_config.rst:769 +#: ../../c-api/init_config.rst:783 ../../c-api/init_config.rst:813 +#: ../../c-api/init_config.rst:827 ../../c-api/init_config.rst:880 +#: ../../c-api/init_config.rst:929 ../../c-api/init_config.rst:989 +#: ../../c-api/init_config.rst:1028 ../../c-api/init_config.rst:1057 +#: ../../c-api/init_config.rst:1128 msgid "Default: ``0``." msgstr "預設:\\ ``0``。" @@ -403,7 +403,7 @@ msgid "" "use_environment`." msgstr "" -#: ../../c-api/init_config.rst:326 ../../c-api/init_config.rst:1103 +#: ../../c-api/init_config.rst:326 ../../c-api/init_config.rst:1102 msgid "Default: ``1`` in Python config and ``0`` in isolated config." msgstr "" @@ -475,7 +475,7 @@ msgid "" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:379 ../../c-api/init_config.rst:1191 +#: ../../c-api/init_config.rst:379 ../../c-api/init_config.rst:1190 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." @@ -584,7 +584,7 @@ msgstr "" msgid "Fields which are already initialized are left unchanged." msgstr "" -#: ../../c-api/init_config.rst:482 ../../c-api/init_config.rst:910 +#: ../../c-api/init_config.rst:482 ../../c-api/init_config.rst:909 msgid "" "The :c:func:`PyConfig_Read` function only parses :c:member:`PyConfig.argv` " "arguments once: :c:member:`PyConfig.parse_argv` is set to ``2`` after " @@ -663,10 +663,10 @@ msgstr "" #: ../../c-api/init_config.rst:533 ../../c-api/init_config.rst:541 #: ../../c-api/init_config.rst:553 ../../c-api/init_config.rst:561 #: ../../c-api/init_config.rst:653 ../../c-api/init_config.rst:662 -#: ../../c-api/init_config.rst:745 ../../c-api/init_config.rst:851 -#: ../../c-api/init_config.rst:949 ../../c-api/init_config.rst:967 -#: ../../c-api/init_config.rst:981 ../../c-api/init_config.rst:998 -#: ../../c-api/init_config.rst:1010 ../../c-api/init_config.rst:1018 +#: ../../c-api/init_config.rst:744 ../../c-api/init_config.rst:850 +#: ../../c-api/init_config.rst:948 ../../c-api/init_config.rst:966 +#: ../../c-api/init_config.rst:980 ../../c-api/init_config.rst:997 +#: ../../c-api/init_config.rst:1009 ../../c-api/init_config.rst:1017 msgid "Default: ``NULL``." msgstr "預設值:\\ ``NULL``\\ 。" @@ -680,8 +680,8 @@ msgstr ":data:`sys.base_exec_prefix`\\ 。" #: ../../c-api/init_config.rst:543 ../../c-api/init_config.rst:555 #: ../../c-api/init_config.rst:563 ../../c-api/init_config.rst:655 -#: ../../c-api/init_config.rst:664 ../../c-api/init_config.rst:868 -#: ../../c-api/init_config.rst:951 +#: ../../c-api/init_config.rst:664 ../../c-api/init_config.rst:867 +#: ../../c-api/init_config.rst:950 msgid "Part of the :ref:`Python Path Configuration ` output." msgstr "" @@ -717,8 +717,8 @@ msgstr "" msgid "stdin is always opened in buffered mode." msgstr "" -#: ../../c-api/init_config.rst:575 ../../c-api/init_config.rst:1046 -#: ../../c-api/init_config.rst:1161 +#: ../../c-api/init_config.rst:575 ../../c-api/init_config.rst:1045 +#: ../../c-api/init_config.rst:1160 msgid "Default: ``1``." msgstr "預設值:\\ ``1``\\ 。" @@ -876,237 +876,237 @@ msgstr "" #: ../../c-api/init_config.rst:691 msgid "" "``\"ascii\"`` if Python detects that ``nl_langinfo(CODESET)`` announces the " -"ASCII encoding (or Roman8 encoding on HP-UX), whereas the ``mbstowcs()`` " -"function decodes from a different encoding (usually Latin1)." +"ASCII encoding, whereas the ``mbstowcs()`` function decodes from a different " +"encoding (usually Latin1)." msgstr "" -#: ../../c-api/init_config.rst:695 +#: ../../c-api/init_config.rst:694 msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string." msgstr "" -#: ../../c-api/init_config.rst:696 +#: ../../c-api/init_config.rst:695 msgid "" "Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." msgstr "" -#: ../../c-api/init_config.rst:699 +#: ../../c-api/init_config.rst:698 msgid "" "At Python startup, the encoding name is normalized to the Python codec name. " "For example, ``\"ANSI_X3.4-1968\"`` is replaced with ``\"ascii\"``." msgstr "" -#: ../../c-api/init_config.rst:702 +#: ../../c-api/init_config.rst:701 msgid "See also the :c:member:`~PyConfig.filesystem_errors` member." msgstr "" -#: ../../c-api/init_config.rst:706 +#: ../../c-api/init_config.rst:705 msgid "" ":term:`Filesystem error handler `: :" "func:`sys.getfilesystemencodeerrors`." msgstr "" -#: ../../c-api/init_config.rst:709 +#: ../../c-api/init_config.rst:708 msgid "" "On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if :c:" "member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is " "non-zero." msgstr "" -#: ../../c-api/init_config.rst:713 +#: ../../c-api/init_config.rst:712 msgid "On other platforms: use ``\"surrogateescape\"`` by default." msgstr "" -#: ../../c-api/init_config.rst:715 +#: ../../c-api/init_config.rst:714 msgid "Supported error handlers:" msgstr "" -#: ../../c-api/init_config.rst:717 +#: ../../c-api/init_config.rst:716 msgid "``\"strict\"``" msgstr "``\"strict\"``" -#: ../../c-api/init_config.rst:718 +#: ../../c-api/init_config.rst:717 msgid "``\"surrogateescape\"``" msgstr "``\"surrogateescape\"``" -#: ../../c-api/init_config.rst:719 +#: ../../c-api/init_config.rst:718 msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)" msgstr "" -#: ../../c-api/init_config.rst:721 +#: ../../c-api/init_config.rst:720 msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member." msgstr "" -#: ../../c-api/init_config.rst:726 +#: ../../c-api/init_config.rst:725 msgid "Randomized hash function seed." msgstr "" -#: ../../c-api/init_config.rst:728 +#: ../../c-api/init_config.rst:727 msgid "" "If :c:member:`~PyConfig.use_hash_seed` is zero, a seed is chosen randomly at " "Python startup, and :c:member:`~PyConfig.hash_seed` is ignored." msgstr "" -#: ../../c-api/init_config.rst:731 +#: ../../c-api/init_config.rst:730 msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable." msgstr "" -#: ../../c-api/init_config.rst:733 +#: ../../c-api/init_config.rst:732 msgid "" "Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:738 +#: ../../c-api/init_config.rst:737 msgid "Python home directory." msgstr "" -#: ../../c-api/init_config.rst:740 +#: ../../c-api/init_config.rst:739 msgid "" "If :c:func:`Py_SetPythonHome` has been called, use its argument if it is not " "``NULL``." msgstr "" -#: ../../c-api/init_config.rst:743 +#: ../../c-api/init_config.rst:742 msgid "Set by the :envvar:`PYTHONHOME` environment variable." msgstr "" -#: ../../c-api/init_config.rst:747 ../../c-api/init_config.rst:840 -#: ../../c-api/init_config.rst:853 ../../c-api/init_config.rst:942 -#: ../../c-api/init_config.rst:969 +#: ../../c-api/init_config.rst:746 ../../c-api/init_config.rst:839 +#: ../../c-api/init_config.rst:852 ../../c-api/init_config.rst:941 +#: ../../c-api/init_config.rst:968 msgid "Part of the :ref:`Python Path Configuration ` input." msgstr "" -#: ../../c-api/init_config.rst:751 +#: ../../c-api/init_config.rst:750 msgid "If non-zero, profile import time." msgstr "" -#: ../../c-api/init_config.rst:753 +#: ../../c-api/init_config.rst:752 msgid "" "Set the ``1`` by the :option:`-X importtime <-X>` option and the :envvar:" "`PYTHONPROFILEIMPORTTIME` environment variable." msgstr "" -#: ../../c-api/init_config.rst:760 +#: ../../c-api/init_config.rst:759 msgid "Enter interactive mode after executing a script or a command." msgstr "" -#: ../../c-api/init_config.rst:762 +#: ../../c-api/init_config.rst:761 msgid "" "If greater than 0, enable inspect: when a script is passed as first argument " "or the -c option is used, enter interactive mode after executing the script " "or the command, even when :data:`sys.stdin` does not appear to be a terminal." msgstr "" -#: ../../c-api/init_config.rst:767 +#: ../../c-api/init_config.rst:766 msgid "" "Incremented by the :option:`-i` command line option. Set to ``1`` if the :" "envvar:`PYTHONINSPECT` environment variable is non-empty." msgstr "" -#: ../../c-api/init_config.rst:774 +#: ../../c-api/init_config.rst:773 msgid "Install Python signal handlers?" msgstr "" -#: ../../c-api/init_config.rst:776 ../../c-api/init_config.rst:916 -#: ../../c-api/init_config.rst:940 ../../c-api/init_config.rst:1113 +#: ../../c-api/init_config.rst:775 ../../c-api/init_config.rst:915 +#: ../../c-api/init_config.rst:939 ../../c-api/init_config.rst:1112 msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:780 +#: ../../c-api/init_config.rst:779 msgid "If greater than 0, enable the interactive mode (REPL)." msgstr "" -#: ../../c-api/init_config.rst:782 +#: ../../c-api/init_config.rst:781 msgid "Incremented by the :option:`-i` command line option." msgstr "" -#: ../../c-api/init_config.rst:788 +#: ../../c-api/init_config.rst:787 msgid "If greater than 0, enable isolated mode:" msgstr "" -#: ../../c-api/init_config.rst:790 +#: ../../c-api/init_config.rst:789 msgid "" ":data:`sys.path` contains neither the script's directory (computed from " "``argv[0]`` or the current directory) nor the user's site-packages directory." msgstr "" -#: ../../c-api/init_config.rst:793 +#: ../../c-api/init_config.rst:792 msgid "" "Python REPL doesn't import :mod:`readline` nor enable default readline " "configuration on interactive prompts." msgstr "" -#: ../../c-api/init_config.rst:795 +#: ../../c-api/init_config.rst:794 msgid "" "Set :c:member:`~PyConfig.use_environment` and :c:member:`~PyConfig." "user_site_directory` to 0." msgstr "" -#: ../../c-api/init_config.rst:800 +#: ../../c-api/init_config.rst:799 msgid "See also :c:member:`PyPreConfig.isolated`." msgstr "也請見 :c:member:`PyPreConfig.isolated`\\ 。" -#: ../../c-api/init_config.rst:804 +#: ../../c-api/init_config.rst:803 msgid "" "If non-zero, use :class:`io.FileIO` instead of :class:`io.WindowsConsoleIO` " "for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys.stderr`." msgstr "" -#: ../../c-api/init_config.rst:808 +#: ../../c-api/init_config.rst:807 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -#: ../../c-api/init_config.rst:816 +#: ../../c-api/init_config.rst:815 msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." msgstr "" -#: ../../c-api/init_config.rst:820 +#: ../../c-api/init_config.rst:819 msgid "" "If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " "` at exit." msgstr "" -#: ../../c-api/init_config.rst:823 +#: ../../c-api/init_config.rst:822 msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:825 +#: ../../c-api/init_config.rst:824 msgid "" "The option is ignored if Python is :option:`configured using the --without-" "pymalloc option <--without-pymalloc>`." msgstr "" -#: ../../c-api/init_config.rst:832 +#: ../../c-api/init_config.rst:831 msgid "Platform library directory name: :data:`sys.platlibdir`." msgstr "" -#: ../../c-api/init_config.rst:834 +#: ../../c-api/init_config.rst:833 msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." msgstr "" -#: ../../c-api/init_config.rst:836 +#: ../../c-api/init_config.rst:835 msgid "" "Default: value of the ``PLATLIBDIR`` macro which is set by the :option:" "`configure --with-platlibdir option <--with-platlibdir>` (default: ``\"lib" "\"``)." msgstr "" -#: ../../c-api/init_config.rst:846 +#: ../../c-api/init_config.rst:845 msgid "" "Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" "data:`os.path.pathsep`)." msgstr "" -#: ../../c-api/init_config.rst:849 +#: ../../c-api/init_config.rst:848 msgid "Set by the :envvar:`PYTHONPATH` environment variable." msgstr "" -#: ../../c-api/init_config.rst:858 +#: ../../c-api/init_config.rst:857 msgid "Module search paths: :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:860 +#: ../../c-api/init_config.rst:859 msgid "" "If :c:member:`~PyConfig.module_search_paths_set` is equal to 0, the function " "calculating the :ref:`Python Path Configuration ` " @@ -1114,41 +1114,41 @@ msgid "" "`~PyConfig.module_search_paths_set` to ``1``." msgstr "" -#: ../../c-api/init_config.rst:865 +#: ../../c-api/init_config.rst:864 msgid "" "Default: empty list (``module_search_paths``) and ``0`` " "(``module_search_paths_set``)." msgstr "" -#: ../../c-api/init_config.rst:872 +#: ../../c-api/init_config.rst:871 msgid "Compilation optimization level:" msgstr "" -#: ../../c-api/init_config.rst:874 +#: ../../c-api/init_config.rst:873 msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." msgstr "" -#: ../../c-api/init_config.rst:875 +#: ../../c-api/init_config.rst:874 msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." msgstr "" -#: ../../c-api/init_config.rst:876 +#: ../../c-api/init_config.rst:875 msgid "``2``: Level 1, strip docstrings." msgstr "" -#: ../../c-api/init_config.rst:878 +#: ../../c-api/init_config.rst:877 msgid "" "Incremented by the :option:`-O` command line option. Set to the :envvar:" "`PYTHONOPTIMIZE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:885 +#: ../../c-api/init_config.rst:884 msgid "" "The list of the original command line arguments passed to the Python " "executable: :data:`sys.orig_argv`." msgstr "" -#: ../../c-api/init_config.rst:888 +#: ../../c-api/init_config.rst:887 msgid "" "If :c:member:`~PyConfig.orig_argv` list is empty and :c:member:`~PyConfig." "argv` is not a list only containing an empty string, :c:func:`PyConfig_Read` " @@ -1157,356 +1157,356 @@ msgid "" "parse_argv` is non-zero)." msgstr "" -#: ../../c-api/init_config.rst:895 +#: ../../c-api/init_config.rst:894 msgid "" "See also the :c:member:`~PyConfig.argv` member and the :c:func:" "`Py_GetArgcArgv` function." msgstr "" -#: ../../c-api/init_config.rst:898 ../../c-api/init_config.rst:1148 -#: ../../c-api/init_config.rst:1167 +#: ../../c-api/init_config.rst:897 ../../c-api/init_config.rst:1147 +#: ../../c-api/init_config.rst:1166 msgid "Default: empty list." msgstr "" -#: ../../c-api/init_config.rst:904 +#: ../../c-api/init_config.rst:903 msgid "Parse command line arguments?" msgstr "" -#: ../../c-api/init_config.rst:906 +#: ../../c-api/init_config.rst:905 msgid "" "If equals to ``1``, parse :c:member:`~PyConfig.argv` the same way the " "regular Python parses :ref:`command line arguments `, and " "strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:918 +#: ../../c-api/init_config.rst:917 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:" "`PyConfig.parse_argv` equals to ``1``." msgstr "" -#: ../../c-api/init_config.rst:924 +#: ../../c-api/init_config.rst:923 msgid "" "Parser debug mode. If greater than 0, turn on parser debugging output (for " "expert only, depending on compilation options)." msgstr "" -#: ../../c-api/init_config.rst:927 +#: ../../c-api/init_config.rst:926 msgid "" "Incremented by the :option:`-d` command line option. Set to the :envvar:" "`PYTHONDEBUG` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:934 +#: ../../c-api/init_config.rst:933 msgid "" "On Unix, if non-zero, calculating the :ref:`Python Path Configuration ` can log warnings into ``stderr``. If equals to 0, suppress " "these warnings." msgstr "" -#: ../../c-api/init_config.rst:938 +#: ../../c-api/init_config.rst:937 msgid "It has no effect on Windows." msgstr "" -#: ../../c-api/init_config.rst:946 +#: ../../c-api/init_config.rst:945 msgid "" "The site-specific directory prefix where the platform independent Python " "files are installed: :data:`sys.prefix`." msgstr "" -#: ../../c-api/init_config.rst:955 +#: ../../c-api/init_config.rst:954 msgid "" "Program name used to initialize :c:member:`~PyConfig.executable` and in " "early error messages during Python initialization." msgstr "" -#: ../../c-api/init_config.rst:958 +#: ../../c-api/init_config.rst:957 msgid "If :func:`Py_SetProgramName` has been called, use its argument." msgstr "" -#: ../../c-api/init_config.rst:959 +#: ../../c-api/init_config.rst:958 msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:960 +#: ../../c-api/init_config.rst:959 msgid "" "If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" "`__PYVENV_LAUNCHER__` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:962 +#: ../../c-api/init_config.rst:961 msgid "" "Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." msgstr "" -#: ../../c-api/init_config.rst:964 +#: ../../c-api/init_config.rst:963 msgid "" "Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " "platforms." msgstr "" -#: ../../c-api/init_config.rst:973 +#: ../../c-api/init_config.rst:972 msgid "" "Directory where cached ``.pyc`` files are written: :data:`sys." "pycache_prefix`." msgstr "" -#: ../../c-api/init_config.rst:976 +#: ../../c-api/init_config.rst:975 msgid "" "Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and " "the :envvar:`PYTHONPYCACHEPREFIX` environment variable." msgstr "" -#: ../../c-api/init_config.rst:979 +#: ../../c-api/init_config.rst:978 msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." msgstr "" -#: ../../c-api/init_config.rst:985 +#: ../../c-api/init_config.rst:984 msgid "" "Quiet mode. If greater than 0, don't display the copyright and version at " "Python startup in interactive mode." msgstr "" -#: ../../c-api/init_config.rst:988 +#: ../../c-api/init_config.rst:987 msgid "Incremented by the :option:`-q` command line option." msgstr "" -#: ../../c-api/init_config.rst:994 +#: ../../c-api/init_config.rst:993 msgid "Value of the :option:`-c` command line option." msgstr "" -#: ../../c-api/init_config.rst:996 ../../c-api/init_config.rst:1008 -#: ../../c-api/init_config.rst:1016 +#: ../../c-api/init_config.rst:995 ../../c-api/init_config.rst:1007 +#: ../../c-api/init_config.rst:1015 msgid "Used by :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1002 +#: ../../c-api/init_config.rst:1001 msgid "" "Filename passed on the command line: trailing command line argument without :" "option:`-c` or :option:`-m`." msgstr "" -#: ../../c-api/init_config.rst:1005 +#: ../../c-api/init_config.rst:1004 msgid "" "For example, it is set to ``script.py`` by the ``python3 script.py arg`` " "command." msgstr "" -#: ../../c-api/init_config.rst:1014 +#: ../../c-api/init_config.rst:1013 msgid "Value of the :option:`-m` command line option." msgstr "" -#: ../../c-api/init_config.rst:1022 +#: ../../c-api/init_config.rst:1021 msgid "Show total reference count at exit?" msgstr "" -#: ../../c-api/init_config.rst:1024 +#: ../../c-api/init_config.rst:1023 msgid "Set to 1 by :option:`-X showrefcount <-X>` command line option." msgstr "" -#: ../../c-api/init_config.rst:1026 +#: ../../c-api/init_config.rst:1025 msgid "" "Need a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " "macro must be defined)." msgstr "" -#: ../../c-api/init_config.rst:1033 +#: ../../c-api/init_config.rst:1032 msgid "Import the :mod:`site` module at startup?" msgstr "" -#: ../../c-api/init_config.rst:1035 +#: ../../c-api/init_config.rst:1034 msgid "" "If equal to zero, disable the import of the module site and the site-" "dependent manipulations of :data:`sys.path` that it entails." msgstr "" -#: ../../c-api/init_config.rst:1038 +#: ../../c-api/init_config.rst:1037 msgid "" "Also disable these manipulations if the :mod:`site` module is explicitly " "imported later (call :func:`site.main` if you want them to be triggered)." msgstr "" -#: ../../c-api/init_config.rst:1041 +#: ../../c-api/init_config.rst:1040 msgid "Set to ``0`` by the :option:`-S` command line option." msgstr "" -#: ../../c-api/init_config.rst:1043 +#: ../../c-api/init_config.rst:1042 msgid "" ":data:`sys.flags.no_site` is set to the inverted value of :c:member:" "`~PyConfig.site_import`." msgstr "" -#: ../../c-api/init_config.rst:1050 +#: ../../c-api/init_config.rst:1049 msgid "" "If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " "source." msgstr "" -#: ../../c-api/init_config.rst:1053 +#: ../../c-api/init_config.rst:1052 msgid "" "It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a " "DOS specific hack only." msgstr "" -#: ../../c-api/init_config.rst:1056 +#: ../../c-api/init_config.rst:1055 msgid "Set to ``1`` by the :option:`-x` command line option." msgstr "" -#: ../../c-api/init_config.rst:1063 +#: ../../c-api/init_config.rst:1062 msgid "" "Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :" "data:`sys.stderr` (but :data:`sys.stderr` always uses ``\"backslashreplace" "\"`` error handler)." msgstr "" -#: ../../c-api/init_config.rst:1067 +#: ../../c-api/init_config.rst:1066 msgid "" "If :c:func:`Py_SetStandardStreamEncoding` has been called, use its *error* " "and *errors* arguments if they are not ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:1070 +#: ../../c-api/init_config.rst:1069 msgid "" "Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." msgstr "" -#: ../../c-api/init_config.rst:1073 +#: ../../c-api/init_config.rst:1072 msgid "Default encoding:" msgstr "" -#: ../../c-api/init_config.rst:1075 +#: ../../c-api/init_config.rst:1074 msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:1076 +#: ../../c-api/init_config.rst:1075 msgid "Otherwise, use the :term:`locale encoding`." msgstr "" -#: ../../c-api/init_config.rst:1078 +#: ../../c-api/init_config.rst:1077 msgid "Default error handler:" msgstr "" -#: ../../c-api/init_config.rst:1080 +#: ../../c-api/init_config.rst:1079 msgid "On Windows: use ``\"surrogateescape\"``." msgstr "" -#: ../../c-api/init_config.rst:1081 +#: ../../c-api/init_config.rst:1080 msgid "" "``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or " "if the LC_CTYPE locale is \"C\" or \"POSIX\"." msgstr "" -#: ../../c-api/init_config.rst:1083 +#: ../../c-api/init_config.rst:1082 msgid "``\"strict\"`` otherwise." msgstr "" -#: ../../c-api/init_config.rst:1087 +#: ../../c-api/init_config.rst:1086 msgid "Enable tracemalloc?" msgstr "" -#: ../../c-api/init_config.rst:1089 +#: ../../c-api/init_config.rst:1088 msgid "If non-zero, call :func:`tracemalloc.start` at startup." msgstr "" -#: ../../c-api/init_config.rst:1091 +#: ../../c-api/init_config.rst:1090 msgid "" "Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" "envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1098 +#: ../../c-api/init_config.rst:1097 msgid "Use :ref:`environment variables `?" msgstr "" -#: ../../c-api/init_config.rst:1100 +#: ../../c-api/init_config.rst:1099 msgid "" "If equals to zero, ignore the :ref:`environment variables `." msgstr "" -#: ../../c-api/init_config.rst:1107 +#: ../../c-api/init_config.rst:1106 msgid "If non-zero, add the user site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1109 +#: ../../c-api/init_config.rst:1108 msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." msgstr "" -#: ../../c-api/init_config.rst:1111 +#: ../../c-api/init_config.rst:1110 msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1117 +#: ../../c-api/init_config.rst:1116 msgid "" "Verbose mode. If greater than 0, print a message each time a module is " "imported, showing the place (filename or built-in module) from which it is " "loaded." msgstr "" -#: ../../c-api/init_config.rst:1121 +#: ../../c-api/init_config.rst:1120 msgid "" "If greater or equal to 2, print a message for each file that is checked for " "when searching for a module. Also provides information on module cleanup at " "exit." msgstr "" -#: ../../c-api/init_config.rst:1125 +#: ../../c-api/init_config.rst:1124 msgid "Incremented by the :option:`-v` command line option." msgstr "" -#: ../../c-api/init_config.rst:1127 +#: ../../c-api/init_config.rst:1126 msgid "Set to the :envvar:`PYTHONVERBOSE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1133 +#: ../../c-api/init_config.rst:1132 msgid "" "Options of the :mod:`warnings` module to build warnings filters, lowest to " "highest priority: :data:`sys.warnoptions`." msgstr "" -#: ../../c-api/init_config.rst:1136 +#: ../../c-api/init_config.rst:1135 msgid "" "The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse " "order: the last :c:member:`PyConfig.warnoptions` item becomes the first item " "of :data:`warnings.filters` which is checked first (highest priority)." msgstr "" -#: ../../c-api/init_config.rst:1141 +#: ../../c-api/init_config.rst:1140 msgid "" "The :option:`-W` command line options adds its value to :c:member:`~PyConfig." "warnoptions`, it can be used multiple times." msgstr "" -#: ../../c-api/init_config.rst:1144 +#: ../../c-api/init_config.rst:1143 msgid "" "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " "warning options. Multiple options can be specified, separated by commas (``," "``)." msgstr "" -#: ../../c-api/init_config.rst:1152 +#: ../../c-api/init_config.rst:1151 msgid "" "If equal to 0, Python won't try to write ``.pyc`` files on the import of " "source modules." msgstr "" -#: ../../c-api/init_config.rst:1155 +#: ../../c-api/init_config.rst:1154 msgid "" "Set to ``0`` by the :option:`-B` command line option and the :envvar:" "`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1158 +#: ../../c-api/init_config.rst:1157 msgid "" ":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" "member:`~PyConfig.write_bytecode`." msgstr "" -#: ../../c-api/init_config.rst:1165 +#: ../../c-api/init_config.rst:1164 msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." msgstr "" -#: ../../c-api/init_config.rst:1169 +#: ../../c-api/init_config.rst:1168 msgid "" "If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` " "arguments are parsed the same way the regular Python parses :ref:`command " @@ -1514,29 +1514,29 @@ msgid "" "c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:1174 +#: ../../c-api/init_config.rst:1173 msgid "" "The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " "see the :option:`-X` command line option." msgstr "" -#: ../../c-api/init_config.rst:1179 +#: ../../c-api/init_config.rst:1178 msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: ../../c-api/init_config.rst:1183 +#: ../../c-api/init_config.rst:1182 msgid "Initialization with PyConfig" msgstr "" -#: ../../c-api/init_config.rst:1185 +#: ../../c-api/init_config.rst:1184 msgid "Function to initialize Python:" msgstr "" -#: ../../c-api/init_config.rst:1189 +#: ../../c-api/init_config.rst:1188 msgid "Initialize Python from *config* configuration." msgstr "" -#: ../../c-api/init_config.rst:1194 +#: ../../c-api/init_config.rst:1193 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" "func:`PyImport_ExtendInittab` are used, they must be set or called after " @@ -1545,34 +1545,34 @@ msgid "" "`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1201 +#: ../../c-api/init_config.rst:1200 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" -#: ../../c-api/init_config.rst:1204 +#: ../../c-api/init_config.rst:1203 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:1232 +#: ../../c-api/init_config.rst:1231 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters::" msgstr "" -#: ../../c-api/init_config.rst:1283 +#: ../../c-api/init_config.rst:1282 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:1285 +#: ../../c-api/init_config.rst:1284 msgid "" ":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" "`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " "Python from the system. For example, to embed Python into an application." msgstr "" -#: ../../c-api/init_config.rst:1290 +#: ../../c-api/init_config.rst:1289 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -1580,7 +1580,7 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:1295 +#: ../../c-api/init_config.rst:1294 msgid "" "Configuration files are still used with this configuration. Set the :ref:" "`Python Path Configuration ` (\"output fields\") to ignore " @@ -1588,108 +1588,108 @@ msgid "" "configuration." msgstr "" -#: ../../c-api/init_config.rst:1304 +#: ../../c-api/init_config.rst:1303 msgid "Python Configuration" msgstr "" -#: ../../c-api/init_config.rst:1306 +#: ../../c-api/init_config.rst:1305 msgid "" ":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" "`PyConfig_InitPythonConfig` functions create a configuration to build a " "customized Python which behaves as the regular Python." msgstr "" -#: ../../c-api/init_config.rst:1310 +#: ../../c-api/init_config.rst:1309 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:1313 +#: ../../c-api/init_config.rst:1312 msgid "" "This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " "Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:" "`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables." msgstr "" -#: ../../c-api/init_config.rst:1322 +#: ../../c-api/init_config.rst:1321 msgid "Python Path Configuration" msgstr "" -#: ../../c-api/init_config.rst:1324 +#: ../../c-api/init_config.rst:1323 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1326 +#: ../../c-api/init_config.rst:1325 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:1328 +#: ../../c-api/init_config.rst:1327 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" -#: ../../c-api/init_config.rst:1329 +#: ../../c-api/init_config.rst:1328 msgid ":c:member:`PyConfig.platlibdir`" msgstr ":c:member:`PyConfig.platlibdir`" -#: ../../c-api/init_config.rst:1330 +#: ../../c-api/init_config.rst:1329 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" -#: ../../c-api/init_config.rst:1331 +#: ../../c-api/init_config.rst:1330 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" -#: ../../c-api/init_config.rst:1332 +#: ../../c-api/init_config.rst:1331 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" -#: ../../c-api/init_config.rst:1333 +#: ../../c-api/init_config.rst:1332 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:1334 +#: ../../c-api/init_config.rst:1333 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:1336 +#: ../../c-api/init_config.rst:1335 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "``__PYVENV_LAUNCHER__`` 環境變數" -#: ../../c-api/init_config.rst:1337 +#: ../../c-api/init_config.rst:1336 msgid "" "(Windows only) Application paths in the registry under \"Software\\Python" "\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE " "(where X.Y is the Python version)." msgstr "" -#: ../../c-api/init_config.rst:1341 +#: ../../c-api/init_config.rst:1340 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:1343 +#: ../../c-api/init_config.rst:1342 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:1344 +#: ../../c-api/init_config.rst:1343 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:1345 +#: ../../c-api/init_config.rst:1344 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:1346 +#: ../../c-api/init_config.rst:1345 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:1347 +#: ../../c-api/init_config.rst:1346 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:1348 +#: ../../c-api/init_config.rst:1347 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" @@ -1697,11 +1697,11 @@ msgstr "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" -#: ../../c-api/init_config.rst:1350 +#: ../../c-api/init_config.rst:1349 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:1352 +#: ../../c-api/init_config.rst:1351 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." @@ -1710,7 +1710,7 @@ msgid "" "module_search_paths_set` is set to 1." msgstr "" -#: ../../c-api/init_config.rst:1358 +#: ../../c-api/init_config.rst:1357 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -1720,52 +1720,52 @@ msgid "" "well." msgstr "" -#: ../../c-api/init_config.rst:1365 +#: ../../c-api/init_config.rst:1364 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to 0 to suppress warnings when " "calculating the path configuration (Unix only, Windows does not log any " "warning)." msgstr "" -#: ../../c-api/init_config.rst:1368 +#: ../../c-api/init_config.rst:1367 msgid "" "If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." "base_exec_prefix` fields are not set, they inherit their value from :c:" "member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." msgstr "" -#: ../../c-api/init_config.rst:1372 +#: ../../c-api/init_config.rst:1371 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: ../../c-api/init_config.rst:1374 +#: ../../c-api/init_config.rst:1373 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " "contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." "run_filename` to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1377 +#: ../../c-api/init_config.rst:1376 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: ../../c-api/init_config.rst:1379 +#: ../../c-api/init_config.rst:1378 msgid "" "If :c:member:`~PyConfig.run_module` is set, prepend the current directory " "to :data:`sys.path`. Do nothing if the current directory cannot be read." msgstr "" -#: ../../c-api/init_config.rst:1381 +#: ../../c-api/init_config.rst:1380 msgid "" "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " "filename to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1383 +#: ../../c-api/init_config.rst:1382 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1385 +#: ../../c-api/init_config.rst:1384 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " "modified by the :mod:`site` module. If :c:member:`~PyConfig." @@ -1774,156 +1774,156 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1391 +#: ../../c-api/init_config.rst:1390 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1393 +#: ../../c-api/init_config.rst:1392 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" -#: ../../c-api/init_config.rst:1394 +#: ../../c-api/init_config.rst:1393 msgid "``python._pth`` (Windows only)" msgstr "" -#: ../../c-api/init_config.rst:1395 +#: ../../c-api/init_config.rst:1394 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: ../../c-api/init_config.rst:1397 +#: ../../c-api/init_config.rst:1396 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" "`PyConfig.base_executable`" msgstr "" -#: ../../c-api/init_config.rst:1402 +#: ../../c-api/init_config.rst:1401 msgid "Py_RunMain()" msgstr "Py_RunMain()" -#: ../../c-api/init_config.rst:1406 +#: ../../c-api/init_config.rst:1405 msgid "" "Execute the command (:c:member:`PyConfig.run_command`), the script (:c:" "member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." "run_module`) specified on the command line or in the configuration." msgstr "" -#: ../../c-api/init_config.rst:1411 +#: ../../c-api/init_config.rst:1410 msgid "By default and when if :option:`-i` option is used, run the REPL." msgstr "" -#: ../../c-api/init_config.rst:1413 +#: ../../c-api/init_config.rst:1412 msgid "" "Finally, finalizes Python and returns an exit status that can be passed to " "the ``exit()`` function." msgstr "" -#: ../../c-api/init_config.rst:1416 +#: ../../c-api/init_config.rst:1415 msgid "" "See :ref:`Python Configuration ` for an example of " "customized Python always running in isolated mode using :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1422 +#: ../../c-api/init_config.rst:1421 msgid "Py_GetArgcArgv()" msgstr "Py_GetArgcArgv()" -#: ../../c-api/init_config.rst:1426 +#: ../../c-api/init_config.rst:1425 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: ../../c-api/init_config.rst:1428 +#: ../../c-api/init_config.rst:1427 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:1432 +#: ../../c-api/init_config.rst:1431 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" -#: ../../c-api/init_config.rst:1434 +#: ../../c-api/init_config.rst:1433 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of :pep:`432`:" msgstr "" -#: ../../c-api/init_config.rst:1437 +#: ../../c-api/init_config.rst:1436 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: ../../c-api/init_config.rst:1439 +#: ../../c-api/init_config.rst:1438 msgid "Builtin types;" msgstr "" -#: ../../c-api/init_config.rst:1440 +#: ../../c-api/init_config.rst:1439 msgid "Builtin exceptions;" msgstr "" -#: ../../c-api/init_config.rst:1441 +#: ../../c-api/init_config.rst:1440 msgid "Builtin and frozen modules;" msgstr "" -#: ../../c-api/init_config.rst:1442 +#: ../../c-api/init_config.rst:1441 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" -#: ../../c-api/init_config.rst:1445 +#: ../../c-api/init_config.rst:1444 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: ../../c-api/init_config.rst:1447 +#: ../../c-api/init_config.rst:1446 msgid "Install and configure :mod:`importlib`;" msgstr "" -#: ../../c-api/init_config.rst:1448 +#: ../../c-api/init_config.rst:1447 msgid "Apply the :ref:`Path Configuration `;" msgstr "" -#: ../../c-api/init_config.rst:1449 +#: ../../c-api/init_config.rst:1448 msgid "Install signal handlers;" msgstr "" -#: ../../c-api/init_config.rst:1450 +#: ../../c-api/init_config.rst:1449 msgid "" "Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" "data:`sys.path`);" msgstr "" -#: ../../c-api/init_config.rst:1452 +#: ../../c-api/init_config.rst:1451 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: ../../c-api/init_config.rst:1453 +#: ../../c-api/init_config.rst:1452 msgid "Import the :mod:`site` module;" msgstr "" -#: ../../c-api/init_config.rst:1454 +#: ../../c-api/init_config.rst:1453 msgid "etc." msgstr "" -#: ../../c-api/init_config.rst:1456 +#: ../../c-api/init_config.rst:1455 msgid "Private provisional API:" msgstr "" -#: ../../c-api/init_config.rst:1458 +#: ../../c-api/init_config.rst:1457 msgid "" ":c:member:`PyConfig._init_main`: if set to 0, :c:func:" "`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." msgstr "" -#: ../../c-api/init_config.rst:1460 +#: ../../c-api/init_config.rst:1459 msgid "" ":c:member:`PyConfig._isolated_interpreter`: if non-zero, disallow threads, " "subprocesses and fork." msgstr "" -#: ../../c-api/init_config.rst:1465 +#: ../../c-api/init_config.rst:1464 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1467 +#: ../../c-api/init_config.rst:1466 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration ` is only " @@ -1932,14 +1932,14 @@ msgid "" "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: ../../c-api/init_config.rst:1473 +#: ../../c-api/init_config.rst:1472 msgid "" "It may become possible to calculatin the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is " "one of the :pep:`432` motivation." msgstr "" -#: ../../c-api/init_config.rst:1477 +#: ../../c-api/init_config.rst:1476 msgid "" "The \"Core\" phase is not properly defined: what should be and what should " "not be available at this phase is not specified yet. The API is marked as " @@ -1947,7 +1947,7 @@ msgid "" "until a proper public API is designed." msgstr "" -#: ../../c-api/init_config.rst:1482 +#: ../../c-api/init_config.rst:1481 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" diff --git a/c-api/structures.po b/c-api/structures.po index 227a680fbf..462c781948 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2022-06-11 00:15+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-" @@ -217,18 +217,18 @@ msgid "" "has four fields:" msgstr "" -#: ../../c-api/structures.rst:239 ../../c-api/structures.rst:397 -#: ../../c-api/structures.rst:493 +#: ../../c-api/structures.rst:239 ../../c-api/structures.rst:395 +#: ../../c-api/structures.rst:491 msgid "Field" msgstr "" -#: ../../c-api/structures.rst:239 ../../c-api/structures.rst:397 -#: ../../c-api/structures.rst:493 +#: ../../c-api/structures.rst:239 ../../c-api/structures.rst:395 +#: ../../c-api/structures.rst:491 msgid "C Type" msgstr "C Type" -#: ../../c-api/structures.rst:239 ../../c-api/structures.rst:397 -#: ../../c-api/structures.rst:493 +#: ../../c-api/structures.rst:239 ../../c-api/structures.rst:395 +#: ../../c-api/structures.rst:491 msgid "Meaning" msgstr "" @@ -237,9 +237,9 @@ msgid ":attr:`ml_name`" msgstr ":attr:`ml_name`" #: ../../c-api/structures.rst:241 ../../c-api/structures.rst:249 -#: ../../c-api/structures.rst:399 ../../c-api/structures.rst:412 -#: ../../c-api/structures.rst:428 ../../c-api/structures.rst:495 -#: ../../c-api/structures.rst:503 +#: ../../c-api/structures.rst:397 ../../c-api/structures.rst:410 +#: ../../c-api/structures.rst:426 ../../c-api/structures.rst:493 +#: ../../c-api/structures.rst:501 msgid "const char \\*" msgstr "const char \\*" @@ -263,8 +263,8 @@ msgstr "" msgid ":attr:`ml_flags`" msgstr ":attr:`ml_flags`" -#: ../../c-api/structures.rst:246 ../../c-api/structures.rst:401 -#: ../../c-api/structures.rst:408 ../../c-api/structures.rst:424 +#: ../../c-api/structures.rst:246 ../../c-api/structures.rst:399 +#: ../../c-api/structures.rst:406 ../../c-api/structures.rst:422 msgid "int" msgstr "int" @@ -276,7 +276,7 @@ msgstr "" msgid ":attr:`ml_doc`" msgstr ":attr:`ml_doc`" -#: ../../c-api/structures.rst:249 ../../c-api/structures.rst:412 +#: ../../c-api/structures.rst:249 ../../c-api/structures.rst:410 msgid "points to the contents of the docstring" msgstr "" @@ -345,25 +345,21 @@ msgid "" "arguments." msgstr "" -#: ../../c-api/structures.rst:312 -msgid "This is not part of the :ref:`limited API `." -msgstr "" - -#: ../../c-api/structures.rst:319 +#: ../../c-api/structures.rst:317 msgid "" "Extension of :const:`METH_FASTCALL | METH_KEYWORDS` supporting the *defining " "class*, that is, the class that contains the method in question. The " "defining class might be a superclass of ``Py_TYPE(self)``." msgstr "" -#: ../../c-api/structures.rst:323 +#: ../../c-api/structures.rst:321 msgid "" "The method needs to be of type :c:type:`PyCMethod`, the same as for " "``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added " "after ``self``." msgstr "" -#: ../../c-api/structures.rst:332 +#: ../../c-api/structures.rst:330 msgid "" "Methods without parameters don't need to check whether arguments are given " "if they are listed with the :const:`METH_NOARGS` flag. They need to be of " @@ -372,7 +368,7 @@ msgid "" "the second parameter will be ``NULL``." msgstr "" -#: ../../c-api/structures.rst:341 +#: ../../c-api/structures.rst:339 msgid "" "Methods with a single object argument can be listed with the :const:`METH_O` " "flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``\"O\"`` " @@ -381,7 +377,7 @@ msgid "" "argument." msgstr "" -#: ../../c-api/structures.rst:347 +#: ../../c-api/structures.rst:345 msgid "" "These two constants are not used to indicate the calling convention but the " "binding when use with methods of classes. These may not be used for " @@ -389,27 +385,27 @@ msgid "" "any given method." msgstr "" -#: ../../c-api/structures.rst:357 +#: ../../c-api/structures.rst:355 msgid "" "The method will be passed the type object as the first parameter rather than " "an instance of the type. This is used to create *class methods*, similar to " "what is created when using the :func:`classmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:367 +#: ../../c-api/structures.rst:365 msgid "" "The method will be passed ``NULL`` as the first parameter rather than an " "instance of the type. This is used to create *static methods*, similar to " "what is created when using the :func:`staticmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:371 +#: ../../c-api/structures.rst:369 msgid "" "One other constant controls whether a method is loaded in place of another " "definition with the same method name." msgstr "" -#: ../../c-api/structures.rst:377 +#: ../../c-api/structures.rst:375 msgid "" "The method will be loaded in place of existing definitions. Without " "*METH_COEXIST*, the default is to skip repeated definitions. Since slot " @@ -422,194 +418,194 @@ msgid "" "calls." msgstr "" -#: ../../c-api/structures.rst:389 +#: ../../c-api/structures.rst:387 msgid "Accessing attributes of extension types" msgstr "" -#: ../../c-api/structures.rst:393 +#: ../../c-api/structures.rst:391 msgid "" "Structure which describes an attribute of a type which corresponds to a C " "struct member. Its fields are:" msgstr "" -#: ../../c-api/structures.rst:399 +#: ../../c-api/structures.rst:397 msgid ":attr:`name`" msgstr ":attr:`name`" -#: ../../c-api/structures.rst:399 +#: ../../c-api/structures.rst:397 msgid "name of the member" msgstr "" -#: ../../c-api/structures.rst:401 +#: ../../c-api/structures.rst:399 msgid ":attr:`!type`" msgstr ":attr:`!type`" -#: ../../c-api/structures.rst:401 +#: ../../c-api/structures.rst:399 msgid "the type of the member in the C struct" msgstr "" -#: ../../c-api/structures.rst:404 +#: ../../c-api/structures.rst:402 msgid ":attr:`offset`" msgstr ":attr:`offset`" -#: ../../c-api/structures.rst:404 ../../c-api/structures.rst:440 +#: ../../c-api/structures.rst:402 ../../c-api/structures.rst:438 msgid "Py_ssize_t" msgstr "Py_ssize_t" -#: ../../c-api/structures.rst:404 +#: ../../c-api/structures.rst:402 msgid "" "the offset in bytes that the member is located on the type's object struct" msgstr "" -#: ../../c-api/structures.rst:408 +#: ../../c-api/structures.rst:406 msgid ":attr:`flags`" msgstr ":attr:`flags`" -#: ../../c-api/structures.rst:408 +#: ../../c-api/structures.rst:406 msgid "flag bits indicating if the field should be read-only or writable" msgstr "" -#: ../../c-api/structures.rst:412 +#: ../../c-api/structures.rst:410 msgid ":attr:`doc`" msgstr ":attr:`doc`" -#: ../../c-api/structures.rst:416 +#: ../../c-api/structures.rst:414 msgid "" ":attr:`!type` can be one of many ``T_`` macros corresponding to various C " "types. When the member is accessed in Python, it will be converted to the " "equivalent Python type." msgstr "" -#: ../../c-api/structures.rst:421 +#: ../../c-api/structures.rst:419 msgid "Macro name" msgstr "" -#: ../../c-api/structures.rst:421 +#: ../../c-api/structures.rst:419 msgid "C type" msgstr "" -#: ../../c-api/structures.rst:423 +#: ../../c-api/structures.rst:421 msgid "T_SHORT" msgstr "T_SHORT" -#: ../../c-api/structures.rst:423 +#: ../../c-api/structures.rst:421 msgid "short" msgstr "" -#: ../../c-api/structures.rst:424 +#: ../../c-api/structures.rst:422 msgid "T_INT" msgstr "T_INT" -#: ../../c-api/structures.rst:425 +#: ../../c-api/structures.rst:423 msgid "T_LONG" msgstr "T_LONG" -#: ../../c-api/structures.rst:425 +#: ../../c-api/structures.rst:423 msgid "long" msgstr "long" -#: ../../c-api/structures.rst:426 +#: ../../c-api/structures.rst:424 msgid "T_FLOAT" msgstr "T_FLOAT" -#: ../../c-api/structures.rst:426 +#: ../../c-api/structures.rst:424 msgid "float" msgstr "float" -#: ../../c-api/structures.rst:427 +#: ../../c-api/structures.rst:425 msgid "T_DOUBLE" msgstr "T_DOUBLE" -#: ../../c-api/structures.rst:427 +#: ../../c-api/structures.rst:425 msgid "double" msgstr "double" -#: ../../c-api/structures.rst:428 +#: ../../c-api/structures.rst:426 msgid "T_STRING" msgstr "T_STRING" -#: ../../c-api/structures.rst:429 +#: ../../c-api/structures.rst:427 msgid "T_OBJECT" msgstr "T_OBJECT" -#: ../../c-api/structures.rst:429 ../../c-api/structures.rst:430 +#: ../../c-api/structures.rst:427 ../../c-api/structures.rst:428 msgid "PyObject \\*" msgstr "PyObject \\*" -#: ../../c-api/structures.rst:430 +#: ../../c-api/structures.rst:428 msgid "T_OBJECT_EX" msgstr "T_OBJECT_EX" -#: ../../c-api/structures.rst:431 +#: ../../c-api/structures.rst:429 msgid "T_CHAR" msgstr "T_CHAR" -#: ../../c-api/structures.rst:431 ../../c-api/structures.rst:432 -#: ../../c-api/structures.rst:437 +#: ../../c-api/structures.rst:429 ../../c-api/structures.rst:430 +#: ../../c-api/structures.rst:435 msgid "char" msgstr "char" -#: ../../c-api/structures.rst:432 +#: ../../c-api/structures.rst:430 msgid "T_BYTE" msgstr "T_BYTE" -#: ../../c-api/structures.rst:433 +#: ../../c-api/structures.rst:431 msgid "T_UBYTE" msgstr "T_UBYTE" -#: ../../c-api/structures.rst:433 +#: ../../c-api/structures.rst:431 msgid "unsigned char" msgstr "unsigned char" -#: ../../c-api/structures.rst:434 +#: ../../c-api/structures.rst:432 msgid "T_UINT" msgstr "T_UINT" -#: ../../c-api/structures.rst:434 +#: ../../c-api/structures.rst:432 msgid "unsigned int" msgstr "unsigned int" -#: ../../c-api/structures.rst:435 +#: ../../c-api/structures.rst:433 msgid "T_USHORT" msgstr "T_USHORT" -#: ../../c-api/structures.rst:435 +#: ../../c-api/structures.rst:433 msgid "unsigned short" msgstr "unsigned short" -#: ../../c-api/structures.rst:436 +#: ../../c-api/structures.rst:434 msgid "T_ULONG" msgstr "T_ULONG" -#: ../../c-api/structures.rst:436 +#: ../../c-api/structures.rst:434 msgid "unsigned long" msgstr "unsigned long" -#: ../../c-api/structures.rst:437 +#: ../../c-api/structures.rst:435 msgid "T_BOOL" msgstr "T_BOOL" -#: ../../c-api/structures.rst:438 +#: ../../c-api/structures.rst:436 msgid "T_LONGLONG" msgstr "T_LONGLONG" -#: ../../c-api/structures.rst:438 +#: ../../c-api/structures.rst:436 msgid "long long" msgstr "long long" -#: ../../c-api/structures.rst:439 +#: ../../c-api/structures.rst:437 msgid "T_ULONGLONG" msgstr "T_ULONGLONG" -#: ../../c-api/structures.rst:439 +#: ../../c-api/structures.rst:437 msgid "unsigned long long" msgstr "unsigned long long" -#: ../../c-api/structures.rst:440 +#: ../../c-api/structures.rst:438 msgid "T_PYSSIZET" msgstr "T_PYSSIZET" -#: ../../c-api/structures.rst:443 +#: ../../c-api/structures.rst:441 msgid "" ":c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` differ in that :c:macro:" "`T_OBJECT` returns ``None`` if the member is ``NULL`` and :c:macro:" @@ -619,7 +615,7 @@ msgid "" "than :c:macro:`T_OBJECT`." msgstr "" -#: ../../c-api/structures.rst:450 +#: ../../c-api/structures.rst:448 msgid "" ":attr:`flags` can be ``0`` for write and read access or :c:macro:`READONLY` " "for read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies :c:" @@ -628,7 +624,7 @@ msgid "" "are set to ``NULL``)." msgstr "" -#: ../../c-api/structures.rst:458 +#: ../../c-api/structures.rst:456 msgid "" "Heap allocated types (created using :c:func:`PyType_FromSpec` or similar), " "``PyMemberDef`` may contain definitions for the special members " @@ -639,99 +635,99 @@ msgid "" "``T_PYSSIZET`` and ``READONLY``, for example::" msgstr "" -#: ../../c-api/structures.rst:475 +#: ../../c-api/structures.rst:473 msgid "" "Get an attribute belonging to the object at address *obj_addr*. The " "attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" -#: ../../c-api/structures.rst:482 +#: ../../c-api/structures.rst:480 msgid "" "Set an attribute belonging to the object at address *obj_addr* to object " "*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " "``0`` if successful and a negative value on failure." msgstr "" -#: ../../c-api/structures.rst:489 +#: ../../c-api/structures.rst:487 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:495 +#: ../../c-api/structures.rst:493 msgid "name" msgstr "" -#: ../../c-api/structures.rst:495 +#: ../../c-api/structures.rst:493 msgid "attribute name" msgstr "" -#: ../../c-api/structures.rst:497 +#: ../../c-api/structures.rst:495 msgid "get" msgstr "" -#: ../../c-api/structures.rst:497 +#: ../../c-api/structures.rst:495 msgid "getter" msgstr "" -#: ../../c-api/structures.rst:497 +#: ../../c-api/structures.rst:495 msgid "C function to get the attribute" msgstr "" -#: ../../c-api/structures.rst:499 +#: ../../c-api/structures.rst:497 msgid "set" msgstr "" -#: ../../c-api/structures.rst:499 +#: ../../c-api/structures.rst:497 msgid "setter" msgstr "" -#: ../../c-api/structures.rst:499 +#: ../../c-api/structures.rst:497 msgid "" "optional C function to set or delete the attribute, if omitted the attribute " "is readonly" msgstr "" -#: ../../c-api/structures.rst:503 +#: ../../c-api/structures.rst:501 msgid "doc" msgstr "" -#: ../../c-api/structures.rst:503 +#: ../../c-api/structures.rst:501 msgid "optional docstring" msgstr "" -#: ../../c-api/structures.rst:505 +#: ../../c-api/structures.rst:503 msgid "closure" msgstr "" -#: ../../c-api/structures.rst:505 +#: ../../c-api/structures.rst:503 msgid "void \\*" msgstr "void \\*" -#: ../../c-api/structures.rst:505 +#: ../../c-api/structures.rst:503 msgid "" "optional function pointer, providing additional data for getter and setter" msgstr "" -#: ../../c-api/structures.rst:510 +#: ../../c-api/structures.rst:508 msgid "" "The ``get`` function takes one :c:type:`PyObject*` parameter (the instance) " "and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:515 +#: ../../c-api/structures.rst:513 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:518 +#: ../../c-api/structures.rst:516 msgid "" "``set`` functions take two :c:type:`PyObject*` parameters (the instance and " "the value to be set) and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:523 +#: ../../c-api/structures.rst:521 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." diff --git a/c-api/typeobj.po b/c-api/typeobj.po index fc315f9677..a24a7a806f 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-30 00:18+0000\n" +"POT-Creation-Date: 2022-06-11 00:15+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-" @@ -1164,34 +1164,34 @@ msgstr "" #: ../../c-api/typeobj.rst:494 ../../c-api/typeobj.rst:517 #: ../../c-api/typeobj.rst:539 ../../c-api/typeobj.rst:553 #: ../../c-api/typeobj.rst:597 ../../c-api/typeobj.rst:640 -#: ../../c-api/typeobj.rst:698 ../../c-api/typeobj.rst:742 -#: ../../c-api/typeobj.rst:761 ../../c-api/typeobj.rst:778 -#: ../../c-api/typeobj.rst:796 ../../c-api/typeobj.rst:820 -#: ../../c-api/typeobj.rst:837 ../../c-api/typeobj.rst:849 -#: ../../c-api/typeobj.rst:861 ../../c-api/typeobj.rst:894 -#: ../../c-api/typeobj.rst:912 ../../c-api/typeobj.rst:932 -#: ../../c-api/typeobj.rst:953 ../../c-api/typeobj.rst:979 -#: ../../c-api/typeobj.rst:998 ../../c-api/typeobj.rst:1014 -#: ../../c-api/typeobj.rst:1051 ../../c-api/typeobj.rst:1062 -#: ../../c-api/typeobj.rst:1072 ../../c-api/typeobj.rst:1082 -#: ../../c-api/typeobj.rst:1096 ../../c-api/typeobj.rst:1114 -#: ../../c-api/typeobj.rst:1137 ../../c-api/typeobj.rst:1184 -#: ../../c-api/typeobj.rst:1199 ../../c-api/typeobj.rst:1218 -#: ../../c-api/typeobj.rst:1237 ../../c-api/typeobj.rst:1259 -#: ../../c-api/typeobj.rst:1275 ../../c-api/typeobj.rst:1343 -#: ../../c-api/typeobj.rst:1410 ../../c-api/typeobj.rst:1469 -#: ../../c-api/typeobj.rst:1499 ../../c-api/typeobj.rst:1531 -#: ../../c-api/typeobj.rst:1554 ../../c-api/typeobj.rst:1567 -#: ../../c-api/typeobj.rst:1582 ../../c-api/typeobj.rst:1596 -#: ../../c-api/typeobj.rst:1626 ../../c-api/typeobj.rst:1646 -#: ../../c-api/typeobj.rst:1672 ../../c-api/typeobj.rst:1690 -#: ../../c-api/typeobj.rst:1730 ../../c-api/typeobj.rst:1781 -#: ../../c-api/typeobj.rst:1798 ../../c-api/typeobj.rst:1839 -#: ../../c-api/typeobj.rst:1861 ../../c-api/typeobj.rst:1893 -#: ../../c-api/typeobj.rst:1910 ../../c-api/typeobj.rst:1921 -#: ../../c-api/typeobj.rst:1931 ../../c-api/typeobj.rst:1940 -#: ../../c-api/typeobj.rst:1950 ../../c-api/typeobj.rst:1964 -#: ../../c-api/typeobj.rst:2013 ../../c-api/typeobj.rst:2030 +#: ../../c-api/typeobj.rst:698 ../../c-api/typeobj.rst:736 +#: ../../c-api/typeobj.rst:755 ../../c-api/typeobj.rst:772 +#: ../../c-api/typeobj.rst:790 ../../c-api/typeobj.rst:814 +#: ../../c-api/typeobj.rst:831 ../../c-api/typeobj.rst:843 +#: ../../c-api/typeobj.rst:855 ../../c-api/typeobj.rst:888 +#: ../../c-api/typeobj.rst:906 ../../c-api/typeobj.rst:926 +#: ../../c-api/typeobj.rst:947 ../../c-api/typeobj.rst:973 +#: ../../c-api/typeobj.rst:992 ../../c-api/typeobj.rst:1008 +#: ../../c-api/typeobj.rst:1045 ../../c-api/typeobj.rst:1056 +#: ../../c-api/typeobj.rst:1066 ../../c-api/typeobj.rst:1076 +#: ../../c-api/typeobj.rst:1090 ../../c-api/typeobj.rst:1108 +#: ../../c-api/typeobj.rst:1131 ../../c-api/typeobj.rst:1178 +#: ../../c-api/typeobj.rst:1193 ../../c-api/typeobj.rst:1212 +#: ../../c-api/typeobj.rst:1231 ../../c-api/typeobj.rst:1253 +#: ../../c-api/typeobj.rst:1269 ../../c-api/typeobj.rst:1337 +#: ../../c-api/typeobj.rst:1404 ../../c-api/typeobj.rst:1463 +#: ../../c-api/typeobj.rst:1493 ../../c-api/typeobj.rst:1525 +#: ../../c-api/typeobj.rst:1548 ../../c-api/typeobj.rst:1561 +#: ../../c-api/typeobj.rst:1576 ../../c-api/typeobj.rst:1590 +#: ../../c-api/typeobj.rst:1620 ../../c-api/typeobj.rst:1640 +#: ../../c-api/typeobj.rst:1666 ../../c-api/typeobj.rst:1684 +#: ../../c-api/typeobj.rst:1724 ../../c-api/typeobj.rst:1775 +#: ../../c-api/typeobj.rst:1792 ../../c-api/typeobj.rst:1833 +#: ../../c-api/typeobj.rst:1855 ../../c-api/typeobj.rst:1887 +#: ../../c-api/typeobj.rst:1904 ../../c-api/typeobj.rst:1915 +#: ../../c-api/typeobj.rst:1925 ../../c-api/typeobj.rst:1934 +#: ../../c-api/typeobj.rst:1944 ../../c-api/typeobj.rst:1958 +#: ../../c-api/typeobj.rst:2007 ../../c-api/typeobj.rst:2024 msgid "**Inheritance:**" msgstr "" @@ -1221,11 +1221,11 @@ msgid "" msgstr "" #: ../../c-api/typeobj.rst:519 ../../c-api/typeobj.rst:700 -#: ../../c-api/typeobj.rst:822 ../../c-api/typeobj.rst:914 -#: ../../c-api/typeobj.rst:934 ../../c-api/typeobj.rst:1533 -#: ../../c-api/typeobj.rst:1556 ../../c-api/typeobj.rst:1674 -#: ../../c-api/typeobj.rst:1692 ../../c-api/typeobj.rst:1783 -#: ../../c-api/typeobj.rst:1895 ../../c-api/typeobj.rst:2015 +#: ../../c-api/typeobj.rst:816 ../../c-api/typeobj.rst:908 +#: ../../c-api/typeobj.rst:928 ../../c-api/typeobj.rst:1527 +#: ../../c-api/typeobj.rst:1550 ../../c-api/typeobj.rst:1668 +#: ../../c-api/typeobj.rst:1686 ../../c-api/typeobj.rst:1777 +#: ../../c-api/typeobj.rst:1889 ../../c-api/typeobj.rst:2009 msgid "This field is inherited by subtypes." msgstr "" @@ -1467,18 +1467,11 @@ msgstr "" #: ../../c-api/typeobj.rst:732 msgid "" -"The semantics of the ``tp_vectorcall_offset`` slot are provisional and " -"expected to be finalized in Python 3.9. If you use vectorcall, plan for " -"updating your code for Python 3.9." -msgstr "" - -#: ../../c-api/typeobj.rst:738 -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:744 +#: ../../c-api/typeobj.rst:738 msgid "" "This field is always inherited. However, the :const:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not, then " @@ -1487,11 +1480,11 @@ msgid "" "for :ref:`heap types ` (including subclasses defined in Python)." msgstr "" -#: ../../c-api/typeobj.rst:755 +#: ../../c-api/typeobj.rst:749 msgid "An optional pointer to the get-attribute-string function." msgstr "" -#: ../../c-api/typeobj.rst:757 +#: ../../c-api/typeobj.rst:751 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, " @@ -1499,11 +1492,11 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:763 ../../c-api/typeobj.rst:955 +#: ../../c-api/typeobj.rst:757 ../../c-api/typeobj.rst:949 msgid "Group: :attr:`tp_getattr`, :attr:`tp_getattro`" msgstr "" -#: ../../c-api/typeobj.rst:765 +#: ../../c-api/typeobj.rst:759 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1512,12 +1505,12 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:772 ../../c-api/typeobj.rst:968 +#: ../../c-api/typeobj.rst:766 ../../c-api/typeobj.rst:962 msgid "" "An optional pointer to the function for setting and deleting attributes." msgstr "" -#: ../../c-api/typeobj.rst:774 +#: ../../c-api/typeobj.rst:768 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, " @@ -1525,11 +1518,11 @@ msgid "" "attribute name." msgstr "" -#: ../../c-api/typeobj.rst:780 ../../c-api/typeobj.rst:981 +#: ../../c-api/typeobj.rst:774 ../../c-api/typeobj.rst:975 msgid "Group: :attr:`tp_setattr`, :attr:`tp_setattro`" msgstr "" -#: ../../c-api/typeobj.rst:782 +#: ../../c-api/typeobj.rst:776 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1538,34 +1531,34 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:789 +#: ../../c-api/typeobj.rst:783 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:793 +#: ../../c-api/typeobj.rst:787 msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." msgstr "" -#: ../../c-api/typeobj.rst:798 +#: ../../c-api/typeobj.rst:792 msgid "" "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:806 +#: ../../c-api/typeobj.rst:800 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`repr`." msgstr "" -#: ../../c-api/typeobj.rst:809 +#: ../../c-api/typeobj.rst:803 msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "" -#: ../../c-api/typeobj.rst:813 +#: ../../c-api/typeobj.rst:807 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 " @@ -1574,87 +1567,87 @@ msgid "" "``'>'`` from which both the type and the value of the object can be deduced." msgstr "" -#: ../../c-api/typeobj.rst:824 ../../c-api/typeobj.rst:936 -#: ../../c-api/typeobj.rst:961 ../../c-api/typeobj.rst:987 -#: ../../c-api/typeobj.rst:1029 ../../c-api/typeobj.rst:1478 -#: ../../c-api/typeobj.rst:1630 ../../c-api/typeobj.rst:1651 -#: ../../c-api/typeobj.rst:1749 ../../c-api/typeobj.rst:1785 -#: ../../c-api/typeobj.rst:1803 ../../c-api/typeobj.rst:1845 -#: ../../c-api/typeobj.rst:1866 ../../c-api/typeobj.rst:1897 +#: ../../c-api/typeobj.rst:818 ../../c-api/typeobj.rst:930 +#: ../../c-api/typeobj.rst:955 ../../c-api/typeobj.rst:981 +#: ../../c-api/typeobj.rst:1023 ../../c-api/typeobj.rst:1472 +#: ../../c-api/typeobj.rst:1624 ../../c-api/typeobj.rst:1645 +#: ../../c-api/typeobj.rst:1743 ../../c-api/typeobj.rst:1779 +#: ../../c-api/typeobj.rst:1797 ../../c-api/typeobj.rst:1839 +#: ../../c-api/typeobj.rst:1860 ../../c-api/typeobj.rst:1891 msgid "**Default:**" msgstr "**預設:**" -#: ../../c-api/typeobj.rst:826 +#: ../../c-api/typeobj.rst:820 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:833 +#: ../../c-api/typeobj.rst:827 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:839 +#: ../../c-api/typeobj.rst:833 msgid "" "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:845 +#: ../../c-api/typeobj.rst:839 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:851 +#: ../../c-api/typeobj.rst:845 msgid "" "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:857 +#: ../../c-api/typeobj.rst:851 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:863 +#: ../../c-api/typeobj.rst:857 msgid "" "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:871 +#: ../../c-api/typeobj.rst:865 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`hash`." msgstr "" -#: ../../c-api/typeobj.rst:874 +#: ../../c-api/typeobj.rst:868 msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "" -#: ../../c-api/typeobj.rst:878 +#: ../../c-api/typeobj.rst:872 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:882 +#: ../../c-api/typeobj.rst:876 msgid "" "When this field is not set (*and* :attr:`tp_richcompare` is not set), an " "attempt to take the hash of the object raises :exc:`TypeError`. This is the " "same as setting it to :c:func:`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:886 +#: ../../c-api/typeobj.rst:880 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 " @@ -1665,11 +1658,11 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:896 ../../c-api/typeobj.rst:1471 +#: ../../c-api/typeobj.rst:890 ../../c-api/typeobj.rst:1465 msgid "Group: :attr:`tp_hash`, :attr:`tp_richcompare`" msgstr "" -#: ../../c-api/typeobj.rst:898 +#: ../../c-api/typeobj.rst:892 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." @@ -1678,14 +1671,14 @@ msgid "" "are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:906 +#: ../../c-api/typeobj.rst:900 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:919 +#: ../../c-api/typeobj.rst:913 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 " @@ -1694,11 +1687,11 @@ msgid "" "this handler.)" msgstr "" -#: ../../c-api/typeobj.rst:924 +#: ../../c-api/typeobj.rst:918 msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "" -#: ../../c-api/typeobj.rst:928 +#: ../../c-api/typeobj.rst:922 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 " @@ -1706,28 +1699,28 @@ msgid "" "function." msgstr "" -#: ../../c-api/typeobj.rst:938 +#: ../../c-api/typeobj.rst:932 msgid "" "When this field is not set, :c:func:`PyObject_Repr` is called to return a " "string representation." msgstr "" -#: ../../c-api/typeobj.rst:944 +#: ../../c-api/typeobj.rst:938 msgid "An optional pointer to the get-attribute function." msgstr "" -#: ../../c-api/typeobj.rst:946 +#: ../../c-api/typeobj.rst:940 msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:950 +#: ../../c-api/typeobj.rst:944 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:957 +#: ../../c-api/typeobj.rst:951 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1736,15 +1729,15 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:963 +#: ../../c-api/typeobj.rst:957 msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:970 +#: ../../c-api/typeobj.rst:964 msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:974 +#: ../../c-api/typeobj.rst:968 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:" @@ -1752,7 +1745,7 @@ msgid "" "attributes." msgstr "" -#: ../../c-api/typeobj.rst:983 +#: ../../c-api/typeobj.rst:977 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1761,24 +1754,24 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:989 +#: ../../c-api/typeobj.rst:983 msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:994 +#: ../../c-api/typeobj.rst:988 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:1000 +#: ../../c-api/typeobj.rst:994 msgid "" "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:1006 +#: ../../c-api/typeobj.rst:1000 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 " @@ -1790,7 +1783,7 @@ msgid "" "accessed and must be considered to have a zero or ``NULL`` value instead." msgstr "" -#: ../../c-api/typeobj.rst:1016 +#: ../../c-api/typeobj.rst:1010 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 " @@ -1805,17 +1798,17 @@ msgid "" "the subtype exist and have ``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1031 +#: ../../c-api/typeobj.rst:1025 msgid "" ":c:type:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." msgstr "" -#: ../../c-api/typeobj.rst:1034 +#: ../../c-api/typeobj.rst:1028 msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1036 +#: ../../c-api/typeobj.rst:1030 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." @@ -1824,7 +1817,7 @@ msgid "" "zero." msgstr "" -#: ../../c-api/typeobj.rst:1043 +#: ../../c-api/typeobj.rst:1037 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 " @@ -1835,32 +1828,32 @@ msgid "" "gets INCREF'ed or DECREF'ed)." msgstr "" -#: ../../c-api/typeobj.rst:1053 ../../c-api/typeobj.rst:1064 -#: ../../c-api/typeobj.rst:1074 ../../c-api/typeobj.rst:1084 -#: ../../c-api/typeobj.rst:1116 +#: ../../c-api/typeobj.rst:1047 ../../c-api/typeobj.rst:1058 +#: ../../c-api/typeobj.rst:1068 ../../c-api/typeobj.rst:1078 +#: ../../c-api/typeobj.rst:1110 msgid "???" msgstr "" -#: ../../c-api/typeobj.rst:1058 +#: ../../c-api/typeobj.rst:1052 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:1069 +#: ../../c-api/typeobj.rst:1063 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1079 +#: ../../c-api/typeobj.rst:1073 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: ../../c-api/typeobj.rst:1089 +#: ../../c-api/typeobj.rst:1083 msgid "" "This bit is set when the object supports garbage collection. If this bit is " "set, instances must be created using :c:func:`PyObject_GC_New` and destroyed " @@ -1870,13 +1863,13 @@ msgid "" "tp_clear` are present in the type object." msgstr "" -#: ../../c-api/typeobj.rst:1098 ../../c-api/typeobj.rst:1345 -#: ../../c-api/typeobj.rst:1412 +#: ../../c-api/typeobj.rst:1092 ../../c-api/typeobj.rst:1339 +#: ../../c-api/typeobj.rst:1406 msgid "" "Group: :const:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1100 +#: ../../c-api/typeobj.rst:1094 msgid "" "The :const:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :" "attr:`tp_traverse` and :attr:`tp_clear` fields, i.e. if the :const:" @@ -1885,48 +1878,48 @@ msgid "" "``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1110 +#: ../../c-api/typeobj.rst:1104 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: :const:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgstr "" -#: ../../c-api/typeobj.rst:1121 +#: ../../c-api/typeobj.rst:1115 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1123 +#: ../../c-api/typeobj.rst:1117 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: ../../c-api/typeobj.rst:1125 +#: ../../c-api/typeobj.rst:1119 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1128 +#: ../../c-api/typeobj.rst:1122 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1131 +#: ../../c-api/typeobj.rst:1125 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:1139 +#: ../../c-api/typeobj.rst:1133 msgid "" "This flag is never inherited by :ref:`heap types `. For " "extension types, it is inherited whenever :c:member:`~PyTypeObject." "tp_descr_get` is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1156 +#: ../../c-api/typeobj.rst:1150 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 " @@ -1936,68 +1929,68 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: ../../c-api/typeobj.rst:1167 +#: ../../c-api/typeobj.rst:1161 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1172 +#: ../../c-api/typeobj.rst:1166 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:1180 +#: ../../c-api/typeobj.rst:1174 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:1186 +#: ../../c-api/typeobj.rst:1180 msgid "" "This bit is inherited for :ref:`static subtypes ` if :c:member:" "`~PyTypeObject.tp_call` is also inherited. :ref:`Heap types ` do " "not inherit ``Py_TPFLAGS_HAVE_VECTORCALL``." msgstr "" -#: ../../c-api/typeobj.rst:1194 +#: ../../c-api/typeobj.rst:1188 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: ../../c-api/typeobj.rst:1196 +#: ../../c-api/typeobj.rst:1190 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: ../../c-api/typeobj.rst:1201 ../../c-api/typeobj.rst:1220 +#: ../../c-api/typeobj.rst:1195 ../../c-api/typeobj.rst:1214 msgid "This flag is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1207 +#: ../../c-api/typeobj.rst:1201 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:1211 +#: ../../c-api/typeobj.rst:1205 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:1214 +#: ../../c-api/typeobj.rst:1208 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:1227 +#: ../../c-api/typeobj.rst:1221 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 " @@ -2005,23 +1998,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: ../../c-api/typeobj.rst:1234 ../../c-api/typeobj.rst:1256 +#: ../../c-api/typeobj.rst:1228 ../../c-api/typeobj.rst:1250 msgid "" ":const:`Py_TPFLAGS_MAPPING` and :const:`Py_TPFLAGS_SEQUENCE` are mutually " "exclusive; it is an error to enable both flags simultaneously." msgstr "" -#: ../../c-api/typeobj.rst:1239 +#: ../../c-api/typeobj.rst:1233 msgid "" "This flag is inherited by types that do not already set :const:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: ../../c-api/typeobj.rst:1242 ../../c-api/typeobj.rst:1264 +#: ../../c-api/typeobj.rst:1236 ../../c-api/typeobj.rst:1258 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../c-api/typeobj.rst:1249 +#: ../../c-api/typeobj.rst:1243 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 " @@ -2029,37 +2022,37 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: ../../c-api/typeobj.rst:1261 +#: ../../c-api/typeobj.rst:1255 msgid "" "This flag is inherited by types that do not already set :const:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: ../../c-api/typeobj.rst:1271 +#: ../../c-api/typeobj.rst:1265 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:1277 +#: ../../c-api/typeobj.rst:1271 msgid "This field is *not* inherited by subtypes." msgstr "" -#: ../../c-api/typeobj.rst:1282 +#: ../../c-api/typeobj.rst:1276 msgid "" "An optional pointer to a traversal function for the garbage collector. This " "is only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1287 ../../c-api/typeobj.rst:1407 +#: ../../c-api/typeobj.rst:1281 ../../c-api/typeobj.rst:1401 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1290 +#: ../../c-api/typeobj.rst:1284 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2069,7 +2062,7 @@ msgid "" "`_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1305 +#: ../../c-api/typeobj.rst:1299 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`` " @@ -2077,14 +2070,14 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../c-api/typeobj.rst:1309 +#: ../../c-api/typeobj.rst:1303 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:1314 +#: ../../c-api/typeobj.rst:1308 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:" @@ -2113,14 +2106,14 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1338 +#: ../../c-api/typeobj.rst:1332 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:1347 +#: ../../c-api/typeobj.rst:1341 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_clear` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2128,14 +2121,14 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1355 +#: ../../c-api/typeobj.rst:1349 msgid "" "An optional pointer to a clear function for the garbage collector. This is " "only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The signature " "is::" msgstr "" -#: ../../c-api/typeobj.rst:1360 +#: ../../c-api/typeobj.rst:1354 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " "reference cycles in cyclic garbage detected by the garbage collector. Taken " @@ -2150,7 +2143,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1370 +#: ../../c-api/typeobj.rst:1364 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2158,7 +2151,7 @@ msgid "" "example::" msgstr "" -#: ../../c-api/typeobj.rst:1384 +#: ../../c-api/typeobj.rst:1378 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 " @@ -2173,7 +2166,7 @@ msgid "" "in a safe order." msgstr "" -#: ../../c-api/typeobj.rst:1395 +#: ../../c-api/typeobj.rst:1389 msgid "" "Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " "an instance is deallocated. For example, when reference counting is enough " @@ -2181,7 +2174,7 @@ msgid "" "is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." msgstr "" -#: ../../c-api/typeobj.rst:1401 +#: ../../c-api/typeobj.rst:1395 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 " @@ -2191,7 +2184,7 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1414 +#: ../../c-api/typeobj.rst:1408 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_traverse` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2199,18 +2192,18 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1422 +#: ../../c-api/typeobj.rst:1416 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1426 +#: ../../c-api/typeobj.rst:1420 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:1429 +#: ../../c-api/typeobj.rst:1423 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2218,74 +2211,74 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1434 +#: ../../c-api/typeobj.rst:1428 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:1438 +#: ../../c-api/typeobj.rst:1432 msgid "Constant" msgstr "常數" -#: ../../c-api/typeobj.rst:1438 +#: ../../c-api/typeobj.rst:1432 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1440 +#: ../../c-api/typeobj.rst:1434 msgid ":const:`Py_LT`" msgstr ":const:`Py_LT`" -#: ../../c-api/typeobj.rst:1440 +#: ../../c-api/typeobj.rst:1434 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1442 +#: ../../c-api/typeobj.rst:1436 msgid ":const:`Py_LE`" msgstr ":const:`Py_LE`" -#: ../../c-api/typeobj.rst:1442 +#: ../../c-api/typeobj.rst:1436 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1444 +#: ../../c-api/typeobj.rst:1438 msgid ":const:`Py_EQ`" msgstr ":const:`Py_EQ`" -#: ../../c-api/typeobj.rst:1444 +#: ../../c-api/typeobj.rst:1438 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1446 +#: ../../c-api/typeobj.rst:1440 msgid ":const:`Py_NE`" msgstr ":const:`Py_NE`" -#: ../../c-api/typeobj.rst:1446 +#: ../../c-api/typeobj.rst:1440 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1448 +#: ../../c-api/typeobj.rst:1442 msgid ":const:`Py_GT`" msgstr ":const:`Py_GT`" -#: ../../c-api/typeobj.rst:1448 +#: ../../c-api/typeobj.rst:1442 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1450 +#: ../../c-api/typeobj.rst:1444 msgid ":const:`Py_GE`" msgstr ":const:`Py_GE`" -#: ../../c-api/typeobj.rst:1450 +#: ../../c-api/typeobj.rst:1444 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1453 +#: ../../c-api/typeobj.rst:1447 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1457 +#: ../../c-api/typeobj.rst:1451 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 " @@ -2293,15 +2286,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1463 +#: ../../c-api/typeobj.rst:1457 msgid "The return value's reference count is properly incremented." msgstr "" -#: ../../c-api/typeobj.rst:1465 +#: ../../c-api/typeobj.rst:1459 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1473 +#: ../../c-api/typeobj.rst:1467 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2309,7 +2302,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1480 +#: ../../c-api/typeobj.rst:1474 msgid "" ":c:type:`PyBaseObject_Type` provides a :attr:`tp_richcompare` " "implementation, which may be inherited. However, if only :attr:`tp_hash` is " @@ -2317,7 +2310,7 @@ msgid "" "will not be able to participate in any comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1489 +#: ../../c-api/typeobj.rst:1483 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 " @@ -2327,13 +2320,13 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1496 +#: ../../c-api/typeobj.rst:1490 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:1501 +#: ../../c-api/typeobj.rst:1495 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 " @@ -2342,7 +2335,7 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1506 +#: ../../c-api/typeobj.rst:1500 msgid "" "When a type defined by a class statement has no :attr:`~object.__slots__` " "declaration, and none of its base types are weakly referenceable, the type " @@ -2351,7 +2344,7 @@ msgid "" "tp_weaklistoffset` of that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1511 +#: ../../c-api/typeobj.rst:1505 msgid "" "When a type's :attr:`__slots__` declaration contains a slot named :attr:" "`__weakref__`, that slot becomes the weak reference list head for instances " @@ -2359,31 +2352,31 @@ msgid "" "`~PyTypeObject.tp_weaklistoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1516 +#: ../../c-api/typeobj.rst:1510 msgid "" "When a type's :attr:`__slots__` declaration does not contain a slot named :" "attr:`__weakref__`, the type inherits its :c:member:`~PyTypeObject." "tp_weaklistoffset` from its base type." msgstr "" -#: ../../c-api/typeobj.rst:1523 +#: ../../c-api/typeobj.rst:1517 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:1527 +#: ../../c-api/typeobj.rst:1521 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1538 +#: ../../c-api/typeobj.rst:1532 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1543 +#: ../../c-api/typeobj.rst:1537 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2391,74 +2384,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1548 +#: ../../c-api/typeobj.rst:1542 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:1552 +#: ../../c-api/typeobj.rst:1546 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1561 +#: ../../c-api/typeobj.rst:1555 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:1564 +#: ../../c-api/typeobj.rst:1558 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:1569 +#: ../../c-api/typeobj.rst:1563 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1575 +#: ../../c-api/typeobj.rst:1569 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:1579 +#: ../../c-api/typeobj.rst:1573 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:1584 +#: ../../c-api/typeobj.rst:1578 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1590 +#: ../../c-api/typeobj.rst:1584 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:1593 +#: ../../c-api/typeobj.rst:1587 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:1598 +#: ../../c-api/typeobj.rst:1592 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1604 +#: ../../c-api/typeobj.rst:1598 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2466,7 +2459,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1612 +#: ../../c-api/typeobj.rst:1606 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2474,7 +2467,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1617 +#: ../../c-api/typeobj.rst:1611 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "func:`PyBaseObject_Type` is not required to produce an address constant. " @@ -2482,27 +2475,27 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1623 +#: ../../c-api/typeobj.rst:1617 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1628 +#: ../../c-api/typeobj.rst:1622 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1632 +#: ../../c-api/typeobj.rst:1626 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1638 +#: ../../c-api/typeobj.rst:1632 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1640 +#: ../../c-api/typeobj.rst:1634 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -2511,45 +2504,45 @@ msgid "" "they don't correspond to overloaded operations (like :meth:`__add__`)." msgstr "" -#: ../../c-api/typeobj.rst:1648 +#: ../../c-api/typeobj.rst:1642 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:1653 +#: ../../c-api/typeobj.rst:1647 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1658 +#: ../../c-api/typeobj.rst:1652 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:1664 +#: ../../c-api/typeobj.rst:1658 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1666 ../../c-api/typeobj.rst:1682 -#: ../../c-api/typeobj.rst:1764 ../../c-api/typeobj.rst:1794 -#: ../../c-api/typeobj.rst:1818 +#: ../../c-api/typeobj.rst:1660 ../../c-api/typeobj.rst:1676 +#: ../../c-api/typeobj.rst:1758 ../../c-api/typeobj.rst:1788 +#: ../../c-api/typeobj.rst:1812 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1679 +#: ../../c-api/typeobj.rst:1673 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1686 +#: ../../c-api/typeobj.rst:1680 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:1697 +#: ../../c-api/typeobj.rst:1691 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 " @@ -2557,13 +2550,13 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1702 +#: ../../c-api/typeobj.rst:1696 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:1705 +#: ../../c-api/typeobj.rst:1699 msgid "" "If the value of this field is greater than zero, it specifies the offset " "from the start of the instance structure. If the value is less than zero, " @@ -2579,13 +2572,13 @@ msgid "" "the very end of the structure." msgstr "" -#: ../../c-api/typeobj.rst:1717 +#: ../../c-api/typeobj.rst:1711 msgid "" "The real dictionary offset in an instance can be computed from a negative :c:" "member:`~PyTypeObject.tp_dictoffset` as follows::" msgstr "" -#: ../../c-api/typeobj.rst:1724 +#: ../../c-api/typeobj.rst:1718 msgid "" "where :c:member:`~PyTypeObject.tp_basicsize`, :c:member:`~PyTypeObject." "tp_itemsize` and :c:member:`~PyTypeObject.tp_dictoffset` are taken from the " @@ -2595,7 +2588,7 @@ msgid "" "it is done for you by :c:func:`_PyObject_GetDictPtr`.)" msgstr "" -#: ../../c-api/typeobj.rst:1732 +#: ../../c-api/typeobj.rst:1726 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype instances " @@ -2604,7 +2597,7 @@ msgid "" "should not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1737 +#: ../../c-api/typeobj.rst:1731 msgid "" "When a type defined by a class statement has no :attr:`~object.__slots__` " "declaration, and none of its base types has an instance variable dictionary, " @@ -2612,14 +2605,14 @@ msgid "" "`~PyTypeObject.tp_dictoffset` is set to that slot's offset." msgstr "" -#: ../../c-api/typeobj.rst:1742 +#: ../../c-api/typeobj.rst:1736 msgid "" "When a type defined by a class statement has a :attr:`__slots__` " "declaration, the type inherits its :c:member:`~PyTypeObject.tp_dictoffset` " "from its base type." msgstr "" -#: ../../c-api/typeobj.rst:1745 +#: ../../c-api/typeobj.rst:1739 msgid "" "(Adding a slot named :attr:`~object.__dict__` to the :attr:`__slots__` " "declaration does not have the expected effect, it just causes confusion. " @@ -2627,17 +2620,17 @@ msgid "" "though.)" msgstr "" -#: ../../c-api/typeobj.rst:1751 +#: ../../c-api/typeobj.rst:1745 msgid "" "This slot has no default. For :ref:`static types `, if the " "field is ``NULL`` then no :attr:`__dict__` gets created for instances." msgstr "" -#: ../../c-api/typeobj.rst:1757 +#: ../../c-api/typeobj.rst:1751 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:1759 +#: ../../c-api/typeobj.rst:1753 msgid "" "This function corresponds to the :meth:`__init__` method of classes. Like :" "meth:`__init__`, it is possible to create an instance without calling :meth:" @@ -2645,14 +2638,14 @@ msgid "" "meth:`__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:1768 +#: ../../c-api/typeobj.rst:1762 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:" "`__init__`." msgstr "" -#: ../../c-api/typeobj.rst:1772 +#: ../../c-api/typeobj.rst:1766 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 :" @@ -2664,43 +2657,43 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:1779 +#: ../../c-api/typeobj.rst:1773 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:1787 +#: ../../c-api/typeobj.rst:1781 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:1792 +#: ../../c-api/typeobj.rst:1786 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:1800 +#: ../../c-api/typeobj.rst:1794 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:1805 +#: ../../c-api/typeobj.rst:1799 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:1809 +#: ../../c-api/typeobj.rst:1803 msgid "" "For static subtypes, :c:type:`PyBaseObject_Type` uses :c:func:" "`PyType_GenericAlloc`. That is the recommended value for all statically " "defined types." msgstr "" -#: ../../c-api/typeobj.rst:1816 +#: ../../c-api/typeobj.rst:1810 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:1822 +#: ../../c-api/typeobj.rst:1816 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 " @@ -2709,7 +2702,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:1828 +#: ../../c-api/typeobj.rst:1822 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -2721,20 +2714,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:1836 +#: ../../c-api/typeobj.rst:1830 msgid "" "Set the :const:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow creating " "instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:1841 +#: ../../c-api/typeobj.rst:1835 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:1847 +#: ../../c-api/typeobj.rst:1841 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 " @@ -2742,39 +2735,39 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:1855 +#: ../../c-api/typeobj.rst:1849 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1859 +#: ../../c-api/typeobj.rst:1853 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: ../../c-api/typeobj.rst:1863 +#: ../../c-api/typeobj.rst:1857 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:1868 +#: ../../c-api/typeobj.rst:1862 msgid "" "In dynamic subtypes, this field is set to a deallocator suitable to match :c:" "func:`PyType_GenericAlloc` and the value of the :const:`Py_TPFLAGS_HAVE_GC` " "flag bit." msgstr "" -#: ../../c-api/typeobj.rst:1872 +#: ../../c-api/typeobj.rst:1866 msgid "For static subtypes, :c:type:`PyBaseObject_Type` uses PyObject_Del." msgstr "" -#: ../../c-api/typeobj.rst:1877 +#: ../../c-api/typeobj.rst:1871 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:1879 +#: ../../c-api/typeobj.rst:1873 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 " @@ -2786,76 +2779,76 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1889 +#: ../../c-api/typeobj.rst:1883 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:1899 +#: ../../c-api/typeobj.rst:1893 msgid "" "This slot has no default. If this field is ``NULL``, :const:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: ../../c-api/typeobj.rst:1905 +#: ../../c-api/typeobj.rst:1899 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:1907 +#: ../../c-api/typeobj.rst:1901 msgid "" "This is set for types created by a class statement. It should be ``NULL`` " "for statically defined types." msgstr "" -#: ../../c-api/typeobj.rst:1912 ../../c-api/typeobj.rst:1933 -#: ../../c-api/typeobj.rst:1942 ../../c-api/typeobj.rst:1952 -#: ../../c-api/typeobj.rst:1966 +#: ../../c-api/typeobj.rst:1906 ../../c-api/typeobj.rst:1927 +#: ../../c-api/typeobj.rst:1936 ../../c-api/typeobj.rst:1946 +#: ../../c-api/typeobj.rst:1960 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1917 +#: ../../c-api/typeobj.rst:1911 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:1923 +#: ../../c-api/typeobj.rst:1917 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1929 +#: ../../c-api/typeobj.rst:1923 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1938 +#: ../../c-api/typeobj.rst:1932 msgid "List of weak references to subclasses. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1947 +#: ../../c-api/typeobj.rst:1941 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1957 +#: ../../c-api/typeobj.rst:1951 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: ../../c-api/typeobj.rst:1962 +#: ../../c-api/typeobj.rst:1956 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:1971 +#: ../../c-api/typeobj.rst:1965 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1975 +#: ../../c-api/typeobj.rst:1969 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 " @@ -2865,20 +2858,20 @@ msgid "" "object in a sane state." msgstr "" -#: ../../c-api/typeobj.rst:1982 +#: ../../c-api/typeobj.rst:1976 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:1999 +#: ../../c-api/typeobj.rst:1993 msgid "" "For this field to be taken into account (even through inheritance), you must " "also set the :const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit." msgstr "" -#: ../../c-api/typeobj.rst:2002 +#: ../../c-api/typeobj.rst:1996 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 " @@ -2891,11 +2884,11 @@ msgid "" "which called tp_dealloc will not violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:2019 +#: ../../c-api/typeobj.rst:2013 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2024 +#: ../../c-api/typeobj.rst:2018 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -2903,61 +2896,61 @@ msgid "" "attr:`__new__` and :attr:`__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2032 +#: ../../c-api/typeobj.rst:2026 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2034 +#: ../../c-api/typeobj.rst:2028 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2040 +#: ../../c-api/typeobj.rst:2034 msgid "Static Types" msgstr "" -#: ../../c-api/typeobj.rst:2042 +#: ../../c-api/typeobj.rst:2036 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:2046 +#: ../../c-api/typeobj.rst:2040 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2048 +#: ../../c-api/typeobj.rst:2042 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2050 +#: ../../c-api/typeobj.rst:2044 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:2052 +#: ../../c-api/typeobj.rst:2046 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2056 +#: ../../c-api/typeobj.rst:2050 msgid "" "Also, since :c:type:`PyTypeObject` is not part of the :ref:`stable ABI " "`, any extension modules using static types must be compiled for a " "specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2064 +#: ../../c-api/typeobj.rst:2058 msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2066 +#: ../../c-api/typeobj.rst:2060 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -2965,29 +2958,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2071 +#: ../../c-api/typeobj.rst:2065 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" "func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, or :c:func:" "`PyType_FromModuleAndSpec`." msgstr "" -#: ../../c-api/typeobj.rst:2079 +#: ../../c-api/typeobj.rst:2073 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2086 +#: ../../c-api/typeobj.rst:2080 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:2092 ../../c-api/typeobj.rst:2416 +#: ../../c-api/typeobj.rst:2086 ../../c-api/typeobj.rst:2410 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2139 +#: ../../c-api/typeobj.rst:2133 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 " @@ -2997,30 +2990,30 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2148 +#: ../../c-api/typeobj.rst:2142 msgid "" "The :c:data:`nb_reserved` field should always be ``NULL``. It was " "previously called :c:data:`nb_long`, and was renamed in Python 3.0.1." msgstr "" -#: ../../c-api/typeobj.rst:2193 +#: ../../c-api/typeobj.rst:2187 msgid "Mapping Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2200 +#: ../../c-api/typeobj.rst:2194 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:2205 +#: ../../c-api/typeobj.rst:2199 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:2211 +#: ../../c-api/typeobj.rst:2205 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3028,7 +3021,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2219 +#: ../../c-api/typeobj.rst:2213 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PyObject_SetSlice` and :c:func:" @@ -3038,17 +3031,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2230 +#: ../../c-api/typeobj.rst:2224 msgid "Sequence Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2237 +#: ../../c-api/typeobj.rst:2231 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2242 +#: ../../c-api/typeobj.rst:2236 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 " @@ -3056,21 +3049,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2249 +#: ../../c-api/typeobj.rst:2243 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:2255 +#: ../../c-api/typeobj.rst:2249 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:2261 +#: ../../c-api/typeobj.rst:2255 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 " @@ -3079,7 +3072,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2267 +#: ../../c-api/typeobj.rst:2261 msgid "" "Negative indexes are handled as follows: if the :attr:`sq_length` slot is " "filled, it is called and the sequence length is used to compute a positive " @@ -3087,7 +3080,7 @@ msgid "" "the index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2274 +#: ../../c-api/typeobj.rst:2268 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:" @@ -3096,14 +3089,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2283 +#: ../../c-api/typeobj.rst:2277 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:2290 +#: ../../c-api/typeobj.rst:2284 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 " @@ -3113,7 +3106,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2299 +#: ../../c-api/typeobj.rst:2293 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 " @@ -3123,72 +3116,72 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2310 +#: ../../c-api/typeobj.rst:2304 msgid "Buffer Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2318 +#: ../../c-api/typeobj.rst:2312 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:2324 ../../c-api/typeobj.rst:2373 -#: ../../c-api/typeobj.rst:2427 ../../c-api/typeobj.rst:2438 -#: ../../c-api/typeobj.rst:2450 ../../c-api/typeobj.rst:2459 +#: ../../c-api/typeobj.rst:2318 ../../c-api/typeobj.rst:2367 +#: ../../c-api/typeobj.rst:2421 ../../c-api/typeobj.rst:2432 +#: ../../c-api/typeobj.rst:2444 ../../c-api/typeobj.rst:2453 msgid "The signature of this function is::" msgstr "" -#: ../../c-api/typeobj.rst:2328 +#: ../../c-api/typeobj.rst:2322 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:2332 +#: ../../c-api/typeobj.rst:2326 msgid "" "Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " "set :c:data:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2335 +#: ../../c-api/typeobj.rst:2329 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2337 +#: ../../c-api/typeobj.rst:2331 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2339 +#: ../../c-api/typeobj.rst:2333 msgid "" "Set :c:data:`view->obj` to *exporter* and increment :c:data:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2341 +#: ../../c-api/typeobj.rst:2335 msgid "Return ``0``." msgstr "" -#: ../../c-api/typeobj.rst:2343 +#: ../../c-api/typeobj.rst:2337 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2346 +#: ../../c-api/typeobj.rst:2340 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "data:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2349 +#: ../../c-api/typeobj.rst:2343 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:data:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2353 +#: ../../c-api/typeobj.rst:2347 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3196,7 +3189,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2358 +#: ../../c-api/typeobj.rst:2352 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:" @@ -3205,19 +3198,19 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2365 +#: ../../c-api/typeobj.rst:2359 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:2368 +#: ../../c-api/typeobj.rst:2362 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2377 +#: ../../c-api/typeobj.rst:2371 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 " @@ -3225,15 +3218,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2382 +#: ../../c-api/typeobj.rst:2376 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2384 +#: ../../c-api/typeobj.rst:2378 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2386 +#: ../../c-api/typeobj.rst:2380 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 " @@ -3241,68 +3234,68 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2392 +#: ../../c-api/typeobj.rst:2386 msgid "" "This function MUST NOT decrement :c:data:`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:2397 +#: ../../c-api/typeobj.rst:2391 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2405 +#: ../../c-api/typeobj.rst:2399 msgid "Async Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2413 +#: ../../c-api/typeobj.rst:2407 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2431 +#: ../../c-api/typeobj.rst:2425 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:2434 +#: ../../c-api/typeobj.rst:2428 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2442 +#: ../../c-api/typeobj.rst:2436 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`__anext__` " "for details." msgstr "" -#: ../../c-api/typeobj.rst:2445 +#: ../../c-api/typeobj.rst:2439 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2454 +#: ../../c-api/typeobj.rst:2448 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " "This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2463 +#: ../../c-api/typeobj.rst:2457 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2472 +#: ../../c-api/typeobj.rst:2466 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2476 +#: ../../c-api/typeobj.rst:2470 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 " @@ -3316,80 +3309,80 @@ msgid "" "member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2486 +#: ../../c-api/typeobj.rst:2480 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:2493 +#: ../../c-api/typeobj.rst:2487 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`\\ 。" -#: ../../c-api/typeobj.rst:2497 +#: ../../c-api/typeobj.rst:2491 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`\\ 。" -#: ../../c-api/typeobj.rst:2501 +#: ../../c-api/typeobj.rst:2495 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`\\ 。" -#: ../../c-api/typeobj.rst:2505 +#: ../../c-api/typeobj.rst:2499 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`\\ 。" -#: ../../c-api/typeobj.rst:2509 ../../c-api/typeobj.rst:2518 +#: ../../c-api/typeobj.rst:2503 ../../c-api/typeobj.rst:2512 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2513 ../../c-api/typeobj.rst:2524 +#: ../../c-api/typeobj.rst:2507 ../../c-api/typeobj.rst:2518 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:2520 +#: ../../c-api/typeobj.rst:2514 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`\\ 。" -#: ../../c-api/typeobj.rst:2527 +#: ../../c-api/typeobj.rst:2521 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`\\ 。" -#: ../../c-api/typeobj.rst:2531 +#: ../../c-api/typeobj.rst:2525 msgid "See :c:member:`~PyTypeObject.tp_descrget`." msgstr "請見 :c:member:`~PyTypeObject.tp_descrget`\\ 。" -#: ../../c-api/typeobj.rst:2535 +#: ../../c-api/typeobj.rst:2529 msgid "See :c:member:`~PyTypeObject.tp_descrset`." msgstr "請見 :c:member:`~PyTypeObject.tp_descrset`\\ 。" -#: ../../c-api/typeobj.rst:2539 +#: ../../c-api/typeobj.rst:2533 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`\\ 。" -#: ../../c-api/typeobj.rst:2543 +#: ../../c-api/typeobj.rst:2537 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`\\ 。" -#: ../../c-api/typeobj.rst:2547 +#: ../../c-api/typeobj.rst:2541 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`\\ 。" -#: ../../c-api/typeobj.rst:2551 +#: ../../c-api/typeobj.rst:2545 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`\\ 。" -#: ../../c-api/typeobj.rst:2565 +#: ../../c-api/typeobj.rst:2559 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`\\ 。" -#: ../../c-api/typeobj.rst:2581 +#: ../../c-api/typeobj.rst:2575 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2583 +#: ../../c-api/typeobj.rst:2577 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3397,33 +3390,33 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2588 +#: ../../c-api/typeobj.rst:2582 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2605 +#: ../../c-api/typeobj.rst:2599 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2649 +#: ../../c-api/typeobj.rst:2643 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2676 +#: ../../c-api/typeobj.rst:2670 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " "instances (e.g. uses a separate factory func) using :c:data:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: ../../c-api/typeobj.rst:2695 +#: ../../c-api/typeobj.rst:2689 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2706 +#: ../../c-api/typeobj.rst:2700 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" diff --git a/faq/design.po b/faq/design.po index 9261914de3..a647908564 100644 --- a/faq/design.po +++ b/faq/design.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-30 00:18+0000\n" +"POT-Creation-Date: 2022-06-01 05:12+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -428,15 +428,14 @@ msgid "" "`Cython `_ compiles a modified version of Python with " "optional annotations into C extensions. `Nuitka `_ " "is an up-and-coming compiler of Python into C++ code, aiming to support the " -"full Python language. For compiling to Java you can consider `VOC `_." +"full Python language." msgstr "" -#: ../../faq/design.rst:332 +#: ../../faq/design.rst:331 msgid "How does Python manage memory?" msgstr "Python如何管理記憶體?" -#: ../../faq/design.rst:334 +#: ../../faq/design.rst:333 msgid "" "The details of Python memory management depend on the implementation. The " "standard implementation of Python, :term:`CPython`, uses reference counting " @@ -447,7 +446,7 @@ msgid "" "statistics, and tune the collector's parameters." msgstr "" -#: ../../faq/design.rst:342 +#: ../../faq/design.rst:341 msgid "" "Other implementations (such as `Jython `_ or `PyPy " "`_), however, can rely on a different mechanism such as " @@ -456,13 +455,13 @@ msgid "" "reference counting implementation." msgstr "" -#: ../../faq/design.rst:348 +#: ../../faq/design.rst:347 msgid "" "In some Python implementations, the following code (which is fine in " "CPython) will probably run out of file descriptors::" msgstr "" -#: ../../faq/design.rst:355 +#: ../../faq/design.rst:354 msgid "" "Indeed, using CPython's reference counting and destructor scheme, each new " "assignment to *f* closes the previous file. With a traditional GC, however, " @@ -470,18 +469,18 @@ msgid "" "possibly long intervals." msgstr "" -#: ../../faq/design.rst:360 +#: ../../faq/design.rst:359 msgid "" "If you want to write code that will work with any Python implementation, you " "should explicitly close the file or use the :keyword:`with` statement; this " "will work regardless of memory management scheme::" msgstr "" -#: ../../faq/design.rst:370 +#: ../../faq/design.rst:369 msgid "Why doesn't CPython use a more traditional garbage collection scheme?" msgstr "為何CPython不使用更多傳統的垃圾回收機制?" -#: ../../faq/design.rst:372 +#: ../../faq/design.rst:371 msgid "" "For one thing, this is not a C standard feature and hence it's not portable. " "(Yes, we know about the Boehm GC library. It has bits of assembler code for " @@ -490,7 +489,7 @@ msgid "" "Python to work with it.)" msgstr "" -#: ../../faq/design.rst:378 +#: ../../faq/design.rst:377 msgid "" "Traditional GC also becomes a problem when Python is embedded into other " "applications. While in a standalone Python it's fine to replace the " @@ -500,11 +499,11 @@ msgid "" "with anything that implements malloc() and free() properly." msgstr "" -#: ../../faq/design.rst:387 +#: ../../faq/design.rst:386 msgid "Why isn't all memory freed when CPython exits?" msgstr "當CPython結束時,為何所有的記憶體不會被釋放?" -#: ../../faq/design.rst:389 +#: ../../faq/design.rst:388 msgid "" "Objects referenced from the global namespaces of Python modules are not " "always deallocated when Python exits. This may happen if there are circular " @@ -514,17 +513,17 @@ msgid "" "exit and does try to destroy every single object." msgstr "" -#: ../../faq/design.rst:396 +#: ../../faq/design.rst:395 msgid "" "If you want to force Python to delete certain things on deallocation use " "the :mod:`atexit` module to run a function that will force those deletions." msgstr "" -#: ../../faq/design.rst:401 +#: ../../faq/design.rst:400 msgid "Why are there separate tuple and list data types?" msgstr "" -#: ../../faq/design.rst:403 +#: ../../faq/design.rst:402 msgid "" "Lists and tuples, while similar in many respects, are generally used in " "fundamentally different ways. Tuples can be thought of as being similar to " @@ -534,7 +533,7 @@ msgid "" "numbers." msgstr "" -#: ../../faq/design.rst:410 +#: ../../faq/design.rst:409 msgid "" "Lists, on the other hand, are more like arrays in other languages. They " "tend to hold a varying number of objects all of which have the same type and " @@ -544,7 +543,7 @@ msgid "" "added another file or two to the directory." msgstr "" -#: ../../faq/design.rst:417 +#: ../../faq/design.rst:416 msgid "" "Tuples are immutable, meaning that once a tuple has been created, you can't " "replace any of its elements with a new value. Lists are mutable, meaning " @@ -553,12 +552,11 @@ msgid "" "as keys." msgstr "" -#: ../../faq/design.rst:424 -#, fuzzy +#: ../../faq/design.rst:423 msgid "How are lists implemented in CPython?" -msgstr "串列如何被繼承?" +msgstr "串列 (lists) 在 CPython 中是怎麼實作的?" -#: ../../faq/design.rst:426 +#: ../../faq/design.rst:425 msgid "" "CPython's lists are really variable-length arrays, not Lisp-style linked " "lists. The implementation uses a contiguous array of references to other " @@ -566,13 +564,13 @@ msgid "" "head structure." msgstr "" -#: ../../faq/design.rst:430 +#: ../../faq/design.rst:429 msgid "" "This makes indexing a list ``a[i]`` an operation whose cost is independent " "of the size of the list or the value of the index." msgstr "" -#: ../../faq/design.rst:433 +#: ../../faq/design.rst:432 msgid "" "When items are appended or inserted, the array of references is resized. " "Some cleverness is applied to improve the performance of appending items " @@ -580,12 +578,11 @@ msgid "" "the next few times don't require an actual resize." msgstr "" -#: ../../faq/design.rst:440 -#, fuzzy +#: ../../faq/design.rst:439 msgid "How are dictionaries implemented in CPython?" -msgstr "串列如何被繼承?" +msgstr "字典 (dictionaries) 在 CPython 中是怎麼實作的?" -#: ../../faq/design.rst:442 +#: ../../faq/design.rst:441 msgid "" "CPython's dictionaries are implemented as resizable hash tables. Compared " "to B-trees, this gives better performance for lookup (the most common " @@ -593,7 +590,7 @@ msgid "" "simpler." msgstr "" -#: ../../faq/design.rst:446 +#: ../../faq/design.rst:445 msgid "" "Dictionaries work by computing a hash code for each key stored in the " "dictionary using the :func:`hash` built-in function. The hash code varies " @@ -606,11 +603,11 @@ msgid "" "key." msgstr "" -#: ../../faq/design.rst:457 +#: ../../faq/design.rst:456 msgid "Why must dictionary keys be immutable?" msgstr "" -#: ../../faq/design.rst:459 +#: ../../faq/design.rst:458 msgid "" "The hash table implementation of dictionaries uses a hash value calculated " "from the key value to find the key. If the key were a mutable object, its " @@ -623,7 +620,7 @@ msgid "" "would be different." msgstr "" -#: ../../faq/design.rst:468 +#: ../../faq/design.rst:467 msgid "" "If you want a dictionary indexed with a list, simply convert the list to a " "tuple first; the function ``tuple(L)`` creates a tuple with the same entries " @@ -631,17 +628,17 @@ msgid "" "dictionary keys." msgstr "" -#: ../../faq/design.rst:472 +#: ../../faq/design.rst:471 msgid "Some unacceptable solutions that have been proposed:" msgstr "" -#: ../../faq/design.rst:474 +#: ../../faq/design.rst:473 msgid "" "Hash lists by their address (object ID). This doesn't work because if you " "construct a new list with the same value it won't be found; e.g.::" msgstr "" -#: ../../faq/design.rst:480 +#: ../../faq/design.rst:479 msgid "" "would raise a :exc:`KeyError` exception because the id of the ``[1, 2]`` " "used in the second line differs from that in the first line. In other " @@ -649,14 +646,14 @@ msgid "" "`is`." msgstr "" -#: ../../faq/design.rst:484 +#: ../../faq/design.rst:483 msgid "" "Make a copy when using a list as a key. This doesn't work because the list, " "being a mutable object, could contain a reference to itself, and then the " "copying code would run into an infinite loop." msgstr "" -#: ../../faq/design.rst:488 +#: ../../faq/design.rst:487 msgid "" "Allow lists as keys but tell the user not to modify them. This would allow " "a class of hard-to-track bugs in programs when you forgot or modified a list " @@ -664,7 +661,7 @@ msgid "" "every value in ``d.keys()`` is usable as a key of the dictionary." msgstr "" -#: ../../faq/design.rst:493 +#: ../../faq/design.rst:492 msgid "" "Mark lists as read-only once they are used as a dictionary key. The problem " "is that it's not just the top-level object that could change its value; you " @@ -674,7 +671,7 @@ msgid "" "loop." msgstr "" -#: ../../faq/design.rst:499 +#: ../../faq/design.rst:498 msgid "" "There is a trick to get around this if you need to, but use it at your own " "risk: You can wrap a mutable structure inside a class instance which has " @@ -684,14 +681,14 @@ msgid "" "in the dictionary (or other structure). ::" msgstr "" -#: ../../faq/design.rst:523 +#: ../../faq/design.rst:522 msgid "" "Note that the hash computation is complicated by the possibility that some " "members of the list may be unhashable and also by the possibility of " "arithmetic overflow." msgstr "" -#: ../../faq/design.rst:527 +#: ../../faq/design.rst:526 msgid "" "Furthermore it must always be the case that if ``o1 == o2`` (ie ``o1." "__eq__(o2) is True``) then ``hash(o1) == hash(o2)`` (ie, ``o1.__hash__() == " @@ -700,7 +697,7 @@ msgid "" "based structures will misbehave." msgstr "" -#: ../../faq/design.rst:532 +#: ../../faq/design.rst:531 msgid "" "In the case of ListWrapper, whenever the wrapper object is in a dictionary " "the wrapped list must not change to avoid anomalies. Don't do this unless " @@ -708,11 +705,11 @@ msgid "" "of not meeting them correctly. Consider yourself warned." msgstr "" -#: ../../faq/design.rst:539 +#: ../../faq/design.rst:538 msgid "Why doesn't list.sort() return the sorted list?" msgstr "為何list.sort()不是回傳排序過的串列?" -#: ../../faq/design.rst:541 +#: ../../faq/design.rst:540 msgid "" "In situations where performance matters, making a copy of the list just to " "sort it would be wasteful. Therefore, :meth:`list.sort` sorts the list in " @@ -722,7 +719,7 @@ msgid "" "around." msgstr "" -#: ../../faq/design.rst:547 +#: ../../faq/design.rst:546 msgid "" "If you want to return a new list, use the built-in :func:`sorted` function " "instead. This function creates a new list from a provided iterable, sorts " @@ -730,11 +727,11 @@ msgid "" "dictionary in sorted order::" msgstr "" -#: ../../faq/design.rst:557 +#: ../../faq/design.rst:556 msgid "How do you specify and enforce an interface spec in Python?" msgstr "" -#: ../../faq/design.rst:559 +#: ../../faq/design.rst:558 msgid "" "An interface specification for a module as provided by languages such as C++ " "and Java describes the prototypes for the methods and functions of the " @@ -742,7 +739,7 @@ msgid "" "helps in the construction of large programs." msgstr "" -#: ../../faq/design.rst:564 +#: ../../faq/design.rst:563 msgid "" "Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base " "Classes (ABCs). You can then use :func:`isinstance` and :func:`issubclass` " @@ -752,13 +749,13 @@ msgid "" "`~collections.abc.MutableMapping`." msgstr "" -#: ../../faq/design.rst:571 +#: ../../faq/design.rst:570 msgid "" "For Python, many of the advantages of interface specifications can be " "obtained by an appropriate test discipline for components." msgstr "" -#: ../../faq/design.rst:574 +#: ../../faq/design.rst:573 msgid "" "A good test suite for a module can both provide a regression test and serve " "as a module interface specification and a set of examples. Many Python " @@ -770,7 +767,7 @@ msgid "" "in a module." msgstr "" -#: ../../faq/design.rst:582 +#: ../../faq/design.rst:581 msgid "" "An appropriate testing discipline can help build large complex applications " "in Python as well as having interface specifications would. In fact, it can " @@ -781,7 +778,7 @@ msgid "" "correctly, but it's trivial to check this property in a test suite." msgstr "" -#: ../../faq/design.rst:590 +#: ../../faq/design.rst:589 msgid "" "Writing test suites is very helpful, and you might want to design your code " "to make it easily tested. One increasingly popular technique, test-driven " @@ -790,11 +787,11 @@ msgid "" "not write test cases at all." msgstr "" -#: ../../faq/design.rst:598 +#: ../../faq/design.rst:597 msgid "Why is there no goto?" msgstr "為何沒有goto語法?" -#: ../../faq/design.rst:600 +#: ../../faq/design.rst:599 msgid "" "In the 1970s people realized that unrestricted goto could lead to messy " "\"spaghetti\" code that was hard to understand and revise. In a high-level " @@ -804,7 +801,7 @@ msgid "" "containing ``continue`` and ``break``)." msgstr "" -#: ../../faq/design.rst:607 +#: ../../faq/design.rst:606 msgid "" "One can also use exceptions to provide a \"structured goto\" that works even " "across function calls. Many feel that exceptions can conveniently emulate " @@ -812,24 +809,24 @@ msgid "" "other languages. For example::" msgstr "" -#: ../../faq/design.rst:623 +#: ../../faq/design.rst:622 msgid "" "This doesn't allow you to jump into the middle of a loop, but that's usually " "considered an abuse of goto anyway. Use sparingly." msgstr "" -#: ../../faq/design.rst:628 +#: ../../faq/design.rst:627 msgid "Why can't raw strings (r-strings) end with a backslash?" msgstr "" -#: ../../faq/design.rst:630 +#: ../../faq/design.rst:629 msgid "" "More precisely, they can't end with an odd number of backslashes: the " "unpaired backslash at the end escapes the closing quote character, leaving " "an unterminated string." msgstr "" -#: ../../faq/design.rst:634 +#: ../../faq/design.rst:633 msgid "" "Raw strings were designed to ease creating input for processors (chiefly " "regular expression engines) that want to do their own backslash escape " @@ -839,33 +836,33 @@ msgid "" "rules work well when r-strings are used for their intended purpose." msgstr "" -#: ../../faq/design.rst:641 +#: ../../faq/design.rst:640 msgid "" "If you're trying to build Windows pathnames, note that all Windows system " "calls accept forward slashes too::" msgstr "" -#: ../../faq/design.rst:646 +#: ../../faq/design.rst:645 msgid "" "If you're trying to build a pathname for a DOS command, try e.g. one of ::" msgstr "" -#: ../../faq/design.rst:654 +#: ../../faq/design.rst:653 msgid "Why doesn't Python have a \"with\" statement for attribute assignments?" msgstr "" -#: ../../faq/design.rst:656 +#: ../../faq/design.rst:655 msgid "" "Python has a 'with' statement that wraps the execution of a block, calling " "code on the entrance and exit from the block. Some languages have a " "construct that looks like this::" msgstr "" -#: ../../faq/design.rst:664 +#: ../../faq/design.rst:663 msgid "In Python, such a construct would be ambiguous." msgstr "" -#: ../../faq/design.rst:666 +#: ../../faq/design.rst:665 msgid "" "Other languages, such as Object Pascal, Delphi, and C++, use static types, " "so it's possible to know, in an unambiguous way, what member is being " @@ -873,7 +870,7 @@ msgid "" "*always* knows the scope of every variable at compile time." msgstr "" -#: ../../faq/design.rst:671 +#: ../../faq/design.rst:670 msgid "" "Python uses dynamic types. It is impossible to know in advance which " "attribute will be referenced at runtime. Member attributes may be added or " @@ -882,11 +879,11 @@ msgid "" "one, or a member attribute?" msgstr "" -#: ../../faq/design.rst:677 +#: ../../faq/design.rst:676 msgid "For instance, take the following incomplete snippet::" msgstr "" -#: ../../faq/design.rst:683 +#: ../../faq/design.rst:682 msgid "" "The snippet assumes that \"a\" must have a member attribute called \"x\". " "However, there is nothing in Python that tells the interpreter this. What " @@ -895,29 +892,29 @@ msgid "" "the dynamic nature of Python makes such choices much harder." msgstr "" -#: ../../faq/design.rst:689 +#: ../../faq/design.rst:688 msgid "" "The primary benefit of \"with\" and similar language features (reduction of " "code volume) can, however, easily be achieved in Python by assignment. " "Instead of::" msgstr "" -#: ../../faq/design.rst:696 +#: ../../faq/design.rst:695 msgid "write this::" msgstr "" -#: ../../faq/design.rst:703 +#: ../../faq/design.rst:702 msgid "" "This also has the side-effect of increasing execution speed because name " "bindings are resolved at run-time in Python, and the second version only " "needs to perform the resolution once." msgstr "" -#: ../../faq/design.rst:709 +#: ../../faq/design.rst:708 msgid "Why don't generators support the with statement?" msgstr "" -#: ../../faq/design.rst:711 +#: ../../faq/design.rst:710 msgid "" "For technical reasons, a generator used directly as a context manager would " "not work correctly. When, as is most common, a generator is used as an " @@ -925,28 +922,28 @@ msgid "" "\"contextlib.closing(generator)\" in the 'with' statement." msgstr "" -#: ../../faq/design.rst:718 +#: ../../faq/design.rst:717 msgid "Why are colons required for the if/while/def/class statements?" msgstr "" -#: ../../faq/design.rst:720 +#: ../../faq/design.rst:719 msgid "" "The colon is required primarily to enhance readability (one of the results " "of the experimental ABC language). Consider this::" msgstr "" -#: ../../faq/design.rst:726 +#: ../../faq/design.rst:725 msgid "versus ::" msgstr "" -#: ../../faq/design.rst:731 +#: ../../faq/design.rst:730 msgid "" "Notice how the second one is slightly easier to read. Notice further how a " "colon sets off the example in this FAQ answer; it's a standard usage in " "English." msgstr "" -#: ../../faq/design.rst:734 +#: ../../faq/design.rst:733 msgid "" "Another minor reason is that the colon makes it easier for editors with " "syntax highlighting; they can look for colons to decide when indentation " @@ -954,21 +951,21 @@ msgid "" "the program text." msgstr "" -#: ../../faq/design.rst:740 +#: ../../faq/design.rst:739 msgid "Why does Python allow commas at the end of lists and tuples?" msgstr "" -#: ../../faq/design.rst:742 +#: ../../faq/design.rst:741 msgid "" "Python lets you add a trailing comma at the end of lists, tuples, and " "dictionaries::" msgstr "" -#: ../../faq/design.rst:753 +#: ../../faq/design.rst:752 msgid "There are several reasons to allow this." msgstr "這有許多原因可被允許。" -#: ../../faq/design.rst:755 +#: ../../faq/design.rst:754 msgid "" "When you have a literal value for a list, tuple, or dictionary spread across " "multiple lines, it's easier to add more elements because you don't have to " @@ -976,20 +973,20 @@ msgid "" "reordered without creating a syntax error." msgstr "" -#: ../../faq/design.rst:760 +#: ../../faq/design.rst:759 msgid "" "Accidentally omitting the comma can lead to errors that are hard to " "diagnose. For example::" msgstr "" -#: ../../faq/design.rst:770 +#: ../../faq/design.rst:769 msgid "" "This list looks like it has four elements, but it actually contains three: " "\"fee\", \"fiefoo\" and \"fum\". Always adding the comma avoids this source " "of error." msgstr "" -#: ../../faq/design.rst:773 +#: ../../faq/design.rst:772 msgid "" "Allowing the trailing comma may also make programmatic code generation " "easier." diff --git a/faq/library.po b/faq/library.po index fd23a0ff16..c5914e657d 100644 --- a/faq/library.po +++ b/faq/library.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-06-10 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -519,41 +519,46 @@ msgstr "" #: ../../faq/library.rst:486 msgid "" -"The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note " -"that on MacOS 9 it doesn't copy the resource fork and Finder info." +"The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note " +"that on Windows NTFS volumes, it does not copy `alternate data streams " +"`_ nor " +"`resource forks `__ on macOS HFS" +"+ volumes, though both are now rarely used. It also doesn't copy file " +"permissions and metadata, though using :func:`shutil.copy2` instead will " +"preserve most (though not all) of it." msgstr "" -#: ../../faq/library.rst:491 +#: ../../faq/library.rst:497 msgid "How do I read (or write) binary data?" msgstr "" -#: ../../faq/library.rst:493 +#: ../../faq/library.rst:499 msgid "" "To read or write complex binary data formats, it's best to use the :mod:" "`struct` module. It allows you to take a string containing binary data " "(usually numbers) and convert it to Python objects; and vice versa." msgstr "" -#: ../../faq/library.rst:497 +#: ../../faq/library.rst:503 msgid "" "For example, the following code reads two 2-byte integers and one 4-byte " "integer in big-endian format from a file::" msgstr "" -#: ../../faq/library.rst:506 +#: ../../faq/library.rst:512 msgid "" "The '>' in the format string forces big-endian data; the letter 'h' reads " "one \"short integer\" (2 bytes), and 'l' reads one \"long integer\" (4 " "bytes) from the string." msgstr "" -#: ../../faq/library.rst:510 +#: ../../faq/library.rst:516 msgid "" "For data that is more regular (e.g. a homogeneous list of ints or floats), " "you can also use the :mod:`array` module." msgstr "" -#: ../../faq/library.rst:515 +#: ../../faq/library.rst:521 msgid "" "To read and write binary data, it is mandatory to open the file in binary " "mode (here, passing ``\"rb\"`` to :func:`open`). If you use ``\"r\"`` " @@ -561,11 +566,11 @@ msgid "" "will return :class:`str` objects rather than :class:`bytes` objects." msgstr "" -#: ../../faq/library.rst:523 +#: ../../faq/library.rst:529 msgid "I can't seem to use os.read() on a pipe created with os.popen(); why?" msgstr "" -#: ../../faq/library.rst:525 +#: ../../faq/library.rst:531 msgid "" ":func:`os.read` is a low-level function which takes a file descriptor, a " "small integer representing the opened file. :func:`os.popen` creates a high-" @@ -574,37 +579,37 @@ msgid "" "popen`, you need to use ``p.read(n)``." msgstr "" -#: ../../faq/library.rst:612 +#: ../../faq/library.rst:618 msgid "How do I access the serial (RS232) port?" msgstr "" -#: ../../faq/library.rst:614 +#: ../../faq/library.rst:620 msgid "For Win32, OSX, Linux, BSD, Jython, IronPython:" msgstr "" -#: ../../faq/library.rst:616 +#: ../../faq/library.rst:622 msgid "https://pypi.org/project/pyserial/" msgstr "https://pypi.org/project/pyserial/" -#: ../../faq/library.rst:618 +#: ../../faq/library.rst:624 msgid "For Unix, see a Usenet post by Mitch Chapman:" msgstr "" -#: ../../faq/library.rst:620 +#: ../../faq/library.rst:626 msgid "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com" msgstr "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com" -#: ../../faq/library.rst:624 +#: ../../faq/library.rst:630 msgid "Why doesn't closing sys.stdout (stdin, stderr) really close it?" msgstr "" -#: ../../faq/library.rst:626 +#: ../../faq/library.rst:632 msgid "" "Python :term:`file objects ` are a high-level layer of " "abstraction on low-level C file descriptors." msgstr "" -#: ../../faq/library.rst:629 +#: ../../faq/library.rst:635 msgid "" "For most file objects you create in Python via the built-in :func:`open` " "function, ``f.close()`` marks the Python file object as being closed from " @@ -613,7 +618,7 @@ msgid "" "``f`` becomes garbage." msgstr "" -#: ../../faq/library.rst:635 +#: ../../faq/library.rst:641 msgid "" "But stdin, stdout and stderr are treated specially by Python, because of the " "special status also given to them by C. Running ``sys.stdout.close()`` " @@ -621,94 +626,94 @@ msgid "" "associated C file descriptor." msgstr "" -#: ../../faq/library.rst:640 +#: ../../faq/library.rst:646 msgid "" "To close the underlying C file descriptor for one of these three, you should " "first be sure that's what you really want to do (e.g., you may confuse " "extension modules trying to do I/O). If it is, use :func:`os.close`::" msgstr "" -#: ../../faq/library.rst:648 +#: ../../faq/library.rst:654 msgid "Or you can use the numeric constants 0, 1 and 2, respectively." msgstr "" -#: ../../faq/library.rst:652 +#: ../../faq/library.rst:658 msgid "Network/Internet Programming" msgstr "" -#: ../../faq/library.rst:655 +#: ../../faq/library.rst:661 msgid "What WWW tools are there for Python?" msgstr "" -#: ../../faq/library.rst:657 +#: ../../faq/library.rst:663 msgid "" "See the chapters titled :ref:`internet` and :ref:`netdata` in the Library " "Reference Manual. Python has many modules that will help you build server-" "side and client-side web systems." msgstr "" -#: ../../faq/library.rst:663 +#: ../../faq/library.rst:669 msgid "" "A summary of available frameworks is maintained by Paul Boddie at https://" "wiki.python.org/moin/WebProgramming\\ ." msgstr "" -#: ../../faq/library.rst:666 +#: ../../faq/library.rst:672 msgid "" "Cameron Laird maintains a useful set of pages about Python web technologies " "at http://phaseit.net/claird/comp.lang.python/web_python." msgstr "" -#: ../../faq/library.rst:671 +#: ../../faq/library.rst:677 msgid "How can I mimic CGI form submission (METHOD=POST)?" msgstr "" -#: ../../faq/library.rst:673 +#: ../../faq/library.rst:679 msgid "" "I would like to retrieve web pages that are the result of POSTing a form. Is " "there existing code that would let me do this easily?" msgstr "" -#: ../../faq/library.rst:676 +#: ../../faq/library.rst:682 msgid "Yes. Here's a simple example that uses :mod:`urllib.request`::" msgstr "" -#: ../../faq/library.rst:691 +#: ../../faq/library.rst:697 msgid "" "Note that in general for percent-encoded POST operations, query strings must " "be quoted using :func:`urllib.parse.urlencode`. For example, to send " "``name=Guy Steele, Jr.``::" msgstr "" -#: ../../faq/library.rst:699 +#: ../../faq/library.rst:705 msgid ":ref:`urllib-howto` for extensive examples." msgstr "" -#: ../../faq/library.rst:703 +#: ../../faq/library.rst:709 msgid "What module should I use to help with generating HTML?" msgstr "" -#: ../../faq/library.rst:707 +#: ../../faq/library.rst:713 msgid "" "You can find a collection of useful links on the `Web Programming wiki page " "`_." msgstr "" -#: ../../faq/library.rst:712 +#: ../../faq/library.rst:718 msgid "How do I send mail from a Python script?" msgstr "" -#: ../../faq/library.rst:714 +#: ../../faq/library.rst:720 msgid "Use the standard library module :mod:`smtplib`." msgstr "" -#: ../../faq/library.rst:716 +#: ../../faq/library.rst:722 msgid "" "Here's a very simple interactive mail sender that uses it. This method will " "work on any host that supports an SMTP listener. ::" msgstr "" -#: ../../faq/library.rst:736 +#: ../../faq/library.rst:742 msgid "" "A Unix-only alternative uses sendmail. The location of the sendmail program " "varies between systems; sometimes it is ``/usr/lib/sendmail``, sometimes ``/" @@ -716,17 +721,17 @@ msgid "" "some sample code::" msgstr "" -#: ../../faq/library.rst:756 +#: ../../faq/library.rst:762 msgid "How do I avoid blocking in the connect() method of a socket?" msgstr "" -#: ../../faq/library.rst:758 +#: ../../faq/library.rst:764 msgid "" "The :mod:`select` module is commonly used to help with asynchronous I/O on " "sockets." msgstr "" -#: ../../faq/library.rst:761 +#: ../../faq/library.rst:767 msgid "" "To prevent the TCP connect from blocking, you can set the socket to non-" "blocking mode. Then when you do the :meth:`socket.connect`, you will either " @@ -736,7 +741,7 @@ msgid "" "values, so you're going to have to check what's returned on your system." msgstr "" -#: ../../faq/library.rst:768 +#: ../../faq/library.rst:774 msgid "" "You can use the :meth:`socket.connect_ex` method to avoid creating an " "exception. It will just return the errno value. To poll, you can call :" @@ -745,7 +750,7 @@ msgid "" "select` to check if it's writable." msgstr "" -#: ../../faq/library.rst:774 +#: ../../faq/library.rst:780 msgid "" "The :mod:`asyncio` module provides a general purpose single-threaded and " "concurrent asynchronous library, which can be used for writing non-blocking " @@ -753,19 +758,19 @@ msgid "" "library is a popular and feature-rich alternative." msgstr "" -#: ../../faq/library.rst:782 +#: ../../faq/library.rst:788 msgid "Databases" msgstr "" -#: ../../faq/library.rst:785 +#: ../../faq/library.rst:791 msgid "Are there any interfaces to database packages in Python?" msgstr "" -#: ../../faq/library.rst:787 +#: ../../faq/library.rst:793 msgid "Yes." msgstr "有的" -#: ../../faq/library.rst:789 +#: ../../faq/library.rst:795 msgid "" "Interfaces to disk-based hashes such as :mod:`DBM ` and :mod:`GDBM " "` are also included with standard Python. There is also the :mod:" @@ -773,18 +778,18 @@ msgid "" "database." msgstr "" -#: ../../faq/library.rst:794 +#: ../../faq/library.rst:800 msgid "" "Support for most relational databases is available. See the " "`DatabaseProgramming wiki page `_ for details." msgstr "" -#: ../../faq/library.rst:800 +#: ../../faq/library.rst:806 msgid "How do you implement persistent objects in Python?" msgstr "" -#: ../../faq/library.rst:802 +#: ../../faq/library.rst:808 msgid "" "The :mod:`pickle` library module solves this in a very general way (though " "you still can't store things like open files, sockets or windows), and the :" @@ -792,55 +797,55 @@ msgid "" "mappings containing arbitrary Python objects." msgstr "" -#: ../../faq/library.rst:809 +#: ../../faq/library.rst:815 msgid "Mathematics and Numerics" msgstr "" -#: ../../faq/library.rst:812 +#: ../../faq/library.rst:818 msgid "How do I generate random numbers in Python?" msgstr "" -#: ../../faq/library.rst:814 +#: ../../faq/library.rst:820 msgid "" "The standard module :mod:`random` implements a random number generator. " "Usage is simple::" msgstr "" -#: ../../faq/library.rst:820 +#: ../../faq/library.rst:826 msgid "This returns a random floating point number in the range [0, 1)." msgstr "" -#: ../../faq/library.rst:822 +#: ../../faq/library.rst:828 msgid "" "There are also many other specialized generators in this module, such as:" msgstr "" -#: ../../faq/library.rst:824 +#: ../../faq/library.rst:830 msgid "``randrange(a, b)`` chooses an integer in the range [a, b)." msgstr "" -#: ../../faq/library.rst:825 +#: ../../faq/library.rst:831 msgid "``uniform(a, b)`` chooses a floating point number in the range [a, b)." msgstr "" -#: ../../faq/library.rst:826 +#: ../../faq/library.rst:832 msgid "" "``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution." msgstr "" -#: ../../faq/library.rst:828 +#: ../../faq/library.rst:834 msgid "Some higher-level functions operate on sequences directly, such as:" msgstr "" -#: ../../faq/library.rst:830 +#: ../../faq/library.rst:836 msgid "``choice(S)`` chooses a random element from a given sequence." msgstr "" -#: ../../faq/library.rst:831 +#: ../../faq/library.rst:837 msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly." msgstr "" -#: ../../faq/library.rst:833 +#: ../../faq/library.rst:839 msgid "" "There's also a ``Random`` class you can instantiate to create independent " "multiple random number generators." diff --git a/howto/annotations.po b/howto/annotations.po index ba885490b9..ccc8ec3db9 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-12-11 00:08+0000\n" +"POT-Creation-Date: 2022-06-03 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,7 +29,7 @@ msgstr "作者" msgid "Larry Hastings" msgstr "Larry Hastings" -#: ../../howto/annotations.rst:None +#: ../../howto/annotations.rst:-1 msgid "Abstract" msgstr "摘要" diff --git a/howto/clinic.po b/howto/clinic.po index 95ec880a2e..e275e3218f 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-06-03 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,7 +30,7 @@ msgstr "作者" msgid "Larry Hastings" msgstr "Larry Hastings" -#: ../../howto/clinic.rst:None +#: ../../howto/clinic.rst:-1 msgid "Abstract" msgstr "摘要" diff --git a/howto/curses.po b/howto/curses.po index 8128b77bc9..6e4246f02f 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-06-03 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,7 +38,7 @@ msgstr "發佈版本" msgid "2.04" msgstr "2.04" -#: ../../howto/curses.rst:None +#: ../../howto/curses.rst:-1 msgid "Abstract" msgstr "摘要" diff --git a/howto/ipaddress.po b/howto/ipaddress.po index a7cd455df1..e374e88d1e 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-06-03 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,7 +35,7 @@ msgstr "Peter Moody" msgid "Nick Coghlan" msgstr "Nick Coghlan" -#: ../../howto/ipaddress.rst:None +#: ../../howto/ipaddress.rst:-1 msgid "Overview" msgstr "總攬" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 4507f569be..fabce73aeb 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-30 00:09+0000\n" +"POT-Creation-Date: 2022-06-11 00:15+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-" @@ -1556,11 +1556,41 @@ msgid "" "information." msgstr "" -#: ../../howto/logging-cookbook.rst:3009 +#: ../../howto/logging-cookbook.rst:3006 +msgid "Logging to syslog with RFC5424 support" +msgstr "" + +#: ../../howto/logging-cookbook.rst:3008 +msgid "" +"Although :rfc:`5424` dates from 2009, most syslog servers are configured by " +"detault to use the older :rfc:`3164`, which hails from 2001. When " +"``logging`` was added to Python in 2003, it supported the earlier (and only " +"existing) protocol at the time. Since RFC5424 came out, as there has not " +"been widespread deployment of it in syslog servers, the :class:`~logging." +"handlers.SysLogHandler` functionality has not been updated." +msgstr "" + +#: ../../howto/logging-cookbook.rst:3015 +msgid "" +"RFC 5424 contains some useful features such as support for structured data, " +"and if you need to be able to log to a syslog server with support for it, " +"you can do so with a subclassed handler which looks something like this::" +msgstr "" + +#: ../../howto/logging-cookbook.rst:3081 +msgid "" +"You'll need to be familiar with RFC 5424 to fully understand the above code, " +"and it may be that you have slightly different needs (e.g. for how you pass " +"structural data to the log). Nevertheless, the above should be adaptable to " +"your speciric needs. With the above handler, you'd pass structured data " +"using something like this::" +msgstr "" + +#: ../../howto/logging-cookbook.rst:3098 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:3011 +#: ../../howto/logging-cookbook.rst:3100 msgid "" "Although the preceding sections have described ways of doing things you " "might need to do or deal with, it is worth mentioning some usage patterns " @@ -1568,11 +1598,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:3018 +#: ../../howto/logging-cookbook.rst:3107 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:3020 +#: ../../howto/logging-cookbook.rst:3109 msgid "" "On Windows, you will generally not be able to open the same file multiple " "times as this will lead to a \"file is in use by another process\" error. " @@ -1580,32 +1610,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:3025 +#: ../../howto/logging-cookbook.rst:3114 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." msgstr "" -#: ../../howto/logging-cookbook.rst:3028 +#: ../../howto/logging-cookbook.rst:3117 msgid "" "Opening two files that look different, as they have different names, but are " "the same because one is a symbolic link to the other." msgstr "" -#: ../../howto/logging-cookbook.rst:3031 +#: ../../howto/logging-cookbook.rst:3120 msgid "" "Forking a process, following which both parent and child have a reference to " "the same file. This might be through use of the :mod:`multiprocessing` " "module, for example." msgstr "" -#: ../../howto/logging-cookbook.rst:3035 +#: ../../howto/logging-cookbook.rst:3124 msgid "" "Opening a file multiple times might *appear* to work most of the time, but " "can lead to a number of problems in practice:" msgstr "" -#: ../../howto/logging-cookbook.rst:3038 +#: ../../howto/logging-cookbook.rst:3127 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -1614,7 +1644,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:3044 +#: ../../howto/logging-cookbook.rst:3133 msgid "" "An attempt to delete a file (e.g. during file rotation) silently fails, " "because there is another reference pointing to it. This can lead to " @@ -1622,17 +1652,17 @@ msgid "" "places, or are lost altogether." msgstr "" -#: ../../howto/logging-cookbook.rst:3049 +#: ../../howto/logging-cookbook.rst:3138 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:3053 +#: ../../howto/logging-cookbook.rst:3142 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:3055 +#: ../../howto/logging-cookbook.rst:3144 msgid "" "While there might be unusual cases where you'll need to do this, in general " "there is no point because loggers are singletons. Code can always access a " @@ -1643,12 +1673,12 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:3065 +#: ../../howto/logging-cookbook.rst:3154 msgid "" "Adding handlers other than :class:`NullHandler` to a logger in a library" msgstr "" -#: ../../howto/logging-cookbook.rst:3067 +#: ../../howto/logging-cookbook.rst:3156 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -1656,11 +1686,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:3074 +#: ../../howto/logging-cookbook.rst:3163 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:3076 +#: ../../howto/logging-cookbook.rst:3165 msgid "" "Loggers are singletons that are never freed during a script execution, and " "so creating lots of loggers will use up memory which can't then be freed. " diff --git a/howto/pyporting.po b/howto/pyporting.po index 596746e344..25f07996c6 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2022-06-03 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,7 +31,7 @@ msgstr "作者" msgid "Brett Cannon" msgstr "Brett Cannon" -#: ../../howto/pyporting.rst:None +#: ../../howto/pyporting.rst:-1 msgid "Abstract" msgstr "摘要" diff --git a/howto/regex.po b/howto/regex.po index 2414500610..fb60f29e34 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-06 00:13+0000\n" +"POT-Creation-Date: 2022-06-03 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,7 @@ msgstr "作者" msgid "A.M. Kuchling " msgstr "A.M. Kuchling " -#: ../../howto/regex.rst:None +#: ../../howto/regex.rst:-1 msgid "Abstract" msgstr "摘要" diff --git a/howto/sockets.po b/howto/sockets.po index bd633ffb90..f4aaa8e7ce 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-06-10 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,7 +30,7 @@ msgstr "作者" msgid "Gordon McMillan" msgstr "Gordon McMillan" -#: ../../howto/sockets.rst:None +#: ../../howto/sockets.rst:-1 msgid "Abstract" msgstr "摘要" @@ -310,29 +310,38 @@ msgstr "" msgid "" "It is perfectly possible to send binary data over a socket. The major " "problem is that not all machines use the same formats for binary data. For " -"example, a Motorola chip will represent a 16 bit integer with the value 1 as " -"the two hex bytes 00 01. Intel and DEC, however, are byte-reversed - that " -"same 1 is 01 00. Socket libraries have calls for converting 16 and 32 bit " -"integers - ``ntohl, htonl, ntohs, htons`` where \"n\" means *network* and \"h" -"\" means *host*, \"s\" means *short* and \"l\" means *long*. Where network " -"order is host order, these do nothing, but where the machine is byte-" -"reversed, these swap the bytes around appropriately." +"example, `network byte order `_ is big-endian, with the most significant byte " +"first, so a 16 bit integer with the value ``1`` would be the two hex bytes " +"``00 01``. However, most common processors (x86/AMD64, ARM, RISC-V), are " +"little-endian, with the least significant byte first - that same ``1`` would " +"be ``01 00``." msgstr "" -#: ../../howto/sockets.rst:264 +#: ../../howto/sockets.rst:262 msgid "" -"In these days of 32 bit machines, the ascii representation of binary data is " +"Socket libraries have calls for converting 16 and 32 bit integers - ``ntohl, " +"htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, \"s" +"\" means *short* and \"l\" means *long*. Where network order is host order, " +"these do nothing, but where the machine is byte-reversed, these swap the " +"bytes around appropriately." +msgstr "" + +#: ../../howto/sockets.rst:268 +msgid "" +"In these days of 64-bit machines, the ASCII representation of binary data is " "frequently smaller than the binary representation. That's because a " -"surprising amount of the time, all those longs have the value 0, or maybe 1. " -"The string \"0\" would be two bytes, while binary is four. Of course, this " -"doesn't fit well with fixed-length messages. Decisions, decisions." +"surprising amount of the time, most integers have the value 0, or maybe 1. " +"The string ``\"0\"`` would be two bytes, while a full 64-bit integer would " +"be 8. Of course, this doesn't fit well with fixed-length messages. " +"Decisions, decisions." msgstr "" -#: ../../howto/sockets.rst:272 +#: ../../howto/sockets.rst:277 msgid "Disconnecting" msgstr "" -#: ../../howto/sockets.rst:274 +#: ../../howto/sockets.rst:279 msgid "" "Strictly speaking, you're supposed to use ``shutdown`` on a socket before " "you ``close`` it. The ``shutdown`` is an advisory to the socket at the " @@ -344,7 +353,7 @@ msgid "" "``shutdown`` is not needed." msgstr "" -#: ../../howto/sockets.rst:282 +#: ../../howto/sockets.rst:287 msgid "" "One way to use ``shutdown`` effectively is in an HTTP-like exchange. The " "client sends a request and then does a ``shutdown(1)``. This tells the " @@ -354,7 +363,7 @@ msgid "" "successfully then, indeed, the client was still receiving." msgstr "" -#: ../../howto/sockets.rst:289 +#: ../../howto/sockets.rst:294 msgid "" "Python takes the automatic shutdown a step further, and says that when a " "socket is garbage collected, it will automatically do a ``close`` if it's " @@ -364,11 +373,11 @@ msgid "" "sockets when you're done." msgstr "" -#: ../../howto/sockets.rst:297 +#: ../../howto/sockets.rst:302 msgid "When Sockets Die" msgstr "" -#: ../../howto/sockets.rst:299 +#: ../../howto/sockets.rst:304 msgid "" "Probably the worst thing about using blocking sockets is what happens when " "the other side comes down hard (without doing a ``close``). Your socket is " @@ -383,11 +392,11 @@ msgid "" "the thread, your whole process is likely to be screwed up." msgstr "" -#: ../../howto/sockets.rst:313 +#: ../../howto/sockets.rst:318 msgid "Non-blocking Sockets" msgstr "" -#: ../../howto/sockets.rst:315 +#: ../../howto/sockets.rst:320 msgid "" "If you've understood the preceding, you already know most of what you need " "to know about the mechanics of using sockets. You'll still use the same " @@ -395,7 +404,7 @@ msgid "" "will be almost inside-out." msgstr "" -#: ../../howto/sockets.rst:320 +#: ../../howto/sockets.rst:325 msgid "" "In Python, you use ``socket.setblocking(False)`` to make it non-blocking. In " "C, it's more complex, (for one thing, you'll need to choose between the BSD " @@ -405,7 +414,7 @@ msgid "" "it. (Actually, if you're nuts, you can switch back and forth.)" msgstr "" -#: ../../howto/sockets.rst:327 +#: ../../howto/sockets.rst:332 msgid "" "The major mechanical difference is that ``send``, ``recv``, ``connect`` and " "``accept`` can return without having done anything. You have (of course) a " @@ -415,18 +424,18 @@ msgid "" "and do it right." msgstr "" -#: ../../howto/sockets.rst:334 +#: ../../howto/sockets.rst:339 msgid "Use ``select``." msgstr "" -#: ../../howto/sockets.rst:336 +#: ../../howto/sockets.rst:341 msgid "" "In C, coding ``select`` is fairly complex. In Python, it's a piece of cake, " "but it's close enough to the C version that if you understand ``select`` in " "Python, you'll have little trouble with it in C::" msgstr "" -#: ../../howto/sockets.rst:347 +#: ../../howto/sockets.rst:352 msgid "" "You pass ``select`` three lists: the first contains all sockets that you " "might want to try reading; the second all the sockets you might want to try " @@ -437,14 +446,14 @@ msgid "" "minute) unless you have good reason to do otherwise." msgstr "" -#: ../../howto/sockets.rst:355 +#: ../../howto/sockets.rst:360 msgid "" "In return, you will get three lists. They contain the sockets that are " "actually readable, writable and in error. Each of these lists is a subset " "(possibly empty) of the corresponding list you passed in." msgstr "" -#: ../../howto/sockets.rst:359 +#: ../../howto/sockets.rst:364 msgid "" "If a socket is in the output readable list, you can be as-close-to-certain-" "as-we-ever-get-in-this-business that a ``recv`` on that socket will return " @@ -454,7 +463,7 @@ msgid "" "it just means outbound network buffer space is available.)" msgstr "" -#: ../../howto/sockets.rst:366 +#: ../../howto/sockets.rst:371 msgid "" "If you have a \"server\" socket, put it in the potential_readers list. If it " "comes out in the readable list, your ``accept`` will (almost certainly) " @@ -463,7 +472,7 @@ msgid "" "have a decent chance that it has connected." msgstr "" -#: ../../howto/sockets.rst:372 +#: ../../howto/sockets.rst:377 msgid "" "Actually, ``select`` can be handy even with blocking sockets. It's one way " "of determining whether you will block - the socket returns as readable when " @@ -472,7 +481,7 @@ msgid "" "something else." msgstr "" -#: ../../howto/sockets.rst:377 +#: ../../howto/sockets.rst:382 msgid "" "**Portability alert**: On Unix, ``select`` works both with the sockets and " "files. Don't try this on Windows. On Windows, ``select`` works with sockets " diff --git a/library/argparse.po b/library/argparse.po index 210a71b23c..14803ca9b5 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-06-03 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgstr "" msgid "**Source code:** :source:`Lib/argparse.py`" msgstr "**原始碼:**\\ :source:`Lib/argparse.py`" -#: ../../library/argparse.rst:None +#: ../../library/argparse.rst:-1 msgid "Tutorial" msgstr "教學" diff --git a/library/array.po b/library/array.po index d5f342e230..d273621a56 100644 --- a/library/array.po +++ b/library/array.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-06-07 00:13+0000\n" "PO-Revision-Date: 2021-11-23 18:40+0800\n" "Last-Translator: Benson Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -212,7 +212,7 @@ msgstr "根據平台的不同,它有可能是 16 位元或者 32 位元。" #: ../../library/array.rst:53 msgid "" "``array('u')`` now uses ``wchar_t`` as C type instead of deprecated " -"``Py_UNICODE``. This change doesn't affect to its behavior because " +"``Py_UNICODE``. This change doesn't affect its behavior because " "``Py_UNICODE`` is alias of ``wchar_t`` since Python 3.3." msgstr "" "目前 ``array(‘u’)`` 使用 ``wchar_t`` 取代已棄用的 ``Py_UNICODE`` 作為 C " diff --git a/library/asyncio-task.po b/library/asyncio-task.po index c9dfd59440..c201323876 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-06-08 00:14+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -212,8 +212,8 @@ msgid "" "ideally only be called once." msgstr "" -#: ../../library/asyncio-task.rst:230 ../../library/asyncio-task.rst:357 -#: ../../library/asyncio-task.rst:490 ../../library/asyncio-task.rst:626 +#: ../../library/asyncio-task.rst:230 ../../library/asyncio-task.rst:374 +#: ../../library/asyncio-task.rst:507 ../../library/asyncio-task.rst:643 msgid "Example::" msgstr "" "範例:\n" @@ -255,83 +255,86 @@ msgstr "" #: ../../library/asyncio-task.rst:264 msgid "" "Save a reference to the result of this function, to avoid a task " -"disappearing mid execution." +"disappearing mid execution. The event loop only keeps weak references to " +"tasks. A task that isn't referenced elsewhere may get garbage-collected at " +"any time, even before it's done. For reliable \"fire-and-forget\" background " +"tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:269 ../../library/asyncio-task.rst:815 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:832 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" -#: ../../library/asyncio-task.rst:274 +#: ../../library/asyncio-task.rst:291 msgid "Sleeping" msgstr "" -#: ../../library/asyncio-task.rst:278 +#: ../../library/asyncio-task.rst:295 msgid "Block for *delay* seconds." msgstr "" -#: ../../library/asyncio-task.rst:280 +#: ../../library/asyncio-task.rst:297 msgid "" "If *result* is provided, it is returned to the caller when the coroutine " "completes." msgstr "" -#: ../../library/asyncio-task.rst:283 +#: ../../library/asyncio-task.rst:300 msgid "" "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" -#: ../../library/asyncio-task.rst:286 +#: ../../library/asyncio-task.rst:303 msgid "" "Setting the delay to 0 provides an optimized path to allow other tasks to " "run. This can be used by long-running functions to avoid blocking the event " "loop for the full duration of the function call." msgstr "" -#: ../../library/asyncio-task.rst:295 +#: ../../library/asyncio-task.rst:312 msgid "" "The ``loop`` parameter. This function has been implicitly getting the " "current running loop since 3.7. See :ref:`What's New in 3.10's Removed " "section ` for more information." msgstr "" -#: ../../library/asyncio-task.rst:298 +#: ../../library/asyncio-task.rst:315 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "" -#: ../../library/asyncio-task.rst:316 ../../library/asyncio-task.rst:352 -#: ../../library/asyncio-task.rst:406 ../../library/asyncio-task.rst:451 -#: ../../library/asyncio-task.rst:485 ../../library/asyncio-task.rst:515 -#: ../../library/asyncio-task.rst:574 ../../library/asyncio-task.rst:609 -#: ../../library/asyncio-task.rst:623 ../../library/asyncio-task.rst:632 +#: ../../library/asyncio-task.rst:333 ../../library/asyncio-task.rst:369 +#: ../../library/asyncio-task.rst:423 ../../library/asyncio-task.rst:468 +#: ../../library/asyncio-task.rst:502 ../../library/asyncio-task.rst:532 +#: ../../library/asyncio-task.rst:591 ../../library/asyncio-task.rst:626 +#: ../../library/asyncio-task.rst:640 ../../library/asyncio-task.rst:649 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-task.rst:321 +#: ../../library/asyncio-task.rst:338 msgid "Running Tasks Concurrently" msgstr "" -#: ../../library/asyncio-task.rst:325 +#: ../../library/asyncio-task.rst:342 msgid "" "Run :ref:`awaitable objects ` in the *aws* sequence " "*concurrently*." msgstr "" -#: ../../library/asyncio-task.rst:328 +#: ../../library/asyncio-task.rst:345 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task." msgstr "" -#: ../../library/asyncio-task.rst:331 +#: ../../library/asyncio-task.rst:348 msgid "" "If all awaitables are completed successfully, the result is an aggregate " "list of returned values. The order of result values corresponds to the " "order of awaitables in *aws*." msgstr "" -#: ../../library/asyncio-task.rst:335 +#: ../../library/asyncio-task.rst:352 msgid "" "If *return_exceptions* is ``False`` (default), the first raised exception is " "immediately propagated to the task that awaits on ``gather()``. Other " @@ -339,19 +342,19 @@ msgid "" "run." msgstr "" -#: ../../library/asyncio-task.rst:340 +#: ../../library/asyncio-task.rst:357 msgid "" "If *return_exceptions* is ``True``, exceptions are treated the same as " "successful results, and aggregated in the result list." msgstr "" -#: ../../library/asyncio-task.rst:343 +#: ../../library/asyncio-task.rst:360 msgid "" "If ``gather()`` is *cancelled*, all submitted awaitables (that have not " "completed yet) are also *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:346 +#: ../../library/asyncio-task.rst:363 msgid "" "If any Task or Future from the *aws* sequence is *cancelled*, it is treated " "as if it raised :exc:`CancelledError` -- the ``gather()`` call is **not** " @@ -359,7 +362,7 @@ msgid "" "submitted Task/Future to cause other Tasks/Futures to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:395 +#: ../../library/asyncio-task.rst:412 msgid "" "If *return_exceptions* is False, cancelling gather() after it has been " "marked done won't cancel any submitted awaitables. For instance, gather can " @@ -368,42 +371,42 @@ msgid "" "the awaitables) from gather won't cancel any other awaitables." msgstr "" -#: ../../library/asyncio-task.rst:402 +#: ../../library/asyncio-task.rst:419 msgid "" "If the *gather* itself is cancelled, the cancellation is propagated " "regardless of *return_exceptions*." msgstr "" -#: ../../library/asyncio-task.rst:409 +#: ../../library/asyncio-task.rst:426 msgid "" "Deprecation warning is emitted if no positional arguments are provided or " "not all positional arguments are Future-like objects and there is no running " "event loop." msgstr "" -#: ../../library/asyncio-task.rst:416 +#: ../../library/asyncio-task.rst:433 msgid "Shielding From Cancellation" msgstr "" -#: ../../library/asyncio-task.rst:420 +#: ../../library/asyncio-task.rst:437 msgid "" "Protect an :ref:`awaitable object ` from being :meth:" "`cancelled `." msgstr "" -#: ../../library/asyncio-task.rst:423 ../../library/asyncio-task.rst:467 +#: ../../library/asyncio-task.rst:440 ../../library/asyncio-task.rst:484 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" -#: ../../library/asyncio-task.rst:425 +#: ../../library/asyncio-task.rst:442 msgid "The statement::" msgstr "" -#: ../../library/asyncio-task.rst:429 +#: ../../library/asyncio-task.rst:446 msgid "is equivalent to::" msgstr "" -#: ../../library/asyncio-task.rst:433 +#: ../../library/asyncio-task.rst:450 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -412,178 +415,178 @@ msgid "" "`CancelledError`." msgstr "" -#: ../../library/asyncio-task.rst:439 +#: ../../library/asyncio-task.rst:456 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." msgstr "" -#: ../../library/asyncio-task.rst:442 +#: ../../library/asyncio-task.rst:459 msgid "" "If it is desired to completely ignore cancellation (not recommended) the " "``shield()`` function should be combined with a try/except clause, as " "follows::" msgstr "" -#: ../../library/asyncio-task.rst:454 +#: ../../library/asyncio-task.rst:471 msgid "" "Deprecation warning is emitted if *aw* is not Future-like object and there " "is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:460 +#: ../../library/asyncio-task.rst:477 msgid "Timeouts" msgstr "" -#: ../../library/asyncio-task.rst:464 +#: ../../library/asyncio-task.rst:481 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." msgstr "" -#: ../../library/asyncio-task.rst:469 +#: ../../library/asyncio-task.rst:486 msgid "" "*timeout* can either be ``None`` or a float or int number of seconds to wait " "for. If *timeout* is ``None``, block until the future completes." msgstr "" -#: ../../library/asyncio-task.rst:473 +#: ../../library/asyncio-task.rst:490 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`asyncio." "TimeoutError`." msgstr "" -#: ../../library/asyncio-task.rst:476 +#: ../../library/asyncio-task.rst:493 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." msgstr "" -#: ../../library/asyncio-task.rst:479 +#: ../../library/asyncio-task.rst:496 msgid "" "The function will wait until the future is actually cancelled, so the total " "wait time may exceed the *timeout*. If an exception happens during " "cancellation, it is propagated." msgstr "" -#: ../../library/asyncio-task.rst:483 +#: ../../library/asyncio-task.rst:500 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:510 +#: ../../library/asyncio-task.rst:527 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`asyncio.TimeoutError` immediately." msgstr "" -#: ../../library/asyncio-task.rst:520 +#: ../../library/asyncio-task.rst:537 msgid "Waiting Primitives" msgstr "" -#: ../../library/asyncio-task.rst:524 +#: ../../library/asyncio-task.rst:541 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently and block until the condition specified by *return_when*." msgstr "" -#: ../../library/asyncio-task.rst:528 +#: ../../library/asyncio-task.rst:545 msgid "The *aws* iterable must not be empty." msgstr "" -#: ../../library/asyncio-task.rst:530 +#: ../../library/asyncio-task.rst:547 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: ../../library/asyncio-task.rst:532 +#: ../../library/asyncio-task.rst:549 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-task.rst:536 +#: ../../library/asyncio-task.rst:553 msgid "" "*timeout* (a float or int), if specified, can be used to control the maximum " "number of seconds to wait before returning." msgstr "" -#: ../../library/asyncio-task.rst:539 +#: ../../library/asyncio-task.rst:556 msgid "" "Note that this function does not raise :exc:`asyncio.TimeoutError`. Futures " "or Tasks that aren't done when the timeout occurs are simply returned in the " "second set." msgstr "" -#: ../../library/asyncio-task.rst:543 +#: ../../library/asyncio-task.rst:560 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/asyncio-task.rst:549 +#: ../../library/asyncio-task.rst:566 msgid "Constant" msgstr "常數" -#: ../../library/asyncio-task.rst:549 +#: ../../library/asyncio-task.rst:566 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:551 +#: ../../library/asyncio-task.rst:568 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/asyncio-task.rst:551 +#: ../../library/asyncio-task.rst:568 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:554 +#: ../../library/asyncio-task.rst:571 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/asyncio-task.rst:554 +#: ../../library/asyncio-task.rst:571 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: ../../library/asyncio-task.rst:560 +#: ../../library/asyncio-task.rst:577 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/asyncio-task.rst:560 +#: ../../library/asyncio-task.rst:577 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:564 +#: ../../library/asyncio-task.rst:581 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:569 +#: ../../library/asyncio-task.rst:586 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task. Passing coroutines objects to ``wait()`` directly is deprecated as it " "leads to :ref:`confusing behavior `." msgstr "" -#: ../../library/asyncio-task.rst:580 +#: ../../library/asyncio-task.rst:597 msgid "" "``wait()`` schedules coroutines as Tasks automatically and later returns " "those implicitly created Task objects in ``(done, pending)`` sets. " "Therefore the following code won't work as expected::" msgstr "" -#: ../../library/asyncio-task.rst:593 +#: ../../library/asyncio-task.rst:610 msgid "Here is how the above snippet can be fixed::" msgstr "" -#: ../../library/asyncio-task.rst:606 +#: ../../library/asyncio-task.rst:623 msgid "Passing coroutine objects to ``wait()`` directly is deprecated." msgstr "" -#: ../../library/asyncio-task.rst:615 +#: ../../library/asyncio-task.rst:632 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently. Return an iterator of coroutines. Each coroutine returned can " @@ -591,27 +594,27 @@ msgid "" "remaining awaitables." msgstr "" -#: ../../library/asyncio-task.rst:620 +#: ../../library/asyncio-task.rst:637 msgid "" "Raises :exc:`asyncio.TimeoutError` if the timeout occurs before all Futures " "are done." msgstr "" -#: ../../library/asyncio-task.rst:635 +#: ../../library/asyncio-task.rst:652 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:641 +#: ../../library/asyncio-task.rst:658 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:645 +#: ../../library/asyncio-task.rst:662 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:647 +#: ../../library/asyncio-task.rst:664 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -619,19 +622,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:652 +#: ../../library/asyncio-task.rst:669 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:654 +#: ../../library/asyncio-task.rst:671 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were ran in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:684 +#: ../../library/asyncio-task.rst:701 msgid "" "Directly calling `blocking_io()` in any coroutine would block the event loop " "for its duration, resulting in an additional 1 second of run time. Instead, " @@ -639,7 +642,7 @@ msgid "" "blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:691 +#: ../../library/asyncio-task.rst:708 msgid "" "Due to the :term:`GIL`, `asyncio.to_thread()` can typically only be used to " "make IO-bound functions non-blocking. However, for extension modules that " @@ -647,81 +650,81 @@ msgid "" "`asyncio.to_thread()` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:700 +#: ../../library/asyncio-task.rst:717 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:704 +#: ../../library/asyncio-task.rst:721 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:706 +#: ../../library/asyncio-task.rst:723 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:709 +#: ../../library/asyncio-task.rst:726 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: ../../library/asyncio-task.rst:721 +#: ../../library/asyncio-task.rst:738 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: ../../library/asyncio-task.rst:735 +#: ../../library/asyncio-task.rst:752 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:738 +#: ../../library/asyncio-task.rst:755 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:745 +#: ../../library/asyncio-task.rst:762 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:750 +#: ../../library/asyncio-task.rst:767 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:753 +#: ../../library/asyncio-task.rst:770 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:761 +#: ../../library/asyncio-task.rst:778 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:764 +#: ../../library/asyncio-task.rst:781 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:771 +#: ../../library/asyncio-task.rst:788 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:775 +#: ../../library/asyncio-task.rst:792 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:778 +#: ../../library/asyncio-task.rst:795 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -729,21 +732,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:784 +#: ../../library/asyncio-task.rst:801 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:789 +#: ../../library/asyncio-task.rst:806 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:794 +#: ../../library/asyncio-task.rst:811 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -751,47 +754,47 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:799 +#: ../../library/asyncio-task.rst:816 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:804 +#: ../../library/asyncio-task.rst:821 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:808 +#: ../../library/asyncio-task.rst:825 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:812 +#: ../../library/asyncio-task.rst:829 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:818 +#: ../../library/asyncio-task.rst:835 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:824 +#: ../../library/asyncio-task.rst:841 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:826 +#: ../../library/asyncio-task.rst:843 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:829 +#: ../../library/asyncio-task.rst:846 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -801,103 +804,103 @@ msgid "" "is actively discouraged." msgstr "" -#: ../../library/asyncio-task.rst:837 +#: ../../library/asyncio-task.rst:854 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:842 +#: ../../library/asyncio-task.rst:859 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:881 +#: ../../library/asyncio-task.rst:898 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:883 +#: ../../library/asyncio-task.rst:900 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:889 +#: ../../library/asyncio-task.rst:906 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:891 +#: ../../library/asyncio-task.rst:908 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:896 +#: ../../library/asyncio-task.rst:913 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:898 +#: ../../library/asyncio-task.rst:915 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:902 ../../library/asyncio-task.rst:916 +#: ../../library/asyncio-task.rst:919 ../../library/asyncio-task.rst:933 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:905 +#: ../../library/asyncio-task.rst:922 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:910 +#: ../../library/asyncio-task.rst:927 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:912 +#: ../../library/asyncio-task.rst:929 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:919 +#: ../../library/asyncio-task.rst:936 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:924 +#: ../../library/asyncio-task.rst:941 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:926 ../../library/asyncio-task.rst:935 +#: ../../library/asyncio-task.rst:943 ../../library/asyncio-task.rst:952 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:928 +#: ../../library/asyncio-task.rst:945 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:933 +#: ../../library/asyncio-task.rst:950 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:937 +#: ../../library/asyncio-task.rst:954 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:942 +#: ../../library/asyncio-task.rst:959 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:944 +#: ../../library/asyncio-task.rst:961 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -905,15 +908,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:950 +#: ../../library/asyncio-task.rst:967 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:952 +#: ../../library/asyncio-task.rst:969 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:954 +#: ../../library/asyncio-task.rst:971 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -922,111 +925,111 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:963 +#: ../../library/asyncio-task.rst:980 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:965 +#: ../../library/asyncio-task.rst:982 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:968 +#: ../../library/asyncio-task.rst:985 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:970 +#: ../../library/asyncio-task.rst:987 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stderr`." msgstr "" -#: ../../library/asyncio-task.rst:975 +#: ../../library/asyncio-task.rst:992 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:981 +#: ../../library/asyncio-task.rst:998 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:983 +#: ../../library/asyncio-task.rst:1000 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:991 +#: ../../library/asyncio-task.rst:1008 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:993 +#: ../../library/asyncio-task.rst:1010 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:996 +#: ../../library/asyncio-task.rst:1013 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1005 +#: ../../library/asyncio-task.rst:1022 msgid "Generator-based Coroutines" msgstr "" -#: ../../library/asyncio-task.rst:1009 +#: ../../library/asyncio-task.rst:1026 msgid "" "Support for generator-based coroutines is **deprecated** and is removed in " "Python 3.11." msgstr "" -#: ../../library/asyncio-task.rst:1012 +#: ../../library/asyncio-task.rst:1029 msgid "" "Generator-based coroutines predate async/await syntax. They are Python " "generators that use ``yield from`` expressions to await on Futures and other " "coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1016 +#: ../../library/asyncio-task.rst:1033 msgid "" "Generator-based coroutines should be decorated with :func:`@asyncio." "coroutine `, although this is not enforced." msgstr "" -#: ../../library/asyncio-task.rst:1023 +#: ../../library/asyncio-task.rst:1040 msgid "Decorator to mark generator-based coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1025 +#: ../../library/asyncio-task.rst:1042 msgid "" "This decorator enables legacy generator-based coroutines to be compatible " "with async/await code::" msgstr "" -#: ../../library/asyncio-task.rst:1035 +#: ../../library/asyncio-task.rst:1052 msgid "This decorator should not be used for :keyword:`async def` coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1040 +#: ../../library/asyncio-task.rst:1057 msgid "Use :keyword:`async def` instead." msgstr "" -#: ../../library/asyncio-task.rst:1044 +#: ../../library/asyncio-task.rst:1061 msgid "Return ``True`` if *obj* is a :ref:`coroutine object `." msgstr "" -#: ../../library/asyncio-task.rst:1046 +#: ../../library/asyncio-task.rst:1063 msgid "" "This method is different from :func:`inspect.iscoroutine` because it returns " "``True`` for generator-based coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1051 +#: ../../library/asyncio-task.rst:1068 msgid "Return ``True`` if *func* is a :ref:`coroutine function `." msgstr "" -#: ../../library/asyncio-task.rst:1054 +#: ../../library/asyncio-task.rst:1071 msgid "" "This method is different from :func:`inspect.iscoroutinefunction` because it " "returns ``True`` for generator-based coroutine functions decorated with :" diff --git a/library/asyncio.po b/library/asyncio.po index d085d6d888..9e426c6d77 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-06-03 00:13+0000\n" "PO-Revision-Date: 2021-11-23 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,7 +36,7 @@ msgstr "指南與教學" msgid ":mod:`asyncio` --- Asynchronous I/O" msgstr ":mod:`asyncio` --- 非同步 I/O" -#: ../../library/asyncio.rst:None +#: ../../library/asyncio.rst:-1 msgid "Hello World!" msgstr "Hello World!" diff --git a/library/hashlib.po b/library/hashlib.po index 9d99a04486..f2598b23e4 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-02 00:17+0000\n" +"POT-Creation-Date: 2022-06-03 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -502,7 +502,7 @@ msgid "" "(`False` for sequential mode)." msgstr "" -#: ../../library/hashlib.rst:None +#: ../../library/hashlib.rst:-1 msgid "Explanation of tree mode parameters." msgstr "" diff --git a/library/logging.po b/library/logging.po index 703f97db54..9c70a33b41 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-30 00:18+0000\n" +"POT-Creation-Date: 2022-06-11 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -60,43 +60,47 @@ msgid "" msgstr "" #: ../../library/logging.rst:33 +msgid "The simplest example:" +msgstr "" + +#: ../../library/logging.rst:41 msgid "" "The module provides a lot of functionality and flexibility. If you are " -"unfamiliar with logging, the best way to get to grips with it is to see the " -"tutorials (see the links on the right)." +"unfamiliar with logging, the best way to get to grips with it is to view the " +"tutorials (**see the links above and on the right**)." msgstr "" -#: ../../library/logging.rst:37 +#: ../../library/logging.rst:45 msgid "" "The basic classes defined by the module, together with their functions, are " "listed below." msgstr "" -#: ../../library/logging.rst:40 +#: ../../library/logging.rst:48 msgid "Loggers expose the interface that application code directly uses." msgstr "" -#: ../../library/logging.rst:41 +#: ../../library/logging.rst:49 msgid "" "Handlers send the log records (created by loggers) to the appropriate " "destination." msgstr "" -#: ../../library/logging.rst:43 +#: ../../library/logging.rst:51 msgid "" "Filters provide a finer grained facility for determining which log records " "to output." msgstr "" -#: ../../library/logging.rst:45 +#: ../../library/logging.rst:53 msgid "Formatters specify the layout of log records in the final output." msgstr "" -#: ../../library/logging.rst:51 +#: ../../library/logging.rst:59 msgid "Logger Objects" msgstr "" -#: ../../library/logging.rst:53 +#: ../../library/logging.rst:61 msgid "" "Loggers have the following attributes and methods. Note that Loggers should " "*NEVER* be instantiated directly, but always through the module-level " @@ -104,7 +108,7 @@ msgid "" "with the same name will always return a reference to the same Logger object." msgstr "" -#: ../../library/logging.rst:58 +#: ../../library/logging.rst:66 msgid "" "The ``name`` is potentially a period-separated hierarchical value, like " "``foo.bar.baz`` (though it could also be just plain ``foo``, for example). " @@ -118,7 +122,7 @@ msgid "" "module's name in the Python package namespace." msgstr "" -#: ../../library/logging.rst:74 +#: ../../library/logging.rst:82 msgid "" "If this attribute evaluates to true, events logged to this logger will be " "passed to the handlers of higher level (ancestor) loggers, in addition to " @@ -127,13 +131,13 @@ msgid "" "loggers in question are considered." msgstr "" -#: ../../library/logging.rst:80 +#: ../../library/logging.rst:88 msgid "" "If this evaluates to false, logging messages are not passed to the handlers " "of ancestor loggers." msgstr "" -#: ../../library/logging.rst:83 +#: ../../library/logging.rst:91 msgid "" "Spelling it out with an example: If the propagate attribute of the logger " "named ``A.B.C`` evaluates to true, any event logged to ``A.B.C`` via a " @@ -146,11 +150,11 @@ msgid "" "handle, and propagation stops at that point." msgstr "" -#: ../../library/logging.rst:92 +#: ../../library/logging.rst:100 msgid "The constructor sets this attribute to ``True``." msgstr "" -#: ../../library/logging.rst:94 +#: ../../library/logging.rst:102 msgid "" "If you attach a handler to a logger *and* one or more of its ancestors, it " "may emit the same record multiple times. In general, you should not need to " @@ -162,7 +166,7 @@ msgid "" "rest." msgstr "" -#: ../../library/logging.rst:105 +#: ../../library/logging.rst:113 msgid "" "Sets the threshold for this logger to *level*. Logging messages which are " "less severe than *level* will be ignored; logging messages which have " @@ -171,7 +175,7 @@ msgid "" "severity level than *level*." msgstr "" -#: ../../library/logging.rst:110 +#: ../../library/logging.rst:118 msgid "" "When a logger is created, the level is set to :const:`NOTSET` (which causes " "all messages to be processed when the logger is the root logger, or " @@ -179,32 +183,32 @@ msgid "" "the root logger is created with level :const:`WARNING`." msgstr "" -#: ../../library/logging.rst:115 +#: ../../library/logging.rst:123 msgid "" "The term 'delegation to the parent' means that if a logger has a level of " "NOTSET, its chain of ancestor loggers is traversed until either an ancestor " "with a level other than NOTSET is found, or the root is reached." msgstr "" -#: ../../library/logging.rst:119 +#: ../../library/logging.rst:127 msgid "" "If an ancestor is found with a level other than NOTSET, then that ancestor's " "level is treated as the effective level of the logger where the ancestor " "search began, and is used to determine how a logging event is handled." msgstr "" -#: ../../library/logging.rst:123 +#: ../../library/logging.rst:131 msgid "" "If the root is reached, and it has a level of NOTSET, then all messages will " "be processed. Otherwise, the root's level will be used as the effective " "level." msgstr "" -#: ../../library/logging.rst:126 ../../library/logging.rst:439 +#: ../../library/logging.rst:134 ../../library/logging.rst:447 msgid "See :ref:`levels` for a list of levels." msgstr "層級清單請見 :ref:`levels`\\ 。" -#: ../../library/logging.rst:128 +#: ../../library/logging.rst:136 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`. " @@ -213,7 +217,7 @@ msgid "" "expect to be passed integers." msgstr "" -#: ../../library/logging.rst:138 +#: ../../library/logging.rst:146 msgid "" "Indicates if a message of severity *level* would be processed by this " "logger. This method checks first the module-level level set by ``logging." @@ -221,7 +225,7 @@ msgid "" "meth:`getEffectiveLevel`." msgstr "" -#: ../../library/logging.rst:146 +#: ../../library/logging.rst:154 msgid "" "Indicates the effective level for this logger. If a value other than :const:" "`NOTSET` has been set using :meth:`setLevel`, it is returned. Otherwise, the " @@ -230,7 +234,7 @@ msgid "" "integer, typically one of :const:`logging.DEBUG`, :const:`logging.INFO` etc." msgstr "" -#: ../../library/logging.rst:156 +#: ../../library/logging.rst:164 msgid "" "Returns a logger which is a descendant to this logger, as determined by the " "suffix. Thus, ``logging.getLogger('abc').getChild('def.ghi')`` would return " @@ -239,7 +243,7 @@ msgid "" "named using e.g. ``__name__`` rather than a literal string." msgstr "" -#: ../../library/logging.rst:167 +#: ../../library/logging.rst:175 msgid "" "Logs a message with level :const:`DEBUG` on this logger. The *msg* is the " "message format string, and the *args* are the arguments which are merged " @@ -249,13 +253,13 @@ msgid "" "are supplied." msgstr "" -#: ../../library/logging.rst:173 +#: ../../library/logging.rst:181 msgid "" "There are four keyword arguments in *kwargs* which are inspected: " "*exc_info*, *stack_info*, *stacklevel* and *extra*." msgstr "" -#: ../../library/logging.rst:176 +#: ../../library/logging.rst:184 msgid "" "If *exc_info* does not evaluate as false, it causes exception information to " "be added to the logging message. If an exception tuple (in the format " @@ -264,7 +268,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:181 ../../library/logging.rst:990 +#: ../../library/logging.rst:189 ../../library/logging.rst:998 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -276,20 +280,20 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:190 ../../library/logging.rst:999 +#: ../../library/logging.rst:198 ../../library/logging.rst:1007 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:198 ../../library/logging.rst:1007 +#: ../../library/logging.rst:206 ../../library/logging.rst:1015 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." msgstr "" -#: ../../library/logging.rst:201 +#: ../../library/logging.rst:209 msgid "" "The third optional keyword argument is *stacklevel*, which defaults to " "``1``. If greater than 1, the corresponding number of stack frames are " @@ -301,7 +305,7 @@ msgid "" "module." msgstr "" -#: ../../library/logging.rst:209 +#: ../../library/logging.rst:217 msgid "" "The fourth keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the :class:`LogRecord` " @@ -310,18 +314,18 @@ msgid "" "incorporated into logged messages. For example::" msgstr "" -#: ../../library/logging.rst:221 +#: ../../library/logging.rst:229 msgid "would print something like" msgstr "" -#: ../../library/logging.rst:227 ../../library/logging.rst:1027 +#: ../../library/logging.rst:235 ../../library/logging.rst:1035 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:231 +#: ../../library/logging.rst:239 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:" @@ -332,7 +336,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:238 ../../library/logging.rst:1038 +#: ../../library/logging.rst:246 ../../library/logging.rst:1046 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -343,78 +347,78 @@ msgid "" "particular :class:`Handler`\\ s." msgstr "" -#: ../../library/logging.rst:245 +#: ../../library/logging.rst:253 msgid "" "If no handler is attached to this logger (or any of its ancestors, taking " "into account the relevant :attr:`Logger.propagate` attributes), the message " "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:249 ../../library/logging.rst:1049 +#: ../../library/logging.rst:257 ../../library/logging.rst:1057 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" -#: ../../library/logging.rst:252 +#: ../../library/logging.rst:260 msgid "The *exc_info* parameter can now accept exception instances." msgstr "" -#: ../../library/logging.rst:255 +#: ../../library/logging.rst:263 msgid "The *stacklevel* parameter was added." msgstr "新增 *stacklevel* 參數。" -#: ../../library/logging.rst:261 +#: ../../library/logging.rst:269 msgid "" "Logs a message with level :const:`INFO` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:267 +#: ../../library/logging.rst:275 msgid "" "Logs a message with level :const:`WARNING` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:270 +#: ../../library/logging.rst:278 msgid "" "There is an obsolete method ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:276 +#: ../../library/logging.rst:284 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:282 +#: ../../library/logging.rst:290 msgid "" "Logs a message with level :const:`CRITICAL` on this logger. The arguments " "are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:288 +#: ../../library/logging.rst:296 msgid "" "Logs a message with integer level *level* on this logger. The other " "arguments are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:294 +#: ../../library/logging.rst:302 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`. Exception info is added to the logging " "message. This method should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:301 +#: ../../library/logging.rst:309 msgid "Adds the specified filter *filter* to this logger." msgstr "" -#: ../../library/logging.rst:306 +#: ../../library/logging.rst:314 msgid "Removes the specified filter *filter* from this logger." msgstr "" -#: ../../library/logging.rst:311 +#: ../../library/logging.rst:319 msgid "" "Apply this logger'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 " @@ -423,22 +427,22 @@ msgid "" "processing of the record occurs." msgstr "" -#: ../../library/logging.rst:320 +#: ../../library/logging.rst:328 msgid "Adds the specified handler *hdlr* to this logger." msgstr "" -#: ../../library/logging.rst:325 +#: ../../library/logging.rst:333 msgid "Removes the specified handler *hdlr* from this logger." msgstr "" -#: ../../library/logging.rst:330 +#: ../../library/logging.rst:338 msgid "" "Finds the caller's source filename and line number. Returns the filename, " "line number, function name and stack information as a 4-element tuple. The " "stack information is returned as ``None`` unless *stack_info* is ``True``." msgstr "" -#: ../../library/logging.rst:334 +#: ../../library/logging.rst:342 msgid "" "The *stacklevel* parameter is passed from code calling the :meth:`debug` and " "other APIs. If greater than 1, the excess is used to skip stack frames " @@ -448,7 +452,7 @@ msgid "" "calls it." msgstr "" -#: ../../library/logging.rst:344 +#: ../../library/logging.rst:352 msgid "" "Handles a record by passing it to all handlers associated with this logger " "and its ancestors (until a false value of *propagate* is found). This method " @@ -457,13 +461,13 @@ msgid "" "filter`." msgstr "" -#: ../../library/logging.rst:352 +#: ../../library/logging.rst:360 msgid "" "This is a factory method which can be overridden in subclasses to create " "specialized :class:`LogRecord` instances." msgstr "" -#: ../../library/logging.rst:357 +#: ../../library/logging.rst:365 msgid "" "Checks to see if this logger has any handlers configured. This is done by " "looking for handlers in this logger and its parents in the logger hierarchy. " @@ -473,15 +477,15 @@ msgid "" "the existence of handlers." msgstr "" -#: ../../library/logging.rst:366 +#: ../../library/logging.rst:374 msgid "Loggers can now be pickled and unpickled." msgstr "" -#: ../../library/logging.rst:372 +#: ../../library/logging.rst:380 msgid "Logging Levels" msgstr "" -#: ../../library/logging.rst:374 +#: ../../library/logging.rst:382 msgid "" "The numeric values of logging levels are given in the following table. These " "are primarily of interest if you want to define your own levels, and need " @@ -490,67 +494,67 @@ msgid "" "value; the predefined name is lost." msgstr "" -#: ../../library/logging.rst:381 +#: ../../library/logging.rst:389 msgid "Level" msgstr "" -#: ../../library/logging.rst:381 +#: ../../library/logging.rst:389 msgid "Numeric value" msgstr "" -#: ../../library/logging.rst:383 +#: ../../library/logging.rst:391 msgid "``CRITICAL``" msgstr "``CRITICAL``" -#: ../../library/logging.rst:383 +#: ../../library/logging.rst:391 msgid "50" msgstr "50" -#: ../../library/logging.rst:385 +#: ../../library/logging.rst:393 msgid "``ERROR``" msgstr "``ERROR``" -#: ../../library/logging.rst:385 +#: ../../library/logging.rst:393 msgid "40" msgstr "40" -#: ../../library/logging.rst:387 +#: ../../library/logging.rst:395 msgid "``WARNING``" msgstr "``WARNING``" -#: ../../library/logging.rst:387 +#: ../../library/logging.rst:395 msgid "30" msgstr "30" -#: ../../library/logging.rst:389 +#: ../../library/logging.rst:397 msgid "``INFO``" msgstr "``INFO``" -#: ../../library/logging.rst:389 +#: ../../library/logging.rst:397 msgid "20" msgstr "20" -#: ../../library/logging.rst:391 +#: ../../library/logging.rst:399 msgid "``DEBUG``" msgstr "``DEBUG``" -#: ../../library/logging.rst:391 +#: ../../library/logging.rst:399 msgid "10" msgstr "10" -#: ../../library/logging.rst:393 +#: ../../library/logging.rst:401 msgid "``NOTSET``" msgstr "``NOTSET``" -#: ../../library/logging.rst:393 +#: ../../library/logging.rst:401 msgid "0" msgstr "0" -#: ../../library/logging.rst:400 +#: ../../library/logging.rst:408 msgid "Handler Objects" msgstr "" -#: ../../library/logging.rst:402 +#: ../../library/logging.rst:410 msgid "" "Handlers have the following attributes and methods. Note that :class:" "`Handler` is never instantiated directly; this class acts as a base for more " @@ -558,53 +562,53 @@ msgid "" "to call :meth:`Handler.__init__`." msgstr "" -#: ../../library/logging.rst:411 +#: ../../library/logging.rst:419 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:418 +#: ../../library/logging.rst:426 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:424 +#: ../../library/logging.rst:432 msgid "Acquires the thread lock created with :meth:`createLock`." msgstr "" -#: ../../library/logging.rst:429 +#: ../../library/logging.rst:437 msgid "Releases the thread lock acquired with :meth:`acquire`." msgstr "" -#: ../../library/logging.rst:434 +#: ../../library/logging.rst:442 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:441 +#: ../../library/logging.rst:449 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:449 +#: ../../library/logging.rst:457 msgid "Sets the :class:`Formatter` for this handler to *fmt*." msgstr "" -#: ../../library/logging.rst:454 +#: ../../library/logging.rst:462 msgid "Adds the specified filter *filter* to this handler." msgstr "" -#: ../../library/logging.rst:459 +#: ../../library/logging.rst:467 msgid "Removes the specified filter *filter* from this handler." msgstr "" -#: ../../library/logging.rst:464 +#: ../../library/logging.rst:472 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 " @@ -613,13 +617,13 @@ msgid "" "record." msgstr "" -#: ../../library/logging.rst:473 +#: ../../library/logging.rst:481 msgid "" "Ensure all logging output has been flushed. This version does nothing and is " "intended to be implemented by subclasses." msgstr "" -#: ../../library/logging.rst:479 +#: ../../library/logging.rst:487 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 :" @@ -627,14 +631,14 @@ msgid "" "from overridden :meth:`close` methods." msgstr "" -#: ../../library/logging.rst:487 +#: ../../library/logging.rst:495 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:494 +#: ../../library/logging.rst:502 msgid "" "This method should be called from handlers when an exception is encountered " "during an :meth:`emit` call. If the module-level attribute " @@ -647,29 +651,29 @@ msgid "" "more useful during development)." msgstr "" -#: ../../library/logging.rst:507 +#: ../../library/logging.rst:515 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:513 +#: ../../library/logging.rst:521 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:517 +#: ../../library/logging.rst:525 msgid "" "For a list of handlers included as standard, see :mod:`logging.handlers`." msgstr "" -#: ../../library/logging.rst:522 +#: ../../library/logging.rst:530 msgid "Formatter Objects" msgstr "" -#: ../../library/logging.rst:526 +#: ../../library/logging.rst:534 msgid "" ":class:`Formatter` objects have the following attributes and methods. They " "are responsible for converting a :class:`LogRecord` to (usually) a string " @@ -680,7 +684,7 @@ msgid "" "information in the formatted output (such as a timestamp), keep reading." msgstr "" -#: ../../library/logging.rst:534 +#: ../../library/logging.rst:542 msgid "" "A Formatter can be initialized with a format string which makes use of " "knowledge of the :class:`LogRecord` attributes - such as the default value " @@ -690,13 +694,13 @@ msgid "" "ref:`old-string-formatting` for more information on string formatting." msgstr "" -#: ../../library/logging.rst:541 +#: ../../library/logging.rst:549 msgid "" "The useful mapping keys in a :class:`LogRecord` are given in the section on :" "ref:`logrecord-attributes`." msgstr "" -#: ../../library/logging.rst:547 +#: ../../library/logging.rst:555 msgid "" "Returns a new instance of the :class:`Formatter` class. The instance is " "initialized with a format string for the message as a whole, as well as a " @@ -705,7 +709,7 @@ msgid "" "format is used which is described in the :meth:`formatTime` documentation." msgstr "" -#: ../../library/logging.rst:553 +#: ../../library/logging.rst:561 msgid "" "The *style* parameter can be one of '%', '{' or '$' and determines how the " "format string will be merged with its data: using one of %-formatting, :meth:" @@ -715,29 +719,29 @@ msgid "" "for more information on using {- and $-formatting for log messages." msgstr "" -#: ../../library/logging.rst:561 +#: ../../library/logging.rst:569 msgid "" "The *defaults* parameter can be 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:565 +#: ../../library/logging.rst:573 msgid "The *style* parameter was added." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:568 +#: ../../library/logging.rst:576 msgid "" "The *validate* parameter was added. Incorrect or mismatched style and fmt " "will raise a ``ValueError``. For example: ``logging.Formatter('%(asctime)s - " "%(message)s', style='{')``." msgstr "" -#: ../../library/logging.rst:573 +#: ../../library/logging.rst:581 msgid "The *defaults* parameter was added." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:578 +#: ../../library/logging.rst:586 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -756,13 +760,13 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:594 +#: ../../library/logging.rst:602 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:600 +#: ../../library/logging.rst:608 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 " @@ -775,7 +779,7 @@ msgid "" "resulting string is returned." msgstr "" -#: ../../library/logging.rst:610 +#: ../../library/logging.rst:618 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 " @@ -785,7 +789,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:618 +#: ../../library/logging.rst:626 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 " @@ -800,11 +804,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:631 +#: ../../library/logging.rst:639 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:636 +#: ../../library/logging.rst:644 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -812,18 +816,18 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:643 +#: ../../library/logging.rst:651 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:650 +#: ../../library/logging.rst:658 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:652 +#: ../../library/logging.rst:660 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -833,7 +837,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:662 +#: ../../library/logging.rst:670 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 " @@ -841,13 +845,13 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:669 +#: ../../library/logging.rst:677 msgid "" "Is the specified record to be logged? Returns zero for no, nonzero for yes. " "If deemed appropriate, the record may be modified in-place by this method." msgstr "" -#: ../../library/logging.rst:673 +#: ../../library/logging.rst:681 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -857,13 +861,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:680 +#: ../../library/logging.rst:688 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:683 +#: ../../library/logging.rst:691 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) " @@ -874,7 +878,7 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:693 +#: ../../library/logging.rst:701 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -886,11 +890,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:705 +#: ../../library/logging.rst:713 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:707 +#: ../../library/logging.rst:715 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -898,11 +902,11 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:715 +#: ../../library/logging.rst:723 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:717 +#: ../../library/logging.rst:725 msgid "" "The primary information is passed in :attr:`msg` and :attr:`args`, which are " "combined using ``msg % args`` to create the :attr:`message` field of the " @@ -913,58 +917,58 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/logging.rst:721 +#: ../../library/logging.rst:729 msgid "" "The name of the logger used to log the event represented by this LogRecord. " "Note that this name will always have this value, even though it may be " "emitted by a handler attached to a different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:725 +#: ../../library/logging.rst:733 msgid "" "The numeric level of the logging event (one of DEBUG, INFO etc.) Note that " "this is converted to *two* attributes of the LogRecord: ``levelno`` for the " "numeric value and ``levelname`` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:729 +#: ../../library/logging.rst:737 msgid "The full pathname of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:731 +#: ../../library/logging.rst:739 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:733 +#: ../../library/logging.rst:741 msgid "" "The event description message, possibly a format string with placeholders " "for variable data." msgstr "" -#: ../../library/logging.rst:735 +#: ../../library/logging.rst:743 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:737 +#: ../../library/logging.rst:745 msgid "" "An exception tuple with the current exception information, or ``None`` if no " "exception information is available." msgstr "" -#: ../../library/logging.rst:739 +#: ../../library/logging.rst:747 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:741 +#: ../../library/logging.rst:749 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:746 +#: ../../library/logging.rst:754 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -973,7 +977,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:753 +#: ../../library/logging.rst:761 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 " @@ -981,24 +985,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:759 +#: ../../library/logging.rst:767 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:771 +#: ../../library/logging.rst:779 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:780 +#: ../../library/logging.rst:788 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:782 +#: ../../library/logging.rst:790 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 " @@ -1009,7 +1013,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:790 +#: ../../library/logging.rst:798 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 (:" @@ -1017,7 +1021,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:796 +#: ../../library/logging.rst:804 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: " @@ -1026,308 +1030,308 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:803 +#: ../../library/logging.rst:811 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:803 ../../library/logging.rst:1186 +#: ../../library/logging.rst:811 ../../library/logging.rst:1194 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:803 ../../library/logging.rst:1186 +#: ../../library/logging.rst:811 ../../library/logging.rst:1194 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:805 +#: ../../library/logging.rst:0 ../../library/logging.rst:813 msgid "args" msgstr "" -#: ../../library/logging.rst:805 ../../library/logging.rst:819 -#: ../../library/logging.rst:847 ../../library/logging.rst:865 +#: ../../library/logging.rst:813 ../../library/logging.rst:827 +#: ../../library/logging.rst:855 ../../library/logging.rst:873 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:805 +#: ../../library/logging.rst:813 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:810 +#: ../../library/logging.rst:818 msgid "asctime" msgstr "" -#: ../../library/logging.rst:810 +#: ../../library/logging.rst:818 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:810 +#: ../../library/logging.rst:818 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:816 +#: ../../library/logging.rst:824 msgid "created" msgstr "" -#: ../../library/logging.rst:816 +#: ../../library/logging.rst:824 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:816 +#: ../../library/logging.rst:824 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:819 +#: ../../library/logging.rst:0 ../../library/logging.rst:827 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:819 +#: ../../library/logging.rst:827 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:822 +#: ../../library/logging.rst:830 msgid "filename" msgstr "" -#: ../../library/logging.rst:822 +#: ../../library/logging.rst:830 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:822 +#: ../../library/logging.rst:830 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:824 +#: ../../library/logging.rst:832 msgid "funcName" msgstr "" -#: ../../library/logging.rst:824 +#: ../../library/logging.rst:832 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:824 +#: ../../library/logging.rst:832 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:826 +#: ../../library/logging.rst:834 msgid "levelname" msgstr "" -#: ../../library/logging.rst:826 +#: ../../library/logging.rst:834 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:826 +#: ../../library/logging.rst:834 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:830 +#: ../../library/logging.rst:838 msgid "levelno" msgstr "" -#: ../../library/logging.rst:830 +#: ../../library/logging.rst:838 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:830 +#: ../../library/logging.rst:838 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:835 +#: ../../library/logging.rst:843 msgid "lineno" msgstr "" -#: ../../library/logging.rst:835 +#: ../../library/logging.rst:843 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:835 +#: ../../library/logging.rst:843 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:838 +#: ../../library/logging.rst:846 msgid "message" msgstr "" -#: ../../library/logging.rst:838 +#: ../../library/logging.rst:846 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:838 +#: ../../library/logging.rst:846 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:842 +#: ../../library/logging.rst:850 msgid "module" msgstr "模組" -#: ../../library/logging.rst:842 +#: ../../library/logging.rst:850 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:842 +#: ../../library/logging.rst:850 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:844 +#: ../../library/logging.rst:852 msgid "msecs" msgstr "" -#: ../../library/logging.rst:844 +#: ../../library/logging.rst:852 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:844 +#: ../../library/logging.rst:852 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:847 +#: ../../library/logging.rst:0 ../../library/logging.rst:855 msgid "msg" msgstr "" -#: ../../library/logging.rst:847 +#: ../../library/logging.rst:855 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:852 +#: ../../library/logging.rst:0 ../../library/logging.rst:860 msgid "name" msgstr "" -#: ../../library/logging.rst:852 +#: ../../library/logging.rst:860 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:852 +#: ../../library/logging.rst:860 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:854 +#: ../../library/logging.rst:862 msgid "pathname" msgstr "" -#: ../../library/logging.rst:854 +#: ../../library/logging.rst:862 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:854 +#: ../../library/logging.rst:862 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:857 +#: ../../library/logging.rst:865 msgid "process" msgstr "" -#: ../../library/logging.rst:857 +#: ../../library/logging.rst:865 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:857 +#: ../../library/logging.rst:865 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:859 +#: ../../library/logging.rst:867 msgid "processName" msgstr "" -#: ../../library/logging.rst:859 +#: ../../library/logging.rst:867 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:859 +#: ../../library/logging.rst:867 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:861 +#: ../../library/logging.rst:869 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:861 +#: ../../library/logging.rst:869 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:861 +#: ../../library/logging.rst:869 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:865 +#: ../../library/logging.rst:873 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:865 +#: ../../library/logging.rst:873 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:871 +#: ../../library/logging.rst:879 msgid "thread" msgstr "" -#: ../../library/logging.rst:871 +#: ../../library/logging.rst:879 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:871 +#: ../../library/logging.rst:879 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:873 +#: ../../library/logging.rst:881 msgid "threadName" msgstr "" -#: ../../library/logging.rst:873 +#: ../../library/logging.rst:881 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:873 +#: ../../library/logging.rst:881 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:876 +#: ../../library/logging.rst:884 msgid "*processName* was added." msgstr "新增 *processName*\\ 。" -#: ../../library/logging.rst:883 +#: ../../library/logging.rst:891 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:885 +#: ../../library/logging.rst:893 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:891 +#: ../../library/logging.rst:899 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:896 +#: ../../library/logging.rst:904 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1336,7 +1340,7 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:910 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1348,24 +1352,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:911 +#: ../../library/logging.rst:919 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:916 +#: ../../library/logging.rst:924 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:922 +#: ../../library/logging.rst:930 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:924 +#: ../../library/logging.rst:932 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 " @@ -1374,7 +1378,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:929 +#: ../../library/logging.rst:937 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 " @@ -1382,17 +1386,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:944 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:938 +#: ../../library/logging.rst:946 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:944 +#: ../../library/logging.rst:952 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 " @@ -1401,14 +1405,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:949 +#: ../../library/logging.rst:957 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:956 +#: ../../library/logging.rst:964 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 " @@ -1417,24 +1421,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:967 +#: ../../library/logging.rst:975 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:969 +#: ../../library/logging.rst:977 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:974 +#: ../../library/logging.rst:982 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:979 +#: ../../library/logging.rst:987 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 " @@ -1443,7 +1447,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:984 +#: ../../library/logging.rst:992 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1453,7 +1457,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1010 +#: ../../library/logging.rst:1018 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 " @@ -1462,11 +1466,11 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1021 +#: ../../library/logging.rst:1029 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1031 +#: ../../library/logging.rst:1039 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:" @@ -1477,58 +1481,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1045 +#: ../../library/logging.rst:1053 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:1054 +#: ../../library/logging.rst:1062 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1060 +#: ../../library/logging.rst:1068 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1063 +#: ../../library/logging.rst:1071 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:1070 +#: ../../library/logging.rst:1078 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1076 +#: ../../library/logging.rst:1084 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1082 +#: ../../library/logging.rst:1090 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:1088 +#: ../../library/logging.rst:1096 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1093 +#: ../../library/logging.rst:1101 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 " @@ -1542,7 +1546,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1104 +#: ../../library/logging.rst:1112 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 " @@ -1550,13 +1554,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1109 +#: ../../library/logging.rst:1117 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1115 +#: ../../library/logging.rst:1123 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1566,17 +1570,17 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1122 +#: ../../library/logging.rst:1130 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1127 +#: ../../library/logging.rst:1135 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1129 +#: ../../library/logging.rst:1137 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1586,20 +1590,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1136 +#: ../../library/logging.rst:1144 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:1140 +#: ../../library/logging.rst:1148 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1143 +#: ../../library/logging.rst:1151 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 " @@ -1608,7 +1612,7 @@ msgid "" "versa." msgstr "" -#: ../../library/logging.rst:1149 +#: ../../library/logging.rst:1157 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. " @@ -1616,7 +1620,7 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1157 +#: ../../library/logging.rst:1165 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1624,7 +1628,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1165 +#: ../../library/logging.rst:1173 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1633,13 +1637,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1171 +#: ../../library/logging.rst:1179 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:1174 +#: ../../library/logging.rst:1182 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 " @@ -1648,54 +1652,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1181 +#: ../../library/logging.rst:1189 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1188 +#: ../../library/logging.rst:1196 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1188 +#: ../../library/logging.rst:1196 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1192 +#: ../../library/logging.rst:1200 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1192 +#: ../../library/logging.rst:1200 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1196 +#: ../../library/logging.rst:1204 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1196 +#: ../../library/logging.rst:1204 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1201 +#: ../../library/logging.rst:1209 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1201 +#: ../../library/logging.rst:1209 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1204 +#: ../../library/logging.rst:1212 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1204 +#: ../../library/logging.rst:1212 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1215 +#: ../../library/logging.rst:1223 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1215 +#: ../../library/logging.rst:1223 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:1221 +#: ../../library/logging.rst:1229 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1221 +#: ../../library/logging.rst:1229 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 " @@ -1735,33 +1739,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1230 +#: ../../library/logging.rst:1238 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1230 +#: ../../library/logging.rst:1238 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:1236 +#: ../../library/logging.rst:1244 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1236 +#: ../../library/logging.rst:1244 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:1241 +#: ../../library/logging.rst:1249 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1241 +#: ../../library/logging.rst:1249 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 " @@ -1770,39 +1774,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1252 +#: ../../library/logging.rst:1260 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1255 +#: ../../library/logging.rst:1263 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:1261 +#: ../../library/logging.rst:1269 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1264 +#: ../../library/logging.rst:1272 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1269 +#: ../../library/logging.rst:1277 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:1273 +#: ../../library/logging.rst:1281 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:1280 +#: ../../library/logging.rst:1288 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 " @@ -1814,32 +1818,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1291 +#: ../../library/logging.rst:1299 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1293 +#: ../../library/logging.rst:1301 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1295 +#: ../../library/logging.rst:1303 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:1300 +#: ../../library/logging.rst:1308 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1302 +#: ../../library/logging.rst:1310 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1304 +#: ../../library/logging.rst:1312 msgid "The logger name." msgstr "" @@ -1847,7 +1851,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1305 +#: ../../library/logging.rst:1313 msgid "The logging level (numeric)." msgstr "" @@ -1855,7 +1859,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1306 +#: ../../library/logging.rst:1314 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1863,19 +1867,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1307 +#: ../../library/logging.rst:1315 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1308 +#: ../../library/logging.rst:1316 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1309 +#: ../../library/logging.rst:1317 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1310 +#: ../../library/logging.rst:1318 msgid "An exception tuple, or ``None``." msgstr "" @@ -1883,7 +1887,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1311 +#: ../../library/logging.rst:1319 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1891,7 +1895,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1313 +#: ../../library/logging.rst:1321 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1901,15 +1905,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1323 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1319 +#: ../../library/logging.rst:1327 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1323 +#: ../../library/logging.rst:1331 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``, " @@ -1920,22 +1924,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1334 +#: ../../library/logging.rst:1342 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1336 +#: ../../library/logging.rst:1344 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1341 +#: ../../library/logging.rst:1349 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1344 +#: ../../library/logging.rst:1352 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -1944,46 +1948,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1349 +#: ../../library/logging.rst:1357 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:1357 +#: ../../library/logging.rst:1365 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1357 +#: ../../library/logging.rst:1365 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1360 +#: ../../library/logging.rst:1368 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1360 +#: ../../library/logging.rst:1368 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1364 +#: ../../library/logging.rst:1372 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1363 +#: ../../library/logging.rst:1371 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1369 +#: ../../library/logging.rst:1377 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1367 +#: ../../library/logging.rst:1375 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/mmap.po b/library/mmap.po index 875e34c8c0..0db53a8f87 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-06-10 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -160,8 +160,8 @@ msgstr "" #: ../../library/mmap.rst:103 msgid "" "To ensure validity of the created memory mapping the file specified by the " -"descriptor *fileno* is internally automatically synchronized with physical " -"backing store on macOS and OpenVMS." +"descriptor *fileno* is internally automatically synchronized with the " +"physical backing store on macOS." msgstr "" #: ../../library/mmap.rst:107 diff --git a/library/os.po b/library/os.po index c003d0d519..542ba921d5 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-06-07 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2492,10 +2492,10 @@ msgid "" "`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " "respectively. If both are directories and *dst* is empty, *dst* will be " "silently replaced. If *dst* is a non-empty directory, an :exc:`OSError` is " -"raised. If both are files, *dst* it will be replaced silently if the user " -"has permission. The operation may fail on some Unix flavors if *src* and " -"*dst* are on different filesystems. If successful, the renaming will be an " -"atomic operation (this is a POSIX requirement)." +"raised. If both are files, *dst* will be replaced silently if the user has " +"permission. The operation may fail on some Unix flavors if *src* and *dst* " +"are on different filesystems. If successful, the renaming will be an atomic " +"operation (this is a POSIX requirement)." msgstr "" #: ../../library/os.rst:2315 ../../library/os.rst:2355 diff --git a/library/pathlib.po b/library/pathlib.po index dd37321283..4c685a70b7 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-06-11 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -142,341 +142,360 @@ msgstr "" #: ../../library/pathlib.rst:135 msgid "" "Spurious slashes and single dots are collapsed, but double dots (``'..'``) " -"are not, since this would change the meaning of a path in the face of " -"symbolic links::" +"and leading double slashes (``'//'``) are not, since this would change the " +"meaning of a path for various reasons (e.g. symbolic links, UNC paths)::" msgstr "" -#: ../../library/pathlib.rst:146 +#: ../../library/pathlib.rst:148 msgid "" "(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent to " "``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to " "another directory)" msgstr "" -#: ../../library/pathlib.rst:150 +#: ../../library/pathlib.rst:152 msgid "" "Pure path objects implement the :class:`os.PathLike` interface, allowing " "them to be used anywhere the interface is accepted." msgstr "" -#: ../../library/pathlib.rst:153 +#: ../../library/pathlib.rst:155 msgid "Added support for the :class:`os.PathLike` interface." msgstr "" -#: ../../library/pathlib.rst:158 +#: ../../library/pathlib.rst:160 msgid "" "A subclass of :class:`PurePath`, this path flavour represents non-Windows " "filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:164 ../../library/pathlib.rst:174 -#: ../../library/pathlib.rst:638 ../../library/pathlib.rst:648 -#: ../../library/pathlib.rst:658 +#: ../../library/pathlib.rst:166 ../../library/pathlib.rst:178 +#: ../../library/pathlib.rst:665 ../../library/pathlib.rst:675 +#: ../../library/pathlib.rst:685 msgid "*pathsegments* is specified similarly to :class:`PurePath`." msgstr "" -#: ../../library/pathlib.rst:168 +#: ../../library/pathlib.rst:170 msgid "" "A subclass of :class:`PurePath`, this path flavour represents Windows " -"filesystem paths::" +"filesystem paths, including `UNC paths`_::" msgstr "" -#: ../../library/pathlib.rst:176 +#: ../../library/pathlib.rst:182 msgid "" "Regardless of the system you're running on, you can instantiate all of these " "classes, since they don't provide any operation that does system calls." msgstr "" -#: ../../library/pathlib.rst:181 +#: ../../library/pathlib.rst:187 msgid "General properties" msgstr "" -#: ../../library/pathlib.rst:183 +#: ../../library/pathlib.rst:189 msgid "" "Paths are immutable and hashable. Paths of a same flavour are comparable " "and orderable. These properties respect the flavour's case-folding " "semantics::" msgstr "" -#: ../../library/pathlib.rst:196 +#: ../../library/pathlib.rst:202 msgid "Paths of a different flavour compare unequal and cannot be ordered::" msgstr "" -#: ../../library/pathlib.rst:207 +#: ../../library/pathlib.rst:213 msgid "Operators" msgstr "" -#: ../../library/pathlib.rst:209 +#: ../../library/pathlib.rst:215 msgid "" "The slash operator helps create child paths, similarly to :func:`os.path." "join`::" msgstr "" -#: ../../library/pathlib.rst:220 +#: ../../library/pathlib.rst:226 msgid "" "A path object can be used anywhere an object implementing :class:`os." "PathLike` is accepted::" msgstr "" -#: ../../library/pathlib.rst:228 +#: ../../library/pathlib.rst:234 msgid "" "The string representation of a path is the raw filesystem path itself (in " "native form, e.g. with backslashes under Windows), which you can pass to any " "function taking a file path as a string::" msgstr "" -#: ../../library/pathlib.rst:239 +#: ../../library/pathlib.rst:245 msgid "" "Similarly, calling :class:`bytes` on a path gives the raw filesystem path as " "a bytes object, as encoded by :func:`os.fsencode`::" msgstr "" -#: ../../library/pathlib.rst:246 +#: ../../library/pathlib.rst:252 msgid "" "Calling :class:`bytes` is only recommended under Unix. Under Windows, the " "unicode form is the canonical representation of filesystem paths." msgstr "" -#: ../../library/pathlib.rst:251 +#: ../../library/pathlib.rst:257 msgid "Accessing individual parts" msgstr "" -#: ../../library/pathlib.rst:253 +#: ../../library/pathlib.rst:259 msgid "" "To access the individual \"parts\" (components) of a path, use the following " "property:" msgstr "" -#: ../../library/pathlib.rst:258 +#: ../../library/pathlib.rst:264 msgid "A tuple giving access to the path's various components::" msgstr "" -#: ../../library/pathlib.rst:268 +#: ../../library/pathlib.rst:274 msgid "(note how the drive and local root are regrouped in a single part)" msgstr "" -#: ../../library/pathlib.rst:272 +#: ../../library/pathlib.rst:278 msgid "Methods and properties" msgstr "" -#: ../../library/pathlib.rst:278 +#: ../../library/pathlib.rst:284 msgid "Pure paths provide the following methods and properties:" msgstr "" -#: ../../library/pathlib.rst:282 +#: ../../library/pathlib.rst:288 msgid "A string representing the drive letter or name, if any::" msgstr "" -#: ../../library/pathlib.rst:291 +#: ../../library/pathlib.rst:297 msgid "UNC shares are also considered drives::" msgstr "" -#: ../../library/pathlib.rst:298 +#: ../../library/pathlib.rst:304 msgid "A string representing the (local or global) root, if any::" msgstr "" -#: ../../library/pathlib.rst:307 +#: ../../library/pathlib.rst:313 msgid "UNC shares always have a root::" msgstr "" -#: ../../library/pathlib.rst:314 +#: ../../library/pathlib.rst:318 +msgid "" +"If the path starts with more than two successive slashes, :class:`~pathlib." +"PurePosixPath` collapses them::" +msgstr "" + +#: ../../library/pathlib.rst:330 +msgid "" +"This behavior conforms to *The Open Group Base Specifications Issue 6*, " +"paragraph `4.11 *Pathname Resolution* `_:" +msgstr "" + +#: ../../library/pathlib.rst:333 +msgid "" +"*\"A pathname that begins with two successive slashes may be interpreted in " +"an implementation-defined manner, although more than two leading slashes " +"shall be treated as a single slash.\"*" +msgstr "" + +#: ../../library/pathlib.rst:341 msgid "The concatenation of the drive and root::" msgstr "" -#: ../../library/pathlib.rst:328 +#: ../../library/pathlib.rst:355 msgid "" "An immutable sequence providing access to the logical ancestors of the path::" msgstr "" -#: ../../library/pathlib.rst:339 +#: ../../library/pathlib.rst:366 msgid "" "The parents sequence now supports :term:`slices ` and negative index " "values." msgstr "" -#: ../../library/pathlib.rst:344 +#: ../../library/pathlib.rst:371 msgid "The logical parent of the path::" msgstr "" -#: ../../library/pathlib.rst:350 +#: ../../library/pathlib.rst:377 msgid "You cannot go past an anchor, or empty path::" msgstr "" -#: ../../library/pathlib.rst:360 +#: ../../library/pathlib.rst:387 msgid "This is a purely lexical operation, hence the following behaviour::" msgstr "" -#: ../../library/pathlib.rst:366 +#: ../../library/pathlib.rst:393 msgid "" "If you want to walk an arbitrary filesystem path upwards, it is recommended " "to first call :meth:`Path.resolve` so as to resolve symlinks and eliminate `" "\"..\"` components." msgstr "" -#: ../../library/pathlib.rst:373 +#: ../../library/pathlib.rst:400 msgid "" "A string representing the final path component, excluding the drive and " "root, if any::" msgstr "" -#: ../../library/pathlib.rst:379 +#: ../../library/pathlib.rst:406 msgid "UNC drive names are not considered::" msgstr "" -#: ../../library/pathlib.rst:389 +#: ../../library/pathlib.rst:416 msgid "The file extension of the final component, if any::" msgstr "" -#: ../../library/pathlib.rst:401 +#: ../../library/pathlib.rst:428 msgid "A list of the path's file extensions::" msgstr "" -#: ../../library/pathlib.rst:413 +#: ../../library/pathlib.rst:440 msgid "The final path component, without its suffix::" msgstr "" -#: ../../library/pathlib.rst:425 +#: ../../library/pathlib.rst:452 msgid "" "Return a string representation of the path with forward slashes (``/``)::" msgstr "" -#: ../../library/pathlib.rst:436 +#: ../../library/pathlib.rst:463 msgid "" "Represent the path as a ``file`` URI. :exc:`ValueError` is raised if the " "path isn't absolute." msgstr "" -#: ../../library/pathlib.rst:449 +#: ../../library/pathlib.rst:476 msgid "" "Return whether the path is absolute or not. A path is considered absolute " "if it has both a root and (if the flavour allows) a drive::" msgstr "" -#: ../../library/pathlib.rst:469 +#: ../../library/pathlib.rst:496 msgid "Return whether or not this path is relative to the *other* path." msgstr "" -#: ../../library/pathlib.rst:482 +#: ../../library/pathlib.rst:509 msgid "" "With :class:`PureWindowsPath`, return ``True`` if the path is considered " "reserved under Windows, ``False`` otherwise. With :class:`PurePosixPath`, " "``False`` is always returned." msgstr "" -#: ../../library/pathlib.rst:491 +#: ../../library/pathlib.rst:518 msgid "" "File system calls on reserved paths can fail mysteriously or have unintended " "effects." msgstr "" -#: ../../library/pathlib.rst:497 +#: ../../library/pathlib.rst:524 msgid "" "Calling this method is equivalent to combining the path with each of the " "*other* arguments in turn::" msgstr "" -#: ../../library/pathlib.rst:512 +#: ../../library/pathlib.rst:539 msgid "" "Match this path against the provided glob-style pattern. Return ``True`` if " "matching is successful, ``False`` otherwise." msgstr "" -#: ../../library/pathlib.rst:515 +#: ../../library/pathlib.rst:542 msgid "" "If *pattern* is relative, the path can be either relative or absolute, and " "matching is done from the right::" msgstr "" -#: ../../library/pathlib.rst:525 +#: ../../library/pathlib.rst:552 msgid "" "If *pattern* is absolute, the path must be absolute, and the whole path must " "match::" msgstr "" -#: ../../library/pathlib.rst:533 +#: ../../library/pathlib.rst:560 msgid "As with other methods, case-sensitivity follows platform defaults::" msgstr "" -#: ../../library/pathlib.rst:543 +#: ../../library/pathlib.rst:570 msgid "" "Compute a version of this path relative to the path represented by *other*. " "If it's impossible, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:558 +#: ../../library/pathlib.rst:585 msgid "" "NOTE: This function is part of :class:`PurePath` and works with strings. It " "does not check or access the underlying file structure." msgstr "" -#: ../../library/pathlib.rst:563 +#: ../../library/pathlib.rst:590 msgid "" "Return a new path with the :attr:`name` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:580 +#: ../../library/pathlib.rst:607 msgid "" "Return a new path with the :attr:`stem` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:604 +#: ../../library/pathlib.rst:631 msgid "" "Return a new path with the :attr:`suffix` changed. If the original path " "doesn't have a suffix, the new *suffix* is appended instead. If the " "*suffix* is an empty string, the original suffix is removed::" msgstr "" -#: ../../library/pathlib.rst:623 +#: ../../library/pathlib.rst:650 msgid "Concrete paths" msgstr "" -#: ../../library/pathlib.rst:625 +#: ../../library/pathlib.rst:652 msgid "" "Concrete paths are subclasses of the pure path classes. In addition to " "operations provided by the latter, they also provide methods to do system " "calls on path objects. There are three ways to instantiate concrete paths:" msgstr "" -#: ../../library/pathlib.rst:631 +#: ../../library/pathlib.rst:658 msgid "" "A subclass of :class:`PurePath`, this class represents concrete paths of the " "system's path flavour (instantiating it creates either a :class:`PosixPath` " "or a :class:`WindowsPath`)::" msgstr "" -#: ../../library/pathlib.rst:642 +#: ../../library/pathlib.rst:669 msgid "" "A subclass of :class:`Path` and :class:`PurePosixPath`, this class " "represents concrete non-Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:652 +#: ../../library/pathlib.rst:679 msgid "" "A subclass of :class:`Path` and :class:`PureWindowsPath`, this class " "represents concrete Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:660 +#: ../../library/pathlib.rst:687 msgid "" "You can only instantiate the class flavour that corresponds to your system " "(allowing system calls on non-compatible path flavours could lead to bugs or " "failures in your application)::" msgstr "" -#: ../../library/pathlib.rst:680 +#: ../../library/pathlib.rst:707 msgid "Methods" msgstr "" -#: ../../library/pathlib.rst:682 +#: ../../library/pathlib.rst:709 msgid "" "Concrete paths provide the following methods in addition to pure paths " "methods. Many of these methods can raise an :exc:`OSError` if a system call " "fails (for example because the path doesn't exist)." msgstr "" -#: ../../library/pathlib.rst:688 +#: ../../library/pathlib.rst:715 msgid "" ":meth:`~Path.exists()`, :meth:`~Path.is_dir()`, :meth:`~Path.is_file()`, :" "meth:`~Path.is_mount()`, :meth:`~Path.is_symlink()`, :meth:`~Path." @@ -486,116 +505,116 @@ msgid "" "the OS level." msgstr "" -#: ../../library/pathlib.rst:698 +#: ../../library/pathlib.rst:725 msgid "" "Return a new path object representing the current directory (as returned by :" "func:`os.getcwd`)::" msgstr "" -#: ../../library/pathlib.rst:707 +#: ../../library/pathlib.rst:734 msgid "" "Return a new path object representing the user's home directory (as returned " "by :func:`os.path.expanduser` with ``~`` construct). If the home directory " "can't be resolved, :exc:`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:721 +#: ../../library/pathlib.rst:748 msgid "" "Return a :class:`os.stat_result` object containing information about this " "path, like :func:`os.stat`. The result is looked up at each call to this " "method." msgstr "" -#: ../../library/pathlib.rst:724 +#: ../../library/pathlib.rst:751 msgid "" "This method normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :meth:`~Path.lstat`." msgstr "" -#: ../../library/pathlib.rst:735 ../../library/pathlib.rst:755 +#: ../../library/pathlib.rst:762 ../../library/pathlib.rst:782 msgid "The *follow_symlinks* parameter was added." msgstr "新增 *follow_symlinks* 參數。" -#: ../../library/pathlib.rst:740 +#: ../../library/pathlib.rst:767 msgid "Change the file mode and permissions, like :func:`os.chmod`." msgstr "" -#: ../../library/pathlib.rst:742 +#: ../../library/pathlib.rst:769 msgid "" "This method normally follows symlinks. Some Unix flavours support changing " "permissions on the symlink itself; on these platforms you may add the " "argument ``follow_symlinks=False``, or use :meth:`~Path.lchmod`." msgstr "" -#: ../../library/pathlib.rst:760 +#: ../../library/pathlib.rst:787 msgid "Whether the path points to an existing file or directory::" msgstr "" -#: ../../library/pathlib.rst:772 +#: ../../library/pathlib.rst:799 msgid "" "If the path points to a symlink, :meth:`exists` returns whether the symlink " "*points to* an existing file or directory." msgstr "" -#: ../../library/pathlib.rst:778 +#: ../../library/pathlib.rst:805 msgid "" "Return a new path with expanded ``~`` and ``~user`` constructs, as returned " "by :meth:`os.path.expanduser`. If a home directory can't be resolved, :exc:" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:793 +#: ../../library/pathlib.rst:820 msgid "" "Glob the given relative *pattern* in the directory represented by this path, " "yielding all matching files (of any kind)::" msgstr "" -#: ../../library/pathlib.rst:801 +#: ../../library/pathlib.rst:828 msgid "" "Patterns are the same as for :mod:`fnmatch`, with the addition of \"``**``\" " "which means \"this directory and all subdirectories, recursively\". In " "other words, it enables recursive globbing::" msgstr "" -#: ../../library/pathlib.rst:813 +#: ../../library/pathlib.rst:840 msgid "" "Using the \"``**``\" pattern in large directory trees may consume an " "inordinate amount of time." msgstr "" -#: ../../library/pathlib.rst:816 +#: ../../library/pathlib.rst:843 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.glob`` with " "arguments ``self``, ``pattern``." msgstr "" -#: ../../library/pathlib.rst:821 +#: ../../library/pathlib.rst:848 msgid "" "Return the name of the group owning the file. :exc:`KeyError` is raised if " "the file's gid isn't found in the system database." msgstr "" -#: ../../library/pathlib.rst:827 +#: ../../library/pathlib.rst:854 msgid "" "Return ``True`` if the path points to a directory (or a symbolic link " "pointing to a directory), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:830 ../../library/pathlib.rst:839 -#: ../../library/pathlib.rst:868 ../../library/pathlib.rst:877 -#: ../../library/pathlib.rst:886 ../../library/pathlib.rst:895 +#: ../../library/pathlib.rst:857 ../../library/pathlib.rst:866 +#: ../../library/pathlib.rst:895 ../../library/pathlib.rst:904 +#: ../../library/pathlib.rst:913 ../../library/pathlib.rst:922 msgid "" "``False`` is also returned if the path doesn't exist or is a broken symlink; " "other errors (such as permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:836 +#: ../../library/pathlib.rst:863 msgid "" "Return ``True`` if the path points to a regular file (or a symbolic link " "pointing to a regular file), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:845 +#: ../../library/pathlib.rst:872 msgid "" "Return ``True`` if the path is a :dfn:`mount point`: a point in a file " "system where a different file system has been mounted. On POSIX, the " @@ -605,49 +624,49 @@ msgid "" "and POSIX variants. Not implemented on Windows." msgstr "" -#: ../../library/pathlib.rst:857 +#: ../../library/pathlib.rst:884 msgid "" "Return ``True`` if the path points to a symbolic link, ``False`` otherwise." msgstr "" -#: ../../library/pathlib.rst:859 +#: ../../library/pathlib.rst:886 msgid "" "``False`` is also returned if the path doesn't exist; other errors (such as " "permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:865 +#: ../../library/pathlib.rst:892 msgid "" "Return ``True`` if the path points to a Unix socket (or a symbolic link " "pointing to a Unix socket), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:874 +#: ../../library/pathlib.rst:901 msgid "" "Return ``True`` if the path points to a FIFO (or a symbolic link pointing to " "a FIFO), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:883 +#: ../../library/pathlib.rst:910 msgid "" "Return ``True`` if the path points to a block device (or a symbolic link " "pointing to a block device), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:892 +#: ../../library/pathlib.rst:919 msgid "" "Return ``True`` if the path points to a character device (or a symbolic link " "pointing to a character device), ``False`` if it points to another kind of " "file." msgstr "" -#: ../../library/pathlib.rst:901 +#: ../../library/pathlib.rst:928 msgid "" "When the path points to a directory, yield path objects of the directory " "contents::" msgstr "" -#: ../../library/pathlib.rst:915 +#: ../../library/pathlib.rst:942 msgid "" "The children are yielded in arbitrary order, and the special entries ``'.'`` " "and ``'..'`` are not included. If a file is removed from or added to the " @@ -655,88 +674,88 @@ msgid "" "be included is unspecified." msgstr "" -#: ../../library/pathlib.rst:922 +#: ../../library/pathlib.rst:949 msgid "" "Like :meth:`Path.chmod` but, if the path points to a symbolic link, the " "symbolic link's mode is changed rather than its target's." msgstr "" -#: ../../library/pathlib.rst:928 +#: ../../library/pathlib.rst:955 msgid "" "Like :meth:`Path.stat` but, if the path points to a symbolic link, return " "the symbolic link's information rather than its target's." msgstr "" -#: ../../library/pathlib.rst:934 +#: ../../library/pathlib.rst:961 msgid "" "Create a new directory at this given path. If *mode* is given, it is " "combined with the process' ``umask`` value to determine the file mode and " "access flags. If the path already exists, :exc:`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:939 +#: ../../library/pathlib.rst:966 msgid "" "If *parents* is true, any missing parents of this path are created as " "needed; they are created with the default permissions without taking *mode* " "into account (mimicking the POSIX ``mkdir -p`` command)." msgstr "" -#: ../../library/pathlib.rst:943 +#: ../../library/pathlib.rst:970 msgid "" "If *parents* is false (the default), a missing parent raises :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/pathlib.rst:946 +#: ../../library/pathlib.rst:973 msgid "" "If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if " "the target directory already exists." msgstr "" -#: ../../library/pathlib.rst:949 +#: ../../library/pathlib.rst:976 msgid "" "If *exist_ok* is true, :exc:`FileExistsError` exceptions will be ignored " "(same behavior as the POSIX ``mkdir -p`` command), but only if the last path " "component is not an existing non-directory file." msgstr "" -#: ../../library/pathlib.rst:953 +#: ../../library/pathlib.rst:980 msgid "The *exist_ok* parameter was added." msgstr "新增 *exist_ok* 參數。" -#: ../../library/pathlib.rst:959 +#: ../../library/pathlib.rst:986 msgid "" "Open the file pointed to by the path, like the built-in :func:`open` " "function does::" msgstr "" -#: ../../library/pathlib.rst:971 +#: ../../library/pathlib.rst:998 msgid "" "Return the name of the user owning the file. :exc:`KeyError` is raised if " "the file's uid isn't found in the system database." msgstr "" -#: ../../library/pathlib.rst:977 +#: ../../library/pathlib.rst:1004 msgid "Return the binary contents of the pointed-to file as a bytes object::" msgstr "" -#: ../../library/pathlib.rst:990 +#: ../../library/pathlib.rst:1017 msgid "Return the decoded contents of the pointed-to file as a string::" msgstr "" -#: ../../library/pathlib.rst:998 +#: ../../library/pathlib.rst:1025 msgid "" "The file is opened and then closed. The optional parameters have the same " "meaning as in :func:`open`." msgstr "" -#: ../../library/pathlib.rst:1006 +#: ../../library/pathlib.rst:1033 msgid "" "Return the path to which the symbolic link points (as returned by :func:`os." "readlink`)::" msgstr "" -#: ../../library/pathlib.rst:1019 +#: ../../library/pathlib.rst:1046 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. On Unix, if *target* exists and is a file, " @@ -745,37 +764,37 @@ msgid "" "either a string or another path object::" msgstr "" -#: ../../library/pathlib.rst:1034 ../../library/pathlib.rst:1048 +#: ../../library/pathlib.rst:1061 ../../library/pathlib.rst:1075 msgid "" "The target path may be absolute or relative. Relative paths are interpreted " "relative to the current working directory, *not* the directory of the Path " "object." msgstr "" -#: ../../library/pathlib.rst:1038 ../../library/pathlib.rst:1052 +#: ../../library/pathlib.rst:1065 ../../library/pathlib.rst:1079 msgid "Added return value, return the new Path instance." msgstr "" -#: ../../library/pathlib.rst:1044 +#: ../../library/pathlib.rst:1071 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. If *target* points to an existing file or " "empty directory, it will be unconditionally replaced." msgstr "" -#: ../../library/pathlib.rst:1058 +#: ../../library/pathlib.rst:1085 msgid "" "Make the path absolute, resolving any symlinks. A new path object is " "returned::" msgstr "" -#: ../../library/pathlib.rst:1067 +#: ../../library/pathlib.rst:1094 msgid "" "\"``..``\" components are also eliminated (this is the only method to do " "so)::" msgstr "" -#: ../../library/pathlib.rst:1073 +#: ../../library/pathlib.rst:1100 msgid "" "If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError` " "is raised. If *strict* is ``False``, the path is resolved as far as " @@ -784,65 +803,65 @@ msgid "" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:1079 +#: ../../library/pathlib.rst:1106 msgid "The *strict* argument (pre-3.6 behavior is strict)." msgstr "" -#: ../../library/pathlib.rst:1084 +#: ../../library/pathlib.rst:1111 msgid "" "This is like calling :func:`Path.glob` with \"``**/``\" added in front of " "the given relative *pattern*::" msgstr "" -#: ../../library/pathlib.rst:1094 +#: ../../library/pathlib.rst:1121 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." msgstr "" -#: ../../library/pathlib.rst:1099 +#: ../../library/pathlib.rst:1126 msgid "Remove this directory. The directory must be empty." msgstr "" -#: ../../library/pathlib.rst:1104 +#: ../../library/pathlib.rst:1131 msgid "" "Return whether this path points to the same file as *other_path*, which can " "be either a Path object, or a string. The semantics are similar to :func:" "`os.path.samefile` and :func:`os.path.samestat`." msgstr "" -#: ../../library/pathlib.rst:1108 +#: ../../library/pathlib.rst:1135 msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." msgstr "" -#: ../../library/pathlib.rst:1125 +#: ../../library/pathlib.rst:1152 msgid "" "Make this path a symbolic link to *target*. Under Windows, " "*target_is_directory* must be true (default ``False``) if the link's target " "is a directory. Under POSIX, *target_is_directory*'s value is ignored." msgstr "" -#: ../../library/pathlib.rst:1141 +#: ../../library/pathlib.rst:1168 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." msgstr "" -#: ../../library/pathlib.rst:1146 +#: ../../library/pathlib.rst:1173 msgid "Make this path a hard link to the same file as *target*." msgstr "" -#: ../../library/pathlib.rst:1149 +#: ../../library/pathlib.rst:1176 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." msgstr "" -#: ../../library/pathlib.rst:1156 +#: ../../library/pathlib.rst:1183 msgid "Make *target* a hard link to this path." msgstr "" -#: ../../library/pathlib.rst:1160 +#: ../../library/pathlib.rst:1187 msgid "" "This function does not make this path a hard link to *target*, despite the " "implication of the function and argument names. The argument order (target, " @@ -850,14 +869,14 @@ msgid "" "hardlink_to`, but matches that of :func:`os.link`." msgstr "" -#: ../../library/pathlib.rst:1169 +#: ../../library/pathlib.rst:1196 msgid "" "This method is deprecated in favor of :meth:`Path.hardlink_to`, as the " "argument order of :meth:`Path.link_to` does not match that of :meth:`Path." "symlink_to`." msgstr "" -#: ../../library/pathlib.rst:1176 +#: ../../library/pathlib.rst:1203 msgid "" "Create a file at this given path. If *mode* is given, it is combined with " "the process' ``umask`` value to determine the file mode and access flags. " @@ -866,65 +885,65 @@ msgid "" "`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:1185 +#: ../../library/pathlib.rst:1212 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" -#: ../../library/pathlib.rst:1188 +#: ../../library/pathlib.rst:1215 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." msgstr "" -#: ../../library/pathlib.rst:1191 +#: ../../library/pathlib.rst:1218 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." msgstr "" -#: ../../library/pathlib.rst:1194 +#: ../../library/pathlib.rst:1221 msgid "The *missing_ok* parameter was added." msgstr "新增 *missing_ok* 參數。" -#: ../../library/pathlib.rst:1200 +#: ../../library/pathlib.rst:1227 msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1209 +#: ../../library/pathlib.rst:1236 msgid "An existing file of the same name is overwritten." msgstr "" -#: ../../library/pathlib.rst:1216 +#: ../../library/pathlib.rst:1243 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" msgstr "" -#: ../../library/pathlib.rst:1225 +#: ../../library/pathlib.rst:1252 msgid "" "An existing file of the same name is overwritten. The optional parameters " "have the same meaning as in :func:`open`." msgstr "" -#: ../../library/pathlib.rst:1230 +#: ../../library/pathlib.rst:1257 msgid "The *newline* parameter was added." msgstr "新增 *newline* 參數。" -#: ../../library/pathlib.rst:1234 +#: ../../library/pathlib.rst:1261 msgid "Correspondence to tools in the :mod:`os` module" msgstr "" -#: ../../library/pathlib.rst:1236 +#: ../../library/pathlib.rst:1263 msgid "" "Below is a table mapping various :mod:`os` functions to their corresponding :" "class:`PurePath`/:class:`Path` equivalent." msgstr "" -#: ../../library/pathlib.rst:1241 +#: ../../library/pathlib.rst:1268 msgid "" "Not all pairs of functions/methods below are equivalent. Some of them, " "despite having some overlapping use-cases, have different semantics. They " @@ -932,230 +951,230 @@ msgid "" "relpath` and :meth:`PurePath.relative_to`." msgstr "" -#: ../../library/pathlib.rst:1247 +#: ../../library/pathlib.rst:1274 msgid ":mod:`os` and :mod:`os.path`" msgstr ":mod:`os` 和 :mod:`os.path`" -#: ../../library/pathlib.rst:1247 +#: ../../library/pathlib.rst:1274 msgid ":mod:`pathlib`" msgstr ":mod:`pathlib`" -#: ../../library/pathlib.rst:1249 +#: ../../library/pathlib.rst:1276 msgid ":func:`os.path.abspath`" msgstr ":func:`os.path.abspath`" -#: ../../library/pathlib.rst:1249 +#: ../../library/pathlib.rst:1276 msgid ":meth:`Path.resolve` [#]_" msgstr ":meth:`Path.resolve` [#]_" -#: ../../library/pathlib.rst:1250 +#: ../../library/pathlib.rst:1277 msgid ":func:`os.chmod`" msgstr ":func:`os.chmod`" -#: ../../library/pathlib.rst:1250 +#: ../../library/pathlib.rst:1277 msgid ":meth:`Path.chmod`" msgstr ":meth:`Path.chmod`" -#: ../../library/pathlib.rst:1251 +#: ../../library/pathlib.rst:1278 msgid ":func:`os.mkdir`" msgstr ":func:`os.mkdir`" -#: ../../library/pathlib.rst:1251 ../../library/pathlib.rst:1252 +#: ../../library/pathlib.rst:1278 ../../library/pathlib.rst:1279 msgid ":meth:`Path.mkdir`" msgstr ":meth:`Path.mkdir`" -#: ../../library/pathlib.rst:1252 +#: ../../library/pathlib.rst:1279 msgid ":func:`os.makedirs`" msgstr ":func:`os.makedirs`" -#: ../../library/pathlib.rst:1253 +#: ../../library/pathlib.rst:1280 msgid ":func:`os.rename`" msgstr ":func:`os.rename`" -#: ../../library/pathlib.rst:1253 +#: ../../library/pathlib.rst:1280 msgid ":meth:`Path.rename`" msgstr ":meth:`Path.rename`" -#: ../../library/pathlib.rst:1254 +#: ../../library/pathlib.rst:1281 msgid ":func:`os.replace`" msgstr ":func:`os.replace`" -#: ../../library/pathlib.rst:1254 +#: ../../library/pathlib.rst:1281 msgid ":meth:`Path.replace`" msgstr ":meth:`Path.replace`" -#: ../../library/pathlib.rst:1255 +#: ../../library/pathlib.rst:1282 msgid ":func:`os.rmdir`" msgstr ":func:`os.rmdir`" -#: ../../library/pathlib.rst:1255 +#: ../../library/pathlib.rst:1282 msgid ":meth:`Path.rmdir`" msgstr ":meth:`Path.rmdir`" -#: ../../library/pathlib.rst:1256 +#: ../../library/pathlib.rst:1283 msgid ":func:`os.remove`, :func:`os.unlink`" msgstr ":func:`os.remove`, :func:`os.unlink`" -#: ../../library/pathlib.rst:1256 +#: ../../library/pathlib.rst:1283 msgid ":meth:`Path.unlink`" msgstr ":meth:`Path.unlink`" -#: ../../library/pathlib.rst:1257 +#: ../../library/pathlib.rst:1284 msgid ":func:`os.getcwd`" msgstr ":func:`os.getcwd`" -#: ../../library/pathlib.rst:1257 +#: ../../library/pathlib.rst:1284 msgid ":func:`Path.cwd`" msgstr ":func:`Path.cwd`" -#: ../../library/pathlib.rst:1258 +#: ../../library/pathlib.rst:1285 msgid ":func:`os.path.exists`" msgstr ":func:`os.path.exists`" -#: ../../library/pathlib.rst:1258 +#: ../../library/pathlib.rst:1285 msgid ":meth:`Path.exists`" msgstr ":meth:`Path.exists`" -#: ../../library/pathlib.rst:1259 +#: ../../library/pathlib.rst:1286 msgid ":func:`os.path.expanduser`" msgstr ":func:`os.path.expanduser`" -#: ../../library/pathlib.rst:1259 +#: ../../library/pathlib.rst:1286 msgid ":meth:`Path.expanduser` and :meth:`Path.home`" msgstr ":meth:`Path.expanduser` 和 :meth:`Path.home`" -#: ../../library/pathlib.rst:1261 +#: ../../library/pathlib.rst:1288 msgid ":func:`os.listdir`" msgstr ":func:`os.listdir`" -#: ../../library/pathlib.rst:1261 +#: ../../library/pathlib.rst:1288 msgid ":meth:`Path.iterdir`" msgstr ":meth:`Path.iterdir`" -#: ../../library/pathlib.rst:1262 +#: ../../library/pathlib.rst:1289 msgid ":func:`os.path.isdir`" msgstr ":func:`os.path.isdir`" -#: ../../library/pathlib.rst:1262 +#: ../../library/pathlib.rst:1289 msgid ":meth:`Path.is_dir`" msgstr ":meth:`Path.is_dir`" -#: ../../library/pathlib.rst:1263 +#: ../../library/pathlib.rst:1290 msgid ":func:`os.path.isfile`" msgstr ":func:`os.path.isfile`" -#: ../../library/pathlib.rst:1263 +#: ../../library/pathlib.rst:1290 msgid ":meth:`Path.is_file`" msgstr ":meth:`Path.is_file`" -#: ../../library/pathlib.rst:1264 +#: ../../library/pathlib.rst:1291 msgid ":func:`os.path.islink`" msgstr ":func:`os.path.islink`" -#: ../../library/pathlib.rst:1264 +#: ../../library/pathlib.rst:1291 msgid ":meth:`Path.is_symlink`" msgstr ":meth:`Path.is_symlink`" -#: ../../library/pathlib.rst:1265 +#: ../../library/pathlib.rst:1292 msgid ":func:`os.link`" msgstr ":func:`os.link`" -#: ../../library/pathlib.rst:1265 +#: ../../library/pathlib.rst:1292 msgid ":meth:`Path.hardlink_to`" msgstr ":meth:`Path.hardlink_to`" -#: ../../library/pathlib.rst:1266 +#: ../../library/pathlib.rst:1293 msgid ":func:`os.symlink`" msgstr ":func:`os.symlink`" -#: ../../library/pathlib.rst:1266 +#: ../../library/pathlib.rst:1293 msgid ":meth:`Path.symlink_to`" msgstr ":meth:`Path.symlink_to`" -#: ../../library/pathlib.rst:1267 +#: ../../library/pathlib.rst:1294 msgid ":func:`os.readlink`" msgstr ":func:`os.readlink`" -#: ../../library/pathlib.rst:1267 +#: ../../library/pathlib.rst:1294 msgid ":meth:`Path.readlink`" msgstr ":meth:`Path.readlink`" -#: ../../library/pathlib.rst:1268 +#: ../../library/pathlib.rst:1295 msgid ":func:`os.path.relpath`" msgstr ":func:`os.path.relpath`" -#: ../../library/pathlib.rst:1268 -msgid ":meth:`Path.relative_to` [#]_" -msgstr ":meth:`Path.relative_to` [#]_" +#: ../../library/pathlib.rst:1295 +msgid ":meth:`PurePath.relative_to` [#]_" +msgstr ":meth:`PurePath.relative_to` [#]_" -#: ../../library/pathlib.rst:1269 +#: ../../library/pathlib.rst:1296 msgid ":func:`os.stat`" msgstr ":func:`os.stat`" -#: ../../library/pathlib.rst:1269 +#: ../../library/pathlib.rst:1296 msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" msgstr ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" -#: ../../library/pathlib.rst:1272 +#: ../../library/pathlib.rst:1299 msgid ":func:`os.path.isabs`" msgstr ":func:`os.path.isabs`" -#: ../../library/pathlib.rst:1272 +#: ../../library/pathlib.rst:1299 msgid ":meth:`PurePath.is_absolute`" msgstr ":meth:`PurePath.is_absolute`" -#: ../../library/pathlib.rst:1273 +#: ../../library/pathlib.rst:1300 msgid ":func:`os.path.join`" msgstr ":func:`os.path.join`" -#: ../../library/pathlib.rst:1273 +#: ../../library/pathlib.rst:1300 msgid ":func:`PurePath.joinpath`" msgstr ":func:`PurePath.joinpath`" -#: ../../library/pathlib.rst:1274 +#: ../../library/pathlib.rst:1301 msgid ":func:`os.path.basename`" msgstr ":func:`os.path.basename`" -#: ../../library/pathlib.rst:1274 +#: ../../library/pathlib.rst:1301 msgid ":data:`PurePath.name`" msgstr ":data:`PurePath.name`" -#: ../../library/pathlib.rst:1275 +#: ../../library/pathlib.rst:1302 msgid ":func:`os.path.dirname`" msgstr ":func:`os.path.dirname`" -#: ../../library/pathlib.rst:1275 +#: ../../library/pathlib.rst:1302 msgid ":data:`PurePath.parent`" msgstr ":data:`PurePath.parent`" -#: ../../library/pathlib.rst:1276 +#: ../../library/pathlib.rst:1303 msgid ":func:`os.path.samefile`" msgstr ":func:`os.path.samefile`" -#: ../../library/pathlib.rst:1276 +#: ../../library/pathlib.rst:1303 msgid ":meth:`Path.samefile`" msgstr ":meth:`Path.samefile`" -#: ../../library/pathlib.rst:1277 +#: ../../library/pathlib.rst:1304 msgid ":func:`os.path.splitext`" msgstr ":func:`os.path.splitext`" -#: ../../library/pathlib.rst:1277 +#: ../../library/pathlib.rst:1304 msgid ":data:`PurePath.suffix`" msgstr ":data:`PurePath.suffix`" -#: ../../library/pathlib.rst:1281 +#: ../../library/pathlib.rst:1308 msgid "Footnotes" msgstr "註解" -#: ../../library/pathlib.rst:1282 +#: ../../library/pathlib.rst:1309 msgid "" ":func:`os.path.abspath` does not resolve symbolic links while :meth:`Path." "resolve` does." msgstr "" -#: ../../library/pathlib.rst:1283 +#: ../../library/pathlib.rst:1310 msgid "" -":meth:`Path.relative_to` requires ``self`` to be the subpath of the " +":meth:`PurePath.relative_to` requires ``self`` to be the subpath of the " "argument, but :func:`os.path.relpath` does not." msgstr "" diff --git a/library/platform.po b/library/platform.po index dfa92ae573..44675804f7 100644 --- a/library/platform.po +++ b/library/platform.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-21 00:16+0000\n" -"PO-Revision-Date: 2022-02-15 17:47+0800\n" +"POT-Creation-Date: 2022-06-10 00:16+0000\n" +"PO-Revision-Date: 2022-06-11 14:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.0.1\n" +"X-Generator: Poedit 3.1\n" #: ../../library/platform.rst:2 msgid ":mod:`platform` --- Access to underlying platform's identifying data" @@ -95,9 +95,9 @@ msgstr "" #: ../../library/platform.rst:56 msgid "" -"Returns the machine type, e.g. ``'i386'``. An empty string is returned if " +"Returns the machine type, e.g. ``'AMD64'``. An empty string is returned if " "the value cannot be determined." -msgstr "回傳機器種類,例如 ``'i386'``\\ 。如果該值無法確定則會回傳一個空字串。" +msgstr "回傳機器種類,例如 ``'AMD64'``。如果該值無法確定則會回傳一個空字串。" #: ../../library/platform.rst:62 msgid "" diff --git a/library/posix.po b/library/posix.po index dc0fb5b9a0..a106eeeff7 100644 --- a/library/posix.po +++ b/library/posix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-06-10 00:16+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-" @@ -54,11 +54,11 @@ msgstr "" #: ../../library/posix.rst:40 msgid "" -"Several operating systems (including AIX, HP-UX and Solaris) provide support " -"for files that are larger than 2 GiB from a C programming model where :c:" -"type:`int` and :c:type:`long` are 32-bit values. This is typically " -"accomplished by defining the relevant size and offset types as 64-bit " -"values. Such files are sometimes referred to as :dfn:`large files`." +"Several operating systems (including AIX and Solaris) provide support for " +"files that are larger than 2 GiB from a C programming model where :c:type:" +"`int` and :c:type:`long` are 32-bit values. This is typically accomplished " +"by defining the relevant size and offset types as 64-bit values. Such files " +"are sometimes referred to as :dfn:`large files`." msgstr "" #: ../../library/posix.rst:46 diff --git a/library/secrets.po b/library/secrets.po index 9874bd3b1f..7f9a43dc1b 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" -"PO-Revision-Date: 2021-03-10 23:40+0800\n" +"POT-Creation-Date: 2022-06-07 00:13+0000\n" +"PO-Revision-Date: 2022-06-11 14:07+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 2.4.2\n" +"X-Generator: Poedit 3.1\n" #: ../../library/secrets.rst:2 msgid ":mod:`secrets` --- Generate secure random numbers for managing secrets" @@ -59,7 +59,7 @@ msgstr "亂數" msgid "" "The :mod:`secrets` module provides access to the most secure source of " "randomness that your operating system provides." -msgstr " :mod:`secrets` 模組使你得以存取作業系統所提供安全性最高的亂數產生器。" +msgstr ":mod:`secrets` 模組使你得以存取作業系統所提供安全性最高的亂數產生器。" #: ../../library/secrets.rst:41 msgid "" @@ -138,11 +138,11 @@ msgid "" "is sufficient for the typical use-case expected for the :mod:`secrets` " "module." msgstr "" -"為了在面對 `暴力攻擊 `_ 時" -"能保證安全,權杖必須具有足夠的隨機性。 不幸的是,對隨機性是否足夠的標準,會隨" -"著電腦越來越強大並能夠在更短時間內進行更多猜測而不斷提高。 在 2015 年時,人們" -"認為 32 位元組(256 位元)的隨機性對於 :mod:`secrets` 模組所預期的一般使用場" -"景來說是足夠的。" +"為了在面對\\ `暴力攻擊 `_" +"\\ 時能保證安全,權杖必須具有足夠的隨機性。 不幸的是,對隨機性是否足夠的標" +"準,會隨著電腦越來越強大並能夠在更短時間內進行更多猜測而不斷提高。 在 2015 年" +"時,人們認為 32 位元組(256 位元)的隨機性對於 :mod:`secrets` 模組所預期的一" +"般使用場景來說是足夠的。" #: ../../library/secrets.rst:112 msgid "" @@ -175,14 +175,15 @@ msgstr "其他函式" #: ../../library/secrets.rst:131 msgid "" -"Return ``True`` if strings *a* and *b* are equal, otherwise ``False``, in " -"such a way as to reduce the risk of `timing attacks `_. See :func:`hmac.compare_digest` for additional " -"details." +"Return ``True`` if strings *a* and *b* are equal, otherwise ``False``, using " +"a \"constant-time compare\" to reduce the risk of `timing attacks `_. See :func:`hmac.compare_digest` " +"for additional details." msgstr "" -"如果字串 *a* 與 *b* 相等則回傳 ``True``,否則回傳 ``False``,這樣的處理方式可" -"降低 `時序攻擊 `_ 的風險。 " -"請參閱 :func:`hmac.compare_digest` 以了解更多細節。" +"如果字串 *a* 與 *b* 相等則回傳 ``True``,否則回傳 ``False``,以\"恆定時間比" +"較 (constant-time compare) \"的處理方式可降低\\ `時序攻擊 `_\\ 的風險。 請參閱 :func:`hmac." +"compare_digest` 以了解更多細節。" #: ../../library/secrets.rst:138 msgid "Recipes and best practices" @@ -206,7 +207,7 @@ msgid "" "They should be salted and hashed using a cryptographically-strong one-way " "(irreversible) hash function." msgstr "" -"應用程式不能 `以可復原的格式存儲密碼 `_,無論是用純文本還是經過加密。 它們應當先加鹽" "(salt),再使用高加密強度的單向(不可逆)雜湊函數來產生雜湊值。" diff --git a/library/struct.po b/library/struct.po index 69c8e602fc..762fd3a234 100644 --- a/library/struct.po +++ b/library/struct.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2022-06-10 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -221,70 +221,71 @@ msgstr "" #: ../../library/struct.rst:147 msgid "" "Native byte order is big-endian or little-endian, depending on the host " -"system. For example, Intel x86 and AMD64 (x86-64) are little-endian; " -"Motorola 68000 and PowerPC G5 are big-endian; ARM and Intel Itanium feature " -"switchable endianness (bi-endian). Use ``sys.byteorder`` to check the " +"system. For example, Intel x86 and AMD64 (x86-64) are little-endian; IBM z " +"and most legacy architectures are big-endian; and ARM, RISC-V and IBM Power " +"feature switchable endianness (bi-endian, though the former two are nearly " +"always little-endian in practice). Use ``sys.byteorder`` to check the " "endianness of your system." msgstr "" -#: ../../library/struct.rst:153 +#: ../../library/struct.rst:154 msgid "" "Native size and alignment are determined using the C compiler's ``sizeof`` " "expression. This is always combined with native byte order." msgstr "" -#: ../../library/struct.rst:156 +#: ../../library/struct.rst:157 msgid "" "Standard size depends only on the format character; see the table in the :" "ref:`format-characters` section." msgstr "" -#: ../../library/struct.rst:159 +#: ../../library/struct.rst:160 msgid "" "Note the difference between ``'@'`` and ``'='``: both use native byte order, " "but the size and alignment of the latter is standardized." msgstr "" -#: ../../library/struct.rst:162 +#: ../../library/struct.rst:163 msgid "" "The form ``'!'`` represents the network byte order which is always big-" "endian as defined in `IETF RFC 1700 `_." msgstr "" -#: ../../library/struct.rst:165 +#: ../../library/struct.rst:166 msgid "" "There is no way to indicate non-native byte order (force byte-swapping); use " "the appropriate choice of ``'<'`` or ``'>'``." msgstr "" -#: ../../library/struct.rst:168 ../../library/struct.rst:247 +#: ../../library/struct.rst:169 ../../library/struct.rst:248 msgid "Notes:" msgstr "註解:" -#: ../../library/struct.rst:170 +#: ../../library/struct.rst:171 msgid "" "Padding is only automatically added between successive structure members. No " "padding is added at the beginning or the end of the encoded struct." msgstr "" -#: ../../library/struct.rst:173 +#: ../../library/struct.rst:174 msgid "" "No padding is added when using non-native size and alignment, e.g. with '<', " "'>', '=', and '!'." msgstr "" -#: ../../library/struct.rst:176 +#: ../../library/struct.rst:177 msgid "" "To align the end of a structure to the alignment requirement of a particular " "type, end the format with the code for that type with a repeat count of " "zero. See :ref:`struct-examples`." msgstr "" -#: ../../library/struct.rst:184 +#: ../../library/struct.rst:185 msgid "Format Characters" msgstr "" -#: ../../library/struct.rst:186 +#: ../../library/struct.rst:187 msgid "" "Format characters have the following meaning; the conversion between C and " "Python values should be obvious given their types. The 'Standard size' " @@ -294,298 +295,298 @@ msgid "" "platform-dependent." msgstr "" -#: ../../library/struct.rst:194 +#: ../../library/struct.rst:195 msgid "Format" msgstr "" -#: ../../library/struct.rst:194 +#: ../../library/struct.rst:195 msgid "C Type" msgstr "C Type" -#: ../../library/struct.rst:194 +#: ../../library/struct.rst:195 msgid "Python type" msgstr "" -#: ../../library/struct.rst:194 +#: ../../library/struct.rst:195 msgid "Standard size" msgstr "" -#: ../../library/struct.rst:194 +#: ../../library/struct.rst:195 msgid "Notes" msgstr "註解" -#: ../../library/struct.rst:196 +#: ../../library/struct.rst:197 msgid "``x``" msgstr "``x``" -#: ../../library/struct.rst:196 +#: ../../library/struct.rst:197 msgid "pad byte" msgstr "" -#: ../../library/struct.rst:196 +#: ../../library/struct.rst:197 msgid "no value" msgstr "" -#: ../../library/struct.rst:198 +#: ../../library/struct.rst:199 msgid "``c``" msgstr "``c``" -#: ../../library/struct.rst:198 +#: ../../library/struct.rst:199 msgid ":c:type:`char`" msgstr ":c:type:`char`" -#: ../../library/struct.rst:198 +#: ../../library/struct.rst:199 msgid "bytes of length 1" msgstr "" -#: ../../library/struct.rst:198 ../../library/struct.rst:200 -#: ../../library/struct.rst:202 ../../library/struct.rst:204 +#: ../../library/struct.rst:199 ../../library/struct.rst:201 +#: ../../library/struct.rst:203 ../../library/struct.rst:205 msgid "1" msgstr "1" -#: ../../library/struct.rst:200 +#: ../../library/struct.rst:201 msgid "``b``" msgstr "``b``" -#: ../../library/struct.rst:200 +#: ../../library/struct.rst:201 msgid ":c:type:`signed char`" msgstr ":c:type:`signed char`" -#: ../../library/struct.rst:200 ../../library/struct.rst:202 -#: ../../library/struct.rst:206 ../../library/struct.rst:208 -#: ../../library/struct.rst:210 ../../library/struct.rst:212 -#: ../../library/struct.rst:214 ../../library/struct.rst:216 -#: ../../library/struct.rst:218 ../../library/struct.rst:220 -#: ../../library/struct.rst:223 ../../library/struct.rst:225 -#: ../../library/struct.rst:237 +#: ../../library/struct.rst:201 ../../library/struct.rst:203 +#: ../../library/struct.rst:207 ../../library/struct.rst:209 +#: ../../library/struct.rst:211 ../../library/struct.rst:213 +#: ../../library/struct.rst:215 ../../library/struct.rst:217 +#: ../../library/struct.rst:219 ../../library/struct.rst:221 +#: ../../library/struct.rst:224 ../../library/struct.rst:226 +#: ../../library/struct.rst:238 msgid "integer" msgstr "" -#: ../../library/struct.rst:200 +#: ../../library/struct.rst:201 msgid "\\(1), \\(2)" msgstr "\\(1), \\(2)" -#: ../../library/struct.rst:202 +#: ../../library/struct.rst:203 msgid "``B``" msgstr "``B``" -#: ../../library/struct.rst:202 +#: ../../library/struct.rst:203 msgid ":c:type:`unsigned char`" msgstr ":c:type:`unsigned char`" -#: ../../library/struct.rst:202 ../../library/struct.rst:206 -#: ../../library/struct.rst:208 ../../library/struct.rst:210 -#: ../../library/struct.rst:212 ../../library/struct.rst:214 -#: ../../library/struct.rst:216 ../../library/struct.rst:218 -#: ../../library/struct.rst:220 +#: ../../library/struct.rst:203 ../../library/struct.rst:207 +#: ../../library/struct.rst:209 ../../library/struct.rst:211 +#: ../../library/struct.rst:213 ../../library/struct.rst:215 +#: ../../library/struct.rst:217 ../../library/struct.rst:219 +#: ../../library/struct.rst:221 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/struct.rst:204 +#: ../../library/struct.rst:205 msgid "``?``" msgstr "``?``" -#: ../../library/struct.rst:204 +#: ../../library/struct.rst:205 msgid ":c:type:`_Bool`" msgstr ":c:type:`_Bool`" -#: ../../library/struct.rst:204 +#: ../../library/struct.rst:205 msgid "bool" msgstr "bool" -#: ../../library/struct.rst:204 +#: ../../library/struct.rst:205 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/struct.rst:206 +#: ../../library/struct.rst:207 msgid "``h``" msgstr "``h``" -#: ../../library/struct.rst:206 +#: ../../library/struct.rst:207 msgid ":c:type:`short`" msgstr ":c:type:`short`" -#: ../../library/struct.rst:206 ../../library/struct.rst:208 -#: ../../library/struct.rst:227 +#: ../../library/struct.rst:207 ../../library/struct.rst:209 +#: ../../library/struct.rst:228 msgid "2" msgstr "2" -#: ../../library/struct.rst:208 +#: ../../library/struct.rst:209 msgid "``H``" msgstr "``H``" -#: ../../library/struct.rst:208 +#: ../../library/struct.rst:209 msgid ":c:type:`unsigned short`" msgstr ":c:type:`unsigned short`" -#: ../../library/struct.rst:210 +#: ../../library/struct.rst:211 msgid "``i``" msgstr "``i``" -#: ../../library/struct.rst:210 +#: ../../library/struct.rst:211 msgid ":c:type:`int`" msgstr ":c:type:`int`" -#: ../../library/struct.rst:210 ../../library/struct.rst:212 -#: ../../library/struct.rst:214 ../../library/struct.rst:216 -#: ../../library/struct.rst:229 +#: ../../library/struct.rst:211 ../../library/struct.rst:213 +#: ../../library/struct.rst:215 ../../library/struct.rst:217 +#: ../../library/struct.rst:230 msgid "4" msgstr "4" -#: ../../library/struct.rst:212 +#: ../../library/struct.rst:213 msgid "``I``" msgstr "``I``" -#: ../../library/struct.rst:212 +#: ../../library/struct.rst:213 msgid ":c:type:`unsigned int`" msgstr ":c:type:`unsigned int`" -#: ../../library/struct.rst:214 +#: ../../library/struct.rst:215 msgid "``l``" msgstr "``l``" -#: ../../library/struct.rst:214 +#: ../../library/struct.rst:215 msgid ":c:type:`long`" msgstr ":c:type:`long`" -#: ../../library/struct.rst:216 +#: ../../library/struct.rst:217 msgid "``L``" msgstr "``L``" -#: ../../library/struct.rst:216 +#: ../../library/struct.rst:217 msgid ":c:type:`unsigned long`" msgstr ":c:type:`unsigned long`" -#: ../../library/struct.rst:218 +#: ../../library/struct.rst:219 msgid "``q``" msgstr "``q``" -#: ../../library/struct.rst:218 +#: ../../library/struct.rst:219 msgid ":c:type:`long long`" msgstr ":c:type:`long long`" -#: ../../library/struct.rst:218 ../../library/struct.rst:220 -#: ../../library/struct.rst:231 +#: ../../library/struct.rst:219 ../../library/struct.rst:221 +#: ../../library/struct.rst:232 msgid "8" msgstr "8" -#: ../../library/struct.rst:220 +#: ../../library/struct.rst:221 msgid "``Q``" msgstr "``Q``" -#: ../../library/struct.rst:220 +#: ../../library/struct.rst:221 msgid ":c:type:`unsigned long long`" msgstr ":c:type:`unsigned long long`" -#: ../../library/struct.rst:223 +#: ../../library/struct.rst:224 msgid "``n``" msgstr "``n``" -#: ../../library/struct.rst:223 +#: ../../library/struct.rst:224 msgid ":c:type:`ssize_t`" msgstr ":c:type:`ssize_t`" -#: ../../library/struct.rst:223 ../../library/struct.rst:225 +#: ../../library/struct.rst:224 ../../library/struct.rst:226 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/struct.rst:225 +#: ../../library/struct.rst:226 msgid "``N``" msgstr "``N``" -#: ../../library/struct.rst:225 +#: ../../library/struct.rst:226 msgid ":c:type:`size_t`" msgstr ":c:type:`size_t`" -#: ../../library/struct.rst:227 +#: ../../library/struct.rst:228 msgid "``e``" msgstr "``e``" -#: ../../library/struct.rst:227 +#: ../../library/struct.rst:228 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/struct.rst:227 ../../library/struct.rst:229 -#: ../../library/struct.rst:231 +#: ../../library/struct.rst:228 ../../library/struct.rst:230 +#: ../../library/struct.rst:232 msgid "float" msgstr "float" -#: ../../library/struct.rst:227 ../../library/struct.rst:229 -#: ../../library/struct.rst:231 +#: ../../library/struct.rst:228 ../../library/struct.rst:230 +#: ../../library/struct.rst:232 msgid "\\(4)" msgstr "\\(4)" -#: ../../library/struct.rst:229 +#: ../../library/struct.rst:230 msgid "``f``" msgstr "``f``" -#: ../../library/struct.rst:229 +#: ../../library/struct.rst:230 msgid ":c:type:`float`" msgstr ":c:type:`float`" -#: ../../library/struct.rst:231 +#: ../../library/struct.rst:232 msgid "``d``" msgstr "``d``" -#: ../../library/struct.rst:231 +#: ../../library/struct.rst:232 msgid ":c:type:`double`" msgstr ":c:type:`double`" -#: ../../library/struct.rst:233 +#: ../../library/struct.rst:234 msgid "``s``" msgstr "``s``" -#: ../../library/struct.rst:233 ../../library/struct.rst:235 +#: ../../library/struct.rst:234 ../../library/struct.rst:236 msgid ":c:type:`char[]`" msgstr ":c:type:`char[]`" -#: ../../library/struct.rst:233 ../../library/struct.rst:235 +#: ../../library/struct.rst:234 ../../library/struct.rst:236 msgid "bytes" msgstr "" -#: ../../library/struct.rst:235 +#: ../../library/struct.rst:236 msgid "``p``" msgstr "``p``" -#: ../../library/struct.rst:237 +#: ../../library/struct.rst:238 msgid "``P``" msgstr "``P``" -#: ../../library/struct.rst:237 +#: ../../library/struct.rst:238 msgid ":c:type:`void \\*`" msgstr ":c:type:`void \\*`" -#: ../../library/struct.rst:237 +#: ../../library/struct.rst:238 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/struct.rst:240 +#: ../../library/struct.rst:241 msgid "Added support for the ``'n'`` and ``'N'`` formats." msgstr "新增 ``'n'`` 與 ``'N'`` 格式的支援。" -#: ../../library/struct.rst:243 +#: ../../library/struct.rst:244 msgid "Added support for the ``'e'`` format." msgstr "新增 ``'e'`` 格式的支援。" -#: ../../library/struct.rst:252 +#: ../../library/struct.rst:253 msgid "" "The ``'?'`` conversion code corresponds to the :c:type:`_Bool` type defined " "by C99. If this type is not available, it is simulated using a :c:type:" "`char`. In standard mode, it is always represented by one byte." msgstr "" -#: ../../library/struct.rst:257 +#: ../../library/struct.rst:258 msgid "" "When attempting to pack a non-integer using any of the integer conversion " "codes, if the non-integer has a :meth:`__index__` method then that method is " "called to convert the argument to an integer before packing." msgstr "" -#: ../../library/struct.rst:261 +#: ../../library/struct.rst:262 msgid "Added use of the :meth:`__index__` method for non-integers." msgstr "" -#: ../../library/struct.rst:265 +#: ../../library/struct.rst:266 msgid "" "The ``'n'`` and ``'N'`` conversion codes are only available for the native " "size (selected as the default or with the ``'@'`` byte order character). For " @@ -593,7 +594,7 @@ msgid "" "your application." msgstr "" -#: ../../library/struct.rst:271 +#: ../../library/struct.rst:272 msgid "" "For the ``'f'``, ``'d'`` and ``'e'`` conversion codes, the packed " "representation uses the IEEE 754 binary32, binary64 or binary16 format (for " @@ -601,7 +602,7 @@ msgid "" "format used by the platform." msgstr "" -#: ../../library/struct.rst:277 +#: ../../library/struct.rst:278 msgid "" "The ``'P'`` format character is only available for the native byte ordering " "(selected as the default or with the ``'@'`` byte order character). The byte " @@ -610,7 +611,7 @@ msgid "" "ordering, so the ``'P'`` format is not available." msgstr "" -#: ../../library/struct.rst:284 +#: ../../library/struct.rst:285 msgid "" "The IEEE 754 binary16 \"half precision\" type was introduced in the 2008 " "revision of the `IEEE 754 standard `_. It has a sign " @@ -622,19 +623,19 @@ msgid "" "format `_ for more information." msgstr "" -#: ../../library/struct.rst:294 +#: ../../library/struct.rst:295 msgid "" "A format character may be preceded by an integral repeat count. For " "example, the format string ``'4h'`` means exactly the same as ``'hhhh'``." msgstr "" -#: ../../library/struct.rst:297 +#: ../../library/struct.rst:298 msgid "" "Whitespace characters between formats are ignored; a count and its format " "must not contain whitespace though." msgstr "" -#: ../../library/struct.rst:300 +#: ../../library/struct.rst:301 msgid "" "For the ``'s'`` format character, the count is interpreted as the length of " "the bytes, not a repeat count like for the other format characters; for " @@ -646,7 +647,7 @@ msgid "" "(while ``'0c'`` means 0 characters)." msgstr "" -#: ../../library/struct.rst:309 +#: ../../library/struct.rst:310 msgid "" "When packing a value ``x`` using one of the integer formats (``'b'``, " "``'B'``, ``'h'``, ``'H'``, ``'i'``, ``'I'``, ``'l'``, ``'L'``, ``'q'``, " @@ -654,13 +655,13 @@ msgid "" "`struct.error` is raised." msgstr "" -#: ../../library/struct.rst:314 +#: ../../library/struct.rst:315 msgid "" "Previously, some of the integer formats wrapped out-of-range values and " "raised :exc:`DeprecationWarning` instead of :exc:`struct.error`." msgstr "" -#: ../../library/struct.rst:318 +#: ../../library/struct.rst:319 msgid "" "The ``'p'`` format character encodes a \"Pascal string\", meaning a short " "variable-length string stored in a *fixed number of bytes*, given by the " @@ -674,7 +675,7 @@ msgid "" "more than 255 bytes." msgstr "" -#: ../../library/struct.rst:331 +#: ../../library/struct.rst:332 msgid "" "For the ``'?'`` format character, the return value is either :const:`True` " "or :const:`False`. When packing, the truth value of the argument object is " @@ -682,69 +683,69 @@ msgid "" "packed, and any non-zero value will be ``True`` when unpacking." msgstr "" -#: ../../library/struct.rst:341 +#: ../../library/struct.rst:342 msgid "Examples" msgstr "範例" -#: ../../library/struct.rst:344 +#: ../../library/struct.rst:345 msgid "" "All examples assume a native byte order, size, and alignment with a big-" "endian machine." msgstr "" -#: ../../library/struct.rst:347 +#: ../../library/struct.rst:348 msgid "A basic example of packing/unpacking three integers::" msgstr "" -#: ../../library/struct.rst:357 +#: ../../library/struct.rst:358 msgid "" "Unpacked fields can be named by assigning them to variables or by wrapping " "the result in a named tuple::" msgstr "" -#: ../../library/struct.rst:368 +#: ../../library/struct.rst:369 msgid "" "The ordering of format characters may have an impact on size since the " "padding needed to satisfy alignment requirements is different::" msgstr "" -#: ../../library/struct.rst:380 +#: ../../library/struct.rst:381 msgid "" "The following format ``'llh0l'`` specifies two pad bytes at the end, " "assuming longs are aligned on 4-byte boundaries::" msgstr "" -#: ../../library/struct.rst:386 +#: ../../library/struct.rst:387 msgid "" "This only works when native size and alignment are in effect; standard size " "and alignment does not enforce any alignment." msgstr "" -#: ../../library/struct.rst:393 +#: ../../library/struct.rst:394 msgid "Module :mod:`array`" msgstr ":mod:`array` 模組" -#: ../../library/struct.rst:393 +#: ../../library/struct.rst:394 msgid "Packed binary storage of homogeneous data." msgstr "" -#: ../../library/struct.rst:395 +#: ../../library/struct.rst:396 msgid "Module :mod:`xdrlib`" msgstr ":mod:`xdrlib` 模組" -#: ../../library/struct.rst:396 +#: ../../library/struct.rst:397 msgid "Packing and unpacking of XDR data." msgstr "" -#: ../../library/struct.rst:402 +#: ../../library/struct.rst:403 msgid "Classes" msgstr "" -#: ../../library/struct.rst:404 +#: ../../library/struct.rst:405 msgid "The :mod:`struct` module also defines the following type:" msgstr "" -#: ../../library/struct.rst:409 +#: ../../library/struct.rst:410 msgid "" "Return a new Struct object which writes and reads binary data according to " "the format string *format*. Creating a Struct object once and calling its " @@ -752,7 +753,7 @@ msgid "" "same format since the format string only needs to be compiled once." msgstr "" -#: ../../library/struct.rst:416 +#: ../../library/struct.rst:417 msgid "" "The compiled versions of the most recent format strings passed to :class:" "`Struct` and the module-level functions are cached, so programs that use " @@ -760,48 +761,48 @@ msgid "" "`Struct` instance." msgstr "" -#: ../../library/struct.rst:421 +#: ../../library/struct.rst:422 msgid "Compiled Struct objects support the following methods and attributes:" msgstr "" -#: ../../library/struct.rst:425 +#: ../../library/struct.rst:426 msgid "" "Identical to the :func:`pack` function, using the compiled format. " "(``len(result)`` will equal :attr:`size`.)" msgstr "" -#: ../../library/struct.rst:431 +#: ../../library/struct.rst:432 msgid "Identical to the :func:`pack_into` function, using the compiled format." msgstr "" -#: ../../library/struct.rst:436 +#: ../../library/struct.rst:437 msgid "" "Identical to the :func:`unpack` function, using the compiled format. The " "buffer's size in bytes must equal :attr:`size`." msgstr "" -#: ../../library/struct.rst:442 +#: ../../library/struct.rst:443 msgid "" "Identical to the :func:`unpack_from` function, using the compiled format. " "The buffer's size in bytes, starting at position *offset*, must be at least :" "attr:`size`." msgstr "" -#: ../../library/struct.rst:449 +#: ../../library/struct.rst:450 msgid "" "Identical to the :func:`iter_unpack` function, using the compiled format. " "The buffer's size in bytes must be a multiple of :attr:`size`." msgstr "" -#: ../../library/struct.rst:456 +#: ../../library/struct.rst:457 msgid "The format string used to construct this Struct object." msgstr "" -#: ../../library/struct.rst:458 +#: ../../library/struct.rst:459 msgid "The format string type is now :class:`str` instead of :class:`bytes`." msgstr "" -#: ../../library/struct.rst:463 +#: ../../library/struct.rst:464 msgid "" "The calculated size of the struct (and hence of the bytes object produced by " "the :meth:`pack` method) corresponding to :attr:`format`." diff --git a/library/warnings.po b/library/warnings.po index 619f8ef123..88f458afb7 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-05 00:10+0000\n" +"POT-Creation-Date: 2022-06-01 05:12+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -315,45 +315,50 @@ msgstr "" #: ../../library/warnings.rst:156 msgid "" "*message* is a string containing a regular expression that the start of the " -"warning message must match. The expression is compiled to always be case-" -"insensitive." +"warning message must match, case-insensitively. In :option:`-W` and :envvar:" +"`PYTHONWARNINGS`, *message* is a literal string that the start of the " +"warning message must contain (case-insensitively), ignoring any whitespace " +"at the start or end of *message*." msgstr "" -#: ../../library/warnings.rst:160 +#: ../../library/warnings.rst:162 msgid "" "*category* is a class (a subclass of :exc:`Warning`) of which the warning " "category must be a subclass in order to match." msgstr "" -#: ../../library/warnings.rst:163 +#: ../../library/warnings.rst:165 msgid "" -"*module* is a string containing a regular expression that the module name " -"must match. The expression is compiled to be case-sensitive." +"*module* is a string containing a regular expression that the start of the " +"fully-qualified module name must match, case-sensitively. In :option:`-W` " +"and :envvar:`PYTHONWARNINGS`, *module* is a literal string that the fully-" +"qualified module name must be equal to (case-sensitively), ignoring any " +"whitespace at the start or end of *module*." msgstr "" -#: ../../library/warnings.rst:166 +#: ../../library/warnings.rst:171 msgid "" "*lineno* is an integer that the line number where the warning occurred must " "match, or ``0`` to match all line numbers." msgstr "" -#: ../../library/warnings.rst:169 +#: ../../library/warnings.rst:174 msgid "" "Since the :exc:`Warning` class is derived from the built-in :exc:`Exception` " "class, to turn a warning into an error we simply raise ``category(message)``." msgstr "" -#: ../../library/warnings.rst:172 +#: ../../library/warnings.rst:177 msgid "" "If a warning is reported and doesn't match any registered filter then the " "\"default\" action is applied (hence its name)." msgstr "" -#: ../../library/warnings.rst:179 +#: ../../library/warnings.rst:184 msgid "Describing Warning Filters" msgstr "" -#: ../../library/warnings.rst:181 +#: ../../library/warnings.rst:186 msgid "" "The warnings filter is initialized by :option:`-W` options passed to the " "Python interpreter command line and the :envvar:`PYTHONWARNINGS` environment " @@ -363,13 +368,13 @@ msgid "" "after printing a message to :data:`sys.stderr`)." msgstr "" -#: ../../library/warnings.rst:188 +#: ../../library/warnings.rst:193 msgid "" "Individual warnings filters are specified as a sequence of fields separated " "by colons::" msgstr "" -#: ../../library/warnings.rst:193 +#: ../../library/warnings.rst:198 msgid "" "The meaning of each of these fields is as described in :ref:`warning-" "filter`. When listing multiple filters on a single line (as for :envvar:" @@ -379,60 +384,60 @@ msgid "" "precedence over earlier ones)." msgstr "" -#: ../../library/warnings.rst:200 +#: ../../library/warnings.rst:205 msgid "" "Commonly used warning filters apply to either all warnings, warnings in a " "particular category, or warnings raised by particular modules or packages. " "Some examples::" msgstr "" -#: ../../library/warnings.rst:217 +#: ../../library/warnings.rst:221 msgid "Default Warning Filter" msgstr "" -#: ../../library/warnings.rst:219 +#: ../../library/warnings.rst:223 msgid "" "By default, Python installs several warning filters, which can be overridden " "by the :option:`-W` command-line option, the :envvar:`PYTHONWARNINGS` " "environment variable and calls to :func:`filterwarnings`." msgstr "" -#: ../../library/warnings.rst:223 +#: ../../library/warnings.rst:227 msgid "" "In regular release builds, the default warning filter has the following " "entries (in order of precedence)::" msgstr "" -#: ../../library/warnings.rst:232 +#: ../../library/warnings.rst:236 msgid "" "In a :ref:`debug build `, the list of default warning filters " "is empty." msgstr "" -#: ../../library/warnings.rst:234 +#: ../../library/warnings.rst:238 msgid "" ":exc:`DeprecationWarning` is now ignored by default in addition to :exc:" "`PendingDeprecationWarning`." msgstr "" -#: ../../library/warnings.rst:238 +#: ../../library/warnings.rst:242 msgid "" ":exc:`DeprecationWarning` is once again shown by default when triggered " "directly by code in ``__main__``." msgstr "" -#: ../../library/warnings.rst:242 +#: ../../library/warnings.rst:246 msgid "" ":exc:`BytesWarning` no longer appears in the default filter list and is " "instead configured via :data:`sys.warnoptions` when :option:`-b` is " "specified twice." msgstr "" -#: ../../library/warnings.rst:251 +#: ../../library/warnings.rst:255 msgid "Overriding the default filter" msgstr "" -#: ../../library/warnings.rst:253 +#: ../../library/warnings.rst:257 msgid "" "Developers of applications written in Python may wish to hide *all* Python " "level warnings from their users by default, and only display them when " @@ -442,14 +447,14 @@ msgid "" "disabled::" msgstr "" -#: ../../library/warnings.rst:265 +#: ../../library/warnings.rst:269 msgid "" "Developers of test runners for Python code are advised to instead ensure " "that *all* warnings are displayed by default for the code under test, using " "code like::" msgstr "" -#: ../../library/warnings.rst:276 +#: ../../library/warnings.rst:280 msgid "" "Finally, developers of interactive shells that run user code in a namespace " "other than ``__main__`` are advised to ensure that :exc:`DeprecationWarning` " @@ -457,11 +462,11 @@ msgid "" "``user_ns`` is the module used to execute code entered interactively)::" msgstr "" -#: ../../library/warnings.rst:289 +#: ../../library/warnings.rst:293 msgid "Temporarily Suppressing Warnings" msgstr "" -#: ../../library/warnings.rst:291 +#: ../../library/warnings.rst:295 msgid "" "If you are using code that you know will raise a warning, such as a " "deprecated function, but do not want to see the warning (even when warnings " @@ -469,7 +474,7 @@ msgid "" "to suppress the warning using the :class:`catch_warnings` context manager::" msgstr "" -#: ../../library/warnings.rst:305 +#: ../../library/warnings.rst:309 msgid "" "While within the context manager all warnings will simply be ignored. This " "allows you to use known-deprecated code without having to see the warning " @@ -479,11 +484,11 @@ msgid "" "context manager at the same time, the behavior is undefined." msgstr "" -#: ../../library/warnings.rst:317 +#: ../../library/warnings.rst:321 msgid "Testing Warnings" msgstr "" -#: ../../library/warnings.rst:319 +#: ../../library/warnings.rst:323 msgid "" "To test warnings raised by code, use the :class:`catch_warnings` context " "manager. With it you can temporarily mutate the warnings filter to " @@ -491,7 +496,7 @@ msgid "" "raised warnings to check::" msgstr "" -#: ../../library/warnings.rst:339 +#: ../../library/warnings.rst:343 msgid "" "One can also cause all warnings to be exceptions by using ``error`` instead " "of ``always``. One thing to be aware of is that if a warning has already " @@ -500,7 +505,7 @@ msgid "" "registry related to the warning has been cleared." msgstr "" -#: ../../library/warnings.rst:345 +#: ../../library/warnings.rst:349 msgid "" "Once the context manager exits, the warnings filter is restored to its state " "when the context was entered. This prevents tests from changing the warnings " @@ -511,7 +516,7 @@ msgid "" "manager at the same time, the behavior is undefined." msgstr "" -#: ../../library/warnings.rst:353 +#: ../../library/warnings.rst:357 msgid "" "When testing multiple operations that raise the same kind of warning, it is " "important to test them in a manner that confirms each operation is raising a " @@ -521,18 +526,18 @@ msgid "" "entries from the warnings list before each new operation)." msgstr "" -#: ../../library/warnings.rst:364 +#: ../../library/warnings.rst:368 msgid "Updating Code For New Versions of Dependencies" msgstr "" -#: ../../library/warnings.rst:366 +#: ../../library/warnings.rst:370 msgid "" "Warning categories that are primarily of interest to Python developers " "(rather than end users of applications written in Python) are ignored by " "default." msgstr "" -#: ../../library/warnings.rst:369 +#: ../../library/warnings.rst:373 msgid "" "Notably, this \"ignored by default\" list includes :exc:`DeprecationWarning` " "(for every module except ``__main__``), which means developers should make " @@ -541,14 +546,14 @@ msgid "" "(whether in the standard library or third party packages)." msgstr "" -#: ../../library/warnings.rst:375 +#: ../../library/warnings.rst:379 msgid "" "In the ideal case, the code will have a suitable test suite, and the test " "runner will take care of implicitly enabling all warnings when running tests " "(the test runner provided by the :mod:`unittest` module does this)." msgstr "" -#: ../../library/warnings.rst:379 +#: ../../library/warnings.rst:383 msgid "" "In less ideal cases, applications can be checked for use of deprecated " "interfaces by passing :option:`-Wd <-W>` to the Python interpreter (this is " @@ -560,11 +565,11 @@ msgid "" "what is possible." msgstr "" -#: ../../library/warnings.rst:392 +#: ../../library/warnings.rst:396 msgid "Available Functions" msgstr "" -#: ../../library/warnings.rst:397 +#: ../../library/warnings.rst:401 msgid "" "Issue a warning, or maybe ignore it or raise an exception. The *category* " "argument, if given, must be a :ref:`warning category class `. The entry is inserted at the front by default; if " @@ -650,7 +655,7 @@ msgid "" "everything." msgstr "" -#: ../../library/warnings.rst:477 +#: ../../library/warnings.rst:481 msgid "" "Insert a simple entry into the list of :ref:`warnings filter specifications " "`. The meaning of the function parameters is as for :func:" @@ -659,18 +664,18 @@ msgid "" "and line number match." msgstr "" -#: ../../library/warnings.rst:486 +#: ../../library/warnings.rst:490 msgid "" "Reset the warnings filter. This discards the effect of all previous calls " "to :func:`filterwarnings`, including that of the :option:`-W` command line " "options and calls to :func:`simplefilter`." msgstr "" -#: ../../library/warnings.rst:492 +#: ../../library/warnings.rst:496 msgid "Available Context Managers" msgstr "" -#: ../../library/warnings.rst:496 +#: ../../library/warnings.rst:500 msgid "" "A context manager that copies and, upon exit, restores the warnings filter " "and the :func:`showwarning` function. If the *record* argument is :const:" @@ -681,14 +686,14 @@ msgid "" "has attributes with the same names as the arguments to :func:`showwarning`." msgstr "" -#: ../../library/warnings.rst:505 +#: ../../library/warnings.rst:509 msgid "" "The *module* argument takes a module that will be used instead of the module " "returned when you import :mod:`warnings` whose filter will be protected. " "This argument exists primarily for testing the :mod:`warnings` module itself." msgstr "" -#: ../../library/warnings.rst:512 +#: ../../library/warnings.rst:516 msgid "" "The :class:`catch_warnings` manager works by replacing and then later " "restoring the module's :func:`showwarning` function and internal list of " diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 04925cf995..6d3d09703f 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -2459,7 +2459,7 @@ msgstr "" #: ../../whatsnew/3.10.rst:1934 msgid "Changes in the C API" -msgstr "" +msgstr "C API 中的改動" #: ../../whatsnew/3.10.rst:1936 msgid "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index a1af199c67..d97ba9bb6e 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -3452,7 +3452,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:2486 msgid "Changes in the C API" -msgstr "" +msgstr "C API 中的改動" #: ../../whatsnew/3.4.rst:2488 msgid "" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index f3ea1278fb..55c94bb9e5 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -3276,7 +3276,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2513 msgid "Changes in the C API" -msgstr "" +msgstr "C API 中的改動" #: ../../whatsnew/3.5.rst:2515 msgid "" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index b1d8ba8248..1ff5268c36 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -3053,7 +3053,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2331 msgid "Changes in the C API" -msgstr "" +msgstr "C API 中的改動" #: ../../whatsnew/3.6.rst:2333 msgid "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 516983ece0..f48e3d38e2 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -3450,7 +3450,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:2450 msgid "Changes in the C API" -msgstr "" +msgstr "C API 中的改動" #: ../../whatsnew/3.7.rst:2452 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 2ceab0290e..e623508aea 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-30 00:18+0000\n" +"POT-Creation-Date: 2022-06-07 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2614,11 +2614,17 @@ msgid "" "code future-proof." msgstr "" -#: ../../whatsnew/3.8.rst:2010 -msgid "Changes in the C API" +#: ../../whatsnew/3.8.rst:2008 +msgid "" +"The parameter ``digestmod`` for :func:`hmac.new` no longer uses the MD5 " +"digest by default." msgstr "" #: ../../whatsnew/3.8.rst:2012 +msgid "Changes in the C API" +msgstr "C API 中的改動" + +#: ../../whatsnew/3.8.rst:2014 msgid "" "The :c:type:`PyCompilerFlags` structure got a new *cf_feature_version* " "field. It should be initialized to ``PY_MINOR_VERSION``. The field is " @@ -2626,14 +2632,14 @@ msgid "" "in *cf_flags*. (Contributed by Guido van Rossum in :issue:`35766`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2018 +#: ../../whatsnew/3.8.rst:2020 msgid "" "The :c:func:`PyEval_ReInitThreads` function has been removed from the C API. " "It should not be called explicitly: use :c:func:`PyOS_AfterFork_Child` " "instead. (Contributed by Victor Stinner in :issue:`36728`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2023 +#: ../../whatsnew/3.8.rst:2025 msgid "" "On Unix, C extensions are no longer linked to libpython except on Android " "and Cygwin. When Python is embedded, ``libpython`` must not be loaded with " @@ -2644,7 +2650,7 @@ msgid "" "Stinner in :issue:`21536`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2031 +#: ../../whatsnew/3.8.rst:2033 msgid "" "Use of ``#`` variants of formats in parsing or building value (e.g. :c:func:" "`PyArg_ParseTuple`, :c:func:`Py_BuildValue`, :c:func:" @@ -2653,7 +2659,7 @@ msgid "" "`arg-parsing` for detail. (Contributed by Inada Naoki in :issue:`36381`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2037 +#: ../../whatsnew/3.8.rst:2039 msgid "" "Instances of heap-allocated types (such as those created with :c:func:" "`PyType_FromSpec`) hold a reference to their type object. Increasing the " @@ -2663,11 +2669,11 @@ msgid "" "through :c:func:`PyType_FromSpec` behave like other classes in managed code." msgstr "" -#: ../../whatsnew/3.8.rst:2045 +#: ../../whatsnew/3.8.rst:2047 msgid ":ref:`Statically allocated types ` are not affected." msgstr "" -#: ../../whatsnew/3.8.rst:2047 +#: ../../whatsnew/3.8.rst:2049 msgid "" "For the vast majority of cases, there should be no side effect. However, " "types that manually increase the reference count after allocating an " @@ -2676,12 +2682,12 @@ msgid "" "instance deallocation." msgstr "" -#: ../../whatsnew/3.8.rst:2053 +#: ../../whatsnew/3.8.rst:2055 msgid "" "To correctly port these types into 3.8, please apply the following changes:" msgstr "" -#: ../../whatsnew/3.8.rst:2056 +#: ../../whatsnew/3.8.rst:2058 msgid "" "Remove :c:macro:`Py_INCREF` on the type object after allocating an instance " "- if any. This may happen after calling :c:func:`PyObject_New`, :c:func:" @@ -2690,32 +2696,32 @@ msgid "" "`PyObject_INIT`." msgstr "" -#: ../../whatsnew/3.8.rst:2063 ../../whatsnew/3.8.rst:2082 -#: ../../whatsnew/3.8.rst:2101 +#: ../../whatsnew/3.8.rst:2065 ../../whatsnew/3.8.rst:2084 +#: ../../whatsnew/3.8.rst:2103 msgid "Example:" msgstr "範例:" -#: ../../whatsnew/3.8.rst:2079 +#: ../../whatsnew/3.8.rst:2081 msgid "" "Ensure that all custom ``tp_dealloc`` functions of heap-allocated types " "decrease the type's reference count." msgstr "" -#: ../../whatsnew/3.8.rst:2096 +#: ../../whatsnew/3.8.rst:2098 msgid "(Contributed by Eddie Elizondo in :issue:`35810`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2098 +#: ../../whatsnew/3.8.rst:2100 msgid "" "The :c:macro:`Py_DEPRECATED()` macro has been implemented for MSVC. The " "macro now must be placed before the symbol name." msgstr "" -#: ../../whatsnew/3.8.rst:2107 +#: ../../whatsnew/3.8.rst:2109 msgid "(Contributed by Zackery Spytz in :issue:`33407`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2109 +#: ../../whatsnew/3.8.rst:2111 msgid "" "The interpreter does not pretend to support binary compatibility of " "extension types across feature releases, anymore. A :c:type:`PyTypeObject` " @@ -2725,17 +2731,17 @@ msgid "" "before reading :c:member:`~PyTypeObject.tp_finalize`)." msgstr "" -#: ../../whatsnew/3.8.rst:2116 +#: ../../whatsnew/3.8.rst:2118 msgid "(Contributed by Antoine Pitrou in :issue:`32388`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2118 +#: ../../whatsnew/3.8.rst:2120 msgid "" "The functions :c:func:`PyNode_AddChild` and :c:func:`PyParser_AddToken` now " "accept two additional ``int`` arguments *end_lineno* and *end_col_offset*." msgstr "" -#: ../../whatsnew/3.8.rst:2121 +#: ../../whatsnew/3.8.rst:2123 msgid "" "The :file:`libpython38.a` file to allow MinGW tools to link directly " "against :file:`python38.dll` is no longer included in the regular Windows " @@ -2744,7 +2750,7 @@ msgid "" "package:" msgstr "" -#: ../../whatsnew/3.8.rst:2131 +#: ../../whatsnew/3.8.rst:2133 msgid "" "The location of an installed :file:`pythonXY.dll` will depend on the " "installation options and the version and language of Windows. See :ref:" @@ -2753,15 +2759,15 @@ msgid "" "the :file:`libs` directory under your Python installation." msgstr "" -#: ../../whatsnew/3.8.rst:2137 +#: ../../whatsnew/3.8.rst:2139 msgid "(Contributed by Steve Dower in :issue:`37351`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2141 +#: ../../whatsnew/3.8.rst:2143 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.8.rst:2143 +#: ../../whatsnew/3.8.rst:2145 msgid "" "The interpreter loop has been simplified by moving the logic of unrolling " "the stack of blocks into the compiler. The compiler emits now explicit " @@ -2769,7 +2775,7 @@ msgid "" "code for :keyword:`break`, :keyword:`continue` and :keyword:`return`." msgstr "" -#: ../../whatsnew/3.8.rst:2149 +#: ../../whatsnew/3.8.rst:2151 msgid "" "Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`, :opcode:" "`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes :opcode:" @@ -2778,20 +2784,20 @@ msgid "" "`WITH_CLEANUP_START`." msgstr "" -#: ../../whatsnew/3.8.rst:2155 +#: ../../whatsnew/3.8.rst:2157 msgid "" "(Contributed by Mark Shannon, Antoine Pitrou and Serhiy Storchaka in :issue:" "`17611`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2158 +#: ../../whatsnew/3.8.rst:2160 msgid "" "Added new opcode :opcode:`END_ASYNC_FOR` for handling exceptions raised when " "awaiting a next item in an :keyword:`async for` loop. (Contributed by Serhiy " "Storchaka in :issue:`33041`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2162 +#: ../../whatsnew/3.8.rst:2164 msgid "" "The :opcode:`MAP_ADD` now expects the value as the first element in the " "stack and the key as the second element. This change was made so the key is " @@ -2799,22 +2805,22 @@ msgid "" "by :pep:`572`. (Contributed by Jörn Heissler in :issue:`35224`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2169 +#: ../../whatsnew/3.8.rst:2171 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.8.rst:2171 +#: ../../whatsnew/3.8.rst:2173 msgid "" "Added a benchmark script for timing various ways to access variables: " "``Tools/scripts/var_access_benchmark.py``. (Contributed by Raymond Hettinger " "in :issue:`35884`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2175 +#: ../../whatsnew/3.8.rst:2177 msgid "Here's a summary of performance improvements since Python 3.3:" msgstr "" -#: ../../whatsnew/3.8.rst:2222 +#: ../../whatsnew/3.8.rst:2224 msgid "" "The benchmarks were measured on an `Intel® Core™ i7-4960HQ processor " "