From c334bb36ff3f27cdc31735056c29c5f9bd655e26 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 28 Aug 2023 00:06:04 +0000 Subject: [PATCH 01/18] sync with cpython f90099c3 --- library/dis.po | 385 ++++++++--------- library/io.po | 57 +-- reference/datamodel.po | 936 ++++++++++++++++++++--------------------- 3 files changed, 695 insertions(+), 683 deletions(-) diff --git a/library/dis.po b/library/dis.po index a3c151150f..a8f051c8cc 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-31 00:03+0000\n" +"POT-Creation-Date: 2023-08-28 00:04+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,13 +69,13 @@ msgid "" msgstr "" #: ../../library/dis.rst:46 -msgid "Example: Given the function :func:`myfunc`::" +msgid "Example: Given the function :func:`!myfunc`::" msgstr "" #: ../../library/dis.rst:51 msgid "" -"the following command can be used to display the disassembly of :func:" -"`myfunc`:" +"the following command can be used to display the disassembly of :func:`!" +"myfunc`:" msgstr "" #: ../../library/dis.rst:64 @@ -556,9 +556,9 @@ msgstr "" #: ../../library/dis.rst:546 ../../library/dis.rst:554 #: ../../library/dis.rst:566 ../../library/dis.rst:654 #: ../../library/dis.rst:664 ../../library/dis.rst:674 -#: ../../library/dis.rst:894 ../../library/dis.rst:904 -#: ../../library/dis.rst:1003 ../../library/dis.rst:1015 -#: ../../library/dis.rst:1027 +#: ../../library/dis.rst:894 ../../library/dis.rst:905 +#: ../../library/dis.rst:1005 ../../library/dis.rst:1017 +#: ../../library/dis.rst:1029 msgid "Implements::" msgstr "" @@ -756,7 +756,7 @@ msgstr "" #: ../../library/dis.rst:796 msgid "" -"Pushes :func:`builtins.__build_class__` onto the stack. It is later called " +"Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" @@ -797,7 +797,7 @@ msgid "" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:846 ../../library/dis.rst:1465 +#: ../../library/dis.rst:846 ../../library/dis.rst:1467 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." @@ -806,14 +806,15 @@ msgstr "" #: ../../library/dis.rst:853 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " -"attribute :attr:`co_names` of the code object. The compiler tries to use :" -"opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible." +"attribute :attr:`!co_names` of the :ref:`code object `. The " +"compiler tries to use :opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if " +"possible." msgstr "" #: ../../library/dis.rst:860 msgid "" -"Implements ``del name``, where *namei* is the index into :attr:`co_names` " -"attribute of the code object." +"Implements ``del name``, where *namei* is the index into :attr:`!co_names` " +"attribute of the :ref:`code object `." msgstr "" #: ../../library/dis.rst:866 @@ -850,39 +851,43 @@ msgid "" msgstr "" #: ../../library/dis.rst:900 -msgid "where *namei* is the index of name in :attr:`co_names`." +msgid "" +"where *namei* is the index of name in :attr:`!co_names` of the :ref:`code " +"object `." msgstr "" -#: ../../library/dis.rst:909 -msgid "where *namei* is the index of name into :attr:`co_names`." +#: ../../library/dis.rst:910 +msgid "" +"where *namei* is the index of name into :attr:`!co_names` of the :ref:`code " +"object `." msgstr "" -#: ../../library/dis.rst:914 +#: ../../library/dis.rst:916 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:919 +#: ../../library/dis.rst:921 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:924 +#: ../../library/dis.rst:926 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:929 +#: ../../library/dis.rst:931 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:935 +#: ../../library/dis.rst:937 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:944 +#: ../../library/dis.rst:946 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -891,69 +896,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:955 +#: ../../library/dis.rst:957 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:965 +#: ../../library/dis.rst:967 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:970 +#: ../../library/dis.rst:972 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:975 +#: ../../library/dis.rst:977 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:979 +#: ../../library/dis.rst:981 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:986 +#: ../../library/dis.rst:988 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:995 +#: ../../library/dis.rst:997 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1008 +#: ../../library/dis.rst:1010 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1020 +#: ../../library/dis.rst:1022 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1032 +#: ../../library/dis.rst:1034 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1039 +#: ../../library/dis.rst:1041 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1046 +#: ../../library/dis.rst:1048 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1049 +#: ../../library/dis.rst:1051 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -964,13 +969,13 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1057 +#: ../../library/dis.rst:1059 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1064 +#: ../../library/dis.rst:1066 msgid "" "This opcode implements :func:`super` (e.g. ``super().method()`` and " "``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " @@ -980,33 +985,33 @@ msgid "" "class within which the current method was defined), and the global ``super``." msgstr "" -#: ../../library/dis.rst:1071 +#: ../../library/dis.rst:1073 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`." msgstr "" -#: ../../library/dis.rst:1074 +#: ../../library/dis.rst:1076 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1082 +#: ../../library/dis.rst:1084 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1088 +#: ../../library/dis.rst:1090 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1095 +#: ../../library/dis.rst:1097 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1102 +#: ../../library/dis.rst:1104 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1015,68 +1020,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1110 +#: ../../library/dis.rst:1112 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1117 +#: ../../library/dis.rst:1119 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1122 +#: ../../library/dis.rst:1124 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1129 +#: ../../library/dis.rst:1131 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1136 +#: ../../library/dis.rst:1138 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1139 ../../library/dis.rst:1152 +#: ../../library/dis.rst:1141 ../../library/dis.rst:1154 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1144 ../../library/dis.rst:1157 -#: ../../library/dis.rst:1170 ../../library/dis.rst:1184 +#: ../../library/dis.rst:1146 ../../library/dis.rst:1159 +#: ../../library/dis.rst:1172 ../../library/dis.rst:1186 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1149 +#: ../../library/dis.rst:1151 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1162 +#: ../../library/dis.rst:1164 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1165 ../../library/dis.rst:1179 +#: ../../library/dis.rst:1167 ../../library/dis.rst:1181 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1176 +#: ../../library/dis.rst:1178 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1189 +#: ../../library/dis.rst:1191 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1084,83 +1089,83 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1194 +#: ../../library/dis.rst:1196 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1199 +#: ../../library/dis.rst:1201 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1201 +#: ../../library/dis.rst:1203 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1207 +#: ../../library/dis.rst:1209 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1209 +#: ../../library/dis.rst:1211 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1215 +#: ../../library/dis.rst:1217 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1223 +#: ../../library/dis.rst:1225 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1231 +#: ../../library/dis.rst:1233 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1236 +#: ../../library/dis.rst:1238 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1241 +#: ../../library/dis.rst:1243 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1249 +#: ../../library/dis.rst:1251 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1252 +#: ../../library/dis.rst:1254 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1255 ../../library/dis.rst:1264 -#: ../../library/dis.rst:1286 ../../library/dis.rst:1297 +#: ../../library/dis.rst:1257 ../../library/dis.rst:1266 +#: ../../library/dis.rst:1288 ../../library/dis.rst:1299 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1261 +#: ../../library/dis.rst:1263 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1270 +#: ../../library/dis.rst:1272 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1170,94 +1175,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1283 +#: ../../library/dis.rst:1285 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1292 +#: ../../library/dis.rst:1294 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1303 +#: ../../library/dis.rst:1305 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1312 +#: ../../library/dis.rst:1314 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1315 +#: ../../library/dis.rst:1317 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1316 +#: ../../library/dis.rst:1318 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1317 +#: ../../library/dis.rst:1319 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1323 +#: ../../library/dis.rst:1325 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1328 +#: ../../library/dis.rst:1330 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1329 ../../library/dis.rst:1335 +#: ../../library/dis.rst:1331 ../../library/dis.rst:1337 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1330 +#: ../../library/dis.rst:1332 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1331 ../../library/dis.rst:1338 +#: ../../library/dis.rst:1333 ../../library/dis.rst:1340 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1333 +#: ../../library/dis.rst:1335 msgid "or:" msgstr "或:" -#: ../../library/dis.rst:1336 +#: ../../library/dis.rst:1338 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1337 +#: ../../library/dis.rst:1339 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1340 +#: ../../library/dis.rst:1342 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1343 +#: ../../library/dis.rst:1345 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1352 +#: ../../library/dis.rst:1354 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1269,70 +1274,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1367 +#: ../../library/dis.rst:1369 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1376 +#: ../../library/dis.rst:1378 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1385 +#: ../../library/dis.rst:1387 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1388 +#: ../../library/dis.rst:1390 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1390 +#: ../../library/dis.rst:1392 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1391 +#: ../../library/dis.rst:1393 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1392 +#: ../../library/dis.rst:1394 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1393 +#: ../../library/dis.rst:1395 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1395 +#: ../../library/dis.rst:1397 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1398 +#: ../../library/dis.rst:1400 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1406 +#: ../../library/dis.rst:1408 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1412 +#: ../../library/dis.rst:1414 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1419 +#: ../../library/dis.rst:1421 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1424 +#: ../../library/dis.rst:1426 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1340,54 +1345,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1432 +#: ../../library/dis.rst:1434 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1436 +#: ../../library/dis.rst:1438 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1437 +#: ../../library/dis.rst:1439 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1439 +#: ../../library/dis.rst:1441 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1441 +#: ../../library/dis.rst:1443 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1445 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1446 +#: ../../library/dis.rst:1448 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1454 +#: ../../library/dis.rst:1456 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1458 +#: ../../library/dis.rst:1460 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1395,258 +1400,258 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1472 +#: ../../library/dis.rst:1474 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1474 +#: ../../library/dis.rst:1476 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1476 +#: ../../library/dis.rst:1478 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1480 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1479 +#: ../../library/dis.rst:1481 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1480 +#: ../../library/dis.rst:1482 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1487 +#: ../../library/dis.rst:1489 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1496 +#: ../../library/dis.rst:1498 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1499 +#: ../../library/dis.rst:1501 msgid "" "If the call raises :exc:`StopIteration`, pop both items, push the " "exception's ``value`` attribute, and increment the bytecode counter by " "*delta*." msgstr "" -#: ../../library/dis.rst:1508 +#: ../../library/dis.rst:1510 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1512 +#: ../../library/dis.rst:1514 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1515 +#: ../../library/dis.rst:1517 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1519 +#: ../../library/dis.rst:1521 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1527 +#: ../../library/dis.rst:1529 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1531 ../../library/dis.rst:1581 +#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1534 ../../library/dis.rst:1584 +#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1534 ../../library/dis.rst:1584 +#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 msgid "Description" msgstr "" -#: ../../library/dis.rst:1536 +#: ../../library/dis.rst:1538 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 +#: ../../library/dis.rst:1538 ../../library/dis.rst:1588 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1538 +#: ../../library/dis.rst:1540 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1538 +#: ../../library/dis.rst:1540 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1541 +#: ../../library/dis.rst:1543 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1541 +#: ../../library/dis.rst:1543 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1544 +#: ../../library/dis.rst:1546 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1544 +#: ../../library/dis.rst:1546 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1547 +#: ../../library/dis.rst:1549 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1547 +#: ../../library/dis.rst:1549 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1551 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1551 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1552 +#: ../../library/dis.rst:1554 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1552 +#: ../../library/dis.rst:1554 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1556 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1556 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1558 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1558 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1559 +#: ../../library/dis.rst:1561 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1559 +#: ../../library/dis.rst:1561 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1564 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1564 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1567 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1567 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1577 +#: ../../library/dis.rst:1579 msgid "" "Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " "``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " "implement functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1588 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1588 +#: ../../library/dis.rst:1590 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1588 +#: ../../library/dis.rst:1590 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1592 +#: ../../library/dis.rst:1594 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1592 +#: ../../library/dis.rst:1594 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1595 +#: ../../library/dis.rst:1597 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1595 +#: ../../library/dis.rst:1597 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1599 +#: ../../library/dis.rst:1601 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1599 +#: ../../library/dis.rst:1601 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1606 +#: ../../library/dis.rst:1608 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1608 +#: ../../library/dis.rst:1610 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1613 +#: ../../library/dis.rst:1615 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1620 +#: ../../library/dis.rst:1622 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1655,75 +1660,75 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1629 +#: ../../library/dis.rst:1631 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1633 +#: ../../library/dis.rst:1635 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1640 +#: ../../library/dis.rst:1642 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1646 +#: ../../library/dis.rst:1648 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1651 +#: ../../library/dis.rst:1653 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1658 +#: ../../library/dis.rst:1660 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1660 +#: ../../library/dis.rst:1662 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1663 +#: ../../library/dis.rst:1665 msgid "" "The collections now contain pseudo instructions as well. These are opcodes " "with values ``>= MIN_PSEUDO_OPCODE``." msgstr "" -#: ../../library/dis.rst:1669 +#: ../../library/dis.rst:1671 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1674 +#: ../../library/dis.rst:1676 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1679 +#: ../../library/dis.rst:1681 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1684 +#: ../../library/dis.rst:1686 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1691 +#: ../../library/dis.rst:1693 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1696 +#: ../../library/dis.rst:1698 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1731,34 +1736,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1704 +#: ../../library/dis.rst:1706 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1709 +#: ../../library/dis.rst:1711 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1714 +#: ../../library/dis.rst:1716 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1719 +#: ../../library/dis.rst:1721 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1724 +#: ../../library/dis.rst:1726 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1728 +#: ../../library/dis.rst:1730 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1404 +#: ../../library/dis.rst:1406 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1404 +#: ../../library/dis.rst:1406 msgid "slice" msgstr "slice(切片)" diff --git a/library/io.po b/library/io.po index 4c42b73fc0..b50a1f3f6e 100644 --- a/library/io.po +++ b/library/io.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-08-28 00:04+0000\n" "PO-Revision-Date: 2023-08-01 12:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -77,7 +77,7 @@ msgstr "" "原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :exc:" "`IOError` 現在是 :exc:`OSError` 的別名。" -#: ../../library/io.rst:51 ../../library/io.rst:856 ../../library/io.rst:1139 +#: ../../library/io.rst:51 ../../library/io.rst:856 ../../library/io.rst:1147 msgid "Text I/O" msgstr "文字 I/O" @@ -115,7 +115,7 @@ msgid "" "`TextIOBase`." msgstr "文字資料串流 API 的詳細說明在 :class:`TextIOBase` 文件當中。" -#: ../../library/io.rst:72 ../../library/io.rst:1127 +#: ../../library/io.rst:72 ../../library/io.rst:1135 msgid "Binary I/O" msgstr "二進位 (Binary) I/O" @@ -1510,7 +1510,7 @@ msgstr "" #: ../../library/io.rst:1056 msgid "" "``seek(cookie, SEEK_SET)``: Restore a previous position; *cookie* **must " -"be** a number returned by :meth:`!tell`." +"be** a number returned by :meth:`tell`." msgstr "" #: ../../library/io.rst:1058 @@ -1527,16 +1527,23 @@ msgstr "" #: ../../library/io.rst:1066 msgid "" +"Return the stream position as an opaque number. The return value of :meth:`!" +"tell` can be given as input to :meth:`seek`, to restore a previous stream " +"position." +msgstr "" + +#: ../../library/io.rst:1074 +msgid "" "A text stream using an in-memory text buffer. It inherits :class:" "`TextIOBase`." msgstr "" -#: ../../library/io.rst:1069 +#: ../../library/io.rst:1077 msgid "" "The text buffer is discarded when the :meth:`~IOBase.close` method is called." msgstr "" -#: ../../library/io.rst:1072 +#: ../../library/io.rst:1080 msgid "" "The initial value of the buffer can be set by providing *initial_value*. If " "newline translation is enabled, newlines will be encoded as if by :meth:" @@ -1548,50 +1555,50 @@ msgid "" "at the end of the buffer." msgstr "" -#: ../../library/io.rst:1081 +#: ../../library/io.rst:1089 msgid "" "The *newline* argument works like that of :class:`TextIOWrapper`, except " "that when writing output to the stream, if *newline* is ``None``, newlines " "are written as ``\\n`` on all platforms." msgstr "" -#: ../../library/io.rst:1085 +#: ../../library/io.rst:1093 msgid "" ":class:`StringIO` provides this method in addition to those from :class:" "`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1090 +#: ../../library/io.rst:1098 msgid "" "Return a :class:`str` containing the entire contents of the buffer. Newlines " "are decoded as if by :meth:`~TextIOBase.read`, although the stream position " "is not changed." msgstr "" -#: ../../library/io.rst:1094 +#: ../../library/io.rst:1102 msgid "Example usage::" msgstr "" "使用範例:\n" "\n" "::" -#: ../../library/io.rst:1116 +#: ../../library/io.rst:1124 msgid "" "A helper codec that decodes newlines for :term:`universal newlines` mode. It " "inherits :class:`codecs.IncrementalDecoder`." msgstr "" -#: ../../library/io.rst:1121 +#: ../../library/io.rst:1129 msgid "Performance" msgstr "" -#: ../../library/io.rst:1123 +#: ../../library/io.rst:1131 msgid "" "This section discusses the performance of the provided concrete I/O " "implementations." msgstr "" -#: ../../library/io.rst:1129 +#: ../../library/io.rst:1137 msgid "" "By reading and writing only large chunks of data even when the user asks for " "a single byte, buffered I/O hides any inefficiency in calling and executing " @@ -1604,7 +1611,7 @@ msgid "" "data." msgstr "" -#: ../../library/io.rst:1141 +#: ../../library/io.rst:1149 msgid "" "Text I/O over a binary storage (such as a file) is significantly slower than " "binary I/O over the same storage, because it requires conversions between " @@ -1614,24 +1621,24 @@ msgid "" "the reconstruction algorithm used." msgstr "" -#: ../../library/io.rst:1148 +#: ../../library/io.rst:1156 msgid "" ":class:`StringIO`, however, is a native in-memory unicode container and will " "exhibit similar speed to :class:`BytesIO`." msgstr "" -#: ../../library/io.rst:1152 +#: ../../library/io.rst:1160 msgid "Multi-threading" msgstr "" -#: ../../library/io.rst:1154 +#: ../../library/io.rst:1162 msgid "" ":class:`FileIO` objects are thread-safe to the extent that the operating " "system calls (such as :manpage:`read(2)` under Unix) they wrap are thread-" "safe too." msgstr "" -#: ../../library/io.rst:1157 +#: ../../library/io.rst:1165 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) " @@ -1639,15 +1646,15 @@ msgid "" "them from multiple threads at once." msgstr "" -#: ../../library/io.rst:1162 +#: ../../library/io.rst:1170 msgid ":class:`TextIOWrapper` objects are not thread-safe." msgstr "" -#: ../../library/io.rst:1165 +#: ../../library/io.rst:1173 msgid "Reentrancy" msgstr "" -#: ../../library/io.rst:1167 +#: ../../library/io.rst:1175 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) are " @@ -1658,7 +1665,7 @@ msgid "" "from entering the buffered object." msgstr "" -#: ../../library/io.rst:1175 +#: ../../library/io.rst:1183 msgid "" "The above implicitly extends to text files, since the :func:`open()` " "function will wrap a buffered object inside a :class:`TextIOWrapper`. This " @@ -1674,7 +1681,7 @@ msgstr "file object(檔案物件)" msgid "io module" msgstr "io 模組" -#: ../../library/io.rst:971 ../../library/io.rst:1111 +#: ../../library/io.rst:971 ../../library/io.rst:1119 msgid "universal newlines" msgstr "universal newlines" @@ -1682,6 +1689,6 @@ msgstr "universal newlines" msgid "io.TextIOWrapper class" msgstr "io.TextIOWrapper 類別" -#: ../../library/io.rst:1111 +#: ../../library/io.rst:1119 msgid "io.IncrementalNewlineDecoder class" msgstr "io.IncrementalNewlineDecoder 類別" diff --git a/reference/datamodel.po b/reference/datamodel.po index 45236e1665..984e121885 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 00:03+0000\n" +"POT-Creation-Date: 2023-08-28 00:04+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1187,7 +1187,7 @@ msgstr "" msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:1048 +#: ../../reference/datamodel.rst:1050 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1199,7 +1199,7 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:1076 +#: ../../reference/datamodel.rst:1078 msgid "" "Special read-only attributes: :attr:`co_name` gives the function name; :attr:" "`co_qualname` gives the fully qualified function name; :attr:`co_argcount` " @@ -1225,7 +1225,7 @@ msgid "" "flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1102 +#: ../../reference/datamodel.rst:1104 msgid "" "The following flag bits are defined for :attr:`co_flags`: bit ``0x04`` is " "set if the function uses the ``*arguments`` syntax to accept an arbitrary " @@ -1234,7 +1234,7 @@ msgid "" "set if the function is a generator." msgstr "" -#: ../../reference/datamodel.rst:1108 +#: ../../reference/datamodel.rst:1110 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`co_flags` to indicate whether a code object was compiled with " @@ -1243,23 +1243,23 @@ msgid "" "used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1114 +#: ../../reference/datamodel.rst:1116 msgid "Other bits in :attr:`co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1118 +#: ../../reference/datamodel.rst:1120 msgid "" "If a code object represents a function, the first item in :attr:`co_consts` " "is the documentation string of the function, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:1123 +#: ../../reference/datamodel.rst:1125 msgid "" "Returns an iterable over the source code positions of each bytecode " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:1128 msgid "" "The iterator returns tuples containing the ``(start_line, end_line, " "start_column, end_column)``. The *i-th* tuple corresponds to the position of " @@ -1267,37 +1267,37 @@ msgid "" "is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1134 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1135 +#: ../../reference/datamodel.rst:1137 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1136 +#: ../../reference/datamodel.rst:1138 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1137 +#: ../../reference/datamodel.rst:1139 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1138 +#: ../../reference/datamodel.rst:1140 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1141 +#: ../../reference/datamodel.rst:1143 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1147 +#: ../../reference/datamodel.rst:1149 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1307,17 +1307,17 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1158 +#: ../../reference/datamodel.rst:1160 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1164 msgid "" "Frame objects represent execution frames. They may occur in traceback " "objects (see below), and are also passed to registered trace functions." msgstr "" -#: ../../reference/datamodel.rst:1173 +#: ../../reference/datamodel.rst:1175 msgid "" "Special read-only attributes: :attr:`f_back` is to the previous stack frame " "(towards the caller), or ``None`` if this is the bottom stack frame; :attr:" @@ -1328,7 +1328,7 @@ msgid "" "the bytecode string of the code object)." msgstr "" -#: ../../reference/datamodel.rst:1181 +#: ../../reference/datamodel.rst:1183 msgid "" "Accessing ``f_code`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"f_code\"``." @@ -1336,7 +1336,7 @@ msgstr "" "存取 ``f_code`` 會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核" "事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1190 +#: ../../reference/datamodel.rst:1192 msgid "" "Special writable attributes: :attr:`f_trace`, if not ``None``, is a function " "called for various events during code execution (this is used by the " @@ -1344,7 +1344,7 @@ msgid "" "can be disabled by setting :attr:`f_trace_lines` to :const:`False`." msgstr "" -#: ../../reference/datamodel.rst:1195 +#: ../../reference/datamodel.rst:1197 msgid "" "Implementations *may* allow per-opcode events to be requested by setting :" "attr:`f_trace_opcodes` to :const:`True`. Note that this may lead to " @@ -1352,7 +1352,7 @@ msgid "" "escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1200 +#: ../../reference/datamodel.rst:1202 msgid "" ":attr:`f_lineno` is the current line number of the frame --- writing to this " "from within a trace function jumps to the given line (only for the bottom-" @@ -1360,11 +1360,11 @@ msgid "" "Statement) by writing to f_lineno." msgstr "" -#: ../../reference/datamodel.rst:1205 +#: ../../reference/datamodel.rst:1207 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1209 +#: ../../reference/datamodel.rst:1211 msgid "" "This method clears all references to local variables held by the frame. " "Also, if the frame belonged to a generator, the generator is finalized. " @@ -1372,22 +1372,22 @@ msgid "" "catching an exception and storing its traceback for later use)." msgstr "" -#: ../../reference/datamodel.rst:1215 +#: ../../reference/datamodel.rst:1217 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1223 +#: ../../reference/datamodel.rst:1225 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1236 +#: ../../reference/datamodel.rst:1238 msgid "" "Traceback objects represent a stack trace of an exception. A traceback " "object is implicitly created when an exception occurs, and may also be " "explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1242 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1397,21 +1397,21 @@ msgid "" "exc_info()``, and as the ``__traceback__`` attribute of the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1248 +#: ../../reference/datamodel.rst:1250 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " "interactive, it is also made available to the user as ``sys.last_traceback``." msgstr "" -#: ../../reference/datamodel.rst:1253 +#: ../../reference/datamodel.rst:1255 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the ``tb_next`` attributes should be linked to form a full " "stack trace." msgstr "" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1265 msgid "" "Special read-only attributes: :attr:`tb_frame` points to the execution frame " "of the current level; :attr:`tb_lineno` gives the line number where the " @@ -1421,7 +1421,7 @@ msgid "" "statement with no matching except clause or with a finally clause." msgstr "" -#: ../../reference/datamodel.rst:1272 +#: ../../reference/datamodel.rst:1274 msgid "" "Accessing ``tb_frame`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1429,41 +1429,41 @@ msgstr "" "存取 ``tb_frame`` 會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`" "稽核事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1278 +#: ../../reference/datamodel.rst:1280 msgid "" "Special writable attribute: :attr:`tb_next` is the next level in the stack " "trace (towards the frame where the exception occurred), or ``None`` if there " "is no next level." msgstr "" -#: ../../reference/datamodel.rst:1282 +#: ../../reference/datamodel.rst:1284 msgid "" "Traceback objects can now be explicitly instantiated from Python code, and " "the ``tb_next`` attribute of existing instances can be updated." msgstr "" -#: ../../reference/datamodel.rst:1288 +#: ../../reference/datamodel.rst:1290 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:1294 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1301 +#: ../../reference/datamodel.rst:1303 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1307 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1309 +#: ../../reference/datamodel.rst:1311 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1473,11 +1473,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1318 +#: ../../reference/datamodel.rst:1320 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1320 +#: ../../reference/datamodel.rst:1322 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1488,11 +1488,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1330 +#: ../../reference/datamodel.rst:1332 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1332 +#: ../../reference/datamodel.rst:1334 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -1501,11 +1501,11 @@ msgid "" "objects are created by the built-in :func:`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1342 +#: ../../reference/datamodel.rst:1344 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1348 +#: ../../reference/datamodel.rst:1350 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1519,7 +1519,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1359 +#: ../../reference/datamodel.rst:1361 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1528,7 +1528,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1365 +#: ../../reference/datamodel.rst:1367 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1538,11 +1538,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1376 +#: ../../reference/datamodel.rst:1378 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1382 +#: ../../reference/datamodel.rst:1384 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1552,7 +1552,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1389 +#: ../../reference/datamodel.rst:1391 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1560,7 +1560,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1396 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -1569,13 +1569,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1402 +#: ../../reference/datamodel.rst:1404 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1583,7 +1583,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1411 +#: ../../reference/datamodel.rst:1413 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1593,7 +1593,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1420 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1601,7 +1601,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:1433 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1610,7 +1610,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1437 +#: ../../reference/datamodel.rst:1439 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1620,20 +1620,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1444 +#: ../../reference/datamodel.rst:1446 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1449 +#: ../../reference/datamodel.rst:1451 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1454 +#: ../../reference/datamodel.rst:1456 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -1644,18 +1644,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1464 +#: ../../reference/datamodel.rst:1466 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1468 +#: ../../reference/datamodel.rst:1470 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1472 +#: ../../reference/datamodel.rst:1474 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1664,7 +1664,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1478 +#: ../../reference/datamodel.rst:1480 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1675,7 +1675,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1493 +#: ../../reference/datamodel.rst:1495 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1687,13 +1687,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1502 +#: ../../reference/datamodel.rst:1504 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1513 +#: ../../reference/datamodel.rst:1515 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1701,26 +1701,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1518 +#: ../../reference/datamodel.rst:1520 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1522 +#: ../../reference/datamodel.rst:1524 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1532 +#: ../../reference/datamodel.rst:1534 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1543 +#: ../../reference/datamodel.rst:1545 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1732,28 +1732,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1553 +#: ../../reference/datamodel.rst:1555 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1555 +#: ../../reference/datamodel.rst:1557 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1557 +#: ../../reference/datamodel.rst:1559 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1561 +#: ../../reference/datamodel.rst:1563 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1577 +#: ../../reference/datamodel.rst:1579 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1666 +#: ../../reference/datamodel.rst:1668 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -1872,7 +1872,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1675 +#: ../../reference/datamodel.rst:1677 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -1880,7 +1880,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1680 +#: ../../reference/datamodel.rst:1682 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -1888,22 +1888,22 @@ msgid "" "ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1685 +#: ../../reference/datamodel.rst:1687 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1689 +#: ../../reference/datamodel.rst:1691 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1691 +#: ../../reference/datamodel.rst:1693 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1699 +#: ../../reference/datamodel.rst:1701 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -1912,18 +1912,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1710 +#: ../../reference/datamodel.rst:1712 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1712 +#: ../../reference/datamodel.rst:1714 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1720 +#: ../../reference/datamodel.rst:1722 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -1933,7 +1933,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1727 +#: ../../reference/datamodel.rst:1729 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -1946,7 +1946,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1740 +#: ../../reference/datamodel.rst:1742 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -1958,14 +1958,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1751 +#: ../../reference/datamodel.rst:1753 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or built-in functions. " "See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1755 +#: ../../reference/datamodel.rst:1757 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -1973,27 +1973,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1757 +#: ../../reference/datamodel.rst:1759 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1764 +#: ../../reference/datamodel.rst:1766 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1768 +#: ../../reference/datamodel.rst:1770 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1772 +#: ../../reference/datamodel.rst:1774 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -2001,21 +2001,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1774 +#: ../../reference/datamodel.rst:1776 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1781 +#: ../../reference/datamodel.rst:1783 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:1784 +#: ../../reference/datamodel.rst:1786 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2023,23 +2023,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1786 +#: ../../reference/datamodel.rst:1788 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1793 +#: ../../reference/datamodel.rst:1795 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1798 +#: ../../reference/datamodel.rst:1800 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1805 +#: ../../reference/datamodel.rst:1807 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2051,21 +2051,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1814 +#: ../../reference/datamodel.rst:1816 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1818 +#: ../../reference/datamodel.rst:1820 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:1836 +#: ../../reference/datamodel.rst:1838 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2073,27 +2073,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1841 +#: ../../reference/datamodel.rst:1843 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:1844 +#: ../../reference/datamodel.rst:1846 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:1849 +#: ../../reference/datamodel.rst:1851 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:1850 +#: ../../reference/datamodel.rst:1852 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:1856 +#: ../../reference/datamodel.rst:1858 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1858 +#: ../../reference/datamodel.rst:1860 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2103,7 +2103,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1868 +#: ../../reference/datamodel.rst:1870 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2112,13 +2112,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:1874 +#: ../../reference/datamodel.rst:1876 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1877 +#: ../../reference/datamodel.rst:1879 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2128,25 +2128,25 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:1886 +#: ../../reference/datamodel.rst:1888 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:1889 +#: ../../reference/datamodel.rst:1891 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:1895 +#: ../../reference/datamodel.rst:1897 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:1898 +#: ../../reference/datamodel.rst:1900 msgid "" "The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2157,11 +2157,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:1909 +#: ../../reference/datamodel.rst:1911 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1911 +#: ../../reference/datamodel.rst:1913 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2170,7 +2170,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:1917 +#: ../../reference/datamodel.rst:1919 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2178,7 +2178,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:1922 +#: ../../reference/datamodel.rst:1924 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2186,54 +2186,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:1927 +#: ../../reference/datamodel.rst:1929 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:1932 +#: ../../reference/datamodel.rst:1934 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:1931 +#: ../../reference/datamodel.rst:1933 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:1936 +#: ../../reference/datamodel.rst:1938 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:1935 +#: ../../reference/datamodel.rst:1937 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:1940 +#: ../../reference/datamodel.rst:1942 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:1939 +#: ../../reference/datamodel.rst:1941 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:1946 +#: ../../reference/datamodel.rst:1948 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:1943 +#: ../../reference/datamodel.rst:1945 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:1980 +#: ../../reference/datamodel.rst:1982 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2250,7 +2250,7 @@ msgid "" "can be overridden by instances." msgstr "" -#: ../../reference/datamodel.rst:1994 +#: ../../reference/datamodel.rst:1996 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2259,30 +2259,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2000 +#: ../../reference/datamodel.rst:2002 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2007 +#: ../../reference/datamodel.rst:2009 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2009 +#: ../../reference/datamodel.rst:2011 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:2013 +#: ../../reference/datamodel.rst:2015 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:2018 +#: ../../reference/datamodel.rst:2020 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2290,18 +2290,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2027 +#: ../../reference/datamodel.rst:2029 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2029 +#: ../../reference/datamodel.rst:2031 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:2033 +#: ../../reference/datamodel.rst:2035 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2310,7 +2310,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2040 +#: ../../reference/datamodel.rst:2042 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2318,7 +2318,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2046 +#: ../../reference/datamodel.rst:2048 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2326,7 +2326,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2052 +#: ../../reference/datamodel.rst:2054 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2335,7 +2335,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2058 +#: ../../reference/datamodel.rst:2060 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2344,7 +2344,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2065 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2352,11 +2352,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2068 +#: ../../reference/datamodel.rst:2070 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2070 +#: ../../reference/datamodel.rst:2072 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2364,13 +2364,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2075 +#: ../../reference/datamodel.rst:2077 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2078 +#: ../../reference/datamodel.rst:2080 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2378,18 +2378,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2084 +#: ../../reference/datamodel.rst:2086 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:2092 +#: ../../reference/datamodel.rst:2094 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2094 +#: ../../reference/datamodel.rst:2096 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2399,14 +2399,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2103 +#: ../../reference/datamodel.rst:2105 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:2107 +#: ../../reference/datamodel.rst:2109 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2414,13 +2414,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2121 +#: ../../reference/datamodel.rst:2123 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2126 +#: ../../reference/datamodel.rst:2128 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2428,41 +2428,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2134 +#: ../../reference/datamodel.rst:2136 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2139 +#: ../../reference/datamodel.rst:2141 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2145 +#: ../../reference/datamodel.rst:2147 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2156 +#: ../../reference/datamodel.rst:2158 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2164 +#: ../../reference/datamodel.rst:2166 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2171 +#: ../../reference/datamodel.rst:2173 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2175 +#: ../../reference/datamodel.rst:2177 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2470,41 +2470,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2189 +#: ../../reference/datamodel.rst:2191 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2192 +#: ../../reference/datamodel.rst:2194 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2196 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2195 +#: ../../reference/datamodel.rst:2197 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2196 +#: ../../reference/datamodel.rst:2198 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2197 +#: ../../reference/datamodel.rst:2199 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2198 +#: ../../reference/datamodel.rst:2200 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2202 +#: ../../reference/datamodel.rst:2204 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2206 +#: ../../reference/datamodel.rst:2208 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2516,59 +2516,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2220 msgid ":func:`types.resolve_bases`" msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2220 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2222 +#: ../../reference/datamodel.rst:2224 msgid ":func:`types.get_original_bases`" msgstr "" -#: ../../reference/datamodel.rst:2221 +#: ../../reference/datamodel.rst:2223 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2224 +#: ../../reference/datamodel.rst:2226 msgid ":pep:`560`" msgstr "" -#: ../../reference/datamodel.rst:2225 +#: ../../reference/datamodel.rst:2227 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2229 +#: ../../reference/datamodel.rst:2231 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2233 +#: ../../reference/datamodel.rst:2235 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2237 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2236 +#: ../../reference/datamodel.rst:2238 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2238 +#: ../../reference/datamodel.rst:2240 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2241 +#: ../../reference/datamodel.rst:2243 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2577,11 +2577,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2251 +#: ../../reference/datamodel.rst:2253 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2256 +#: ../../reference/datamodel.rst:2258 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2593,25 +2593,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2265 +#: ../../reference/datamodel.rst:2267 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2270 +#: ../../reference/datamodel.rst:2272 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2271 +#: ../../reference/datamodel.rst:2273 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2275 +#: ../../reference/datamodel.rst:2277 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2282 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2620,7 +2620,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2286 +#: ../../reference/datamodel.rst:2288 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2629,11 +2629,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2295 +#: ../../reference/datamodel.rst:2297 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2302 +#: ../../reference/datamodel.rst:2304 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2641,7 +2641,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2307 +#: ../../reference/datamodel.rst:2309 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2652,7 +2652,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2317 +#: ../../reference/datamodel.rst:2319 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2661,39 +2661,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2323 +#: ../../reference/datamodel.rst:2325 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2327 +#: ../../reference/datamodel.rst:2329 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2331 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2333 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2334 +#: ../../reference/datamodel.rst:2336 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2338 +#: ../../reference/datamodel.rst:2340 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2701,19 +2701,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2345 +#: ../../reference/datamodel.rst:2347 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2346 +#: ../../reference/datamodel.rst:2348 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2350 +#: ../../reference/datamodel.rst:2352 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2352 +#: ../../reference/datamodel.rst:2354 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2721,17 +2721,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2359 +#: ../../reference/datamodel.rst:2361 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2361 +#: ../../reference/datamodel.rst:2363 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2364 +#: ../../reference/datamodel.rst:2366 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2739,21 +2739,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2371 +#: ../../reference/datamodel.rst:2373 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2378 +#: ../../reference/datamodel.rst:2380 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2383 +#: ../../reference/datamodel.rst:2385 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2761,11 +2761,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2394 +#: ../../reference/datamodel.rst:2396 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2391 +#: ../../reference/datamodel.rst:2393 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2774,11 +2774,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2399 +#: ../../reference/datamodel.rst:2401 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2401 +#: ../../reference/datamodel.rst:2403 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2786,65 +2786,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2409 +#: ../../reference/datamodel.rst:2411 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2409 +#: ../../reference/datamodel.rst:2411 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2412 +#: ../../reference/datamodel.rst:2414 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2412 +#: ../../reference/datamodel.rst:2414 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2415 +#: ../../reference/datamodel.rst:2417 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2415 +#: ../../reference/datamodel.rst:2417 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2418 +#: ../../reference/datamodel.rst:2420 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2423 +#: ../../reference/datamodel.rst:2425 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2426 +#: ../../reference/datamodel.rst:2428 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2432 +#: ../../reference/datamodel.rst:2434 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2434 +#: ../../reference/datamodel.rst:2436 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2438 +#: ../../reference/datamodel.rst:2440 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2853,7 +2853,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2444 +#: ../../reference/datamodel.rst:2446 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2861,11 +2861,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2454 +#: ../../reference/datamodel.rst:2456 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2456 +#: ../../reference/datamodel.rst:2458 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2875,14 +2875,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2463 +#: ../../reference/datamodel.rst:2465 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2491 +#: ../../reference/datamodel.rst:2493 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2892,40 +2892,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2510 +#: ../../reference/datamodel.rst:2512 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2535 +#: ../../reference/datamodel.rst:2537 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2534 +#: ../../reference/datamodel.rst:2536 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2542 +#: ../../reference/datamodel.rst:2544 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2549 +#: ../../reference/datamodel.rst:2551 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2556 +#: ../../reference/datamodel.rst:2558 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2558 +#: ../../reference/datamodel.rst:2560 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2961,7 +2961,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2598 +#: ../../reference/datamodel.rst:2600 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2969,7 +2969,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2605 +#: ../../reference/datamodel.rst:2607 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " "length is larger than :data:`!sys.maxsize` some features (such as :func:" @@ -2978,7 +2978,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2614 +#: ../../reference/datamodel.rst:2616 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2988,20 +2988,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2628 +#: ../../reference/datamodel.rst:2630 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2632 +#: ../../reference/datamodel.rst:2634 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2636 +#: ../../reference/datamodel.rst:2638 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2641 +#: ../../reference/datamodel.rst:2643 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -3014,20 +3014,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2653 +#: ../../reference/datamodel.rst:2655 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2658 +#: ../../reference/datamodel.rst:2660 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2666 +#: ../../reference/datamodel.rst:2668 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3036,7 +3036,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2675 +#: ../../reference/datamodel.rst:2677 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3045,13 +3045,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2684 +#: ../../reference/datamodel.rst:2686 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2690 +#: ../../reference/datamodel.rst:2692 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3059,14 +3059,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2698 +#: ../../reference/datamodel.rst:2700 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2702 +#: ../../reference/datamodel.rst:2704 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3075,7 +3075,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2709 +#: ../../reference/datamodel.rst:2711 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3083,14 +3083,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2716 +#: ../../reference/datamodel.rst:2718 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2720 +#: ../../reference/datamodel.rst:2722 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3098,11 +3098,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2729 +#: ../../reference/datamodel.rst:2731 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2731 +#: ../../reference/datamodel.rst:2733 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3110,7 +3110,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2757 +#: ../../reference/datamodel.rst:2759 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3124,13 +3124,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2768 +#: ../../reference/datamodel.rst:2770 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2791 +#: ../../reference/datamodel.rst:2793 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3143,13 +3143,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2805 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2808 +#: ../../reference/datamodel.rst:2810 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3158,7 +3158,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2829 +#: ../../reference/datamodel.rst:2831 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3174,19 +3174,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2850 +#: ../../reference/datamodel.rst:2852 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2863 +#: ../../reference/datamodel.rst:2865 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2870 +#: ../../reference/datamodel.rst:2872 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3195,14 +3195,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2876 +#: ../../reference/datamodel.rst:2878 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2888 +#: ../../reference/datamodel.rst:2890 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3211,21 +3211,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2894 +#: ../../reference/datamodel.rst:2896 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:2899 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2904 +#: ../../reference/datamodel.rst:2906 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2906 +#: ../../reference/datamodel.rst:2908 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3235,32 +3235,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2917 +#: ../../reference/datamodel.rst:2919 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2920 +#: ../../reference/datamodel.rst:2922 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2925 +#: ../../reference/datamodel.rst:2927 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2932 +#: ../../reference/datamodel.rst:2934 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2936 +#: ../../reference/datamodel.rst:2938 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3268,27 +3268,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2940 +#: ../../reference/datamodel.rst:2942 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2947 +#: ../../reference/datamodel.rst:2949 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2947 +#: ../../reference/datamodel.rst:2949 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2954 +#: ../../reference/datamodel.rst:2956 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2956 +#: ../../reference/datamodel.rst:2958 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3296,7 +3296,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2963 +#: ../../reference/datamodel.rst:2965 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3305,7 +3305,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2969 +#: ../../reference/datamodel.rst:2971 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3315,19 +3315,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2979 +#: ../../reference/datamodel.rst:2981 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2980 +#: ../../reference/datamodel.rst:2982 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2986 +#: ../../reference/datamodel.rst:2988 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:2988 +#: ../../reference/datamodel.rst:2990 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3335,13 +3335,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:2993 +#: ../../reference/datamodel.rst:2995 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:2998 +#: ../../reference/datamodel.rst:3000 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3351,7 +3351,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3007 +#: ../../reference/datamodel.rst:3009 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3360,28 +3360,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3019 +#: ../../reference/datamodel.rst:3021 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3019 +#: ../../reference/datamodel.rst:3021 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3021 +#: ../../reference/datamodel.rst:3023 msgid ":class:`collections.abc.Buffer`" msgstr "" -#: ../../reference/datamodel.rst:3022 +#: ../../reference/datamodel.rst:3024 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3027 +#: ../../reference/datamodel.rst:3029 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3029 +#: ../../reference/datamodel.rst:3031 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3389,7 +3389,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3044 +#: ../../reference/datamodel.rst:3046 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3398,21 +3398,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3058 +#: ../../reference/datamodel.rst:3060 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3067 +#: ../../reference/datamodel.rst:3069 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3093 +#: ../../reference/datamodel.rst:3095 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3421,36 +3421,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3104 +#: ../../reference/datamodel.rst:3106 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3108 +#: ../../reference/datamodel.rst:3110 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3110 +#: ../../reference/datamodel.rst:3112 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3116 +#: ../../reference/datamodel.rst:3118 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3122 +#: ../../reference/datamodel.rst:3124 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:3128 +#: ../../reference/datamodel.rst:3130 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3458,15 +3458,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3136 +#: ../../reference/datamodel.rst:3138 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3142 +#: ../../reference/datamodel.rst:3144 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3144 +#: ../../reference/datamodel.rst:3146 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3477,18 +3477,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3152 +#: ../../reference/datamodel.rst:3154 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3156 +#: ../../reference/datamodel.rst:3158 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3162 +#: ../../reference/datamodel.rst:3164 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3499,7 +3499,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3173 +#: ../../reference/datamodel.rst:3175 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3510,13 +3510,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3184 +#: ../../reference/datamodel.rst:3186 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3189 +#: ../../reference/datamodel.rst:3191 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3526,99 +3526,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3197 +#: ../../reference/datamodel.rst:3199 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3203 +#: ../../reference/datamodel.rst:3205 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3205 +#: ../../reference/datamodel.rst:3207 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3208 +#: ../../reference/datamodel.rst:3210 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3212 +#: ../../reference/datamodel.rst:3214 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3216 +#: ../../reference/datamodel.rst:3218 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3219 +#: ../../reference/datamodel.rst:3221 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3236 +#: ../../reference/datamodel.rst:3238 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3241 +#: ../../reference/datamodel.rst:3243 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3249 +#: ../../reference/datamodel.rst:3251 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3251 +#: ../../reference/datamodel.rst:3253 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3254 +#: ../../reference/datamodel.rst:3256 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3258 +#: ../../reference/datamodel.rst:3260 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3263 +#: ../../reference/datamodel.rst:3265 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3266 +#: ../../reference/datamodel.rst:3268 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3279 +#: ../../reference/datamodel.rst:3281 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3280 +#: ../../reference/datamodel.rst:3282 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3284 +#: ../../reference/datamodel.rst:3286 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3626,7 +3626,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3290 +#: ../../reference/datamodel.rst:3292 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3634,7 +3634,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3296 +#: ../../reference/datamodel.rst:3298 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " @@ -3655,9 +3655,9 @@ msgstr "" #: ../../reference/datamodel.rst:760 ../../reference/datamodel.rst:778 #: ../../reference/datamodel.rst:810 ../../reference/datamodel.rst:891 #: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:986 -#: ../../reference/datamodel.rst:1042 ../../reference/datamodel.rst:1100 -#: ../../reference/datamodel.rst:1160 ../../reference/datamodel.rst:1225 -#: ../../reference/datamodel.rst:1616 ../../reference/datamodel.rst:2624 +#: ../../reference/datamodel.rst:1048 ../../reference/datamodel.rst:1102 +#: ../../reference/datamodel.rst:1162 ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1618 ../../reference/datamodel.rst:2626 msgid "object" msgstr "object(物件)" @@ -3668,13 +3668,13 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:292 #: ../../reference/datamodel.rst:336 ../../reference/datamodel.rst:420 #: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:760 -#: ../../reference/datamodel.rst:1005 ../../reference/datamodel.rst:1290 -#: ../../reference/datamodel.rst:1530 ../../reference/datamodel.rst:1535 -#: ../../reference/datamodel.rst:1616 ../../reference/datamodel.rst:2166 -#: ../../reference/datamodel.rst:2594 ../../reference/datamodel.rst:2752 -#: ../../reference/datamodel.rst:2787 ../../reference/datamodel.rst:2801 -#: ../../reference/datamodel.rst:2848 ../../reference/datamodel.rst:2858 -#: ../../reference/datamodel.rst:2886 +#: ../../reference/datamodel.rst:1005 ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:1532 ../../reference/datamodel.rst:1537 +#: ../../reference/datamodel.rst:1618 ../../reference/datamodel.rst:2168 +#: ../../reference/datamodel.rst:2596 ../../reference/datamodel.rst:2754 +#: ../../reference/datamodel.rst:2789 ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2850 ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:2888 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3683,7 +3683,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "type" msgstr "type(型別)" @@ -3807,12 +3807,12 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2860 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2594 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2596 msgid "len" msgstr "len" @@ -3845,8 +3845,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1505 -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1507 +#: ../../reference/datamodel.rst:1537 msgid "string" msgstr "string(字串)" @@ -3882,7 +3882,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1530 +#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1532 msgid "bytes" msgstr "bytes(位元組)" @@ -3904,8 +3904,8 @@ msgid "assignment" msgstr "assignment(賦值)" #: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:810 -#: ../../reference/datamodel.rst:1257 ../../reference/datamodel.rst:1426 -#: ../../reference/datamodel.rst:2913 +#: ../../reference/datamodel.rst:1259 ../../reference/datamodel.rst:1428 +#: ../../reference/datamodel.rst:2915 msgid "statement" msgstr "statement(陳述式)" @@ -3942,7 +3942,7 @@ msgid "mapping" msgstr "mapping(對映)" #: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:891 -#: ../../reference/datamodel.rst:1616 +#: ../../reference/datamodel.rst:1618 msgid "dictionary" msgstr "dictionary(字典)" @@ -3965,7 +3965,7 @@ msgid "function" msgstr "function (函式)" #: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:891 -#: ../../reference/datamodel.rst:913 ../../reference/datamodel.rst:2547 +#: ../../reference/datamodel.rst:913 ../../reference/datamodel.rst:2549 msgid "call" msgstr "call(呼叫)" @@ -4065,7 +4065,7 @@ msgstr "__name__ (方法屬性)" msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:1100 +#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:1102 msgid "generator" msgstr "generator(產生器)" @@ -4073,7 +4073,7 @@ msgstr "generator(產生器)" msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:724 ../../reference/datamodel.rst:3100 +#: ../../reference/datamodel.rst:724 ../../reference/datamodel.rst:3102 msgid "coroutine" msgstr "coroutine(協程)" @@ -4118,8 +4118,8 @@ msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" #: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:908 -#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:1409 -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:1411 +#: ../../reference/datamodel.rst:2279 msgid "class" msgstr "class(類別)" @@ -4129,7 +4129,7 @@ msgid "class instance" msgstr "class instance(類別實例)" #: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:959 -#: ../../reference/datamodel.rst:2547 +#: ../../reference/datamodel.rst:2549 msgid "instance" msgstr "instance(實例)" @@ -4225,371 +4225,371 @@ msgstr "internal type(內部型別)" msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:1042 +#: ../../reference/datamodel.rst:1048 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:1042 +#: ../../reference/datamodel.rst:1048 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:1042 +#: ../../reference/datamodel.rst:1048 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1116 +#: ../../reference/datamodel.rst:1118 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1160 +#: ../../reference/datamodel.rst:1162 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1275 +#: ../../reference/datamodel.rst:1277 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1290 ../../reference/datamodel.rst:2624 +#: ../../reference/datamodel.rst:1292 ../../reference/datamodel.rst:2626 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1296 +#: ../../reference/datamodel.rst:1298 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1296 +#: ../../reference/datamodel.rst:1298 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1296 +#: ../../reference/datamodel.rst:1298 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1382 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1382 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1409 +#: ../../reference/datamodel.rst:1411 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1428 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1428 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1428 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1490 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1490 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1507 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1507 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1507 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1537 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1537 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1537 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1574 +#: ../../reference/datamodel.rst:1576 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1616 +#: ../../reference/datamodel.rst:1618 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1697 +#: ../../reference/datamodel.rst:1699 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1802 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1802 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1802 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2230 +#: ../../reference/datamodel.rst:2232 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2253 +#: ../../reference/datamodel.rst:2255 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:2279 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2299 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2299 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2594 +#: ../../reference/datamodel.rst:2596 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2752 ../../reference/datamodel.rst:2787 +#: ../../reference/datamodel.rst:2754 ../../reference/datamodel.rst:2789 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2752 ../../reference/datamodel.rst:2787 -#: ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:2754 ../../reference/datamodel.rst:2789 +#: ../../reference/datamodel.rst:2803 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:2848 +#: ../../reference/datamodel.rst:2850 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:2860 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:2860 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:2886 +#: ../../reference/datamodel.rst:2888 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:2913 +#: ../../reference/datamodel.rst:2915 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:2913 +#: ../../reference/datamodel.rst:2915 msgid "context manager" msgstr "context manager(情境管理器)" From 661978aee19d5b9cb00f22e0a465ad9eeca4d827 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 29 Aug 2023 00:06:11 +0000 Subject: [PATCH 02/18] sync with cpython 7c7b2bfb --- library/calendar.po | 191 +++++++++++++++++++++++++------------------- whatsnew/3.12.po | 6 +- 2 files changed, 110 insertions(+), 87 deletions(-) diff --git a/library/calendar.po b/library/calendar.po index 51a147d790..9c51be3d45 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 00:03+0000\n" +"POT-Creation-Date: 2023-08-29 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -55,21 +55,11 @@ msgstr "" "這個模組定義的函式和類別使用理想化的日曆,也就是公曆 (Gregorian calendar) 無" "限往前後兩個方向延伸。這符合 Dershowitz 和 Reingold 在「Calendrical " "Calculations」這本書定義的「逆推公曆」(proleptic Gregorian),是做所有計算的基" -"礎日曆。0 及負數年份的解讀跟 ISO 8601 標準裡規定的一樣,0 年是公元前 1 年,-1" -" 年是公元前 2 年依此類推。" +"礎日曆。0 及負數年份的解讀跟 ISO 8601 標準裡規定的一樣,0 年是公元前 1 " +"年,-1 年是公元前 2 年依此類推。" #: ../../library/calendar.rst:33 msgid "" -"Enumeration defining the days of the week as integer constants, from 0 to 6." -msgstr "定義一週的每一天的列舉,為 0 到 6 的整數常數。" - -#: ../../library/calendar.rst:54 -msgid "" -"Enumeration defining months of the year as integer constants, from 1 to 12." -msgstr "定義一年中的月份的列舉,為 1 到 12 的整數常數。" - -#: ../../library/calendar.rst:85 -msgid "" "Creates a :class:`Calendar` object. *firstweekday* is an integer specifying " "the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:" "`SUNDAY` is ``6``." @@ -77,7 +67,7 @@ msgstr "" "建立 :class:`Calendar` 物件。*firstweekday* 是一個指定一週第一天的整數,:" "const:`MONDAY` 是 ``0``\\ (預設值),:const:`SUNDAY` 是 ``6``。" -#: ../../library/calendar.rst:88 +#: ../../library/calendar.rst:36 msgid "" "A :class:`Calendar` object provides several methods that can be used for " "preparing the calendar data for formatting. This class doesn't do any " @@ -86,11 +76,11 @@ msgstr "" ":class:`Calendar` 物件提供一些方法來為日曆資料的格式化做準備。這個類別本身不" "做任何格式化,這是子類別的工作。" -#: ../../library/calendar.rst:93 +#: ../../library/calendar.rst:41 msgid ":class:`Calendar` instances have the following methods:" msgstr ":class:`Calendar` 實例有以下方法:" -#: ../../library/calendar.rst:97 +#: ../../library/calendar.rst:45 msgid "" "Return an iterator for the week day numbers that will be used for one week. " "The first value from the iterator will be the same as the value of the :attr:" @@ -99,7 +89,7 @@ msgstr "" "回傳一個以數字代表一週的每一天的疊代器 (iterator)。疊代器的第一個值和 :attr:" "`firstweekday` 屬性的值一樣。" -#: ../../library/calendar.rst:104 +#: ../../library/calendar.rst:52 msgid "" "Return an iterator for the month *month* (1--12) in the year *year*. This " "iterator will return all days (as :class:`datetime.date` objects) for the " @@ -109,7 +99,7 @@ msgstr "" "回傳一個在 *year* 年 *month* (1--12) 月的疊代器。這個疊代器會回傳該月的所有日" "期(:class:`datetime.date` 物件)以及在該月之前及之後用來組成完整一週的日期。" -#: ../../library/calendar.rst:112 +#: ../../library/calendar.rst:60 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -120,7 +110,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期單純是該月當日的數字,對於該月" "之外的日期數字會是 ``0``。" -#: ../../library/calendar.rst:120 +#: ../../library/calendar.rst:68 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -131,7 +121,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由該月當日的數字及代表週" "幾的數字組成的元組。" -#: ../../library/calendar.rst:128 +#: ../../library/calendar.rst:76 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -142,7 +132,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日的數字組成的" "元組。" -#: ../../library/calendar.rst:138 +#: ../../library/calendar.rst:86 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -153,7 +143,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日及代表週幾的" "數字組成的元組。" -#: ../../library/calendar.rst:148 +#: ../../library/calendar.rst:96 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven :class:`datetime.date` objects." @@ -161,7 +151,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個 :" "class:`datetime.date` 物件。" -#: ../../library/calendar.rst:154 +#: ../../library/calendar.rst:102 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven tuples of day numbers and weekday numbers." @@ -169,7 +159,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" "月當日的數字及代表週幾的數字組成的元組。" -#: ../../library/calendar.rst:161 +#: ../../library/calendar.rst:109 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven day numbers." @@ -177,7 +167,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" "月當日的數字。" -#: ../../library/calendar.rst:167 +#: ../../library/calendar.rst:115 msgid "" "Return the data for the specified year ready for formatting. The return " "value is a list of month rows. Each month row contains up to *width* months " @@ -188,7 +178,7 @@ msgstr "" "*width* 個月份組成(預設為 3)。每個月份包含四到六週,每一週包含一到七天,每" "一天則是一個 :class:`datetime.date` 物件。" -#: ../../library/calendar.rst:175 +#: ../../library/calendar.rst:123 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are tuples of day " @@ -197,7 +187,7 @@ msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" "個該月當日的數字及代表週幾的數字組成的元組,該月外的日期的該月當日數字為 0。" -#: ../../library/calendar.rst:182 +#: ../../library/calendar.rst:130 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day " @@ -206,15 +196,15 @@ msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" "個該月當日的數字,該月外的日期的該月當日數字為 0。" -#: ../../library/calendar.rst:189 +#: ../../library/calendar.rst:137 msgid "This class can be used to generate plain text calendars." msgstr "這個類別用來產生純文字的日曆。" -#: ../../library/calendar.rst:191 +#: ../../library/calendar.rst:139 msgid ":class:`TextCalendar` instances have the following methods:" msgstr ":class:`TextCalendar` 實例有以下方法:" -#: ../../library/calendar.rst:195 +#: ../../library/calendar.rst:143 msgid "" "Return a month's calendar in a multi-line string. If *w* is provided, it " "specifies the width of the date columns, which are centered. If *l* is " @@ -226,11 +216,11 @@ msgstr "" "度。如果給定 *l*,它會指定每一週使用的行數。這個日曆會依據在建構函式中指定或" "者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。" -#: ../../library/calendar.rst:204 +#: ../../library/calendar.rst:152 msgid "Print a month's calendar as returned by :meth:`formatmonth`." msgstr "印出一個月份的日曆,內容和 :meth:`formatmonth` 回傳的一樣。" -#: ../../library/calendar.rst:209 +#: ../../library/calendar.rst:157 msgid "" "Return a *m*-column calendar for an entire year as a multi-line string. " "Optional parameters *w*, *l*, and *c* are for date column width, lines per " @@ -244,20 +234,20 @@ msgstr "" "者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。最早可以產生日曆" "的年份會依據平台而不同。" -#: ../../library/calendar.rst:219 +#: ../../library/calendar.rst:167 msgid "" "Print the calendar for an entire year as returned by :meth:`formatyear`." msgstr "印出一整年的日曆,內容和 :meth:`formatyear` 回傳的一樣。" -#: ../../library/calendar.rst:224 +#: ../../library/calendar.rst:172 msgid "This class can be used to generate HTML calendars." msgstr "這個類別用來產生 HTML 日曆。" -#: ../../library/calendar.rst:227 +#: ../../library/calendar.rst:175 msgid ":class:`!HTMLCalendar` instances have the following methods:" msgstr ":class:`!HTMLCalendar` 實例有以下方法:" -#: ../../library/calendar.rst:231 +#: ../../library/calendar.rst:179 msgid "" "Return a month's calendar as an HTML table. If *withyear* is true the year " "will be included in the header, otherwise just the month name will be used." @@ -265,14 +255,14 @@ msgstr "" "以 HTML 表格的形式回傳一個月份的日曆。如果 *withyear* 是 true 則標題會包含年" "份,否則只會有月份名稱。" -#: ../../library/calendar.rst:238 +#: ../../library/calendar.rst:186 msgid "" "Return a year's calendar as an HTML table. *width* (defaulting to 3) " "specifies the number of months per row." msgstr "" "以 HTML 表格的形式回傳一整年的日曆。*width*\\ (預設為 3)指定一列有幾個月。" -#: ../../library/calendar.rst:244 +#: ../../library/calendar.rst:192 msgid "" "Return a year's calendar as a complete HTML page. *width* (defaulting to 3) " "specifies the number of months per row. *css* is the name for the cascading " @@ -284,30 +274,30 @@ msgstr "" "月。*css* 是要使用的 CSS (cascading style sheet) 名稱,可以給 :const:`None` " "表示不使用任何 CSS。*encoding* 指定輸出使用的編碼(預設使用系統預設編碼)。" -#: ../../library/calendar.rst:251 +#: ../../library/calendar.rst:199 msgid "" ":class:`!HTMLCalendar` has the following attributes you can override to " "customize the CSS classes used by the calendar:" msgstr ":class:`!HTMLCalendar` 可以覆寫以下屬性來客製日曆所使用的 CSS 類別:" -#: ../../library/calendar.rst:256 +#: ../../library/calendar.rst:204 msgid "" "A list of CSS classes used for each weekday. The default class list is::" msgstr "對應一週每一天 CSS 類別的串列。預設的串列內容為: ::" -#: ../../library/calendar.rst:260 +#: ../../library/calendar.rst:208 msgid "more styles can be added for each day::" msgstr "可以針對每一天增加更多樣式: ::" -#: ../../library/calendar.rst:264 +#: ../../library/calendar.rst:212 msgid "Note that the length of this list must be seven items." msgstr "注意這個串列的長度必須是七個項目。" -#: ../../library/calendar.rst:269 +#: ../../library/calendar.rst:217 msgid "The CSS class for a weekday occurring in the previous or coming month." msgstr "跟當月為同一週且屬於前一個或下一個月份的日期使用的 CSS 類別。" -#: ../../library/calendar.rst:276 +#: ../../library/calendar.rst:224 msgid "" "A list of CSS classes used for weekday names in the header row. The default " "is the same as :attr:`cssclasses`." @@ -315,7 +305,7 @@ msgstr "" "在標題列中一週每一天名稱的 CSS 類別的串列。預設內容和 :attr:`cssclasses` 相" "同。" -#: ../../library/calendar.rst:284 +#: ../../library/calendar.rst:232 msgid "" "The month's head CSS class (used by :meth:`formatmonthname`). The default " "value is ``\"month\"``." @@ -323,7 +313,7 @@ msgstr "" "月份標題的 CSS 類別(由 :meth:`formatmonthname` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:292 +#: ../../library/calendar.rst:240 msgid "" "The CSS class for the whole month's table (used by :meth:`formatmonth`). The " "default value is ``\"month\"``." @@ -331,14 +321,14 @@ msgstr "" "整個月份表格的 CSS 類別(由 :meth:`formatmonth` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:300 +#: ../../library/calendar.rst:248 msgid "" "The CSS class for the whole year's table of tables (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" "整年表格的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 ``\"year\"``。" -#: ../../library/calendar.rst:308 +#: ../../library/calendar.rst:256 msgid "" "The CSS class for the table head for the whole year (used by :meth:" "`formatyear`). The default value is ``\"year\"``." @@ -346,7 +336,7 @@ msgstr "" "整年表格標題的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 " "``\"year\"``。" -#: ../../library/calendar.rst:314 +#: ../../library/calendar.rst:262 msgid "" "Note that although the naming for the above described class attributes is " "singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " @@ -356,11 +346,11 @@ msgstr "" "``cssclass_noday``),你可以使用多個以空格隔開的 CSS 類別取代單一 CSS 類別," "例如: ::" -#: ../../library/calendar.rst:320 +#: ../../library/calendar.rst:268 msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" msgstr "以下是客製化 :class:`!HTMLCalendar` 的範例: ::" -#: ../../library/calendar.rst:332 +#: ../../library/calendar.rst:280 msgid "" "This subclass of :class:`TextCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -368,7 +358,7 @@ msgstr "" ":class:`TextCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:338 +#: ../../library/calendar.rst:286 msgid "" "This subclass of :class:`HTMLCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -376,7 +366,7 @@ msgstr "" ":class:`HTMLCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:344 +#: ../../library/calendar.rst:292 msgid "" "The constructor, :meth:`formatweekday` and :meth:`formatmonthname` methods " "of these two classes temporarily change the ``LC_TIME`` locale to the given " @@ -387,11 +377,11 @@ msgstr "" "把 ``LC_TIME`` 語系暫時改成給定的 *locale*。因為目前的語系是屬於整個行程 " "(process-wide) 的設定,它們不是執行緒安全的。" -#: ../../library/calendar.rst:350 +#: ../../library/calendar.rst:298 msgid "For simple text calendars this module provides the following functions." msgstr "這個模組提供以下函式給單純的文字日曆使用。" -#: ../../library/calendar.rst:354 +#: ../../library/calendar.rst:302 msgid "" "Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The " "values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:" @@ -402,26 +392,26 @@ msgstr "" "`TUESDAY`、:const:`WEDNESDAY`、:const:`THURSDAY`、:const:`FRIDAY`、:const:" "`SATURDAY` 及 :const:`SUNDAY` 可以方便設定。例如設定一週的第一天為週日: ::" -#: ../../library/calendar.rst:365 +#: ../../library/calendar.rst:313 msgid "Returns the current setting for the weekday to start each week." msgstr "回傳目前設定的一週的第一天。" -#: ../../library/calendar.rst:370 +#: ../../library/calendar.rst:318 msgid "" "Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." msgstr "如果 *year* 是閏年回傳 :const:`True`,否則回傳 :const:`False`。" -#: ../../library/calendar.rst:375 +#: ../../library/calendar.rst:323 msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." msgstr "回傳從 *y1* 到 *y2*\\ (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" -#: ../../library/calendar.rst:378 +#: ../../library/calendar.rst:326 msgid "This function works for ranges spanning a century change." msgstr "這個函式也適用在跨越世紀的時間範圍。" -#: ../../library/calendar.rst:383 +#: ../../library/calendar.rst:331 msgid "" "Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), " "*month* (``1``--``12``), *day* (``1``--``31``)." @@ -429,19 +419,19 @@ msgstr "" "回傳 *year* 年 (``1970``--...) *month* 月 (``1``--``12``) *day* 日 (``1``--" "``31``) 是週幾(``0`` 是星期一)。" -#: ../../library/calendar.rst:389 +#: ../../library/calendar.rst:337 msgid "" "Return a header containing abbreviated weekday names. *n* specifies the " "width in characters for one weekday." msgstr "回傳包含一週每一天的名稱縮寫的標題。*n* 指定每一天的字元寬度。" -#: ../../library/calendar.rst:395 +#: ../../library/calendar.rst:343 msgid "" "Returns weekday of first day of the month and number of days in month, for " "the specified *year* and *month*." msgstr "回傳指定 *year* 年 *month* 月該月第一天代表週幾的數字及該月有多少天。" -#: ../../library/calendar.rst:401 +#: ../../library/calendar.rst:349 msgid "" "Returns a matrix representing a month's calendar. Each row represents a " "week; days outside of the month are represented by zeros. Each week begins " @@ -450,11 +440,11 @@ msgstr "" "回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。每一週以" "週一開始,除非有使用 :func:`setfirstweekday` 改變設定。" -#: ../../library/calendar.rst:408 +#: ../../library/calendar.rst:356 msgid "Prints a month's calendar as returned by :func:`month`." msgstr "印出一個月份的日曆,跟 :func:`month` 回傳的內容一樣。" -#: ../../library/calendar.rst:413 +#: ../../library/calendar.rst:361 msgid "" "Returns a month's calendar in a multi-line string using the :meth:" "`formatmonth` of the :class:`TextCalendar` class." @@ -462,12 +452,12 @@ msgstr "" "以多行字串的形式回傳一個月的日曆,使用 :class:`TextCalendar` 類別的 :meth:" "`formatmonth`。" -#: ../../library/calendar.rst:419 +#: ../../library/calendar.rst:367 msgid "" "Prints the calendar for an entire year as returned by :func:`calendar`." msgstr "印出一整年的日曆,跟 :func:`calendar` 回傳的內容一樣。" -#: ../../library/calendar.rst:424 +#: ../../library/calendar.rst:372 msgid "" "Returns a 3-column calendar for an entire year as a multi-line string using " "the :meth:`formatyear` of the :class:`TextCalendar` class." @@ -475,7 +465,7 @@ msgstr "" "以多行字串回傳三欄形式的一整年日曆,使用 :class:`TextCalendar` 類別的 :meth:" "`formatyear`。" -#: ../../library/calendar.rst:430 +#: ../../library/calendar.rst:378 msgid "" "An unrelated but handy function that takes a time tuple such as returned by " "the :func:`~time.gmtime` function in the :mod:`time` module, and returns the " @@ -487,21 +477,35 @@ msgstr "" "gmtime` 函式回傳的元組,並回傳對應的 Unix 時間戳,假設從 1970 開始及 POSIX 編" "碼。事實上,:func:`time.gmtime` 和 :func:`timegm` 是彼此相反的。" -#: ../../library/calendar.rst:437 +#: ../../library/calendar.rst:385 msgid "The :mod:`calendar` module exports the following data attributes:" msgstr ":mod:`calendar` 模組匯出以下資料屬性:" -#: ../../library/calendar.rst:441 +#: ../../library/calendar.rst:389 msgid "An array that represents the days of the week in the current locale." msgstr "以目前語系來表示的一週每一天名稱的陣列。" -#: ../../library/calendar.rst:446 +#: ../../library/calendar.rst:394 msgid "" "An array that represents the abbreviated days of the week in the current " "locale." msgstr "以目前語系來表示的一週每一天縮寫名稱的陣列。" -#: ../../library/calendar.rst:451 +#: ../../library/calendar.rst:405 +#, fuzzy +msgid "" +"Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " +"is ``6``." +msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" + +#: ../../library/calendar.rst:413 +msgid "" +"Enumeration defining days of the week as integer constants. The members of " +"this enumeration are exported to the module scope as :data:`MONDAY` through :" +"data:`SUNDAY`." +msgstr "" + +#: ../../library/calendar.rst:422 msgid "" "An array that represents the months of the year in the current locale. This " "follows normal convention of January being month number 1, so it has a " @@ -510,7 +514,7 @@ msgstr "" "以目前語系來表示的一年每個月份名稱的陣列。它按照一般慣例以數字 1 代表一月,因" "此它的長度為 13,而 ``month_name[0]`` 是空字串。" -#: ../../library/calendar.rst:458 +#: ../../library/calendar.rst:429 msgid "" "An array that represents the abbreviated months of the year in the current " "locale. This follows normal convention of January being month number 1, so " @@ -519,49 +523,68 @@ msgstr "" "以目前語系來表示的一年每個月份縮寫名稱的陣列。它按照一般慣例以數字 1 代表一" "月,因此它的長度為 13,而 ``month_abbr[0]`` 是空字串。" -#: ../../library/calendar.rst:470 +#: ../../library/calendar.rst:447 +#, fuzzy msgid "" -"Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``." +"Aliases for the months of the year, where ``JANUARY`` is ``1`` and " +"``DECEMBER`` is ``12``." msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" -#: ../../library/calendar.rst:473 +#: ../../library/calendar.rst:455 +msgid "" +"Enumeration defining months of the year as integer constants. The members of " +"this enumeration are exported to the module scope as :data:`JANUARY` " +"through :data:`DECEMBER`." +msgstr "" + +#: ../../library/calendar.rst:462 msgid "The :mod:`calendar` module defines the following exceptions:" msgstr "" -#: ../../library/calendar.rst:477 +#: ../../library/calendar.rst:466 msgid "" "A subclass of :exc:`ValueError`, raised when the given month number is " "outside of the range 1-12 (inclusive)." msgstr "" -#: ../../library/calendar.rst:482 +#: ../../library/calendar.rst:471 msgid "The invalid month number." msgstr "" -#: ../../library/calendar.rst:487 +#: ../../library/calendar.rst:476 msgid "" "A subclass of :exc:`ValueError`, raised when the given weekday number is " "outside of the range 0-6 (inclusive)." msgstr "" -#: ../../library/calendar.rst:492 +#: ../../library/calendar.rst:481 msgid "The invalid weekday number." msgstr "" -#: ../../library/calendar.rst:499 +#: ../../library/calendar.rst:488 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/calendar.rst:498 +#: ../../library/calendar.rst:487 msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." msgstr "日期與時間的物件導向介面,和 :mod:`time` 模組有相似的功能。" -#: ../../library/calendar.rst:501 +#: ../../library/calendar.rst:490 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/calendar.rst:502 +#: ../../library/calendar.rst:491 msgid "Low-level time related functions." msgstr "底層的時間相關函式。" + +#~ msgid "" +#~ "Enumeration defining the days of the week as integer constants, from 0 to " +#~ "6." +#~ msgstr "定義一週的每一天的列舉,為 0 到 6 的整數常數。" + +#~ msgid "" +#~ "Enumeration defining months of the year as integer constants, from 1 to " +#~ "12." +#~ msgstr "定義一年中的月份的列舉,為 1 到 12 的整數常數。" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 20e10941bc..90a15a1def 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-08-29 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1292,8 +1292,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1016 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.Month.JANUARY` and :data:" -"`calendar.Month.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" #: ../../whatsnew/3.12.rst:1020 From b6904092b5783c28002b2e2f40679e04f71e2b27 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 29 Aug 2023 12:29:19 +0000 Subject: [PATCH 03/18] sync with cpython cdca4af6 --- c-api/stable.po | 10 +++++----- c-api/typeobj.po | 4 ++-- library/idle.po | 4 ++-- library/importlib.po | 4 ++-- library/sqlite3.po | 4 ++-- library/tkinter.po | 4 ++-- using/configure.po | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/c-api/stable.po b/c-api/stable.po index 59f5a6d71c..ea5b0c5350 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2023-01-24 21:07+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,7 +48,7 @@ msgstr "" "行,反之亦然,但 3.9.x 和 3.10.x 就需要分別編譯。" #: ../../c-api/stable.rst:21 -msgid "There are two tiers of C API with different stability exepectations:" +msgid "There are two tiers of C API with different stability expectations:" msgstr "" #: ../../c-api/stable.rst:23 @@ -147,9 +147,9 @@ msgid "" "the specified one onward, and can use Limited API introduced up to that " "version." msgstr "" -"將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本的 :c:macro:" -"`PY_VERSION_HEX` 值。該擴充無需重新編譯即可與從指定版本開始的所有 Python 3 版" -"本一起使用,並且可以使用過去版本有引入的受限 API。" +"將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本的 :c:" +"macro:`PY_VERSION_HEX` 值。該擴充無需重新編譯即可與從指定版本開始的所有 " +"Python 3 版本一起使用,並且可以使用過去版本有引入的受限 API。" #: ../../c-api/stable.rst:83 msgid "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 7b0d0db989..1c052f1ed6 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2610,7 +2610,7 @@ msgstr "" #: ../../c-api/typeobj.rst:1730 msgid "" "Some types may not store their dictionary in this slot. Use :c:func:" -"`PyType_GetDict` to retreive the dictionary for an arbitrary type." +"`PyType_GetDict` to retrieve the dictionary for an arbitrary type." msgstr "" #: ../../c-api/typeobj.rst:1736 diff --git a/library/idle.po b/library/idle.po index 2686b61b6a..521bc73b78 100644 --- a/library/idle.po +++ b/library/idle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -922,7 +922,7 @@ msgstr "" msgid "" "Any selection becomes a search target. However, only selections within a " "line work because searches are only performed within lines with the terminal " -"newline removed. If ``[x] Regular expresion`` is checked, the target is " +"newline removed. If ``[x] Regular expression`` is checked, the target is " "interpreted according to the Python re module." msgstr "" diff --git a/library/importlib.po b/library/importlib.po index 9ebc47b3d0..2f7398079e 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1491,7 +1491,7 @@ msgstr "" msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " -"mulitple interpreters (or per-interpreter GIL)." +"multiple interpreters (or per-interpreter GIL)." msgstr "" #: ../../library/importlib.rst:1276 diff --git a/library/sqlite3.po b/library/sqlite3.po index 0e6a2ccf5f..cacf25b635 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1479,7 +1479,7 @@ msgstr "" #: ../../library/sqlite3.rst:1548 msgid "" -"If *sql* contains more than one SQL statement, or is not a DML statment." +"If *sql* contains more than one SQL statement, or is not a DML statement." msgstr "" #: ../../library/sqlite3.rst:1565 diff --git a/library/tkinter.po b/library/tkinter.po index 30c7155ee1..8b8ad0bd3e 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -650,7 +650,7 @@ msgstr "" msgid "" "When your application uses Tkinter's classes and methods, internally Tkinter " "is assembling strings representing Tcl/Tk commands, and executing those " -"commands in the Tcl interpreter attached to your applicaton's :class:`Tk` " +"commands in the Tcl interpreter attached to your application's :class:`Tk` " "instance." msgstr "" diff --git a/using/configure.po b/using/configure.po index 27dd931962..3a283eca32 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+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-" @@ -320,7 +320,7 @@ msgid "" msgstr "" #: ../../using/configure.rst:224 -msgid "This value can be retrived at runtime using :data:`sys.prefix`." +msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "" #: ../../using/configure.rst:226 @@ -336,7 +336,7 @@ msgid "" msgstr "" #: ../../using/configure.rst:233 -msgid "This value can be retrived at runtime using :data:`sys.exec_prefix`." +msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "" #: ../../using/configure.rst:237 From 24010055cfb739e42c6ca920667ce942b9b059f7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 30 Aug 2023 00:06:07 +0000 Subject: [PATCH 04/18] sync with cpython 036dd695 --- library/io.po | 349 +++++++++++++++++++++++++------------------------- 1 file changed, 175 insertions(+), 174 deletions(-) diff --git a/library/io.po b/library/io.po index b50a1f3f6e..fba54e7c27 100644 --- a/library/io.po +++ b/library/io.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-28 00:04+0000\n" +"POT-Creation-Date: 2023-08-30 00:04+0000\n" "PO-Revision-Date: 2023-08-01 12:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -77,7 +77,7 @@ msgstr "" "原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :exc:" "`IOError` 現在是 :exc:`OSError` 的別名。" -#: ../../library/io.rst:51 ../../library/io.rst:856 ../../library/io.rst:1147 +#: ../../library/io.rst:51 ../../library/io.rst:855 ../../library/io.rst:1149 msgid "Text I/O" msgstr "文字 I/O" @@ -115,7 +115,7 @@ msgid "" "`TextIOBase`." msgstr "文字資料串流 API 的詳細說明在 :class:`TextIOBase` 文件當中。" -#: ../../library/io.rst:72 ../../library/io.rst:1135 +#: ../../library/io.rst:72 ../../library/io.rst:1137 msgid "Binary I/O" msgstr "二進位 (Binary) I/O" @@ -665,54 +665,51 @@ msgstr "" #: ../../library/io.rst:408 msgid "" -"Change the stream position to the given byte *offset*. *offset* is " -"interpreted relative to the position indicated by *whence*. The default " -"value for *whence* is :data:`!SEEK_SET`. Values for *whence* are:" +"Change the stream position to the given byte *offset*, interpreted relative " +"to the position indicated by *whence*, and return the new absolute position. " +"Values for *whence* are:" msgstr "" -#: ../../library/io.rst:412 +#: ../../library/io.rst:413 msgid "" -":data:`!SEEK_SET` or ``0`` -- start of the stream (the default); *offset* " +":data:`os.SEEK_SET` or ``0`` -- start of the stream (the default); *offset* " "should be zero or positive" msgstr "" -#: ../../library/io.rst:414 +#: ../../library/io.rst:415 msgid "" -":data:`!SEEK_CUR` or ``1`` -- current stream position; *offset* may be " +":data:`os.SEEK_CUR` or ``1`` -- current stream position; *offset* may be " "negative" msgstr "" -#: ../../library/io.rst:416 +#: ../../library/io.rst:417 msgid "" -":data:`!SEEK_END` or ``2`` -- end of the stream; *offset* is usually negative" -msgstr "" - -#: ../../library/io.rst:419 -msgid "Return the new absolute position." +":data:`os.SEEK_END` or ``2`` -- end of the stream; *offset* is usually " +"negative" msgstr "" -#: ../../library/io.rst:421 ../../library/io.rst:931 +#: ../../library/io.rst:420 ../../library/io.rst:930 msgid "The :data:`!SEEK_*` constants." msgstr "" -#: ../../library/io.rst:424 +#: ../../library/io.rst:423 msgid "" "Some operating systems could support additional values, like :const:`os." "SEEK_HOLE` or :const:`os.SEEK_DATA`. The valid values for a file could " "depend on it being open in text or binary mode." msgstr "" -#: ../../library/io.rst:431 +#: ../../library/io.rst:430 msgid "" "Return ``True`` if the stream supports random access. If ``False``, :meth:" "`seek`, :meth:`tell` and :meth:`truncate` will raise :exc:`OSError`." msgstr "" -#: ../../library/io.rst:436 +#: ../../library/io.rst:435 msgid "Return the current stream position." msgstr "" -#: ../../library/io.rst:440 +#: ../../library/io.rst:439 msgid "" "Resize the stream to the given *size* in bytes (or the current position if " "*size* is not specified). The current stream position isn't changed. This " @@ -721,34 +718,34 @@ msgid "" "additional bytes are zero-filled). The new file size is returned." msgstr "" -#: ../../library/io.rst:447 +#: ../../library/io.rst:446 msgid "Windows will now zero-fill files when extending." msgstr "" -#: ../../library/io.rst:452 +#: ../../library/io.rst:451 msgid "" "Return ``True`` if the stream supports writing. If ``False``, :meth:`!" "write` and :meth:`truncate` will raise :exc:`OSError`." msgstr "" -#: ../../library/io.rst:457 +#: ../../library/io.rst:456 msgid "" "Write a list of lines to the stream. Line separators are not added, so it " "is usual for each of the lines provided to have a line separator at the end." msgstr "" -#: ../../library/io.rst:463 +#: ../../library/io.rst:462 msgid "" "Prepare for object destruction. :class:`IOBase` provides a default " "implementation of this method that calls the instance's :meth:`~IOBase." "close` method." msgstr "" -#: ../../library/io.rst:470 +#: ../../library/io.rst:469 msgid "Base class for raw binary streams. It inherits :class:`IOBase`." msgstr "" -#: ../../library/io.rst:472 +#: ../../library/io.rst:471 msgid "" "Raw binary streams typically provide low-level access to an underlying OS " "device or API, and do not try to encapsulate it in high-level primitives " @@ -756,13 +753,13 @@ msgid "" "text streams, described later in this page)." msgstr "" -#: ../../library/io.rst:477 +#: ../../library/io.rst:476 msgid "" ":class:`RawIOBase` provides these methods in addition to those from :class:" "`IOBase`:" msgstr "" -#: ../../library/io.rst:482 +#: ../../library/io.rst:481 msgid "" "Read up to *size* bytes from the object and return them. As a convenience, " "if *size* is unspecified or -1, all bytes until EOF are returned. Otherwise, " @@ -770,25 +767,25 @@ msgid "" "if the operating system call returns fewer than *size* bytes." msgstr "" -#: ../../library/io.rst:487 +#: ../../library/io.rst:486 msgid "" "If 0 bytes are returned, and *size* was not 0, this indicates end of file. " "If the object is in non-blocking mode and no bytes are available, ``None`` " "is returned." msgstr "" -#: ../../library/io.rst:491 +#: ../../library/io.rst:490 msgid "" "The default implementation defers to :meth:`readall` and :meth:`readinto`." msgstr "" -#: ../../library/io.rst:496 +#: ../../library/io.rst:495 msgid "" "Read and return all the bytes from the stream until EOF, using multiple " "calls to the stream if necessary." msgstr "" -#: ../../library/io.rst:501 +#: ../../library/io.rst:500 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b*, and " "return the number of bytes read. For example, *b* might be a :class:" @@ -796,7 +793,7 @@ msgid "" "available, ``None`` is returned." msgstr "" -#: ../../library/io.rst:509 +#: ../../library/io.rst:508 msgid "" "Write the given :term:`bytes-like object`, *b*, to the underlying raw " "stream, and return the number of bytes written. This can be less than the " @@ -807,13 +804,13 @@ msgid "" "the implementation should only access *b* during the method call." msgstr "" -#: ../../library/io.rst:522 +#: ../../library/io.rst:521 msgid "" "Base class for binary streams that support some kind of buffering. It " "inherits :class:`IOBase`." msgstr "" -#: ../../library/io.rst:525 +#: ../../library/io.rst:524 msgid "" "The main difference with :class:`RawIOBase` is that methods :meth:`read`, :" "meth:`readinto` and :meth:`write` will try (respectively) to read as much " @@ -821,7 +818,7 @@ msgid "" "perhaps more than one system call." msgstr "" -#: ../../library/io.rst:530 +#: ../../library/io.rst:529 msgid "" "In addition, those methods can raise :exc:`BlockingIOError` if the " "underlying raw stream is in non-blocking mode and cannot take or give enough " @@ -829,55 +826,55 @@ msgid "" "``None``." msgstr "" -#: ../../library/io.rst:535 +#: ../../library/io.rst:534 msgid "" "Besides, the :meth:`read` method does not have a default implementation that " "defers to :meth:`readinto`." msgstr "" -#: ../../library/io.rst:538 +#: ../../library/io.rst:537 msgid "" "A typical :class:`BufferedIOBase` implementation should not inherit from a :" "class:`RawIOBase` implementation, but wrap one, like :class:`BufferedWriter` " "and :class:`BufferedReader` do." msgstr "" -#: ../../library/io.rst:542 +#: ../../library/io.rst:541 msgid "" ":class:`BufferedIOBase` provides or overrides these data attributes and " "methods in addition to those from :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:547 +#: ../../library/io.rst:546 msgid "" "The underlying raw stream (a :class:`RawIOBase` instance) that :class:" "`BufferedIOBase` deals with. This is not part of the :class:" "`BufferedIOBase` API and may not exist on some implementations." msgstr "" -#: ../../library/io.rst:553 +#: ../../library/io.rst:552 msgid "Separate the underlying raw stream from the buffer and return it." msgstr "" -#: ../../library/io.rst:555 +#: ../../library/io.rst:554 msgid "" "After the raw stream has been detached, the buffer is in an unusable state." msgstr "" -#: ../../library/io.rst:558 +#: ../../library/io.rst:557 msgid "" "Some buffers, like :class:`BytesIO`, do not have the concept of a single raw " "stream to return from this method. They raise :exc:`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:566 +#: ../../library/io.rst:565 msgid "" "Read and return up to *size* bytes. If the argument is omitted, ``None``, " "or negative, data is read and returned until EOF is reached. An empty :" "class:`bytes` object is returned if the stream is already at EOF." msgstr "" -#: ../../library/io.rst:570 +#: ../../library/io.rst:569 msgid "" "If the argument is positive, and the underlying raw stream is not " "interactive, multiple raw reads may be issued to satisfy the byte count " @@ -886,13 +883,13 @@ msgid "" "imminent." msgstr "" -#: ../../library/io.rst:576 ../../library/io.rst:599 ../../library/io.rst:609 +#: ../../library/io.rst:575 ../../library/io.rst:598 ../../library/io.rst:608 msgid "" "A :exc:`BlockingIOError` is raised if the underlying raw stream is in non " "blocking-mode, and has no data available at the moment." msgstr "" -#: ../../library/io.rst:581 +#: ../../library/io.rst:580 msgid "" "Read and return up to *size* bytes, with at most one call to the underlying " "raw stream's :meth:`~RawIOBase.read` (or :meth:`~RawIOBase.readinto`) " @@ -900,26 +897,26 @@ msgid "" "top of a :class:`BufferedIOBase` object." msgstr "" -#: ../../library/io.rst:587 +#: ../../library/io.rst:586 msgid "" "If *size* is ``-1`` (the default), an arbitrary number of bytes are returned " "(more than zero unless EOF is reached)." msgstr "" -#: ../../library/io.rst:592 +#: ../../library/io.rst:591 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b* and " "return the number of bytes read. For example, *b* might be a :class:" "`bytearray`." msgstr "" -#: ../../library/io.rst:596 +#: ../../library/io.rst:595 msgid "" "Like :meth:`read`, multiple reads may be issued to the underlying raw " "stream, unless the latter is interactive." msgstr "" -#: ../../library/io.rst:604 +#: ../../library/io.rst:603 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b*, " "using at most one call to the underlying raw stream's :meth:`~RawIOBase." @@ -927,7 +924,7 @@ msgid "" "read." msgstr "" -#: ../../library/io.rst:616 +#: ../../library/io.rst:615 msgid "" "Write the given :term:`bytes-like object`, *b*, and return the number of " "bytes written (always equal to the length of *b* in bytes, since if the " @@ -936,41 +933,41 @@ msgid "" "or held in a buffer for performance and latency reasons." msgstr "" -#: ../../library/io.rst:623 +#: ../../library/io.rst:622 msgid "" "When in non-blocking mode, a :exc:`BlockingIOError` is raised if the data " "needed to be written to the raw stream but it couldn't accept all the data " "without blocking." msgstr "" -#: ../../library/io.rst:627 +#: ../../library/io.rst:626 msgid "" "The caller may release or mutate *b* after this method returns, so the " "implementation should only access *b* during the method call." msgstr "" -#: ../../library/io.rst:632 +#: ../../library/io.rst:631 msgid "Raw File I/O" msgstr "" -#: ../../library/io.rst:636 +#: ../../library/io.rst:635 msgid "" "A raw binary stream representing an OS-level file containing bytes data. It " "inherits :class:`RawIOBase`." msgstr "" -#: ../../library/io.rst:639 +#: ../../library/io.rst:638 msgid "The *name* can be one of two things:" msgstr "" -#: ../../library/io.rst:641 +#: ../../library/io.rst:640 msgid "" "a character string or :class:`bytes` object representing the path to the " "file which will be opened. In this case closefd must be ``True`` (the " "default) otherwise an error will be raised." msgstr "" -#: ../../library/io.rst:644 +#: ../../library/io.rst:643 msgid "" "an integer representing the number of an existing OS-level file descriptor " "to which the resulting :class:`FileIO` object will give access. When the " @@ -978,7 +975,7 @@ msgid "" "set to ``False``." msgstr "" -#: ../../library/io.rst:649 +#: ../../library/io.rst:648 msgid "" "The *mode* can be ``'r'``, ``'w'``, ``'x'`` or ``'a'`` for reading " "(default), writing, exclusive creation or appending. The file will be " @@ -989,14 +986,14 @@ msgid "" "``'+'`` to the mode to allow simultaneous reading and writing." msgstr "" -#: ../../library/io.rst:657 +#: ../../library/io.rst:656 msgid "" "The :meth:`~RawIOBase.read` (when called with a positive argument), :meth:" "`~RawIOBase.readinto` and :meth:`~RawIOBase.write` methods on this class " "will only make one system call." msgstr "" -#: ../../library/io.rst:661 +#: ../../library/io.rst:660 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -1005,372 +1002,372 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/io.rst:667 +#: ../../library/io.rst:666 msgid "The newly created file is :ref:`non-inheritable `." msgstr "" -#: ../../library/io.rst:669 +#: ../../library/io.rst:668 msgid "" "See the :func:`open` built-in function for examples on using the *opener* " "parameter." msgstr "" -#: ../../library/io.rst:672 +#: ../../library/io.rst:671 msgid "The *opener* parameter was added. The ``'x'`` mode was added." msgstr "" -#: ../../library/io.rst:676 +#: ../../library/io.rst:675 msgid "The file is now non-inheritable." msgstr "" -#: ../../library/io.rst:679 +#: ../../library/io.rst:678 msgid "" ":class:`FileIO` provides these data attributes in addition to those from :" "class:`RawIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:684 +#: ../../library/io.rst:683 msgid "The mode as given in the constructor." msgstr "" -#: ../../library/io.rst:688 +#: ../../library/io.rst:687 msgid "" "The file name. This is the file descriptor of the file when no name is " "given in the constructor." msgstr "" -#: ../../library/io.rst:693 +#: ../../library/io.rst:692 msgid "Buffered Streams" msgstr "" -#: ../../library/io.rst:695 +#: ../../library/io.rst:694 msgid "" "Buffered I/O streams provide a higher-level interface to an I/O device than " "raw I/O does." msgstr "" -#: ../../library/io.rst:700 +#: ../../library/io.rst:699 msgid "" "A binary stream using an in-memory bytes buffer. It inherits :class:" "`BufferedIOBase`. The buffer is discarded when the :meth:`~IOBase.close` " "method is called." msgstr "" -#: ../../library/io.rst:704 +#: ../../library/io.rst:703 msgid "" "The optional argument *initial_bytes* is a :term:`bytes-like object` that " "contains initial data." msgstr "" -#: ../../library/io.rst:707 +#: ../../library/io.rst:706 msgid "" ":class:`BytesIO` provides or overrides these methods in addition to those " "from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:712 +#: ../../library/io.rst:711 msgid "" "Return a readable and writable view over the contents of the buffer without " "copying them. Also, mutating the view will transparently update the " "contents of the buffer::" msgstr "" -#: ../../library/io.rst:723 +#: ../../library/io.rst:722 msgid "" "As long as the view exists, the :class:`BytesIO` object cannot be resized or " "closed." msgstr "" -#: ../../library/io.rst:730 +#: ../../library/io.rst:729 msgid "Return :class:`bytes` containing the entire contents of the buffer." msgstr "" -#: ../../library/io.rst:735 +#: ../../library/io.rst:734 msgid "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.read`." msgstr "" -#: ../../library/io.rst:737 ../../library/io.rst:780 +#: ../../library/io.rst:736 ../../library/io.rst:779 msgid "The *size* argument is now optional." msgstr "" -#: ../../library/io.rst:742 +#: ../../library/io.rst:741 msgid "" "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.readinto`." msgstr "" -#: ../../library/io.rst:748 +#: ../../library/io.rst:747 msgid "" "A buffered binary stream providing higher-level access to a readable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:752 +#: ../../library/io.rst:751 msgid "" "When reading data from this object, a larger amount of data may be requested " "from the underlying raw stream, and kept in an internal buffer. The buffered " "data can then be returned directly on subsequent reads." msgstr "" -#: ../../library/io.rst:756 +#: ../../library/io.rst:755 msgid "" "The constructor creates a :class:`BufferedReader` for the given readable " "*raw* stream and *buffer_size*. If *buffer_size* is omitted, :data:" "`DEFAULT_BUFFER_SIZE` is used." msgstr "" -#: ../../library/io.rst:760 +#: ../../library/io.rst:759 msgid "" ":class:`BufferedReader` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:765 +#: ../../library/io.rst:764 msgid "" "Return bytes from the stream without advancing the position. At most one " "single read on the raw stream is done to satisfy the call. The number of " "bytes returned may be less or more than requested." msgstr "" -#: ../../library/io.rst:771 +#: ../../library/io.rst:770 msgid "" "Read and return *size* bytes, or if *size* is not given or negative, until " "EOF or if the read call would block in non-blocking mode." msgstr "" -#: ../../library/io.rst:776 +#: ../../library/io.rst:775 msgid "" "Read and return up to *size* bytes with only one call on the raw stream. If " "at least one byte is buffered, only buffered bytes are returned. Otherwise, " "one raw stream read call is made." msgstr "" -#: ../../library/io.rst:786 +#: ../../library/io.rst:785 msgid "" "A buffered binary stream providing higher-level access to a writeable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:790 +#: ../../library/io.rst:789 msgid "" "When writing to this object, data is normally placed into an internal " "buffer. The buffer will be written out to the underlying :class:`RawIOBase` " "object under various conditions, including:" msgstr "" -#: ../../library/io.rst:794 +#: ../../library/io.rst:793 msgid "when the buffer gets too small for all pending data;" msgstr "" -#: ../../library/io.rst:795 +#: ../../library/io.rst:794 msgid "when :meth:`flush` is called;" msgstr "" -#: ../../library/io.rst:796 +#: ../../library/io.rst:795 msgid "" "when a :meth:`~IOBase.seek` is requested (for :class:`BufferedRandom` " "objects);" msgstr "" -#: ../../library/io.rst:797 +#: ../../library/io.rst:796 msgid "when the :class:`BufferedWriter` object is closed or destroyed." msgstr "" -#: ../../library/io.rst:799 +#: ../../library/io.rst:798 msgid "" "The constructor creates a :class:`BufferedWriter` for the given writeable " "*raw* stream. If the *buffer_size* is not given, it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:803 +#: ../../library/io.rst:802 msgid "" ":class:`BufferedWriter` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:808 +#: ../../library/io.rst:807 msgid "" "Force bytes held in the buffer into the raw stream. A :exc:" "`BlockingIOError` should be raised if the raw stream blocks." msgstr "" -#: ../../library/io.rst:813 +#: ../../library/io.rst:812 msgid "" "Write the :term:`bytes-like object`, *b*, and return the number of bytes " "written. When in non-blocking mode, a :exc:`BlockingIOError` is raised if " "the buffer needs to be written out but the raw stream blocks." msgstr "" -#: ../../library/io.rst:821 +#: ../../library/io.rst:820 msgid "" "A buffered binary stream providing higher-level access to a seekable :class:" "`RawIOBase` raw binary stream. It inherits :class:`BufferedReader` and :" "class:`BufferedWriter`." msgstr "" -#: ../../library/io.rst:825 +#: ../../library/io.rst:824 msgid "" "The constructor creates a reader and writer for a seekable raw stream, given " "in the first argument. If the *buffer_size* is omitted it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:829 +#: ../../library/io.rst:828 msgid "" ":class:`BufferedRandom` is capable of anything :class:`BufferedReader` or :" "class:`BufferedWriter` can do. In addition, :meth:`~IOBase.seek` and :meth:" "`~IOBase.tell` are guaranteed to be implemented." msgstr "" -#: ../../library/io.rst:836 +#: ../../library/io.rst:835 msgid "" "A buffered binary stream providing higher-level access to two non seekable :" "class:`RawIOBase` raw binary streams---one readable, the other writeable. It " "inherits :class:`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:840 +#: ../../library/io.rst:839 msgid "" "*reader* and *writer* are :class:`RawIOBase` objects that are readable and " "writeable respectively. If the *buffer_size* is omitted it defaults to :" "data:`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:844 +#: ../../library/io.rst:843 msgid "" ":class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\\'s " "methods except for :meth:`~BufferedIOBase.detach`, which raises :exc:" "`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:850 +#: ../../library/io.rst:849 msgid "" ":class:`BufferedRWPair` does not attempt to synchronize accesses to its " "underlying raw streams. You should not pass it the same object as reader " "and writer; use :class:`BufferedRandom` instead." msgstr "" -#: ../../library/io.rst:860 +#: ../../library/io.rst:859 msgid "" "Base class for text streams. This class provides a character and line based " "interface to stream I/O. It inherits :class:`IOBase`." msgstr "" -#: ../../library/io.rst:863 +#: ../../library/io.rst:862 msgid "" ":class:`TextIOBase` provides or overrides these data attributes and methods " "in addition to those from :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:868 +#: ../../library/io.rst:867 msgid "" "The name of the encoding used to decode the stream's bytes into strings, and " "to encode strings into bytes." msgstr "" -#: ../../library/io.rst:873 +#: ../../library/io.rst:872 msgid "The error setting of the decoder or encoder." msgstr "" -#: ../../library/io.rst:877 +#: ../../library/io.rst:876 msgid "" "A string, a tuple of strings, or ``None``, indicating the newlines " "translated so far. Depending on the implementation and the initial " "constructor flags, this may not be available." msgstr "" -#: ../../library/io.rst:883 +#: ../../library/io.rst:882 msgid "" "The underlying binary buffer (a :class:`BufferedIOBase` instance) that :" "class:`TextIOBase` deals with. This is not part of the :class:`TextIOBase` " "API and may not exist in some implementations." msgstr "" -#: ../../library/io.rst:889 +#: ../../library/io.rst:888 msgid "" "Separate the underlying binary buffer from the :class:`TextIOBase` and " "return it." msgstr "" -#: ../../library/io.rst:892 +#: ../../library/io.rst:891 msgid "" "After the underlying buffer has been detached, the :class:`TextIOBase` is in " "an unusable state." msgstr "" -#: ../../library/io.rst:895 +#: ../../library/io.rst:894 msgid "" "Some :class:`TextIOBase` implementations, like :class:`StringIO`, may not " "have the concept of an underlying buffer and calling this method will raise :" "exc:`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:903 +#: ../../library/io.rst:902 msgid "" "Read and return at most *size* characters from the stream as a single :class:" "`str`. If *size* is negative or ``None``, reads until EOF." msgstr "" -#: ../../library/io.rst:908 +#: ../../library/io.rst:907 msgid "" "Read until newline or EOF and return a single :class:`str`. If the stream " "is already at EOF, an empty string is returned." msgstr "" -#: ../../library/io.rst:911 +#: ../../library/io.rst:910 msgid "If *size* is specified, at most *size* characters will be read." msgstr "" -#: ../../library/io.rst:915 +#: ../../library/io.rst:914 msgid "" "Change the stream position to the given *offset*. Behaviour depends on the " "*whence* parameter. The default value for *whence* is :data:`!SEEK_SET`." msgstr "" -#: ../../library/io.rst:919 +#: ../../library/io.rst:918 msgid "" ":data:`!SEEK_SET` or ``0``: seek from the start of the stream (the default); " "*offset* must either be a number returned by :meth:`TextIOBase.tell`, or " "zero. Any other *offset* value produces undefined behaviour." msgstr "" -#: ../../library/io.rst:923 +#: ../../library/io.rst:922 msgid "" ":data:`!SEEK_CUR` or ``1``: \"seek\" to the current position; *offset* must " "be zero, which is a no-operation (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:926 +#: ../../library/io.rst:925 msgid "" ":data:`!SEEK_END` or ``2``: seek to the end of the stream; *offset* must be " "zero (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:929 +#: ../../library/io.rst:928 msgid "Return the new absolute position as an opaque number." msgstr "" -#: ../../library/io.rst:936 +#: ../../library/io.rst:935 msgid "" "Return the current stream position as an opaque number. The number does not " "usually represent a number of bytes in the underlying binary storage." msgstr "" -#: ../../library/io.rst:942 +#: ../../library/io.rst:941 msgid "" "Write the string *s* to the stream and return the number of characters " "written." msgstr "" -#: ../../library/io.rst:949 +#: ../../library/io.rst:948 msgid "" "A buffered text stream providing higher-level access to a :class:" "`BufferedIOBase` buffered binary stream. It inherits :class:`TextIOBase`." msgstr "" -#: ../../library/io.rst:953 +#: ../../library/io.rst:952 msgid "" "*encoding* gives the name of the encoding that the stream will be decoded or " "encoded with. It defaults to :func:`locale.getencoding()`. " @@ -1378,7 +1375,7 @@ msgid "" "explicitly. See :ref:`io-text-encoding` for more information." msgstr "" -#: ../../library/io.rst:958 +#: ../../library/io.rst:957 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled. Pass ``'strict'`` to raise a :exc:`ValueError` " @@ -1393,13 +1390,13 @@ msgid "" "that has been registered with :func:`codecs.register_error` is also valid." msgstr "" -#: ../../library/io.rst:974 +#: ../../library/io.rst:973 msgid "" "*newline* controls how line endings are handled. It can be ``None``, " "``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as follows:" msgstr "" -#: ../../library/io.rst:977 +#: ../../library/io.rst:976 msgid "" "When reading input from the stream, if *newline* is ``None``, :term:" "`universal newlines` mode is enabled. Lines in the input can end in " @@ -1411,7 +1408,7 @@ msgid "" "returned to the caller untranslated." msgstr "" -#: ../../library/io.rst:986 +#: ../../library/io.rst:985 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -1420,13 +1417,13 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/io.rst:992 +#: ../../library/io.rst:991 msgid "" "If *line_buffering* is ``True``, :meth:`~IOBase.flush` is implied when a " "call to write contains a newline character or a carriage return." msgstr "" -#: ../../library/io.rst:995 +#: ../../library/io.rst:994 msgid "" "If *write_through* is ``True``, calls to :meth:`~BufferedIOBase.write` are " "guaranteed not to be buffered: any data written on the :class:" @@ -1434,11 +1431,11 @@ msgid "" "*buffer*." msgstr "" -#: ../../library/io.rst:999 +#: ../../library/io.rst:998 msgid "The *write_through* argument has been added." msgstr "" -#: ../../library/io.rst:1002 +#: ../../library/io.rst:1001 msgid "" "The default *encoding* is now ``locale.getpreferredencoding(False)`` instead " "of ``locale.getpreferredencoding()``. Don't change temporary the locale " @@ -1446,104 +1443,108 @@ msgid "" "instead of the user preferred encoding." msgstr "" -#: ../../library/io.rst:1008 +#: ../../library/io.rst:1007 msgid "" "The *encoding* argument now supports the ``\"locale\"`` dummy encoding name." msgstr "" -#: ../../library/io.rst:1011 +#: ../../library/io.rst:1010 msgid "" ":class:`TextIOWrapper` provides these data attributes and methods in " "addition to those from :class:`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1016 +#: ../../library/io.rst:1015 msgid "Whether line buffering is enabled." msgstr "" -#: ../../library/io.rst:1020 +#: ../../library/io.rst:1019 msgid "Whether writes are passed immediately to the underlying binary buffer." msgstr "" -#: ../../library/io.rst:1028 +#: ../../library/io.rst:1027 msgid "" "Reconfigure this text stream using new settings for *encoding*, *errors*, " "*newline*, *line_buffering* and *write_through*." msgstr "" -#: ../../library/io.rst:1031 +#: ../../library/io.rst:1030 msgid "" "Parameters not specified keep current settings, except ``errors='strict'`` " "is used when *encoding* is specified but *errors* is not specified." msgstr "" -#: ../../library/io.rst:1035 +#: ../../library/io.rst:1034 msgid "" "It is not possible to change the encoding or newline if some data has " "already been read from the stream. On the other hand, changing encoding " "after write is possible." msgstr "" -#: ../../library/io.rst:1039 +#: ../../library/io.rst:1038 msgid "" "This method does an implicit stream flush before setting the new parameters." msgstr "" -#: ../../library/io.rst:1044 +#: ../../library/io.rst:1043 msgid "The method supports ``encoding=\"locale\"`` option." msgstr "" -#: ../../library/io.rst:1049 +#: ../../library/io.rst:1048 msgid "" "Set the stream position. Return the new stream position as an :class:`int`." msgstr "" -#: ../../library/io.rst:1052 +#: ../../library/io.rst:1051 msgid "" "Four operations are supported, given by the following argument combinations:" msgstr "" -#: ../../library/io.rst:1055 +#: ../../library/io.rst:1054 msgid "``seek(0, SEEK_SET)``: Rewind to the start of the stream." msgstr "" -#: ../../library/io.rst:1056 +#: ../../library/io.rst:1055 msgid "" "``seek(cookie, SEEK_SET)``: Restore a previous position; *cookie* **must " "be** a number returned by :meth:`tell`." msgstr "" -#: ../../library/io.rst:1058 +#: ../../library/io.rst:1057 msgid "``seek(0, SEEK_END)``: Fast-forward to the end of the stream." msgstr "" -#: ../../library/io.rst:1059 +#: ../../library/io.rst:1058 msgid "``seek(0, SEEK_CUR)``: Leave the current stream position unchanged." msgstr "" -#: ../../library/io.rst:1061 +#: ../../library/io.rst:1060 msgid "Any other argument combinations are invalid, and may raise exceptions." msgstr "" -#: ../../library/io.rst:1066 +#: ../../library/io.rst:1065 +msgid ":data:`os.SEEK_SET`, :data:`os.SEEK_CUR`, and :data:`os.SEEK_END`." +msgstr "" + +#: ../../library/io.rst:1069 msgid "" "Return the stream position as an opaque number. The return value of :meth:`!" "tell` can be given as input to :meth:`seek`, to restore a previous stream " "position." msgstr "" -#: ../../library/io.rst:1074 +#: ../../library/io.rst:1076 msgid "" "A text stream using an in-memory text buffer. It inherits :class:" "`TextIOBase`." msgstr "" -#: ../../library/io.rst:1077 +#: ../../library/io.rst:1079 msgid "" "The text buffer is discarded when the :meth:`~IOBase.close` method is called." msgstr "" -#: ../../library/io.rst:1080 +#: ../../library/io.rst:1082 msgid "" "The initial value of the buffer can be set by providing *initial_value*. If " "newline translation is enabled, newlines will be encoded as if by :meth:" @@ -1555,50 +1556,50 @@ msgid "" "at the end of the buffer." msgstr "" -#: ../../library/io.rst:1089 +#: ../../library/io.rst:1091 msgid "" "The *newline* argument works like that of :class:`TextIOWrapper`, except " "that when writing output to the stream, if *newline* is ``None``, newlines " "are written as ``\\n`` on all platforms." msgstr "" -#: ../../library/io.rst:1093 +#: ../../library/io.rst:1095 msgid "" ":class:`StringIO` provides this method in addition to those from :class:" "`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1098 +#: ../../library/io.rst:1100 msgid "" "Return a :class:`str` containing the entire contents of the buffer. Newlines " "are decoded as if by :meth:`~TextIOBase.read`, although the stream position " "is not changed." msgstr "" -#: ../../library/io.rst:1102 +#: ../../library/io.rst:1104 msgid "Example usage::" msgstr "" "使用範例:\n" "\n" "::" -#: ../../library/io.rst:1124 +#: ../../library/io.rst:1126 msgid "" "A helper codec that decodes newlines for :term:`universal newlines` mode. It " "inherits :class:`codecs.IncrementalDecoder`." msgstr "" -#: ../../library/io.rst:1129 +#: ../../library/io.rst:1131 msgid "Performance" msgstr "" -#: ../../library/io.rst:1131 +#: ../../library/io.rst:1133 msgid "" "This section discusses the performance of the provided concrete I/O " "implementations." msgstr "" -#: ../../library/io.rst:1137 +#: ../../library/io.rst:1139 msgid "" "By reading and writing only large chunks of data even when the user asks for " "a single byte, buffered I/O hides any inefficiency in calling and executing " @@ -1611,7 +1612,7 @@ msgid "" "data." msgstr "" -#: ../../library/io.rst:1149 +#: ../../library/io.rst:1151 msgid "" "Text I/O over a binary storage (such as a file) is significantly slower than " "binary I/O over the same storage, because it requires conversions between " @@ -1621,24 +1622,24 @@ msgid "" "the reconstruction algorithm used." msgstr "" -#: ../../library/io.rst:1156 +#: ../../library/io.rst:1158 msgid "" ":class:`StringIO`, however, is a native in-memory unicode container and will " "exhibit similar speed to :class:`BytesIO`." msgstr "" -#: ../../library/io.rst:1160 +#: ../../library/io.rst:1162 msgid "Multi-threading" msgstr "" -#: ../../library/io.rst:1162 +#: ../../library/io.rst:1164 msgid "" ":class:`FileIO` objects are thread-safe to the extent that the operating " "system calls (such as :manpage:`read(2)` under Unix) they wrap are thread-" "safe too." msgstr "" -#: ../../library/io.rst:1165 +#: ../../library/io.rst:1167 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) " @@ -1646,15 +1647,15 @@ msgid "" "them from multiple threads at once." msgstr "" -#: ../../library/io.rst:1170 +#: ../../library/io.rst:1172 msgid ":class:`TextIOWrapper` objects are not thread-safe." msgstr "" -#: ../../library/io.rst:1173 +#: ../../library/io.rst:1175 msgid "Reentrancy" msgstr "" -#: ../../library/io.rst:1175 +#: ../../library/io.rst:1177 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) are " @@ -1665,7 +1666,7 @@ msgid "" "from entering the buffered object." msgstr "" -#: ../../library/io.rst:1183 +#: ../../library/io.rst:1185 msgid "" "The above implicitly extends to text files, since the :func:`open()` " "function will wrap a buffered object inside a :class:`TextIOWrapper`. This " @@ -1681,14 +1682,14 @@ msgstr "file object(檔案物件)" msgid "io module" msgstr "io 模組" -#: ../../library/io.rst:971 ../../library/io.rst:1119 +#: ../../library/io.rst:970 ../../library/io.rst:1121 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/io.rst:971 +#: ../../library/io.rst:970 msgid "io.TextIOWrapper class" msgstr "io.TextIOWrapper 類別" -#: ../../library/io.rst:1119 +#: ../../library/io.rst:1121 msgid "io.IncrementalNewlineDecoder class" msgstr "io.IncrementalNewlineDecoder 類別" From 4981b8f5500de6b3f3ec923212749b4fa1514ce1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 31 Aug 2023 00:06:24 +0000 Subject: [PATCH 05/18] sync with cpython 320d3982 --- howto/logging-cookbook.po | 462 ++++++++++++++++++------------------- library/multiprocessing.po | 4 +- library/pickle.po | 249 ++++++++++---------- library/unittest.po | 6 +- 4 files changed, 363 insertions(+), 358 deletions(-) diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index aff058ea1a..31e89a4211 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-31 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -357,9 +357,9 @@ msgstr "" msgid "" "Note that there are some security issues with pickle in some scenarios. If " "these affect you, you can use an alternative serialization scheme by " -"overriding the :meth:`~handlers.SocketHandler.makePickle` method and " -"implementing your alternative there, as well as adapting the above script to " -"use your alternative serialization." +"overriding the :meth:`~SocketHandler.makePickle` method and implementing " +"your alternative there, as well as adapting the above script to use your " +"alternative serialization." msgstr "" #: ../../howto/logging-cookbook.rst:770 @@ -509,11 +509,11 @@ msgid "" "configured ports clash with something else in your test environment." msgstr "" -#: ../../howto/logging-cookbook.rst:841 +#: ../../howto/logging-cookbook.rst:843 msgid "Adding contextual information to your logging output" msgstr "" -#: ../../howto/logging-cookbook.rst:843 +#: ../../howto/logging-cookbook.rst:845 msgid "" "Sometimes you want logging output to contain contextual information in " "addition to the parameters passed to the logging call. For example, in a " @@ -529,11 +529,11 @@ msgid "" "`Logger` instances becomes effectively unbounded." msgstr "" -#: ../../howto/logging-cookbook.rst:858 +#: ../../howto/logging-cookbook.rst:860 msgid "Using LoggerAdapters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:860 +#: ../../howto/logging-cookbook.rst:862 msgid "" "An easy way in which you can pass contextual information to be output along " "with logging event information is to use the :class:`LoggerAdapter` class. " @@ -544,7 +544,7 @@ msgid "" "types of instances interchangeably." msgstr "" -#: ../../howto/logging-cookbook.rst:868 +#: ../../howto/logging-cookbook.rst:870 msgid "" "When you create an instance of :class:`LoggerAdapter`, you pass it a :class:" "`Logger` instance and a dict-like object which contains your contextual " @@ -555,7 +555,7 @@ msgid "" "of :class:`LoggerAdapter`::" msgstr "" -#: ../../howto/logging-cookbook.rst:884 +#: ../../howto/logging-cookbook.rst:886 msgid "" "The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where " "the contextual information is added to the logging output. It's passed the " @@ -568,7 +568,7 @@ msgid "" "be silently overwritten." msgstr "" -#: ../../howto/logging-cookbook.rst:893 +#: ../../howto/logging-cookbook.rst:895 msgid "" "The advantage of using 'extra' is that the values in the dict-like object " "are merged into the :class:`LogRecord` instance's __dict__, allowing you to " @@ -579,21 +579,21 @@ msgid "" "`~LoggerAdapter.process` to do what you need. Here is a simple example::" msgstr "" -#: ../../howto/logging-cookbook.rst:909 +#: ../../howto/logging-cookbook.rst:911 msgid "which you can use like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:914 +#: ../../howto/logging-cookbook.rst:916 msgid "" "Then any events that you log to the adapter will have the value of " "``some_conn_id`` prepended to the log messages." msgstr "" -#: ../../howto/logging-cookbook.rst:918 +#: ../../howto/logging-cookbook.rst:920 msgid "Using objects other than dicts to pass contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:920 +#: ../../howto/logging-cookbook.rst:922 msgid "" "You don't need to pass an actual dict to a :class:`LoggerAdapter` - you " "could pass an instance of a class which implements ``__getitem__`` and " @@ -602,11 +602,11 @@ msgid "" "would be constant)." msgstr "" -#: ../../howto/logging-cookbook.rst:929 +#: ../../howto/logging-cookbook.rst:931 msgid "Using Filters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:931 +#: ../../howto/logging-cookbook.rst:933 msgid "" "You can also add contextual information to log output using a user-defined :" "class:`Filter`. ``Filter`` instances are allowed to modify the " @@ -615,7 +615,7 @@ msgid "" "class:`Formatter`." msgstr "" -#: ../../howto/logging-cookbook.rst:936 +#: ../../howto/logging-cookbook.rst:938 msgid "" "For example in a web application, the request being processed (or at least, " "the interesting parts of it) can be stored in a threadlocal (:class:" @@ -627,15 +627,15 @@ msgid "" "an example script::" msgstr "" -#: ../../howto/logging-cookbook.rst:982 +#: ../../howto/logging-cookbook.rst:984 msgid "which, when run, produces something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:1000 +#: ../../howto/logging-cookbook.rst:1002 msgid "Use of ``contextvars``" msgstr "" -#: ../../howto/logging-cookbook.rst:1002 +#: ../../howto/logging-cookbook.rst:1004 msgid "" "Since Python 3.7, the :mod:`contextvars` module has provided context-local " "storage which works for both :mod:`threading` and :mod:`asyncio` processing " @@ -645,7 +645,7 @@ msgid "" "attributes handled by web applications." msgstr "" -#: ../../howto/logging-cookbook.rst:1008 +#: ../../howto/logging-cookbook.rst:1010 msgid "" "For the purposes of illustration, say that you have different web " "applications, each independent of the other but running in the same Python " @@ -656,18 +656,18 @@ msgid "" "information such as client IP, HTTP request method and client username?" msgstr "" -#: ../../howto/logging-cookbook.rst:1015 +#: ../../howto/logging-cookbook.rst:1017 msgid "Let's assume that the library can be simulated by the following code:" msgstr "" -#: ../../howto/logging-cookbook.rst:1031 +#: ../../howto/logging-cookbook.rst:1033 msgid "" "We can simulate the multiple web applications by means of two simple " "classes, ``Request`` and ``WebApp``. These simulate how real threaded web " "applications work - each request is handled by a thread:" msgstr "" -#: ../../howto/logging-cookbook.rst:1175 +#: ../../howto/logging-cookbook.rst:1177 msgid "" "If you run the above, you should find that roughly half the requests go " "into :file:`app1.log` and the rest into :file:`app2.log`, and the all the " @@ -678,11 +678,11 @@ msgid "" "illustrated by the following shell output:" msgstr "" -#: ../../howto/logging-cookbook.rst:1222 +#: ../../howto/logging-cookbook.rst:1224 msgid "Imparting contextual information in handlers" msgstr "" -#: ../../howto/logging-cookbook.rst:1224 +#: ../../howto/logging-cookbook.rst:1226 msgid "" "Each :class:`~Handler` has its own chain of filters. If you want to add " "contextual information to a :class:`LogRecord` without leaking it to other " @@ -690,11 +690,11 @@ msgid "" "instead of modifying it in-place, as shown in the following script::" msgstr "" -#: ../../howto/logging-cookbook.rst:1251 +#: ../../howto/logging-cookbook.rst:1253 msgid "Logging to a single file from multiple processes" msgstr "" -#: ../../howto/logging-cookbook.rst:1253 +#: ../../howto/logging-cookbook.rst:1255 msgid "" "Although logging is thread-safe, and logging to a single file from multiple " "threads in a single process *is* supported, logging to a single file from " @@ -710,7 +710,7 @@ msgid "" "you to adapt in your own applications." msgstr "" -#: ../../howto/logging-cookbook.rst:1266 +#: ../../howto/logging-cookbook.rst:1268 msgid "" "You could also write your own handler which uses the :class:" "`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " @@ -721,7 +721,7 @@ msgid "" "platforms (see https://bugs.python.org/issue3770)." msgstr "" -#: ../../howto/logging-cookbook.rst:1276 +#: ../../howto/logging-cookbook.rst:1278 msgid "" "Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send " "all logging events to one of the processes in your multi-process " @@ -736,13 +736,13 @@ msgid "" "requirements::" msgstr "" -#: ../../howto/logging-cookbook.rst:1392 +#: ../../howto/logging-cookbook.rst:1394 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "" -#: ../../howto/logging-cookbook.rst:1487 +#: ../../howto/logging-cookbook.rst:1489 msgid "" "This variant shows how you can e.g. apply configuration for particular " "loggers - e.g. the ``foo`` logger has a special handler which stores all " @@ -752,34 +752,34 @@ msgid "" "appropriate destinations." msgstr "" -#: ../../howto/logging-cookbook.rst:1494 +#: ../../howto/logging-cookbook.rst:1496 msgid "Using concurrent.futures.ProcessPoolExecutor" msgstr "" -#: ../../howto/logging-cookbook.rst:1496 +#: ../../howto/logging-cookbook.rst:1498 msgid "" "If you want to use :class:`concurrent.futures.ProcessPoolExecutor` to start " "your worker processes, you need to create the queue slightly differently. " "Instead of" msgstr "" -#: ../../howto/logging-cookbook.rst:1504 +#: ../../howto/logging-cookbook.rst:1506 msgid "you should use" msgstr "" -#: ../../howto/logging-cookbook.rst:1510 +#: ../../howto/logging-cookbook.rst:1512 msgid "and you can then replace the worker creation from this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1521 +#: ../../howto/logging-cookbook.rst:1523 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" -#: ../../howto/logging-cookbook.rst:1528 +#: ../../howto/logging-cookbook.rst:1530 msgid "Deploying Web applications using Gunicorn and uWSGI" msgstr "" -#: ../../howto/logging-cookbook.rst:1530 +#: ../../howto/logging-cookbook.rst:1532 msgid "" "When deploying Web applications using `Gunicorn `_ or " "`uWSGI `_ (or similar), " @@ -791,27 +791,26 @@ msgid "" "listener in production`_ for more details." msgstr "" -#: ../../howto/logging-cookbook.rst:1540 +#: ../../howto/logging-cookbook.rst:1542 msgid "Using file rotation" msgstr "" -#: ../../howto/logging-cookbook.rst:1545 +#: ../../howto/logging-cookbook.rst:1547 msgid "" "Sometimes you want to let a log file grow to a certain size, then open a new " "file and log to that. You may want to keep a certain number of these files, " "and when that many files have been created, rotate the files so that the " "number of files and the size of the files both remain bounded. For this " -"usage pattern, the logging package provides a :class:`~handlers." -"RotatingFileHandler`::" +"usage pattern, the logging package provides a :class:`RotatingFileHandler`::" msgstr "" -#: ../../howto/logging-cookbook.rst:1577 +#: ../../howto/logging-cookbook.rst:1579 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" msgstr "" -#: ../../howto/logging-cookbook.rst:1589 +#: ../../howto/logging-cookbook.rst:1591 msgid "" "The most current file is always :file:`logging_rotatingfile_example.out`, " "and each time it reaches the size limit it is renamed with the suffix " @@ -819,17 +818,17 @@ msgid "" "(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." msgstr "" -#: ../../howto/logging-cookbook.rst:1594 +#: ../../howto/logging-cookbook.rst:1596 msgid "" "Obviously this example sets the log length much too small as an extreme " "example. You would want to set *maxBytes* to an appropriate value." msgstr "" -#: ../../howto/logging-cookbook.rst:1600 +#: ../../howto/logging-cookbook.rst:1604 msgid "Use of alternative formatting styles" msgstr "" -#: ../../howto/logging-cookbook.rst:1602 +#: ../../howto/logging-cookbook.rst:1606 msgid "" "When logging was added to the Python standard library, the only way of " "formatting messages with variable content was to use the %-formatting " @@ -838,7 +837,7 @@ msgid "" "Python 2.6)." msgstr "" -#: ../../howto/logging-cookbook.rst:1608 +#: ../../howto/logging-cookbook.rst:1612 msgid "" "Logging (as of 3.2) provides improved support for these two additional " "formatting styles. The :class:`Formatter` class been enhanced to take an " @@ -851,14 +850,14 @@ msgid "" "session to show the possibilities:" msgstr "" -#: ../../howto/logging-cookbook.rst:1642 +#: ../../howto/logging-cookbook.rst:1646 msgid "" "Note that the formatting of logging messages for final output to logs is " "completely independent of how an individual logging message is constructed. " "That can still use %-formatting, as shown here::" msgstr "" -#: ../../howto/logging-cookbook.rst:1650 +#: ../../howto/logging-cookbook.rst:1654 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -874,7 +873,7 @@ msgid "" "strings." msgstr "" -#: ../../howto/logging-cookbook.rst:1663 +#: ../../howto/logging-cookbook.rst:1667 msgid "" "There is, however, a way that you can use {}- and $- formatting to construct " "your individual log messages. Recall that for a message you can use an " @@ -883,7 +882,7 @@ msgid "" "the following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:1687 +#: ../../howto/logging-cookbook.rst:1691 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -894,21 +893,21 @@ msgid "" "used as a synonym/alias for :func:`gettext.gettext` or its brethren)." msgstr "" -#: ../../howto/logging-cookbook.rst:1695 +#: ../../howto/logging-cookbook.rst:1699 msgid "" "The above classes are not included in Python, though they're easy enough to " "copy and paste into your own code. They can be used as follows (assuming " "that they're declared in a module called ``wherever``):" msgstr "" -#: ../../howto/logging-cookbook.rst:1717 +#: ../../howto/logging-cookbook.rst:1721 msgid "" "While the above examples use ``print()`` to show how the formatting works, " "you would of course use ``logger.debug()`` or similar to actually log using " "this approach." msgstr "" -#: ../../howto/logging-cookbook.rst:1721 +#: ../../howto/logging-cookbook.rst:1725 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -919,23 +918,23 @@ msgid "" "sugar for a constructor call to one of the XXXMessage classes." msgstr "" -#: ../../howto/logging-cookbook.rst:1729 +#: ../../howto/logging-cookbook.rst:1733 msgid "" "If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar " "effect to the above, as in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1760 +#: ../../howto/logging-cookbook.rst:1764 msgid "" "The above script should log the message ``Hello, world!`` when run with " "Python 3.2 or later." msgstr "" -#: ../../howto/logging-cookbook.rst:1769 +#: ../../howto/logging-cookbook.rst:1773 msgid "Customizing ``LogRecord``" msgstr "" -#: ../../howto/logging-cookbook.rst:1771 +#: ../../howto/logging-cookbook.rst:1775 msgid "" "Every logging event is represented by a :class:`LogRecord` instance. When an " "event is logged and not filtered out by a logger's level, a :class:" @@ -946,13 +945,13 @@ msgid "" "was done:" msgstr "" -#: ../../howto/logging-cookbook.rst:1778 +#: ../../howto/logging-cookbook.rst:1782 msgid "" ":meth:`Logger.makeRecord`, which is called in the normal process of logging " "an event. This invoked :class:`LogRecord` directly to create an instance." msgstr "" -#: ../../howto/logging-cookbook.rst:1781 +#: ../../howto/logging-cookbook.rst:1785 msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " @@ -961,27 +960,27 @@ msgid "" "`~handlers.HTTPHandler`)." msgstr "" -#: ../../howto/logging-cookbook.rst:1787 +#: ../../howto/logging-cookbook.rst:1791 msgid "" "This has usually meant that if you need to do anything special with a :class:" "`LogRecord`, you've had to do one of the following." msgstr "" -#: ../../howto/logging-cookbook.rst:1790 +#: ../../howto/logging-cookbook.rst:1794 msgid "" "Create your own :class:`Logger` subclass, which overrides :meth:`Logger." "makeRecord`, and set it using :func:`~logging.setLoggerClass` before any " "loggers that you care about are instantiated." msgstr "" -#: ../../howto/logging-cookbook.rst:1793 +#: ../../howto/logging-cookbook.rst:1797 msgid "" "Add a :class:`Filter` to a logger or handler, which does the necessary " "special manipulation you need when its :meth:`~Filter.filter` method is " "called." msgstr "" -#: ../../howto/logging-cookbook.rst:1797 +#: ../../howto/logging-cookbook.rst:1801 msgid "" "The first approach would be a little unwieldy in the scenario where (say) " "several different libraries wanted to do different things. Each would " @@ -989,7 +988,7 @@ msgid "" "last would win." msgstr "" -#: ../../howto/logging-cookbook.rst:1802 +#: ../../howto/logging-cookbook.rst:1806 msgid "" "The second approach works reasonably well for many cases, but does not allow " "you to e.g. use a specialized subclass of :class:`LogRecord`. Library " @@ -998,7 +997,7 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" -#: ../../howto/logging-cookbook.rst:1810 +#: ../../howto/logging-cookbook.rst:1814 msgid "" "at module level). It's probably one too many things to think about. " "Developers could also add the filter to a :class:`~logging.NullHandler` " @@ -1008,7 +1007,7 @@ msgid "" "developer." msgstr "" -#: ../../howto/logging-cookbook.rst:1816 +#: ../../howto/logging-cookbook.rst:1820 msgid "" "In Python 3.2 and later, :class:`~logging.LogRecord` creation is done " "through a factory, which you can specify. The factory is just a callable you " @@ -1018,7 +1017,7 @@ msgid "" "`LogRecord` is the default setting for the factory." msgstr "" -#: ../../howto/logging-cookbook.rst:1823 +#: ../../howto/logging-cookbook.rst:1827 msgid "" "This approach allows a custom factory to control all aspects of LogRecord " "creation. For example, you could return a subclass, or just add some " @@ -1026,7 +1025,7 @@ msgid "" "this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1836 +#: ../../howto/logging-cookbook.rst:1840 msgid "" "This pattern allows different libraries to chain factories together, and as " "long as they don't overwrite each other's attributes or unintentionally " @@ -1036,70 +1035,70 @@ msgid "" "used when the use of a :class:`Filter` does not provide the desired result." msgstr "" -#: ../../howto/logging-cookbook.rst:1847 +#: ../../howto/logging-cookbook.rst:1852 msgid "Subclassing QueueHandler - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1849 +#: ../../howto/logging-cookbook.rst:1854 msgid "" "You can use a :class:`QueueHandler` subclass to send messages to other kinds " "of queues, for example a ZeroMQ 'publish' socket. In the example below,the " "socket is created separately and passed to the handler (as its 'queue')::" msgstr "" -#: ../../howto/logging-cookbook.rst:1868 +#: ../../howto/logging-cookbook.rst:1873 msgid "" "Of course there are other ways of organizing this, for example passing in " "the data needed by the handler to create the socket::" msgstr "" -#: ../../howto/logging-cookbook.rst:1886 +#: ../../howto/logging-cookbook.rst:1891 msgid "Subclassing QueueListener - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1888 +#: ../../howto/logging-cookbook.rst:1893 msgid "" "You can also subclass :class:`QueueListener` to get messages from other " "kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1907 ../../howto/logging-cookbook.rst:3948 +#: ../../howto/logging-cookbook.rst:1912 ../../howto/logging-cookbook.rst:3955 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:1907 ../../howto/logging-cookbook.rst:3948 +#: ../../howto/logging-cookbook.rst:1912 ../../howto/logging-cookbook.rst:3955 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3951 +#: ../../howto/logging-cookbook.rst:1915 ../../howto/logging-cookbook.rst:3958 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3951 +#: ../../howto/logging-cookbook.rst:1915 ../../howto/logging-cookbook.rst:3958 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3954 +#: ../../howto/logging-cookbook.rst:1918 ../../howto/logging-cookbook.rst:3961 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3954 +#: ../../howto/logging-cookbook.rst:1918 ../../howto/logging-cookbook.rst:3961 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1915 +#: ../../howto/logging-cookbook.rst:1920 msgid ":ref:`A basic logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1917 +#: ../../howto/logging-cookbook.rst:1922 msgid ":ref:`A more advanced logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1921 +#: ../../howto/logging-cookbook.rst:1928 msgid "An example dictionary-based configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:1923 +#: ../../howto/logging-cookbook.rst:1930 msgid "" "Below is an example of a logging configuration dictionary - it's taken from " "the `documentation on the Django project `_ of the Django documentation." msgstr "" -#: ../../howto/logging-cookbook.rst:1986 +#: ../../howto/logging-cookbook.rst:1993 msgid "Using a rotator and namer to customize log rotation processing" msgstr "" -#: ../../howto/logging-cookbook.rst:1988 +#: ../../howto/logging-cookbook.rst:1995 msgid "" "An example of how you can define a namer and rotator is given in the " "following runnable script, which shows gzip compression of the log file::" msgstr "" -#: ../../howto/logging-cookbook.rst:2019 +#: ../../howto/logging-cookbook.rst:2026 msgid "" "After running this, you will see six new files, five of which are compressed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2032 +#: ../../howto/logging-cookbook.rst:2039 msgid "A more elaborate multiprocessing example" msgstr "" -#: ../../howto/logging-cookbook.rst:2034 +#: ../../howto/logging-cookbook.rst:2041 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -1141,7 +1140,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2039 +#: ../../howto/logging-cookbook.rst:2046 msgid "" "In the example, the main process spawns a listener process and some worker " "processes. Each of the main process, the listener and the workers have three " @@ -1154,17 +1153,17 @@ msgid "" "own scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2049 +#: ../../howto/logging-cookbook.rst:2056 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: ../../howto/logging-cookbook.rst:2261 +#: ../../howto/logging-cookbook.rst:2268 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: ../../howto/logging-cookbook.rst:2263 +#: ../../howto/logging-cookbook.rst:2270 msgid "" ":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a " "set of bytes which have the following structure: an optional pure-ASCII " @@ -1173,7 +1172,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: ../../howto/logging-cookbook.rst:2269 +#: ../../howto/logging-cookbook.rst:2276 msgid "" "In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to " "insert a BOM into the message, but unfortunately, it was implemented " @@ -1181,7 +1180,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: ../../howto/logging-cookbook.rst:2275 +#: ../../howto/logging-cookbook.rst:2282 msgid "" "As this behaviour is broken, the incorrect BOM insertion code is being " "removed from Python 3.2.4 and later. However, it is not being replaced, and " @@ -1190,33 +1189,33 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: ../../howto/logging-cookbook.rst:2281 +#: ../../howto/logging-cookbook.rst:2288 msgid "" "Attach a :class:`~logging.Formatter` instance to your :class:`~logging." "handlers.SysLogHandler` instance, with a format string such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2287 +#: ../../howto/logging-cookbook.rst:2294 msgid "" "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as " "a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." msgstr "" -#: ../../howto/logging-cookbook.rst:2290 +#: ../../howto/logging-cookbook.rst:2297 msgid "" "Replace the ASCII section with whatever placeholders you like, but make sure " "that the data that appears in there after substitution is always ASCII (that " "way, it will remain unchanged after UTF-8 encoding)." msgstr "" -#: ../../howto/logging-cookbook.rst:2294 +#: ../../howto/logging-cookbook.rst:2301 msgid "" "Replace the Unicode section with whatever placeholders you like; if the data " "which appears there after substitution contains characters outside the ASCII " "range, that's fine -- it will be encoded using UTF-8." msgstr "" -#: ../../howto/logging-cookbook.rst:2298 +#: ../../howto/logging-cookbook.rst:2305 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -1225,11 +1224,11 @@ msgid "" "daemon may complain." msgstr "" -#: ../../howto/logging-cookbook.rst:2305 +#: ../../howto/logging-cookbook.rst:2312 msgid "Implementing structured logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2307 +#: ../../howto/logging-cookbook.rst:2314 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -1241,31 +1240,31 @@ msgid "" "machine-parseable manner::" msgstr "" -#: ../../howto/logging-cookbook.rst:2331 +#: ../../howto/logging-cookbook.rst:2338 msgid "If the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2337 ../../howto/logging-cookbook.rst:2379 +#: ../../howto/logging-cookbook.rst:2344 ../../howto/logging-cookbook.rst:2386 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: ../../howto/logging-cookbook.rst:2340 +#: ../../howto/logging-cookbook.rst:2347 msgid "" "If you need more specialised processing, you can use a custom JSON encoder, " "as in the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2373 +#: ../../howto/logging-cookbook.rst:2380 msgid "When the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2388 +#: ../../howto/logging-cookbook.rst:2395 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2390 +#: ../../howto/logging-cookbook.rst:2397 msgid "" "There are times when you want to customize logging handlers in particular " "ways, and if you use :func:`dictConfig` you may be able to do this without " @@ -1275,24 +1274,24 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2404 +#: ../../howto/logging-cookbook.rst:2411 msgid "" "You can then specify, in a logging configuration passed to :func:" "`dictConfig`, that a logging handler be created by calling this function::" msgstr "" -#: ../../howto/logging-cookbook.rst:2437 +#: ../../howto/logging-cookbook.rst:2444 msgid "" "In this example I am setting the ownership using the ``pulse`` user and " "group, just for the purposes of illustration. Putting it together into a " "working script, ``chowntest.py``::" msgstr "" -#: ../../howto/logging-cookbook.rst:2484 +#: ../../howto/logging-cookbook.rst:2491 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2494 +#: ../../howto/logging-cookbook.rst:2501 msgid "" "Note that this example uses Python 3.3 because that's where :func:`shutil." "chown` makes an appearance. This approach should work with any Python " @@ -1301,17 +1300,17 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: ../../howto/logging-cookbook.rst:2500 +#: ../../howto/logging-cookbook.rst:2507 msgid "" "In practice, the handler-creating function may be in a utility module " "somewhere in your project. Instead of the line in the configuration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2505 +#: ../../howto/logging-cookbook.rst:2512 msgid "you could use e.g.::" msgstr "" -#: ../../howto/logging-cookbook.rst:2509 +#: ../../howto/logging-cookbook.rst:2516 msgid "" "where ``project.util`` can be replaced with the actual name of the package " "where the function resides. In the above working script, using ``'ext://" @@ -1319,25 +1318,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: ../../howto/logging-cookbook.rst:2514 +#: ../../howto/logging-cookbook.rst:2521 msgid "" "This example hopefully also points the way to how you could implement other " "types of file change - e.g. setting specific POSIX permission bits - in the " "same way, using :func:`os.chmod`." msgstr "" -#: ../../howto/logging-cookbook.rst:2518 +#: ../../howto/logging-cookbook.rst:2525 msgid "" "Of course, the approach could also be extended to types of handler other " "than a :class:`~logging.FileHandler` - for example, one of the rotating file " "handlers, or a different type of handler altogether." msgstr "" -#: ../../howto/logging-cookbook.rst:2528 +#: ../../howto/logging-cookbook.rst:2535 msgid "Using particular formatting styles throughout your application" msgstr "" -#: ../../howto/logging-cookbook.rst:2530 +#: ../../howto/logging-cookbook.rst:2537 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -1348,7 +1347,7 @@ msgid "" "is constructed." msgstr "" -#: ../../howto/logging-cookbook.rst:2537 +#: ../../howto/logging-cookbook.rst:2544 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -1363,7 +1362,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: ../../howto/logging-cookbook.rst:2549 +#: ../../howto/logging-cookbook.rst:2556 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -1371,7 +1370,7 @@ msgid "" "formatting." msgstr "" -#: ../../howto/logging-cookbook.rst:2553 +#: ../../howto/logging-cookbook.rst:2560 msgid "" "For logging to work interoperably between any third-party libraries and your " "code, decisions about formatting need to be made at the level of the " @@ -1379,11 +1378,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: ../../howto/logging-cookbook.rst:2560 +#: ../../howto/logging-cookbook.rst:2567 msgid "Using LogRecord factories" msgstr "" -#: ../../howto/logging-cookbook.rst:2562 +#: ../../howto/logging-cookbook.rst:2569 msgid "" "In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned " "above, the logging package gained the ability to allow users to set their " @@ -1398,17 +1397,17 @@ msgid "" "implementation does." msgstr "" -#: ../../howto/logging-cookbook.rst:2573 +#: ../../howto/logging-cookbook.rst:2580 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: ../../howto/logging-cookbook.rst:2578 +#: ../../howto/logging-cookbook.rst:2585 msgid "Using custom message objects" msgstr "" -#: ../../howto/logging-cookbook.rst:2580 +#: ../../howto/logging-cookbook.rst:2587 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -1418,7 +1417,7 @@ msgid "" "following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:2605 +#: ../../howto/logging-cookbook.rst:2612 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -1429,17 +1428,17 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: ../../howto/logging-cookbook.rst:2613 +#: ../../howto/logging-cookbook.rst:2620 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2627 +#: ../../howto/logging-cookbook.rst:2634 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2634 +#: ../../howto/logging-cookbook.rst:2641 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -1451,11 +1450,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2648 +#: ../../howto/logging-cookbook.rst:2655 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2650 +#: ../../howto/logging-cookbook.rst:2657 msgid "" "You *can* configure filters using :func:`~logging.config.dictConfig`, though " "it might not be obvious at first glance how to do it (hence this recipe). " @@ -1470,22 +1469,22 @@ msgid "" "complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2703 +#: ../../howto/logging-cookbook.rst:2710 msgid "" "This example shows how you can pass configuration data to the callable which " "constructs the instance, in the form of keyword parameters. When run, the " "above script will print:" msgstr "" -#: ../../howto/logging-cookbook.rst:2711 +#: ../../howto/logging-cookbook.rst:2718 msgid "which shows that the filter is working as configured." msgstr "" -#: ../../howto/logging-cookbook.rst:2713 +#: ../../howto/logging-cookbook.rst:2720 msgid "A couple of extra points to note:" msgstr "" -#: ../../howto/logging-cookbook.rst:2715 +#: ../../howto/logging-cookbook.rst:2722 msgid "" "If you can't refer to the callable directly in the configuration (e.g. if it " "lives in a different module, and you can't import it directly where the " @@ -1495,7 +1494,7 @@ msgid "" "the above example." msgstr "" -#: ../../howto/logging-cookbook.rst:2722 +#: ../../howto/logging-cookbook.rst:2729 msgid "" "As well as for filters, this technique can also be used to configure custom " "handlers and formatters. See :ref:`logging-config-dict-userdef` for more " @@ -1504,11 +1503,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2731 +#: ../../howto/logging-cookbook.rst:2738 msgid "Customized exception formatting" msgstr "" -#: ../../howto/logging-cookbook.rst:2733 +#: ../../howto/logging-cookbook.rst:2740 msgid "" "There might be times when you want to do customized exception formatting - " "for argument's sake, let's say you want exactly one line per logged event, " @@ -1516,22 +1515,22 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2774 +#: ../../howto/logging-cookbook.rst:2781 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: ../../howto/logging-cookbook.rst:2781 +#: ../../howto/logging-cookbook.rst:2788 msgid "" "While the above treatment is simplistic, it points the way to how exception " "information can be formatted to your liking. The :mod:`traceback` module may " "be helpful for more specialized needs." msgstr "" -#: ../../howto/logging-cookbook.rst:2788 +#: ../../howto/logging-cookbook.rst:2795 msgid "Speaking logging messages" msgstr "" -#: ../../howto/logging-cookbook.rst:2790 +#: ../../howto/logging-cookbook.rst:2797 msgid "" "There might be situations when it is desirable to have logging messages " "rendered in an audible rather than a visible format. This is easy to do if " @@ -1548,24 +1547,24 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: ../../howto/logging-cookbook.rst:2832 +#: ../../howto/logging-cookbook.rst:2839 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: ../../howto/logging-cookbook.rst:2834 +#: ../../howto/logging-cookbook.rst:2841 msgid "" "The above approach can, of course, be adapted to other TTS systems and even " "other systems altogether which can process messages via external programs " "run from a command line." msgstr "" -#: ../../howto/logging-cookbook.rst:2842 +#: ../../howto/logging-cookbook.rst:2849 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: ../../howto/logging-cookbook.rst:2844 +#: ../../howto/logging-cookbook.rst:2851 msgid "" "There might be situations where you want to log messages in a temporary area " "and only output them if a certain condition occurs. For example, you may " @@ -1575,7 +1574,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: ../../howto/logging-cookbook.rst:2851 +#: ../../howto/logging-cookbook.rst:2858 msgid "" "Here is an example which shows how you could do this using a decorator for " "your functions where you want logging to behave this way. It makes use of " @@ -1588,7 +1587,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: ../../howto/logging-cookbook.rst:2861 +#: ../../howto/logging-cookbook.rst:2868 msgid "" "The example script has a simple function, ``foo``, which just cycles through " "all the logging levels, writing to ``sys.stderr`` to say what level it's " @@ -1597,7 +1596,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: ../../howto/logging-cookbook.rst:2867 +#: ../../howto/logging-cookbook.rst:2874 msgid "" "The script just arranges to decorate ``foo`` with a decorator which will do " "the conditional logging that's required. The decorator takes a logger as a " @@ -1609,30 +1608,30 @@ msgid "" "respectively." msgstr "" -#: ../../howto/logging-cookbook.rst:2875 +#: ../../howto/logging-cookbook.rst:2882 msgid "Here's the script::" msgstr "" -#: ../../howto/logging-cookbook.rst:2938 +#: ../../howto/logging-cookbook.rst:2945 msgid "When this script is run, the following output should be observed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2968 +#: ../../howto/logging-cookbook.rst:2975 msgid "" "As you can see, actual logging output only occurs when an event is logged " "whose severity is ERROR or greater, but in that case, any previous events at " "lower severities are also logged." msgstr "" -#: ../../howto/logging-cookbook.rst:2972 +#: ../../howto/logging-cookbook.rst:2979 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2982 +#: ../../howto/logging-cookbook.rst:2989 msgid "Sending logging messages to email, with buffering" msgstr "" -#: ../../howto/logging-cookbook.rst:2984 +#: ../../howto/logging-cookbook.rst:2991 msgid "" "To illustrate how you can send log messages via email, so that a set number " "of messages are sent per email, you can subclass :class:`~logging.handlers." @@ -1643,7 +1642,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: ../../howto/logging-cookbook.rst:3056 +#: ../../howto/logging-cookbook.rst:3063 msgid "" "If you run this script and your SMTP server is correctly set up, you should " "find that it sends eleven emails to the addressee you specify. The first ten " @@ -1651,17 +1650,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: ../../howto/logging-cookbook.rst:3064 +#: ../../howto/logging-cookbook.rst:3071 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3066 +#: ../../howto/logging-cookbook.rst:3073 msgid "" "Sometimes you want to format times using UTC, which can be done using a " "class such as ``UTCFormatter``, shown below::" msgstr "" -#: ../../howto/logging-cookbook.rst:3075 +#: ../../howto/logging-cookbook.rst:3082 msgid "" "and you can then use the ``UTCFormatter`` in your code instead of :class:" "`~logging.Formatter`. If you want to do that via configuration, you can use " @@ -1669,21 +1668,21 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:3118 +#: ../../howto/logging-cookbook.rst:3125 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:3125 +#: ../../howto/logging-cookbook.rst:3132 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:3132 +#: ../../howto/logging-cookbook.rst:3139 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3134 +#: ../../howto/logging-cookbook.rst:3141 msgid "" "There are times when it would be useful to temporarily change the logging " "configuration and revert it back after doing something. For this, a context " @@ -1693,7 +1692,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:3167 +#: ../../howto/logging-cookbook.rst:3174 msgid "" "If you specify a level value, the logger's level is set to that value in the " "scope of the with block covered by the context manager. If you specify a " @@ -1702,13 +1701,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:3173 +#: ../../howto/logging-cookbook.rst:3180 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:3191 +#: ../../howto/logging-cookbook.rst:3198 msgid "" "We initially set the logger's level to ``INFO``, so message #1 appears and " "message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the " @@ -1721,56 +1720,56 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:3201 +#: ../../howto/logging-cookbook.rst:3208 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:3212 +#: ../../howto/logging-cookbook.rst:3219 msgid "" "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " "following, which is the only message written to ``stdout``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3220 +#: ../../howto/logging-cookbook.rst:3227 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:3230 +#: ../../howto/logging-cookbook.rst:3237 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:3232 +#: ../../howto/logging-cookbook.rst:3239 msgid "" "Of course, the approach described here can be generalised, for example to " "attach logging filters temporarily. Note that the above code works in Python " "2 as well as Python 3." msgstr "" -#: ../../howto/logging-cookbook.rst:3240 +#: ../../howto/logging-cookbook.rst:3247 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:3242 +#: ../../howto/logging-cookbook.rst:3249 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:3244 +#: ../../howto/logging-cookbook.rst:3251 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:3245 +#: ../../howto/logging-cookbook.rst:3252 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:3247 +#: ../../howto/logging-cookbook.rst:3254 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3249 +#: ../../howto/logging-cookbook.rst:3256 msgid "" "Suppose we have a command-line application whose job is to stop, start or " "restart some services. This could be organised for the purposes of " @@ -1781,53 +1780,53 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:3298 +#: ../../howto/logging-cookbook.rst:3305 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3311 +#: ../../howto/logging-cookbook.rst:3318 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:3332 +#: ../../howto/logging-cookbook.rst:3339 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3353 +#: ../../howto/logging-cookbook.rst:3360 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3366 +#: ../../howto/logging-cookbook.rst:3373 msgid "" "The first word is the logging level, and the second word is the module or " "package name of the place where the event was logged." msgstr "" -#: ../../howto/logging-cookbook.rst:3369 +#: ../../howto/logging-cookbook.rst:3376 msgid "" "If we change the logging level, then we can change the information sent to " "the log. For example, if we want more information:" msgstr "" -#: ../../howto/logging-cookbook.rst:3386 +#: ../../howto/logging-cookbook.rst:3393 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3394 +#: ../../howto/logging-cookbook.rst:3401 msgid "" "In this case, the commands don't print anything to the console, since " "nothing at ``WARNING`` level or above is logged by them." msgstr "" -#: ../../howto/logging-cookbook.rst:3400 +#: ../../howto/logging-cookbook.rst:3407 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3402 +#: ../../howto/logging-cookbook.rst:3409 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" @@ -1835,7 +1834,7 @@ msgid "" "project/PySide2/>`_ or `PyQt5 `_ libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3408 +#: ../../howto/logging-cookbook.rst:3415 msgid "" "The following example shows how to log to a Qt GUI. This introduces a simple " "``QtHandler`` class which takes a callable, which should be a slot in the " @@ -1845,14 +1844,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3415 +#: ../../howto/logging-cookbook.rst:3422 msgid "" "The worker thread is implemented using Qt's ``QThread`` class rather than " "the :mod:`threading` module, as there are circumstances where one has to use " "``QThread``, which offers better integration with other ``Qt`` components." msgstr "" -#: ../../howto/logging-cookbook.rst:3419 +#: ../../howto/logging-cookbook.rst:3426 msgid "" "The code should work with recent releases of either ``PySide2`` or " "``PyQt5``. You should be able to adapt the approach to earlier versions of " @@ -1860,11 +1859,11 @@ msgid "" "information." msgstr "" -#: ../../howto/logging-cookbook.rst:3633 +#: ../../howto/logging-cookbook.rst:3640 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3635 +#: ../../howto/logging-cookbook.rst:3642 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "default to use the older :rfc:`3164`, which hails from 2001. When " @@ -1874,14 +1873,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3642 +#: ../../howto/logging-cookbook.rst:3649 msgid "" "RFC 5424 contains some useful features such as support for structured data, " "and if you need to be able to log to a syslog server with support for it, " "you can do so with a subclassed handler which looks something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3708 +#: ../../howto/logging-cookbook.rst:3715 msgid "" "You'll need to be familiar with RFC 5424 to fully understand the above code, " "and it may be that you have slightly different needs (e.g. for how you pass " @@ -1890,11 +1889,11 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3722 +#: ../../howto/logging-cookbook.rst:3729 msgid "How to treat a logger like an output stream" msgstr "" -#: ../../howto/logging-cookbook.rst:3724 +#: ../../howto/logging-cookbook.rst:3731 msgid "" "Sometimes, you need to interface to a third-party API which expects a file-" "like object to write to, but you want to direct the API's output to a " @@ -1902,17 +1901,17 @@ msgid "" "API. Here's a short script illustrating such a class:" msgstr "" -#: ../../howto/logging-cookbook.rst:3764 +#: ../../howto/logging-cookbook.rst:3771 msgid "When this script is run, it prints" msgstr "" -#: ../../howto/logging-cookbook.rst:3771 +#: ../../howto/logging-cookbook.rst:3778 msgid "" "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." "stderr`` by doing something like this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3781 +#: ../../howto/logging-cookbook.rst:3788 msgid "" "You should do this *after* configuring logging for your needs. In the above " "example, the :func:`~logging.basicConfig` call does this (using the ``sys." @@ -1920,25 +1919,25 @@ msgid "" "Then, you'd get this kind of result:" msgstr "" -#: ../../howto/logging-cookbook.rst:3794 +#: ../../howto/logging-cookbook.rst:3801 msgid "" "Of course, the examples above show output according to the format used by :" "func:`~logging.basicConfig`, but you can use a different formatter when you " "configure logging." msgstr "" -#: ../../howto/logging-cookbook.rst:3798 +#: ../../howto/logging-cookbook.rst:3805 msgid "" "Note that with the above scheme, you are somewhat at the mercy of buffering " "and the sequence of write calls which you are intercepting. For example, " "with the definition of ``LoggerWriter`` above, if you have the snippet" msgstr "" -#: ../../howto/logging-cookbook.rst:3807 +#: ../../howto/logging-cookbook.rst:3814 msgid "then running the script results in" msgstr "" -#: ../../howto/logging-cookbook.rst:3825 +#: ../../howto/logging-cookbook.rst:3832 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes multiple writes, each of which results " @@ -1948,17 +1947,17 @@ msgid "" "``LoggerWriter``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3850 +#: ../../howto/logging-cookbook.rst:3857 msgid "" "This just buffers up stuff until a newline is seen, and then logs complete " "lines. With this approach, you get better output:" msgstr "" -#: ../../howto/logging-cookbook.rst:3866 +#: ../../howto/logging-cookbook.rst:3873 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:3868 +#: ../../howto/logging-cookbook.rst:3875 msgid "" "Although the preceding sections have described ways of doing things you " "might need to do or deal with, it is worth mentioning some usage patterns " @@ -1966,11 +1965,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:3874 +#: ../../howto/logging-cookbook.rst:3881 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:3876 +#: ../../howto/logging-cookbook.rst:3883 msgid "" "On Windows, you will generally not be able to open the same file multiple " "times as this will lead to a \"file is in use by another process\" error. " @@ -1978,32 +1977,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:3881 +#: ../../howto/logging-cookbook.rst:3888 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." msgstr "" -#: ../../howto/logging-cookbook.rst:3884 +#: ../../howto/logging-cookbook.rst:3891 msgid "" "Opening two files that look different, as they have different names, but are " "the same because one is a symbolic link to the other." msgstr "" -#: ../../howto/logging-cookbook.rst:3887 +#: ../../howto/logging-cookbook.rst:3894 msgid "" "Forking a process, following which both parent and child have a reference to " "the same file. This might be through use of the :mod:`multiprocessing` " "module, for example." msgstr "" -#: ../../howto/logging-cookbook.rst:3891 +#: ../../howto/logging-cookbook.rst:3898 msgid "" "Opening a file multiple times might *appear* to work most of the time, but " "can lead to a number of problems in practice:" msgstr "" -#: ../../howto/logging-cookbook.rst:3894 +#: ../../howto/logging-cookbook.rst:3901 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -2012,7 +2011,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:3900 +#: ../../howto/logging-cookbook.rst:3907 msgid "" "An attempt to delete a file (e.g. during file rotation) silently fails, " "because there is another reference pointing to it. This can lead to " @@ -2022,17 +2021,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:3907 +#: ../../howto/logging-cookbook.rst:3914 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:3911 +#: ../../howto/logging-cookbook.rst:3918 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:3913 +#: ../../howto/logging-cookbook.rst:3920 msgid "" "While there might be unusual cases where you'll need to do this, in general " "there is no point because loggers are singletons. Code can always access a " @@ -2043,12 +2042,13 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:3922 +#: ../../howto/logging-cookbook.rst:3929 msgid "" -"Adding handlers other than :class:`NullHandler` to a logger in a library" +"Adding handlers other than :class:`~logging.NullHandler` to a logger in a " +"library" msgstr "" -#: ../../howto/logging-cookbook.rst:3924 +#: ../../howto/logging-cookbook.rst:3931 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -2056,11 +2056,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:3930 +#: ../../howto/logging-cookbook.rst:3937 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:3932 +#: ../../howto/logging-cookbook.rst:3939 msgid "" "Loggers are singletons that are never freed during a script execution, and " "so creating lots of loggers will use up memory which can't then be freed. " @@ -2071,14 +2071,14 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:3943 +#: ../../howto/logging-cookbook.rst:3950 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:3956 +#: ../../howto/logging-cookbook.rst:3963 msgid ":ref:`Basic Tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:3958 +#: ../../howto/logging-cookbook.rst:3965 msgid ":ref:`Advanced Tutorial `" msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index df80d4e10b..2d6e9bd948 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-31 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3289,7 +3289,7 @@ msgstr "" #: ../../library/multiprocessing.rst:2990 msgid "" "Make sure that the main module can be safely imported by a new Python " -"interpreter without causing unintended side effects (such a starting a new " +"interpreter without causing unintended side effects (such as starting a new " "process)." msgstr "" diff --git a/library/pickle.po b/library/pickle.po index dfb9a4f3f5..d0cd1ef02a 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-31 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -666,39 +666,41 @@ msgid "The following types can be pickled:" msgstr "" #: ../../library/pickle.rst:497 -msgid "``None``, ``True``, and ``False``;" -msgstr "``None``\\ 、\\ ``True`` 和 ``False``\\ ;" +msgid "" +"built-in constants (``None``, ``True``, ``False``, ``Ellipsis``, and " +"``NotImplemented``);" +msgstr "" -#: ../../library/pickle.rst:499 +#: ../../library/pickle.rst:500 msgid "integers, floating-point numbers, complex numbers;" msgstr "" -#: ../../library/pickle.rst:501 +#: ../../library/pickle.rst:502 msgid "strings, bytes, bytearrays;" msgstr "" -#: ../../library/pickle.rst:503 +#: ../../library/pickle.rst:504 msgid "" "tuples, lists, sets, and dictionaries containing only picklable objects;" msgstr "" -#: ../../library/pickle.rst:505 +#: ../../library/pickle.rst:506 msgid "" "functions (built-in and user-defined) accessible from the top level of a " "module (using :keyword:`def`, not :keyword:`lambda`);" msgstr "" -#: ../../library/pickle.rst:508 +#: ../../library/pickle.rst:509 msgid "classes accessible from the top level of a module;" msgstr "" -#: ../../library/pickle.rst:510 +#: ../../library/pickle.rst:511 msgid "" "instances of such classes whose the result of calling :meth:`__getstate__` " "is picklable (see section :ref:`pickle-inst` for details)." msgstr "" -#: ../../library/pickle.rst:513 +#: ../../library/pickle.rst:514 msgid "" "Attempts to pickle unpicklable objects will raise the :exc:`PicklingError` " "exception; when this happens, an unspecified number of bytes may have " @@ -708,7 +710,7 @@ msgid "" "limit with :func:`sys.setrecursionlimit`." msgstr "" -#: ../../library/pickle.rst:520 +#: ../../library/pickle.rst:521 msgid "" "Note that functions (built-in and user-defined) are pickled by fully :term:" "`qualified name`, not by value. [#]_ This means that only the function name " @@ -719,7 +721,7 @@ msgid "" "exception will be raised. [#]_" msgstr "" -#: ../../library/pickle.rst:527 +#: ../../library/pickle.rst:528 msgid "" "Similarly, classes are pickled by fully qualified name, so the same " "restrictions in the unpickling environment apply. Note that none of the " @@ -727,13 +729,13 @@ msgid "" "attribute ``attr`` is not restored in the unpickling environment::" msgstr "" -#: ../../library/pickle.rst:537 +#: ../../library/pickle.rst:538 msgid "" "These restrictions are why picklable functions and classes must be defined " "at the top level of a module." msgstr "" -#: ../../library/pickle.rst:540 +#: ../../library/pickle.rst:541 msgid "" "Similarly, when class instances are pickled, their class's code and data are " "not pickled along with them. Only the instance data are pickled. This is " @@ -745,17 +747,17 @@ msgid "" "method." msgstr "" -#: ../../library/pickle.rst:552 +#: ../../library/pickle.rst:553 msgid "Pickling Class Instances" msgstr "" -#: ../../library/pickle.rst:556 +#: ../../library/pickle.rst:557 msgid "" "In this section, we describe the general mechanisms available to you to " "define, customize, and control how class instances are pickled and unpickled." msgstr "" -#: ../../library/pickle.rst:559 +#: ../../library/pickle.rst:560 msgid "" "In most cases, no additional code is needed to make instances picklable. By " "default, pickle will retrieve the class and the attributes of an instance " @@ -765,13 +767,13 @@ msgid "" "following code shows an implementation of this behaviour::" msgstr "" -#: ../../library/pickle.rst:574 +#: ../../library/pickle.rst:575 msgid "" "Classes can alter the default behaviour by providing one or several special " "methods:" msgstr "" -#: ../../library/pickle.rst:579 +#: ../../library/pickle.rst:580 msgid "" "In protocols 2 and newer, classes that implements the :meth:" "`__getnewargs_ex__` method can dictate the values passed to the :meth:" @@ -781,37 +783,37 @@ msgid "" "passed to the :meth:`__new__` method upon unpickling." msgstr "" -#: ../../library/pickle.rst:587 +#: ../../library/pickle.rst:588 msgid "" "You should implement this method if the :meth:`__new__` method of your class " "requires keyword-only arguments. Otherwise, it is recommended for " "compatibility to implement :meth:`__getnewargs__`." msgstr "" -#: ../../library/pickle.rst:591 +#: ../../library/pickle.rst:592 msgid ":meth:`__getnewargs_ex__` is now used in protocols 2 and 3." msgstr "" -#: ../../library/pickle.rst:597 +#: ../../library/pickle.rst:598 msgid "" "This method serves a similar purpose as :meth:`__getnewargs_ex__`, but " "supports only positional arguments. It must return a tuple of arguments " "``args`` which will be passed to the :meth:`__new__` method upon unpickling." msgstr "" -#: ../../library/pickle.rst:601 +#: ../../library/pickle.rst:602 msgid "" ":meth:`__getnewargs__` will not be called if :meth:`__getnewargs_ex__` is " "defined." msgstr "" -#: ../../library/pickle.rst:604 +#: ../../library/pickle.rst:605 msgid "" "Before Python 3.6, :meth:`__getnewargs__` was called instead of :meth:" "`__getnewargs_ex__` in protocols 2 and 3." msgstr "" -#: ../../library/pickle.rst:611 +#: ../../library/pickle.rst:612 msgid "" "Classes can further influence how their instances are pickled by overriding " "the method :meth:`__getstate__`. It is called and the returned object is " @@ -819,19 +821,19 @@ msgid "" "are several cases:" msgstr "" -#: ../../library/pickle.rst:616 +#: ../../library/pickle.rst:617 msgid "" "For a class that has no instance :attr:`~object.__dict__` and no :attr:" "`~object.__slots__`, the default state is ``None``." msgstr "" -#: ../../library/pickle.rst:619 +#: ../../library/pickle.rst:620 msgid "" "For a class that has an instance :attr:`~object.__dict__` and no :attr:" "`~object.__slots__`, the default state is ``self.__dict__``." msgstr "" -#: ../../library/pickle.rst:622 +#: ../../library/pickle.rst:623 msgid "" "For a class that has an instance :attr:`~object.__dict__` and :attr:`~object." "__slots__`, the default state is a tuple consisting of two dictionaries: " @@ -839,7 +841,7 @@ msgid "" "slots that have a value are included in the latter." msgstr "" -#: ../../library/pickle.rst:628 +#: ../../library/pickle.rst:629 msgid "" "For a class that has :attr:`~object.__slots__` and no instance :attr:" "`~object.__dict__`, the default state is a tuple whose first item is " @@ -847,13 +849,13 @@ msgid "" "values described in the previous bullet." msgstr "" -#: ../../library/pickle.rst:633 +#: ../../library/pickle.rst:634 msgid "" "Added the default implementation of the ``__getstate__()`` method in the :" "class:`object` class." msgstr "" -#: ../../library/pickle.rst:640 +#: ../../library/pickle.rst:641 msgid "" "Upon unpickling, if the class defines :meth:`__setstate__`, it is called " "with the unpickled state. In that case, there is no requirement for the " @@ -861,19 +863,19 @@ msgid "" "dictionary and its items are assigned to the new instance's dictionary." msgstr "" -#: ../../library/pickle.rst:647 +#: ../../library/pickle.rst:648 msgid "" "If :meth:`__getstate__` returns a false value, the :meth:`__setstate__` " "method will not be called upon unpickling." msgstr "" -#: ../../library/pickle.rst:651 +#: ../../library/pickle.rst:652 msgid "" "Refer to the section :ref:`pickle-state` for more information about how to " "use the methods :meth:`__getstate__` and :meth:`__setstate__`." msgstr "" -#: ../../library/pickle.rst:656 +#: ../../library/pickle.rst:657 msgid "" "At unpickling time, some methods like :meth:`__getattr__`, :meth:" "`__getattribute__`, or :meth:`__setattr__` may be called upon the instance. " @@ -882,7 +884,7 @@ msgid "" "`__init__` is not called when unpickling an instance." msgstr "" -#: ../../library/pickle.rst:665 +#: ../../library/pickle.rst:666 msgid "" "As we shall see, pickle does not use directly the methods described above. " "In fact, these methods are part of the copy protocol which implements the :" @@ -891,7 +893,7 @@ msgid "" "objects. [#]_" msgstr "" -#: ../../library/pickle.rst:671 +#: ../../library/pickle.rst:672 msgid "" "Although powerful, implementing :meth:`__reduce__` directly in your classes " "is error prone. For this reason, class designers should use the high-level " @@ -901,14 +903,14 @@ msgid "" "pickling or both." msgstr "" -#: ../../library/pickle.rst:680 +#: ../../library/pickle.rst:681 msgid "" "The interface is currently defined as follows. The :meth:`__reduce__` " "method takes no argument and shall return either a string or preferably a " "tuple (the returned object is often referred to as the \"reduce value\")." msgstr "" -#: ../../library/pickle.rst:684 +#: ../../library/pickle.rst:685 msgid "" "If a string is returned, the string should be interpreted as the name of a " "global variable. It should be the object's local name relative to its " @@ -916,26 +918,26 @@ msgid "" "object's module. This behaviour is typically useful for singletons." msgstr "" -#: ../../library/pickle.rst:689 +#: ../../library/pickle.rst:690 msgid "" "When a tuple is returned, it must be between two and six items long. " "Optional items can either be omitted, or ``None`` can be provided as their " "value. The semantics of each item are in order:" msgstr "" -#: ../../library/pickle.rst:695 +#: ../../library/pickle.rst:696 msgid "" "A callable object that will be called to create the initial version of the " "object." msgstr "" -#: ../../library/pickle.rst:698 +#: ../../library/pickle.rst:699 msgid "" "A tuple of arguments for the callable object. An empty tuple must be given " "if the callable does not accept any argument." msgstr "" -#: ../../library/pickle.rst:701 +#: ../../library/pickle.rst:702 msgid "" "Optionally, the object's state, which will be passed to the object's :meth:" "`__setstate__` method as previously described. If the object has no such " @@ -943,7 +945,7 @@ msgid "" "object's :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/pickle.rst:706 +#: ../../library/pickle.rst:707 msgid "" "Optionally, an iterator (and not a sequence) yielding successive items. " "These items will be appended to the object either using ``obj.append(item)`` " @@ -955,7 +957,7 @@ msgid "" "must be supported.)" msgstr "" -#: ../../library/pickle.rst:715 +#: ../../library/pickle.rst:716 msgid "" "Optionally, an iterator (not a sequence) yielding successive key-value " "pairs. These items will be stored to the object using ``obj[key] = " @@ -963,7 +965,7 @@ msgid "" "by other classes as long as they implement :meth:`__setitem__`." msgstr "" -#: ../../library/pickle.rst:720 +#: ../../library/pickle.rst:721 msgid "" "Optionally, a callable with a ``(obj, state)`` signature. This callable " "allows the user to programmatically control the state-updating behavior of a " @@ -972,11 +974,11 @@ msgid "" "meth:`__setstate__`." msgstr "" -#: ../../library/pickle.rst:726 +#: ../../library/pickle.rst:727 msgid "The optional sixth tuple item, ``(obj, state)``, was added." msgstr "" -#: ../../library/pickle.rst:732 +#: ../../library/pickle.rst:733 msgid "" "Alternatively, a :meth:`__reduce_ex__` method may be defined. The only " "difference is this method should take a single integer argument, the " @@ -986,11 +988,11 @@ msgid "" "provide backwards-compatible reduce values for older Python releases." msgstr "" -#: ../../library/pickle.rst:744 +#: ../../library/pickle.rst:745 msgid "Persistence of External Objects" msgstr "" -#: ../../library/pickle.rst:750 +#: ../../library/pickle.rst:751 msgid "" "For the benefit of object persistence, the :mod:`pickle` module supports the " "notion of a reference to an object outside the pickled data stream. Such " @@ -999,7 +1001,7 @@ msgid "" "(for any newer protocol)." msgstr "" -#: ../../library/pickle.rst:756 +#: ../../library/pickle.rst:757 msgid "" "The resolution of such persistent IDs is not defined by the :mod:`pickle` " "module; it will delegate this resolution to the user-defined methods on the " @@ -1007,7 +1009,7 @@ msgid "" "persistent_load` respectively." msgstr "" -#: ../../library/pickle.rst:761 +#: ../../library/pickle.rst:762 msgid "" "To pickle objects that have an external persistent ID, the pickler must have " "a custom :meth:`~Pickler.persistent_id` method that takes an object as an " @@ -1018,67 +1020,67 @@ msgid "" "persistent ID." msgstr "" -#: ../../library/pickle.rst:768 +#: ../../library/pickle.rst:769 msgid "" "To unpickle external objects, the unpickler must have a custom :meth:" "`~Unpickler.persistent_load` method that takes a persistent ID object and " "returns the referenced object." msgstr "" -#: ../../library/pickle.rst:772 +#: ../../library/pickle.rst:773 msgid "" "Here is a comprehensive example presenting how persistent ID can be used to " "pickle external objects by reference." msgstr "" -#: ../../library/pickle.rst:780 +#: ../../library/pickle.rst:781 msgid "Dispatch Tables" msgstr "" -#: ../../library/pickle.rst:782 +#: ../../library/pickle.rst:783 msgid "" "If one wants to customize pickling of some classes without disturbing any " "other code which depends on pickling, then one can create a pickler with a " "private dispatch table." msgstr "" -#: ../../library/pickle.rst:786 +#: ../../library/pickle.rst:787 msgid "" "The global dispatch table managed by the :mod:`copyreg` module is available " "as :data:`copyreg.dispatch_table`. Therefore, one may choose to use a " "modified copy of :data:`copyreg.dispatch_table` as a private dispatch table." msgstr "" -#: ../../library/pickle.rst:791 +#: ../../library/pickle.rst:792 msgid "For example ::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/pickle.rst:798 +#: ../../library/pickle.rst:799 msgid "" "creates an instance of :class:`pickle.Pickler` with a private dispatch table " "which handles the ``SomeClass`` class specially. Alternatively, the code ::" msgstr "" -#: ../../library/pickle.rst:808 +#: ../../library/pickle.rst:809 msgid "" "does the same but all instances of ``MyPickler`` will by default share the " "private dispatch table. On the other hand, the code ::" msgstr "" -#: ../../library/pickle.rst:815 +#: ../../library/pickle.rst:816 msgid "" "modifies the global dispatch table shared by all users of the :mod:`copyreg` " "module." msgstr "" -#: ../../library/pickle.rst:820 +#: ../../library/pickle.rst:821 msgid "Handling Stateful Objects" msgstr "" -#: ../../library/pickle.rst:826 +#: ../../library/pickle.rst:827 msgid "" "Here's an example that shows how to modify pickling behavior for a class. " "The :class:`TextReader` class opens a text file, and returns the line number " @@ -1090,15 +1092,15 @@ msgid "" "behavior. ::" msgstr "" -#: ../../library/pickle.rst:872 +#: ../../library/pickle.rst:873 msgid "A sample usage might be something like this::" msgstr "" -#: ../../library/pickle.rst:886 +#: ../../library/pickle.rst:887 msgid "Custom Reduction for Types, Functions, and Other Objects" msgstr "" -#: ../../library/pickle.rst:890 +#: ../../library/pickle.rst:891 msgid "" "Sometimes, :attr:`~Pickler.dispatch_table` may not be flexible enough. In " "particular we may want to customize pickling based on another criterion than " @@ -1106,7 +1108,7 @@ msgid "" "classes." msgstr "" -#: ../../library/pickle.rst:895 +#: ../../library/pickle.rst:896 msgid "" "For those cases, it is possible to subclass from the :class:`Pickler` class " "and implement a :meth:`~Pickler.reducer_override` method. This method can " @@ -1115,14 +1117,14 @@ msgid "" "behavior." msgstr "" -#: ../../library/pickle.rst:900 +#: ../../library/pickle.rst:901 msgid "" "If both the :attr:`~Pickler.dispatch_table` and :meth:`~Pickler." "reducer_override` are defined, then :meth:`~Pickler.reducer_override` method " "takes priority." msgstr "" -#: ../../library/pickle.rst:905 +#: ../../library/pickle.rst:906 msgid "" "For performance reasons, :meth:`~Pickler.reducer_override` may not be called " "for the following objects: ``None``, ``True``, ``False``, and exact " @@ -1131,17 +1133,17 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/pickle.rst:911 +#: ../../library/pickle.rst:912 msgid "" "Here is a simple example where we allow pickling and reconstructing a given " "class::" msgstr "" -#: ../../library/pickle.rst:946 +#: ../../library/pickle.rst:947 msgid "Out-of-band Buffers" msgstr "" -#: ../../library/pickle.rst:950 +#: ../../library/pickle.rst:951 msgid "" "In some contexts, the :mod:`pickle` module is used to transfer massive " "amounts of data. Therefore, it can be important to minimize the number of " @@ -1151,7 +1153,7 @@ msgid "" "involves copying data to and from the pickle stream." msgstr "" -#: ../../library/pickle.rst:957 +#: ../../library/pickle.rst:958 msgid "" "This constraint can be eschewed if both the *provider* (the implementation " "of the object types to be transferred) and the *consumer* (the " @@ -1159,11 +1161,11 @@ msgid "" "transfer facilities provided by pickle protocol 5 and higher." msgstr "" -#: ../../library/pickle.rst:963 +#: ../../library/pickle.rst:964 msgid "Provider API" msgstr "" -#: ../../library/pickle.rst:965 +#: ../../library/pickle.rst:966 msgid "" "The large data objects to be pickled must implement a :meth:`__reduce_ex__` " "method specialized for protocol 5 and higher, which returns a :class:" @@ -1171,7 +1173,7 @@ msgid "" "large data." msgstr "" -#: ../../library/pickle.rst:970 +#: ../../library/pickle.rst:971 msgid "" "A :class:`PickleBuffer` object *signals* that the underlying buffer is " "eligible for out-of-band data transfer. Those objects remain compatible " @@ -1180,17 +1182,17 @@ msgid "" "themselves." msgstr "" -#: ../../library/pickle.rst:977 +#: ../../library/pickle.rst:978 msgid "Consumer API" msgstr "" -#: ../../library/pickle.rst:979 +#: ../../library/pickle.rst:980 msgid "" "A communications system can enable custom handling of the :class:" "`PickleBuffer` objects generated when serializing an object graph." msgstr "" -#: ../../library/pickle.rst:982 +#: ../../library/pickle.rst:983 msgid "" "On the sending side, it needs to pass a *buffer_callback* argument to :class:" "`Pickler` (or to the :func:`dump` or :func:`dumps` function), which will be " @@ -1199,7 +1201,7 @@ msgid "" "copied into the pickle stream, only a cheap marker will be inserted." msgstr "" -#: ../../library/pickle.rst:989 +#: ../../library/pickle.rst:990 msgid "" "On the receiving side, it needs to pass a *buffers* argument to :class:" "`Unpickler` (or to the :func:`load` or :func:`loads` function), which is an " @@ -1210,7 +1212,7 @@ msgid "" "`PickleBuffer` objects." msgstr "" -#: ../../library/pickle.rst:997 +#: ../../library/pickle.rst:998 msgid "" "Between the sending side and the receiving side, the communications system " "is free to implement its own transfer mechanism for out-of-band buffers. " @@ -1218,36 +1220,36 @@ msgid "" "dependent compression." msgstr "" -#: ../../library/pickle.rst:1003 +#: ../../library/pickle.rst:1004 msgid "Example" msgstr "範例" -#: ../../library/pickle.rst:1005 +#: ../../library/pickle.rst:1006 msgid "" "Here is a trivial example where we implement a :class:`bytearray` subclass " "able to participate in out-of-band buffer pickling::" msgstr "" -#: ../../library/pickle.rst:1029 +#: ../../library/pickle.rst:1030 msgid "" "The reconstructor (the ``_reconstruct`` class method) returns the buffer's " "providing object if it has the right type. This is an easy way to simulate " "zero-copy behaviour on this toy example." msgstr "" -#: ../../library/pickle.rst:1033 +#: ../../library/pickle.rst:1034 msgid "" "On the consumer side, we can pickle those objects the usual way, which when " "unserialized will give us a copy of the original object::" msgstr "" -#: ../../library/pickle.rst:1042 +#: ../../library/pickle.rst:1043 msgid "" "But if we pass a *buffer_callback* and then give back the accumulated " "buffers when unserializing, we are able to get back the original object::" msgstr "" -#: ../../library/pickle.rst:1052 +#: ../../library/pickle.rst:1053 msgid "" "This example is limited by the fact that :class:`bytearray` allocates its " "own memory: you cannot create a :class:`bytearray` instance that is backed " @@ -1257,15 +1259,15 @@ msgid "" "processes or systems." msgstr "" -#: ../../library/pickle.rst:1059 +#: ../../library/pickle.rst:1060 msgid ":pep:`574` -- Pickle protocol 5 with out-of-band data" msgstr "" -#: ../../library/pickle.rst:1065 +#: ../../library/pickle.rst:1066 msgid "Restricting Globals" msgstr "" -#: ../../library/pickle.rst:1070 +#: ../../library/pickle.rst:1071 msgid "" "By default, unpickling will import any class or function that it finds in " "the pickle data. For many applications, this behaviour is unacceptable as " @@ -1273,7 +1275,7 @@ msgid "" "what this hand-crafted pickle data stream does when loaded::" msgstr "" -#: ../../library/pickle.rst:1080 +#: ../../library/pickle.rst:1081 msgid "" "In this example, the unpickler imports the :func:`os.system` function and " "then apply the string argument \"echo hello world\". Although this example " @@ -1281,7 +1283,7 @@ msgid "" "system." msgstr "" -#: ../../library/pickle.rst:1084 +#: ../../library/pickle.rst:1085 msgid "" "For this reason, you may want to control what gets unpickled by customizing :" "meth:`Unpickler.find_class`. Unlike its name suggests, :meth:`Unpickler." @@ -1290,17 +1292,17 @@ msgid "" "restrict them to a safe subset." msgstr "" -#: ../../library/pickle.rst:1090 +#: ../../library/pickle.rst:1091 msgid "" "Here is an example of an unpickler allowing only few safe classes from the :" "mod:`builtins` module to be loaded::" msgstr "" -#: ../../library/pickle.rst:1119 +#: ../../library/pickle.rst:1120 msgid "A sample usage of our unpickler working as intended::" msgstr "" -#: ../../library/pickle.rst:1138 +#: ../../library/pickle.rst:1139 msgid "" "As our examples shows, you have to be careful with what you allow to be " "unpickled. Therefore if security is a concern, you may want to consider " @@ -1308,97 +1310,97 @@ msgid "" "party solutions." msgstr "" -#: ../../library/pickle.rst:1145 +#: ../../library/pickle.rst:1146 msgid "Performance" msgstr "" -#: ../../library/pickle.rst:1147 +#: ../../library/pickle.rst:1148 msgid "" "Recent versions of the pickle protocol (from protocol 2 and upwards) feature " "efficient binary encodings for several common features and built-in types. " "Also, the :mod:`pickle` module has a transparent optimizer written in C." msgstr "" -#: ../../library/pickle.rst:1155 +#: ../../library/pickle.rst:1156 msgid "Examples" msgstr "範例" -#: ../../library/pickle.rst:1157 +#: ../../library/pickle.rst:1158 msgid "" "For the simplest code, use the :func:`dump` and :func:`load` functions. ::" msgstr "" -#: ../../library/pickle.rst:1173 +#: ../../library/pickle.rst:1174 msgid "The following example reads the resulting pickled data. ::" msgstr "" -#: ../../library/pickle.rst:1190 +#: ../../library/pickle.rst:1191 msgid "Module :mod:`copyreg`" msgstr ":mod:`copyreg` 模組" -#: ../../library/pickle.rst:1190 +#: ../../library/pickle.rst:1191 msgid "Pickle interface constructor registration for extension types." msgstr "" -#: ../../library/pickle.rst:1193 +#: ../../library/pickle.rst:1194 msgid "Module :mod:`pickletools`" msgstr ":mod:`pickletools` 模組" -#: ../../library/pickle.rst:1193 +#: ../../library/pickle.rst:1194 msgid "Tools for working with and analyzing pickled data." msgstr "" -#: ../../library/pickle.rst:1196 +#: ../../library/pickle.rst:1197 msgid "Module :mod:`shelve`" msgstr ":mod:`shelve` 模組" -#: ../../library/pickle.rst:1196 +#: ../../library/pickle.rst:1197 msgid "Indexed databases of objects; uses :mod:`pickle`." msgstr "" -#: ../../library/pickle.rst:1199 +#: ../../library/pickle.rst:1200 msgid "Module :mod:`copy`" msgstr ":mod:`copy` 模組" -#: ../../library/pickle.rst:1199 +#: ../../library/pickle.rst:1200 msgid "Shallow and deep object copying." msgstr "" -#: ../../library/pickle.rst:1201 +#: ../../library/pickle.rst:1202 msgid "Module :mod:`marshal`" msgstr ":mod:`marshal` 模組" -#: ../../library/pickle.rst:1202 +#: ../../library/pickle.rst:1203 msgid "High-performance serialization of built-in types." msgstr "" -#: ../../library/pickle.rst:1206 +#: ../../library/pickle.rst:1207 msgid "Footnotes" msgstr "註解" -#: ../../library/pickle.rst:1207 +#: ../../library/pickle.rst:1208 msgid "Don't confuse this with the :mod:`marshal` module" msgstr "" -#: ../../library/pickle.rst:1209 +#: ../../library/pickle.rst:1210 msgid "" "This is why :keyword:`lambda` functions cannot be pickled: all :keyword:`!" "lambda` functions share the same name: ````." msgstr "" -#: ../../library/pickle.rst:1212 +#: ../../library/pickle.rst:1213 msgid "" "The exception raised will likely be an :exc:`ImportError` or an :exc:" "`AttributeError` but it could be something else." msgstr "" -#: ../../library/pickle.rst:1215 +#: ../../library/pickle.rst:1216 msgid "" "The :mod:`copy` module uses this protocol for shallow and deep copying " "operations." msgstr "" -#: ../../library/pickle.rst:1218 +#: ../../library/pickle.rst:1219 msgid "" "The limitation on alphanumeric characters is due to the fact that persistent " "IDs in protocol 0 are delimited by the newline character. Therefore if any " @@ -1438,30 +1440,33 @@ msgstr "pickling" msgid "External Data Representation" msgstr "External Data Representation(外部資料表示法)" -#: ../../library/pickle.rst:663 +#: ../../library/pickle.rst:664 msgid "copy" msgstr "copy(複製)" -#: ../../library/pickle.rst:663 +#: ../../library/pickle.rst:664 msgid "protocol" msgstr "protocol(協定)" -#: ../../library/pickle.rst:746 +#: ../../library/pickle.rst:747 msgid "persistent_id (pickle protocol)" msgstr "persistent_id(pickle 協定)" -#: ../../library/pickle.rst:746 +#: ../../library/pickle.rst:747 msgid "persistent_load (pickle protocol)" msgstr "persistent_load(pickle 協定)" -#: ../../library/pickle.rst:822 +#: ../../library/pickle.rst:823 msgid "__getstate__() (copy protocol)" msgstr "__getstate__()(copy 協定)" -#: ../../library/pickle.rst:822 +#: ../../library/pickle.rst:823 msgid "__setstate__() (copy protocol)" msgstr "__setstate__()(copy 協定)" -#: ../../library/pickle.rst:1067 +#: ../../library/pickle.rst:1068 msgid "find_class() (pickle protocol)" msgstr "find_class()(pickle 協定)" + +#~ msgid "``None``, ``True``, and ``False``;" +#~ msgstr "``None``\\ 、\\ ``True`` 和 ``False``\\ ;" diff --git a/library/unittest.po b/library/unittest.po index daf13a07ff..4d7ca66c6a 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-31 00:03+0000\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2426,8 +2426,8 @@ msgstr "" #: ../../library/unittest.rst:2020 msgid "" -"A list containing 2-tuples of :class:`TestCase` instances and floats " -"representing the elapsed time of each test which was run." +"A list containing 2-tuples of test case names and floats representing the " +"elapsed time of each test which was run." msgstr "" #: ../../library/unittest.rst:2027 From 0b65998b726b4ba8b9302a0425793044d64f8420 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 1 Sep 2023 00:05:55 +0000 Subject: [PATCH 06/18] sync with cpython 8c3793a5 --- howto/enum.po | 364 ++++++++++++++-------------- library/threading.po | 32 +-- whatsnew/3.12.po | 555 ++++++++++++++++++++++--------------------- 3 files changed, 486 insertions(+), 465 deletions(-) diff --git a/howto/enum.po b/howto/enum.po index 2c8f289c56..b8dfcac179 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -323,33 +323,41 @@ msgstr "" #: ../../howto/enum.rst:429 msgid "" -"Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` " -"then any value(s) given to the enum member will be passed into those " -"methods. See `Planet`_ for an example." +"Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__`, " +"any value(s) given to the enum member will be passed into those methods. See " +"`Planet`_ for an example." msgstr "" #: ../../howto/enum.rst:435 +msgid "" +"The :meth:`__new__` method, if defined, is used during creation of the Enum " +"members; it is then replaced by Enum's :meth:`__new__` which is used after " +"class creation for lookup of existing members. See :ref:`new-vs-init` for " +"more details." +msgstr "" + +#: ../../howto/enum.rst:442 msgid "Restricted Enum subclassing" msgstr "" -#: ../../howto/enum.rst:437 +#: ../../howto/enum.rst:444 msgid "" "A new :class:`Enum` class must have one base enum class, up to one concrete " "data type, and as many :class:`object`-based mixin classes as needed. The " "order of these base classes is::" msgstr "" -#: ../../howto/enum.rst:444 +#: ../../howto/enum.rst:451 msgid "" "Also, subclassing an enumeration is allowed only if the enumeration does not " "define any members. So this is forbidden::" msgstr "" -#: ../../howto/enum.rst:454 +#: ../../howto/enum.rst:461 msgid "But this is allowed::" msgstr "" -#: ../../howto/enum.rst:465 +#: ../../howto/enum.rst:472 msgid "" "Allowing subclassing of enums that define members would lead to a violation " "of some important invariants of types and instances. On the other hand, it " @@ -357,78 +365,78 @@ msgid "" "enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" -#: ../../howto/enum.rst:474 +#: ../../howto/enum.rst:481 msgid "Dataclass support" msgstr "" -#: ../../howto/enum.rst:476 +#: ../../howto/enum.rst:483 msgid "" "When inheriting from a :class:`~dataclasses.dataclass`, the :meth:`~Enum." "__repr__` omits the inherited class' name. For example::" msgstr "" -#: ../../howto/enum.rst:492 +#: ../../howto/enum.rst:499 msgid "" "Use the :func:`!dataclass` argument ``repr=False`` to use the standard :func:" "`repr`." msgstr "" -#: ../../howto/enum.rst:495 +#: ../../howto/enum.rst:502 msgid "" "Only the dataclass fields are shown in the value area, not the dataclass' " "name." msgstr "" -#: ../../howto/enum.rst:501 +#: ../../howto/enum.rst:508 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:503 +#: ../../howto/enum.rst:510 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:510 +#: ../../howto/enum.rst:517 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -#: ../../howto/enum.rst:516 +#: ../../howto/enum.rst:523 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:519 +#: ../../howto/enum.rst:526 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`__reduce_ex__` in the enumeration class. The default method is by-" "value, but enums with complicated values may want to use by-name::" msgstr "" -#: ../../howto/enum.rst:528 +#: ../../howto/enum.rst:535 msgid "" "Using by-name for flags is not recommended, as unnamed aliases will not " "unpickle." msgstr "" -#: ../../howto/enum.rst:533 +#: ../../howto/enum.rst:540 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:535 +#: ../../howto/enum.rst:542 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:545 +#: ../../howto/enum.rst:552 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: ../../howto/enum.rst:548 +#: ../../howto/enum.rst:555 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -440,14 +448,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:564 +#: ../../howto/enum.rst:571 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -#: ../../howto/enum.rst:568 +#: ../../howto/enum.rst:575 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -456,14 +464,14 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:578 +#: ../../howto/enum.rst:585 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: ../../howto/enum.rst:582 +#: ../../howto/enum.rst:589 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -471,7 +479,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:589 +#: ../../howto/enum.rst:596 msgid "The complete signature is::" msgstr "" @@ -479,7 +487,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../howto/enum.rst:601 +#: ../../howto/enum.rst:608 msgid "What the new enum class will record as its name." msgstr "" @@ -487,21 +495,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../howto/enum.rst:603 +#: ../../howto/enum.rst:610 msgid "" "The enum members. This can be a whitespace- or comma-separated string " "(values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../howto/enum.rst:608 +#: ../../howto/enum.rst:615 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:612 +#: ../../howto/enum.rst:619 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:616 +#: ../../howto/enum.rst:623 msgid "or a mapping::" msgstr "" @@ -509,7 +517,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../howto/enum.rst:620 +#: ../../howto/enum.rst:627 msgid "name of module where new enum class can be found." msgstr "" @@ -517,7 +525,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../howto/enum.rst:622 +#: ../../howto/enum.rst:629 msgid "where in module new enum class can be found." msgstr "" @@ -525,7 +533,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../howto/enum.rst:624 +#: ../../howto/enum.rst:631 msgid "type to mix in to new enum class." msgstr "" @@ -533,23 +541,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../howto/enum.rst:626 +#: ../../howto/enum.rst:633 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:628 +#: ../../howto/enum.rst:635 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:633 +#: ../../howto/enum.rst:640 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:636 +#: ../../howto/enum.rst:643 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:638 +#: ../../howto/enum.rst:645 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -557,22 +565,22 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:659 +#: ../../howto/enum.rst:666 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:672 +#: ../../howto/enum.rst:679 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:683 +#: ../../howto/enum.rst:690 msgid "StrEnum" msgstr "" -#: ../../howto/enum.rst:685 +#: ../../howto/enum.rst:692 msgid "" "The second variation of :class:`Enum` that is provided is also a subclass " "of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " @@ -580,11 +588,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:694 +#: ../../howto/enum.rst:701 msgid "IntFlag" msgstr "" -#: ../../howto/enum.rst:696 +#: ../../howto/enum.rst:703 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -594,60 +602,60 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:704 +#: ../../howto/enum.rst:711 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:707 +#: ../../howto/enum.rst:714 msgid "" "Bit-wise operations that result in invalid :class:`IntFlag` values will lose " "the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" -#: ../../howto/enum.rst:714 +#: ../../howto/enum.rst:721 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:730 +#: ../../howto/enum.rst:737 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:747 +#: ../../howto/enum.rst:754 msgid "" "Named combinations are considered aliases. Aliases do not show up during " "iteration, but can be returned from by-value lookups." msgstr "" -#: ../../howto/enum.rst:752 +#: ../../howto/enum.rst:759 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: ../../howto/enum.rst:760 +#: ../../howto/enum.rst:767 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" -#: ../../howto/enum.rst:771 +#: ../../howto/enum.rst:778 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:777 +#: ../../howto/enum.rst:784 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:786 +#: ../../howto/enum.rst:793 msgid "Flag" msgstr "" -#: ../../howto/enum.rst:788 +#: ../../howto/enum.rst:795 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -657,29 +665,29 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:797 +#: ../../howto/enum.rst:804 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: ../../howto/enum.rst:811 +#: ../../howto/enum.rst:818 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags will not::" msgstr "" -#: ../../howto/enum.rst:823 +#: ../../howto/enum.rst:830 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:837 +#: ../../howto/enum.rst:844 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:847 +#: ../../howto/enum.rst:854 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -690,42 +698,42 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:857 +#: ../../howto/enum.rst:864 msgid "Others" msgstr "" -#: ../../howto/enum.rst:859 +#: ../../howto/enum.rst:866 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:865 +#: ../../howto/enum.rst:872 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: ../../howto/enum.rst:868 +#: ../../howto/enum.rst:875 msgid "Some rules:" msgstr "" -#: ../../howto/enum.rst:870 +#: ../../howto/enum.rst:877 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before :class:" "`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " "above." msgstr "" -#: ../../howto/enum.rst:873 +#: ../../howto/enum.rst:880 msgid "" "Mix-in types must be subclassable. For example, :class:`bool` and :class:" "`range` are not subclassable and will throw an error during Enum creation if " "used as the mix-in type." msgstr "" -#: ../../howto/enum.rst:876 +#: ../../howto/enum.rst:883 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -733,163 +741,169 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:880 +#: ../../howto/enum.rst:887 msgid "" "When another data type is mixed in, the :attr:`value` attribute is *not the " "same* as the enum member itself, although it is equivalent and will compare " "equal." msgstr "" -#: ../../howto/enum.rst:883 +#: ../../howto/enum.rst:890 msgid "" "A ``data type`` is a mixin that defines :meth:`__new__`, or a :class:" "`~dataclasses.dataclass`" msgstr "" -#: ../../howto/enum.rst:885 +#: ../../howto/enum.rst:892 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " "``%h`` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../howto/enum.rst:888 +#: ../../howto/enum.rst:895 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:893 +#: ../../howto/enum.rst:900 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" "`__str__` method has been reset to their data types' :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:899 +#: ../../howto/enum.rst:908 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:901 +#: ../../howto/enum.rst:910 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:905 +#: ../../howto/enum.rst:914 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:932 +#: ../../howto/enum.rst:941 +msgid "" +"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " +"one that is found; instead, use the data type directly." +msgstr "" + +#: ../../howto/enum.rst:946 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:935 +#: ../../howto/enum.rst:949 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:937 +#: ../../howto/enum.rst:951 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:940 +#: ../../howto/enum.rst:954 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../howto/enum.rst:946 +#: ../../howto/enum.rst:960 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:948 +#: ../../howto/enum.rst:962 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:949 +#: ../../howto/enum.rst:963 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:951 +#: ../../howto/enum.rst:965 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:953 +#: ../../howto/enum.rst:967 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../howto/enum.rst:956 +#: ../../howto/enum.rst:970 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:958 +#: ../../howto/enum.rst:972 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:964 +#: ../../howto/enum.rst:978 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:967 +#: ../../howto/enum.rst:981 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../howto/enum.rst:970 +#: ../../howto/enum.rst:984 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:971 +#: ../../howto/enum.rst:985 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:973 +#: ../../howto/enum.rst:987 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:991 +#: ../../howto/enum.rst:1005 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:996 +#: ../../howto/enum.rst:1010 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:998 +#: ../../howto/enum.rst:1012 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:1005 +#: ../../howto/enum.rst:1019 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:1007 +#: ../../howto/enum.rst:1021 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -899,22 +913,22 @@ msgid "" "strongly recommended." msgstr "" -#: ../../howto/enum.rst:1018 +#: ../../howto/enum.rst:1032 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:1020 +#: ../../howto/enum.rst:1034 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:1032 +#: ../../howto/enum.rst:1046 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:1034 +#: ../../howto/enum.rst:1048 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -923,137 +937,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1043 +#: ../../howto/enum.rst:1057 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1047 +#: ../../howto/enum.rst:1061 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1049 +#: ../../howto/enum.rst:1063 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1060 +#: ../../howto/enum.rst:1074 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1062 +#: ../../howto/enum.rst:1076 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1080 +#: ../../howto/enum.rst:1094 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1082 +#: ../../howto/enum.rst:1096 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1093 +#: ../../howto/enum.rst:1107 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1095 +#: ../../howto/enum.rst:1109 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1096 +#: ../../howto/enum.rst:1110 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1097 +#: ../../howto/enum.rst:1111 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1102 +#: ../../howto/enum.rst:1116 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1125 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1130 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1127 +#: ../../howto/enum.rst:1141 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1133 +#: ../../howto/enum.rst:1147 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1142 +#: ../../howto/enum.rst:1156 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1145 +#: ../../howto/enum.rst:1159 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1146 +#: ../../howto/enum.rst:1160 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1147 +#: ../../howto/enum.rst:1161 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1151 +#: ../../howto/enum.rst:1165 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1149 +#: ../../howto/enum.rst:1163 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1150 +#: ../../howto/enum.rst:1164 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1151 +#: ../../howto/enum.rst:1165 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1153 +#: ../../howto/enum.rst:1167 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1161 +#: ../../howto/enum.rst:1175 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1163 +#: ../../howto/enum.rst:1177 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1168 +#: ../../howto/enum.rst:1182 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1170 +#: ../../howto/enum.rst:1184 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1064,11 +1078,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1179 +#: ../../howto/enum.rst:1193 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1181 +#: ../../howto/enum.rst:1195 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1077,11 +1091,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1187 +#: ../../howto/enum.rst:1201 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1189 +#: ../../howto/enum.rst:1203 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1090,37 +1104,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1195 +#: ../../howto/enum.rst:1209 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1197 +#: ../../howto/enum.rst:1211 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1203 +#: ../../howto/enum.rst:1217 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1205 +#: ../../howto/enum.rst:1219 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1211 +#: ../../howto/enum.rst:1225 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1221 +#: ../../howto/enum.rst:1235 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1224 +#: ../../howto/enum.rst:1238 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1128,149 +1142,155 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1231 +#: ../../howto/enum.rst:1245 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1233 +#: ../../howto/enum.rst:1247 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1236 +#: ../../howto/enum.rst:1250 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1237 +#: ../../howto/enum.rst:1251 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1238 +#: ../../howto/enum.rst:1252 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1239 +#: ../../howto/enum.rst:1253 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1242 +#: ../../howto/enum.rst:1256 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1248 +#: ../../howto/enum.rst:1262 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1250 +#: ../../howto/enum.rst:1264 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1262 +#: ../../howto/enum.rst:1276 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1264 +#: ../../howto/enum.rst:1278 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1274 +#: ../../howto/enum.rst:1288 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1290 +#: ../../howto/enum.rst:1304 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1292 +#: ../../howto/enum.rst:1306 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1304 +#: ../../howto/enum.rst:1318 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1306 +#: ../../howto/enum.rst:1320 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1323 +#: ../../howto/enum.rst:1337 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1333 +#: ../../howto/enum.rst:1347 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1352 +#: ../../howto/enum.rst:1366 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1358 +#: ../../howto/enum.rst:1372 +msgid "" +"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " +"one that is found; instead, use the data type directly -- e.g.::" +msgstr "" + +#: ../../howto/enum.rst:1379 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1360 +#: ../../howto/enum.rst:1381 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1394 +#: ../../howto/enum.rst:1415 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1396 +#: ../../howto/enum.rst:1417 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1421 +#: ../../howto/enum.rst:1442 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1427 +#: ../../howto/enum.rst:1448 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1429 +#: ../../howto/enum.rst:1450 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1458 +#: ../../howto/enum.rst:1479 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1460 +#: ../../howto/enum.rst:1481 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1479 +#: ../../howto/enum.rst:1500 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1481 +#: ../../howto/enum.rst:1502 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/library/threading.po b/library/threading.po index 992f2849f1..2d8aba54e4 100644 --- a/library/threading.po +++ b/library/threading.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -346,7 +346,7 @@ msgstr "" #: ../../library/threading.rst:274 msgid "" "For more details and extensive examples, see the documentation string of " -"the :mod:`_threading_local` module: :source:`Lib/_threading_local.py`." +"the :mod:`!_threading_local` module: :source:`Lib/_threading_local.py`." msgstr "" #: ../../library/threading.rst:281 @@ -359,8 +359,8 @@ msgid "" "thread of control. There are two ways to specify the activity: by passing a " "callable object to the constructor, or by overriding the :meth:`~Thread.run` " "method in a subclass. No other methods (except for the constructor) should " -"be overridden in a subclass. In other words, *only* override the :meth:" -"`~Thread.__init__` and :meth:`~Thread.run` methods of this class." +"be overridden in a subclass. In other words, *only* override the " +"``__init__()`` and :meth:`~Thread.run` methods of this class." msgstr "" #: ../../library/threading.rst:290 @@ -440,8 +440,8 @@ msgstr "" #: ../../library/threading.rst:339 msgid "" -"*group* should be ``None``; reserved for future extension when a :class:" -"`ThreadGroup` class is implemented." +"*group* should be ``None``; reserved for future extension when a :class:`!" +"ThreadGroup` class is implemented." msgstr "" #: ../../library/threading.rst:342 @@ -1282,11 +1282,11 @@ msgstr "" #: ../../library/threading.rst:1012 msgid "" -"Timers are started, as with threads, by calling their :meth:`~Timer.start` " -"method. The timer can be stopped (before its action has begun) by calling " -"the :meth:`~Timer.cancel` method. The interval the timer will wait before " -"executing its action may not be exactly the same as the interval specified " -"by the user." +"Timers are started, as with threads, by calling their :meth:`Timer.start " +"` method. The timer can be stopped (before its action has " +"begun) by calling the :meth:`~Timer.cancel` method. The interval the timer " +"will wait before executing its action may not be exactly the same as the " +"interval specified by the user." msgstr "" #: ../../library/threading.rst:1018 @@ -1426,11 +1426,11 @@ msgstr "" #: ../../library/threading.rst:1150 msgid "" -"All of the objects provided by this module that have :meth:`acquire` and :" -"meth:`release` methods can be used as context managers for a :keyword:`with` " -"statement. The :meth:`acquire` method will be called when the block is " -"entered, and :meth:`release` will be called when the block is exited. " -"Hence, the following snippet::" +"All of the objects provided by this module that have ``acquire`` and " +"``release`` methods can be used as context managers for a :keyword:`with` " +"statement. The ``acquire`` method will be called when the block is entered, " +"and ``release`` will be called when the block is exited. Hence, the " +"following snippet::" msgstr "" #: ../../library/threading.rst:1159 diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 90a15a1def..a5b402c852 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-29 00:03+0000\n" +"POT-Creation-Date: 2023-09-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -143,7 +143,7 @@ msgid "" "in :gh:`91058`." msgstr "" -#: ../../whatsnew/3.12.rst:149 ../../whatsnew/3.12.rst:1652 +#: ../../whatsnew/3.12.rst:149 ../../whatsnew/3.12.rst:1653 msgid "New Features" msgstr "新增特性" @@ -1004,7 +1004,7 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:801 ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:801 ../../whatsnew/3.12.rst:1561 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " @@ -1277,7 +1277,7 @@ msgid "" "demos>`_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1009 ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:1009 ../../whatsnew/3.12.rst:1952 msgid "Deprecated" msgstr "已棄用" @@ -1750,7 +1750,7 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1247 ../../whatsnew/3.12.rst:2033 +#: ../../whatsnew/3.12.rst:1247 ../../whatsnew/3.12.rst:2034 msgid "Removed" msgstr "已移除" @@ -1866,164 +1866,165 @@ msgstr "" #: ../../whatsnew/3.12.rst:1315 msgid "" -"``importlib.util.set_package`` has been removed. (Contributed by Brett " -"Cannon in :gh:`65961`.)" +"``importlib.util.set_package``, ``importlib.util.set_loader`` and " +"``importlib.util.module_for_loader`` have all been removed. (Contributed by " +"Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1318 +#: ../../whatsnew/3.12.rst:1319 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1321 +#: ../../whatsnew/3.12.rst:1322 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1324 +#: ../../whatsnew/3.12.rst:1325 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1327 +#: ../../whatsnew/3.12.rst:1328 msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1330 +#: ../../whatsnew/3.12.rst:1331 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1330 +#: ../../whatsnew/3.12.rst:1331 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1332 +#: ../../whatsnew/3.12.rst:1333 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1332 +#: ../../whatsnew/3.12.rst:1333 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1334 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1334 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1335 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1335 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1336 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1336 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1337 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1337 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1338 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1338 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1339 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1339 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1340 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1340 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1341 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1341 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1342 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1342 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1344 +#: ../../whatsnew/3.12.rst:1345 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1359 +#: ../../whatsnew/3.12.rst:1360 msgid "Removed :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1362 msgid "undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1363 +#: ../../whatsnew/3.12.rst:1364 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1365 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1366 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1367 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1368 +#: ../../whatsnew/3.12.rst:1369 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1371 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1374 +#: ../../whatsnew/3.12.rst:1375 msgid "" ":mod:`io`: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2032,14 +2033,14 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1380 +#: ../../whatsnew/3.12.rst:1381 msgid "" ":mod:`locale`: Remove the :func:`!locale.format` function, deprecated in " "Python 3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1385 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2047,27 +2048,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1393 msgid "" ":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " "deprecated in Python 3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1396 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1397 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1399 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1402 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2075,22 +2076,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1406 +#: ../../whatsnew/3.12.rst:1407 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1408 +#: ../../whatsnew/3.12.rst:1409 msgid ":mod:`ssl`:" msgstr "" -#: ../../whatsnew/3.12.rst:1410 +#: ../../whatsnew/3.12.rst:1411 msgid "" "Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " "3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " "by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1414 +#: ../../whatsnew/3.12.rst:1415 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2098,7 +2099,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1420 +#: ../../whatsnew/3.12.rst:1421 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2109,174 +2110,174 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1429 +#: ../../whatsnew/3.12.rst:1430 msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1431 +#: ../../whatsnew/3.12.rst:1432 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1435 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1435 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1435 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1436 +#: ../../whatsnew/3.12.rst:1437 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1437 ../../whatsnew/3.12.rst:1444 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1437 -#: ../../whatsnew/3.12.rst:1438 ../../whatsnew/3.12.rst:1439 -#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1441 -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1437 ../../whatsnew/3.12.rst:1438 +#: ../../whatsnew/3.12.rst:1439 ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1441 ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1443 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1438 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1438 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1438 +#: ../../whatsnew/3.12.rst:1439 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1438 ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1439 ../../whatsnew/3.12.rst:1445 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1440 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1439 ../../whatsnew/3.12.rst:1445 +#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1446 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1441 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1441 ../../whatsnew/3.12.rst:1447 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1441 +#: ../../whatsnew/3.12.rst:1442 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1441 ../../whatsnew/3.12.rst:1447 +#: ../../whatsnew/3.12.rst:1442 ../../whatsnew/3.12.rst:1448 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1443 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1443 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1444 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1443 ../../whatsnew/3.12.rst:1444 -#: ../../whatsnew/3.12.rst:1445 ../../whatsnew/3.12.rst:1446 -#: ../../whatsnew/3.12.rst:1447 ../../whatsnew/3.12.rst:1448 -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1444 ../../whatsnew/3.12.rst:1445 +#: ../../whatsnew/3.12.rst:1446 ../../whatsnew/3.12.rst:1447 +#: ../../whatsnew/3.12.rst:1448 ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1450 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1445 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1445 +#: ../../whatsnew/3.12.rst:1446 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1447 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1447 +#: ../../whatsnew/3.12.rst:1448 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1449 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1449 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1450 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1450 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1451 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1451 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1451 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1453 +#: ../../whatsnew/3.12.rst:1454 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1456 +#: ../../whatsnew/3.12.rst:1457 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1459 +#: ../../whatsnew/3.12.rst:1460 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1464 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1467 msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1469 msgid "" ":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" "`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " @@ -2284,7 +2285,7 @@ msgid "" "`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1473 msgid "" ":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " "method of the pure Python implementation, deprecated in Python 3.10, use " @@ -2293,21 +2294,21 @@ msgid "" "(Contributed by Victor Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1479 msgid "" ":mod:`zipimport`: Remove ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1483 +#: ../../whatsnew/3.12.rst:1484 msgid "" "Removed the ``suspicious`` rule from the documentation Makefile, and removed " "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1488 +#: ../../whatsnew/3.12.rst:1489 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2317,21 +2318,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1499 ../../whatsnew/3.12.rst:1811 +#: ../../whatsnew/3.12.rst:1500 ../../whatsnew/3.12.rst:1812 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1501 +#: ../../whatsnew/3.12.rst:1502 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1505 +#: ../../whatsnew/3.12.rst:1506 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1507 +#: ../../whatsnew/3.12.rst:1508 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2340,7 +2341,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1515 msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -2352,7 +2353,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1523 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2362,21 +2363,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1528 +#: ../../whatsnew/3.12.rst:1529 msgid "" "Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1532 +#: ../../whatsnew/3.12.rst:1533 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1537 +#: ../../whatsnew/3.12.rst:1538 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2384,7 +2385,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1542 +#: ../../whatsnew/3.12.rst:1543 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2396,7 +2397,7 @@ msgid "" "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1552 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2408,14 +2409,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1564 +#: ../../whatsnew/3.12.rst:1565 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1570 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2427,45 +2428,45 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1580 +#: ../../whatsnew/3.12.rst:1581 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1593 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1596 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1598 +#: ../../whatsnew/3.12.rst:1599 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1602 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1604 +#: ../../whatsnew/3.12.rst:1605 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1609 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1610 +#: ../../whatsnew/3.12.rst:1611 msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2474,21 +2475,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1616 +#: ../../whatsnew/3.12.rst:1617 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1621 +#: ../../whatsnew/3.12.rst:1622 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1625 +#: ../../whatsnew/3.12.rst:1626 msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2497,46 +2498,46 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1631 +#: ../../whatsnew/3.12.rst:1632 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1633 +#: ../../whatsnew/3.12.rst:1634 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1634 +#: ../../whatsnew/3.12.rst:1635 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1635 +#: ../../whatsnew/3.12.rst:1636 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1637 +#: ../../whatsnew/3.12.rst:1638 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1640 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1641 +#: ../../whatsnew/3.12.rst:1642 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1646 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1649 +#: ../../whatsnew/3.12.rst:1650 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1655 +#: ../../whatsnew/3.12.rst:1656 msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2544,84 +2545,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1661 +#: ../../whatsnew/3.12.rst:1662 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1663 +#: ../../whatsnew/3.12.rst:1664 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1664 +#: ../../whatsnew/3.12.rst:1665 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1666 +#: ../../whatsnew/3.12.rst:1667 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1668 +#: ../../whatsnew/3.12.rst:1669 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1669 +#: ../../whatsnew/3.12.rst:1670 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1670 +#: ../../whatsnew/3.12.rst:1671 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1672 +#: ../../whatsnew/3.12.rst:1673 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1675 +#: ../../whatsnew/3.12.rst:1676 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1677 +#: ../../whatsnew/3.12.rst:1678 msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1680 +#: ../../whatsnew/3.12.rst:1681 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1682 +#: ../../whatsnew/3.12.rst:1683 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1684 +#: ../../whatsnew/3.12.rst:1685 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1688 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1691 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1693 msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -2629,29 +2630,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1698 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1702 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1703 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1704 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1705 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1707 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -2662,7 +2663,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1715 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2670,32 +2671,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1720 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1723 +#: ../../whatsnew/3.12.rst:1724 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1725 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1725 +#: ../../whatsnew/3.12.rst:1726 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr "" -#: ../../whatsnew/3.12.rst:1727 +#: ../../whatsnew/3.12.rst:1728 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1731 +#: ../../whatsnew/3.12.rst:1732 msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -2703,14 +2704,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1737 +#: ../../whatsnew/3.12.rst:1738 msgid "" "Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " "sets the vectorcall field of a given :c:type:`PyFunctionObject`. " "(Contributed by Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1741 +#: ../../whatsnew/3.12.rst:1742 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2719,28 +2720,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1747 +#: ../../whatsnew/3.12.rst:1748 msgid "" "Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1751 +#: ../../whatsnew/3.12.rst:1752 msgid "" "Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1756 +#: ../../whatsnew/3.12.rst:1757 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1760 +#: ../../whatsnew/3.12.rst:1761 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2750,14 +2751,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1768 +#: ../../whatsnew/3.12.rst:1769 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1772 +#: ../../whatsnew/3.12.rst:1773 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2765,71 +2766,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1777 +#: ../../whatsnew/3.12.rst:1778 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1781 +#: ../../whatsnew/3.12.rst:1782 msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1785 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1785 +#: ../../whatsnew/3.12.rst:1786 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1786 +#: ../../whatsnew/3.12.rst:1787 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1787 +#: ../../whatsnew/3.12.rst:1788 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1788 +#: ../../whatsnew/3.12.rst:1789 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1789 +#: ../../whatsnew/3.12.rst:1790 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1790 +#: ../../whatsnew/3.12.rst:1791 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1791 +#: ../../whatsnew/3.12.rst:1792 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1792 +#: ../../whatsnew/3.12.rst:1793 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1795 +#: ../../whatsnew/3.12.rst:1796 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1794 +#: ../../whatsnew/3.12.rst:1795 msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1797 +#: ../../whatsnew/3.12.rst:1798 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1799 +#: ../../whatsnew/3.12.rst:1800 msgid "" ":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " "and :c:type:`PyInterpreterConfig`, which may be used to create sub-" @@ -2837,27 +2838,27 @@ msgid "" "info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1805 +#: ../../whatsnew/3.12.rst:1806 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1813 +#: ../../whatsnew/3.12.rst:1814 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1816 +#: ../../whatsnew/3.12.rst:1817 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1820 +#: ../../whatsnew/3.12.rst:1821 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2866,7 +2867,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1827 +#: ../../whatsnew/3.12.rst:1828 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -2874,13 +2875,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1832 +#: ../../whatsnew/3.12.rst:1833 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1836 +#: ../../whatsnew/3.12.rst:1837 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -2889,7 +2890,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1842 +#: ../../whatsnew/3.12.rst:1843 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2898,13 +2899,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1848 +#: ../../whatsnew/3.12.rst:1849 msgid "" "Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1852 +#: ../../whatsnew/3.12.rst:1853 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -2918,7 +2919,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1864 +#: ../../whatsnew/3.12.rst:1865 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -2926,7 +2927,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1869 +#: ../../whatsnew/3.12.rst:1870 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -2934,7 +2935,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1874 +#: ../../whatsnew/3.12.rst:1875 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -2942,7 +2943,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1879 +#: ../../whatsnew/3.12.rst:1880 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -2950,25 +2951,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1884 +#: ../../whatsnew/3.12.rst:1885 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1887 +#: ../../whatsnew/3.12.rst:1888 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1888 +#: ../../whatsnew/3.12.rst:1889 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1889 +#: ../../whatsnew/3.12.rst:1890 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1891 +#: ../../whatsnew/3.12.rst:1892 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -2976,14 +2977,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1896 +#: ../../whatsnew/3.12.rst:1897 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:1900 +#: ../../whatsnew/3.12.rst:1901 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -2992,17 +2993,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1907 +#: ../../whatsnew/3.12.rst:1908 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1909 +#: ../../whatsnew/3.12.rst:1910 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1911 +#: ../../whatsnew/3.12.rst:1912 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3010,20 +3011,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:1916 +#: ../../whatsnew/3.12.rst:1917 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:1920 +#: ../../whatsnew/3.12.rst:1921 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:1923 +#: ../../whatsnew/3.12.rst:1924 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3031,14 +3032,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:1928 +#: ../../whatsnew/3.12.rst:1929 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:1932 +#: ../../whatsnew/3.12.rst:1933 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3049,15 +3050,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:1940 +#: ../../whatsnew/3.12.rst:1941 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr "" -#: ../../whatsnew/3.12.rst:1941 +#: ../../whatsnew/3.12.rst:1942 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr "" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:1944 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3066,281 +3067,281 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:1953 +#: ../../whatsnew/3.12.rst:1954 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:1955 +#: ../../whatsnew/3.12.rst:1956 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:1956 +#: ../../whatsnew/3.12.rst:1957 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:1957 +#: ../../whatsnew/3.12.rst:1958 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:1959 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:1959 +#: ../../whatsnew/3.12.rst:1960 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:1961 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:1962 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:1963 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1964 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:1965 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:1966 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:1967 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1968 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1969 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:1971 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:1972 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:1973 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1973 +#: ../../whatsnew/3.12.rst:1974 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1974 +#: ../../whatsnew/3.12.rst:1975 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:1976 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:1977 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:1979 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1982 +#: ../../whatsnew/3.12.rst:1983 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:1986 msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:1988 +#: ../../whatsnew/3.12.rst:1989 msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:1991 +#: ../../whatsnew/3.12.rst:1992 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" -#: ../../whatsnew/3.12.rst:1993 +#: ../../whatsnew/3.12.rst:1994 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:1995 +#: ../../whatsnew/3.12.rst:1996 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:1998 +#: ../../whatsnew/3.12.rst:1999 msgid "Several items are not exposed from ``Python.h``:" msgstr "" -#: ../../whatsnew/3.12.rst:2000 +#: ../../whatsnew/3.12.rst:2001 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:2001 +#: ../../whatsnew/3.12.rst:2002 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:2002 +#: ../../whatsnew/3.12.rst:2003 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2004 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:2005 +#: ../../whatsnew/3.12.rst:2006 msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2008 +#: ../../whatsnew/3.12.rst:2009 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2013 +#: ../../whatsnew/3.12.rst:2014 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2016 +#: ../../whatsnew/3.12.rst:2017 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2021 +#: ../../whatsnew/3.12.rst:2022 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2024 +#: ../../whatsnew/3.12.rst:2025 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2027 +#: ../../whatsnew/3.12.rst:2028 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2035 +#: ../../whatsnew/3.12.rst:2036 msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``token.h`` header file was only designed to be used by Python " "internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2040 +#: ../../whatsnew/3.12.rst:2041 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2042 +#: ../../whatsnew/3.12.rst:2043 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2043 +#: ../../whatsnew/3.12.rst:2044 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2044 +#: ../../whatsnew/3.12.rst:2045 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2046 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2046 +#: ../../whatsnew/3.12.rst:2047 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2047 +#: ../../whatsnew/3.12.rst:2048 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2048 +#: ../../whatsnew/3.12.rst:2049 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2049 +#: ../../whatsnew/3.12.rst:2050 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2050 +#: ../../whatsnew/3.12.rst:2051 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2052 +#: ../../whatsnew/3.12.rst:2053 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2056 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2058 +#: ../../whatsnew/3.12.rst:2059 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" From 3ea36ae99855b29655fb5bcf826277aaaab96a0e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 2 Sep 2023 00:06:01 +0000 Subject: [PATCH 07/18] sync with cpython 4dc07d2b --- library/ast.po | 8 ++++---- tutorial/classes.po | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/library/ast.po b/library/ast.po index 3d3224d116..42ca2796b4 100644 --- a/library/ast.po +++ b/library/ast.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-02 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -420,8 +420,8 @@ msgstr "" #: ../../library/ast.rst:588 msgid "" -"``keywords`` holds a list of :class:`keyword` objects representing arguments " -"passed by keyword." +"``keywords`` holds a list of :class:`.keyword` objects representing " +"arguments passed by keyword." msgstr "" #: ../../library/ast.rst:591 @@ -959,7 +959,7 @@ msgstr "" #: ../../library/ast.rst:2027 msgid "" -"``keywords`` is a list of :class:`keyword` nodes, principally for " +"``keywords`` is a list of :class:`.keyword` nodes, principally for " "'metaclass'. Other keywords will be passed to the metaclass, as per " "`PEP-3115 `_." msgstr "" diff --git a/tutorial/classes.po b/tutorial/classes.po index c7e6db0e8f..8f2b1af576 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-22 00:03+0000\n" +"POT-Creation-Date: 2023-09-02 00:03+0000\n" "PO-Revision-Date: 2022-12-26 23:12+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -471,11 +471,12 @@ msgstr "" "::" #: ../../tutorial/classes.rst:276 +#, fuzzy msgid "" "then ``MyClass.i`` and ``MyClass.f`` are valid attribute references, " "returning an integer and a function object, respectively. Class attributes " "can also be assigned to, so you can change the value of ``MyClass.i`` by " -"assignment. :attr:`__doc__` is also a valid attribute, returning the " +"assignment. :attr:`!__doc__` is also a valid attribute, returning the " "docstring belonging to the class: ``\"A simple example class\"``." msgstr "" "那麼 ``MyClass.i`` 和 ``MyClass.f`` 都是有效的屬性參照,會分別回傳一個整數和" From 1c26dab14e25af875329933cd4a43caecf9ab8e6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 3 Sep 2023 00:05:47 +0000 Subject: [PATCH 08/18] sync with cpython dcaacd90 --- c-api/dict.po | 92 ++- c-api/mapping.po | 61 +- c-api/object.po | 39 +- library/datetime.po | 1148 +++++++++++++++-------------- library/unittest.mock-examples.po | 115 +-- library/uuid.po | 183 ++--- tutorial/appendix.po | 12 +- 7 files changed, 843 insertions(+), 807 deletions(-) diff --git a/c-api/dict.po b/c-api/dict.po index 5f484c64d1..f2083a7490 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -87,15 +87,14 @@ msgid "" "to *val*." msgstr "" -#: ../../c-api/dict.rst:75 +#: ../../c-api/dict.rst:73 msgid "" -"Insert *val* into the dictionary *p* using *key* as a key. *key* should be " -"a :c:expr:`const char*` UTF-8 encoded bytes string. The key object is " -"created using ``PyUnicode_FromString(key)``. Return ``0`` on success or " -"``-1`` on failure. This function *does not* steal a reference to *val*." +"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a :c:" +"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:83 +#: ../../c-api/dict.rst:80 msgid "" "Remove the entry in dictionary *p* with key *key*. *key* must be :term:" "`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not in the " @@ -103,47 +102,47 @@ msgid "" "failure." msgstr "" -#: ../../c-api/dict.rst:91 +#: ../../c-api/dict.rst:88 msgid "" -"Remove the entry in dictionary *p* which has a key specified by the UTF-8 " -"encoded bytes string *key*. If *key* is not in the dictionary, :exc:" -"`KeyError` is raised. Return ``0`` on success or ``-1`` on failure." +"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as a :c:" +"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:99 +#: ../../c-api/dict.rst:95 msgid "" "Return the object from dictionary *p* which has a key *key*. Return " "``NULL`` if the key *key* is not present, but *without* setting an exception." msgstr "" -#: ../../c-api/dict.rst:104 +#: ../../c-api/dict.rst:100 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods are silently ignored. Prefer the :c:func:" "`PyDict_GetItemWithError` function instead." msgstr "" -#: ../../c-api/dict.rst:108 +#: ../../c-api/dict.rst:104 msgid "" "Calling this API without :term:`GIL` held had been allowed for historical " "reason. It is no longer allowed." msgstr "" -#: ../../c-api/dict.rst:115 +#: ../../c-api/dict.rst:111 msgid "" "Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " "Return ``NULL`` **with** an exception set if an exception occurred. Return " "``NULL`` **without** an exception set if the key wasn't present." msgstr "" -#: ../../c-api/dict.rst:123 +#: ../../c-api/dict.rst:119 msgid "" "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" "expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:129 +#: ../../c-api/dict.rst:125 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods or while creating the temporary :class:`str` object " @@ -151,7 +150,7 @@ msgid "" "function with your own :c:func:`PyUnicode_FromString` *key* instead." msgstr "" -#: ../../c-api/dict.rst:138 +#: ../../c-api/dict.rst:134 msgid "" "This is the same as the Python-level :meth:`dict.setdefault`. If present, " "it returns the value corresponding to *key* from the dictionary *p*. If the " @@ -161,29 +160,29 @@ msgid "" "the insertion." msgstr "" -#: ../../c-api/dict.rst:148 +#: ../../c-api/dict.rst:144 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "" -#: ../../c-api/dict.rst:153 +#: ../../c-api/dict.rst:149 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "" -#: ../../c-api/dict.rst:158 +#: ../../c-api/dict.rst:154 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." msgstr "" -#: ../../c-api/dict.rst:166 +#: ../../c-api/dict.rst:162 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." msgstr "" -#: ../../c-api/dict.rst:172 +#: ../../c-api/dict.rst:168 msgid "" "Iterate over all key-value pairs in the dictionary *p*. The :c:type:" "`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the " @@ -197,21 +196,21 @@ msgid "" "structure is sparse, the offsets are not consecutive." msgstr "" -#: ../../c-api/dict.rst:183 +#: ../../c-api/dict.rst:179 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../c-api/dict.rst:193 +#: ../../c-api/dict.rst:189 msgid "" "The dictionary *p* should not be mutated during iteration. It is safe to " "modify the values of the keys as you iterate over the dictionary, but only " "so long as the set of keys does not change. For example::" msgstr "" -#: ../../c-api/dict.rst:218 +#: ../../c-api/dict.rst:214 msgid "" "Iterate over mapping object *b* adding key-value pairs to dictionary *a*. " "*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` " @@ -221,7 +220,7 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" -#: ../../c-api/dict.rst:228 +#: ../../c-api/dict.rst:224 msgid "" "This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a." "update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back " @@ -230,7 +229,7 @@ msgid "" "exception was raised." msgstr "" -#: ../../c-api/dict.rst:237 +#: ../../c-api/dict.rst:233 msgid "" "Update or merge into dictionary *a*, from the key-value pairs in *seq2*. " "*seq2* must be an iterable object producing iterable objects of length 2, " @@ -239,7 +238,7 @@ msgid "" "if an exception was raised. Equivalent Python (except for the return value)::" msgstr "" -#: ../../c-api/dict.rst:251 +#: ../../c-api/dict.rst:247 msgid "" "Register *callback* as a dictionary watcher. Return a non-negative integer " "id which must be passed to future calls to :c:func:`PyDict_Watch`. In case " @@ -247,21 +246,21 @@ msgid "" "exception." msgstr "" -#: ../../c-api/dict.rst:260 +#: ../../c-api/dict.rst:256 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the " "given *watcher_id* was never registered.)" msgstr "" -#: ../../c-api/dict.rst:268 +#: ../../c-api/dict.rst:264 msgid "" "Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:" "func:`PyDict_AddWatcher` will be called when *dict* is modified or " "deallocated. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:276 +#: ../../c-api/dict.rst:272 msgid "" "Mark dictionary *dict* as no longer watched. The callback granted " "*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " @@ -269,7 +268,7 @@ msgid "" "watched by this watcher. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:285 +#: ../../c-api/dict.rst:281 msgid "" "Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " "``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " @@ -277,11 +276,11 @@ msgid "" "``PyDict_EVENT_DEALLOCATED``." msgstr "" -#: ../../c-api/dict.rst:293 +#: ../../c-api/dict.rst:289 msgid "Type of a dict watcher callback function." msgstr "" -#: ../../c-api/dict.rst:295 +#: ../../c-api/dict.rst:291 msgid "" "If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both " "*key* and *new_value* will be ``NULL``. If *event* is ``PyDict_EVENT_ADDED`` " @@ -290,7 +289,7 @@ msgid "" "dictionary and *new_value* will be ``NULL``." msgstr "" -#: ../../c-api/dict.rst:301 +#: ../../c-api/dict.rst:297 msgid "" "``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another " "dict is merged into it. To maintain efficiency of this operation, per-key " @@ -298,14 +297,14 @@ msgid "" "``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." msgstr "" -#: ../../c-api/dict.rst:307 +#: ../../c-api/dict.rst:303 msgid "" "The callback may inspect but must not modify *dict*; doing so could have " "unpredictable effects, including infinite recursion. Do not trigger Python " "code execution in the callback, as it could modify the dict as a side effect." msgstr "" -#: ../../c-api/dict.rst:311 +#: ../../c-api/dict.rst:307 msgid "" "If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the " "callback to the about-to-be-destroyed dictionary will resurrect it and " @@ -314,20 +313,20 @@ msgid "" "again." msgstr "" -#: ../../c-api/dict.rst:317 +#: ../../c-api/dict.rst:313 msgid "" "Callbacks occur before the notified modification to *dict* takes place, so " "the prior state of *dict* can be inspected." msgstr "" -#: ../../c-api/dict.rst:320 +#: ../../c-api/dict.rst:316 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: ../../c-api/dict.rst:324 +#: ../../c-api/dict.rst:320 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " @@ -344,14 +343,13 @@ msgstr "object(物件)" msgid "dictionary" msgstr "dictionary(字典)" -#: ../../c-api/dict.rst:73 -msgid "PyUnicode_FromString()" -msgstr "PyUnicode_FromString()" - -#: ../../c-api/dict.rst:164 +#: ../../c-api/dict.rst:160 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/dict.rst:164 +#: ../../c-api/dict.rst:160 msgid "len" msgstr "len" + +#~ msgid "PyUnicode_FromString()" +#~ msgstr "PyUnicode_FromString()" diff --git a/c-api/mapping.po b/c-api/mapping.po index cdfeb15ebe..b1d0f462d8 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,33 +45,30 @@ msgstr "" #: ../../c-api/mapping.rst:31 msgid "" -"Return element of *o* corresponding to the string *key* or ``NULL`` on " -"failure. This is the equivalent of the Python expression ``o[key]``. See " -"also :c:func:`PyObject_GetItem`." +"This is the same as :c:func:`PyObject_GetItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" #: ../../c-api/mapping.rst:38 msgid "" -"Map the string *key* to the value *v* in object *o*. Returns ``-1`` on " -"failure. This is the equivalent of the Python statement ``o[key] = v``. See " -"also :c:func:`PyObject_SetItem`. This function *does not* steal a reference " -"to *v*." +"This is the same as :c:func:`PyObject_SetItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/mapping.rst:46 -msgid "" -"Remove the mapping for the object *key* from the object *o*. Return ``-1`` " -"on failure. This is equivalent to the Python statement ``del o[key]``. This " -"is an alias of :c:func:`PyObject_DelItem`." +#: ../../c-api/mapping.rst:45 +msgid "This is an alias of :c:func:`PyObject_DelItem`." msgstr "" -#: ../../c-api/mapping.rst:53 +#: ../../c-api/mapping.rst:50 msgid "" -"Remove the mapping for the string *key* from the object *o*. Return ``-1`` " -"on failure. This is equivalent to the Python statement ``del o[key]``." +"This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/mapping.rst:59 ../../c-api/mapping.rst:70 +#: ../../c-api/mapping.rst:57 msgid "" "Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. " "This is equivalent to the Python expression ``key in o``. This function " @@ -80,37 +77,43 @@ msgstr "" #: ../../c-api/mapping.rst:63 msgid "" -"Note that exceptions which occur while calling the :meth:`~object." -"__getitem__` method will get suppressed. To get error reporting use :c:func:" +"Exceptions which occur when this calls :meth:`~object.__getitem__` method " +"are silently ignored. For proper error handling, use :c:func:" "`PyObject_GetItem()` instead." msgstr "" -#: ../../c-api/mapping.rst:74 +#: ../../c-api/mapping.rst:70 +msgid "" +"This is the same as :c:func:`PyMapping_HasKey`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +#: ../../c-api/mapping.rst:76 msgid "" -"Note that exceptions which occur while calling the :meth:`~object." -"__getitem__` method and creating a temporary string object will get " -"suppressed. To get error reporting use :c:func:`PyMapping_GetItemString()` " -"instead." +"Exceptions that occur when this calls :meth:`~object.__getitem__` method or " +"while creating the temporary :class:`str` object are silently ignored. For " +"proper error handling, use :c:func:`PyMapping_GetItemString` instead." msgstr "" -#: ../../c-api/mapping.rst:81 +#: ../../c-api/mapping.rst:84 msgid "" "On success, return a list of the keys in object *o*. On failure, return " "``NULL``." msgstr "" -#: ../../c-api/mapping.rst:84 ../../c-api/mapping.rst:93 -#: ../../c-api/mapping.rst:102 +#: ../../c-api/mapping.rst:87 ../../c-api/mapping.rst:96 +#: ../../c-api/mapping.rst:105 msgid "Previously, the function returned a list or a tuple." msgstr "" -#: ../../c-api/mapping.rst:90 +#: ../../c-api/mapping.rst:93 msgid "" "On success, return a list of the values in object *o*. On failure, return " "``NULL``." msgstr "" -#: ../../c-api/mapping.rst:99 +#: ../../c-api/mapping.rst:102 msgid "" "On success, return a list of the items in object *o*, where each item is a " "tuple containing a key-value pair. On failure, return ``NULL``." diff --git a/c-api/object.po b/c-api/object.po index 26c27baa4c..87c4863fc6 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,7 +43,7 @@ msgid "" "the object is written instead of the :func:`repr`." msgstr "" -#: ../../c-api/object.rst:32 ../../c-api/object.rst:45 +#: ../../c-api/object.rst:32 msgid "" "Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " "This is equivalent to the Python expression ``hasattr(o, attr_name)``. This " @@ -57,6 +57,13 @@ msgid "" "handling, use :c:func:`PyObject_GetAttr` instead." msgstr "" +#: ../../c-api/object.rst:45 +msgid "" +"This is the same as :c:func:`PyObject_HasAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + #: ../../c-api/object.rst:51 msgid "" "Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" @@ -74,9 +81,9 @@ msgstr "" #: ../../c-api/object.rst:66 msgid "" -"Retrieve an attribute named *attr_name* from object *o*. Returns the " -"attribute value on success, or ``NULL`` on failure. This is the equivalent " -"of the Python expression ``o.attr_name``." +"This is the same as :c:func:`PyObject_GetAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" #: ../../c-api/object.rst:73 @@ -89,7 +96,7 @@ msgid "" "descriptors don't. Otherwise, an :exc:`AttributeError` is raised." msgstr "" -#: ../../c-api/object.rst:83 ../../c-api/object.rst:95 +#: ../../c-api/object.rst:83 msgid "" "Set the value of the attribute named *attr_name*, for object *o*, to the " "value *v*. Raise an exception and return ``-1`` on failure; return ``0`` on " @@ -103,13 +110,20 @@ msgid "" "plans to remove it." msgstr "" -#: ../../c-api/object.rst:100 +#: ../../c-api/object.rst:95 +msgid "" +"This is the same as :c:func:`PyObject_SetAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +#: ../../c-api/object.rst:99 msgid "" "If *v* is ``NULL``, the attribute is deleted, but this feature is deprecated " "in favour of using :c:func:`PyObject_DelAttrString`." msgstr "" -#: ../../c-api/object.rst:106 +#: ../../c-api/object.rst:105 msgid "" "Generic attribute setter and deleter function that is meant to be put into a " "type object's :c:member:`~PyTypeObject.tp_setattro` slot. It looks for a " @@ -121,12 +135,19 @@ msgid "" "returned." msgstr "" -#: ../../c-api/object.rst:118 ../../c-api/object.rst:124 +#: ../../c-api/object.rst:117 msgid "" "Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on " "failure. This is the equivalent of the Python statement ``del o.attr_name``." msgstr "" +#: ../../c-api/object.rst:123 +msgid "" +"This is the same as :c:func:`PyObject_DelAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + #: ../../c-api/object.rst:130 msgid "" "A generic implementation for the getter of a ``__dict__`` descriptor. It " diff --git a/library/datetime.po b/library/datetime.po index a61def35c8..d185585c26 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,7 +66,7 @@ msgstr ":mod:`zoneinfo` 模組" msgid "Concrete time zones representing the IANA time zone database." msgstr "" -#: ../../library/datetime.rst:37 +#: ../../library/datetime.rst:38 msgid "Package `dateutil `_" msgstr "" @@ -74,17 +74,27 @@ msgstr "" msgid "Third-party library with expanded time zone and parsing support." msgstr "" -#: ../../library/datetime.rst:43 +#: ../../library/datetime.rst:41 +msgid "Package `DateType `_" +msgstr "" + +#: ../../library/datetime.rst:41 +msgid "" +"Third-party library that introduces distinct static types to e.g. allow " +"static type checkers to differentiate between naive and aware datetimes." +msgstr "" + +#: ../../library/datetime.rst:47 msgid "Aware and Naive Objects" msgstr "" -#: ../../library/datetime.rst:45 +#: ../../library/datetime.rst:49 msgid "" "Date and time objects may be categorized as \"aware\" or \"naive\" depending " "on whether or not they include timezone information." msgstr "" -#: ../../library/datetime.rst:48 +#: ../../library/datetime.rst:52 msgid "" "With sufficient knowledge of applicable algorithmic and political time " "adjustments, such as time zone and daylight saving time information, an " @@ -93,7 +103,7 @@ msgid "" "interpretation. [#]_" msgstr "" -#: ../../library/datetime.rst:54 +#: ../../library/datetime.rst:58 msgid "" "A **naive** object does not contain enough information to unambiguously " "locate itself relative to other date/time objects. Whether a naive object " @@ -104,7 +114,7 @@ msgid "" "some aspects of reality." msgstr "" -#: ../../library/datetime.rst:61 +#: ../../library/datetime.rst:65 msgid "" "For applications requiring aware objects, :class:`.datetime` and :class:`." "time` objects have an optional time zone information attribute, :attr:`!" @@ -114,7 +124,7 @@ msgid "" "is in effect." msgstr "" -#: ../../library/datetime.rst:67 +#: ../../library/datetime.rst:71 msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " "supplied by the :mod:`datetime` module. The :class:`timezone` class can " @@ -125,42 +135,42 @@ msgid "" "there is no standard suitable for every application aside from UTC." msgstr "" -#: ../../library/datetime.rst:76 +#: ../../library/datetime.rst:80 msgid "Constants" msgstr "常數" -#: ../../library/datetime.rst:78 +#: ../../library/datetime.rst:82 msgid "The :mod:`datetime` module exports the following constants:" msgstr ":mod:`datetime` 模組匯出以下常數:" -#: ../../library/datetime.rst:82 +#: ../../library/datetime.rst:86 msgid "" "The smallest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MINYEAR` is ``1``." msgstr "" -#: ../../library/datetime.rst:88 +#: ../../library/datetime.rst:92 msgid "" "The largest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MAXYEAR` is ``9999``." msgstr "" -#: ../../library/datetime.rst:93 +#: ../../library/datetime.rst:97 msgid "Alias for the UTC timezone singleton :attr:`datetime.timezone.utc`." msgstr "" -#: ../../library/datetime.rst:98 +#: ../../library/datetime.rst:102 msgid "Available Types" msgstr "" -#: ../../library/datetime.rst:103 +#: ../../library/datetime.rst:107 msgid "" "An idealized naive date, assuming the current Gregorian calendar always was, " "and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, and :" "attr:`day`." msgstr "" -#: ../../library/datetime.rst:111 +#: ../../library/datetime.rst:115 msgid "" "An idealized time, independent of any particular day, assuming that every " "day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap " @@ -168,14 +178,14 @@ msgid "" "attr:`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:120 +#: ../../library/datetime.rst:124 msgid "" "A combination of a date and a time. Attributes: :attr:`year`, :attr:" "`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" "`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:128 +#: ../../library/datetime.rst:132 msgid "" "A duration expressing the difference between two :class:`date`, :class:`." "time`, or :class:`.datetime` instances to microsecond resolution." @@ -183,7 +193,7 @@ msgstr "" "表示兩個 :class:`date`、:class:`.time` 或 :class:`.datetime` 實例之間時間的差" "異,以微秒為解析度。" -#: ../../library/datetime.rst:135 +#: ../../library/datetime.rst:139 msgid "" "An abstract base class for time zone information objects. These are used by " "the :class:`.datetime` and :class:`.time` classes to provide a customizable " @@ -191,158 +201,158 @@ msgid "" "daylight saving time)." msgstr "" -#: ../../library/datetime.rst:143 +#: ../../library/datetime.rst:147 msgid "" "A class that implements the :class:`tzinfo` abstract base class as a fixed " "offset from the UTC." msgstr "" -#: ../../library/datetime.rst:148 ../../library/datetime.rst:166 +#: ../../library/datetime.rst:152 ../../library/datetime.rst:170 msgid "Objects of these types are immutable." msgstr "" -#: ../../library/datetime.rst:150 +#: ../../library/datetime.rst:154 msgid "Subclass relationships::" msgstr "" -#: ../../library/datetime.rst:161 +#: ../../library/datetime.rst:165 msgid "Common Properties" msgstr "常見屬性" -#: ../../library/datetime.rst:163 +#: ../../library/datetime.rst:167 msgid "" "The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` " "types share these common features:" msgstr "" -#: ../../library/datetime.rst:167 +#: ../../library/datetime.rst:171 msgid "" "Objects of these types are :term:`hashable`, meaning that they can be used " "as dictionary keys." msgstr "" -#: ../../library/datetime.rst:169 +#: ../../library/datetime.rst:173 msgid "" "Objects of these types support efficient pickling via the :mod:`pickle` " "module." msgstr "" -#: ../../library/datetime.rst:172 +#: ../../library/datetime.rst:176 msgid "Determining if an Object is Aware or Naive" msgstr "" -#: ../../library/datetime.rst:174 +#: ../../library/datetime.rst:178 msgid "Objects of the :class:`date` type are always naive." msgstr "" -#: ../../library/datetime.rst:176 +#: ../../library/datetime.rst:180 msgid "" "An object of type :class:`.time` or :class:`.datetime` may be aware or naive." msgstr "" -#: ../../library/datetime.rst:178 +#: ../../library/datetime.rst:182 msgid "A :class:`.datetime` object *d* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:180 +#: ../../library/datetime.rst:184 msgid "``d.tzinfo`` is not ``None``" msgstr "``d.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:181 +#: ../../library/datetime.rst:185 msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" msgstr "``d.tzinfo.utcoffset(d)`` 不會回傳 ``None``" -#: ../../library/datetime.rst:183 +#: ../../library/datetime.rst:187 msgid "Otherwise, *d* is naive." msgstr "否則 *d* 會是 naive 的。" -#: ../../library/datetime.rst:185 +#: ../../library/datetime.rst:189 msgid "A :class:`.time` object *t* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:187 +#: ../../library/datetime.rst:191 msgid "``t.tzinfo`` is not ``None``" msgstr "``t.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:188 +#: ../../library/datetime.rst:192 msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." msgstr "``t.tzinfo.utcoffset(None)`` 沒有回傳 ``None``\\ 。" -#: ../../library/datetime.rst:190 +#: ../../library/datetime.rst:194 msgid "Otherwise, *t* is naive." msgstr "" -#: ../../library/datetime.rst:192 +#: ../../library/datetime.rst:196 msgid "" "The distinction between aware and naive doesn't apply to :class:`timedelta` " "objects." msgstr "" -#: ../../library/datetime.rst:198 +#: ../../library/datetime.rst:202 msgid ":class:`timedelta` Objects" msgstr ":class:`timedelta` 物件" -#: ../../library/datetime.rst:200 +#: ../../library/datetime.rst:204 msgid "" "A :class:`timedelta` object represents a duration, the difference between " "two dates or times." msgstr "" "一個 :class:`timedelta` 物件代表著一段持續時間,即兩個日期或時間之間的差異。" -#: ../../library/datetime.rst:205 +#: ../../library/datetime.rst:209 msgid "" "All arguments are optional and default to ``0``. Arguments may be integers " "or floats, and may be positive or negative." msgstr "" -#: ../../library/datetime.rst:208 +#: ../../library/datetime.rst:212 msgid "" "Only *days*, *seconds* and *microseconds* are stored internally. Arguments " "are converted to those units:" msgstr "" -#: ../../library/datetime.rst:211 +#: ../../library/datetime.rst:215 msgid "A millisecond is converted to 1000 microseconds." msgstr "一毫秒會被轉換為 1000 微秒。" -#: ../../library/datetime.rst:212 +#: ../../library/datetime.rst:216 msgid "A minute is converted to 60 seconds." msgstr "一分鐘會被轉換為 60 秒。" -#: ../../library/datetime.rst:213 +#: ../../library/datetime.rst:217 msgid "An hour is converted to 3600 seconds." msgstr "一小時會被轉換為 3600 秒。" -#: ../../library/datetime.rst:214 +#: ../../library/datetime.rst:218 msgid "A week is converted to 7 days." msgstr "一週會被轉換為 7 天。" -#: ../../library/datetime.rst:216 +#: ../../library/datetime.rst:220 msgid "" "and days, seconds and microseconds are then normalized so that the " "representation is unique, with" msgstr "" -#: ../../library/datetime.rst:219 +#: ../../library/datetime.rst:223 msgid "``0 <= microseconds < 1000000``" msgstr "``0 <= microseconds < 1000000``" -#: ../../library/datetime.rst:220 +#: ../../library/datetime.rst:224 msgid "``0 <= seconds < 3600*24`` (the number of seconds in one day)" msgstr "" -#: ../../library/datetime.rst:221 +#: ../../library/datetime.rst:225 msgid "``-999999999 <= days <= 999999999``" msgstr "``-999999999 <= days <= 999999999``" -#: ../../library/datetime.rst:223 +#: ../../library/datetime.rst:227 msgid "" "The following example illustrates how any arguments besides *days*, " "*seconds* and *microseconds* are \"merged\" and normalized into those three " "resulting attributes::" msgstr "" -#: ../../library/datetime.rst:241 +#: ../../library/datetime.rst:245 msgid "" "If any argument is a float and there are fractional microseconds, the " "fractional microseconds left over from all arguments are combined and their " @@ -351,281 +361,281 @@ msgid "" "processes are exact (no information is lost)." msgstr "" -#: ../../library/datetime.rst:248 +#: ../../library/datetime.rst:252 msgid "" "If the normalized value of days lies outside the indicated range, :exc:" "`OverflowError` is raised." msgstr "" -#: ../../library/datetime.rst:251 +#: ../../library/datetime.rst:255 msgid "" "Note that normalization of negative values may be surprising at first. For " "example::" msgstr "" -#: ../../library/datetime.rst:260 ../../library/datetime.rst:556 -#: ../../library/datetime.rst:1069 ../../library/datetime.rst:1688 -#: ../../library/datetime.rst:2290 +#: ../../library/datetime.rst:264 ../../library/datetime.rst:560 +#: ../../library/datetime.rst:1073 ../../library/datetime.rst:1692 +#: ../../library/datetime.rst:2294 msgid "Class attributes:" msgstr "類別屬性:" -#: ../../library/datetime.rst:264 +#: ../../library/datetime.rst:268 msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." msgstr "" -#: ../../library/datetime.rst:269 +#: ../../library/datetime.rst:273 msgid "" "The most positive :class:`timedelta` object, ``timedelta(days=999999999, " "hours=23, minutes=59, seconds=59, microseconds=999999)``." msgstr "" -#: ../../library/datetime.rst:275 +#: ../../library/datetime.rst:279 msgid "" "The smallest possible difference between non-equal :class:`timedelta` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:278 +#: ../../library/datetime.rst:282 msgid "" "Note that, because of normalization, ``timedelta.max`` > ``-timedelta.min``. " "``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:281 ../../library/datetime.rst:574 -#: ../../library/datetime.rst:1089 ../../library/datetime.rst:1708 +#: ../../library/datetime.rst:285 ../../library/datetime.rst:578 +#: ../../library/datetime.rst:1093 ../../library/datetime.rst:1712 msgid "Instance attributes (read-only):" msgstr "" -#: ../../library/datetime.rst:284 +#: ../../library/datetime.rst:288 msgid "Attribute" msgstr "屬性" -#: ../../library/datetime.rst:284 +#: ../../library/datetime.rst:288 msgid "Value" msgstr "" -#: ../../library/datetime.rst:286 +#: ../../library/datetime.rst:290 msgid "``days``" msgstr "``days``" -#: ../../library/datetime.rst:286 +#: ../../library/datetime.rst:290 msgid "Between -999999999 and 999999999 inclusive" msgstr "" -#: ../../library/datetime.rst:288 +#: ../../library/datetime.rst:292 msgid "``seconds``" msgstr "``seconds``" -#: ../../library/datetime.rst:288 +#: ../../library/datetime.rst:292 msgid "Between 0 and 86399 inclusive" msgstr "在 0 到 86399 (含)之間" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:294 msgid "``microseconds``" msgstr "``microseconds``" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:294 msgid "Between 0 and 999999 inclusive" msgstr "在 0 到 999999 (含)之間" -#: ../../library/datetime.rst:293 ../../library/datetime.rst:591 -#: ../../library/datetime.rst:1142 +#: ../../library/datetime.rst:297 ../../library/datetime.rst:595 +#: ../../library/datetime.rst:1146 msgid "Supported operations:" msgstr "" -#: ../../library/datetime.rst:298 ../../library/datetime.rst:594 -#: ../../library/datetime.rst:1145 +#: ../../library/datetime.rst:302 ../../library/datetime.rst:598 +#: ../../library/datetime.rst:1149 msgid "Operation" msgstr "" -#: ../../library/datetime.rst:298 ../../library/datetime.rst:594 -#: ../../library/datetime.rst:1145 +#: ../../library/datetime.rst:302 ../../library/datetime.rst:598 +#: ../../library/datetime.rst:1149 msgid "Result" msgstr "" -#: ../../library/datetime.rst:300 +#: ../../library/datetime.rst:304 msgid "``t1 = t2 + t3``" msgstr "``t1 = t2 + t3``" -#: ../../library/datetime.rst:300 +#: ../../library/datetime.rst:304 msgid "" "Sum of *t2* and *t3*. Afterwards *t1*-*t2* == *t3* and *t1*-*t3* == *t2* are " "true. (1)" msgstr "" -#: ../../library/datetime.rst:303 +#: ../../library/datetime.rst:307 msgid "``t1 = t2 - t3``" msgstr "``t1 = t2 - t3``" -#: ../../library/datetime.rst:303 +#: ../../library/datetime.rst:307 msgid "" "Difference of *t2* and *t3*. Afterwards *t1* == *t2* - *t3* and *t2* == *t1* " "+ *t3* are true. (1)(6)" msgstr "" -#: ../../library/datetime.rst:307 +#: ../../library/datetime.rst:311 msgid "``t1 = t2 * i or t1 = i * t2``" msgstr "``t1 = t2 * i or t1 = i * t2``" -#: ../../library/datetime.rst:307 +#: ../../library/datetime.rst:311 msgid "" "Delta multiplied by an integer. Afterwards *t1* // i == *t2* is true, " "provided ``i != 0``." msgstr "" -#: ../../library/datetime.rst:311 +#: ../../library/datetime.rst:315 msgid "In general, *t1* \\* i == *t1* \\* (i-1) + *t1* is true. (1)" msgstr "" -#: ../../library/datetime.rst:314 +#: ../../library/datetime.rst:318 msgid "``t1 = t2 * f or t1 = f * t2``" msgstr "``t1 = t2 * f or t1 = f * t2``" -#: ../../library/datetime.rst:314 +#: ../../library/datetime.rst:318 msgid "" "Delta multiplied by a float. The result is rounded to the nearest multiple " "of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:322 msgid "``f = t2 / t3``" msgstr "``f = t2 / t3``" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:322 msgid "" "Division (3) of overall duration *t2* by interval unit *t3*. Returns a :" "class:`float` object." msgstr "" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:326 msgid "``t1 = t2 / f or t1 = t2 / i``" msgstr "``t1 = t2 / f or t1 = t2 / i``" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:326 msgid "" "Delta divided by a float or an int. The result is rounded to the nearest " "multiple of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:330 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" msgstr "``t1 = t2 // i`` or ``t1 = t2 // t3``" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:330 msgid "" "The floor is computed and the remainder (if any) is thrown away. In the " "second case, an integer is returned. (3)" msgstr "" -#: ../../library/datetime.rst:330 +#: ../../library/datetime.rst:334 msgid "``t1 = t2 % t3``" msgstr "``t1 = t2 % t3``" -#: ../../library/datetime.rst:330 +#: ../../library/datetime.rst:334 msgid "The remainder is computed as a :class:`timedelta` object. (3)" msgstr "" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:337 msgid "``q, r = divmod(t1, t2)``" msgstr "``q, r = divmod(t1, t2)``" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:337 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " "t2``. q is an integer and r is a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:338 +#: ../../library/datetime.rst:342 msgid "``+t1``" msgstr "``+t1``" -#: ../../library/datetime.rst:338 +#: ../../library/datetime.rst:342 msgid "Returns a :class:`timedelta` object with the same value. (2)" msgstr "" -#: ../../library/datetime.rst:341 +#: ../../library/datetime.rst:345 msgid "``-t1``" msgstr "``-t1``" -#: ../../library/datetime.rst:341 +#: ../../library/datetime.rst:345 msgid "" "equivalent to :class:`timedelta`\\ (-*t1.days*, -*t1.seconds*, -*t1." "microseconds*), and to *t1*\\* -1. (1)(4)" msgstr "" -#: ../../library/datetime.rst:346 +#: ../../library/datetime.rst:350 msgid "``abs(t)``" msgstr "``abs(t)``" -#: ../../library/datetime.rst:346 +#: ../../library/datetime.rst:350 msgid "" "equivalent to +\\ *t* when ``t.days >= 0``, and to -*t* when ``t.days < 0``. " "(2)" msgstr "" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:353 msgid "``str(t)``" msgstr "``str(t)``" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:353 msgid "" "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " "negative for negative ``t``. (5)" msgstr "" -#: ../../library/datetime.rst:353 +#: ../../library/datetime.rst:357 msgid "``repr(t)``" msgstr "``repr(t)``" -#: ../../library/datetime.rst:353 +#: ../../library/datetime.rst:357 msgid "" "Returns a string representation of the :class:`timedelta` object as a " "constructor call with canonical attribute values." msgstr "" -#: ../../library/datetime.rst:359 ../../library/datetime.rst:608 -#: ../../library/datetime.rst:2521 +#: ../../library/datetime.rst:363 ../../library/datetime.rst:612 +#: ../../library/datetime.rst:2525 msgid "Notes:" msgstr "註解:" -#: ../../library/datetime.rst:362 +#: ../../library/datetime.rst:366 msgid "This is exact but may overflow." msgstr "這是精確的,但可能會溢位。" -#: ../../library/datetime.rst:365 +#: ../../library/datetime.rst:369 msgid "This is exact and cannot overflow." msgstr "這是精確的,且不會溢位。" -#: ../../library/datetime.rst:368 +#: ../../library/datetime.rst:372 msgid "Division by 0 raises :exc:`ZeroDivisionError`." msgstr "" -#: ../../library/datetime.rst:371 +#: ../../library/datetime.rst:375 msgid "-*timedelta.max* is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:374 +#: ../../library/datetime.rst:378 msgid "" "String representations of :class:`timedelta` objects are normalized " "similarly to their internal representation. This leads to somewhat unusual " "results for negative timedeltas. For example::" msgstr "" -#: ../../library/datetime.rst:384 +#: ../../library/datetime.rst:388 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" "t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " "will produce a result while the latter will overflow." msgstr "" -#: ../../library/datetime.rst:388 +#: ../../library/datetime.rst:392 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " "support certain additions and subtractions with :class:`date` and :class:`." "datetime` objects (see below)." msgstr "" -#: ../../library/datetime.rst:392 +#: ../../library/datetime.rst:396 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`timedelta` object are now supported, as are remainder operations and " @@ -633,119 +643,119 @@ msgid "" "`timedelta` object by a :class:`float` object are now supported." msgstr "" -#: ../../library/datetime.rst:399 +#: ../../library/datetime.rst:403 msgid "" "Comparisons of :class:`timedelta` objects are supported, with some caveats." msgstr "" -#: ../../library/datetime.rst:401 +#: ../../library/datetime.rst:405 msgid "" "The comparisons ``==`` or ``!=`` *always* return a :class:`bool`, no matter " "the type of the compared object::" msgstr "" -#: ../../library/datetime.rst:412 +#: ../../library/datetime.rst:416 msgid "" "For all other comparisons (such as ``<`` and ``>``), when a :class:" "`timedelta` object is compared to an object of a different type, :exc:" "`TypeError` is raised::" msgstr "" -#: ../../library/datetime.rst:423 +#: ../../library/datetime.rst:427 msgid "" "In Boolean contexts, a :class:`timedelta` object is considered to be true if " "and only if it isn't equal to ``timedelta(0)``." msgstr "" -#: ../../library/datetime.rst:426 ../../library/datetime.rst:637 -#: ../../library/datetime.rst:1216 ../../library/datetime.rst:1816 +#: ../../library/datetime.rst:430 ../../library/datetime.rst:641 +#: ../../library/datetime.rst:1220 ../../library/datetime.rst:1820 msgid "Instance methods:" msgstr "實例方法:" -#: ../../library/datetime.rst:430 +#: ../../library/datetime.rst:434 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " "the division form directly (e.g. ``td / timedelta(microseconds=1)``)." msgstr "" -#: ../../library/datetime.rst:434 +#: ../../library/datetime.rst:438 msgid "" "Note that for very large time intervals (greater than 270 years on most " "platforms) this method will lose microsecond accuracy." msgstr "" -#: ../../library/datetime.rst:440 +#: ../../library/datetime.rst:444 msgid "Examples of usage: :class:`timedelta`" msgstr "用法範例:\\ :class:`timedelta`" -#: ../../library/datetime.rst:442 +#: ../../library/datetime.rst:446 msgid "An additional example of normalization::" msgstr "" -#: ../../library/datetime.rst:454 +#: ../../library/datetime.rst:458 msgid "Examples of :class:`timedelta` arithmetic::" msgstr "" -#: ../../library/datetime.rst:473 +#: ../../library/datetime.rst:477 msgid ":class:`date` Objects" msgstr ":class:`date` 物件" -#: ../../library/datetime.rst:475 +#: ../../library/datetime.rst:479 msgid "" "A :class:`date` object represents a date (year, month and day) in an " "idealized calendar, the current Gregorian calendar indefinitely extended in " "both directions." msgstr "" -#: ../../library/datetime.rst:479 +#: ../../library/datetime.rst:483 msgid "" "January 1 of year 1 is called day number 1, January 2 of year 1 is called " "day number 2, and so on. [#]_" msgstr "" -#: ../../library/datetime.rst:484 +#: ../../library/datetime.rst:488 msgid "" "All arguments are required. Arguments must be integers, in the following " "ranges:" msgstr "" -#: ../../library/datetime.rst:487 +#: ../../library/datetime.rst:491 msgid "``MINYEAR <= year <= MAXYEAR``" msgstr "``MINYEAR <= year <= MAXYEAR``" -#: ../../library/datetime.rst:488 +#: ../../library/datetime.rst:492 msgid "``1 <= month <= 12``" msgstr "``1 <= month <= 12``" -#: ../../library/datetime.rst:489 +#: ../../library/datetime.rst:493 msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:491 ../../library/datetime.rst:852 +#: ../../library/datetime.rst:495 ../../library/datetime.rst:856 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:494 ../../library/datetime.rst:857 +#: ../../library/datetime.rst:498 ../../library/datetime.rst:861 msgid "Other constructors, all class methods:" msgstr "" -#: ../../library/datetime.rst:498 +#: ../../library/datetime.rst:502 msgid "Return the current local date." msgstr "回傳目前的本地日期。" -#: ../../library/datetime.rst:500 +#: ../../library/datetime.rst:504 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "這等同於 ``date.fromtimestamp(time.time())``。" -#: ../../library/datetime.rst:504 +#: ../../library/datetime.rst:508 msgid "" "Return the local date corresponding to the POSIX timestamp, such as is " "returned by :func:`time.time`." msgstr "" -#: ../../library/datetime.rst:507 +#: ../../library/datetime.rst:511 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`localtime` function, and :exc:" @@ -755,7 +765,7 @@ msgid "" "ignored by :meth:`fromtimestamp`." msgstr "" -#: ../../library/datetime.rst:514 +#: ../../library/datetime.rst:518 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -763,96 +773,96 @@ msgid "" "`localtime` failure." msgstr "" -#: ../../library/datetime.rst:523 +#: ../../library/datetime.rst:527 msgid "" "Return the date corresponding to the proleptic Gregorian ordinal, where " "January 1 of year 1 has ordinal 1." msgstr "" -#: ../../library/datetime.rst:526 +#: ../../library/datetime.rst:530 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " "For any date *d*, ``date.fromordinal(d.toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:533 +#: ../../library/datetime.rst:537 msgid "" "Return a :class:`date` corresponding to a *date_string* given in any valid " "ISO 8601 format, except ordinal dates (e.g. ``YYYY-DDD``)::" msgstr "" -#: ../../library/datetime.rst:545 +#: ../../library/datetime.rst:549 msgid "Previously, this method only supported the format ``YYYY-MM-DD``." msgstr "" -#: ../../library/datetime.rst:550 +#: ../../library/datetime.rst:554 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "year, week and day. This is the inverse of the function :meth:`date." "isocalendar`." msgstr "" -#: ../../library/datetime.rst:560 +#: ../../library/datetime.rst:564 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." msgstr "" -#: ../../library/datetime.rst:565 +#: ../../library/datetime.rst:569 msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." msgstr "" -#: ../../library/datetime.rst:570 +#: ../../library/datetime.rst:574 msgid "" "The smallest possible difference between non-equal date objects, " "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:578 ../../library/datetime.rst:1093 +#: ../../library/datetime.rst:582 ../../library/datetime.rst:1097 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:583 ../../library/datetime.rst:1098 +#: ../../library/datetime.rst:587 ../../library/datetime.rst:1102 msgid "Between 1 and 12 inclusive." msgstr "在 1 到 12 (含)之間。" -#: ../../library/datetime.rst:588 ../../library/datetime.rst:1103 +#: ../../library/datetime.rst:592 ../../library/datetime.rst:1107 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" -#: ../../library/datetime.rst:596 +#: ../../library/datetime.rst:600 msgid "``date2 = date1 + timedelta``" msgstr "``date2 = date1 + timedelta``" -#: ../../library/datetime.rst:596 +#: ../../library/datetime.rst:600 msgid "*date2* will be ``timedelta.days`` days after *date1*. (1)" msgstr "" -#: ../../library/datetime.rst:599 +#: ../../library/datetime.rst:603 msgid "``date2 = date1 - timedelta``" msgstr "``date2 = date1 - timedelta``" -#: ../../library/datetime.rst:599 +#: ../../library/datetime.rst:603 msgid "Computes *date2* such that ``date2 + timedelta == date1``. (2)" msgstr "" -#: ../../library/datetime.rst:602 +#: ../../library/datetime.rst:606 msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:602 ../../library/datetime.rst:1151 +#: ../../library/datetime.rst:606 ../../library/datetime.rst:1155 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/datetime.rst:604 +#: ../../library/datetime.rst:608 msgid "``date1 < date2``" msgstr "``date1 < date2``" -#: ../../library/datetime.rst:604 +#: ../../library/datetime.rst:608 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. (4)" msgstr "" -#: ../../library/datetime.rst:611 +#: ../../library/datetime.rst:615 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -861,17 +871,17 @@ msgid "" "`MINYEAR` or larger than :const:`MAXYEAR`." msgstr "" -#: ../../library/datetime.rst:618 +#: ../../library/datetime.rst:622 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "``timedelta.seconds`` 和 ``timedelta.microseconds`` 被忽略。" -#: ../../library/datetime.rst:621 +#: ../../library/datetime.rst:625 msgid "" "This is exact, and cannot overflow. timedelta.seconds and timedelta." "microseconds are 0, and date2 + timedelta == date1 after." msgstr "" -#: ../../library/datetime.rst:625 +#: ../../library/datetime.rst:629 msgid "" "In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2." "toordinal()``. Date comparison raises :exc:`TypeError` if the other " @@ -884,56 +894,56 @@ msgid "" "`True`, respectively." msgstr "" -#: ../../library/datetime.rst:635 +#: ../../library/datetime.rst:639 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -#: ../../library/datetime.rst:641 +#: ../../library/datetime.rst:645 msgid "" "Return a date with the same value, except for those parameters given new " "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:644 ../../library/datetime.rst:1859 +#: ../../library/datetime.rst:648 ../../library/datetime.rst:1863 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:654 ../../library/datetime.rst:1329 +#: ../../library/datetime.rst:658 ../../library/datetime.rst:1333 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" "回傳一個 :class:`time.struct_time`,如同 :func:`time.localtime` 所回傳。" -#: ../../library/datetime.rst:656 +#: ../../library/datetime.rst:660 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:658 ../../library/datetime.rst:1331 +#: ../../library/datetime.rst:662 ../../library/datetime.rst:1335 msgid "``d.timetuple()`` is equivalent to::" msgstr "" "``d.timetuple()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:662 +#: ../../library/datetime.rst:666 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st." msgstr "" -#: ../../library/datetime.rst:668 +#: ../../library/datetime.rst:672 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " "1 has ordinal 1. For any :class:`date` object *d*, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:675 +#: ../../library/datetime.rst:679 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" @@ -942,25 +952,25 @@ msgstr "" "回傳一個代表星期幾的整數,星期一為 0、星期日為 6。例如 ``date(2002, 12, 4)." "weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" -#: ../../library/datetime.rst:682 +#: ../../library/datetime.rst:686 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" "meth:`weekday`, :meth:`isocalendar`." msgstr "" -#: ../../library/datetime.rst:689 +#: ../../library/datetime.rst:693 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." msgstr "" -#: ../../library/datetime.rst:692 +#: ../../library/datetime.rst:696 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "" -#: ../../library/datetime.rst:694 +#: ../../library/datetime.rst:698 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -969,17 +979,17 @@ msgid "" "Gregorian year." msgstr "" -#: ../../library/datetime.rst:699 +#: ../../library/datetime.rst:703 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" msgstr "" -#: ../../library/datetime.rst:708 +#: ../../library/datetime.rst:712 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" -#: ../../library/datetime.rst:713 +#: ../../library/datetime.rst:717 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "" @@ -987,29 +997,29 @@ msgstr "" "\n" "::" -#: ../../library/datetime.rst:721 +#: ../../library/datetime.rst:725 msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -#: ../../library/datetime.rst:726 +#: ../../library/datetime.rst:730 msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:732 ../../library/datetime.rst:1515 +#: ../../library/datetime.rst:736 ../../library/datetime.rst:1519 msgid "``d.ctime()`` is equivalent to::" msgstr "" "``d.ctime()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:736 +#: ../../library/datetime.rst:740 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " "the C standard." msgstr "" -#: ../../library/datetime.rst:743 +#: ../../library/datetime.rst:747 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " @@ -1017,7 +1027,7 @@ msgid "" "isoformat`." msgstr "" -#: ../../library/datetime.rst:750 +#: ../../library/datetime.rst:754 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals 0, or backward if ``timedelta.days`` < 0. " @@ -1447,7 +1457,7 @@ msgid "" "the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1167 +#: ../../library/datetime.rst:1171 msgid "" "Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " "addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " @@ -1455,14 +1465,14 @@ msgid "" "aware." msgstr "" -#: ../../library/datetime.rst:1172 +#: ../../library/datetime.rst:1176 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1176 +#: ../../library/datetime.rst:1180 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " @@ -1470,7 +1480,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1181 +#: ../../library/datetime.rst:1185 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes " @@ -1479,20 +1489,20 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1187 +#: ../../library/datetime.rst:1191 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time." msgstr "" -#: ../../library/datetime.rst:1190 +#: ../../library/datetime.rst:1194 msgid "" "If one comparand is naive and the other is aware, :exc:`TypeError` is raised " "if an order comparison is attempted. For equality comparisons, naive " "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1194 +#: ../../library/datetime.rst:1198 msgid "" "If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " "attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " @@ -1502,13 +1512,13 @@ msgid "" "utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1200 +#: ../../library/datetime.rst:1204 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1206 +#: ../../library/datetime.rst:1210 msgid "" "In order to stop comparison from falling back to the default scheme of " "comparing object addresses, datetime comparison normally raises :exc:" @@ -1521,27 +1531,27 @@ msgid "" "cases return :const:`False` or :const:`True`, respectively." msgstr "" -#: ../../library/datetime.rst:1220 +#: ../../library/datetime.rst:1224 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1225 +#: ../../library/datetime.rst:1229 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1228 ../../library/datetime.rst:1237 +#: ../../library/datetime.rst:1232 ../../library/datetime.rst:1241 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1234 +#: ../../library/datetime.rst:1238 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1245 +#: ../../library/datetime.rst:1249 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1549,21 +1559,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1256 +#: ../../library/datetime.rst:1260 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1260 +#: ../../library/datetime.rst:1264 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system timezone." msgstr "" -#: ../../library/datetime.rst:1264 +#: ../../library/datetime.rst:1268 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1571,7 +1581,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1269 +#: ../../library/datetime.rst:1273 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1580,7 +1590,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1275 +#: ../../library/datetime.rst:1279 msgid "" "If you merely want to attach a time zone object *tz* to a datetime *dt* " "without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " @@ -1588,56 +1598,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1280 +#: ../../library/datetime.rst:1284 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: ../../library/datetime.rst:1292 +#: ../../library/datetime.rst:1296 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1295 +#: ../../library/datetime.rst:1299 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1302 +#: ../../library/datetime.rst:1306 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1306 ../../library/datetime.rst:1899 -#: ../../library/datetime.rst:2005 ../../library/datetime.rst:2250 -#: ../../library/datetime.rst:2262 ../../library/datetime.rst:2574 +#: ../../library/datetime.rst:1310 ../../library/datetime.rst:1903 +#: ../../library/datetime.rst:2009 ../../library/datetime.rst:2254 +#: ../../library/datetime.rst:2266 ../../library/datetime.rst:2578 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1312 +#: ../../library/datetime.rst:1316 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1316 ../../library/datetime.rst:1909 -#: ../../library/datetime.rst:2059 +#: ../../library/datetime.rst:1320 ../../library/datetime.rst:1913 +#: ../../library/datetime.rst:2063 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1322 +#: ../../library/datetime.rst:1326 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: ../../library/datetime.rst:1337 +#: ../../library/datetime.rst:1341 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st. The :" @@ -1647,14 +1657,14 @@ msgid "" "attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" -#: ../../library/datetime.rst:1348 +#: ../../library/datetime.rst:1352 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`tm_isdst` is forced to 0 regardless of what " "``d.dst()`` returns. DST is never in effect for a UTC time." msgstr "" -#: ../../library/datetime.rst:1352 +#: ../../library/datetime.rst:1356 msgid "" "If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -1663,7 +1673,7 @@ msgid "" "spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1361 +#: ../../library/datetime.rst:1365 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1673,20 +1683,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1370 +#: ../../library/datetime.rst:1374 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1375 +#: ../../library/datetime.rst:1379 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: ../../library/datetime.rst:1379 +#: ../../library/datetime.rst:1383 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " @@ -1696,18 +1706,18 @@ msgid "" "future." msgstr "" -#: ../../library/datetime.rst:1386 +#: ../../library/datetime.rst:1390 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1393 +#: ../../library/datetime.rst:1397 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1399 +#: ../../library/datetime.rst:1403 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1715,49 +1725,49 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1407 +#: ../../library/datetime.rst:1411 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1413 +#: ../../library/datetime.rst:1417 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1419 +#: ../../library/datetime.rst:1423 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: ../../library/datetime.rst:1426 +#: ../../library/datetime.rst:1430 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1432 +#: ../../library/datetime.rst:1436 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1434 +#: ../../library/datetime.rst:1438 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``,如果 :attr:`microsecond` 不是 0" -#: ../../library/datetime.rst:1435 +#: ../../library/datetime.rst:1439 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1437 +#: ../../library/datetime.rst:1441 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1440 +#: ../../library/datetime.rst:1444 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -1765,99 +1775,99 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1442 +#: ../../library/datetime.rst:1446 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1452 +#: ../../library/datetime.rst:1456 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1839 +#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 +#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1847 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1472 ../../library/datetime.rst:1845 +#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1849 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1473 ../../library/datetime.rst:1846 +#: ../../library/datetime.rst:1477 ../../library/datetime.rst:1850 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1847 +#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1849 +#: ../../library/datetime.rst:1480 ../../library/datetime.rst:1853 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 +#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1855 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1855 +#: ../../library/datetime.rst:1486 ../../library/datetime.rst:1859 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1484 +#: ../../library/datetime.rst:1488 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1494 ../../library/datetime.rst:1870 +#: ../../library/datetime.rst:1498 ../../library/datetime.rst:1874 msgid "Added the *timespec* argument." msgstr "新增 *timespec* 引數。" -#: ../../library/datetime.rst:1500 +#: ../../library/datetime.rst:1504 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1506 +#: ../../library/datetime.rst:1510 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1512 +#: ../../library/datetime.rst:1516 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1519 +#: ../../library/datetime.rst:1523 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: ../../library/datetime.rst:1526 +#: ../../library/datetime.rst:1530 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. See also :ref:`strftime-strptime-behavior` and :meth:" "`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1533 +#: ../../library/datetime.rst:1537 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -1865,70 +1875,70 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1540 +#: ../../library/datetime.rst:1544 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:1542 +#: ../../library/datetime.rst:1546 msgid "Examples of working with :class:`~datetime.datetime` objects:" msgstr "" -#: ../../library/datetime.rst:1595 +#: ../../library/datetime.rst:1599 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1642 +#: ../../library/datetime.rst:1646 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1668 +#: ../../library/datetime.rst:1672 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1670 +#: ../../library/datetime.rst:1674 msgid "" "A :class:`time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1675 +#: ../../library/datetime.rst:1679 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1685 +#: ../../library/datetime.rst:1689 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" -#: ../../library/datetime.rst:1693 +#: ../../library/datetime.rst:1697 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1698 +#: ../../library/datetime.rst:1702 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1703 +#: ../../library/datetime.rst:1707 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: ../../library/datetime.rst:1732 +#: ../../library/datetime.rst:1736 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1746 +#: ../../library/datetime.rst:1750 msgid "" ":class:`.time` objects support comparison of :class:`.time` to :class:`." "time`, where *a* is considered less than *b* when *a* precedes *b* in time. " @@ -1937,7 +1947,7 @@ msgid "" "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1752 +#: ../../library/datetime.rst:1756 msgid "" "If both comparands are aware, and have the same :attr:`~time.tzinfo` " "attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " @@ -1951,18 +1961,18 @@ msgid "" "respectively." msgstr "" -#: ../../library/datetime.rst:1762 +#: ../../library/datetime.rst:1766 msgid "" "Equality comparisons between aware and naive :class:`~datetime.time` " "instances don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1766 +#: ../../library/datetime.rst:1770 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1768 +#: ../../library/datetime.rst:1772 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -1970,35 +1980,35 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1775 +#: ../../library/datetime.rst:1779 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1779 +#: ../../library/datetime.rst:1783 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1783 +#: ../../library/datetime.rst:1787 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" -#: ../../library/datetime.rst:1785 +#: ../../library/datetime.rst:1789 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1811 +#: ../../library/datetime.rst:1815 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1821 +#: ../../library/datetime.rst:1825 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -2006,46 +2016,46 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1832 +#: ../../library/datetime.rst:1836 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1834 +#: ../../library/datetime.rst:1838 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1839 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1836 +#: ../../library/datetime.rst:1840 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1841 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1857 +#: ../../library/datetime.rst:1861 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1876 +#: ../../library/datetime.rst:1880 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1881 +#: ../../library/datetime.rst:1885 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: ../../library/datetime.rst:1887 +#: ../../library/datetime.rst:1891 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2142 +#: ../../library/datetime.rst:2146 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -2315,7 +2325,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2156 +#: ../../library/datetime.rst:2160 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -2324,7 +2334,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2175 +#: ../../library/datetime.rst:2179 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -2339,13 +2349,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2197 +#: ../../library/datetime.rst:2201 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2200 +#: ../../library/datetime.rst:2204 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2355,28 +2365,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2214 +#: ../../library/datetime.rst:2218 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2209 +#: ../../library/datetime.rst:2213 msgid "" "The :mod:`datetime` module has a basic :class:`timezone` class (for handling " "arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a " "UTC timezone instance)." msgstr "" -#: ../../library/datetime.rst:2213 +#: ../../library/datetime.rst:2217 msgid "" "``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2220 +#: ../../library/datetime.rst:2224 msgid "`IANA timezone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2217 +#: ../../library/datetime.rst:2221 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -2385,24 +2395,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2227 +#: ../../library/datetime.rst:2231 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2229 +#: ../../library/datetime.rst:2233 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2233 +#: ../../library/datetime.rst:2237 msgid "" "Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2240 +#: ../../library/datetime.rst:2244 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2410,25 +2420,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2245 +#: ../../library/datetime.rst:2249 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2256 ../../library/datetime.rst:2267 +#: ../../library/datetime.rst:2260 ../../library/datetime.rst:2271 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2259 +#: ../../library/datetime.rst:2263 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2270 +#: ../../library/datetime.rst:2274 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -2437,144 +2447,144 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2276 +#: ../../library/datetime.rst:2280 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2283 +#: ../../library/datetime.rst:2287 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2287 +#: ../../library/datetime.rst:2291 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2294 +#: ../../library/datetime.rst:2298 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2303 +#: ../../library/datetime.rst:2307 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr ":meth:`strftime` 與 :meth:`strptime` 的行為" -#: ../../library/datetime.rst:2305 +#: ../../library/datetime.rst:2309 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2309 +#: ../../library/datetime.rst:2313 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2317 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2327 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2327 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2327 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2329 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2329 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2329 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2332 +#: ../../library/datetime.rst:2336 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2338 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2342 +#: ../../library/datetime.rst:2346 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2348 +#: ../../library/datetime.rst:2352 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2348 +#: ../../library/datetime.rst:2352 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2586,11 +2596,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2357 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2357 msgid "Weekday as locale's full name." msgstr "" @@ -2602,42 +2612,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2362 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2362 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2362 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2366 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2366 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2366 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2362 ../../library/datetime.rst:2375 -#: ../../library/datetime.rst:2378 ../../library/datetime.rst:2384 -#: ../../library/datetime.rst:2387 ../../library/datetime.rst:2393 -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2366 ../../library/datetime.rst:2379 +#: ../../library/datetime.rst:2382 ../../library/datetime.rst:2388 +#: ../../library/datetime.rst:2391 ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2415 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2369 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2369 msgid "Month as locale's abbreviated name." msgstr "" @@ -2649,11 +2659,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2370 +#: ../../library/datetime.rst:2374 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2370 +#: ../../library/datetime.rst:2374 msgid "Month as locale's full name." msgstr "" @@ -2665,67 +2675,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2379 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2379 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2375 ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2379 ../../library/datetime.rst:2391 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2382 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2382 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2382 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2385 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2385 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2381 ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2385 ../../library/datetime.rst:2455 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2388 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2388 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2388 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2391 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2391 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2394 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2394 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2737,128 +2747,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2394 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2397 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2397 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2393 ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2400 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2403 ../../library/datetime.rst:2572 +#: ../../library/datetime.rst:2407 ../../library/datetime.rst:2576 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2407 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2407 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2403 ../../library/datetime.rst:2408 -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2407 ../../library/datetime.rst:2412 +#: ../../library/datetime.rst:2469 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2600 +#: ../../library/datetime.rst:2412 ../../library/datetime.rst:2604 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2412 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2412 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2415 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2415 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2415 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2414 +#: ../../library/datetime.rst:2418 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2414 +#: ../../library/datetime.rst:2418 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2418 ../../library/datetime.rst:2426 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2418 ../../library/datetime.rst:2426 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2426 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2426 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2434 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2434 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2870,11 +2880,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2435 +#: ../../library/datetime.rst:2439 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2435 +#: ../../library/datetime.rst:2439 msgid "Locale's appropriate date representation." msgstr "" @@ -2890,11 +2900,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2443 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2443 msgid "Locale's appropriate time representation." msgstr "" @@ -2906,83 +2916,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2446 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2446 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2446 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2449 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2455 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2455 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2455 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2465 ../../library/datetime.rst:2586 +#: ../../library/datetime.rst:2469 ../../library/datetime.rst:2590 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2475 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -2991,7 +3001,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2476 +#: ../../library/datetime.rst:2480 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -3001,37 +3011,37 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2482 +#: ../../library/datetime.rst:2486 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" -#: ../../library/datetime.rst:2485 +#: ../../library/datetime.rst:2489 msgid "``%:z`` was added." msgstr "" -#: ../../library/datetime.rst:2489 +#: ../../library/datetime.rst:2493 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2491 +#: ../../library/datetime.rst:2495 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2495 +#: ../../library/datetime.rst:2499 msgid "" "For the :meth:`datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2499 +#: ../../library/datetime.rst:2503 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2503 +#: ../../library/datetime.rst:2507 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " @@ -3039,7 +3049,7 @@ msgid "" msgstr "" # format code 在這份文件第一次出現的地方是 ../../library/datetime.rst:739,應該要改成在那邊註記 (format code) -#: ../../library/datetime.rst:2507 +#: ../../library/datetime.rst:2511 #, fuzzy msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " @@ -3051,7 +3061,7 @@ msgstr "" "為 :class:`time` 物件並沒有這些值。如果使用這些格式碼,年份會以 ``1900`` 代" "替、月及日會以 ``1`` 代替。" -#: ../../library/datetime.rst:2511 +#: ../../library/datetime.rst:2515 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " @@ -3060,7 +3070,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 ``0`` 代替。" -#: ../../library/datetime.rst:2515 +#: ../../library/datetime.rst:2519 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -3069,7 +3079,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2528 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -3077,37 +3087,37 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2530 +#: ../../library/datetime.rst:2534 msgid "" "The :meth:`strptime` method can parse years in the full [1, 9999] range, but " "years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2533 +#: ../../library/datetime.rst:2537 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2537 +#: ../../library/datetime.rst:2541 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2542 +#: ../../library/datetime.rst:2546 msgid "" "When used with the :meth:`strptime` method, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/datetime.rst:2546 +#: ../../library/datetime.rst:2550 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2550 +#: ../../library/datetime.rst:2554 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3115,17 +3125,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2557 +#: ../../library/datetime.rst:2561 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2560 +#: ../../library/datetime.rst:2564 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2563 +#: ../../library/datetime.rst:2567 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3139,7 +3149,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2577 +#: ../../library/datetime.rst:2581 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3147,53 +3157,53 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2585 +#: ../../library/datetime.rst:2589 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2589 +#: ../../library/datetime.rst:2593 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2593 +#: ../../library/datetime.rst:2597 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2595 +#: ../../library/datetime.rst:2599 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2596 +#: ../../library/datetime.rst:2600 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2598 +#: ../../library/datetime.rst:2602 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2602 +#: ../../library/datetime.rst:2606 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, an " "aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " "result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2608 +#: ../../library/datetime.rst:2612 msgid "" "When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " "in calculations when the day of the week and the calendar year (``%Y``) are " "specified." msgstr "" -#: ../../library/datetime.rst:2613 +#: ../../library/datetime.rst:2617 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:" @@ -3201,22 +3211,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2619 +#: ../../library/datetime.rst:2623 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2624 +#: ../../library/datetime.rst:2628 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2625 +#: ../../library/datetime.rst:2629 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2627 +#: ../../library/datetime.rst:2631 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3225,23 +3235,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2633 +#: ../../library/datetime.rst:2637 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2637 +#: ../../library/datetime.rst:2641 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." msgstr "" -#: ../../library/datetime.rst:2297 +#: ../../library/datetime.rst:2301 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2297 +#: ../../library/datetime.rst:2301 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index 926c4d8e5e..dd64c4887f 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:35+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -495,8 +495,8 @@ msgid "" "In some tests I wanted to mock out a call to :meth:`datetime.date.today` to " "return a known date, but I didn't want to prevent the code under test from " "creating new date objects. Unfortunately :class:`datetime.date` is written " -"in C, and so I couldn't just monkey-patch out the static :meth:`date.today` " -"method." +"in C, and so I couldn't just monkey-patch out the static :meth:`datetime." +"date.today` method." msgstr "" #: ../../library/unittest.mock-examples.rst:584 @@ -509,9 +509,9 @@ msgstr "" #: ../../library/unittest.mock-examples.rst:588 msgid "" "The :func:`patch decorator ` is used here to mock out the ``date`` " -"class in the module under test. The :attr:`side_effect` attribute on the " -"mock date class is then set to a lambda function that returns a real date. " -"When the mock date class is called a real date will be constructed and " +"class in the module under test. The :attr:`~Mock.side_effect` attribute on " +"the mock date class is then set to a lambda function that returns a real " +"date. When the mock date class is called a real date will be constructed and " "returned by ``side_effect``. ::" msgstr "" @@ -662,9 +662,9 @@ msgstr "" #: ../../library/unittest.mock-examples.rst:768 msgid "" -"If your mock is only being called once you can use the :meth:" -"`assert_called_once_with` method that also asserts that the :attr:" -"`call_count` is one." +"If your mock is only being called once you can use the :meth:`~Mock." +"assert_called_once_with` method that also asserts that the :attr:`~Mock." +"call_count` is one." msgstr "" #: ../../library/unittest.mock-examples.rst:779 @@ -717,12 +717,13 @@ msgstr "" #: ../../library/unittest.mock-examples.rst:838 msgid "" -"Here's one solution that uses the :attr:`side_effect` functionality. If you " -"provide a ``side_effect`` function for a mock then ``side_effect`` will be " -"called with the same args as the mock. This gives us an opportunity to copy " -"the arguments and store them for later assertions. In this example I'm using " -"*another* mock to store the arguments so that I can use the mock methods for " -"doing the assertion. Again a helper function sets this up for me. ::" +"Here's one solution that uses the :attr:`~Mock.side_effect` functionality. " +"If you provide a ``side_effect`` function for a mock then ``side_effect`` " +"will be called with the same args as the mock. This gives us an opportunity " +"to copy the arguments and store them for later assertions. In this example " +"I'm using *another* mock to store the arguments so that I can use the mock " +"methods for doing the assertion. Again a helper function sets this up for " +"me. ::" msgstr "" #: ../../library/unittest.mock-examples.rst:867 @@ -792,55 +793,55 @@ msgstr "" #: ../../library/unittest.mock-examples.rst:974 msgid "" -"When the :meth:`__getitem__` and :meth:`__setitem__` methods of our " -"``MagicMock`` are called (normal dictionary access) then ``side_effect`` is " -"called with the key (and in the case of ``__setitem__`` the value too). We " -"can also control what is returned." +"When the :meth:`~object.__getitem__` and :meth:`~object.__setitem__` methods " +"of our ``MagicMock`` are called (normal dictionary access) then " +"``side_effect`` is called with the key (and in the case of ``__setitem__`` " +"the value too). We can also control what is returned." msgstr "" -#: ../../library/unittest.mock-examples.rst:978 +#: ../../library/unittest.mock-examples.rst:979 msgid "" "After the ``MagicMock`` has been used we can use attributes like :data:" "`~Mock.call_args_list` to assert about how the dictionary was used:" msgstr "" -#: ../../library/unittest.mock-examples.rst:994 +#: ../../library/unittest.mock-examples.rst:995 msgid "" "An alternative to using ``MagicMock`` is to use ``Mock`` and *only* provide " "the magic methods you specifically want:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1001 +#: ../../library/unittest.mock-examples.rst:1002 msgid "" "A *third* option is to use ``MagicMock`` but passing in ``dict`` as the " "*spec* (or *spec_set*) argument so that the ``MagicMock`` created only has " "dictionary magic methods available:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1009 +#: ../../library/unittest.mock-examples.rst:1010 msgid "" "With these side effect functions in place, the ``mock`` will behave like a " "normal dictionary but recording the access. It even raises a :exc:`KeyError` " "if you try to access a key that doesn't exist." msgstr "" -#: ../../library/unittest.mock-examples.rst:1028 +#: ../../library/unittest.mock-examples.rst:1029 msgid "" "After it has been used you can make assertions about the access using the " "normal mock methods and attributes:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1040 +#: ../../library/unittest.mock-examples.rst:1041 msgid "Mock subclasses and their attributes" msgstr "" -#: ../../library/unittest.mock-examples.rst:1042 +#: ../../library/unittest.mock-examples.rst:1043 msgid "" "There are various reasons why you might want to subclass :class:`Mock`. One " "reason might be to add helper methods. Here's a silly example:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1058 +#: ../../library/unittest.mock-examples.rst:1059 msgid "" "The standard behaviour for ``Mock`` instances is that attributes and the " "return value mocks are of the same type as the mock they are accessed on. " @@ -850,7 +851,7 @@ msgid "" "mock of instances of your subclass." msgstr "" -#: ../../library/unittest.mock-examples.rst:1074 +#: ../../library/unittest.mock-examples.rst:1075 msgid "" "Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted " @@ -858,7 +859,7 @@ msgid "" "html>`_. Having this applied to attributes too actually causes errors." msgstr "" -#: ../../library/unittest.mock-examples.rst:1080 +#: ../../library/unittest.mock-examples.rst:1081 msgid "" "``Mock`` (in all its flavours) uses a method called ``_get_child_mock`` to " "create these \"sub-mocks\" for attributes and return values. You can prevent " @@ -867,25 +868,25 @@ msgid "" "are then passed onto the mock constructor:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1097 +#: ../../library/unittest.mock-examples.rst:1098 msgid "" "An exception to this rule are the non-callable mocks. Attributes use the " "callable variant because otherwise non-callable mocks couldn't have callable " "methods." msgstr "" -#: ../../library/unittest.mock-examples.rst:1103 +#: ../../library/unittest.mock-examples.rst:1104 msgid "Mocking imports with patch.dict" msgstr "" -#: ../../library/unittest.mock-examples.rst:1105 +#: ../../library/unittest.mock-examples.rst:1106 msgid "" "One situation where mocking can be hard is where you have a local import " "inside a function. These are harder to mock because they aren't using an " "object from the module namespace that we can patch out." msgstr "" -#: ../../library/unittest.mock-examples.rst:1109 +#: ../../library/unittest.mock-examples.rst:1110 msgid "" "Generally local imports are to be avoided. They are sometimes done to " "prevent circular dependencies, for which there is *usually* a much better " @@ -895,7 +896,7 @@ msgid "" "attribute and only do the import on first use)." msgstr "" -#: ../../library/unittest.mock-examples.rst:1116 +#: ../../library/unittest.mock-examples.rst:1117 msgid "" "That aside there is a way to use ``mock`` to affect the results of an " "import. Importing fetches an *object* from the :data:`sys.modules` " @@ -905,7 +906,7 @@ msgid "" "back. This need not be the case however." msgstr "" -#: ../../library/unittest.mock-examples.rst:1123 +#: ../../library/unittest.mock-examples.rst:1124 msgid "" "This means you can use :func:`patch.dict` to *temporarily* put a mock in " "place in :data:`sys.modules`. Any imports whilst this patch is active will " @@ -914,29 +915,29 @@ msgid "" "whatever was there previously will be restored safely." msgstr "" -#: ../../library/unittest.mock-examples.rst:1129 +#: ../../library/unittest.mock-examples.rst:1130 msgid "Here's an example that mocks out the 'fooble' module." msgstr "" -#: ../../library/unittest.mock-examples.rst:1141 +#: ../../library/unittest.mock-examples.rst:1142 msgid "" "As you can see the ``import fooble`` succeeds, but on exit there is no " "'fooble' left in :data:`sys.modules`." msgstr "" -#: ../../library/unittest.mock-examples.rst:1144 +#: ../../library/unittest.mock-examples.rst:1145 msgid "This also works for the ``from module import name`` form:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1154 +#: ../../library/unittest.mock-examples.rst:1155 msgid "With slightly more work you can also mock package imports:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1167 +#: ../../library/unittest.mock-examples.rst:1168 msgid "Tracking order of calls and less verbose call assertions" msgstr "" -#: ../../library/unittest.mock-examples.rst:1169 +#: ../../library/unittest.mock-examples.rst:1170 msgid "" "The :class:`Mock` class allows you to track the *order* of method calls on " "your mock objects through the :attr:`~Mock.method_calls` attribute. This " @@ -944,7 +945,7 @@ msgid "" "however we can use :attr:`~Mock.mock_calls` to achieve the same effect." msgstr "" -#: ../../library/unittest.mock-examples.rst:1174 +#: ../../library/unittest.mock-examples.rst:1175 msgid "" "Because mocks track calls to child mocks in ``mock_calls``, and accessing an " "arbitrary attribute of a mock creates a child mock, we can create our " @@ -952,20 +953,20 @@ msgid "" "recorded, in order, in the ``mock_calls`` of the parent:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1191 +#: ../../library/unittest.mock-examples.rst:1192 msgid "" "We can then assert about the calls, including the order, by comparing with " "the ``mock_calls`` attribute on the manager mock:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1198 +#: ../../library/unittest.mock-examples.rst:1199 msgid "" "If ``patch`` is creating, and putting in place, your mocks then you can " "attach them to a manager mock using the :meth:`~Mock.attach_mock` method. " "After attaching calls will be recorded in ``mock_calls`` of the manager. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:1217 +#: ../../library/unittest.mock-examples.rst:1218 msgid "" "If many calls have been made, but you're only interested in a particular " "sequence of them then an alternative is to use the :meth:`~Mock." @@ -974,13 +975,13 @@ msgid "" "mock_calls` then the assert succeeds." msgstr "" -#: ../../library/unittest.mock-examples.rst:1231 +#: ../../library/unittest.mock-examples.rst:1232 msgid "" "Even though the chained call ``m.one().two().three()`` aren't the only calls " "that have been made to the mock, the assert still succeeds." msgstr "" -#: ../../library/unittest.mock-examples.rst:1234 +#: ../../library/unittest.mock-examples.rst:1235 msgid "" "Sometimes a mock may have several calls made to it, and you are only " "interested in asserting about *some* of those calls. You may not even care " @@ -988,17 +989,17 @@ msgid "" "``assert_has_calls``:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1246 +#: ../../library/unittest.mock-examples.rst:1247 msgid "More complex argument matching" msgstr "" -#: ../../library/unittest.mock-examples.rst:1248 +#: ../../library/unittest.mock-examples.rst:1249 msgid "" "Using the same basic concept as :data:`ANY` we can implement matchers to do " "more complex assertions on objects used as arguments to mocks." msgstr "" -#: ../../library/unittest.mock-examples.rst:1251 +#: ../../library/unittest.mock-examples.rst:1252 msgid "" "Suppose we expect some object to be passed to a mock that by default " "compares equal based on object identity (which is the Python default for " @@ -1008,28 +1009,28 @@ msgid "" "attributes for us." msgstr "" -#: ../../library/unittest.mock-examples.rst:1258 +#: ../../library/unittest.mock-examples.rst:1259 msgid "" "You can see in this example how a 'standard' call to ``assert_called_with`` " "isn't sufficient:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1273 +#: ../../library/unittest.mock-examples.rst:1274 msgid "" "A comparison function for our ``Foo`` class might look something like this:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1285 +#: ../../library/unittest.mock-examples.rst:1286 msgid "" "And a matcher object that can use comparison functions like this for its " "equality operation would look something like this:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1296 +#: ../../library/unittest.mock-examples.rst:1297 msgid "Putting all this together:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1301 +#: ../../library/unittest.mock-examples.rst:1302 msgid "" "The ``Matcher`` is instantiated with our compare function and the ``Foo`` " "object we want to compare against. In ``assert_called_with`` the ``Matcher`` " @@ -1039,13 +1040,13 @@ msgid "" "raised:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1314 +#: ../../library/unittest.mock-examples.rst:1315 msgid "" "With a bit of tweaking you could have the comparison function raise the :exc:" "`AssertionError` directly and provide a more useful failure message." msgstr "" -#: ../../library/unittest.mock-examples.rst:1317 +#: ../../library/unittest.mock-examples.rst:1318 msgid "" "As of version 1.5, the Python testing library `PyHamcrest `_ provides similar functionality, that may be " diff --git a/library/uuid.po b/library/uuid.po index f2b28e52d6..13cbf26b97 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -49,12 +49,14 @@ msgstr "" "UUID。而 :func:`uuid4` 則會建立一個隨機的 UUID。" #: ../../library/uuid.rst:22 +#, fuzzy msgid "" "Depending on support from the underlying platform, :func:`uuid1` may or may " "not return a \"safe\" UUID. A safe UUID is one which is generated using " "synchronization methods that ensure no two processes can obtain the same " -"UUID. All instances of :class:`UUID` have an :attr:`is_safe` attribute " -"which relays any information about the UUID's safety, using this enumeration:" +"UUID. All instances of :class:`UUID` have an :attr:`~UUID.is_safe` " +"attribute which relays any information about the UUID's safety, using this " +"enumeration:" msgstr "" "根據底層平台的支援情況,:func:`uuid1` 可能會也可能不會回傳一個「安全的」" "UUID。安全的 UUID 是使用同步方法生成的,以確保不會有兩個行程獲取到相同的 " @@ -154,83 +156,57 @@ msgstr "" "UUID 以 6 個整數欄位所組成的元組表示,也可以看作有 6 個個別屬性和 2 個衍生屬" "性:" -#: ../../library/uuid.rst:99 +#: ../../library/uuid.rst:100 msgid "Field" msgstr "欄位" -#: ../../library/uuid.rst:99 +#: ../../library/uuid.rst:101 msgid "Meaning" msgstr "意義" -#: ../../library/uuid.rst:101 -msgid ":attr:`time_low`" -msgstr ":attr:`time_low`" - -#: ../../library/uuid.rst:101 -msgid "the first 32 bits of the UUID" +#: ../../library/uuid.rst:104 +#, fuzzy +msgid "The first 32 bits of the UUID." msgstr "UUID 的前 32 位元" -#: ../../library/uuid.rst:103 -msgid ":attr:`time_mid`" -msgstr ":attr:`time_mid`" - -#: ../../library/uuid.rst:103 ../../library/uuid.rst:105 -msgid "the next 16 bits of the UUID" +#: ../../library/uuid.rst:107 ../../library/uuid.rst:110 +#, fuzzy +msgid "The next 16 bits of the UUID." msgstr "UUID 接下來的 16 位元" -#: ../../library/uuid.rst:105 -msgid ":attr:`time_hi_version`" -msgstr ":attr:`time_hi_version`" - -#: ../../library/uuid.rst:107 -msgid ":attr:`clock_seq_hi_variant`" -msgstr ":attr:`clock_seq_hi_variant`" - -#: ../../library/uuid.rst:107 ../../library/uuid.rst:109 -msgid "the next 8 bits of the UUID" +#: ../../library/uuid.rst:113 ../../library/uuid.rst:116 +#, fuzzy +msgid "The next 8 bits of the UUID." msgstr "UUID 接下來的 8 位元" -#: ../../library/uuid.rst:109 -msgid ":attr:`clock_seq_low`" -msgstr ":attr:`clock_seq_low`" - -#: ../../library/uuid.rst:111 -msgid ":attr:`node`" -msgstr ":attr:`node`" - -#: ../../library/uuid.rst:111 -msgid "the last 48 bits of the UUID" +#: ../../library/uuid.rst:119 +#, fuzzy +msgid "The last 48 bits of the UUID." msgstr "UUID 最後的 48 位元" -#: ../../library/uuid.rst:113 -msgid ":attr:`time`" -msgstr ":attr:`time`" - -#: ../../library/uuid.rst:113 -msgid "the 60-bit timestamp" +#: ../../library/uuid.rst:122 +#, fuzzy +msgid "The 60-bit timestamp." msgstr "60 位元的時間戳" -#: ../../library/uuid.rst:115 -msgid ":attr:`clock_seq`" -msgstr ":attr:`clock_seq`" - -#: ../../library/uuid.rst:115 -msgid "the 14-bit sequence number" +#: ../../library/uuid.rst:125 +#, fuzzy +msgid "The 14-bit sequence number." msgstr "14 位元的序列號" -#: ../../library/uuid.rst:121 +#: ../../library/uuid.rst:130 msgid "The UUID as a 32-character lowercase hexadecimal string." msgstr "UUID 以 32 個小寫十六進位字元組成的字串表示。" -#: ../../library/uuid.rst:126 +#: ../../library/uuid.rst:135 msgid "The UUID as a 128-bit integer." msgstr "UUID 以 128 位元的整數表示。" -#: ../../library/uuid.rst:131 +#: ../../library/uuid.rst:140 msgid "The UUID as a URN as specified in :rfc:`4122`." msgstr "UUID 以 :rfc:`4122` 中指定的 URN 形式表示。" -#: ../../library/uuid.rst:136 +#: ../../library/uuid.rst:145 msgid "" "The UUID variant, which determines the internal layout of the UUID. This " "will be one of the constants :const:`RESERVED_NCS`, :const:`RFC_4122`, :" @@ -240,23 +216,23 @@ msgstr "" "`RFC_4122`、:const:`RESERVED_MICROSOFT` 或 :const:`RESERVED_FUTURE` 其中一個" "常數。" -#: ../../library/uuid.rst:143 +#: ../../library/uuid.rst:152 msgid "" "The UUID version number (1 through 5, meaningful only when the variant is :" "const:`RFC_4122`)." msgstr "UUID 的版本號(1 到 5,只有當變體是 :const:`RFC_4122` 時才有意義)。" -#: ../../library/uuid.rst:148 +#: ../../library/uuid.rst:157 msgid "" "An enumeration of :class:`SafeUUID` which indicates whether the platform " "generated the UUID in a multiprocessing-safe way." msgstr ":class:`SafeUUID` 的列舉,表示平台是否以多行程安全的方式產生 UUID。" -#: ../../library/uuid.rst:153 +#: ../../library/uuid.rst:162 msgid "The :mod:`uuid` module defines the following functions:" msgstr ":mod:`uuid` 模組定義了以下函式:" -#: ../../library/uuid.rst:158 +#: ../../library/uuid.rst:167 msgid "" "Get the hardware address as a 48-bit positive integer. The first time this " "runs, it may launch a separate program, which could be quite slow. If all " @@ -277,7 +253,7 @@ msgstr "" "*),而不是本地管理 (locally administered) 的 MAC 位址,除此之外不保證任何選" "擇的順序。" -#: ../../library/uuid.rst:168 +#: ../../library/uuid.rst:177 msgid "" "Universally administered MAC addresses are preferred over locally " "administered MAC addresses, since the former are guaranteed to be globally " @@ -286,7 +262,7 @@ msgstr "" "通用管理的 MAC 位址優於本地管理的 MAC 位址,因為前者保證是全球唯一的,而後者" "不是。" -#: ../../library/uuid.rst:178 +#: ../../library/uuid.rst:187 msgid "" "Generate a UUID from a host ID, sequence number, and the current time. If " "*node* is not given, :func:`getnode` is used to obtain the hardware address. " @@ -297,7 +273,7 @@ msgstr "" "`getnode` 獲取硬體位址。如果給定 *clock_seq*,會將其用作序列號;否則將使用一" "個隨機 14 位元的序列號。" -#: ../../library/uuid.rst:188 +#: ../../library/uuid.rst:197 msgid "" "Generate a UUID based on the MD5 hash of a namespace identifier (which is a " "UUID) and a name (which is a :class:`bytes` object or a string that will be " @@ -306,11 +282,11 @@ msgstr "" "基於命名空間識別碼 (namespace identifier)(一個 UUID)和名稱(一個 :class:" "`bytes` 物件或使用 UTF-8 編碼的字串)的 MD5 hash 來生成 UUID。" -#: ../../library/uuid.rst:197 +#: ../../library/uuid.rst:206 msgid "Generate a random UUID." msgstr "生成一個隨機的 UUID。" -#: ../../library/uuid.rst:204 +#: ../../library/uuid.rst:213 msgid "" "Generate a UUID based on the SHA-1 hash of a namespace identifier (which is " "a UUID) and a name (which is a :class:`bytes` object or a string that will " @@ -319,7 +295,7 @@ msgstr "" "基於命名空間識別碼(一個 UUID)和名稱(一個 :class:`bytes` 物件或使用 UTF-8 " "編碼的字串)的 SHA-1 hash 來生成 UUID。" -#: ../../library/uuid.rst:210 +#: ../../library/uuid.rst:219 msgid "" "The :mod:`uuid` module defines the following namespace identifiers for use " "with :func:`uuid3` or :func:`uuid5`." @@ -327,7 +303,7 @@ msgstr "" ":mod:`uuid` 模組為 :func:`uuid3` 或 :func:`uuid5` 定義了以下的命名空間識別" "碼。" -#: ../../library/uuid.rst:216 +#: ../../library/uuid.rst:225 msgid "" "When this namespace is specified, the *name* string is a fully qualified " "domain name." @@ -335,50 +311,51 @@ msgstr "" "當指定這個命名空間時,*name* 字串是一個完整網域名稱 (fully qualified domain " "name)。" -#: ../../library/uuid.rst:222 +#: ../../library/uuid.rst:231 msgid "When this namespace is specified, the *name* string is a URL." msgstr "當指定這個命名空間時,*name* 字串是一個 URL。" -#: ../../library/uuid.rst:227 +#: ../../library/uuid.rst:236 msgid "When this namespace is specified, the *name* string is an ISO OID." msgstr "當指定這個命名空間時,*name* 字串是一個 ISO OID。" -#: ../../library/uuid.rst:232 +#: ../../library/uuid.rst:241 msgid "" "When this namespace is specified, the *name* string is an X.500 DN in DER or " "a text output format." msgstr "" "當指定這個命名空間時,*name* 字串是以 DER 或文字輸出格式表示的 X.500 DN。" -#: ../../library/uuid.rst:235 +#: ../../library/uuid.rst:244 +#, fuzzy msgid "" "The :mod:`uuid` module defines the following constants for the possible " -"values of the :attr:`variant` attribute:" +"values of the :attr:`~UUID.variant` attribute:" msgstr ":mod:`uuid` 模組為 :attr:`variant` 屬性的可能值定義了以下常數:" -#: ../../library/uuid.rst:241 +#: ../../library/uuid.rst:250 msgid "Reserved for NCS compatibility." msgstr "保留供 NCS 相容性使用。" -#: ../../library/uuid.rst:246 +#: ../../library/uuid.rst:255 msgid "Specifies the UUID layout given in :rfc:`4122`." msgstr "使用在 :rfc:`4122` 中給定的 UUID 佈局。" -#: ../../library/uuid.rst:251 +#: ../../library/uuid.rst:260 msgid "Reserved for Microsoft compatibility." msgstr "保留供 Microsoft 相容性使用。" -#: ../../library/uuid.rst:256 +#: ../../library/uuid.rst:265 msgid "Reserved for future definition." msgstr "保留供未來定義使用。" -#: ../../library/uuid.rst:262 +#: ../../library/uuid.rst:271 msgid ":rfc:`4122` - A Universally Unique IDentifier (UUID) URN Namespace" msgstr "" ":rfc:`4122` - 通用唯一辨識碼 (UUID, Universally Unique IDentifier) 的 URN 命" "名空間" -#: ../../library/uuid.rst:262 +#: ../../library/uuid.rst:271 msgid "" "This specification defines a Uniform Resource Name namespace for UUIDs, the " "internal format of UUIDs, and methods of generating UUIDs." @@ -386,30 +363,30 @@ msgstr "" "這個規範定義了 UUID 的統一資源名稱 (Uniform Resource Name) 命名空間、UUID 的" "內部格式和生成 UUID 的方法。" -#: ../../library/uuid.rst:269 +#: ../../library/uuid.rst:278 msgid "Command-Line Usage" msgstr "命令列的用法" -#: ../../library/uuid.rst:273 +#: ../../library/uuid.rst:282 msgid "" "The :mod:`uuid` module can be executed as a script from the command line." msgstr ":mod:`uuid` 模組可以在命令列下作為腳本來執行。" -#: ../../library/uuid.rst:279 +#: ../../library/uuid.rst:288 msgid "The following options are accepted:" msgstr "可以接受以下選項:" -#: ../../library/uuid.rst:285 +#: ../../library/uuid.rst:294 msgid "Show the help message and exit." msgstr "顯示幫助訊息並退出。" -#: ../../library/uuid.rst:290 +#: ../../library/uuid.rst:299 msgid "" "Specify the function name to use to generate the uuid. By default :func:" "`uuid4` is used." msgstr "指定要用來生成 UUID 的函式名稱。預設使用 :func:`uuid4`。" -#: ../../library/uuid.rst:296 +#: ../../library/uuid.rst:305 msgid "" "The namespace is a ``UUID``, or ``@ns`` where ``ns`` is a well-known " "predefined UUID addressed by namespace name. Such as ``@dns``, ``@url``, " @@ -420,49 +397,73 @@ msgstr "" "空間名稱,例如 ``@dns``、``@url``、``@oid`` 和 ``@x500``。 只有 :func:" "`uuid3` / :func:`uuid5` 函式會需要。" -#: ../../library/uuid.rst:303 +#: ../../library/uuid.rst:312 msgid "" "The name used as part of generating the uuid. Only required for :func:" "`uuid3` / :func:`uuid5` functions." msgstr "用於生成 uuid 的名稱。只有 :func:`uuid3` / :func:`uuid5` 函式會需要。" -#: ../../library/uuid.rst:310 +#: ../../library/uuid.rst:319 msgid "Example" msgstr "範例" -#: ../../library/uuid.rst:312 +#: ../../library/uuid.rst:321 msgid "Here are some examples of typical usage of the :mod:`uuid` module::" msgstr "" "以下是一些 :mod:`uuid` 模組的典型使用範例:\n" "\n" "::" -#: ../../library/uuid.rst:351 +#: ../../library/uuid.rst:360 msgid "Command-Line Example" msgstr "命令列的範例" -#: ../../library/uuid.rst:353 +#: ../../library/uuid.rst:362 msgid "" "Here are some examples of typical usage of the :mod:`uuid` command line " "interface:" msgstr "以下是一些 :mod:`uuid` 命令列介面的典型使用範例:" -#: ../../library/uuid.rst:173 +#: ../../library/uuid.rst:182 msgid "getnode" msgstr "getnode" -#: ../../library/uuid.rst:183 +#: ../../library/uuid.rst:192 msgid "uuid1" msgstr "uuid1" -#: ../../library/uuid.rst:192 +#: ../../library/uuid.rst:201 msgid "uuid3" msgstr "uuid3" -#: ../../library/uuid.rst:199 +#: ../../library/uuid.rst:208 msgid "uuid4" msgstr "uuid4" -#: ../../library/uuid.rst:208 +#: ../../library/uuid.rst:217 msgid "uuid5" msgstr "uuid5" + +#~ msgid ":attr:`time_low`" +#~ msgstr ":attr:`time_low`" + +#~ msgid ":attr:`time_mid`" +#~ msgstr ":attr:`time_mid`" + +#~ msgid ":attr:`time_hi_version`" +#~ msgstr ":attr:`time_hi_version`" + +#~ msgid ":attr:`clock_seq_hi_variant`" +#~ msgstr ":attr:`clock_seq_hi_variant`" + +#~ msgid ":attr:`clock_seq_low`" +#~ msgstr ":attr:`clock_seq_low`" + +#~ msgid ":attr:`node`" +#~ msgstr ":attr:`node`" + +#~ msgid ":attr:`time`" +#~ msgstr ":attr:`time`" + +#~ msgid ":attr:`clock_seq`" +#~ msgstr ":attr:`clock_seq`" diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 7ee36c62e6..bdb234b8b7 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2021-07-05 14:35+0800\n" "Last-Translator: meowmeowcat \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -162,9 +162,10 @@ msgid "The Customization Modules" msgstr "客製化模組" #: ../../tutorial/appendix.rst:104 +#, fuzzy msgid "" -"Python provides two hooks to let you customize it: :mod:`sitecustomize` and :" -"mod:`usercustomize`. To see how it works, you need first to find the " +"Python provides two hooks to let you customize it: :index:`sitecustomize` " +"and :index:`usercustomize`. To see how it works, you need first to find the " "location of your user site-packages directory. Start Python and run this " "code::" msgstr "" @@ -186,10 +187,11 @@ msgstr "" "啟動以禁用自動 import 。" #: ../../tutorial/appendix.rst:116 +#, fuzzy msgid "" -":mod:`sitecustomize` works in the same way, but is typically created by an " +":index:`sitecustomize` works in the same way, but is typically created by an " "administrator of the computer in the global site-packages directory, and is " -"imported before :mod:`usercustomize`. See the documentation of the :mod:" +"imported before :index:`usercustomize`. See the documentation of the :mod:" "`site` module for more details." msgstr "" ":mod:`sitecustomize` 的運作方式相同,但通常是由電腦的管理員在全域 site-" From dcefeac0552cb229a0e8c2dd702e79c61f2c066c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 4 Sep 2023 16:17:17 +0000 Subject: [PATCH 09/18] sync with cpython e0f60808 --- library/itertools.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/itertools.po b/library/itertools.po index 91e47042bf..9113d9bac3 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-04 16:14+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -889,6 +889,6 @@ msgid "" "term:`generator`\\s which incur interpreter overhead." msgstr "" -#: ../../library/itertools.rst:1025 +#: ../../library/itertools.rst:1021 msgid "The following recipes have a more mathematical flavor:" msgstr "" From cf8f0d4a3ff0b08012f30bc7984e05808d7a69ef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 Sep 2023 00:06:05 +0000 Subject: [PATCH 10/18] sync with cpython 88ff02e3 --- faq/gui.po | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/faq/gui.po b/faq/gui.po index d22809b8e0..2911cabe0a 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"POT-Creation-Date: 2023-09-05 00:04+0000\n" "PO-Revision-Date: 2022-07-02 17:41+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -84,10 +84,11 @@ msgstr "" "用程式不是真正的獨立,因為該應用程式仍然需要 Tcl 和 Tk 函式庫。" #: ../../faq/gui.rst:45 +#, fuzzy msgid "" "One solution is to ship the application with the Tcl and Tk libraries, and " -"point to them at run-time using the :envvar:`TCL_LIBRARY` and :envvar:" -"`TK_LIBRARY` environment variables." +"point to them at run-time using the :envvar:`!TCL_LIBRARY` and :envvar:`!" +"TK_LIBRARY` environment variables." msgstr "" "將應用程式與 Tcl 和 Tk 函式庫一併發送是一種解決方法,並在執行環境 (run-time) " "使用 :envvar:`TCL_LIBRARY` 和 :envvar:`TK_LIBRARY` 環境變數來指向該函式庫。" @@ -104,9 +105,10 @@ msgstr "" "一部分 (https://tix.sourceforge.net/)。" #: ../../faq/gui.rst:54 +#, fuzzy msgid "" -"Build Tix with SAM enabled, perform the appropriate call to :c:func:" -"`Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link " +"Build Tix with SAM enabled, perform the appropriate call to :c:func:`!" +"Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link " "with libtclsam and libtksam (you might include the Tix libraries as well)." msgstr "" "請在 SAM 被啟用的情況下建置 Tix,對 Python 的 :file:`Modules/tkappinit.c` 中" @@ -118,10 +120,11 @@ msgid "Can I have Tk events handled while waiting for I/O?" msgstr "是否可以在等待 I/O 時處理 Tk 事件?" #: ../../faq/gui.rst:63 +#, fuzzy msgid "" "On platforms other than Windows, yes, and you don't even need threads! But " "you'll have to restructure your I/O code a bit. Tk has the equivalent of " -"Xt's :c:func:`XtAddInput()` call, which allows you to register a callback " +"Xt's :c:func:`!XtAddInput` call, which allows you to register a callback " "function which will be called from the Tk mainloop when I/O is possible on a " "file descriptor. See :ref:`tkinter-file-handlers`." msgstr "" @@ -136,15 +139,16 @@ msgid "I can't get key bindings to work in Tkinter: why?" msgstr "我無法讓鍵繫結 (key binding) 在 Tkinter 中作用:為什麼?" #: ../../faq/gui.rst:73 +#, fuzzy msgid "" -"An often-heard complaint is that event handlers bound to events with the :" -"meth:`bind` method don't get handled even when the appropriate key is " -"pressed." +"An often-heard complaint is that event handlers :ref:`bound ` to events with the :meth:`!bind` method don't get handled even when " +"the appropriate key is pressed." msgstr "" "一個經常聽到的抱怨是,儘管事件處理程式 (event handler) 已經繫結到帶有 :meth:" "`bind` method 的事件,但在按下相應的鍵時,該事件也沒有被處理。" -#: ../../faq/gui.rst:76 +#: ../../faq/gui.rst:77 msgid "" "The most common cause is that the widget to which the binding applies " "doesn't have \"keyboard focus\". Check out the Tk documentation for the " From d4d700263bad2c609ad2cc50b7d8c32d55901fd4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 6 Sep 2023 00:06:23 +0000 Subject: [PATCH 11/18] sync with cpython 495ba703 --- library/sys.monitoring.po | 540 +++++++++++++++++ library/sys.po | 16 +- whatsnew/3.12.po | 1156 +++++++++++++++++++------------------ 3 files changed, 1139 insertions(+), 573 deletions(-) create mode 100644 library/sys.monitoring.po diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po new file mode 100644 index 0000000000..58353e1ae7 --- /dev/null +++ b/library/sys.monitoring.po @@ -0,0 +1,540 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2023, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-09-06 00:03+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/sys.monitoring.rst:2 +msgid ":mod:`sys.monitoring` --- Execution event monitoring" +msgstr "" + +#: ../../library/sys.monitoring.rst:11 +msgid "" +"``sys.monitoring`` is a namespace within the ``sys`` module, not an " +"independent module, so there is no need to ``import sys.monitoring``, simply " +"``import sys`` and then use ``sys.monitoring``." +msgstr "" + +#: ../../library/sys.monitoring.rst:17 +msgid "" +"This namespace provides access to the functions and constants necessary to " +"activate and control event monitoring." +msgstr "" + +#: ../../library/sys.monitoring.rst:20 +msgid "" +"As programs execute, events occur that might be of interest to tools that " +"monitor execution. The :mod:`!sys.monitoring` namespace provides means to " +"receive callbacks when events of interest occur." +msgstr "" + +#: ../../library/sys.monitoring.rst:24 +msgid "The monitoring API consists of three components:" +msgstr "" + +#: ../../library/sys.monitoring.rst:26 ../../library/sys.monitoring.rst:31 +msgid "Tool identifiers" +msgstr "" + +#: ../../library/sys.monitoring.rst:27 ../../library/sys.monitoring.rst:74 +msgid "Events" +msgstr "" + +#: ../../library/sys.monitoring.rst:28 +msgid "Callbacks" +msgstr "" + +#: ../../library/sys.monitoring.rst:33 +msgid "" +"A tool identifier is an integer and associated name. Tool identifiers are " +"used to discourage tools from interfering with each other and to allow " +"multiple tools to operate at the same time. Currently tools are completely " +"independent and cannot be used to monitor each other. This restriction may " +"be lifted in the future." +msgstr "" + +#: ../../library/sys.monitoring.rst:39 +msgid "" +"Before registering or activating events, a tool should choose an identifier. " +"Identifiers are integers in the range 0 to 5." +msgstr "" + +#: ../../library/sys.monitoring.rst:43 +msgid "Registering and using tools" +msgstr "" + +#: ../../library/sys.monitoring.rst:47 +msgid "" +"Must be called before ``id`` can be used. ``id`` must be in the range 0 to 5 " +"inclusive. Raises a ``ValueError`` if ``id`` is in use." +msgstr "" + +#: ../../library/sys.monitoring.rst:53 +msgid "Should be called once a tool no longer requires ``id``." +msgstr "" + +#: ../../library/sys.monitoring.rst:57 +msgid "" +"Returns the name of the tool if ``id`` is in use, otherwise it returns " +"``None``. ``id`` must be in the range 0 to 5 inclusive." +msgstr "" + +#: ../../library/sys.monitoring.rst:61 +msgid "" +"All IDs are treated the same by the VM with regard to events, but the " +"following IDs are pre-defined to make co-operation of tools easier::" +msgstr "" + +#: ../../library/sys.monitoring.rst:69 +msgid "" +"There is no obligation to set an ID, nor is there anything preventing a tool " +"from using an ID even it is already in use. However, tools are encouraged to " +"use a unique ID and respect other tools." +msgstr "" + +#: ../../library/sys.monitoring.rst:76 +msgid "The following events are supported:" +msgstr "" + +#: ../../library/sys.monitoring.rst:78 ../../library/sys.monitoring.rst:138 +msgid "BRANCH" +msgstr "" + +#: ../../library/sys.monitoring.rst:79 +msgid "A conditional branch is taken (or not)." +msgstr "" + +#: ../../library/sys.monitoring.rst:80 ../../library/sys.monitoring.rst:134 +msgid "CALL" +msgstr "" + +#: ../../library/sys.monitoring.rst:81 +msgid "A call in Python code (event occurs before the call)." +msgstr "" + +#: ../../library/sys.monitoring.rst:82 ../../library/sys.monitoring.rst:147 +msgid "C_RAISE" +msgstr "" + +#: ../../library/sys.monitoring.rst:83 +msgid "" +"Exception raised from any callable, except Python functions (event occurs " +"after the exit)." +msgstr "" + +#: ../../library/sys.monitoring.rst:84 ../../library/sys.monitoring.rst:148 +msgid "C_RETURN" +msgstr "" + +#: ../../library/sys.monitoring.rst:85 +msgid "" +"Return from any callable, except Python functions (event occurs after the " +"return)." +msgstr "" + +#: ../../library/sys.monitoring.rst:86 ../../library/sys.monitoring.rst:165 +msgid "EXCEPTION_HANDLED" +msgstr "" + +#: ../../library/sys.monitoring.rst:87 +msgid "An exception is handled." +msgstr "" + +#: ../../library/sys.monitoring.rst:88 ../../library/sys.monitoring.rst:136 +msgid "INSTRUCTION" +msgstr "" + +#: ../../library/sys.monitoring.rst:89 +msgid "A VM instruction is about to be executed." +msgstr "" + +#: ../../library/sys.monitoring.rst:90 ../../library/sys.monitoring.rst:137 +msgid "JUMP" +msgstr "" + +#: ../../library/sys.monitoring.rst:91 +msgid "An unconditional jump in the control flow graph is made." +msgstr "" + +#: ../../library/sys.monitoring.rst:92 ../../library/sys.monitoring.rst:135 +msgid "LINE" +msgstr "" + +#: ../../library/sys.monitoring.rst:93 +msgid "" +"An instruction is about to be executed that has a different line number from " +"the preceding instruction." +msgstr "" + +#: ../../library/sys.monitoring.rst:94 ../../library/sys.monitoring.rst:131 +msgid "PY_RESUME" +msgstr "" + +#: ../../library/sys.monitoring.rst:95 +msgid "" +"Resumption of a Python function (for generator and coroutine functions), " +"except for throw() calls." +msgstr "" + +#: ../../library/sys.monitoring.rst:96 ../../library/sys.monitoring.rst:132 +msgid "PY_RETURN" +msgstr "" + +#: ../../library/sys.monitoring.rst:97 +msgid "" +"Return from a Python function (occurs immediately before the return, the " +"callee's frame will be on the stack)." +msgstr "" + +#: ../../library/sys.monitoring.rst:98 ../../library/sys.monitoring.rst:130 +msgid "PY_START" +msgstr "" + +#: ../../library/sys.monitoring.rst:99 +msgid "" +"Start of a Python function (occurs immediately after the call, the callee's " +"frame will be on the stack)" +msgstr "" + +#: ../../library/sys.monitoring.rst:100 ../../library/sys.monitoring.rst:162 +msgid "PY_THROW" +msgstr "" + +#: ../../library/sys.monitoring.rst:101 +msgid "A Python function is resumed by a throw() call." +msgstr "" + +#: ../../library/sys.monitoring.rst:102 ../../library/sys.monitoring.rst:163 +msgid "PY_UNWIND" +msgstr "" + +#: ../../library/sys.monitoring.rst:103 +msgid "Exit from a Python function during exception unwinding." +msgstr "" + +#: ../../library/sys.monitoring.rst:104 ../../library/sys.monitoring.rst:133 +msgid "PY_YIELD" +msgstr "" + +#: ../../library/sys.monitoring.rst:105 +msgid "" +"Yield from a Python function (occurs immediately before the yield, the " +"callee's frame will be on the stack)." +msgstr "" + +#: ../../library/sys.monitoring.rst:106 ../../library/sys.monitoring.rst:164 +msgid "RAISE" +msgstr "" + +#: ../../library/sys.monitoring.rst:107 +msgid "" +"An exception is raised, except those that cause a ``STOP_ITERATION`` event." +msgstr "" + +#: ../../library/sys.monitoring.rst:108 +msgid "RERAISE" +msgstr "" + +#: ../../library/sys.monitoring.rst:109 +msgid "" +"An exception is re-raised, for example at the end of a ``finally`` block." +msgstr "" + +#: ../../library/sys.monitoring.rst:111 ../../library/sys.monitoring.rst:139 +msgid "STOP_ITERATION" +msgstr "" + +#: ../../library/sys.monitoring.rst:111 +msgid "" +"An artificial ``StopIteration`` is raised; see `the STOP_ITERATION event`_." +msgstr "" + +#: ../../library/sys.monitoring.rst:113 +msgid "More events may be added in the future." +msgstr "" + +#: ../../library/sys.monitoring.rst:115 +msgid "" +"These events are attributes of the :mod:`!sys.monitoring.events` namespace. " +"Each event is represented as a power-of-2 integer constant. To define a set " +"of events, simply bitwise or the individual events together. For example, to " +"specify both ``PY_RETURN`` and ``PY_START`` events, use the expression " +"``PY_RETURN | PY_START``." +msgstr "" + +#: ../../library/sys.monitoring.rst:121 +msgid "Events are divided into three groups:" +msgstr "" + +#: ../../library/sys.monitoring.rst:124 +msgid "Local events" +msgstr "" + +#: ../../library/sys.monitoring.rst:126 +msgid "" +"Local events are associated with normal execution of the program and happen " +"at clearly defined locations. All local events can be disabled. The local " +"events are:" +msgstr "" + +#: ../../library/sys.monitoring.rst:142 +msgid "Ancillary events" +msgstr "" + +#: ../../library/sys.monitoring.rst:144 +msgid "" +"Ancillary events can be monitored like other events, but are controlled by " +"another event:" +msgstr "" + +#: ../../library/sys.monitoring.rst:150 +msgid "" +"The ``C_RETURN`` and ``C_RAISE`` events are are controlled by the ``CALL`` " +"event. ``C_RETURN`` and ``C_RAISE`` events will only be seen if the " +"corresponding ``CALL`` event is being monitored." +msgstr "" + +#: ../../library/sys.monitoring.rst:155 +msgid "Other events" +msgstr "" + +#: ../../library/sys.monitoring.rst:157 +msgid "" +"Other events are not necessarily tied to a specific location in the program " +"and cannot be individually disabled." +msgstr "" + +#: ../../library/sys.monitoring.rst:160 +msgid "The other events that can be monitored are:" +msgstr "" + +#: ../../library/sys.monitoring.rst:169 +msgid "The STOP_ITERATION event" +msgstr "" + +#: ../../library/sys.monitoring.rst:171 +msgid "" +":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a " +"``StopIteration`` exception is raised when returning a value from a " +"generator or coroutine. However, this is a very inefficient way to return a " +"value, so some Python implementations, notably CPython 3.12+, do not raise " +"an exception unless it would be visible to other code." +msgstr "" + +#: ../../library/sys.monitoring.rst:177 +msgid "" +"To allow tools to monitor for real exceptions without slowing down " +"generators and coroutines, the ``STOP_ITERATION`` event is provided. " +"``STOP_ITERATION`` can be locally disabled, unlike ``RAISE``." +msgstr "" + +#: ../../library/sys.monitoring.rst:183 +msgid "Turning events on and off" +msgstr "" + +#: ../../library/sys.monitoring.rst:185 +msgid "" +"In order to monitor an event, it must be turned on and a callback " +"registered. Events can be turned on or off by setting the events either " +"globally or for a particular code object." +msgstr "" + +#: ../../library/sys.monitoring.rst:191 +msgid "Setting events globally" +msgstr "" + +#: ../../library/sys.monitoring.rst:193 +msgid "" +"Events can be controlled globally by modifying the set of events being " +"monitored." +msgstr "" + +#: ../../library/sys.monitoring.rst:197 +msgid "Returns the ``int`` representing all the active events." +msgstr "" + +#: ../../library/sys.monitoring.rst:201 +msgid "" +"Activates all events which are set in ``event_set``. Raises a ``ValueError`` " +"if ``tool_id`` is not in use." +msgstr "" + +#: ../../library/sys.monitoring.rst:204 +msgid "No events are active by default." +msgstr "" + +#: ../../library/sys.monitoring.rst:207 +msgid "Per code object events" +msgstr "" + +#: ../../library/sys.monitoring.rst:209 +msgid "Events can also be controlled on a per code object basis." +msgstr "" + +#: ../../library/sys.monitoring.rst:213 +msgid "Returns all the local events for ``code``" +msgstr "" + +#: ../../library/sys.monitoring.rst:217 +msgid "" +"Activates all the local events for ``code`` which are set in ``event_set``. " +"Raises a ``ValueError`` if ``tool_id`` is not in use." +msgstr "" + +#: ../../library/sys.monitoring.rst:220 +msgid "" +"Local events add to global events, but do not mask them. In other words, all " +"global events will trigger for a code object, regardless of the local events." +msgstr "" + +#: ../../library/sys.monitoring.rst:226 +msgid "Disabling events" +msgstr "" + +#: ../../library/sys.monitoring.rst:228 +msgid "" +"Local events can be disabled for a specific code location by returning ``sys." +"monitoring.DISABLE`` from a callback function. This does not change which " +"events are set, or any other code locations for the same event." +msgstr "" + +#: ../../library/sys.monitoring.rst:232 +msgid "" +"Disabling events for specific locations is very important for high " +"performance monitoring. For example, a program can be run under a debugger " +"with no overhead if the debugger disables all monitoring except for a few " +"breakpoints." +msgstr "" + +#: ../../library/sys.monitoring.rst:239 +msgid "Registering callback functions" +msgstr "" + +#: ../../library/sys.monitoring.rst:241 +msgid "To register a callable for events call" +msgstr "" + +#: ../../library/sys.monitoring.rst:245 +msgid "" +"Registers the callable ``func`` for the ``event`` with the given ``tool_id``" +msgstr "" + +#: ../../library/sys.monitoring.rst:247 +msgid "" +"If another callback was registered for the given ``tool_id`` and ``event``, " +"it is unregistered and returned. Otherwise ``register_callback`` returns " +"``None``." +msgstr "" + +#: ../../library/sys.monitoring.rst:252 +msgid "" +"Functions can be unregistered by calling ``sys.monitoring." +"register_callback(tool_id, event, None)``." +msgstr "" + +#: ../../library/sys.monitoring.rst:255 +msgid "Callback functions can be registered and unregistered at any time." +msgstr "" + +#: ../../library/sys.monitoring.rst:257 +msgid "" +"Registering or unregistering a callback function will generate a ``sys." +"audit`` event." +msgstr "" + +#: ../../library/sys.monitoring.rst:261 +msgid "Callback function arguments" +msgstr "" + +#: ../../library/sys.monitoring.rst:263 +msgid "" +"When an active event occurs, the registered callback function is called. " +"Different events will provide the callback function with different " +"arguments, as follows:" +msgstr "" + +#: ../../library/sys.monitoring.rst:266 +msgid "``PY_START`` and ``PY_RESUME``::" +msgstr "" + +#: ../../library/sys.monitoring.rst:270 +msgid "``PY_RETURN`` and ``PY_YIELD``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:272 +msgid "" +"``func(code: CodeType, instruction_offset: int, retval: object) -> DISABLE | " +"Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:274 +msgid "``CALL``, ``C_RAISE`` and ``C_RETURN``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:276 +msgid "" +"``func(code: CodeType, instruction_offset: int, callable: object, arg0: " +"object | MISSING) -> DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:278 +msgid "If there are no arguments, ``arg0`` is set to ``MISSING``." +msgstr "" + +#: ../../library/sys.monitoring.rst:280 +msgid "" +"``RAISE``, ``RERAISE``, ``EXCEPTION_HANDLED``, ``PY_UNWIND``, ``PY_THROW`` " +"and ``STOP_ITERATION``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:282 +msgid "" +"``func(code: CodeType, instruction_offset: int, exception: BaseException) -> " +"DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:284 +msgid "``LINE``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:286 +msgid "``func(code: CodeType, line_number: int) -> DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:288 +msgid "``BRANCH`` and ``JUMP``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:290 +msgid "" +"``func(code: CodeType, instruction_offset: int, destination_offset: int) -> " +"DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:292 +msgid "" +"Note that the ``destination_offset`` is where the code will next execute. " +"For an untaken branch this will be the offset of the instruction following " +"the branch." +msgstr "" + +#: ../../library/sys.monitoring.rst:296 +msgid "``INSTRUCTION``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:298 +msgid "``func(code: CodeType, instruction_offset: int) -> DISABLE | Any``" +msgstr "" diff --git a/library/sys.po b/library/sys.po index bf8dcc3cde..21b9d3dc3d 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-21 00:03+0000\n" +"POT-Creation-Date: 2023-09-06 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2532,25 +2532,31 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1958 +#: ../../library/sys.rst:1959 +msgid "" +"Namespace containing functions and constants for register callbacks and " +"controlling monitoring events. See :mod:`sys.monitoring` for details." +msgstr "" + +#: ../../library/sys.rst:1965 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1974 +#: ../../library/sys.rst:1981 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1982 +#: ../../library/sys.rst:1989 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1983 +#: ../../library/sys.rst:1990 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index a5b402c852..33d9955dbd 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-01 00:03+0000\n" +"POT-Creation-Date: 2023-09-06 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -62,7 +62,7 @@ msgid "New grammar features:" msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:71 -msgid ":pep:`701`: Syntactic formalization of f-strings" +msgid ":ref:`whatsnew312-pep701`" msgstr "" #: ../../whatsnew/3.12.rst:73 @@ -74,52 +74,56 @@ msgid ":ref:`whatsnew312-pep684`" msgstr "" #: ../../whatsnew/3.12.rst:77 +msgid ":ref:`whatsnew312-pep669`" +msgstr "" + +#: ../../whatsnew/3.12.rst:79 msgid "New typing features:" msgstr "新增型別特性:" -#: ../../whatsnew/3.12.rst:79 -msgid ":pep:`688`: Making the buffer protocol accessible in Python" +#: ../../whatsnew/3.12.rst:81 +msgid ":ref:`whatsnew312-pep688`" msgstr "" -#: ../../whatsnew/3.12.rst:81 +#: ../../whatsnew/3.12.rst:83 msgid ":ref:`whatsnew312-pep692`" msgstr ":ref:`whatsnew312-pep692`" -#: ../../whatsnew/3.12.rst:83 +#: ../../whatsnew/3.12.rst:85 msgid ":ref:`whatsnew312-pep695`" msgstr ":ref:`whatsnew312-pep695`" -#: ../../whatsnew/3.12.rst:85 -msgid ":pep:`698`: Override Decorator for Static Typing" +#: ../../whatsnew/3.12.rst:87 +msgid ":ref:`whatsnew312-pep698`" msgstr "" -#: ../../whatsnew/3.12.rst:87 +#: ../../whatsnew/3.12.rst:89 msgid "Important deprecations, removals or restrictions:" msgstr "" -#: ../../whatsnew/3.12.rst:89 +#: ../../whatsnew/3.12.rst:91 msgid ":pep:`623`: Remove wstr from Unicode" msgstr "" -#: ../../whatsnew/3.12.rst:91 +#: ../../whatsnew/3.12.rst:93 msgid "" ":pep:`632`: Remove the ``distutils`` package. See `the migration guide " "`_ for advice on its " "replacement." msgstr "" -#: ../../whatsnew/3.12.rst:96 +#: ../../whatsnew/3.12.rst:98 msgid "Improved Error Messages" msgstr "" -#: ../../whatsnew/3.12.rst:98 +#: ../../whatsnew/3.12.rst:100 msgid "" "Modules from the standard library are now potentially suggested as part of " "the error messages displayed by the interpreter when a :exc:`NameError` is " "raised to the top level. Contributed by Pablo Galindo in :gh:`98254`." msgstr "" -#: ../../whatsnew/3.12.rst:107 +#: ../../whatsnew/3.12.rst:109 msgid "" "Improve the error suggestion for :exc:`NameError` exceptions for instances. " "Now if a :exc:`NameError` is raised in a method and the instance has an " @@ -128,14 +132,14 @@ msgid "" "scope. Contributed by Pablo Galindo in :gh:`99139`." msgstr "" -#: ../../whatsnew/3.12.rst:128 +#: ../../whatsnew/3.12.rst:130 msgid "" "Improve the :exc:`SyntaxError` error message when the user types ``import x " "from y`` instead of ``from y import x``. Contributed by Pablo Galindo in :gh:" "`98931`." msgstr "" -#: ../../whatsnew/3.12.rst:138 +#: ../../whatsnew/3.12.rst:140 msgid "" ":exc:`ImportError` exceptions raised from failed ``from import " "`` statements now include suggestions for the value of ```` " @@ -143,15 +147,15 @@ msgid "" "in :gh:`91058`." msgstr "" -#: ../../whatsnew/3.12.rst:149 ../../whatsnew/3.12.rst:1653 +#: ../../whatsnew/3.12.rst:151 ../../whatsnew/3.12.rst:1672 msgid "New Features" msgstr "新增特性" -#: ../../whatsnew/3.12.rst:154 +#: ../../whatsnew/3.12.rst:156 msgid "PEP 701: Syntactic formalization of f-strings" msgstr "" -#: ../../whatsnew/3.12.rst:156 +#: ../../whatsnew/3.12.rst:158 msgid "" ":pep:`701` lifts some restrictions on the usage of f-strings. Expression " "components inside f-strings can now be any valid Python expression including " @@ -160,7 +164,7 @@ msgid "" "in detail:" msgstr "" -#: ../../whatsnew/3.12.rst:161 +#: ../../whatsnew/3.12.rst:163 msgid "" "Quote reuse: in Python 3.11, reusing the same quotes as the containing f-" "string raises a :exc:`SyntaxError`, forcing the user to either use other " @@ -168,7 +172,7 @@ msgid "" "uses single quotes). In Python 3.12, you can now do things like this:" msgstr "" -#: ../../whatsnew/3.12.rst:170 +#: ../../whatsnew/3.12.rst:172 msgid "" "Note that before this change there was no explicit limit in how f-strings " "can be nested, but the fact that string quotes cannot be reused inside the " @@ -176,13 +180,13 @@ msgid "" "arbitrarily. In fact, this is the most nested f-string that could be written:" msgstr "" -#: ../../whatsnew/3.12.rst:178 +#: ../../whatsnew/3.12.rst:180 msgid "" "As now f-strings can contain any valid Python expression inside expression " "components, it is now possible to nest f-strings arbitrarily:" msgstr "" -#: ../../whatsnew/3.12.rst:184 +#: ../../whatsnew/3.12.rst:186 msgid "" "Multi-line expressions and comments: In Python 3.11, f-strings expressions " "must be defined in a single line even if outside f-strings expressions could " @@ -191,7 +195,7 @@ msgid "" "spanning multiple lines and include comments on them:" msgstr "" -#: ../../whatsnew/3.12.rst:197 +#: ../../whatsnew/3.12.rst:199 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " "couldn't contain any ``\\`` character. This also affected unicode escaped " @@ -200,11 +204,11 @@ msgid "" "can define expressions like this:" msgstr "" -#: ../../whatsnew/3.12.rst:210 +#: ../../whatsnew/3.12.rst:212 msgid "See :pep:`701` for more details." msgstr "詳情請見 :pep:`701`。" -#: ../../whatsnew/3.12.rst:212 +#: ../../whatsnew/3.12.rst:214 msgid "" "As a positive side-effect of how this feature has been implemented (by " "parsing f-strings with the PEG parser (see :pep:`617`), now error messages " @@ -213,7 +217,7 @@ msgid "" "`SyntaxError`:" msgstr "" -#: ../../whatsnew/3.12.rst:225 +#: ../../whatsnew/3.12.rst:227 msgid "" "but the error message doesn't include the exact location of the error within " "the line and also has the expression artificially surrounded by parentheses. " @@ -221,25 +225,25 @@ msgid "" "can be more precise and show the entire line:" msgstr "" -#: ../../whatsnew/3.12.rst:237 +#: ../../whatsnew/3.12.rst:239 msgid "" "(Contributed by Pablo Galindo, Batuhan Taskaya, Lysandros Nikolaou, Cristián " "Maureira-Fredes and Marta Gómez in :gh:`102856`. PEP written by Pablo " "Galindo, Batuhan Taskaya, Lysandros Nikolaou and Marta Gómez)." msgstr "" -#: ../../whatsnew/3.12.rst:244 +#: ../../whatsnew/3.12.rst:246 msgid "PEP 709: Comprehension inlining" msgstr "" -#: ../../whatsnew/3.12.rst:246 +#: ../../whatsnew/3.12.rst:248 msgid "" "Dictionary, list, and set comprehensions are now inlined, rather than " "creating a new single-use function object for each execution of the " "comprehension. This speeds up execution of a comprehension by up to 2x." msgstr "" -#: ../../whatsnew/3.12.rst:250 +#: ../../whatsnew/3.12.rst:252 msgid "" "Comprehension iteration variables remain isolated; they don't overwrite a " "variable of the same name in the outer scope, nor are they visible after the " @@ -247,24 +251,24 @@ msgid "" "manipulation, not via separate function scope." msgstr "" -#: ../../whatsnew/3.12.rst:255 +#: ../../whatsnew/3.12.rst:257 msgid "Inlining does result in a few visible behavior changes:" msgstr "" -#: ../../whatsnew/3.12.rst:257 +#: ../../whatsnew/3.12.rst:259 msgid "" "There is no longer a separate frame for the comprehension in tracebacks, and " "tracing/profiling no longer shows the comprehension as a function call." msgstr "" -#: ../../whatsnew/3.12.rst:259 +#: ../../whatsnew/3.12.rst:261 msgid "" "Calling :func:`locals` inside a comprehension now includes variables from " "outside the comprehension, and no longer includes the synthetic ``.0`` " "variable for the comprehension \"argument\"." msgstr "" -#: ../../whatsnew/3.12.rst:262 +#: ../../whatsnew/3.12.rst:264 msgid "" "A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " "locals()]``) may see \"RuntimeError: dictionary changed size during " @@ -274,22 +278,22 @@ msgid "" "[k for k in keys]``." msgstr "" -#: ../../whatsnew/3.12.rst:269 +#: ../../whatsnew/3.12.rst:271 msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." msgstr "" -#: ../../whatsnew/3.12.rst:272 +#: ../../whatsnew/3.12.rst:276 msgid "PEP 688: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:274 +#: ../../whatsnew/3.12.rst:278 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" -#: ../../whatsnew/3.12.rst:278 +#: ../../whatsnew/3.12.rst:282 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" @@ -297,76 +301,92 @@ msgid "" "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" -#: ../../whatsnew/3.12.rst:287 +#: ../../whatsnew/3.12.rst:291 msgid "PEP 684: A Per-Interpreter GIL" msgstr "" -#: ../../whatsnew/3.12.rst:289 +#: ../../whatsnew/3.12.rst:293 msgid "" "Sub-interpreters may now be created with a unique GIL per interpreter. This " "allows Python programs to take full advantage of multiple CPU cores." msgstr "" -#: ../../whatsnew/3.12.rst:293 +#: ../../whatsnew/3.12.rst:297 msgid "" "Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " "interpreter with its own GIL::" msgstr "" -#: ../../whatsnew/3.12.rst:307 +#: ../../whatsnew/3.12.rst:311 msgid "" "For further examples how to use the C-API for sub-interpreters with a per-" "interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." msgstr "" -#: ../../whatsnew/3.12.rst:310 +#: ../../whatsnew/3.12.rst:314 msgid "A Python API is anticipated for 3.13. (See :pep:`554`.)" msgstr "" -#: ../../whatsnew/3.12.rst:312 +#: ../../whatsnew/3.12.rst:316 msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" -#: ../../whatsnew/3.12.rst:315 +#: ../../whatsnew/3.12.rst:321 +msgid "PEP 669: Low impact monitoring for CPython" +msgstr "" + +#: ../../whatsnew/3.12.rst:323 +msgid "" +"CPython 3.12 now supports the ability to monitor calls, returns, lines, " +"exceptions and other events using instrumentation. This means that you only " +"pay for what you use, providing support for near-zero overhead debuggers and " +"coverage tools." +msgstr "" + +#: ../../whatsnew/3.12.rst:328 +msgid "See :mod:`sys.monitoring` for details." +msgstr "" + +#: ../../whatsnew/3.12.rst:332 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.12.rst:317 +#: ../../whatsnew/3.12.rst:334 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.12.rst:323 +#: ../../whatsnew/3.12.rst:340 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" msgstr "" -#: ../../whatsnew/3.12.rst:325 +#: ../../whatsnew/3.12.rst:342 msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" -#: ../../whatsnew/3.12.rst:329 +#: ../../whatsnew/3.12.rst:346 msgid "" "This PEP specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" -#: ../../whatsnew/3.12.rst:340 +#: ../../whatsnew/3.12.rst:357 msgid "See :pep:`692` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:342 +#: ../../whatsnew/3.12.rst:359 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" msgstr "(由 Franek Magiera 於 :gh:`103629` 中貢獻。)" -#: ../../whatsnew/3.12.rst:345 +#: ../../whatsnew/3.12.rst:364 msgid "PEP 698: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:347 +#: ../../whatsnew/3.12.rst:366 msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -375,51 +395,51 @@ msgid "" "class does not in fact do so." msgstr "" -#: ../../whatsnew/3.12.rst:353 +#: ../../whatsnew/3.12.rst:372 msgid "Example::" msgstr "" -#: ../../whatsnew/3.12.rst:371 +#: ../../whatsnew/3.12.rst:390 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" -#: ../../whatsnew/3.12.rst:376 +#: ../../whatsnew/3.12.rst:395 msgid "PEP 695: Type Parameter Syntax" msgstr "" -#: ../../whatsnew/3.12.rst:378 +#: ../../whatsnew/3.12.rst:397 msgid "" "Generic classes and functions under :pep:`484` were declared using a verbose " "syntax that left the scope of type parameters unclear and required explicit " "declarations of variance." msgstr "" -#: ../../whatsnew/3.12.rst:382 +#: ../../whatsnew/3.12.rst:401 msgid "" ":pep:`695` introduces a new, more compact and explicit way to create :ref:" "`generic classes ` and :ref:`functions `::" msgstr "" -#: ../../whatsnew/3.12.rst:395 +#: ../../whatsnew/3.12.rst:414 msgid "" "In addition, the PEP introduces a new way to declare :ref:`type aliases " "` using the :keyword:`type` statement, which creates an " "instance of :class:`~typing.TypeAliasType`::" msgstr "" -#: ../../whatsnew/3.12.rst:401 +#: ../../whatsnew/3.12.rst:420 msgid "Type aliases can also be :ref:`generic `::" msgstr "" -#: ../../whatsnew/3.12.rst:405 +#: ../../whatsnew/3.12.rst:424 msgid "" "The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" "`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " "parameters with bounds or constraints::" msgstr "" -#: ../../whatsnew/3.12.rst:414 +#: ../../whatsnew/3.12.rst:433 msgid "" "The value of type aliases and the bound and constraints of type variables " "created through this syntax are evaluated only on demand (see :ref:`lazy-" @@ -427,7 +447,7 @@ msgid "" "defined later in the file." msgstr "" -#: ../../whatsnew/3.12.rst:419 +#: ../../whatsnew/3.12.rst:438 msgid "" "Type parameters declared through a type parameter list are visible within " "the scope of the declaration and any nested scopes, but not in the outer " @@ -437,7 +457,7 @@ msgid "" "detailed description of the runtime semantics of type parameters." msgstr "" -#: ../../whatsnew/3.12.rst:426 +#: ../../whatsnew/3.12.rst:445 msgid "" "In order to support these scoping semantics, a new kind of scope is " "introduced, the :ref:`annotation scope `. Annotation " @@ -446,21 +466,21 @@ msgid "" "` will also be evaluated in annotation scopes." msgstr "" -#: ../../whatsnew/3.12.rst:432 +#: ../../whatsnew/3.12.rst:451 msgid "See :pep:`695` for more details." msgstr "詳情請見 :pep:`695`。" -#: ../../whatsnew/3.12.rst:434 +#: ../../whatsnew/3.12.rst:453 msgid "" "(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " "and others in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:438 +#: ../../whatsnew/3.12.rst:457 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.12.rst:440 +#: ../../whatsnew/3.12.rst:459 msgid "" "Add :ref:`perf_profiling` through the new environment variable :envvar:" "`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " @@ -471,7 +491,7 @@ msgid "" "in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:450 +#: ../../whatsnew/3.12.rst:469 msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " @@ -481,32 +501,32 @@ msgid "" "`706`.)" msgstr "" -#: ../../whatsnew/3.12.rst:458 +#: ../../whatsnew/3.12.rst:477 msgid "" ":class:`types.MappingProxyType` instances are now hashable if the underlying " "mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" msgstr "" -#: ../../whatsnew/3.12.rst:462 +#: ../../whatsnew/3.12.rst:481 msgid "" ":class:`memoryview` now supports the half-float type (the \"e\" format " "code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" -#: ../../whatsnew/3.12.rst:465 +#: ../../whatsnew/3.12.rst:484 msgid "" "The parser now raises :exc:`SyntaxError` when parsing source code containing " "null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:468 +#: ../../whatsnew/3.12.rst:487 msgid "" ":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " "when parsing source code containing null bytes. (Contributed by Pablo " "Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:472 +#: ../../whatsnew/3.12.rst:491 msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -516,7 +536,7 @@ msgid "" "`97922`.)" msgstr "" -#: ../../whatsnew/3.12.rst:479 +#: ../../whatsnew/3.12.rst:498 msgid "" "A backslash-character pair that is not a valid escape sequence now generates " "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " @@ -527,7 +547,7 @@ msgid "" "`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:488 +#: ../../whatsnew/3.12.rst:507 msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " "deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" @@ -535,14 +555,14 @@ msgid "" "a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:494 +#: ../../whatsnew/3.12.rst:513 msgid "" "All builtin and extension callables expecting boolean parameters now accept " "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" -#: ../../whatsnew/3.12.rst:498 +#: ../../whatsnew/3.12.rst:517 msgid "" "Variables used in the target part of comprehensions that are not stored to " "can now be used in assignment expressions (``:=``). For example, in ``[(b := " @@ -552,28 +572,28 @@ msgid "" "(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" -#: ../../whatsnew/3.12.rst:505 +#: ../../whatsnew/3.12.rst:524 msgid "" ":class:`slice` objects are now hashable, allowing them to be used as dict " "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" -#: ../../whatsnew/3.12.rst:508 +#: ../../whatsnew/3.12.rst:527 msgid "" ":func:`sum` now uses Neumaier summation to improve accuracy when summing " "floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" "`100425`.)" msgstr "" -#: ../../whatsnew/3.12.rst:512 +#: ../../whatsnew/3.12.rst:531 msgid "" "Exceptions raised in a typeobject's ``__set_name__`` method are no longer " "wrapped by a :exc:`RuntimeError`. Context information is added to the " "exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" -#: ../../whatsnew/3.12.rst:516 +#: ../../whatsnew/3.12.rst:535 msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " "and raises one other exception, that exception is no longer wrapped in an :" @@ -581,33 +601,33 @@ msgid "" "Katriel in :gh:`103590`.)" msgstr "" -#: ../../whatsnew/3.12.rst:523 +#: ../../whatsnew/3.12.rst:542 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.12.rst:525 +#: ../../whatsnew/3.12.rst:544 msgid "None." msgstr "" -#: ../../whatsnew/3.12.rst:529 +#: ../../whatsnew/3.12.rst:548 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.12.rst:532 +#: ../../whatsnew/3.12.rst:551 msgid "array" msgstr "array" -#: ../../whatsnew/3.12.rst:534 +#: ../../whatsnew/3.12.rst:553 msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" -#: ../../whatsnew/3.12.rst:538 +#: ../../whatsnew/3.12.rst:557 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.12.rst:540 +#: ../../whatsnew/3.12.rst:559 msgid "" "The performance of writing to sockets in :mod:`asyncio` has been " "significantly improved. ``asyncio`` now avoids unnecessary copying when " @@ -615,7 +635,7 @@ msgid "" "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" -#: ../../whatsnew/3.12.rst:545 +#: ../../whatsnew/3.12.rst:564 msgid "" "Added :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " @@ -623,7 +643,7 @@ msgid "" "Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" -#: ../../whatsnew/3.12.rst:550 +#: ../../whatsnew/3.12.rst:569 msgid "" "On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default " "if :func:`os.pidfd_open` is available and functional instead of :class:" @@ -631,7 +651,7 @@ msgid "" "`98024`.)" msgstr "" -#: ../../whatsnew/3.12.rst:555 +#: ../../whatsnew/3.12.rst:574 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -643,7 +663,7 @@ msgid "" "`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:564 +#: ../../whatsnew/3.12.rst:583 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -651,57 +671,57 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:570 +#: ../../whatsnew/3.12.rst:589 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:574 +#: ../../whatsnew/3.12.rst:593 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " "(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" -#: ../../whatsnew/3.12.rst:577 +#: ../../whatsnew/3.12.rst:596 msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" -#: ../../whatsnew/3.12.rst:581 +#: ../../whatsnew/3.12.rst:600 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" -#: ../../whatsnew/3.12.rst:586 +#: ../../whatsnew/3.12.rst:605 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.12.rst:588 +#: ../../whatsnew/3.12.rst:607 msgid "" "Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " "Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:592 +#: ../../whatsnew/3.12.rst:611 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.12.rst:594 +#: ../../whatsnew/3.12.rst:613 msgid "" "Add :const:`~csv.QUOTE_NOTNULL` and :const:`~csv.QUOTE_STRINGS` flags to " "provide finer grained control of ``None`` and empty strings by :class:`~csv." "writer` objects." msgstr "" -#: ../../whatsnew/3.12.rst:599 +#: ../../whatsnew/3.12.rst:618 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.12.rst:601 +#: ../../whatsnew/3.12.rst:620 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" @@ -710,35 +730,35 @@ msgid "" "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:610 +#: ../../whatsnew/3.12.rst:629 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.12.rst:612 +#: ../../whatsnew/3.12.rst:631 msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" -#: ../../whatsnew/3.12.rst:616 +#: ../../whatsnew/3.12.rst:635 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:618 +#: ../../whatsnew/3.12.rst:637 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:622 +#: ../../whatsnew/3.12.rst:641 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :issue:`35759`.)" msgstr "" -#: ../../whatsnew/3.12.rst:626 +#: ../../whatsnew/3.12.rst:645 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -746,60 +766,60 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:632 +#: ../../whatsnew/3.12.rst:651 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:634 +#: ../../whatsnew/3.12.rst:653 msgid "" "Added :class:`itertools.batched()` for collecting into even-sized tuples " "where the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:639 +#: ../../whatsnew/3.12.rst:658 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:641 +#: ../../whatsnew/3.12.rst:660 msgid "" "Added :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -#: ../../whatsnew/3.12.rst:644 +#: ../../whatsnew/3.12.rst:663 msgid "" "Extended :func:`math.nextafter` to include a *steps* argument for moving up " "or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:649 +#: ../../whatsnew/3.12.rst:668 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:651 +#: ../../whatsnew/3.12.rst:670 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:655 +#: ../../whatsnew/3.12.rst:674 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:659 +#: ../../whatsnew/3.12.rst:678 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:663 +#: ../../whatsnew/3.12.rst:682 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -812,27 +832,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:674 +#: ../../whatsnew/3.12.rst:693 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:676 +#: ../../whatsnew/3.12.rst:695 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:679 +#: ../../whatsnew/3.12.rst:698 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:683 +#: ../../whatsnew/3.12.rst:702 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:685 +#: ../../whatsnew/3.12.rst:704 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -840,14 +860,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:690 +#: ../../whatsnew/3.12.rst:709 msgid "" "Add :meth:`~pathlib.Path.walk` for walking the directory trees and " "generating all file or directory names within them, similar to :func:`os." "walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:694 +#: ../../whatsnew/3.12.rst:713 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " @@ -855,13 +875,13 @@ msgid "" "issue:`40358`.)" msgstr "" -#: ../../whatsnew/3.12.rst:699 +#: ../../whatsnew/3.12.rst:718 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:702 +#: ../../whatsnew/3.12.rst:721 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -869,38 +889,38 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:707 +#: ../../whatsnew/3.12.rst:726 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:709 +#: ../../whatsnew/3.12.rst:728 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:715 +#: ../../whatsnew/3.12.rst:734 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:717 +#: ../../whatsnew/3.12.rst:736 msgid "" "Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" "gh:`81620`.)" msgstr "" -#: ../../whatsnew/3.12.rst:720 +#: ../../whatsnew/3.12.rst:739 msgid "" "Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:724 +#: ../../whatsnew/3.12.rst:743 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:726 +#: ../../whatsnew/3.12.rst:745 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -908,7 +928,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:732 +#: ../../whatsnew/3.12.rst:751 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -916,14 +936,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:738 +#: ../../whatsnew/3.12.rst:757 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:762 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -931,24 +951,24 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:748 +#: ../../whatsnew/3.12.rst:767 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:754 +#: ../../whatsnew/3.12.rst:773 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:756 +#: ../../whatsnew/3.12.rst:775 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -#: ../../whatsnew/3.12.rst:759 +#: ../../whatsnew/3.12.rst:778 msgid "" "Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." "Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " @@ -956,36 +976,36 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:766 +#: ../../whatsnew/3.12.rst:785 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:771 +#: ../../whatsnew/3.12.rst:790 msgid "" "Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection." "setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " "a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:777 +#: ../../whatsnew/3.12.rst:796 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:779 +#: ../../whatsnew/3.12.rst:798 msgid "" "Extended :func:`statistics.correlation` to include as a ``ranked`` method " "for computing the Spearman correlation of ranked data. (Contributed by " "Raymond Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:784 +#: ../../whatsnew/3.12.rst:803 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:786 +#: ../../whatsnew/3.12.rst:805 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -995,7 +1015,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:795 +#: ../../whatsnew/3.12.rst:814 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1004,14 +1024,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:801 ../../whatsnew/3.12.rst:1561 +#: ../../whatsnew/3.12.rst:820 ../../whatsnew/3.12.rst:1580 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:805 +#: ../../whatsnew/3.12.rst:824 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1019,27 +1039,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:811 +#: ../../whatsnew/3.12.rst:830 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:813 +#: ../../whatsnew/3.12.rst:832 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:815 +#: ../../whatsnew/3.12.rst:834 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:821 +#: ../../whatsnew/3.12.rst:840 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:823 +#: ../../whatsnew/3.12.rst:842 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1047,11 +1067,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:829 +#: ../../whatsnew/3.12.rst:848 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:831 +#: ../../whatsnew/3.12.rst:850 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1061,11 +1081,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:840 +#: ../../whatsnew/3.12.rst:859 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:842 +#: ../../whatsnew/3.12.rst:861 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "( Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1073,22 +1093,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:848 +#: ../../whatsnew/3.12.rst:867 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:850 +#: ../../whatsnew/3.12.rst:869 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:855 +#: ../../whatsnew/3.12.rst:874 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:857 +#: ../../whatsnew/3.12.rst:876 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1101,7 +1121,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:868 +#: ../../whatsnew/3.12.rst:887 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1109,13 +1129,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:890 +#: ../../whatsnew/3.12.rst:909 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:893 +#: ../../whatsnew/3.12.rst:912 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1126,71 +1146,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:901 +#: ../../whatsnew/3.12.rst:920 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:905 +#: ../../whatsnew/3.12.rst:924 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:909 +#: ../../whatsnew/3.12.rst:928 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:911 +#: ../../whatsnew/3.12.rst:930 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:915 +#: ../../whatsnew/3.12.rst:934 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:917 +#: ../../whatsnew/3.12.rst:936 msgid "" "Added ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:933 +#: ../../whatsnew/3.12.rst:952 msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" msgstr "(由 Giampaolo Rodola 於 :issue:`4080` 中貢獻。)" -#: ../../whatsnew/3.12.rst:936 +#: ../../whatsnew/3.12.rst:955 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:938 +#: ../../whatsnew/3.12.rst:957 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:943 +#: ../../whatsnew/3.12.rst:962 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:945 +#: ../../whatsnew/3.12.rst:964 msgid "" "Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " "reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " "(Contributed by Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:949 +#: ../../whatsnew/3.12.rst:968 msgid "" "Added experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:953 +#: ../../whatsnew/3.12.rst:972 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1198,13 +1218,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:958 +#: ../../whatsnew/3.12.rst:977 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar O in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:961 +#: ../../whatsnew/3.12.rst:980 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1212,18 +1232,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:966 +#: ../../whatsnew/3.12.rst:985 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:972 +#: ../../whatsnew/3.12.rst:991 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:974 +#: ../../whatsnew/3.12.rst:993 msgid "" "Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1231,20 +1251,20 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:979 +#: ../../whatsnew/3.12.rst:998 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:982 +#: ../../whatsnew/3.12.rst:1001 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:985 +#: ../../whatsnew/3.12.rst:1004 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1253,35 +1273,35 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:991 +#: ../../whatsnew/3.12.rst:1010 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:995 +#: ../../whatsnew/3.12.rst:1014 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:997 +#: ../../whatsnew/3.12.rst:1016 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1002 +#: ../../whatsnew/3.12.rst:1021 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1009 ../../whatsnew/3.12.rst:1952 +#: ../../whatsnew/3.12.rst:1028 ../../whatsnew/3.12.rst:1971 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.12.rst:1011 +#: ../../whatsnew/3.12.rst:1030 msgid "" ":mod:`asyncio`: The :meth:`~asyncio.get_event_loop` method of the default " "event loop policy now emits a :exc:`DeprecationWarning` if there is no " @@ -1289,14 +1309,14 @@ msgid "" "Storchaka and Guido van Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1016 +#: ../../whatsnew/3.12.rst:1035 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." "FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1020 +#: ../../whatsnew/3.12.rst:1039 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1306,7 +1326,7 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1028 +#: ../../whatsnew/3.12.rst:1047 msgid "" ":mod:`os`: The ``st_ctime`` fields return by :func:`os.stat` and :func:`os." "lstat` on Windows are deprecated. In a future release, they will contain the " @@ -1315,25 +1335,25 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1034 +#: ../../whatsnew/3.12.rst:1053 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " "Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1049 +#: ../../whatsnew/3.12.rst:1068 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.12.rst:1038 +#: ../../whatsnew/3.12.rst:1057 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1044 +#: ../../whatsnew/3.12.rst:1063 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1343,28 +1363,28 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1051 +#: ../../whatsnew/3.12.rst:1070 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1055 +#: ../../whatsnew/3.12.rst:1074 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1059 +#: ../../whatsnew/3.12.rst:1078 msgid "" ":mod:`typing`: :class:`typing.Hashable` and :class:`typing.Sized` aliases " "for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:" "gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1062 +#: ../../whatsnew/3.12.rst:1081 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -1372,7 +1392,7 @@ msgid "" "implementation emitted nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1067 +#: ../../whatsnew/3.12.rst:1086 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" "meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " @@ -1380,14 +1400,14 @@ msgid "" "functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1072 +#: ../../whatsnew/3.12.rst:1091 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1077 +#: ../../whatsnew/3.12.rst:1096 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -1396,7 +1416,7 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1101 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1405,156 +1425,156 @@ msgid "" "by Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1089 +#: ../../whatsnew/3.12.rst:1108 msgid "Pending Removal in Python 3.13" msgstr "" -#: ../../whatsnew/3.12.rst:1091 +#: ../../whatsnew/3.12.rst:1110 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1094 +#: ../../whatsnew/3.12.rst:1113 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1096 +#: ../../whatsnew/3.12.rst:1115 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1097 +#: ../../whatsnew/3.12.rst:1116 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1098 +#: ../../whatsnew/3.12.rst:1117 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1099 +#: ../../whatsnew/3.12.rst:1118 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1100 +#: ../../whatsnew/3.12.rst:1119 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1101 +#: ../../whatsnew/3.12.rst:1120 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1102 +#: ../../whatsnew/3.12.rst:1121 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1103 +#: ../../whatsnew/3.12.rst:1122 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1104 +#: ../../whatsnew/3.12.rst:1123 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1105 +#: ../../whatsnew/3.12.rst:1124 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1106 +#: ../../whatsnew/3.12.rst:1125 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1107 +#: ../../whatsnew/3.12.rst:1126 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1127 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1109 +#: ../../whatsnew/3.12.rst:1128 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1110 +#: ../../whatsnew/3.12.rst:1129 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1111 +#: ../../whatsnew/3.12.rst:1130 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1112 +#: ../../whatsnew/3.12.rst:1131 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1113 +#: ../../whatsnew/3.12.rst:1132 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1114 +#: ../../whatsnew/3.12.rst:1133 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1116 +#: ../../whatsnew/3.12.rst:1135 msgid "Other modules:" msgstr "" -#: ../../whatsnew/3.12.rst:1118 +#: ../../whatsnew/3.12.rst:1137 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1139 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1141 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1142 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1124 +#: ../../whatsnew/3.12.rst:1143 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1144 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1126 +#: ../../whatsnew/3.12.rst:1145 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1127 +#: ../../whatsnew/3.12.rst:1146 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1147 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1129 +#: ../../whatsnew/3.12.rst:1148 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1149 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1152 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1135 +#: ../../whatsnew/3.12.rst:1154 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1140 +#: ../../whatsnew/3.12.rst:1159 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1562,39 +1582,39 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1144 +#: ../../whatsnew/3.12.rst:1163 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1145 +#: ../../whatsnew/3.12.rst:1164 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1146 +#: ../../whatsnew/3.12.rst:1165 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1147 +#: ../../whatsnew/3.12.rst:1166 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1148 +#: ../../whatsnew/3.12.rst:1167 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1150 +#: ../../whatsnew/3.12.rst:1169 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1153 +#: ../../whatsnew/3.12.rst:1172 msgid "" ":mod:`asyncio`: the *msg* parameter of both :meth:`asyncio.Future.cancel` " "and :meth:`asyncio.Task.cancel` (:gh:`90985`)" msgstr "" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1176 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1602,47 +1622,47 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1162 +#: ../../whatsnew/3.12.rst:1181 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1165 +#: ../../whatsnew/3.12.rst:1184 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1168 +#: ../../whatsnew/3.12.rst:1187 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1169 +#: ../../whatsnew/3.12.rst:1188 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1170 +#: ../../whatsnew/3.12.rst:1189 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1172 +#: ../../whatsnew/3.12.rst:1191 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1174 +#: ../../whatsnew/3.12.rst:1193 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1175 +#: ../../whatsnew/3.12.rst:1194 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1177 +#: ../../whatsnew/3.12.rst:1196 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1179 +#: ../../whatsnew/3.12.rst:1198 msgid "" ":mod:`itertools`: The module had undocumented, inefficient, historically " "buggy, and inconsistent support for copy, deepcopy, and pickle operations. " @@ -1650,7 +1670,7 @@ msgid "" "maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1185 +#: ../../whatsnew/3.12.rst:1204 msgid "" ":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " "change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " @@ -1661,52 +1681,52 @@ msgid "" "code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../whatsnew/3.12.rst:1193 +#: ../../whatsnew/3.12.rst:1212 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1198 +#: ../../whatsnew/3.12.rst:1217 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " "gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1202 +#: ../../whatsnew/3.12.rst:1221 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "in 3.12, and will be removed in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1205 +#: ../../whatsnew/3.12.rst:1224 msgid "" ":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../whatsnew/3.12.rst:1208 +#: ../../whatsnew/3.12.rst:1227 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element` is deprecated and will raise an exception in " "Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1211 +#: ../../whatsnew/3.12.rst:1230 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases using the C API (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:1214 +#: ../../whatsnew/3.12.rst:1233 msgid "" "``__package__`` and ``__cached__`` will cease to be set or taken into " "consideration by the import system (:gh:`97879`)." msgstr "" -#: ../../whatsnew/3.12.rst:1217 +#: ../../whatsnew/3.12.rst:1236 msgid "" "Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " "planned to be removed in 3.12 but it only got a proper :exc:" @@ -1714,31 +1734,31 @@ msgid "" "Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1223 +#: ../../whatsnew/3.12.rst:1242 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases using the C API (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:1227 +#: ../../whatsnew/3.12.rst:1246 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1229 +#: ../../whatsnew/3.12.rst:1248 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1232 +#: ../../whatsnew/3.12.rst:1251 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1234 +#: ../../whatsnew/3.12.rst:1253 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1236 +#: ../../whatsnew/3.12.rst:1255 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1750,42 +1770,42 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1247 ../../whatsnew/3.12.rst:2034 +#: ../../whatsnew/3.12.rst:1266 ../../whatsnew/3.12.rst:2053 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1249 +#: ../../whatsnew/3.12.rst:1268 msgid "" "``asynchat`` and ``asyncore``: These two modules have been removed according " "to the schedule in :pep:`594`, having been deprecated in Python 3.6. Use :" "mod:`asyncio` instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1255 +#: ../../whatsnew/3.12.rst:1274 msgid "" ":mod:`configparser`: Several names deprecated in the :mod:`configparser` way " "back in 3.2 have been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1258 +#: ../../whatsnew/3.12.rst:1277 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1260 +#: ../../whatsnew/3.12.rst:1279 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1262 +#: ../../whatsnew/3.12.rst:1281 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1265 +#: ../../whatsnew/3.12.rst:1284 msgid "" "``distutils``: Remove the ``distutils`` package. It was deprecated in Python " "3.10 by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -1794,13 +1814,13 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1271 +#: ../../whatsnew/3.12.rst:1290 msgid "" ":mod:`ensurepip`: Remove the bundled setuptools wheel from :mod:`ensurepip`, " "and stop installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1293 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1808,7 +1828,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1280 +#: ../../whatsnew/3.12.rst:1299 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1818,23 +1838,23 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1287 +#: ../../whatsnew/3.12.rst:1306 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1289 +#: ../../whatsnew/3.12.rst:1308 msgid "" ":mod:`enum`: Remove ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1293 +#: ../../whatsnew/3.12.rst:1312 msgid "" ":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1297 +#: ../../whatsnew/3.12.rst:1316 msgid "" ":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -1843,7 +1863,7 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1303 +#: ../../whatsnew/3.12.rst:1322 msgid "" ":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -1852,179 +1872,179 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1309 +#: ../../whatsnew/3.12.rst:1328 msgid "" ":mod:`importlib`: Many previously deprecated cleanups in :mod:`importlib` " "have now been completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1312 +#: ../../whatsnew/3.12.rst:1331 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1315 +#: ../../whatsnew/3.12.rst:1334 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1319 +#: ../../whatsnew/3.12.rst:1338 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1322 +#: ../../whatsnew/3.12.rst:1341 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1325 +#: ../../whatsnew/3.12.rst:1344 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1328 +#: ../../whatsnew/3.12.rst:1347 msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1331 +#: ../../whatsnew/3.12.rst:1350 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1331 +#: ../../whatsnew/3.12.rst:1350 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1352 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1352 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1353 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1353 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1354 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1354 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1355 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1355 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1356 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1356 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1357 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1357 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1358 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1358 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1359 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1359 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1360 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1360 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1361 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1361 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1345 +#: ../../whatsnew/3.12.rst:1364 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1360 +#: ../../whatsnew/3.12.rst:1379 msgid "Removed :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1362 +#: ../../whatsnew/3.12.rst:1381 msgid "undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1383 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1384 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1385 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1386 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1369 +#: ../../whatsnew/3.12.rst:1388 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1371 +#: ../../whatsnew/3.12.rst:1390 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1375 +#: ../../whatsnew/3.12.rst:1394 msgid "" ":mod:`io`: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2033,14 +2053,14 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1400 msgid "" ":mod:`locale`: Remove the :func:`!locale.format` function, deprecated in " "Python 3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1385 +#: ../../whatsnew/3.12.rst:1404 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2048,27 +2068,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1412 msgid "" ":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " "deprecated in Python 3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1415 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1416 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1418 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1421 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2076,22 +2096,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1407 +#: ../../whatsnew/3.12.rst:1426 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1409 +#: ../../whatsnew/3.12.rst:1428 msgid ":mod:`ssl`:" msgstr "" -#: ../../whatsnew/3.12.rst:1411 +#: ../../whatsnew/3.12.rst:1430 msgid "" "Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " "3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " "by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1415 +#: ../../whatsnew/3.12.rst:1434 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2099,7 +2119,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1421 +#: ../../whatsnew/3.12.rst:1440 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2110,174 +2130,174 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1449 msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1432 +#: ../../whatsnew/3.12.rst:1451 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1454 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1454 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1454 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1456 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1437 ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1456 ../../whatsnew/3.12.rst:1463 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1437 ../../whatsnew/3.12.rst:1438 -#: ../../whatsnew/3.12.rst:1439 ../../whatsnew/3.12.rst:1440 -#: ../../whatsnew/3.12.rst:1441 ../../whatsnew/3.12.rst:1442 -#: ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1456 ../../whatsnew/3.12.rst:1457 +#: ../../whatsnew/3.12.rst:1458 ../../whatsnew/3.12.rst:1459 +#: ../../whatsnew/3.12.rst:1460 ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:1462 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1438 +#: ../../whatsnew/3.12.rst:1457 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1438 +#: ../../whatsnew/3.12.rst:1457 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1458 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1439 ../../whatsnew/3.12.rst:1445 +#: ../../whatsnew/3.12.rst:1458 ../../whatsnew/3.12.rst:1464 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1459 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1459 ../../whatsnew/3.12.rst:1465 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1441 +#: ../../whatsnew/3.12.rst:1460 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1441 ../../whatsnew/3.12.rst:1447 +#: ../../whatsnew/3.12.rst:1460 ../../whatsnew/3.12.rst:1466 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1461 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1442 ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1461 ../../whatsnew/3.12.rst:1467 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1462 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1462 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1463 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1444 ../../whatsnew/3.12.rst:1445 -#: ../../whatsnew/3.12.rst:1446 ../../whatsnew/3.12.rst:1447 -#: ../../whatsnew/3.12.rst:1448 ../../whatsnew/3.12.rst:1449 -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1463 ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1465 ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1469 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1445 +#: ../../whatsnew/3.12.rst:1464 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1465 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1447 +#: ../../whatsnew/3.12.rst:1466 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1467 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1468 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1468 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1469 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1469 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1451 +#: ../../whatsnew/3.12.rst:1470 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1451 +#: ../../whatsnew/3.12.rst:1470 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1451 +#: ../../whatsnew/3.12.rst:1470 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1454 +#: ../../whatsnew/3.12.rst:1473 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1457 +#: ../../whatsnew/3.12.rst:1476 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1460 +#: ../../whatsnew/3.12.rst:1479 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1483 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1486 msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1488 msgid "" ":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" "`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " @@ -2285,7 +2305,7 @@ msgid "" "`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1473 +#: ../../whatsnew/3.12.rst:1492 msgid "" ":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " "method of the pure Python implementation, deprecated in Python 3.10, use " @@ -2294,21 +2314,21 @@ msgid "" "(Contributed by Victor Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1479 +#: ../../whatsnew/3.12.rst:1498 msgid "" ":mod:`zipimport`: Remove ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1484 +#: ../../whatsnew/3.12.rst:1503 msgid "" "Removed the ``suspicious`` rule from the documentation Makefile, and removed " "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1489 +#: ../../whatsnew/3.12.rst:1508 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2318,21 +2338,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1500 ../../whatsnew/3.12.rst:1812 +#: ../../whatsnew/3.12.rst:1519 ../../whatsnew/3.12.rst:1831 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1502 +#: ../../whatsnew/3.12.rst:1521 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1506 +#: ../../whatsnew/3.12.rst:1525 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1508 +#: ../../whatsnew/3.12.rst:1527 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2341,7 +2361,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1515 +#: ../../whatsnew/3.12.rst:1534 msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -2353,7 +2373,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1542 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2363,21 +2383,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1529 +#: ../../whatsnew/3.12.rst:1548 msgid "" "Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1533 +#: ../../whatsnew/3.12.rst:1552 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1538 +#: ../../whatsnew/3.12.rst:1557 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2385,7 +2405,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1543 +#: ../../whatsnew/3.12.rst:1562 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2397,7 +2417,7 @@ msgid "" "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1552 +#: ../../whatsnew/3.12.rst:1571 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2409,14 +2429,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1565 +#: ../../whatsnew/3.12.rst:1584 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1589 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2428,45 +2448,45 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1600 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1612 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1596 +#: ../../whatsnew/3.12.rst:1615 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1599 +#: ../../whatsnew/3.12.rst:1618 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1602 +#: ../../whatsnew/3.12.rst:1621 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1605 +#: ../../whatsnew/3.12.rst:1624 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1609 +#: ../../whatsnew/3.12.rst:1628 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1611 +#: ../../whatsnew/3.12.rst:1630 msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2475,21 +2495,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1617 +#: ../../whatsnew/3.12.rst:1636 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1622 +#: ../../whatsnew/3.12.rst:1641 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1626 +#: ../../whatsnew/3.12.rst:1645 msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2498,46 +2518,46 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1632 +#: ../../whatsnew/3.12.rst:1651 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1634 +#: ../../whatsnew/3.12.rst:1653 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1635 +#: ../../whatsnew/3.12.rst:1654 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1636 +#: ../../whatsnew/3.12.rst:1655 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1638 +#: ../../whatsnew/3.12.rst:1657 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1640 +#: ../../whatsnew/3.12.rst:1659 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1642 +#: ../../whatsnew/3.12.rst:1661 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1646 +#: ../../whatsnew/3.12.rst:1665 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1650 +#: ../../whatsnew/3.12.rst:1669 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1675 msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2545,84 +2565,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1662 +#: ../../whatsnew/3.12.rst:1681 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1664 +#: ../../whatsnew/3.12.rst:1683 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1665 +#: ../../whatsnew/3.12.rst:1684 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1667 +#: ../../whatsnew/3.12.rst:1686 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1669 +#: ../../whatsnew/3.12.rst:1688 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1670 +#: ../../whatsnew/3.12.rst:1689 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1671 +#: ../../whatsnew/3.12.rst:1690 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1673 +#: ../../whatsnew/3.12.rst:1692 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1676 +#: ../../whatsnew/3.12.rst:1695 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1678 +#: ../../whatsnew/3.12.rst:1697 msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1681 +#: ../../whatsnew/3.12.rst:1700 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1683 +#: ../../whatsnew/3.12.rst:1702 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1685 +#: ../../whatsnew/3.12.rst:1704 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1688 +#: ../../whatsnew/3.12.rst:1707 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1691 +#: ../../whatsnew/3.12.rst:1710 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1693 +#: ../../whatsnew/3.12.rst:1712 msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -2630,29 +2650,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1717 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1721 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1722 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1723 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1705 +#: ../../whatsnew/3.12.rst:1724 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1707 +#: ../../whatsnew/3.12.rst:1726 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -2663,7 +2683,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1715 +#: ../../whatsnew/3.12.rst:1734 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2671,32 +2691,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1739 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1743 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1725 +#: ../../whatsnew/3.12.rst:1744 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1726 +#: ../../whatsnew/3.12.rst:1745 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr "" -#: ../../whatsnew/3.12.rst:1728 +#: ../../whatsnew/3.12.rst:1747 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1732 +#: ../../whatsnew/3.12.rst:1751 msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -2704,14 +2724,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1738 +#: ../../whatsnew/3.12.rst:1757 msgid "" "Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " "sets the vectorcall field of a given :c:type:`PyFunctionObject`. " "(Contributed by Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1742 +#: ../../whatsnew/3.12.rst:1761 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2720,28 +2740,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1748 +#: ../../whatsnew/3.12.rst:1767 msgid "" "Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1752 +#: ../../whatsnew/3.12.rst:1771 msgid "" "Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1757 +#: ../../whatsnew/3.12.rst:1776 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1761 +#: ../../whatsnew/3.12.rst:1780 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2751,14 +2771,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1769 +#: ../../whatsnew/3.12.rst:1788 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1773 +#: ../../whatsnew/3.12.rst:1792 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2766,71 +2786,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1778 +#: ../../whatsnew/3.12.rst:1797 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1782 +#: ../../whatsnew/3.12.rst:1801 msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1785 +#: ../../whatsnew/3.12.rst:1804 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1786 +#: ../../whatsnew/3.12.rst:1805 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1787 +#: ../../whatsnew/3.12.rst:1806 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1788 +#: ../../whatsnew/3.12.rst:1807 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1789 +#: ../../whatsnew/3.12.rst:1808 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1790 +#: ../../whatsnew/3.12.rst:1809 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1791 +#: ../../whatsnew/3.12.rst:1810 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1792 +#: ../../whatsnew/3.12.rst:1811 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1793 +#: ../../whatsnew/3.12.rst:1812 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1796 +#: ../../whatsnew/3.12.rst:1815 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1795 +#: ../../whatsnew/3.12.rst:1814 msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1798 +#: ../../whatsnew/3.12.rst:1817 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1800 +#: ../../whatsnew/3.12.rst:1819 msgid "" ":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " "and :c:type:`PyInterpreterConfig`, which may be used to create sub-" @@ -2838,27 +2858,27 @@ msgid "" "info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1806 +#: ../../whatsnew/3.12.rst:1825 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1814 +#: ../../whatsnew/3.12.rst:1833 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1817 +#: ../../whatsnew/3.12.rst:1836 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1821 +#: ../../whatsnew/3.12.rst:1840 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2867,7 +2887,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1828 +#: ../../whatsnew/3.12.rst:1847 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -2875,13 +2895,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1833 +#: ../../whatsnew/3.12.rst:1852 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1837 +#: ../../whatsnew/3.12.rst:1856 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -2890,7 +2910,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1843 +#: ../../whatsnew/3.12.rst:1862 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2899,13 +2919,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1849 +#: ../../whatsnew/3.12.rst:1868 msgid "" "Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1853 +#: ../../whatsnew/3.12.rst:1872 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -2919,7 +2939,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1865 +#: ../../whatsnew/3.12.rst:1884 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -2927,7 +2947,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1870 +#: ../../whatsnew/3.12.rst:1889 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -2935,7 +2955,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1875 +#: ../../whatsnew/3.12.rst:1894 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -2943,7 +2963,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1880 +#: ../../whatsnew/3.12.rst:1899 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -2951,25 +2971,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1885 +#: ../../whatsnew/3.12.rst:1904 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1888 +#: ../../whatsnew/3.12.rst:1907 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1889 +#: ../../whatsnew/3.12.rst:1908 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1890 +#: ../../whatsnew/3.12.rst:1909 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1892 +#: ../../whatsnew/3.12.rst:1911 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -2977,14 +2997,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1897 +#: ../../whatsnew/3.12.rst:1916 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:1901 +#: ../../whatsnew/3.12.rst:1920 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -2993,17 +3013,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1908 +#: ../../whatsnew/3.12.rst:1927 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1910 +#: ../../whatsnew/3.12.rst:1929 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1912 +#: ../../whatsnew/3.12.rst:1931 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3011,20 +3031,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:1917 +#: ../../whatsnew/3.12.rst:1936 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:1921 +#: ../../whatsnew/3.12.rst:1940 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:1924 +#: ../../whatsnew/3.12.rst:1943 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3032,14 +3052,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:1929 +#: ../../whatsnew/3.12.rst:1948 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:1933 +#: ../../whatsnew/3.12.rst:1952 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3050,15 +3070,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:1941 +#: ../../whatsnew/3.12.rst:1960 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr "" -#: ../../whatsnew/3.12.rst:1942 +#: ../../whatsnew/3.12.rst:1961 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr "" -#: ../../whatsnew/3.12.rst:1944 +#: ../../whatsnew/3.12.rst:1963 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3067,281 +3087,281 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:1954 +#: ../../whatsnew/3.12.rst:1973 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:1956 +#: ../../whatsnew/3.12.rst:1975 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:1957 +#: ../../whatsnew/3.12.rst:1976 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:1977 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:1959 +#: ../../whatsnew/3.12.rst:1978 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:1979 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:1980 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:1981 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1982 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:1983 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:1984 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:1985 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1986 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1987 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1988 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:1990 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:1991 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1973 +#: ../../whatsnew/3.12.rst:1992 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1974 +#: ../../whatsnew/3.12.rst:1993 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:1994 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:1995 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:1977 +#: ../../whatsnew/3.12.rst:1996 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:1979 +#: ../../whatsnew/3.12.rst:1998 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1983 +#: ../../whatsnew/3.12.rst:2002 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1986 +#: ../../whatsnew/3.12.rst:2005 msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:1989 +#: ../../whatsnew/3.12.rst:2008 msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:1992 +#: ../../whatsnew/3.12.rst:2011 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" -#: ../../whatsnew/3.12.rst:1994 +#: ../../whatsnew/3.12.rst:2013 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:1996 +#: ../../whatsnew/3.12.rst:2015 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:1999 +#: ../../whatsnew/3.12.rst:2018 msgid "Several items are not exposed from ``Python.h``:" msgstr "" -#: ../../whatsnew/3.12.rst:2001 +#: ../../whatsnew/3.12.rst:2020 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:2002 +#: ../../whatsnew/3.12.rst:2021 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2022 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:2004 +#: ../../whatsnew/3.12.rst:2023 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:2006 +#: ../../whatsnew/3.12.rst:2025 msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2009 +#: ../../whatsnew/3.12.rst:2028 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2014 +#: ../../whatsnew/3.12.rst:2033 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2017 +#: ../../whatsnew/3.12.rst:2036 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2022 +#: ../../whatsnew/3.12.rst:2041 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2025 +#: ../../whatsnew/3.12.rst:2044 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2028 +#: ../../whatsnew/3.12.rst:2047 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2036 +#: ../../whatsnew/3.12.rst:2055 msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``token.h`` header file was only designed to be used by Python " "internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2041 +#: ../../whatsnew/3.12.rst:2060 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2043 +#: ../../whatsnew/3.12.rst:2062 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2044 +#: ../../whatsnew/3.12.rst:2063 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2064 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2046 +#: ../../whatsnew/3.12.rst:2065 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2047 +#: ../../whatsnew/3.12.rst:2066 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2048 +#: ../../whatsnew/3.12.rst:2067 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2049 +#: ../../whatsnew/3.12.rst:2068 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2050 +#: ../../whatsnew/3.12.rst:2069 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2051 +#: ../../whatsnew/3.12.rst:2070 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2053 +#: ../../whatsnew/3.12.rst:2072 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2056 +#: ../../whatsnew/3.12.rst:2075 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2059 +#: ../../whatsnew/3.12.rst:2078 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" From fdbed6846aa5235bc9e7cde2074229cc718ae3ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 6 Sep 2023 16:55:25 +0000 Subject: [PATCH 12/18] sync with cpython ce370956 --- library/inspect.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/inspect.po b/library/inspect.po index 3a1d2173e9..65cac3464a 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-06 16:53+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1027,8 +1027,8 @@ msgstr "" #: ../../library/inspect.rst:733 msgid "" -"Create a new Signature instance based on the instance replace was invoked " -"on. It is possible to pass different ``parameters`` and/or " +"Create a new Signature instance based on the instance :meth:`replace` was " +"invoked on. It is possible to pass different ``parameters`` and/or " "``return_annotation`` to override the corresponding properties of the base " "signature. To remove return_annotation from the copied Signature, pass in :" "attr:`Signature.empty`." From 06ad9054206dac6a1b5eed28bc33ec6e92210891 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 9 Sep 2023 00:05:34 +0000 Subject: [PATCH 13/18] sync with cpython af83d1e8 --- library/ast.po | 323 +++--- library/calendar.po | 87 +- library/configparser.po | 146 +-- library/importlib.resources.po | 74 +- library/os.po | 1568 ++++++++++++++--------------- library/socket.po | 8 +- library/sys.po | 16 +- library/unittest.mock-examples.po | 235 ++--- using/configure.po | 553 +++++----- whatsnew/3.12.po | 942 ++++++++--------- 10 files changed, 2050 insertions(+), 1902 deletions(-) diff --git a/library/ast.po b/library/ast.po index 42ca2796b4..e021b7c35f 100644 --- a/library/ast.po +++ b/library/ast.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-02 00:03+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -458,11 +458,11 @@ msgid "" "case both ``target`` and ``value`` must be single nodes." msgstr "" -#: ../../library/ast.rst:668 +#: ../../library/ast.rst:669 msgid "Subscripting" msgstr "" -#: ../../library/ast.rst:672 +#: ../../library/ast.rst:673 msgid "" "A subscript, such as ``l[1]``. ``value`` is the subscripted object (usually " "sequence or mapping). ``slice`` is an index, slice or key. It can be a :" @@ -470,29 +470,29 @@ msgid "" "`Store` or :class:`Del` according to the action performed with the subscript." msgstr "" -#: ../../library/ast.rst:696 +#: ../../library/ast.rst:697 msgid "" "Regular slicing (on the form ``lower:upper`` or ``lower:upper:step``). Can " "occur only inside the *slice* field of :class:`Subscript`, either directly " "or as an element of :class:`Tuple`." msgstr "" -#: ../../library/ast.rst:713 +#: ../../library/ast.rst:714 msgid "Comprehensions" msgstr "" -#: ../../library/ast.rst:720 +#: ../../library/ast.rst:721 msgid "" "List and set comprehensions, generator expressions, and dictionary " "comprehensions. ``elt`` (or ``key`` and ``value``) is a single node " "representing the part that will be evaluated for each item." msgstr "" -#: ../../library/ast.rst:724 +#: ../../library/ast.rst:725 msgid "``generators`` is a list of :class:`comprehension` nodes." msgstr "" -#: ../../library/ast.rst:766 +#: ../../library/ast.rst:767 msgid "" "One ``for`` clause in a comprehension. ``target`` is the reference to use " "for each element - typically a :class:`Name` or :class:`Tuple` node. " @@ -500,36 +500,36 @@ msgid "" "expressions: each ``for`` clause can have multiple ``ifs``." msgstr "" -#: ../../library/ast.rst:771 +#: ../../library/ast.rst:772 msgid "" "``is_async`` indicates a comprehension is asynchronous (using an ``async " "for`` instead of ``for``). The value is an integer (0 or 1)." msgstr "" -#: ../../library/ast.rst:840 +#: ../../library/ast.rst:841 msgid "Statements" msgstr "" -#: ../../library/ast.rst:844 +#: ../../library/ast.rst:845 msgid "" "An assignment. ``targets`` is a list of nodes, and ``value`` is a single " "node." msgstr "" -#: ../../library/ast.rst:846 +#: ../../library/ast.rst:847 msgid "" "Multiple nodes in ``targets`` represents assigning the same value to each. " "Unpacking is represented by putting a :class:`Tuple` or :class:`List` within " "``targets``." msgstr "" -#: ../../library/ast.rst:852 ../../library/ast.rst:1159 -#: ../../library/ast.rst:1363 ../../library/ast.rst:1862 +#: ../../library/ast.rst:853 ../../library/ast.rst:1161 +#: ../../library/ast.rst:1366 ../../library/ast.rst:1891 msgid "" "``type_comment`` is an optional string with the type annotation as a comment." msgstr "" -#: ../../library/ast.rst:882 +#: ../../library/ast.rst:883 msgid "" "An assignment with a type annotation. ``target`` is a single node and can be " "a :class:`Name`, a :class:`Attribute` or a :class:`Subscript`. " @@ -539,7 +539,7 @@ msgid "" "appear in between parenthesis and are hence pure names and not expressions." msgstr "" -#: ../../library/ast.rst:937 +#: ../../library/ast.rst:938 msgid "" "Augmented assignment, such as ``a += 1``. In the following example, " "``target`` is a :class:`Name` node for ``x`` (with the :class:`Store` " @@ -547,36 +547,36 @@ msgid "" "value for 1." msgstr "" -#: ../../library/ast.rst:942 +#: ../../library/ast.rst:943 msgid "" "The ``target`` attribute cannot be of class :class:`Tuple` or :class:`List`, " "unlike the targets of :class:`Assign`." msgstr "" -#: ../../library/ast.rst:959 +#: ../../library/ast.rst:960 msgid "" "A ``raise`` statement. ``exc`` is the exception object to be raised, " "normally a :class:`Call` or :class:`Name`, or ``None`` for a standalone " "``raise``. ``cause`` is the optional part for ``y`` in ``raise x from y``." msgstr "" -#: ../../library/ast.rst:976 +#: ../../library/ast.rst:977 msgid "" "An assertion. ``test`` holds the condition, such as a :class:`Compare` node. " "``msg`` holds the failure message." msgstr "" -#: ../../library/ast.rst:992 +#: ../../library/ast.rst:993 msgid "" "Represents a ``del`` statement. ``targets`` is a list of nodes, such as :" "class:`Name`, :class:`Attribute` or :class:`Subscript` nodes." msgstr "" -#: ../../library/ast.rst:1010 +#: ../../library/ast.rst:1011 msgid "A ``pass`` statement." msgstr "" -#: ../../library/ast.rst:1023 +#: ../../library/ast.rst:1024 msgid "" "A :ref:`type alias ` created through the :keyword:`type` " "statement. ``name`` is the name of the alias, ``type_params`` is a list of :" @@ -584,21 +584,21 @@ msgid "" "type alias." msgstr "" -#: ../../library/ast.rst:1040 +#: ../../library/ast.rst:1042 msgid "" "Other statements which are only applicable inside functions or loops are " "described in other sections." msgstr "" -#: ../../library/ast.rst:1044 +#: ../../library/ast.rst:1046 msgid "Imports" msgstr "" -#: ../../library/ast.rst:1048 +#: ../../library/ast.rst:1050 msgid "An import statement. ``names`` is a list of :class:`alias` nodes." msgstr "" -#: ../../library/ast.rst:1065 +#: ../../library/ast.rst:1067 msgid "" "Represents ``from x import y``. ``module`` is a raw string of the 'from' " "name, without any leading dots, or ``None`` for statements such as ``from . " @@ -606,36 +606,36 @@ msgid "" "import (0 means absolute import)." msgstr "" -#: ../../library/ast.rst:1087 +#: ../../library/ast.rst:1089 msgid "" "Both parameters are raw strings of the names. ``asname`` can be ``None`` if " "the regular name is to be used." msgstr "" -#: ../../library/ast.rst:1104 +#: ../../library/ast.rst:1106 msgid "Control flow" msgstr "" -#: ../../library/ast.rst:1107 +#: ../../library/ast.rst:1109 msgid "" "Optional clauses such as ``else`` are stored as an empty list if they're not " "present." msgstr "" -#: ../../library/ast.rst:1112 +#: ../../library/ast.rst:1114 msgid "" "An ``if`` statement. ``test`` holds a single node, such as a :class:" "`Compare` node. ``body`` and ``orelse`` each hold a list of nodes." msgstr "" -#: ../../library/ast.rst:1115 +#: ../../library/ast.rst:1117 msgid "" "``elif`` clauses don't have a special representation in the AST, but rather " "appear as extra :class:`If` nodes within the ``orelse`` section of the " "previous one." msgstr "" -#: ../../library/ast.rst:1150 +#: ../../library/ast.rst:1152 msgid "" "A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " "single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or :" @@ -645,30 +645,30 @@ msgid "" "via a ``break`` statement." msgstr "" -#: ../../library/ast.rst:1185 +#: ../../library/ast.rst:1187 msgid "" "A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` " "node." msgstr "" -#: ../../library/ast.rst:1212 +#: ../../library/ast.rst:1214 msgid "The ``break`` and ``continue`` statements." msgstr "" -#: ../../library/ast.rst:1247 +#: ../../library/ast.rst:1249 msgid "" "``try`` blocks. All attributes are list of nodes to execute, except for " "``handlers``, which is a list of :class:`ExceptHandler` nodes." msgstr "" -#: ../../library/ast.rst:1293 +#: ../../library/ast.rst:1295 msgid "" "``try`` blocks which are followed by ``except*`` clauses. The attributes are " "the same as for :class:`Try` but the :class:`ExceptHandler` nodes in " "``handlers`` are interpreted as ``except*`` blocks rather then ``except``." msgstr "" -#: ../../library/ast.rst:1324 +#: ../../library/ast.rst:1327 msgid "" "A single ``except`` clause. ``type`` is the exception type it will match, " "typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` " @@ -676,14 +676,14 @@ msgid "" "``None`` if the clause doesn't have ``as foo``. ``body`` is a list of nodes." msgstr "" -#: ../../library/ast.rst:1358 +#: ../../library/ast.rst:1361 msgid "" "A ``with`` block. ``items`` is a list of :class:`withitem` nodes " "representing the context managers, and ``body`` is the indented block inside " "the context." msgstr "" -#: ../../library/ast.rst:1368 +#: ../../library/ast.rst:1371 msgid "" "A single context manager in a ``with`` block. ``context_expr`` is the " "context manager, often a :class:`Call` node. ``optional_vars`` is a :class:" @@ -691,18 +691,18 @@ msgid "" "if that isn't used." msgstr "" -#: ../../library/ast.rst:1401 +#: ../../library/ast.rst:1404 msgid "Pattern matching" msgstr "" -#: ../../library/ast.rst:1406 +#: ../../library/ast.rst:1409 msgid "" "A ``match`` statement. ``subject`` holds the subject of the match (the " "object that is being matched against the cases) and ``cases`` contains an " "iterable of :class:`match_case` nodes with the different cases." msgstr "" -#: ../../library/ast.rst:1412 +#: ../../library/ast.rst:1417 msgid "" "A single case pattern in a ``match`` statement. ``pattern`` contains the " "match pattern that the subject will be matched against. Note that the :class:" @@ -710,19 +710,19 @@ msgid "" "expressions, even when they share the same syntax." msgstr "" -#: ../../library/ast.rst:1417 +#: ../../library/ast.rst:1422 msgid "" "The ``guard`` attribute contains an expression that will be evaluated if the " "pattern matches the subject." msgstr "" -#: ../../library/ast.rst:1420 +#: ../../library/ast.rst:1425 msgid "" "``body`` contains a list of nodes to execute if the pattern matches and the " "result of evaluating the guard expression is true." msgstr "" -#: ../../library/ast.rst:1463 +#: ../../library/ast.rst:1470 msgid "" "A match literal or value pattern that compares by equality. ``value`` is an " "expression node. Permitted value nodes are restricted as described in the " @@ -730,14 +730,14 @@ msgid "" "equal to the evaluated value." msgstr "" -#: ../../library/ast.rst:1490 +#: ../../library/ast.rst:1499 msgid "" "A match literal pattern that compares by identity. ``value`` is the " "singleton to be compared against: ``None``, ``True``, or ``False``. This " "pattern succeeds if the match subject is the given constant." msgstr "" -#: ../../library/ast.rst:1515 +#: ../../library/ast.rst:1526 msgid "" "A match sequence pattern. ``patterns`` contains the patterns to be matched " "against the subject elements if the subject is a sequence. Matches a " @@ -745,7 +745,7 @@ msgid "" "otherwise matches a fixed length sequence." msgstr "" -#: ../../library/ast.rst:1546 +#: ../../library/ast.rst:1559 msgid "" "Matches the rest of the sequence in a variable length match sequence " "pattern. If ``name`` is not ``None``, a list containing the remaining " @@ -753,7 +753,7 @@ msgid "" "successful." msgstr "" -#: ../../library/ast.rst:1586 +#: ../../library/ast.rst:1601 msgid "" "A match mapping pattern. ``keys`` is a sequence of expression nodes. " "``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an " @@ -762,7 +762,7 @@ msgid "" "statement documentation." msgstr "" -#: ../../library/ast.rst:1592 +#: ../../library/ast.rst:1607 msgid "" "This pattern succeeds if the subject is a mapping, all evaluated key " "expressions are present in the mapping, and the value corresponding to each " @@ -771,7 +771,7 @@ msgid "" "overall mapping pattern is successful." msgstr "" -#: ../../library/ast.rst:1632 +#: ../../library/ast.rst:1649 msgid "" "A match class pattern. ``cls`` is an expression giving the nominal class to " "be matched. ``patterns`` is a sequence of pattern nodes to be matched " @@ -782,21 +782,21 @@ msgid "" "pattern)." msgstr "" -#: ../../library/ast.rst:1639 +#: ../../library/ast.rst:1656 msgid "" "This pattern succeeds if the subject is an instance of the nominated class, " "all positional patterns match the corresponding class-defined attributes, " "and any specified keyword attributes match their corresponding pattern." msgstr "" -#: ../../library/ast.rst:1643 +#: ../../library/ast.rst:1660 msgid "" "Note: classes may define a property that returns self in order to match a " "pattern node against the instance being matched. Several builtin types are " "also matched that way, as described in the match statement documentation." msgstr "" -#: ../../library/ast.rst:1696 +#: ../../library/ast.rst:1715 msgid "" "A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` " "contains the match pattern that the subject will be matched against. If the " @@ -804,14 +804,14 @@ msgid "" "and will always succeed." msgstr "" -#: ../../library/ast.rst:1701 +#: ../../library/ast.rst:1720 msgid "" "The ``name`` attribute contains the name that will be bound if the pattern " "is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` " "and the node represents the wildcard pattern." msgstr "" -#: ../../library/ast.rst:1737 +#: ../../library/ast.rst:1758 msgid "" "A match \"or-pattern\". An or-pattern matches each of its subpatterns in " "turn to the subject, until one succeeds. The or-pattern is then deemed to " @@ -820,184 +820,189 @@ msgid "" "matched against the subject." msgstr "" -#: ../../library/ast.rst:1770 +#: ../../library/ast.rst:1793 msgid "Type parameters" msgstr "" -#: ../../library/ast.rst:1772 +#: ../../library/ast.rst:1795 msgid "" ":ref:`Type parameters ` can exist on classes, functions, and " "type aliases." msgstr "" -#: ../../library/ast.rst:1777 +#: ../../library/ast.rst:1800 msgid "" "A :class:`typing.TypeVar`. ``name`` is the name of the type variable. " "``bound`` is the bound or constraints, if any. If ``bound`` is a :class:" "`Tuple`, it represents constraints; otherwise it represents the bound." msgstr "" -#: ../../library/ast.rst:1800 +#: ../../library/ast.rst:1825 msgid "" "A :class:`typing.ParamSpec`. ``name`` is the name of the parameter " "specification." msgstr "" -#: ../../library/ast.rst:1823 +#: ../../library/ast.rst:1850 msgid "" "A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable " "tuple." msgstr "" -#: ../../library/ast.rst:1846 +#: ../../library/ast.rst:1875 msgid "Function and class definitions" msgstr "" -#: ../../library/ast.rst:1850 +#: ../../library/ast.rst:1879 msgid "A function definition." msgstr "" -#: ../../library/ast.rst:1852 +#: ../../library/ast.rst:1881 msgid "``name`` is a raw string of the function name." msgstr "" -#: ../../library/ast.rst:1853 +#: ../../library/ast.rst:1882 msgid "``args`` is an :class:`arguments` node." msgstr "" -#: ../../library/ast.rst:1854 +#: ../../library/ast.rst:1883 msgid "``body`` is the list of nodes inside the function." msgstr "" -#: ../../library/ast.rst:1855 +#: ../../library/ast.rst:1884 msgid "" "``decorator_list`` is the list of decorators to be applied, stored outermost " "first (i.e. the first in the list will be applied last)." msgstr "" -#: ../../library/ast.rst:1857 +#: ../../library/ast.rst:1886 msgid "``returns`` is the return annotation." msgstr "" -#: ../../library/ast.rst:1858 ../../library/ast.rst:2033 +#: ../../library/ast.rst:1887 ../../library/ast.rst:2065 msgid "``type_params`` is a list of :ref:`type parameters `." msgstr "" -#: ../../library/ast.rst:1867 +#: ../../library/ast.rst:1893 ../../library/ast.rst:2094 +#: ../../library/ast.rst:2105 +msgid "Added ``type_params``." +msgstr "" + +#: ../../library/ast.rst:1899 msgid "" "``lambda`` is a minimal function definition that can be used inside an " "expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." msgstr "" -#: ../../library/ast.rst:1891 +#: ../../library/ast.rst:1923 msgid "The arguments for a function." msgstr "" -#: ../../library/ast.rst:1893 +#: ../../library/ast.rst:1925 msgid "" "``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." msgstr "" -#: ../../library/ast.rst:1894 +#: ../../library/ast.rst:1926 msgid "" "``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the " "``*args, **kwargs`` parameters." msgstr "" -#: ../../library/ast.rst:1896 +#: ../../library/ast.rst:1928 msgid "" "``kw_defaults`` is a list of default values for keyword-only arguments. If " "one is ``None``, the corresponding argument is required." msgstr "" -#: ../../library/ast.rst:1898 +#: ../../library/ast.rst:1930 msgid "" "``defaults`` is a list of default values for arguments that can be passed " "positionally. If there are fewer defaults, they correspond to the last n " "arguments." msgstr "" -#: ../../library/ast.rst:1905 +#: ../../library/ast.rst:1937 msgid "" "A single argument in a list. ``arg`` is a raw string of the argument name, " "``annotation`` is its annotation, such as a :class:`Str` or :class:`Name` " "node." msgstr "" -#: ../../library/ast.rst:1911 +#: ../../library/ast.rst:1943 msgid "" "``type_comment`` is an optional string with the type annotation as a comment" msgstr "" -#: ../../library/ast.rst:1956 +#: ../../library/ast.rst:1988 msgid "A ``return`` statement." msgstr "" -#: ../../library/ast.rst:1971 +#: ../../library/ast.rst:2003 msgid "" "A ``yield`` or ``yield from`` expression. Because these are expressions, " "they must be wrapped in a :class:`Expr` node if the value sent back is not " "used." msgstr "" -#: ../../library/ast.rst:1996 +#: ../../library/ast.rst:2028 msgid "" "``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." msgstr "" -#: ../../library/ast.rst:2023 +#: ../../library/ast.rst:2055 msgid "A class definition." msgstr "" -#: ../../library/ast.rst:2025 +#: ../../library/ast.rst:2057 msgid "``name`` is a raw string for the class name" msgstr "" -#: ../../library/ast.rst:2026 +#: ../../library/ast.rst:2058 msgid "``bases`` is a list of nodes for explicitly specified base classes." msgstr "" -#: ../../library/ast.rst:2027 +#: ../../library/ast.rst:2059 msgid "" "``keywords`` is a list of :class:`.keyword` nodes, principally for " "'metaclass'. Other keywords will be passed to the metaclass, as per " "`PEP-3115 `_." msgstr "" -#: ../../library/ast.rst:2030 +#: ../../library/ast.rst:2062 msgid "" "``body`` is a list of nodes representing the code within the class " "definition." msgstr "" -#: ../../library/ast.rst:2032 +#: ../../library/ast.rst:2064 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "" -#: ../../library/ast.rst:2063 +#: ../../library/ast.rst:2098 msgid "Async and await" msgstr "" -#: ../../library/ast.rst:2067 +#: ../../library/ast.rst:2102 msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." msgstr "" -#: ../../library/ast.rst:2073 +#: ../../library/ast.rst:2111 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:2107 +#: ../../library/ast.rst:2145 msgid "" "``async for`` loops and ``async with`` context managers. They have the same " "fields as :class:`For` and :class:`With`, respectively. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:2112 +#: ../../library/ast.rst:2150 msgid "" "When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" "class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." @@ -1006,23 +1011,23 @@ msgid "" "same value (e.g. :class:`ast.Add`)." msgstr "" -#: ../../library/ast.rst:2120 +#: ../../library/ast.rst:2158 msgid ":mod:`ast` Helpers" msgstr "" -#: ../../library/ast.rst:2122 +#: ../../library/ast.rst:2160 msgid "" "Apart from the node classes, the :mod:`ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" msgstr "" -#: ../../library/ast.rst:2127 +#: ../../library/ast.rst:2165 msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " "filename, mode, ast.PyCF_ONLY_AST)``." msgstr "" -#: ../../library/ast.rst:2130 +#: ../../library/ast.rst:2168 msgid "" "If ``type_comments=True`` is given, the parser is modified to check and " "return type comments as specified by :pep:`484` and :pep:`526`. This is " @@ -1035,14 +1040,14 @@ msgid "" "empty list)." msgstr "" -#: ../../library/ast.rst:2140 +#: ../../library/ast.rst:2178 msgid "" "In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " "correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> " "List[str]``." msgstr "" -#: ../../library/ast.rst:2144 +#: ../../library/ast.rst:2182 msgid "" "Also, setting ``feature_version`` to a tuple ``(major, minor)`` will attempt " "to parse using that Python version's grammar. Currently ``major`` must equal " @@ -1051,12 +1056,12 @@ msgid "" "version is ``(3, 4)``; the highest is ``sys.version_info[0:2]``." msgstr "" -#: ../../library/ast.rst:2151 +#: ../../library/ast.rst:2189 msgid "" "If source contains a null character ('\\0'), :exc:`ValueError` is raised." msgstr "" -#: ../../library/ast.rst:2154 +#: ../../library/ast.rst:2192 msgid "" "Note that successfully parsing source code into an AST object doesn't " "guarantee that the source code provided is valid Python code that can be " @@ -1066,45 +1071,45 @@ msgid "" "inside a function node)." msgstr "" -#: ../../library/ast.rst:2161 +#: ../../library/ast.rst:2199 msgid "" "In particular, :func:`ast.parse` won't do any scoping checks, which the " "compilation step does." msgstr "" -#: ../../library/ast.rst:2165 +#: ../../library/ast.rst:2203 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string due to stack depth limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:2169 +#: ../../library/ast.rst:2207 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" "新增 ``type_comments``\\ 、\\ ``mode='func_type'`` 與 " "``feature_version``\\ 。" -#: ../../library/ast.rst:2175 +#: ../../library/ast.rst:2213 msgid "" "Unparse an :class:`ast.AST` object and generate a string with code that " "would produce an equivalent :class:`ast.AST` object if parsed back with :" "func:`ast.parse`." msgstr "" -#: ../../library/ast.rst:2180 +#: ../../library/ast.rst:2218 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " "optimizations, such as constant tuples/frozensets)." msgstr "" -#: ../../library/ast.rst:2185 +#: ../../library/ast.rst:2223 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "" -#: ../../library/ast.rst:2193 +#: ../../library/ast.rst:2231 msgid "" "Evaluate an expression node or a string containing only a Python literal or " "container display. The string or node provided may only consist of the " @@ -1112,14 +1117,14 @@ msgid "" "dicts, sets, booleans, ``None`` and ``Ellipsis``." msgstr "" -#: ../../library/ast.rst:2198 +#: ../../library/ast.rst:2236 msgid "" "This can be used for evaluating strings containing Python values without the " "need to parse the values oneself. It is not capable of evaluating " "arbitrarily complex expressions, for example involving operators or indexing." msgstr "" -#: ../../library/ast.rst:2203 +#: ../../library/ast.rst:2241 msgid "" "This function had been documented as \"safe\" in the past without defining " "what that meant. That was misleading. This is specifically designed not to " @@ -1131,31 +1136,31 @@ msgid "" "untrusted data is thus not recommended." msgstr "" -#: ../../library/ast.rst:2213 +#: ../../library/ast.rst:2251 msgid "" "It is possible to crash the Python interpreter due to stack depth " "limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:2216 +#: ../../library/ast.rst:2254 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." msgstr "" -#: ../../library/ast.rst:2220 +#: ../../library/ast.rst:2258 msgid "Now allows bytes and set literals." msgstr "" -#: ../../library/ast.rst:2223 +#: ../../library/ast.rst:2261 msgid "Now supports creating empty sets with ``'set()'``." msgstr "" -#: ../../library/ast.rst:2226 +#: ../../library/ast.rst:2264 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "" -#: ../../library/ast.rst:2232 +#: ../../library/ast.rst:2270 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -1163,24 +1168,24 @@ msgid "" "clean up the docstring's indentation with :func:`inspect.cleandoc`." msgstr "" -#: ../../library/ast.rst:2238 +#: ../../library/ast.rst:2276 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "目前已支援 :class:`AsyncFunctionDef`\\ 。" -#: ../../library/ast.rst:2244 +#: ../../library/ast.rst:2282 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`lineno`, :attr:`end_lineno`, :attr:" "`col_offset`, or :attr:`end_col_offset`) is missing, return ``None``." msgstr "" -#: ../../library/ast.rst:2248 +#: ../../library/ast.rst:2286 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." msgstr "" -#: ../../library/ast.rst:2256 +#: ../../library/ast.rst:2294 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`lineno` and :attr:`col_offset` attributes for every node that supports " @@ -1189,77 +1194,77 @@ msgid "" "the values of the parent node. It works recursively starting at *node*." msgstr "" -#: ../../library/ast.rst:2265 +#: ../../library/ast.rst:2303 msgid "" "Increment the line number and end line number of each node in the tree " "starting at *node* by *n*. This is useful to \"move code\" to a different " "location in a file." msgstr "" -#: ../../library/ast.rst:2272 +#: ../../library/ast.rst:2310 msgid "" "Copy source location (:attr:`lineno`, :attr:`col_offset`, :attr:" "`end_lineno`, and :attr:`end_col_offset`) from *old_node* to *new_node* if " "possible, and return *new_node*." msgstr "" -#: ../../library/ast.rst:2279 +#: ../../library/ast.rst:2317 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." msgstr "" -#: ../../library/ast.rst:2285 +#: ../../library/ast.rst:2323 msgid "" "Yield all direct child nodes of *node*, that is, all fields that are nodes " "and all items of fields that are lists of nodes." msgstr "" -#: ../../library/ast.rst:2291 +#: ../../library/ast.rst:2329 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " "only want to modify nodes in place and don't care about the context." msgstr "" -#: ../../library/ast.rst:2298 +#: ../../library/ast.rst:2336 msgid "" "A node visitor base class that walks the abstract syntax tree and calls a " "visitor function for every node found. This function may return a value " "which is forwarded by the :meth:`visit` method." msgstr "" -#: ../../library/ast.rst:2302 +#: ../../library/ast.rst:2340 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "" -#: ../../library/ast.rst:2307 +#: ../../library/ast.rst:2345 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " "or :meth:`generic_visit` if that method doesn't exist." msgstr "" -#: ../../library/ast.rst:2313 +#: ../../library/ast.rst:2351 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "" -#: ../../library/ast.rst:2315 +#: ../../library/ast.rst:2353 msgid "" "Note that child nodes of nodes that have a custom visitor method won't be " "visited unless the visitor calls :meth:`generic_visit` or visits them itself." msgstr "" -#: ../../library/ast.rst:2319 +#: ../../library/ast.rst:2357 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" "`NodeTransformer`) that allows modifications." msgstr "" -#: ../../library/ast.rst:2325 +#: ../../library/ast.rst:2363 msgid "" "Methods :meth:`visit_Num`, :meth:`visit_Str`, :meth:`visit_Bytes`, :meth:" "`visit_NameConstant` and :meth:`visit_Ellipsis` are deprecated now and will " @@ -1267,13 +1272,13 @@ msgid "" "method to handle all constant nodes." msgstr "" -#: ../../library/ast.rst:2333 +#: ../../library/ast.rst:2371 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "" -#: ../../library/ast.rst:2336 +#: ../../library/ast.rst:2374 msgid "" "The :class:`NodeTransformer` will walk the AST and use the return value of " "the visitor methods to replace or remove the old node. If the return value " @@ -1282,27 +1287,27 @@ msgid "" "may be the original node in which case no replacement takes place." msgstr "" -#: ../../library/ast.rst:2342 +#: ../../library/ast.rst:2380 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" msgstr "" -#: ../../library/ast.rst:2354 +#: ../../library/ast.rst:2392 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " "either transform the child nodes yourself or call the :meth:`generic_visit` " "method for the node first." msgstr "" -#: ../../library/ast.rst:2358 +#: ../../library/ast.rst:2396 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " "just a single node." msgstr "" -#: ../../library/ast.rst:2362 +#: ../../library/ast.rst:2400 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:" @@ -1310,11 +1315,11 @@ msgid "" "tree to recalculate the location information::" msgstr "" -#: ../../library/ast.rst:2370 +#: ../../library/ast.rst:2408 msgid "Usually you use the transformer like this::" msgstr "" -#: ../../library/ast.rst:2377 +#: ../../library/ast.rst:2415 msgid "" "Return a formatted dump of the tree in *node*. This is mainly useful for " "debugging purposes. If *annotate_fields* is true (by default), the returned " @@ -1325,7 +1330,7 @@ msgid "" "true." msgstr "" -#: ../../library/ast.rst:2385 +#: ../../library/ast.rst:2423 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " "pretty-printed with that indent level. An indent level of 0, negative, or " @@ -1335,87 +1340,87 @@ msgid "" "string is used to indent each level." msgstr "" -#: ../../library/ast.rst:2392 +#: ../../library/ast.rst:2430 msgid "Added the *indent* option." msgstr "新增 *indent* 選項。" -#: ../../library/ast.rst:2399 +#: ../../library/ast.rst:2437 msgid "Compiler Flags" msgstr "" -#: ../../library/ast.rst:2401 +#: ../../library/ast.rst:2439 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" msgstr "" -#: ../../library/ast.rst:2406 +#: ../../library/ast.rst:2444 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." msgstr "" -#: ../../library/ast.rst:2413 +#: ../../library/ast.rst:2451 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "" -#: ../../library/ast.rst:2418 +#: ../../library/ast.rst:2456 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." msgstr "" -#: ../../library/ast.rst:2427 +#: ../../library/ast.rst:2465 msgid "Command-Line Usage" msgstr "" -#: ../../library/ast.rst:2431 +#: ../../library/ast.rst:2469 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr "" -#: ../../library/ast.rst:2438 +#: ../../library/ast.rst:2476 msgid "The following options are accepted:" msgstr "" -#: ../../library/ast.rst:2444 +#: ../../library/ast.rst:2482 msgid "Show the help message and exit." msgstr "" -#: ../../library/ast.rst:2449 +#: ../../library/ast.rst:2487 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "" -#: ../../library/ast.rst:2454 +#: ../../library/ast.rst:2492 msgid "Don't parse type comments." msgstr "" -#: ../../library/ast.rst:2458 +#: ../../library/ast.rst:2496 msgid "Include attributes such as line numbers and column offsets." msgstr "" -#: ../../library/ast.rst:2463 +#: ../../library/ast.rst:2501 msgid "Indentation of nodes in AST (number of spaces)." msgstr "" -#: ../../library/ast.rst:2465 +#: ../../library/ast.rst:2503 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." msgstr "" -#: ../../library/ast.rst:2471 +#: ../../library/ast.rst:2509 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." msgstr "" -#: ../../library/ast.rst:2474 +#: ../../library/ast.rst:2512 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -1423,21 +1428,21 @@ msgid "" "transformations." msgstr "" -#: ../../library/ast.rst:2479 +#: ../../library/ast.rst:2517 msgid "" "`leoAst.py `_ unifies the " "token-based and parse-tree-based views of python programs by inserting two-" "way links between tokens and ast nodes." msgstr "" -#: ../../library/ast.rst:2483 +#: ../../library/ast.rst:2521 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " "useful for building automated refactoring (codemod) applications and linters." msgstr "" -#: ../../library/ast.rst:2488 +#: ../../library/ast.rst:2526 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " diff --git a/library/calendar.po b/library/calendar.po index 9c51be3d45..0b57c63fdb 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-29 00:03+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -579,6 +579,91 @@ msgstr ":mod:`time` 模組" msgid "Low-level time related functions." msgstr "底層的時間相關函式。" +#: ../../library/calendar.rst:497 +msgid "Command-Line Usage" +msgstr "" + +#: ../../library/calendar.rst:501 +msgid "" +"The :mod:`calendar` module can be executed as a script from the command line " +"to interactively print a calendar." +msgstr "" + +#: ../../library/calendar.rst:511 +msgid "For example, to print a calendar for the year 2000:" +msgstr "" + +#: ../../library/calendar.rst:554 +msgid "The following options are accepted:" +msgstr "" + +#: ../../library/calendar.rst:561 +msgid "Show the help message and exit." +msgstr "" + +#: ../../library/calendar.rst:566 +msgid "The locale to use for month and weekday names. Defaults to English." +msgstr "" + +#: ../../library/calendar.rst:572 +msgid "" +"The encoding to use for output. :option:`--encoding` is required if :option:" +"`--locale` is set." +msgstr "" + +#: ../../library/calendar.rst:578 +msgid "Print the calendar to the terminal as text, or as an HTML document." +msgstr "" + +#: ../../library/calendar.rst:584 +msgid "" +"The year to print the calendar for. Must be a number between 1 and 9999. " +"Defaults to the current year." +msgstr "" + +#: ../../library/calendar.rst:591 +msgid "" +"The month of the specified :option:`year` to print the calendar for. Must be " +"a number between 1 and 12, and may only be used in text mode. Defaults to " +"printing a calendar for the full year." +msgstr "" + +#: ../../library/calendar.rst:597 +msgid "*Text-mode options:*" +msgstr "" + +#: ../../library/calendar.rst:601 +msgid "" +"The width of the date column in terminal columns. The date is printed " +"centred in the column. Any value lower than 2 is ignored. Defaults to 2." +msgstr "" + +#: ../../library/calendar.rst:609 +msgid "" +"The number of lines for each week in terminal rows. The date is printed top-" +"aligned. Any value lower than 1 is ignored. Defaults to 1." +msgstr "" + +#: ../../library/calendar.rst:617 +msgid "" +"The space between months in columns. Any value lower than 2 is ignored. " +"Defaults to 6." +msgstr "" + +#: ../../library/calendar.rst:624 +msgid "The number of months printed per row. Defaults to 3." +msgstr "" + +#: ../../library/calendar.rst:628 +msgid "*HTML-mode options:*" +msgstr "" + +#: ../../library/calendar.rst:632 +msgid "" +"The path of a CSS stylesheet to use for the calendar. This must either be " +"relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." +msgstr "" + #~ msgid "" #~ "Enumeration defining the days of the week as integer constants, from 0 to " #~ "6." diff --git a/library/configparser.po b/library/configparser.po index e7185179f7..1fd52352d6 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -713,10 +713,12 @@ msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " "(normally named ``\"DEFAULT\"``). This value can be retrieved and changed " -"on runtime using the ``default_section`` instance attribute." +"at runtime using the ``default_section`` instance attribute. This won't re-" +"evaluate an already parsed config file, but will be used when writing parsed " +"settings to a new config file." msgstr "" -#: ../../library/configparser.rst:941 +#: ../../library/configparser.rst:943 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -725,7 +727,7 @@ msgid "" "`dedicated documentation section <#interpolation-of-values>`_." msgstr "" -#: ../../library/configparser.rst:947 +#: ../../library/configparser.rst:949 msgid "" "All option names used in interpolation will be passed through the :meth:" "`optionxform` method just like any other option name reference. For " @@ -734,7 +736,7 @@ msgid "" "%(BAR)s`` are equivalent." msgstr "" -#: ../../library/configparser.rst:953 +#: ../../library/configparser.rst:955 msgid "" "When *converters* is given, it should be a dictionary where each key " "represents the name of a type converter and each value is a callable " @@ -743,44 +745,44 @@ msgid "" "object and section proxies." msgstr "" -#: ../../library/configparser.rst:959 +#: ../../library/configparser.rst:961 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "" -#: ../../library/configparser.rst:962 +#: ../../library/configparser.rst:964 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." msgstr "" -#: ../../library/configparser.rst:967 +#: ../../library/configparser.rst:969 msgid "The *converters* argument was added." msgstr "新增 *converters* 引數。" -#: ../../library/configparser.rst:970 +#: ../../library/configparser.rst:972 msgid "" "The *defaults* argument is read with :meth:`read_dict()`, providing " "consistent behavior across the parser: non-string keys and values are " "implicitly converted to strings." msgstr "" -#: ../../library/configparser.rst:975 ../../library/configparser.rst:1238 +#: ../../library/configparser.rst:977 ../../library/configparser.rst:1240 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" -#: ../../library/configparser.rst:981 +#: ../../library/configparser.rst:983 msgid "Return a dictionary containing the instance-wide defaults." msgstr "" -#: ../../library/configparser.rst:986 +#: ../../library/configparser.rst:988 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." msgstr "" -#: ../../library/configparser.rst:992 +#: ../../library/configparser.rst:994 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -788,34 +790,34 @@ msgid "" "the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:997 +#: ../../library/configparser.rst:999 msgid "Non-string section names raise :exc:`TypeError`." msgstr "" -#: ../../library/configparser.rst:1003 +#: ../../library/configparser.rst:1005 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." msgstr "" -#: ../../library/configparser.rst:1009 +#: ../../library/configparser.rst:1011 msgid "Return a list of options available in the specified *section*." msgstr "" -#: ../../library/configparser.rst:1014 +#: ../../library/configparser.rst:1016 msgid "" "If the given *section* exists, and contains the given *option*, return :" "const:`True`; otherwise return :const:`False`. If the specified *section* " "is :const:`None` or an empty string, DEFAULT is assumed." msgstr "" -#: ../../library/configparser.rst:1021 +#: ../../library/configparser.rst:1023 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." msgstr "" -#: ../../library/configparser.rst:1024 +#: ../../library/configparser.rst:1026 msgid "" "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " "object`, it is treated as a single filename. If a file named in *filenames* " @@ -826,7 +828,7 @@ msgid "" "be read." msgstr "" -#: ../../library/configparser.rst:1033 +#: ../../library/configparser.rst:1035 msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " @@ -834,49 +836,49 @@ msgid "" "`read_file` before calling :meth:`read` for any optional files::" msgstr "" -#: ../../library/configparser.rst:1046 +#: ../../library/configparser.rst:1048 msgid "" "The *encoding* parameter. Previously, all files were read using the default " "encoding for :func:`open`." msgstr "" -#: ../../library/configparser.rst:1050 +#: ../../library/configparser.rst:1052 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/configparser.rst:1053 +#: ../../library/configparser.rst:1055 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "" -#: ../../library/configparser.rst:1059 +#: ../../library/configparser.rst:1061 msgid "" "Read and parse configuration data from *f* which must be an iterable " "yielding Unicode strings (for example files opened in text mode)." msgstr "" -#: ../../library/configparser.rst:1062 +#: ../../library/configparser.rst:1064 msgid "" "Optional argument *source* specifies the name of the file being read. If " "not given and *f* has a :attr:`name` attribute, that is used for *source*; " "the default is ``''``." msgstr "" -#: ../../library/configparser.rst:1066 +#: ../../library/configparser.rst:1068 msgid "Replaces :meth:`readfp`." msgstr "" -#: ../../library/configparser.rst:1071 +#: ../../library/configparser.rst:1073 msgid "Parse configuration data from a string." msgstr "" -#: ../../library/configparser.rst:1073 +#: ../../library/configparser.rst:1075 msgid "" "Optional argument *source* specifies a context-specific name of the string " "passed. If not given, ``''`` is used. This should commonly be a " "filesystem path or a URL." msgstr "" -#: ../../library/configparser.rst:1082 +#: ../../library/configparser.rst:1084 msgid "" "Load configuration from any object that provides a dict-like ``items()`` " "method. Keys are section names, values are dictionaries with keys and " @@ -885,17 +887,17 @@ msgid "" "automatically converted to strings." msgstr "" -#: ../../library/configparser.rst:1088 +#: ../../library/configparser.rst:1090 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." msgstr "" -#: ../../library/configparser.rst:1091 +#: ../../library/configparser.rst:1093 msgid "This method can be used to copy state between parsers." msgstr "" -#: ../../library/configparser.rst:1098 +#: ../../library/configparser.rst:1100 msgid "" "Get an *option* value for the named *section*. If *vars* is provided, it " "must be a dictionary. The *option* is looked up in *vars* (if provided), " @@ -904,35 +906,35 @@ msgid "" "provided as a *fallback* value." msgstr "" -#: ../../library/configparser.rst:1104 +#: ../../library/configparser.rst:1106 msgid "" "All the ``'%'`` interpolations are expanded in the return values, unless the " "*raw* argument is true. Values for interpolation keys are looked up in the " "same manner as the option." msgstr "" -#: ../../library/configparser.rst:1108 +#: ../../library/configparser.rst:1110 msgid "" "Arguments *raw*, *vars* and *fallback* are keyword only to protect users " "from trying to use the third argument as the *fallback* fallback (especially " "when using the mapping protocol)." msgstr "" -#: ../../library/configparser.rst:1116 +#: ../../library/configparser.rst:1118 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to an integer. See :meth:`get` for explanation of *raw*, *vars* and " "*fallback*." msgstr "" -#: ../../library/configparser.rst:1123 +#: ../../library/configparser.rst:1125 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a floating point number. See :meth:`get` for explanation of *raw*, " "*vars* and *fallback*." msgstr "" -#: ../../library/configparser.rst:1130 +#: ../../library/configparser.rst:1132 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a Boolean value. Note that the accepted values for the option are " @@ -944,34 +946,34 @@ msgid "" "*fallback*." msgstr "" -#: ../../library/configparser.rst:1143 +#: ../../library/configparser.rst:1145 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." msgstr "" -#: ../../library/configparser.rst:1146 +#: ../../library/configparser.rst:1148 msgid "" "Otherwise, return a list of *name*, *value* pairs for the options in the " "given *section*. Optional arguments have the same meaning as for the :meth:" "`get` method." msgstr "" -#: ../../library/configparser.rst:1150 +#: ../../library/configparser.rst:1152 msgid "" "Items present in *vars* no longer appear in the result. The previous " "behaviour mixed actual parser options with variables provided for " "interpolation." msgstr "" -#: ../../library/configparser.rst:1158 +#: ../../library/configparser.rst:1160 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. *option* and *value* must be " "strings; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:1165 +#: ../../library/configparser.rst:1167 msgid "" "Write a representation of the configuration to the specified :term:`file " "object`, which must be opened in text mode (accepting strings). This " @@ -980,27 +982,27 @@ msgid "" "surrounded by spaces." msgstr "" -#: ../../library/configparser.rst:1173 +#: ../../library/configparser.rst:1175 msgid "" "Comments in the original configuration file are not preserved when writing " "the configuration back. What is considered a comment, depends on the given " "values for *comment_prefix* and *inline_comment_prefix*." msgstr "" -#: ../../library/configparser.rst:1181 +#: ../../library/configparser.rst:1183 msgid "" "Remove the specified *option* from the specified *section*. If the section " "does not exist, raise :exc:`NoSectionError`. If the option existed to be " "removed, return :const:`True`; otherwise return :const:`False`." msgstr "" -#: ../../library/configparser.rst:1189 +#: ../../library/configparser.rst:1191 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." msgstr "" -#: ../../library/configparser.rst:1195 +#: ../../library/configparser.rst:1197 msgid "" "Transforms the option name *option* as found in an input file or as passed " "in by client code to the form that should be used in the internal " @@ -1009,7 +1011,7 @@ msgid "" "of this name on instances to affect this behavior." msgstr "" -#: ../../library/configparser.rst:1201 +#: ../../library/configparser.rst:1203 msgid "" "You don't need to subclass the parser to use this method, you can also set " "it on an instance, to a function that takes a string argument and returns a " @@ -1017,24 +1019,24 @@ msgid "" "sensitive::" msgstr "" -#: ../../library/configparser.rst:1209 +#: ../../library/configparser.rst:1211 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." msgstr "" -#: ../../library/configparser.rst:1215 +#: ../../library/configparser.rst:1217 msgid "" "The maximum depth for recursive interpolation for :meth:`get` when the *raw* " "parameter is false. This is relevant only when the default *interpolation* " "is used." msgstr "" -#: ../../library/configparser.rst:1223 +#: ../../library/configparser.rst:1225 msgid "RawConfigParser Objects" msgstr "RawConfigParser 物件" -#: ../../library/configparser.rst:1233 +#: ../../library/configparser.rst:1235 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1042,27 +1044,27 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: ../../library/configparser.rst:1243 +#: ../../library/configparser.rst:1245 msgid "" "Consider using :class:`ConfigParser` instead which checks types of the " "values to be stored internally. If you don't want interpolation, you can " "use ``ConfigParser(interpolation=None)``." msgstr "" -#: ../../library/configparser.rst:1250 +#: ../../library/configparser.rst:1252 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " "*default section* name is passed, :exc:`ValueError` is raised." msgstr "" -#: ../../library/configparser.rst:1254 +#: ../../library/configparser.rst:1256 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." msgstr "" -#: ../../library/configparser.rst:1260 +#: ../../library/configparser.rst:1262 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" @@ -1072,7 +1074,7 @@ msgid "" "string values." msgstr "" -#: ../../library/configparser.rst:1267 +#: ../../library/configparser.rst:1269 msgid "" "This method lets users assign non-string values to keys internally. This " "behaviour is unsupported and will cause errors when attempting to write to a " @@ -1080,32 +1082,32 @@ msgid "" "not allow such assignments to take place." msgstr "" -#: ../../library/configparser.rst:1274 +#: ../../library/configparser.rst:1276 msgid "Exceptions" msgstr "例外" -#: ../../library/configparser.rst:1278 +#: ../../library/configparser.rst:1280 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "" -#: ../../library/configparser.rst:1283 +#: ../../library/configparser.rst:1285 msgid "Exception raised when a specified section is not found." msgstr "" -#: ../../library/configparser.rst:1288 +#: ../../library/configparser.rst:1290 msgid "" "Exception raised if :meth:`add_section` is called with the name of a section " "that is already present or in strict parsers when a section if found more " "than once in a single input file, string or dictionary." msgstr "" -#: ../../library/configparser.rst:1292 +#: ../../library/configparser.rst:1294 msgid "" "Optional ``source`` and ``lineno`` attributes and arguments to :meth:" "`__init__` were added." msgstr "" -#: ../../library/configparser.rst:1299 +#: ../../library/configparser.rst:1301 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -1113,58 +1115,58 @@ msgid "" "representing the same case-insensitive configuration key." msgstr "" -#: ../../library/configparser.rst:1307 +#: ../../library/configparser.rst:1309 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" -#: ../../library/configparser.rst:1313 +#: ../../library/configparser.rst:1315 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" -#: ../../library/configparser.rst:1319 +#: ../../library/configparser.rst:1321 msgid "" "Exception raised when string interpolation cannot be completed because the " "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" "exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1326 +#: ../../library/configparser.rst:1328 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1332 +#: ../../library/configparser.rst:1334 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1338 +#: ../../library/configparser.rst:1340 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" -#: ../../library/configparser.rst:1344 +#: ../../library/configparser.rst:1346 msgid "Exception raised when errors occur attempting to parse a file." msgstr "" -#: ../../library/configparser.rst:1346 +#: ../../library/configparser.rst:1348 msgid "" "The ``filename`` attribute and :meth:`__init__` constructor argument were " "removed. They have been available using the name ``source`` since 3.2." msgstr "" -#: ../../library/configparser.rst:1351 +#: ../../library/configparser.rst:1353 msgid "Footnotes" msgstr "註解" -#: ../../library/configparser.rst:1352 +#: ../../library/configparser.rst:1354 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " diff --git a/library/importlib.resources.po b/library/importlib.resources.po index 0ea74a8221..927b9c1463 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -116,28 +116,32 @@ msgstr "" #: ../../library/importlib.resources.rst:84 msgid "" "Given a :class:`~importlib.resources.abc.Traversable` object representing a " -"file, typically from :func:`importlib.resources.files`, return a context " -"manager for use in a :keyword:`with` statement. The context manager provides " -"a :class:`pathlib.Path` object." +"file or directory, typically from :func:`importlib.resources.files`, return " +"a context manager for use in a :keyword:`with` statement. The context " +"manager provides a :class:`pathlib.Path` object." msgstr "" #: ../../library/importlib.resources.rst:89 msgid "" -"Exiting the context manager cleans up any temporary file created when the " -"resource was extracted from e.g. a zip file." +"Exiting the context manager cleans up any temporary file or directory " +"created when the resource was extracted from e.g. a zip file." msgstr "" #: ../../library/importlib.resources.rst:92 msgid "" "Use ``as_file`` when the Traversable methods (``read_text``, etc) are " -"insufficient and an actual file on the file system is required." +"insufficient and an actual file or directory on the file system is required." +msgstr "" + +#: ../../library/importlib.resources.rst:98 +msgid "Added support for ``traversable`` representing a directory." msgstr "" -#: ../../library/importlib.resources.rst:100 +#: ../../library/importlib.resources.rst:103 msgid "Deprecated functions" msgstr "已棄用函式" -#: ../../library/importlib.resources.rst:102 +#: ../../library/importlib.resources.rst:105 msgid "" "An older, deprecated set of functions is still available, but is scheduled " "for removal in a future version of Python. The main drawback of these " @@ -145,7 +149,7 @@ msgid "" "are located directly within a *package*." msgstr "" -#: ../../library/importlib.resources.rst:109 +#: ../../library/importlib.resources.rst:112 msgid "" "Whenever a function accepts a ``Package`` argument, you can pass in either " "a :class:`module object ` or a module name as a string. " @@ -153,25 +157,25 @@ msgid "" "submodule_search_locations`` is not ``None``." msgstr "" -#: ../../library/importlib.resources.rst:114 +#: ../../library/importlib.resources.rst:117 msgid "The ``Package`` type is defined as ``Union[str, ModuleType]``." msgstr "" -#: ../../library/importlib.resources.rst:121 +#: ../../library/importlib.resources.rst:124 msgid "" "For *resource* arguments of the functions below, you can pass in the name of " "a resource as a string or a :class:`path-like object `." msgstr "" -#: ../../library/importlib.resources.rst:125 +#: ../../library/importlib.resources.rst:128 msgid "The ``Resource`` type is defined as ``Union[str, os.PathLike]``." msgstr "" -#: ../../library/importlib.resources.rst:130 +#: ../../library/importlib.resources.rst:133 msgid "Open for binary reading the *resource* within *package*." msgstr "" -#: ../../library/importlib.resources.rst:132 +#: ../../library/importlib.resources.rst:135 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -180,22 +184,22 @@ msgid "" "BinaryIO`` instance, a binary I/O stream open for reading." msgstr "" -#: ../../library/importlib.resources.rst:140 -#: ../../library/importlib.resources.rst:161 -#: ../../library/importlib.resources.rst:179 -#: ../../library/importlib.resources.rst:198 -#: ../../library/importlib.resources.rst:234 -#: ../../library/importlib.resources.rst:250 +#: ../../library/importlib.resources.rst:143 +#: ../../library/importlib.resources.rst:164 +#: ../../library/importlib.resources.rst:182 +#: ../../library/importlib.resources.rst:201 +#: ../../library/importlib.resources.rst:237 +#: ../../library/importlib.resources.rst:253 msgid "Calls to this function can be replaced by::" msgstr "" -#: ../../library/importlib.resources.rst:147 +#: ../../library/importlib.resources.rst:150 msgid "" "Open for text reading the *resource* within *package*. By default, the " "resource is opened for reading as UTF-8." msgstr "" -#: ../../library/importlib.resources.rst:150 +#: ../../library/importlib.resources.rst:153 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -204,18 +208,18 @@ msgid "" "same meaning as with built-in :func:`open`." msgstr "" -#: ../../library/importlib.resources.rst:156 +#: ../../library/importlib.resources.rst:159 msgid "" "This function returns a ``typing.TextIO`` instance, a text I/O stream open " "for reading." msgstr "" -#: ../../library/importlib.resources.rst:168 +#: ../../library/importlib.resources.rst:171 msgid "" "Read and return the contents of the *resource* within *package* as ``bytes``." msgstr "" -#: ../../library/importlib.resources.rst:171 +#: ../../library/importlib.resources.rst:174 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -224,13 +228,13 @@ msgid "" "contents of the resource as :class:`bytes`." msgstr "" -#: ../../library/importlib.resources.rst:186 +#: ../../library/importlib.resources.rst:189 msgid "" "Read and return the contents of *resource* within *package* as a ``str``. By " "default, the contents are read as strict UTF-8." msgstr "" -#: ../../library/importlib.resources.rst:189 +#: ../../library/importlib.resources.rst:192 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -240,20 +244,20 @@ msgid "" "contents of the resource as :class:`str`." msgstr "" -#: ../../library/importlib.resources.rst:205 +#: ../../library/importlib.resources.rst:208 msgid "" "Return the path to the *resource* as an actual file system path. This " "function returns a context manager for use in a :keyword:`with` statement. " "The context manager provides a :class:`pathlib.Path` object." msgstr "" -#: ../../library/importlib.resources.rst:209 +#: ../../library/importlib.resources.rst:212 msgid "" "Exiting the context manager cleans up any temporary file created when the " "resource needs to be extracted from e.g. a zip file." msgstr "" -#: ../../library/importlib.resources.rst:212 +#: ../../library/importlib.resources.rst:215 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -261,11 +265,11 @@ msgid "" "resources (i.e. it cannot be a directory)." msgstr "" -#: ../../library/importlib.resources.rst:219 +#: ../../library/importlib.resources.rst:222 msgid "Calls to this function can be replaced using :func:`as_file`::" msgstr "" -#: ../../library/importlib.resources.rst:226 +#: ../../library/importlib.resources.rst:229 msgid "" "Return ``True`` if there is a resource named *name* in the package, " "otherwise ``False``. This function does not consider directories to be " @@ -273,14 +277,14 @@ msgid "" "the ``Package`` requirements." msgstr "" -#: ../../library/importlib.resources.rst:241 +#: ../../library/importlib.resources.rst:244 msgid "" "Return an iterable over the named items within the package. The iterable " "returns :class:`str` resources (e.g. files) and non-resources (e.g. " "directories). The iterable does not recurse into subdirectories." msgstr "" -#: ../../library/importlib.resources.rst:245 +#: ../../library/importlib.resources.rst:248 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements." diff --git a/library/os.po b/library/os.po index bfc519c83b..e7c91a433e 100644 --- a/library/os.po +++ b/library/os.po @@ -302,32 +302,32 @@ msgstr "" #: ../../library/os.rst:703 ../../library/os.rst:712 ../../library/os.rst:719 #: ../../library/os.rst:726 ../../library/os.rst:735 ../../library/os.rst:1161 #: ../../library/os.rst:1345 ../../library/os.rst:1371 -#: ../../library/os.rst:1608 ../../library/os.rst:1647 -#: ../../library/os.rst:1656 ../../library/os.rst:2020 -#: ../../library/os.rst:2109 ../../library/os.rst:2149 -#: ../../library/os.rst:2429 ../../library/os.rst:2451 -#: ../../library/os.rst:4035 ../../library/os.rst:4042 -#: ../../library/os.rst:4049 ../../library/os.rst:4056 -#: ../../library/os.rst:4063 ../../library/os.rst:4070 -#: ../../library/os.rst:4077 ../../library/os.rst:4085 -#: ../../library/os.rst:4093 ../../library/os.rst:4100 -#: ../../library/os.rst:4107 ../../library/os.rst:4116 -#: ../../library/os.rst:4124 ../../library/os.rst:4132 -#: ../../library/os.rst:4139 ../../library/os.rst:4146 -#: ../../library/os.rst:4167 ../../library/os.rst:4184 -#: ../../library/os.rst:4224 ../../library/os.rst:4231 -#: ../../library/os.rst:4261 ../../library/os.rst:4388 -#: ../../library/os.rst:4437 ../../library/os.rst:4674 -#: ../../library/os.rst:4708 ../../library/os.rst:4766 -#: ../../library/os.rst:4780 ../../library/os.rst:4797 -#: ../../library/os.rst:4812 ../../library/os.rst:4823 -#: ../../library/os.rst:4835 ../../library/os.rst:4848 -#: ../../library/os.rst:4857 ../../library/os.rst:4867 -#: ../../library/os.rst:4880 ../../library/os.rst:4931 -#: ../../library/os.rst:4942 ../../library/os.rst:4954 -#: ../../library/os.rst:4961 ../../library/os.rst:4970 -#: ../../library/os.rst:4979 ../../library/os.rst:4988 -#: ../../library/os.rst:4997 +#: ../../library/os.rst:1608 ../../library/os.rst:1628 +#: ../../library/os.rst:1637 ../../library/os.rst:2021 +#: ../../library/os.rst:2110 ../../library/os.rst:2150 +#: ../../library/os.rst:2430 ../../library/os.rst:2452 +#: ../../library/os.rst:4036 ../../library/os.rst:4043 +#: ../../library/os.rst:4050 ../../library/os.rst:4057 +#: ../../library/os.rst:4064 ../../library/os.rst:4071 +#: ../../library/os.rst:4078 ../../library/os.rst:4086 +#: ../../library/os.rst:4094 ../../library/os.rst:4101 +#: ../../library/os.rst:4108 ../../library/os.rst:4117 +#: ../../library/os.rst:4125 ../../library/os.rst:4133 +#: ../../library/os.rst:4140 ../../library/os.rst:4147 +#: ../../library/os.rst:4168 ../../library/os.rst:4185 +#: ../../library/os.rst:4225 ../../library/os.rst:4232 +#: ../../library/os.rst:4262 ../../library/os.rst:4389 +#: ../../library/os.rst:4438 ../../library/os.rst:4675 +#: ../../library/os.rst:4709 ../../library/os.rst:4767 +#: ../../library/os.rst:4781 ../../library/os.rst:4798 +#: ../../library/os.rst:4813 ../../library/os.rst:4824 +#: ../../library/os.rst:4836 ../../library/os.rst:4849 +#: ../../library/os.rst:4858 ../../library/os.rst:4868 +#: ../../library/os.rst:4881 ../../library/os.rst:4932 +#: ../../library/os.rst:4943 ../../library/os.rst:4955 +#: ../../library/os.rst:4962 ../../library/os.rst:4971 +#: ../../library/os.rst:4980 ../../library/os.rst:4989 +#: ../../library/os.rst:4998 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -484,11 +484,11 @@ msgstr "" #: ../../library/os.rst:322 ../../library/os.rst:1086 ../../library/os.rst:1097 #: ../../library/os.rst:1110 ../../library/os.rst:1357 -#: ../../library/os.rst:1628 ../../library/os.rst:1796 -#: ../../library/os.rst:2529 ../../library/os.rst:3374 -#: ../../library/os.rst:3411 ../../library/os.rst:4027 -#: ../../library/os.rst:4525 ../../library/os.rst:4536 -#: ../../library/os.rst:4653 +#: ../../library/os.rst:1649 ../../library/os.rst:1797 +#: ../../library/os.rst:2530 ../../library/os.rst:3375 +#: ../../library/os.rst:3412 ../../library/os.rst:4028 +#: ../../library/os.rst:4526 ../../library/os.rst:4537 +#: ../../library/os.rst:4654 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -513,15 +513,15 @@ msgstr "" #: ../../library/os.rst:1074 ../../library/os.rst:1138 #: ../../library/os.rst:1150 ../../library/os.rst:1396 #: ../../library/os.rst:1411 ../../library/os.rst:1424 -#: ../../library/os.rst:1493 ../../library/os.rst:1707 -#: ../../library/os.rst:1734 ../../library/os.rst:1769 -#: ../../library/os.rst:2092 ../../library/os.rst:2123 -#: ../../library/os.rst:2164 ../../library/os.rst:2177 -#: ../../library/os.rst:2495 ../../library/os.rst:2507 -#: ../../library/os.rst:3240 ../../library/os.rst:3397 -#: ../../library/os.rst:3630 ../../library/os.rst:5143 -#: ../../library/os.rst:5152 ../../library/os.rst:5173 -#: ../../library/os.rst:5183 ../../library/os.rst:5192 +#: ../../library/os.rst:1493 ../../library/os.rst:1708 +#: ../../library/os.rst:1735 ../../library/os.rst:1770 +#: ../../library/os.rst:2093 ../../library/os.rst:2124 +#: ../../library/os.rst:2165 ../../library/os.rst:2178 +#: ../../library/os.rst:2496 ../../library/os.rst:2508 +#: ../../library/os.rst:3241 ../../library/os.rst:3398 +#: ../../library/os.rst:3631 ../../library/os.rst:5144 +#: ../../library/os.rst:5153 ../../library/os.rst:5174 +#: ../../library/os.rst:5184 ../../library/os.rst:5193 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -593,10 +593,10 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3992 -#: ../../library/os.rst:4208 ../../library/os.rst:4506 -#: ../../library/os.rst:4630 ../../library/os.rst:4746 -#: ../../library/os.rst:4915 +#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3993 +#: ../../library/os.rst:4209 ../../library/os.rst:4507 +#: ../../library/os.rst:4631 ../../library/os.rst:4747 +#: ../../library/os.rst:4916 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -894,7 +894,7 @@ msgid "" "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:789 ../../library/os.rst:4655 +#: ../../library/os.rst:789 ../../library/os.rst:4656 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1123,8 +1123,8 @@ msgid "" "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:1002 ../../library/os.rst:2068 -#: ../../library/os.rst:2162 +#: ../../library/os.rst:1002 ../../library/os.rst:2069 +#: ../../library/os.rst:2163 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -1133,9 +1133,9 @@ msgstr "" "` ``os.chmod``。" #: ../../library/os.rst:1006 ../../library/os.rst:1021 -#: ../../library/os.rst:1112 ../../library/os.rst:1630 -#: ../../library/os.rst:2065 ../../library/os.rst:2094 -#: ../../library/os.rst:3376 +#: ../../library/os.rst:1112 ../../library/os.rst:1651 +#: ../../library/os.rst:2066 ../../library/os.rst:2095 +#: ../../library/os.rst:3377 msgid "" "The function is limited on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." @@ -1148,8 +1148,8 @@ msgid "" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:1017 ../../library/os.rst:2090 -#: ../../library/os.rst:2175 +#: ../../library/os.rst:1017 ../../library/os.rst:2091 +#: ../../library/os.rst:2176 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." @@ -1178,7 +1178,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:1046 ../../library/os.rst:2487 +#: ../../library/os.rst:1046 ../../library/os.rst:2488 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -1200,7 +1200,7 @@ msgstr "" msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:1065 ../../library/os.rst:2322 +#: ../../library/os.rst:1065 ../../library/os.rst:2323 msgid "The :func:`.stat` function." msgstr "" @@ -1240,7 +1240,7 @@ msgstr "" "引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:1099 ../../library/os.rst:3415 +#: ../../library/os.rst:1099 ../../library/os.rst:3416 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" @@ -1255,11 +1255,11 @@ msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`set_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1115 ../../library/os.rst:1633 +#: ../../library/os.rst:1115 ../../library/os.rst:1654 msgid "On Windows, this function is limited to pipes." msgstr "" -#: ../../library/os.rst:1119 ../../library/os.rst:1637 +#: ../../library/os.rst:1119 ../../library/os.rst:1658 msgid "Added support for pipes on Windows." msgstr "新增對 Windows 上的 pipe 支援。" @@ -1437,35 +1437,35 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1254 ../../library/os.rst:2363 -#: ../../library/os.rst:2431 ../../library/os.rst:2453 -#: ../../library/os.rst:2534 ../../library/os.rst:2565 +#: ../../library/os.rst:1254 ../../library/os.rst:2364 +#: ../../library/os.rst:2432 ../../library/os.rst:2454 +#: ../../library/os.rst:2535 ../../library/os.rst:2566 msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" #: ../../library/os.rst:1257 ../../library/os.rst:1576 -#: ../../library/os.rst:1751 ../../library/os.rst:4748 +#: ../../library/os.rst:1752 ../../library/os.rst:4749 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" "exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/os.rst:1262 ../../library/os.rst:1962 -#: ../../library/os.rst:1994 ../../library/os.rst:2025 -#: ../../library/os.rst:2074 ../../library/os.rst:2111 -#: ../../library/os.rst:2151 ../../library/os.rst:2166 -#: ../../library/os.rst:2179 ../../library/os.rst:2238 -#: ../../library/os.rst:2330 ../../library/os.rst:2366 -#: ../../library/os.rst:2407 ../../library/os.rst:2434 -#: ../../library/os.rst:2456 ../../library/os.rst:2497 -#: ../../library/os.rst:2568 ../../library/os.rst:2587 -#: ../../library/os.rst:2675 ../../library/os.rst:2965 -#: ../../library/os.rst:3254 ../../library/os.rst:3418 -#: ../../library/os.rst:3434 ../../library/os.rst:3474 -#: ../../library/os.rst:3573 ../../library/os.rst:3634 -#: ../../library/os.rst:3818 ../../library/os.rst:3998 -#: ../../library/os.rst:4513 +#: ../../library/os.rst:1262 ../../library/os.rst:1963 +#: ../../library/os.rst:1995 ../../library/os.rst:2026 +#: ../../library/os.rst:2075 ../../library/os.rst:2112 +#: ../../library/os.rst:2152 ../../library/os.rst:2167 +#: ../../library/os.rst:2180 ../../library/os.rst:2239 +#: ../../library/os.rst:2331 ../../library/os.rst:2367 +#: ../../library/os.rst:2408 ../../library/os.rst:2435 +#: ../../library/os.rst:2457 ../../library/os.rst:2498 +#: ../../library/os.rst:2569 ../../library/os.rst:2588 +#: ../../library/os.rst:2676 ../../library/os.rst:2966 +#: ../../library/os.rst:3255 ../../library/os.rst:3419 +#: ../../library/os.rst:3435 ../../library/os.rst:3475 +#: ../../library/os.rst:3574 ../../library/os.rst:3635 +#: ../../library/os.rst:3819 ../../library/os.rst:3999 +#: ../../library/os.rst:4514 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -1605,14 +1605,14 @@ msgstr ":data:`RWF_HIPRI`" msgid ":data:`RWF_NOWAIT`" msgstr ":data:`RWF_NOWAIT`" -#: ../../library/os.rst:1442 ../../library/os.rst:1701 +#: ../../library/os.rst:1442 ../../library/os.rst:1702 msgid "" "Return the total number of bytes actually read which can be less than the " "total capacity of all the objects." msgstr "" #: ../../library/os.rst:1445 ../../library/os.rst:1515 -#: ../../library/os.rst:1704 ../../library/os.rst:1766 +#: ../../library/os.rst:1705 ../../library/os.rst:1767 msgid "" "The operating system may set a limit (:func:`sysconf` value " "``'SC_IOV_MAX'``) on the number of buffers that can be used." @@ -1674,7 +1674,7 @@ msgid "" "*offset*, leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1491 ../../library/os.rst:1741 +#: ../../library/os.rst:1491 ../../library/os.rst:1742 msgid "Return the number of bytes actually written." msgstr "" @@ -1805,31 +1805,31 @@ msgstr "" msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: ../../library/os.rst:1623 -msgid "" -"Set the blocking mode of the specified file descriptor. Set the :data:" -"`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise." -msgstr "" - -#: ../../library/os.rst:1626 -msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." -msgstr "" -"另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" - -#: ../../library/os.rst:1644 +#: ../../library/os.rst:1625 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: ../../library/os.rst:1653 +#: ../../library/os.rst:1634 msgid "" "Parameter to the :func:`sendfile` function, if the implementation supports " "it. The data won't be cached in the virtual memory and will be freed " "afterwards." msgstr "" -#: ../../library/os.rst:1663 +#: ../../library/os.rst:1644 +msgid "" +"Set the blocking mode of the specified file descriptor. Set the :data:" +"`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise." +msgstr "" + +#: ../../library/os.rst:1647 +msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." +msgstr "" +"另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" + +#: ../../library/os.rst:1664 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1841,7 +1841,7 @@ msgid "" "`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:1672 +#: ../../library/os.rst:1673 msgid "" "This copy is done without the additional cost of transferring data from the " "kernel to user space and then back into the kernel. Additionally, some " @@ -1849,7 +1849,7 @@ msgid "" "files are opened as binary." msgstr "" -#: ../../library/os.rst:1677 +#: ../../library/os.rst:1678 msgid "" "Upon successful completion, returns the number of bytes spliced to or from " "the pipe. A return value of 0 means end of input. If *src* refers to a pipe, " @@ -1858,11 +1858,11 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1683 +#: ../../library/os.rst:1684 msgid ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" -#: ../../library/os.rst:1696 +#: ../../library/os.rst:1697 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects ` *buffers*. Transfer data into each buffer until " @@ -1870,34 +1870,34 @@ msgid "" "rest of the data." msgstr "" -#: ../../library/os.rst:1714 +#: ../../library/os.rst:1715 msgid "" "Return the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`)." msgstr "" -#: ../../library/os.rst:1717 ../../library/os.rst:1725 +#: ../../library/os.rst:1718 ../../library/os.rst:1726 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/os.rst:1722 +#: ../../library/os.rst:1723 msgid "" "Set the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`) to *pg*." msgstr "" -#: ../../library/os.rst:1730 +#: ../../library/os.rst:1731 msgid "" "Return a string which specifies the terminal device associated with file " "descriptor *fd*. If *fd* is not associated with a terminal device, an " "exception is raised." msgstr "" -#: ../../library/os.rst:1739 +#: ../../library/os.rst:1740 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1745 +#: ../../library/os.rst:1746 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To write a " @@ -1906,7 +1906,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: ../../library/os.rst:1759 +#: ../../library/os.rst:1760 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects `. Buffers are " @@ -1914,70 +1914,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: ../../library/os.rst:1764 +#: ../../library/os.rst:1765 msgid "Returns the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1777 +#: ../../library/os.rst:1778 msgid "Querying the size of a terminal" msgstr "" -#: ../../library/os.rst:1783 +#: ../../library/os.rst:1784 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: ../../library/os.rst:1786 +#: ../../library/os.rst:1787 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: ../../library/os.rst:1789 +#: ../../library/os.rst:1790 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: ../../library/os.rst:1792 +#: ../../library/os.rst:1793 msgid "" ":func:`shutil.get_terminal_size` is the high-level function which should " "normally be used, ``os.get_terminal_size`` is the low-level implementation." msgstr "" -#: ../../library/os.rst:1800 +#: ../../library/os.rst:1801 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: ../../library/os.rst:1804 +#: ../../library/os.rst:1805 msgid "Width of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1808 +#: ../../library/os.rst:1809 msgid "Height of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1814 +#: ../../library/os.rst:1815 msgid "Inheritance of File Descriptors" msgstr "" -#: ../../library/os.rst:1818 +#: ../../library/os.rst:1819 msgid "" "A file descriptor has an \"inheritable\" flag which indicates if the file " "descriptor can be inherited by child processes. Since Python 3.4, file " "descriptors created by Python are non-inheritable by default." msgstr "" -#: ../../library/os.rst:1822 +#: ../../library/os.rst:1823 msgid "" "On UNIX, non-inheritable file descriptors are closed in child processes at " "the execution of a new program, other file descriptors are inherited." msgstr "" -#: ../../library/os.rst:1825 +#: ../../library/os.rst:1826 msgid "" "On Windows, non-inheritable handles and file descriptors are closed in child " "processes, except for standard streams (file descriptors 0, 1 and 2: stdin, " @@ -1988,46 +1988,46 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1833 +#: ../../library/os.rst:1834 msgid "" "On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, the file " "descriptor cannot be modified." msgstr "" -#: ../../library/os.rst:1838 +#: ../../library/os.rst:1839 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1842 +#: ../../library/os.rst:1843 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1846 +#: ../../library/os.rst:1847 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1848 ../../library/os.rst:1854 -#: ../../library/os.rst:3923 ../../library/os.rst:4548 -#: ../../library/os.rst:4593 +#: ../../library/os.rst:1849 ../../library/os.rst:1855 +#: ../../library/os.rst:3924 ../../library/os.rst:4549 +#: ../../library/os.rst:4594 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:1852 +#: ../../library/os.rst:1853 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:1860 +#: ../../library/os.rst:1861 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:1862 +#: ../../library/os.rst:1863 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:1867 +#: ../../library/os.rst:1868 msgid "" "**specifying a file descriptor:** Normally the *path* argument provided to " "functions in the :mod:`os` module must be a string specifying a file path. " @@ -2038,7 +2038,7 @@ msgid "" "``chdir``).)" msgstr "" -#: ../../library/os.rst:1875 +#: ../../library/os.rst:1876 msgid "" "You can check whether or not *path* can be specified as a file descriptor " "for a particular function on your platform using :data:`os.supports_fd`. If " @@ -2046,13 +2046,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1880 +#: ../../library/os.rst:1881 msgid "" "If the function also supports *dir_fd* or *follow_symlinks* arguments, it's " "an error to specify one of those when supplying *path* as a file descriptor." msgstr "" -#: ../../library/os.rst:1885 +#: ../../library/os.rst:1886 msgid "" "**paths relative to directory descriptors:** If *dir_fd* is not ``None``, it " "should be a file descriptor referring to a directory, and the path to " @@ -2063,14 +2063,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:1892 +#: ../../library/os.rst:1893 msgid "" "You can check whether or not *dir_fd* is supported for a particular function " "on your platform using :data:`os.supports_dir_fd`. If it's unavailable, " "using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1898 +#: ../../library/os.rst:1899 msgid "" "**not following symlinks:** If *follow_symlinks* is ``False``, and the last " "element of the path to operate on is a symbolic link, the function will " @@ -2079,14 +2079,14 @@ msgid "" "function.)" msgstr "" -#: ../../library/os.rst:1904 +#: ../../library/os.rst:1905 msgid "" "You can check whether or not *follow_symlinks* is supported for a particular " "function on your platform using :data:`os.supports_follow_symlinks`. If it's " "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1912 +#: ../../library/os.rst:1913 msgid "" "Use the real uid/gid to test for access to *path*. Note that most " "operations will use the effective uid/gid, therefore this routine can be " @@ -2098,13 +2098,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:1921 +#: ../../library/os.rst:1922 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1924 +#: ../../library/os.rst:1925 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -2113,7 +2113,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1932 +#: ../../library/os.rst:1933 msgid "" "Using :func:`access` to check if a user is authorized to e.g. open a file " "before actually doing so using :func:`open` creates a security hole, because " @@ -2122,117 +2122,117 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:1943 +#: ../../library/os.rst:1944 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:1955 +#: ../../library/os.rst:1956 msgid "" "I/O operations may fail even when :func:`access` indicates that they would " "succeed, particularly for operations on network filesystems which may have " "permissions semantics beyond the usual POSIX permission-bit model." msgstr "" -#: ../../library/os.rst:1959 +#: ../../library/os.rst:1960 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "新增 *dir_fd*\\ 、\\ *effective_ids* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:1971 +#: ../../library/os.rst:1972 msgid "" "Values to pass as the *mode* parameter of :func:`access` to test the " "existence, readability, writability and executability of *path*, " "respectively." msgstr "" -#: ../../library/os.rst:1980 +#: ../../library/os.rst:1981 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:1982 +#: ../../library/os.rst:1983 msgid "" "This function can support :ref:`specifying a file descriptor `. " "The descriptor must refer to an opened directory, not an open file." msgstr "" -#: ../../library/os.rst:1985 +#: ../../library/os.rst:1986 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:1988 ../../library/os.rst:2121 +#: ../../library/os.rst:1989 ../../library/os.rst:2122 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.chdir``。" -#: ../../library/os.rst:1990 +#: ../../library/os.rst:1991 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:2000 +#: ../../library/os.rst:2001 msgid "" "Set the flags of *path* to the numeric *flags*. *flags* may take a " "combination (bitwise OR) of the following values (as defined in the :mod:" "`stat` module):" msgstr "" -#: ../../library/os.rst:2003 +#: ../../library/os.rst:2004 msgid ":const:`stat.UF_NODUMP`" msgstr ":const:`stat.UF_NODUMP`" -#: ../../library/os.rst:2004 +#: ../../library/os.rst:2005 msgid ":const:`stat.UF_IMMUTABLE`" msgstr ":const:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:2005 +#: ../../library/os.rst:2006 msgid ":const:`stat.UF_APPEND`" msgstr ":const:`stat.UF_APPEND`" -#: ../../library/os.rst:2006 +#: ../../library/os.rst:2007 msgid ":const:`stat.UF_OPAQUE`" msgstr ":const:`stat.UF_OPAQUE`" -#: ../../library/os.rst:2007 +#: ../../library/os.rst:2008 msgid ":const:`stat.UF_NOUNLINK`" msgstr ":const:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:2008 +#: ../../library/os.rst:2009 msgid ":const:`stat.UF_COMPRESSED`" msgstr ":const:`stat.UF_COMPRESSED`" -#: ../../library/os.rst:2009 +#: ../../library/os.rst:2010 msgid ":const:`stat.UF_HIDDEN`" msgstr ":const:`stat.UF_HIDDEN`" -#: ../../library/os.rst:2010 +#: ../../library/os.rst:2011 msgid ":const:`stat.SF_ARCHIVED`" msgstr ":const:`stat.SF_ARCHIVED`" -#: ../../library/os.rst:2011 +#: ../../library/os.rst:2012 msgid ":const:`stat.SF_IMMUTABLE`" msgstr ":const:`stat.SF_IMMUTABLE`" -#: ../../library/os.rst:2012 +#: ../../library/os.rst:2013 msgid ":const:`stat.SF_APPEND`" msgstr ":const:`stat.SF_APPEND`" -#: ../../library/os.rst:2013 +#: ../../library/os.rst:2014 msgid ":const:`stat.SF_NOUNLINK`" msgstr ":const:`stat.SF_NOUNLINK`" -#: ../../library/os.rst:2014 +#: ../../library/os.rst:2015 msgid ":const:`stat.SF_SNAPSHOT`" msgstr ":const:`stat.SF_SNAPSHOT`" -#: ../../library/os.rst:2016 +#: ../../library/os.rst:2017 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2018 ../../library/os.rst:2147 +#: ../../library/os.rst:2019 ../../library/os.rst:2148 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." @@ -2240,164 +2240,164 @@ msgstr "" "引發一個附帶引數 ``path``、``flags`` 的\\ :ref:`稽核事件 ` ``os." "chflags``。" -#: ../../library/os.rst:2022 +#: ../../library/os.rst:2023 msgid "The *follow_symlinks* argument." msgstr "*follow_symlinks* 引數。" -#: ../../library/os.rst:2031 +#: ../../library/os.rst:2032 msgid "" "Change the mode of *path* to the numeric *mode*. *mode* may take one of the " "following values (as defined in the :mod:`stat` module) or bitwise ORed " "combinations of them:" msgstr "" -#: ../../library/os.rst:2035 +#: ../../library/os.rst:2036 msgid ":const:`stat.S_ISUID`" msgstr ":const:`stat.S_ISUID`" -#: ../../library/os.rst:2036 +#: ../../library/os.rst:2037 msgid ":const:`stat.S_ISGID`" msgstr ":const:`stat.S_ISGID`" -#: ../../library/os.rst:2037 +#: ../../library/os.rst:2038 msgid ":const:`stat.S_ENFMT`" msgstr ":const:`stat.S_ENFMT`" -#: ../../library/os.rst:2038 +#: ../../library/os.rst:2039 msgid ":const:`stat.S_ISVTX`" msgstr ":const:`stat.S_ISVTX`" -#: ../../library/os.rst:2039 +#: ../../library/os.rst:2040 msgid ":const:`stat.S_IREAD`" msgstr ":const:`stat.S_IREAD`" -#: ../../library/os.rst:2040 +#: ../../library/os.rst:2041 msgid ":const:`stat.S_IWRITE`" msgstr ":const:`stat.S_IWRITE`" -#: ../../library/os.rst:2041 +#: ../../library/os.rst:2042 msgid ":const:`stat.S_IEXEC`" msgstr ":const:`stat.S_IEXEC`" -#: ../../library/os.rst:2042 +#: ../../library/os.rst:2043 msgid ":const:`stat.S_IRWXU`" msgstr ":const:`stat.S_IRWXU`" -#: ../../library/os.rst:2043 +#: ../../library/os.rst:2044 msgid ":const:`stat.S_IRUSR`" msgstr ":const:`stat.S_IRUSR`" -#: ../../library/os.rst:2044 +#: ../../library/os.rst:2045 msgid ":const:`stat.S_IWUSR`" msgstr ":const:`stat.S_IWUSR`" -#: ../../library/os.rst:2045 +#: ../../library/os.rst:2046 msgid ":const:`stat.S_IXUSR`" msgstr ":const:`stat.S_IXUSR`" -#: ../../library/os.rst:2046 +#: ../../library/os.rst:2047 msgid ":const:`stat.S_IRWXG`" msgstr ":const:`stat.S_IRWXG`" -#: ../../library/os.rst:2047 +#: ../../library/os.rst:2048 msgid ":const:`stat.S_IRGRP`" msgstr ":const:`stat.S_IRGRP`" -#: ../../library/os.rst:2048 +#: ../../library/os.rst:2049 msgid ":const:`stat.S_IWGRP`" msgstr ":const:`stat.S_IWGRP`" -#: ../../library/os.rst:2049 +#: ../../library/os.rst:2050 msgid ":const:`stat.S_IXGRP`" msgstr ":const:`stat.S_IXGRP`" -#: ../../library/os.rst:2050 +#: ../../library/os.rst:2051 msgid ":const:`stat.S_IRWXO`" msgstr ":const:`stat.S_IRWXO`" -#: ../../library/os.rst:2051 +#: ../../library/os.rst:2052 msgid ":const:`stat.S_IROTH`" msgstr ":const:`stat.S_IROTH`" -#: ../../library/os.rst:2052 +#: ../../library/os.rst:2053 msgid ":const:`stat.S_IWOTH`" msgstr ":const:`stat.S_IWOTH`" -#: ../../library/os.rst:2053 +#: ../../library/os.rst:2054 msgid ":const:`stat.S_IXOTH`" msgstr ":const:`stat.S_IXOTH`" -#: ../../library/os.rst:2055 ../../library/os.rst:2083 -#: ../../library/os.rst:3464 +#: ../../library/os.rst:2056 ../../library/os.rst:2084 +#: ../../library/os.rst:3465 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " "following symlinks `." msgstr "" -#: ../../library/os.rst:2061 +#: ../../library/os.rst:2062 msgid "" "Although Windows supports :func:`chmod`, you can only set the file's read-" "only flag with it (via the ``stat.S_IWRITE`` and ``stat.S_IREAD`` constants " "or a corresponding integer value). All other bits are ignored." msgstr "" -#: ../../library/os.rst:2070 ../../library/os.rst:2097 +#: ../../library/os.rst:2071 ../../library/os.rst:2098 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:2080 +#: ../../library/os.rst:2081 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. To " "leave one of the ids unchanged, set it to -1." msgstr "" -#: ../../library/os.rst:2087 +#: ../../library/os.rst:2088 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:2101 +#: ../../library/os.rst:2102 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2107 +#: ../../library/os.rst:2108 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:2117 +#: ../../library/os.rst:2118 msgid "" "Change the current working directory to the directory represented by the " "file descriptor *fd*. The descriptor must refer to an opened directory, not " "an open file. As of Python 3.3, this is equivalent to ``os.chdir(fd)``." msgstr "" -#: ../../library/os.rst:2128 +#: ../../library/os.rst:2129 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:2133 +#: ../../library/os.rst:2134 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:2135 +#: ../../library/os.rst:2136 msgid "" "The function now uses the UTF-8 encoding on Windows, rather than the ANSI " "code page: see :pep:`529` for the rationale. The function is no longer " "deprecated on Windows." msgstr "" -#: ../../library/os.rst:2143 +#: ../../library/os.rst:2144 msgid "" "Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do " "not follow symbolic links. As of Python 3.3, this is equivalent to ``os." "chflags(path, flags, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2157 +#: ../../library/os.rst:2158 msgid "" "Change the mode of *path* to the numeric *mode*. If path is a symlink, this " "affects the symlink rather than the target. See the docs for :func:`chmod` " @@ -2405,25 +2405,25 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2171 +#: ../../library/os.rst:2172 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. " "This function will not follow symbolic links. As of Python 3.3, this is " "equivalent to ``os.chown(path, uid, gid, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2185 +#: ../../library/os.rst:2186 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2187 +#: ../../library/os.rst:2188 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `, and :ref:" "`not following symlinks `." msgstr "" -#: ../../library/os.rst:2191 +#: ../../library/os.rst:2192 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2431,24 +2431,24 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.link``。" -#: ../../library/os.rst:2193 +#: ../../library/os.rst:2194 msgid ":ref:`Availability `: Unix, Windows, not Emscripten." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten。" -#: ../../library/os.rst:2195 +#: ../../library/os.rst:2196 msgid "Added Windows support." msgstr "新支援 Windows。" -#: ../../library/os.rst:2198 +#: ../../library/os.rst:2199 msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* arguments." msgstr "增加 *src_dir_fd*\\ 、\\ *dst_dir_fd* 與 *follow_symlinks* 引數。" -#: ../../library/os.rst:2201 ../../library/os.rst:2619 -#: ../../library/os.rst:2656 ../../library/os.rst:3386 +#: ../../library/os.rst:2202 ../../library/os.rst:2620 +#: ../../library/os.rst:2657 ../../library/os.rst:3387 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:2207 +#: ../../library/os.rst:2208 msgid "" "Return a list containing the names of the entries in the directory given by " "*path*. The list is in arbitrary order, and does not include the special " @@ -2457,7 +2457,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:2213 +#: ../../library/os.rst:2214 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2465,42 +2465,42 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2218 ../../library/os.rst:2704 +#: ../../library/os.rst:2219 ../../library/os.rst:2705 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:2221 +#: ../../library/os.rst:2222 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listdir``。" -#: ../../library/os.rst:2224 +#: ../../library/os.rst:2225 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:2228 +#: ../../library/os.rst:2229 msgid "" "The :func:`scandir` function returns directory entries along with file " "attribute information, giving better performance for many common use cases." msgstr "" -#: ../../library/os.rst:2232 +#: ../../library/os.rst:2233 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2235 ../../library/os.rst:3245 +#: ../../library/os.rst:2236 ../../library/os.rst:3246 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2244 +#: ../../library/os.rst:2245 msgid "Return a list containing the names of drives on a Windows system." msgstr "" -#: ../../library/os.rst:2246 +#: ../../library/os.rst:2247 msgid "" "A drive name typically looks like ``'C:\\\\'``. Not every drive name will be " "associated with a volume, and some may be inaccessible for a variety of " @@ -2508,27 +2508,27 @@ msgid "" "function does not test for access." msgstr "" -#: ../../library/os.rst:2251 +#: ../../library/os.rst:2252 msgid "May raise :exc:`OSError` if an error occurs collecting the drive names." msgstr "" -#: ../../library/os.rst:2254 +#: ../../library/os.rst:2255 msgid "" "Raises an :ref:`auditing event ` ``os.listdrives`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listdrives``。" -#: ../../library/os.rst:2256 ../../library/os.rst:2280 -#: ../../library/os.rst:2300 +#: ../../library/os.rst:2257 ../../library/os.rst:2281 +#: ../../library/os.rst:2301 msgid ":ref:`Availability `: Windows" msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:2263 +#: ../../library/os.rst:2264 msgid "" "Return a list containing the mount points for a volume on a Windows system." msgstr "" -#: ../../library/os.rst:2266 +#: ../../library/os.rst:2267 msgid "" "*volume* must be represented as a GUID path, like those returned by :func:" "`os.listvolumes`. Volumes may be mounted in multiple locations or not at " @@ -2536,19 +2536,19 @@ msgid "" "associated with a volume will not be returned by this function." msgstr "" -#: ../../library/os.rst:2272 +#: ../../library/os.rst:2273 msgid "" "The mount points return by this function will be absolute paths, and may be " "longer than the drive name." msgstr "" -#: ../../library/os.rst:2275 +#: ../../library/os.rst:2276 msgid "" "Raises :exc:`OSError` if the volume is not recognized or if an error occurs " "collecting the paths." msgstr "" -#: ../../library/os.rst:2278 +#: ../../library/os.rst:2279 msgid "" "Raises an :ref:`auditing event ` ``os.listmounts`` with argument " "``volume``." @@ -2556,11 +2556,11 @@ msgstr "" "引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 ` ``os." "listmounts``。" -#: ../../library/os.rst:2287 +#: ../../library/os.rst:2288 msgid "Return a list containing the volumes in the system." msgstr "" -#: ../../library/os.rst:2289 +#: ../../library/os.rst:2290 msgid "" "Volumes are typically represented as a GUID path that looks like ``\\\\?" "\\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\\``. Files can usually be " @@ -2569,53 +2569,53 @@ msgid "" "function is to retrieve mount points using :func:`os.listmounts`." msgstr "" -#: ../../library/os.rst:2296 +#: ../../library/os.rst:2297 msgid "May raise :exc:`OSError` if an error occurs collecting the volumes." msgstr "" -#: ../../library/os.rst:2298 +#: ../../library/os.rst:2299 msgid "" "Raises an :ref:`auditing event ` ``os.listvolumes`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listvolumes``。" -#: ../../library/os.rst:2307 +#: ../../library/os.rst:2308 msgid "" "Perform the equivalent of an :c:func:`!lstat` system call on the given path. " "Similar to :func:`~os.stat`, but does not follow symbolic links. Return a :" "class:`stat_result` object." msgstr "" -#: ../../library/os.rst:2311 +#: ../../library/os.rst:2312 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2314 +#: ../../library/os.rst:2315 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2317 ../../library/os.rst:2355 -#: ../../library/os.rst:2420 ../../library/os.rst:2448 -#: ../../library/os.rst:2522 +#: ../../library/os.rst:2318 ../../library/os.rst:2356 +#: ../../library/os.rst:2421 ../../library/os.rst:2449 +#: ../../library/os.rst:2523 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2324 ../../library/os.rst:2531 -#: ../../library/os.rst:3379 +#: ../../library/os.rst:2325 ../../library/os.rst:2532 +#: ../../library/os.rst:3380 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2327 +#: ../../library/os.rst:2328 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" -#: ../../library/os.rst:2333 +#: ../../library/os.rst:2334 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2623,18 +2623,18 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2342 +#: ../../library/os.rst:2343 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2344 +#: ../../library/os.rst:2345 msgid "" "If the directory already exists, :exc:`FileExistsError` is raised. If a " "parent directory in the path does not exist, :exc:`FileNotFoundError` is " "raised." msgstr "" -#: ../../library/os.rst:2349 +#: ../../library/os.rst:2350 msgid "" "On some systems, *mode* is ignored. Where it is used, the current umask " "value is first masked out. If bits other than the last 9 (i.e. the last 3 " @@ -2643,13 +2643,13 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2358 +#: ../../library/os.rst:2359 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:2361 ../../library/os.rst:2395 +#: ../../library/os.rst:2362 ../../library/os.rst:2396 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -2657,13 +2657,13 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.mkdir``。" -#: ../../library/os.rst:2376 +#: ../../library/os.rst:2377 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2379 +#: ../../library/os.rst:2380 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2672,27 +2672,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2385 +#: ../../library/os.rst:2386 msgid "" "If *exist_ok* is ``False`` (the default), a :exc:`FileExistsError` is raised " "if the target directory already exists." msgstr "" -#: ../../library/os.rst:2390 +#: ../../library/os.rst:2391 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2393 +#: ../../library/os.rst:2394 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2397 +#: ../../library/os.rst:2398 msgid "The *exist_ok* parameter." msgstr "*exist_ok* 參數。" -#: ../../library/os.rst:2402 +#: ../../library/os.rst:2403 msgid "" "Before Python 3.4.1, if *exist_ok* was ``True`` and the directory existed, :" "func:`makedirs` would still raise an error if *mode* did not match the mode " @@ -2700,19 +2700,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2410 +#: ../../library/os.rst:2411 msgid "" "The *mode* argument no longer affects the file permission bits of newly " "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2417 +#: ../../library/os.rst:2418 msgid "" "Create a FIFO (a named pipe) named *path* with numeric mode *mode*. The " "current umask value is first masked out from the mode." msgstr "" -#: ../../library/os.rst:2423 +#: ../../library/os.rst:2424 msgid "" "FIFOs are pipes that can be accessed like regular files. FIFOs exist until " "they are deleted (for example with :func:`os.unlink`). Generally, FIFOs are " @@ -2722,7 +2722,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2440 +#: ../../library/os.rst:2441 msgid "" "Create a filesystem node (file, device special file or named pipe) named " "*path*. *mode* specifies both the permissions to use and the type of node to " @@ -2733,23 +2733,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2462 +#: ../../library/os.rst:2463 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2468 +#: ../../library/os.rst:2469 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2474 +#: ../../library/os.rst:2475 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2479 +#: ../../library/os.rst:2480 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2760,20 +2760,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2492 ../../library/os.rst:3238 -#: ../../library/os.rst:3407 +#: ../../library/os.rst:2493 ../../library/os.rst:3239 +#: ../../library/os.rst:3408 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2503 +#: ../../library/os.rst:2504 msgid "" "Dictionary mapping names accepted by :func:`pathconf` and :func:`fpathconf` " "to the integer values defined for those names by the host operating system. " "This can be used to determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:2512 +#: ../../library/os.rst:2513 msgid "" "Return a string representing the path to which the symbolic link points. " "The result may be either an absolute or relative pathname; if it is " @@ -2781,7 +2781,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2517 +#: ../../library/os.rst:2518 msgid "" "If the *path* is a string object (directly or indirectly through a :class:" "`PathLike` interface), the result will also be a string object, and the call " @@ -2789,42 +2789,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2525 +#: ../../library/os.rst:2526 msgid "" "When trying to resolve a path that may contain links, use :func:`~os.path." "realpath` to properly handle recursion and platform differences." msgstr "" -#: ../../library/os.rst:2537 +#: ../../library/os.rst:2538 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2540 +#: ../../library/os.rst:2541 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2543 +#: ../../library/os.rst:2544 msgid "" "Added support for directory junctions, and changed to return the " "substitution path (which typically includes ``\\\\?\\`` prefix) rather than " "the optional \"print name\" field that was previously returned." msgstr "" -#: ../../library/os.rst:2550 +#: ../../library/os.rst:2551 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " "does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/os.rst:2554 ../../library/os.rst:2667 -#: ../../library/os.rst:3358 +#: ../../library/os.rst:2555 ../../library/os.rst:2668 +#: ../../library/os.rst:3359 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2557 +#: ../../library/os.rst:2558 msgid "" "On Windows, attempting to remove a file that is in use causes an exception " "to be raised; on Unix, the directory entry is removed but the storage " @@ -2832,12 +2832,12 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2561 +#: ../../library/os.rst:2562 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2563 ../../library/os.rst:2585 -#: ../../library/os.rst:3429 +#: ../../library/os.rst:2564 ../../library/os.rst:2586 +#: ../../library/os.rst:3430 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -2845,7 +2845,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "remove``。" -#: ../../library/os.rst:2576 +#: ../../library/os.rst:2577 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2857,20 +2857,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2593 +#: ../../library/os.rst:2594 msgid "" "Rename the file or directory *src* to *dst*. If *dst* exists, the operation " "will fail with an :exc:`OSError` subclass in a number of cases:" msgstr "" -#: ../../library/os.rst:2596 +#: ../../library/os.rst:2597 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " "operation may fail if *src* and *dst* are on different filesystems. Use :" "func:`shutil.move` to support moves to a different filesystem." msgstr "" -#: ../../library/os.rst:2600 +#: ../../library/os.rst:2601 msgid "" "On Unix, if *src* is a file and *dst* is a directory or vice-versa, an :exc:" "`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " @@ -2882,20 +2882,20 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2609 ../../library/os.rst:2649 +#: ../../library/os.rst:2610 ../../library/os.rst:2650 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `." msgstr "" -#: ../../library/os.rst:2612 +#: ../../library/os.rst:2613 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2614 ../../library/os.rst:2635 -#: ../../library/os.rst:2652 +#: ../../library/os.rst:2615 ../../library/os.rst:2636 +#: ../../library/os.rst:2653 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2903,11 +2903,11 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.rename``。" -#: ../../library/os.rst:2616 +#: ../../library/os.rst:2617 msgid "The *src_dir_fd* and *dst_dir_fd* arguments." msgstr "*src_dir_fd* 與 *dst_dir_fd* 引數。" -#: ../../library/os.rst:2625 +#: ../../library/os.rst:2626 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2916,17 +2916,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2632 +#: ../../library/os.rst:2633 msgid "" "This function can fail with the new directory structure made if you lack " "permissions needed to remove the leaf directory or file." msgstr "" -#: ../../library/os.rst:2637 +#: ../../library/os.rst:2638 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2643 +#: ../../library/os.rst:2644 msgid "" "Rename the file or directory *src* to *dst*. If *dst* is a non-empty " "directory, :exc:`OSError` will be raised. If *dst* exists and is a file, it " @@ -2935,7 +2935,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2662 +#: ../../library/os.rst:2663 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2943,7 +2943,7 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2670 +#: ../../library/os.rst:2671 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." @@ -2951,11 +2951,11 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "rmdir``。" -#: ../../library/os.rst:2672 ../../library/os.rst:3431 +#: ../../library/os.rst:2673 ../../library/os.rst:3432 msgid "The *dir_fd* parameter." msgstr "*dir_fd* 參數。" -#: ../../library/os.rst:2681 +#: ../../library/os.rst:2682 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2965,7 +2965,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2688 +#: ../../library/os.rst:2689 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2977,7 +2977,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2698 +#: ../../library/os.rst:2699 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the type " @@ -2986,31 +2986,31 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2707 +#: ../../library/os.rst:2708 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.scandir``。" -#: ../../library/os.rst:2709 +#: ../../library/os.rst:2710 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2714 +#: ../../library/os.rst:2715 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2716 +#: ../../library/os.rst:2717 msgid "" "This is called automatically when the iterator is exhausted or garbage " "collected, or when an error happens during iterating. However it is " "advisable to call it explicitly or use the :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:2723 +#: ../../library/os.rst:2724 msgid "" "The following example shows a simple use of :func:`scandir` to display all " "the files (excluding directories) in the given *path* that don't start with " @@ -3018,7 +3018,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2735 +#: ../../library/os.rst:2736 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -3029,7 +3029,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2747 +#: ../../library/os.rst:2748 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -3037,28 +3037,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2753 +#: ../../library/os.rst:2754 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2755 +#: ../../library/os.rst:2756 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2761 +#: ../../library/os.rst:2762 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2764 +#: ../../library/os.rst:2765 msgid "" ":func:`scandir` will provide as much of this information as possible without " "making additional system calls. When a ``stat()`` or ``lstat()`` system call " "is made, the ``os.DirEntry`` object will cache the result." msgstr "" -#: ../../library/os.rst:2768 +#: ../../library/os.rst:2769 msgid "" "``os.DirEntry`` instances are not intended to be stored in long-lived data " "structures; if you know the file metadata has changed or if a long time has " @@ -3066,7 +3066,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2773 +#: ../../library/os.rst:2774 msgid "" "Because the ``os.DirEntry`` methods can make operating system calls, they " "may also raise :exc:`OSError`. If you need very fine-grained control over " @@ -3074,29 +3074,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2778 +#: ../../library/os.rst:2779 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2781 +#: ../../library/os.rst:2782 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2785 +#: ../../library/os.rst:2786 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2788 +#: ../../library/os.rst:2789 msgid "" "The :attr:`name` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2794 +#: ../../library/os.rst:2795 msgid "" "The entry's full path name: equivalent to ``os.path.join(scandir_path, entry." "name)`` where *scandir_path* is the :func:`scandir` *path* argument. The " @@ -3106,51 +3106,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2801 +#: ../../library/os.rst:2802 msgid "" "The :attr:`path` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2807 +#: ../../library/os.rst:2808 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2809 +#: ../../library/os.rst:2810 msgid "" "The result is cached on the ``os.DirEntry`` object. Use ``os.stat(entry." "path, follow_symlinks=False).st_ino`` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2813 +#: ../../library/os.rst:2814 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2818 +#: ../../library/os.rst:2819 msgid "" "Return ``True`` if this entry is a directory or a symbolic link pointing to " "a directory; return ``False`` if the entry is or points to any other kind of " "file, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2822 +#: ../../library/os.rst:2823 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "directory (without following symlinks); return ``False`` if the entry is any " "other kind of file or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2826 +#: ../../library/os.rst:2827 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` along " "with :func:`stat.S_ISDIR` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2830 +#: ../../library/os.rst:2831 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, for non-symlinks, neither Windows or Unix require a system " @@ -3160,46 +3160,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2837 ../../library/os.rst:2867 +#: ../../library/os.rst:2838 ../../library/os.rst:2868 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2842 +#: ../../library/os.rst:2843 msgid "" "Return ``True`` if this entry is a file or a symbolic link pointing to a " "file; return ``False`` if the entry is or points to a directory or other non-" "file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2846 +#: ../../library/os.rst:2847 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "file (without following symlinks); return ``False`` if the entry is a " "directory or other non-file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2850 +#: ../../library/os.rst:2851 msgid "" "The result is cached on the ``os.DirEntry`` object. Caching, system calls " "made, and exceptions raised are as per :func:`~os.DirEntry.is_dir`." msgstr "" -#: ../../library/os.rst:2855 +#: ../../library/os.rst:2856 msgid "" "Return ``True`` if this entry is a symbolic link (even if broken); return " "``False`` if the entry points to a directory or any kind of file, or if it " "doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2859 +#: ../../library/os.rst:2860 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "islink` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2862 +#: ../../library/os.rst:2863 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, neither Windows or Unix require a system call, except on " @@ -3207,48 +3207,48 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2872 +#: ../../library/os.rst:2873 msgid "" "Return ``True`` if this entry is a junction (even if broken); return " "``False`` if the entry points to a regular directory, any kind of file, a " "symlink, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2876 +#: ../../library/os.rst:2877 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "isjunction` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2883 +#: ../../library/os.rst:2884 msgid "" "Return a :class:`stat_result` object for this entry. This method follows " "symbolic links by default; to stat a symbolic link add the " "``follow_symlinks=False`` argument." msgstr "" -#: ../../library/os.rst:2887 +#: ../../library/os.rst:2888 msgid "" "On Unix, this method always requires a system call. On Windows, it only " "requires a system call if *follow_symlinks* is ``True`` and the entry is a " "reparse point (for example, a symbolic link or directory junction)." msgstr "" -#: ../../library/os.rst:2892 +#: ../../library/os.rst:2893 msgid "" "On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of the :" "class:`stat_result` are always set to zero. Call :func:`os.stat` to get " "these attributes." msgstr "" -#: ../../library/os.rst:2896 +#: ../../library/os.rst:2897 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` to fetch " "up-to-date information." msgstr "" -#: ../../library/os.rst:2900 +#: ../../library/os.rst:2901 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -3256,13 +3256,13 @@ msgid "" "``is_file()``, ``is_symlink()``, ``is_junction()``, and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2908 +#: ../../library/os.rst:2909 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2912 +#: ../../library/os.rst:2913 msgid "" "The ``st_ctime`` attribute of a stat result is deprecated on Windows. The " "file creation time is properly available as ``st_birthtime``, and in the " @@ -3270,7 +3270,7 @@ msgid "" "time, if available." msgstr "" -#: ../../library/os.rst:2921 +#: ../../library/os.rst:2922 msgid "" "Get the status of a file or a file descriptor. Perform the equivalent of a :" "c:func:`stat` system call on the given path. *path* may be specified as " @@ -3279,21 +3279,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2927 +#: ../../library/os.rst:2928 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2930 ../../library/os.rst:3797 -#: ../../library/os.rst:3813 ../../library/os.rst:3829 -#: ../../library/os.rst:3849 +#: ../../library/os.rst:2931 ../../library/os.rst:3798 +#: ../../library/os.rst:3814 ../../library/os.rst:3830 +#: ../../library/os.rst:3850 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2933 +#: ../../library/os.rst:2934 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -3307,24 +3307,24 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2946 ../../library/os.rst:3717 +#: ../../library/os.rst:2947 ../../library/os.rst:3718 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/os.rst:2959 +#: ../../library/os.rst:2960 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:2961 +#: ../../library/os.rst:2962 msgid "" "Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " "descriptor instead of a path." msgstr "" -#: ../../library/os.rst:2968 +#: ../../library/os.rst:2969 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -3334,122 +3334,122 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2979 +#: ../../library/os.rst:2980 msgid "" "Object whose attributes correspond roughly to the members of the :c:struct:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:2983 +#: ../../library/os.rst:2984 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2987 +#: ../../library/os.rst:2988 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2991 +#: ../../library/os.rst:2992 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2994 +#: ../../library/os.rst:2995 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2995 +#: ../../library/os.rst:2996 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:3001 +#: ../../library/os.rst:3002 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:3005 +#: ../../library/os.rst:3006 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:3009 +#: ../../library/os.rst:3010 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:3013 +#: ../../library/os.rst:3014 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:3017 +#: ../../library/os.rst:3018 msgid "" "Size of the file in bytes, if it is a regular file or a symbolic link. The " "size of a symbolic link is the length of the pathname it contains, without a " "terminating null byte." msgstr "" -#: ../../library/os.rst:3021 +#: ../../library/os.rst:3022 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:3025 +#: ../../library/os.rst:3026 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:3029 +#: ../../library/os.rst:3030 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:3033 +#: ../../library/os.rst:3034 msgid "Time of most recent metadata change expressed in seconds." msgstr "" -#: ../../library/os.rst:3035 +#: ../../library/os.rst:3036 msgid "" "``st_ctime`` is deprecated on Windows. Use ``st_birthtime`` for the file " "creation time. In the future, ``st_ctime`` will contain the time of the most " "recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3042 +#: ../../library/os.rst:3043 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3046 +#: ../../library/os.rst:3047 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:3051 +#: ../../library/os.rst:3052 msgid "" "Time of most recent metadata change expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3054 +#: ../../library/os.rst:3055 msgid "" "``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns`` for the " "file creation time. In the future, ``st_ctime`` will contain the time of the " "most recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3061 +#: ../../library/os.rst:3062 msgid "" "Time of file creation expressed in seconds. This attribute is not always " "available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3064 +#: ../../library/os.rst:3065 msgid "``st_birthtime`` is now available on Windows." msgstr "" -#: ../../library/os.rst:3069 +#: ../../library/os.rst:3070 msgid "" "Time of file creation expressed in nanoseconds as an integer. This attribute " "is not always available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3077 +#: ../../library/os.rst:3078 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" "attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " @@ -3459,7 +3459,7 @@ msgid "" "details." msgstr "" -#: ../../library/os.rst:3084 +#: ../../library/os.rst:3085 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" "`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " @@ -3472,74 +3472,74 @@ msgid "" "`st_birthtime_ns`." msgstr "" -#: ../../library/os.rst:3094 +#: ../../library/os.rst:3095 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:3099 +#: ../../library/os.rst:3100 msgid "" "Number of 512-byte blocks allocated for file. This may be smaller than :attr:" "`st_size`/512 when the file has holes." msgstr "" -#: ../../library/os.rst:3104 +#: ../../library/os.rst:3105 msgid "" "\"Preferred\" blocksize for efficient file system I/O. Writing to a file in " "smaller chunks may cause an inefficient read-modify-rewrite." msgstr "" -#: ../../library/os.rst:3109 +#: ../../library/os.rst:3110 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:3113 +#: ../../library/os.rst:3114 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:3115 +#: ../../library/os.rst:3116 msgid "" "On other Unix systems (such as FreeBSD), the following attributes may be " "available (but may be only filled out if root tries to use them):" msgstr "" -#: ../../library/os.rst:3120 +#: ../../library/os.rst:3121 msgid "File generation number." msgstr "" -#: ../../library/os.rst:3122 +#: ../../library/os.rst:3123 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3127 +#: ../../library/os.rst:3128 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:3130 +#: ../../library/os.rst:3131 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3134 +#: ../../library/os.rst:3135 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:3138 +#: ../../library/os.rst:3139 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:3142 +#: ../../library/os.rst:3143 msgid "File type." msgstr "" -#: ../../library/os.rst:3144 +#: ../../library/os.rst:3145 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:3148 +#: ../../library/os.rst:3149 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:`!" @@ -3547,7 +3547,7 @@ msgid "" "FILE_ATTRIBUTE_ARCHIVE>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3156 +#: ../../library/os.rst:3157 msgid "" "When :attr:`st_file_attributes` has the :const:`~stat." "FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the tag identifying " @@ -3555,14 +3555,14 @@ msgid "" "IO_REPARSE_TAG_SYMLINK>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3161 +#: ../../library/os.rst:3162 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:struct:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:3165 +#: ../../library/os.rst:3166 msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " @@ -3574,59 +3574,59 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:3174 +#: ../../library/os.rst:3175 msgid "" "Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " "members." msgstr "" -#: ../../library/os.rst:3178 +#: ../../library/os.rst:3179 msgid "Added the :attr:`st_file_attributes` member on Windows." msgstr "在 Windows 上新增 :attr:`st_file_attributes` 成員。" -#: ../../library/os.rst:3181 +#: ../../library/os.rst:3182 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:3185 +#: ../../library/os.rst:3186 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:3188 +#: ../../library/os.rst:3189 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "在 Windows 上新增 :attr:`st_reparse_tag` 成員。" -#: ../../library/os.rst:3191 +#: ../../library/os.rst:3192 msgid "" "On Windows, the :attr:`st_mode` member now identifies special files as :" "const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" -#: ../../library/os.rst:3196 +#: ../../library/os.rst:3197 msgid "" "On Windows, :attr:`st_ctime` is deprecated. Eventually, it will contain the " "last metadata change time, for consistency with other platforms, but for now " "still contains creation time. Use :attr:`st_birthtime` for the creation time." msgstr "" -#: ../../library/os.rst:3202 +#: ../../library/os.rst:3203 msgid "" "On Windows, :attr:`st_ino` may now be up to 128 bits, depending on the file " "system. Previously it would not be above 64 bits, and larger file " "identifiers would be arbitrarily packed." msgstr "" -#: ../../library/os.rst:3207 +#: ../../library/os.rst:3208 msgid "" "On Windows, :attr:`st_rdev` no longer returns a value. Previously it would " "contain the same as :attr:`st_dev`, which was incorrect." msgstr "" -#: ../../library/os.rst:3211 +#: ../../library/os.rst:3212 msgid "Added the :attr:`st_birthtime` member on Windows." msgstr "" -#: ../../library/os.rst:3217 +#: ../../library/os.rst:3218 msgid "" "Perform a :c:func:`!statvfs` system call on the given path. The return " "value is an object whose attributes describe the filesystem on the given " @@ -3636,7 +3636,7 @@ msgid "" "`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:3224 +#: ../../library/os.rst:3225 msgid "" "Two module-level constants are defined for the :attr:`f_flag` attribute's " "bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted read-" @@ -3644,7 +3644,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:3229 +#: ../../library/os.rst:3230 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3657,11 +3657,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:3242 +#: ../../library/os.rst:3243 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:3248 +#: ../../library/os.rst:3249 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3669,11 +3669,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:3257 +#: ../../library/os.rst:3258 msgid "Added :attr:`f_fsid`." msgstr "新增 :attr:`f_fsid`\\ 。" -#: ../../library/os.rst:3263 +#: ../../library/os.rst:3264 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3685,7 +3685,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:3273 +#: ../../library/os.rst:3274 msgid "" "To check whether a particular function accepts an open file descriptor for " "its *dir_fd* parameter, use the ``in`` operator on ``supports_dir_fd``. As " @@ -3693,13 +3693,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3280 +#: ../../library/os.rst:3281 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3288 +#: ../../library/os.rst:3289 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3708,19 +3708,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3294 +#: ../../library/os.rst:3295 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3299 +#: ../../library/os.rst:3300 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3307 +#: ../../library/os.rst:3308 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "permit specifying their *path* parameter as an open file descriptor on the " @@ -3729,7 +3729,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3314 +#: ../../library/os.rst:3315 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3738,7 +3738,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3327 +#: ../../library/os.rst:3328 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3751,7 +3751,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3337 +#: ../../library/os.rst:3338 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3760,11 +3760,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3350 +#: ../../library/os.rst:3351 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3352 +#: ../../library/os.rst:3353 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -3774,7 +3774,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3363 +#: ../../library/os.rst:3364 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3782,12 +3782,12 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3369 +#: ../../library/os.rst:3370 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3372 +#: ../../library/os.rst:3373 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -3795,27 +3795,27 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.symlink``。" -#: ../../library/os.rst:3382 +#: ../../library/os.rst:3383 msgid "" "Added the *dir_fd* argument, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3389 +#: ../../library/os.rst:3390 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3395 +#: ../../library/os.rst:3396 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3404 +#: ../../library/os.rst:3405 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3409 +#: ../../library/os.rst:3410 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -3823,46 +3823,46 @@ msgstr "" "引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:3424 +#: ../../library/os.rst:3425 msgid "" "Remove (delete) the file *path*. This function is semantically identical " "to :func:`remove`; the ``unlink`` name is its traditional Unix name. Please " "see the documentation for :func:`remove` for further information." msgstr "" -#: ../../library/os.rst:3440 +#: ../../library/os.rst:3441 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3442 +#: ../../library/os.rst:3443 msgid "" ":func:`utime` takes two optional parameters, *times* and *ns*. These specify " "the times set on *path* and are used as follows:" msgstr "" -#: ../../library/os.rst:3445 +#: ../../library/os.rst:3446 msgid "" "If *ns* is specified, it must be a 2-tuple of the form ``(atime_ns, " "mtime_ns)`` where each member is an int expressing nanoseconds." msgstr "" -#: ../../library/os.rst:3448 +#: ../../library/os.rst:3449 msgid "" "If *times* is not ``None``, it must be a 2-tuple of the form ``(atime, " "mtime)`` where each member is an int or float expressing seconds." msgstr "" -#: ../../library/os.rst:3451 +#: ../../library/os.rst:3452 msgid "" "If *times* is ``None`` and *ns* is unspecified, this is equivalent to " "specifying ``ns=(atime_ns, mtime_ns)`` where both times are the current time." msgstr "" -#: ../../library/os.rst:3455 +#: ../../library/os.rst:3456 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3457 +#: ../../library/os.rst:3458 msgid "" "Note that the exact times you set here may not be returned by a subsequent :" "func:`~os.stat` call, depending on the resolution with which your operating " @@ -3872,7 +3872,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:3468 +#: ../../library/os.rst:3469 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -3880,13 +3880,13 @@ msgstr "" "引發一個附帶引數 ``path``、``times``、``ns``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.utime``。" -#: ../../library/os.rst:3470 +#: ../../library/os.rst:3471 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3484 +#: ../../library/os.rst:3485 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up. For each directory in the tree rooted at directory *top* " @@ -3894,7 +3894,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3489 +#: ../../library/os.rst:3490 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -3908,7 +3908,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3500 +#: ../../library/os.rst:3501 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -3919,7 +3919,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3508 +#: ../../library/os.rst:3509 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3932,7 +3932,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3517 +#: ../../library/os.rst:3518 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -3942,42 +3942,42 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3523 +#: ../../library/os.rst:3524 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: ../../library/os.rst:3529 +#: ../../library/os.rst:3530 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: ../../library/os.rst:3535 +#: ../../library/os.rst:3536 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3539 ../../library/os.rst:3600 +#: ../../library/os.rst:3540 ../../library/os.rst:3601 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any CVS subdirectory::" msgstr "" -#: ../../library/os.rst:3552 +#: ../../library/os.rst:3553 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3567 +#: ../../library/os.rst:3568 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -3985,25 +3985,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 ` ``os.walk``。" -#: ../../library/os.rst:3569 +#: ../../library/os.rst:3570 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: ../../library/os.rst:3583 +#: ../../library/os.rst:3584 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: ../../library/os.rst:3586 +#: ../../library/os.rst:3587 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: ../../library/os.rst:3589 +#: ../../library/os.rst:3590 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -4011,20 +4011,20 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3596 +#: ../../library/os.rst:3597 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: ../../library/os.rst:3613 +#: ../../library/os.rst:3614 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3628 +#: ../../library/os.rst:3629 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -4032,11 +4032,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 ` ``os.fwalk``。" -#: ../../library/os.rst:3637 +#: ../../library/os.rst:3638 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3643 +#: ../../library/os.rst:3644 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -4044,7 +4044,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3648 +#: ../../library/os.rst:3649 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -4054,23 +4054,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3655 +#: ../../library/os.rst:3656 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:3678 +#: ../../library/os.rst:3679 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3680 +#: ../../library/os.rst:3681 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" -#: ../../library/os.rst:3682 +#: ../../library/os.rst:3683 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: ../../library/os.rst:3689 +#: ../../library/os.rst:3690 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -4079,7 +4079,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3695 +#: ../../library/os.rst:3696 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be an 32 bit unsigned integer. Please note that the initial value is limited " @@ -4087,87 +4087,87 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3700 +#: ../../library/os.rst:3701 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3703 +#: ../../library/os.rst:3704 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: ../../library/os.rst:3706 +#: ../../library/os.rst:3707 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: ../../library/os.rst:3710 +#: ../../library/os.rst:3711 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3713 +#: ../../library/os.rst:3714 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3734 +#: ../../library/os.rst:3735 msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" -#: ../../library/os.rst:3740 +#: ../../library/os.rst:3741 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3743 ../../library/os.rst:3752 -#: ../../library/os.rst:3760 ../../library/os.rst:3769 +#: ../../library/os.rst:3744 ../../library/os.rst:3753 +#: ../../library/os.rst:3761 ../../library/os.rst:3770 msgid ":ref:`Availability `: Linux >= 2.6.27" msgstr ":ref:`適用 `:Linux 2.6.27 以上" -#: ../../library/os.rst:3749 +#: ../../library/os.rst:3750 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3758 +#: ../../library/os.rst:3759 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3766 +#: ../../library/os.rst:3767 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3775 +#: ../../library/os.rst:3776 msgid "" "Provide semaphore-like semantics for reads from a :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3778 +#: ../../library/os.rst:3779 msgid ":ref:`Availability `: Linux >= 2.6.30" msgstr ":ref:`適用 `:Linux 2.6.30 以上" -#: ../../library/os.rst:3784 +#: ../../library/os.rst:3785 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3788 +#: ../../library/os.rst:3789 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3792 +#: ../../library/os.rst:3793 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4175,7 +4175,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3800 +#: ../../library/os.rst:3801 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -4183,12 +4183,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.getxattr``。" -#: ../../library/os.rst:3802 ../../library/os.rst:3834 -#: ../../library/os.rst:3859 +#: ../../library/os.rst:3803 ../../library/os.rst:3835 +#: ../../library/os.rst:3860 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3808 +#: ../../library/os.rst:3809 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4196,14 +4196,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3816 +#: ../../library/os.rst:3817 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" -#: ../../library/os.rst:3824 +#: ../../library/os.rst:3825 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4211,7 +4211,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:3832 +#: ../../library/os.rst:3833 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -4219,7 +4219,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.removexattr``。" -#: ../../library/os.rst:3840 +#: ../../library/os.rst:3841 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4231,13 +4231,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3854 +#: ../../library/os.rst:3855 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:3857 +#: ../../library/os.rst:3858 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -4245,33 +4245,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 ` ``os.setxattr``。" -#: ../../library/os.rst:3865 +#: ../../library/os.rst:3866 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3871 +#: ../../library/os.rst:3872 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: ../../library/os.rst:3877 +#: ../../library/os.rst:3878 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: ../../library/os.rst:3884 +#: ../../library/os.rst:3885 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3886 +#: ../../library/os.rst:3887 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3888 +#: ../../library/os.rst:3889 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -4282,7 +4282,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3899 +#: ../../library/os.rst:3900 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -4291,31 +4291,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3908 +#: ../../library/os.rst:3909 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3910 +#: ../../library/os.rst:3911 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through :data:`sys.path`), and also " "by :mod:`ctypes`." msgstr "" -#: ../../library/os.rst:3914 +#: ../../library/os.rst:3915 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3917 +#: ../../library/os.rst:3918 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3921 +#: ../../library/os.rst:3922 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -4323,7 +4323,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." "add_dll_directory``。" -#: ../../library/os.rst:3925 +#: ../../library/os.rst:3926 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4331,14 +4331,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3932 +#: ../../library/os.rst:3933 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:3947 +#: ../../library/os.rst:3948 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -4346,7 +4346,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3952 +#: ../../library/os.rst:3953 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -4354,7 +4354,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3958 +#: ../../library/os.rst:3959 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4367,7 +4367,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3967 +#: ../../library/os.rst:3968 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4381,7 +4381,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:3978 +#: ../../library/os.rst:3979 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4391,7 +4391,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3985 +#: ../../library/os.rst:3986 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -4400,7 +4400,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3990 +#: ../../library/os.rst:3991 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4408,25 +4408,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:3994 +#: ../../library/os.rst:3995 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4003 +#: ../../library/os.rst:4004 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:4008 +#: ../../library/os.rst:4009 msgid "" "The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " "should normally only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:4011 +#: ../../library/os.rst:4012 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -4434,125 +4434,125 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:4017 +#: ../../library/os.rst:4018 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: ../../library/os.rst:4024 +#: ../../library/os.rst:4025 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: ../../library/os.rst:4032 +#: ../../library/os.rst:4033 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:4040 +#: ../../library/os.rst:4041 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:4047 +#: ../../library/os.rst:4048 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:4054 +#: ../../library/os.rst:4055 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:4061 +#: ../../library/os.rst:4062 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:4068 +#: ../../library/os.rst:4069 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:4075 +#: ../../library/os.rst:4076 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:4082 +#: ../../library/os.rst:4083 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: ../../library/os.rst:4090 +#: ../../library/os.rst:4091 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: ../../library/os.rst:4098 +#: ../../library/os.rst:4099 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:4105 +#: ../../library/os.rst:4106 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:4112 +#: ../../library/os.rst:4113 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: ../../library/os.rst:4121 +#: ../../library/os.rst:4122 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:4129 +#: ../../library/os.rst:4130 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: ../../library/os.rst:4137 +#: ../../library/os.rst:4138 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:4144 +#: ../../library/os.rst:4145 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:4151 +#: ../../library/os.rst:4152 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4154 +#: ../../library/os.rst:4155 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:4157 +#: ../../library/os.rst:4158 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4159 +#: ../../library/os.rst:4160 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4165 +#: ../../library/os.rst:4166 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:4172 +#: ../../library/os.rst:4173 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -4561,24 +4561,24 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4178 +#: ../../library/os.rst:4179 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4180 +#: ../../library/os.rst:4181 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4193 +#: ../../library/os.rst:4194 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:4196 +#: ../../library/os.rst:4197 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -4589,11 +4589,11 @@ msgid "" "process handles to be killed." msgstr "" -#: ../../library/os.rst:4204 +#: ../../library/os.rst:4205 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:4206 +#: ../../library/os.rst:4207 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4601,15 +4601,15 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4210 +#: ../../library/os.rst:4211 msgid "Windows support." msgstr "" -#: ../../library/os.rst:4220 +#: ../../library/os.rst:4221 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4222 +#: ../../library/os.rst:4223 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4617,27 +4617,27 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4229 +#: ../../library/os.rst:4230 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4236 +#: ../../library/os.rst:4237 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4240 +#: ../../library/os.rst:4241 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4242 +#: ../../library/os.rst:4243 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:4247 +#: ../../library/os.rst:4248 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -4645,17 +4645,17 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4252 +#: ../../library/os.rst:4253 msgid ":ref:`Availability `: Linux >= 5.10" msgstr ":ref:`適用 `:Linux 5.10 以上" -#: ../../library/os.rst:4258 +#: ../../library/os.rst:4259 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4266 +#: ../../library/os.rst:4267 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4665,7 +4665,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4274 +#: ../../library/os.rst:4275 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4677,60 +4677,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4284 +#: ../../library/os.rst:4285 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:4289 +#: ../../library/os.rst:4290 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:4293 +#: ../../library/os.rst:4294 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4296 +#: ../../library/os.rst:4297 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4299 +#: ../../library/os.rst:4300 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4308 +#: ../../library/os.rst:4309 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4310 +#: ../../library/os.rst:4311 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4312 +#: ../../library/os.rst:4313 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4315 +#: ../../library/os.rst:4316 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:4319 +#: ../../library/os.rst:4320 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4739,31 +4739,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4327 +#: ../../library/os.rst:4328 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4329 +#: ../../library/os.rst:4330 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4333 +#: ../../library/os.rst:4334 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4335 +#: ../../library/os.rst:4336 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4339 +#: ../../library/os.rst:4340 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4341 +#: ../../library/os.rst:4342 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4343 +#: ../../library/os.rst:4344 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" @@ -4772,7 +4772,7 @@ msgid "" "`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4349 +#: ../../library/os.rst:4350 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -4781,7 +4781,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4355 +#: ../../library/os.rst:4356 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4792,7 +4792,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4363 +#: ../../library/os.rst:4364 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" @@ -4800,7 +4800,7 @@ msgid "" "is raised." msgstr "" -#: ../../library/os.rst:4368 +#: ../../library/os.rst:4369 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -4808,14 +4808,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4373 +#: ../../library/os.rst:4374 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:macro:`!" "POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4377 +#: ../../library/os.rst:4378 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4825,7 +4825,7 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4384 ../../library/os.rst:4400 +#: ../../library/os.rst:4385 ../../library/os.rst:4401 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4833,76 +4833,76 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4394 +#: ../../library/os.rst:4395 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4396 +#: ../../library/os.rst:4397 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4404 +#: ../../library/os.rst:4405 msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" -#: ../../library/os.rst:4406 +#: ../../library/os.rst:4407 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4412 +#: ../../library/os.rst:4413 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4417 +#: ../../library/os.rst:4418 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4418 +#: ../../library/os.rst:4419 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4420 +#: ../../library/os.rst:4421 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4422 +#: ../../library/os.rst:4423 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4426 +#: ../../library/os.rst:4427 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4431 +#: ../../library/os.rst:4432 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4435 +#: ../../library/os.rst:4436 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4451 +#: ../../library/os.rst:4452 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4453 +#: ../../library/os.rst:4454 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4910,7 +4910,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4458 +#: ../../library/os.rst:4459 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4919,13 +4919,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4464 +#: ../../library/os.rst:4465 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4467 +#: ../../library/os.rst:4468 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4937,7 +4937,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4476 +#: ../../library/os.rst:4477 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4950,7 +4950,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4486 +#: ../../library/os.rst:4487 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4962,13 +4962,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4495 +#: ../../library/os.rst:4496 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4504 +#: ../../library/os.rst:4505 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -4976,7 +4976,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4508 +#: ../../library/os.rst:4509 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4984,7 +4984,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4520 +#: ../../library/os.rst:4521 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4992,7 +4992,7 @@ msgid "" "created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4530 +#: ../../library/os.rst:4531 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -5001,7 +5001,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4542 +#: ../../library/os.rst:4543 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -5011,11 +5011,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4553 +#: ../../library/os.rst:4554 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4555 +#: ../../library/os.rst:4556 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -5023,7 +5023,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4560 +#: ../../library/os.rst:4561 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -5031,28 +5031,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4565 +#: ../../library/os.rst:4566 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4569 +#: ../../library/os.rst:4570 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4573 +#: ../../library/os.rst:4574 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`!ShellExecute` function." msgstr "" -#: ../../library/os.rst:4577 +#: ../../library/os.rst:4578 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -5063,14 +5063,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4585 +#: ../../library/os.rst:4586 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`!ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:4589 +#: ../../library/os.rst:4590 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -5078,7 +5078,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:4591 +#: ../../library/os.rst:4592 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -5086,13 +5086,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:4595 +#: ../../library/os.rst:4596 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4602 +#: ../../library/os.rst:4603 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -5103,13 +5103,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4610 +#: ../../library/os.rst:4611 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4613 +#: ../../library/os.rst:4614 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -5118,7 +5118,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4619 +#: ../../library/os.rst:4620 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5126,54 +5126,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4624 +#: ../../library/os.rst:4625 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: ../../library/os.rst:4628 +#: ../../library/os.rst:4629 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:4635 +#: ../../library/os.rst:4636 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4638 +#: ../../library/os.rst:4639 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4639 +#: ../../library/os.rst:4640 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4640 +#: ../../library/os.rst:4641 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4641 +#: ../../library/os.rst:4642 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4642 +#: ../../library/os.rst:4643 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4644 +#: ../../library/os.rst:4645 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: ../../library/os.rst:4648 +#: ../../library/os.rst:4649 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5183,7 +5183,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4662 +#: ../../library/os.rst:4663 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5192,83 +5192,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4668 +#: ../../library/os.rst:4669 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4671 ../../library/os.rst:4743 +#: ../../library/os.rst:4672 ../../library/os.rst:4744 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4678 +#: ../../library/os.rst:4679 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4685 +#: ../../library/os.rst:4686 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4687 +#: ../../library/os.rst:4688 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4690 +#: ../../library/os.rst:4691 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4694 +#: ../../library/os.rst:4695 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4697 +#: ../../library/os.rst:4698 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4698 +#: ../../library/os.rst:4699 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4699 +#: ../../library/os.rst:4700 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4700 +#: ../../library/os.rst:4701 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4701 +#: ../../library/os.rst:4702 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4703 +#: ../../library/os.rst:4704 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4715 +#: ../../library/os.rst:4716 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4717 +#: ../../library/os.rst:4718 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -5277,7 +5277,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4722 +#: ../../library/os.rst:4723 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -5287,7 +5287,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4729 +#: ../../library/os.rst:4730 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5296,7 +5296,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4735 +#: ../../library/os.rst:4736 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -5308,7 +5308,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4756 +#: ../../library/os.rst:4757 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -5317,13 +5317,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4763 ../../library/os.rst:4777 +#: ../../library/os.rst:4764 ../../library/os.rst:4778 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4771 +#: ../../library/os.rst:4772 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5332,118 +5332,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4788 +#: ../../library/os.rst:4789 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4791 +#: ../../library/os.rst:4792 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4792 +#: ../../library/os.rst:4793 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4793 +#: ../../library/os.rst:4794 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4794 +#: ../../library/os.rst:4795 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4799 +#: ../../library/os.rst:4800 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4802 +#: ../../library/os.rst:4803 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4808 +#: ../../library/os.rst:4809 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4817 +#: ../../library/os.rst:4818 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4820 +#: ../../library/os.rst:4821 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4830 +#: ../../library/os.rst:4831 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4833 ../../library/os.rst:4865 +#: ../../library/os.rst:4834 ../../library/os.rst:4866 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4842 +#: ../../library/os.rst:4843 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4846 +#: ../../library/os.rst:4847 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4853 +#: ../../library/os.rst:4854 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4862 +#: ../../library/os.rst:4863 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4877 +#: ../../library/os.rst:4878 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4884 +#: ../../library/os.rst:4885 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4890 +#: ../../library/os.rst:4891 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4892 +#: ../../library/os.rst:4893 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4894 +#: ../../library/os.rst:4895 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4897 +#: ../../library/os.rst:4898 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -5451,15 +5451,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4901 +#: ../../library/os.rst:4902 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4903 +#: ../../library/os.rst:4904 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4905 +#: ../../library/os.rst:4906 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -5467,217 +5467,217 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4912 +#: ../../library/os.rst:4913 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4920 +#: ../../library/os.rst:4921 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4926 +#: ../../library/os.rst:4927 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4929 ../../library/os.rst:4995 +#: ../../library/os.rst:4930 ../../library/os.rst:4996 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4936 +#: ../../library/os.rst:4937 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4940 +#: ../../library/os.rst:4941 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4947 +#: ../../library/os.rst:4948 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4950 +#: ../../library/os.rst:4951 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:4958 +#: ../../library/os.rst:4959 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4966 +#: ../../library/os.rst:4967 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4975 +#: ../../library/os.rst:4976 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4977 +#: ../../library/os.rst:4978 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4984 +#: ../../library/os.rst:4985 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4986 +#: ../../library/os.rst:4987 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4993 +#: ../../library/os.rst:4994 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:5001 +#: ../../library/os.rst:5002 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:5003 +#: ../../library/os.rst:5004 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:5009 +#: ../../library/os.rst:5010 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:5014 +#: ../../library/os.rst:5015 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5018 +#: ../../library/os.rst:5019 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5023 +#: ../../library/os.rst:5024 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5027 +#: ../../library/os.rst:5028 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5031 +#: ../../library/os.rst:5032 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:5035 +#: ../../library/os.rst:5036 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:5039 +#: ../../library/os.rst:5040 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:5046 +#: ../../library/os.rst:5047 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:5050 +#: ../../library/os.rst:5051 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5054 +#: ../../library/os.rst:5055 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5059 +#: ../../library/os.rst:5060 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5065 +#: ../../library/os.rst:5066 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5071 +#: ../../library/os.rst:5072 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5078 +#: ../../library/os.rst:5079 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:5085 +#: ../../library/os.rst:5086 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5091 +#: ../../library/os.rst:5092 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5097 +#: ../../library/os.rst:5098 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5103 +#: ../../library/os.rst:5104 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:5108 +#: ../../library/os.rst:5109 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:5115 +#: ../../library/os.rst:5116 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:5122 +#: ../../library/os.rst:5123 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5127 +#: ../../library/os.rst:5128 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -5688,13 +5688,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5135 +#: ../../library/os.rst:5136 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5138 +#: ../../library/os.rst:5139 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -5702,33 +5702,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5148 +#: ../../library/os.rst:5149 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5157 +#: ../../library/os.rst:5158 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:5159 +#: ../../library/os.rst:5160 msgid "" "This number is not equivalent to the number of CPUs the current process can " "use. The number of usable CPUs can be obtained with ``len(os." "sched_getaffinity(0))``" msgstr "" -#: ../../library/os.rst:5169 +#: ../../library/os.rst:5170 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:5178 +#: ../../library/os.rst:5179 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5737,44 +5737,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5188 +#: ../../library/os.rst:5189 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5194 +#: ../../library/os.rst:5195 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5197 +#: ../../library/os.rst:5198 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5200 +#: ../../library/os.rst:5201 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5206 +#: ../../library/os.rst:5207 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5214 +#: ../../library/os.rst:5215 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5223 +#: ../../library/os.rst:5224 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5783,7 +5783,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5233 +#: ../../library/os.rst:5234 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5791,27 +5791,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5242 +#: ../../library/os.rst:5243 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5250 +#: ../../library/os.rst:5251 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5257 +#: ../../library/os.rst:5258 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:" "`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5264 +#: ../../library/os.rst:5265 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -5820,36 +5820,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5273 +#: ../../library/os.rst:5274 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5284 +#: ../../library/os.rst:5285 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:5292 +#: ../../library/os.rst:5293 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5297 +#: ../../library/os.rst:5298 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5300 +#: ../../library/os.rst:5301 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5303 +#: ../../library/os.rst:5304 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5857,36 +5857,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5308 +#: ../../library/os.rst:5309 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5312 +#: ../../library/os.rst:5313 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5315 +#: ../../library/os.rst:5316 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5321 +#: ../../library/os.rst:5322 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5323 +#: ../../library/os.rst:5324 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:5327 +#: ../../library/os.rst:5328 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5896,63 +5896,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5334 +#: ../../library/os.rst:5335 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:5338 +#: ../../library/os.rst:5339 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5341 +#: ../../library/os.rst:5342 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:5345 +#: ../../library/os.rst:5346 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5349 +#: ../../library/os.rst:5350 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:5353 +#: ../../library/os.rst:5354 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:5359 +#: ../../library/os.rst:5360 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5365 +#: ../../library/os.rst:5366 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:5369 +#: ../../library/os.rst:5370 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:5376 +#: ../../library/os.rst:5377 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -5968,7 +5968,7 @@ msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 #: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 -#: ../../library/os.rst:4189 ../../library/os.rst:4216 +#: ../../library/os.rst:4190 ../../library/os.rst:4217 msgid "process" msgstr "process" @@ -6008,11 +6008,11 @@ msgstr "gethostname()(於 socket 模組)" msgid "gethostbyaddr() (in module socket)" msgstr "gethostbyaddr()(於 socket 模組)" -#: ../../library/os.rst:796 ../../library/os.rst:2574 +#: ../../library/os.rst:796 ../../library/os.rst:2575 msgid "deleting" msgstr "deleting(刪除)" -#: ../../library/os.rst:1338 ../../library/os.rst:2944 +#: ../../library/os.rst:1338 ../../library/os.rst:2945 msgid "module" msgstr "module(模組)" @@ -6020,82 +6020,82 @@ msgstr "module(模組)" msgid "pty" msgstr "pty" -#: ../../library/os.rst:1978 ../../library/os.rst:2372 -#: ../../library/os.rst:2574 ../../library/os.rst:3480 -#: ../../library/os.rst:3579 +#: ../../library/os.rst:1979 ../../library/os.rst:2373 +#: ../../library/os.rst:2575 ../../library/os.rst:3481 +#: ../../library/os.rst:3580 msgid "directory" msgstr "directory(目錄)" -#: ../../library/os.rst:1978 +#: ../../library/os.rst:1979 msgid "changing" msgstr "changing(改變)" -#: ../../library/os.rst:2372 +#: ../../library/os.rst:2373 msgid "creating" msgstr "creating(建立)" -#: ../../library/os.rst:2372 +#: ../../library/os.rst:2373 msgid "UNC paths" msgstr "UNC paths(UNC 路徑)" -#: ../../library/os.rst:2372 +#: ../../library/os.rst:2373 msgid "and os.makedirs()" msgstr "以及 os.makedirs()" -#: ../../library/os.rst:2944 +#: ../../library/os.rst:2945 msgid "stat" msgstr "stat" -#: ../../library/os.rst:3480 ../../library/os.rst:3579 +#: ../../library/os.rst:3481 ../../library/os.rst:3580 msgid "walking" msgstr "" -#: ../../library/os.rst:3480 ../../library/os.rst:3579 +#: ../../library/os.rst:3481 ../../library/os.rst:3580 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4189 ../../library/os.rst:4216 +#: ../../library/os.rst:4190 ../../library/os.rst:4217 msgid "killing" msgstr "" -#: ../../library/os.rst:4189 ../../library/os.rst:4216 +#: ../../library/os.rst:4190 ../../library/os.rst:4217 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5203 ../../library/os.rst:5239 +#: ../../library/os.rst:5204 ../../library/os.rst:5240 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5203 ../../library/os.rst:5211 -#: ../../library/os.rst:5219 ../../library/os.rst:5230 -#: ../../library/os.rst:5239 +#: ../../library/os.rst:5204 ../../library/os.rst:5212 +#: ../../library/os.rst:5220 ../../library/os.rst:5231 +#: ../../library/os.rst:5240 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5211 +#: ../../library/os.rst:5212 msgid ".." msgstr ".." -#: ../../library/os.rst:5219 ../../library/os.rst:5230 +#: ../../library/os.rst:5220 ../../library/os.rst:5231 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5220 +#: ../../library/os.rst:5221 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5220 +#: ../../library/os.rst:5221 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5246 +#: ../../library/os.rst:5247 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5246 +#: ../../library/os.rst:5247 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5246 +#: ../../library/os.rst:5247 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/socket.po b/library/socket.po index 7875ed07cd..6ef99f085a 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1187,8 +1187,8 @@ msgstr ":ref:`適用 `:非 WASI。" #: ../../library/socket.rst:981 msgid "" -"Translate a host name to IPv4 address format, extended interface. Return a " -"triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " +"Translate a host name to IPv4 address format, extended interface. Return a 3-" +"tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " "primary host name, *aliaslist* is a (possibly empty) list of alternative " "host names for the same address, and *ipaddrlist* is a list of IPv4 " "addresses for the same interface on the same host (often but not always a " @@ -1218,7 +1218,7 @@ msgstr "" #: ../../library/socket.rst:1010 msgid "" -"Return a triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " +"Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " "(possibly empty) list of alternative host names for the same address, and " "*ipaddrlist* is a list of IPv4/v6 addresses for the same interface on the " diff --git a/library/sys.po b/library/sys.po index 21b9d3dc3d..0b47041954 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-06 00:03+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -471,13 +471,13 @@ msgstr "" #: ../../library/sys.rst:381 msgid "" -"When an exception is raised and uncaught, the interpreter calls ``sys." -"excepthook`` with three arguments, the exception class, exception instance, " -"and a traceback object. In an interactive session this happens just before " -"control is returned to the prompt; in a Python program this happens just " -"before the program exits. The handling of such top-level exceptions can be " -"customized by assigning another three-argument function to ``sys." -"excepthook``." +"When an exception other than :exc:`SystemExit` is raised and uncaught, the " +"interpreter calls ``sys.excepthook`` with three arguments, the exception " +"class, exception instance, and a traceback object. In an interactive " +"session this happens just before control is returned to the prompt; in a " +"Python program this happens just before the program exits. The handling of " +"such top-level exceptions can be customized by assigning another three-" +"argument function to ``sys.excepthook``." msgstr "" #: ../../library/sys.rst:388 diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index dd64c4887f..badb5f9e01 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-03 00:03+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:35+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -310,18 +310,29 @@ msgid "" "*spec_set* instead of *spec*." msgstr "" -#: ../../library/unittest.mock-examples.rst:365 +#: ../../library/unittest.mock-examples.rst:364 +msgid "Using side_effect to return per file content" +msgstr "" + +#: ../../library/unittest.mock-examples.rst:366 +msgid "" +":func:`mock_open` is used to patch :func:`open` method. :attr:`~Mock." +"side_effect` can be used to return a new Mock object per call. This can be " +"used to return different contents per file stored in a dictionary::" +msgstr "" + +#: ../../library/unittest.mock-examples.rst:389 msgid "Patch Decorators" msgstr "" -#: ../../library/unittest.mock-examples.rst:369 +#: ../../library/unittest.mock-examples.rst:393 msgid "" "With :func:`patch` it matters that you patch objects in the namespace where " "they are looked up. This is normally straightforward, but for a quick guide " "read :ref:`where to patch `." msgstr "" -#: ../../library/unittest.mock-examples.rst:374 +#: ../../library/unittest.mock-examples.rst:398 msgid "" "A common need in tests is to patch a class attribute or a module attribute, " "for example patching a builtin or patching a class in a module to test that " @@ -330,7 +341,7 @@ msgid "" "tests and cause hard to diagnose problems." msgstr "" -#: ../../library/unittest.mock-examples.rst:380 +#: ../../library/unittest.mock-examples.rst:404 msgid "" "mock provides three convenient decorators for this: :func:`patch`, :func:" "`patch.object` and :func:`patch.dict`. ``patch`` takes a single string, of " @@ -341,37 +352,37 @@ msgid "" "to patch it with." msgstr "" -#: ../../library/unittest.mock-examples.rst:388 +#: ../../library/unittest.mock-examples.rst:412 msgid "``patch.object``::" msgstr "" -#: ../../library/unittest.mock-examples.rst:405 +#: ../../library/unittest.mock-examples.rst:429 msgid "" "If you are patching a module (including :mod:`builtins`) then use :func:" "`patch` instead of :func:`patch.object`:" msgstr "" -#: ../../library/unittest.mock-examples.rst:415 +#: ../../library/unittest.mock-examples.rst:439 msgid "" "The module name can be 'dotted', in the form ``package.module`` if needed::" msgstr "" -#: ../../library/unittest.mock-examples.rst:424 +#: ../../library/unittest.mock-examples.rst:448 msgid "A nice pattern is to actually decorate test methods themselves:" msgstr "" -#: ../../library/unittest.mock-examples.rst:435 +#: ../../library/unittest.mock-examples.rst:459 msgid "" "If you want to patch with a Mock, you can use :func:`patch` with only one " "argument (or :func:`patch.object` with two arguments). The mock will be " "created for you and passed into the test function / method:" msgstr "" -#: ../../library/unittest.mock-examples.rst:447 +#: ../../library/unittest.mock-examples.rst:471 msgid "You can stack up multiple patch decorators using this pattern::" msgstr "" -#: ../../library/unittest.mock-examples.rst:458 +#: ../../library/unittest.mock-examples.rst:482 msgid "" "When you nest patch decorators the mocks are passed in to the decorated " "function in the same order they applied (the normal *Python* order that " @@ -379,45 +390,45 @@ msgid "" "above the mock for ``test_module.ClassName2`` is passed in first." msgstr "" -#: ../../library/unittest.mock-examples.rst:463 +#: ../../library/unittest.mock-examples.rst:487 msgid "" "There is also :func:`patch.dict` for setting values in a dictionary just " "during a scope and restoring the dictionary to its original state when the " "test ends:" msgstr "" -#: ../../library/unittest.mock-examples.rst:474 +#: ../../library/unittest.mock-examples.rst:498 msgid "" "``patch``, ``patch.object`` and ``patch.dict`` can all be used as context " "managers." msgstr "" -#: ../../library/unittest.mock-examples.rst:476 +#: ../../library/unittest.mock-examples.rst:500 msgid "" "Where you use :func:`patch` to create a mock for you, you can get a " "reference to the mock using the \"as\" form of the with statement:" msgstr "" -#: ../../library/unittest.mock-examples.rst:491 +#: ../../library/unittest.mock-examples.rst:515 msgid "" "As an alternative ``patch``, ``patch.object`` and ``patch.dict`` can be used " "as class decorators. When used in this way it is the same as applying the " "decorator individually to every method whose name starts with \"test\"." msgstr "" -#: ../../library/unittest.mock-examples.rst:499 +#: ../../library/unittest.mock-examples.rst:523 msgid "Further Examples" msgstr "" -#: ../../library/unittest.mock-examples.rst:502 +#: ../../library/unittest.mock-examples.rst:526 msgid "Here are some more examples for some slightly more advanced scenarios." msgstr "" -#: ../../library/unittest.mock-examples.rst:506 +#: ../../library/unittest.mock-examples.rst:530 msgid "Mocking chained calls" msgstr "" -#: ../../library/unittest.mock-examples.rst:508 +#: ../../library/unittest.mock-examples.rst:532 msgid "" "Mocking chained calls is actually straightforward with mock once you " "understand the :attr:`~Mock.return_value` attribute. When a mock is called " @@ -425,31 +436,31 @@ msgid "" "called, a new :class:`Mock` is created." msgstr "" -#: ../../library/unittest.mock-examples.rst:513 +#: ../../library/unittest.mock-examples.rst:537 msgid "" "This means that you can see how the object returned from a call to a mocked " "object has been used by interrogating the ``return_value`` mock:" msgstr "" -#: ../../library/unittest.mock-examples.rst:521 +#: ../../library/unittest.mock-examples.rst:545 msgid "" "From here it is a simple step to configure and then make assertions about " "chained calls. Of course another alternative is writing your code in a more " "testable way in the first place..." msgstr "" -#: ../../library/unittest.mock-examples.rst:525 +#: ../../library/unittest.mock-examples.rst:549 msgid "So, suppose we have some code that looks a little bit like this:" msgstr "" -#: ../../library/unittest.mock-examples.rst:534 +#: ../../library/unittest.mock-examples.rst:558 msgid "" "Assuming that ``BackendProvider`` is already well tested, how do we test " "``method()``? Specifically, we want to test that the code section ``# more " "code`` uses the response object in the correct way." msgstr "" -#: ../../library/unittest.mock-examples.rst:538 +#: ../../library/unittest.mock-examples.rst:562 msgid "" "As this chain of calls is made from an instance attribute we can monkey " "patch the ``backend`` attribute on a ``Something`` instance. In this " @@ -459,26 +470,26 @@ msgid "" "response object uses the builtin :func:`open` as its ``spec``." msgstr "" -#: ../../library/unittest.mock-examples.rst:545 +#: ../../library/unittest.mock-examples.rst:569 msgid "" "To do this we create a mock instance as our mock backend and create a mock " "response object for it. To set the response as the return value for that " "final ``start_call`` we could do this::" msgstr "" -#: ../../library/unittest.mock-examples.rst:551 +#: ../../library/unittest.mock-examples.rst:575 msgid "" "We can do that in a slightly nicer way using the :meth:`~Mock." "configure_mock` method to directly set the return value for us::" msgstr "" -#: ../../library/unittest.mock-examples.rst:560 +#: ../../library/unittest.mock-examples.rst:584 msgid "" "With these we monkey patch the \"mock backend\" in place and can make the " "real call::" msgstr "" -#: ../../library/unittest.mock-examples.rst:566 +#: ../../library/unittest.mock-examples.rst:590 msgid "" "Using :attr:`~Mock.mock_calls` we can check the chained call with a single " "assert. A chained call is several calls in one line of code, so there will " @@ -486,11 +497,11 @@ msgid "" "create this list of calls for us::" msgstr "" -#: ../../library/unittest.mock-examples.rst:577 +#: ../../library/unittest.mock-examples.rst:601 msgid "Partial mocking" msgstr "" -#: ../../library/unittest.mock-examples.rst:579 +#: ../../library/unittest.mock-examples.rst:603 msgid "" "In some tests I wanted to mock out a call to :meth:`datetime.date.today` to " "return a known date, but I didn't want to prevent the code under test from " @@ -499,14 +510,14 @@ msgid "" "date.today` method." msgstr "" -#: ../../library/unittest.mock-examples.rst:584 +#: ../../library/unittest.mock-examples.rst:608 msgid "" "I found a simple way of doing this that involved effectively wrapping the " "date class with a mock, but passing through calls to the constructor to the " "real class (and returning real instances)." msgstr "" -#: ../../library/unittest.mock-examples.rst:588 +#: ../../library/unittest.mock-examples.rst:612 msgid "" "The :func:`patch decorator ` is used here to mock out the ``date`` " "class in the module under test. The :attr:`~Mock.side_effect` attribute on " @@ -515,13 +526,13 @@ msgid "" "returned by ``side_effect``. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:602 +#: ../../library/unittest.mock-examples.rst:626 msgid "" "Note that we don't patch :class:`datetime.date` globally, we patch ``date`` " "in the module that *uses* it. See :ref:`where to patch `." msgstr "" -#: ../../library/unittest.mock-examples.rst:605 +#: ../../library/unittest.mock-examples.rst:629 msgid "" "When ``date.today()`` is called a known date is returned, but calls to the " "``date(...)`` constructor still return normal dates. Without this you can " @@ -529,30 +540,30 @@ msgid "" "algorithm as the code under test, which is a classic testing anti-pattern." msgstr "" -#: ../../library/unittest.mock-examples.rst:610 +#: ../../library/unittest.mock-examples.rst:634 msgid "" "Calls to the date constructor are recorded in the ``mock_date`` attributes " "(``call_count`` and friends) which may also be useful for your tests." msgstr "" -#: ../../library/unittest.mock-examples.rst:613 +#: ../../library/unittest.mock-examples.rst:637 msgid "" "An alternative way of dealing with mocking dates, or other builtin classes, " "is discussed in `this blog entry `_." msgstr "" -#: ../../library/unittest.mock-examples.rst:619 +#: ../../library/unittest.mock-examples.rst:643 msgid "Mocking a Generator Method" msgstr "" -#: ../../library/unittest.mock-examples.rst:621 +#: ../../library/unittest.mock-examples.rst:645 msgid "" "A Python generator is a function or method that uses the :keyword:`yield` " "statement to return a series of values when iterated over [#]_." msgstr "" -#: ../../library/unittest.mock-examples.rst:624 +#: ../../library/unittest.mock-examples.rst:648 msgid "" "A generator method / function is called to return the generator object. It " "is the generator object that is then iterated over. The protocol method for " @@ -560,23 +571,23 @@ msgid "" "`MagicMock`." msgstr "" -#: ../../library/unittest.mock-examples.rst:629 +#: ../../library/unittest.mock-examples.rst:653 msgid "" "Here's an example class with an \"iter\" method implemented as a generator:" msgstr "" -#: ../../library/unittest.mock-examples.rst:641 +#: ../../library/unittest.mock-examples.rst:665 msgid "How would we mock this class, and in particular its \"iter\" method?" msgstr "" -#: ../../library/unittest.mock-examples.rst:643 +#: ../../library/unittest.mock-examples.rst:667 msgid "" "To configure the values returned from the iteration (implicit in the call " "to :class:`list`), we need to configure the object returned by the call to " "``foo.iter()``." msgstr "" -#: ../../library/unittest.mock-examples.rst:651 +#: ../../library/unittest.mock-examples.rst:675 msgid "" "There are also generator expressions and more `advanced uses `_ of generators, but we aren't concerned " @@ -585,11 +596,11 @@ msgid "" "com/generators/>`_." msgstr "" -#: ../../library/unittest.mock-examples.rst:659 +#: ../../library/unittest.mock-examples.rst:683 msgid "Applying the same patch to every test method" msgstr "" -#: ../../library/unittest.mock-examples.rst:661 +#: ../../library/unittest.mock-examples.rst:685 msgid "" "If you want several patches in place for multiple test methods the obvious " "way is to apply the patch decorators to every method. This can feel like " @@ -599,14 +610,14 @@ msgid "" "start with ``test``::" msgstr "" -#: ../../library/unittest.mock-examples.rst:685 +#: ../../library/unittest.mock-examples.rst:709 msgid "" "An alternative way of managing patches is to use the :ref:`start-and-stop`. " "These allow you to move the patching into your ``setUp`` and ``tearDown`` " "methods. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:702 +#: ../../library/unittest.mock-examples.rst:726 msgid "" "If you use this technique you must ensure that the patching is \"undone\" by " "calling ``stop``. This can be fiddlier than you might think, because if an " @@ -614,11 +625,11 @@ msgid "" "`unittest.TestCase.addCleanup` makes this easier::" msgstr "" -#: ../../library/unittest.mock-examples.rst:720 +#: ../../library/unittest.mock-examples.rst:744 msgid "Mocking Unbound Methods" msgstr "" -#: ../../library/unittest.mock-examples.rst:722 +#: ../../library/unittest.mock-examples.rst:746 msgid "" "Whilst writing tests today I needed to patch an *unbound method* (patching " "the method on the class rather than on the instance). I needed self to be " @@ -632,7 +643,7 @@ msgid "" "becomes a nuisance." msgstr "" -#: ../../library/unittest.mock-examples.rst:733 +#: ../../library/unittest.mock-examples.rst:757 msgid "" "If you pass ``autospec=True`` to patch then it does the patching with a " "*real* function object. This function object has the same signature as the " @@ -644,30 +655,30 @@ msgid "" "exactly what I wanted:" msgstr "" -#: ../../library/unittest.mock-examples.rst:754 +#: ../../library/unittest.mock-examples.rst:778 msgid "" "If we don't use ``autospec=True`` then the unbound method is patched out " "with a Mock instance instead, and isn't called with ``self``." msgstr "" -#: ../../library/unittest.mock-examples.rst:759 +#: ../../library/unittest.mock-examples.rst:783 msgid "Checking multiple calls with mock" msgstr "" -#: ../../library/unittest.mock-examples.rst:761 +#: ../../library/unittest.mock-examples.rst:785 msgid "" "mock has a nice API for making assertions about how your mock objects are " "used." msgstr "" -#: ../../library/unittest.mock-examples.rst:768 +#: ../../library/unittest.mock-examples.rst:792 msgid "" "If your mock is only being called once you can use the :meth:`~Mock." "assert_called_once_with` method that also asserts that the :attr:`~Mock." "call_count` is one." msgstr "" -#: ../../library/unittest.mock-examples.rst:779 +#: ../../library/unittest.mock-examples.rst:803 msgid "" "Both ``assert_called_with`` and ``assert_called_once_with`` make assertions " "about the *most recent* call. If your mock is going to be called several " @@ -675,7 +686,7 @@ msgid "" "attr:`~Mock.call_args_list`:" msgstr "" -#: ../../library/unittest.mock-examples.rst:791 +#: ../../library/unittest.mock-examples.rst:815 msgid "" "The :data:`call` helper makes it easy to make assertions about these calls. " "You can build up a list of expected calls and compare it to " @@ -683,11 +694,11 @@ msgid "" "``call_args_list``:" msgstr "" -#: ../../library/unittest.mock-examples.rst:801 +#: ../../library/unittest.mock-examples.rst:825 msgid "Coping with mutable arguments" msgstr "" -#: ../../library/unittest.mock-examples.rst:803 +#: ../../library/unittest.mock-examples.rst:827 msgid "" "Another situation is rare, but can bite you, is when your mock is called " "with mutable arguments. ``call_args`` and ``call_args_list`` store " @@ -696,26 +707,26 @@ msgid "" "when the mock was called." msgstr "" -#: ../../library/unittest.mock-examples.rst:808 +#: ../../library/unittest.mock-examples.rst:832 msgid "" "Here's some example code that shows the problem. Imagine the following " "functions defined in 'mymodule'::" msgstr "" -#: ../../library/unittest.mock-examples.rst:819 +#: ../../library/unittest.mock-examples.rst:843 msgid "" "When we try to test that ``grob`` calls ``frob`` with the correct argument " "look what happens::" msgstr "" -#: ../../library/unittest.mock-examples.rst:834 +#: ../../library/unittest.mock-examples.rst:858 msgid "" "One possibility would be for mock to copy the arguments you pass in. This " "could then cause problems if you do assertions that rely on object identity " "for equality." msgstr "" -#: ../../library/unittest.mock-examples.rst:838 +#: ../../library/unittest.mock-examples.rst:862 msgid "" "Here's one solution that uses the :attr:`~Mock.side_effect` functionality. " "If you provide a ``side_effect`` function for a mock then ``side_effect`` " @@ -726,28 +737,28 @@ msgid "" "me. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:867 +#: ../../library/unittest.mock-examples.rst:891 msgid "" "``copy_call_args`` is called with the mock that will be called. It returns a " "new mock that we do the assertion on. The ``side_effect`` function makes a " "copy of the args and calls our ``new_mock`` with the copy." msgstr "" -#: ../../library/unittest.mock-examples.rst:873 +#: ../../library/unittest.mock-examples.rst:897 msgid "" "If your mock is only going to be used once there is an easier way of " "checking arguments at the point they are called. You can simply do the " "checking inside a ``side_effect`` function." msgstr "" -#: ../../library/unittest.mock-examples.rst:887 +#: ../../library/unittest.mock-examples.rst:911 msgid "" "An alternative approach is to create a subclass of :class:`Mock` or :class:" "`MagicMock` that copies (using :func:`copy.deepcopy`) the arguments. Here's " "an example implementation:" msgstr "" -#: ../../library/unittest.mock-examples.rst:911 +#: ../../library/unittest.mock-examples.rst:935 msgid "" "When you subclass ``Mock`` or ``MagicMock`` all dynamically created " "attributes, and the ``return_value`` will use your subclass automatically. " @@ -755,18 +766,18 @@ msgid "" "``CopyingMock``." msgstr "" -#: ../../library/unittest.mock-examples.rst:917 +#: ../../library/unittest.mock-examples.rst:941 msgid "Nesting Patches" msgstr "" -#: ../../library/unittest.mock-examples.rst:919 +#: ../../library/unittest.mock-examples.rst:943 msgid "" "Using patch as a context manager is nice, but if you do multiple patches you " "can end up with nested with statements indenting further and further to the " "right::" msgstr "" -#: ../../library/unittest.mock-examples.rst:937 +#: ../../library/unittest.mock-examples.rst:961 msgid "" "With unittest ``cleanup`` functions and the :ref:`start-and-stop` we can " "achieve the same effect without the nested indentation. A simple helper " @@ -774,24 +785,24 @@ msgid "" "mock for us::" msgstr "" -#: ../../library/unittest.mock-examples.rst:965 +#: ../../library/unittest.mock-examples.rst:989 msgid "Mocking a dictionary with MagicMock" msgstr "" -#: ../../library/unittest.mock-examples.rst:967 +#: ../../library/unittest.mock-examples.rst:991 msgid "" "You may want to mock a dictionary, or other container object, recording all " "access to it whilst having it still behave like a dictionary." msgstr "" -#: ../../library/unittest.mock-examples.rst:970 +#: ../../library/unittest.mock-examples.rst:994 msgid "" "We can do this with :class:`MagicMock`, which will behave like a dictionary, " "and using :data:`~Mock.side_effect` to delegate dictionary access to a real " "underlying dictionary that is under our control." msgstr "" -#: ../../library/unittest.mock-examples.rst:974 +#: ../../library/unittest.mock-examples.rst:998 msgid "" "When the :meth:`~object.__getitem__` and :meth:`~object.__setitem__` methods " "of our ``MagicMock`` are called (normal dictionary access) then " @@ -799,49 +810,49 @@ msgid "" "the value too). We can also control what is returned." msgstr "" -#: ../../library/unittest.mock-examples.rst:979 +#: ../../library/unittest.mock-examples.rst:1003 msgid "" "After the ``MagicMock`` has been used we can use attributes like :data:" "`~Mock.call_args_list` to assert about how the dictionary was used:" msgstr "" -#: ../../library/unittest.mock-examples.rst:995 +#: ../../library/unittest.mock-examples.rst:1019 msgid "" "An alternative to using ``MagicMock`` is to use ``Mock`` and *only* provide " "the magic methods you specifically want:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1002 +#: ../../library/unittest.mock-examples.rst:1026 msgid "" "A *third* option is to use ``MagicMock`` but passing in ``dict`` as the " "*spec* (or *spec_set*) argument so that the ``MagicMock`` created only has " "dictionary magic methods available:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1010 +#: ../../library/unittest.mock-examples.rst:1034 msgid "" "With these side effect functions in place, the ``mock`` will behave like a " "normal dictionary but recording the access. It even raises a :exc:`KeyError` " "if you try to access a key that doesn't exist." msgstr "" -#: ../../library/unittest.mock-examples.rst:1029 +#: ../../library/unittest.mock-examples.rst:1053 msgid "" "After it has been used you can make assertions about the access using the " "normal mock methods and attributes:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1041 +#: ../../library/unittest.mock-examples.rst:1065 msgid "Mock subclasses and their attributes" msgstr "" -#: ../../library/unittest.mock-examples.rst:1043 +#: ../../library/unittest.mock-examples.rst:1067 msgid "" "There are various reasons why you might want to subclass :class:`Mock`. One " "reason might be to add helper methods. Here's a silly example:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1059 +#: ../../library/unittest.mock-examples.rst:1083 msgid "" "The standard behaviour for ``Mock`` instances is that attributes and the " "return value mocks are of the same type as the mock they are accessed on. " @@ -851,7 +862,7 @@ msgid "" "mock of instances of your subclass." msgstr "" -#: ../../library/unittest.mock-examples.rst:1075 +#: ../../library/unittest.mock-examples.rst:1099 msgid "" "Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted " @@ -859,7 +870,7 @@ msgid "" "html>`_. Having this applied to attributes too actually causes errors." msgstr "" -#: ../../library/unittest.mock-examples.rst:1081 +#: ../../library/unittest.mock-examples.rst:1105 msgid "" "``Mock`` (in all its flavours) uses a method called ``_get_child_mock`` to " "create these \"sub-mocks\" for attributes and return values. You can prevent " @@ -868,25 +879,25 @@ msgid "" "are then passed onto the mock constructor:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1098 +#: ../../library/unittest.mock-examples.rst:1122 msgid "" "An exception to this rule are the non-callable mocks. Attributes use the " "callable variant because otherwise non-callable mocks couldn't have callable " "methods." msgstr "" -#: ../../library/unittest.mock-examples.rst:1104 +#: ../../library/unittest.mock-examples.rst:1128 msgid "Mocking imports with patch.dict" msgstr "" -#: ../../library/unittest.mock-examples.rst:1106 +#: ../../library/unittest.mock-examples.rst:1130 msgid "" "One situation where mocking can be hard is where you have a local import " "inside a function. These are harder to mock because they aren't using an " "object from the module namespace that we can patch out." msgstr "" -#: ../../library/unittest.mock-examples.rst:1110 +#: ../../library/unittest.mock-examples.rst:1134 msgid "" "Generally local imports are to be avoided. They are sometimes done to " "prevent circular dependencies, for which there is *usually* a much better " @@ -896,7 +907,7 @@ msgid "" "attribute and only do the import on first use)." msgstr "" -#: ../../library/unittest.mock-examples.rst:1117 +#: ../../library/unittest.mock-examples.rst:1141 msgid "" "That aside there is a way to use ``mock`` to affect the results of an " "import. Importing fetches an *object* from the :data:`sys.modules` " @@ -906,7 +917,7 @@ msgid "" "back. This need not be the case however." msgstr "" -#: ../../library/unittest.mock-examples.rst:1124 +#: ../../library/unittest.mock-examples.rst:1148 msgid "" "This means you can use :func:`patch.dict` to *temporarily* put a mock in " "place in :data:`sys.modules`. Any imports whilst this patch is active will " @@ -915,29 +926,29 @@ msgid "" "whatever was there previously will be restored safely." msgstr "" -#: ../../library/unittest.mock-examples.rst:1130 +#: ../../library/unittest.mock-examples.rst:1154 msgid "Here's an example that mocks out the 'fooble' module." msgstr "" -#: ../../library/unittest.mock-examples.rst:1142 +#: ../../library/unittest.mock-examples.rst:1166 msgid "" "As you can see the ``import fooble`` succeeds, but on exit there is no " "'fooble' left in :data:`sys.modules`." msgstr "" -#: ../../library/unittest.mock-examples.rst:1145 +#: ../../library/unittest.mock-examples.rst:1169 msgid "This also works for the ``from module import name`` form:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1155 +#: ../../library/unittest.mock-examples.rst:1179 msgid "With slightly more work you can also mock package imports:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1168 +#: ../../library/unittest.mock-examples.rst:1192 msgid "Tracking order of calls and less verbose call assertions" msgstr "" -#: ../../library/unittest.mock-examples.rst:1170 +#: ../../library/unittest.mock-examples.rst:1194 msgid "" "The :class:`Mock` class allows you to track the *order* of method calls on " "your mock objects through the :attr:`~Mock.method_calls` attribute. This " @@ -945,7 +956,7 @@ msgid "" "however we can use :attr:`~Mock.mock_calls` to achieve the same effect." msgstr "" -#: ../../library/unittest.mock-examples.rst:1175 +#: ../../library/unittest.mock-examples.rst:1199 msgid "" "Because mocks track calls to child mocks in ``mock_calls``, and accessing an " "arbitrary attribute of a mock creates a child mock, we can create our " @@ -953,20 +964,20 @@ msgid "" "recorded, in order, in the ``mock_calls`` of the parent:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1192 +#: ../../library/unittest.mock-examples.rst:1216 msgid "" "We can then assert about the calls, including the order, by comparing with " "the ``mock_calls`` attribute on the manager mock:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1199 +#: ../../library/unittest.mock-examples.rst:1223 msgid "" "If ``patch`` is creating, and putting in place, your mocks then you can " "attach them to a manager mock using the :meth:`~Mock.attach_mock` method. " "After attaching calls will be recorded in ``mock_calls`` of the manager. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:1218 +#: ../../library/unittest.mock-examples.rst:1242 msgid "" "If many calls have been made, but you're only interested in a particular " "sequence of them then an alternative is to use the :meth:`~Mock." @@ -975,13 +986,13 @@ msgid "" "mock_calls` then the assert succeeds." msgstr "" -#: ../../library/unittest.mock-examples.rst:1232 +#: ../../library/unittest.mock-examples.rst:1256 msgid "" "Even though the chained call ``m.one().two().three()`` aren't the only calls " "that have been made to the mock, the assert still succeeds." msgstr "" -#: ../../library/unittest.mock-examples.rst:1235 +#: ../../library/unittest.mock-examples.rst:1259 msgid "" "Sometimes a mock may have several calls made to it, and you are only " "interested in asserting about *some* of those calls. You may not even care " @@ -989,17 +1000,17 @@ msgid "" "``assert_has_calls``:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1247 +#: ../../library/unittest.mock-examples.rst:1271 msgid "More complex argument matching" msgstr "" -#: ../../library/unittest.mock-examples.rst:1249 +#: ../../library/unittest.mock-examples.rst:1273 msgid "" "Using the same basic concept as :data:`ANY` we can implement matchers to do " "more complex assertions on objects used as arguments to mocks." msgstr "" -#: ../../library/unittest.mock-examples.rst:1252 +#: ../../library/unittest.mock-examples.rst:1276 msgid "" "Suppose we expect some object to be passed to a mock that by default " "compares equal based on object identity (which is the Python default for " @@ -1009,28 +1020,28 @@ msgid "" "attributes for us." msgstr "" -#: ../../library/unittest.mock-examples.rst:1259 +#: ../../library/unittest.mock-examples.rst:1283 msgid "" "You can see in this example how a 'standard' call to ``assert_called_with`` " "isn't sufficient:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1274 +#: ../../library/unittest.mock-examples.rst:1298 msgid "" "A comparison function for our ``Foo`` class might look something like this:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1286 +#: ../../library/unittest.mock-examples.rst:1310 msgid "" "And a matcher object that can use comparison functions like this for its " "equality operation would look something like this:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1297 +#: ../../library/unittest.mock-examples.rst:1321 msgid "Putting all this together:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1302 +#: ../../library/unittest.mock-examples.rst:1326 msgid "" "The ``Matcher`` is instantiated with our compare function and the ``Foo`` " "object we want to compare against. In ``assert_called_with`` the ``Matcher`` " @@ -1040,13 +1051,13 @@ msgid "" "raised:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1315 +#: ../../library/unittest.mock-examples.rst:1339 msgid "" "With a bit of tweaking you could have the comparison function raise the :exc:" "`AssertionError` directly and provide a more useful failure message." msgstr "" -#: ../../library/unittest.mock-examples.rst:1318 +#: ../../library/unittest.mock-examples.rst:1342 msgid "" "As of version 1.5, the Python testing library `PyHamcrest `_ provides similar functionality, that may be " diff --git a/using/configure.po b/using/configure.po index 3a283eca32..9e76574cb8 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-29 12:27+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,63 +86,88 @@ msgid "" "platform support\"." msgstr "" +#: ../../using/configure.rst:47 +msgid "Generated files" +msgstr "" + #: ../../using/configure.rst:49 +msgid "" +"To reduce build dependencies, Python source code contains multiple generated " +"files. Commands to regenerate all generated files::" +msgstr "" + +#: ../../using/configure.rst:57 +msgid "" +"The ``Makefile.pre.in`` file documents generated files, their inputs, and " +"tools used to regenerate them. Search for ``regen-*`` make targets." +msgstr "" + +#: ../../using/configure.rst:60 +msgid "" +"The ``make regen-configure`` command runs `tiran/cpython_autoconf `_ container for reproducible build; see " +"container ``entry.sh`` script. The container is optional, the following " +"command can be run locally, the generated files depend on autoconf and " +"aclocal versions::" +msgstr "" + +#: ../../using/configure.rst:72 msgid "Configure Options" msgstr "" -#: ../../using/configure.rst:51 +#: ../../using/configure.rst:74 msgid "List all ``./configure`` script options using::" msgstr "" -#: ../../using/configure.rst:55 +#: ../../using/configure.rst:78 msgid "" "See also the :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution." msgstr "" -#: ../../using/configure.rst:58 +#: ../../using/configure.rst:81 msgid "General Options" msgstr "" -#: ../../using/configure.rst:62 +#: ../../using/configure.rst:85 msgid "" "Support loadable extensions in the :mod:`_sqlite` extension module (default " "is no)." msgstr "" -#: ../../using/configure.rst:65 +#: ../../using/configure.rst:88 msgid "" "See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" "`sqlite3` module." msgstr "" -#: ../../using/configure.rst:72 +#: ../../using/configure.rst:95 msgid "" "Disable IPv6 support (enabled by default if supported), see the :mod:" "`socket` module." msgstr "" -#: ../../using/configure.rst:77 +#: ../../using/configure.rst:100 msgid "Define the size in bits of Python :class:`int` digits: 15 or 30 bits." msgstr "" -#: ../../using/configure.rst:79 +#: ../../using/configure.rst:102 msgid "By default, the digit size is 30." msgstr "" -#: ../../using/configure.rst:81 +#: ../../using/configure.rst:104 msgid "Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``." msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``\\ 。" -#: ../../using/configure.rst:83 +#: ../../using/configure.rst:106 msgid "See :data:`sys.int_info.bits_per_digit `." msgstr "參閱 :data:`sys.int_info.bits_per_digit `\\ 。" -#: ../../using/configure.rst:87 +#: ../../using/configure.rst:110 msgid "Set the Python executable suffix to *SUFFIX*." msgstr "" -#: ../../using/configure.rst:89 +#: ../../using/configure.rst:112 msgid "" "The default suffix is ``.exe`` on Windows and macOS (``python.exe`` " "executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser, ``." @@ -150,95 +175,95 @@ msgid "" "executable)." msgstr "" -#: ../../using/configure.rst:94 +#: ../../using/configure.rst:117 msgid "" "The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." "wasm``." msgstr "" -#: ../../using/configure.rst:100 +#: ../../using/configure.rst:123 msgid "" "Select the default time zone search path for :const:`zoneinfo.TZPATH`. See " "the :ref:`Compile-time configuration ` of " "the :mod:`zoneinfo` module." msgstr "" -#: ../../using/configure.rst:104 +#: ../../using/configure.rst:127 msgid "" "Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/" "etc/zoneinfo``." msgstr "" -#: ../../using/configure.rst:106 +#: ../../using/configure.rst:129 msgid "See :data:`os.pathsep` path separator." msgstr "" -#: ../../using/configure.rst:112 +#: ../../using/configure.rst:135 msgid "" "Build the ``_decimal`` extension module using a thread-local context rather " "than a coroutine-local context (default), see the :mod:`decimal` module." msgstr "" -#: ../../using/configure.rst:115 +#: ../../using/configure.rst:138 msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." msgstr "" -#: ../../using/configure.rst:121 +#: ../../using/configure.rst:144 msgid "Override order to check db backends for the :mod:`dbm` module" msgstr "" -#: ../../using/configure.rst:123 +#: ../../using/configure.rst:146 msgid "" "A valid value is a colon (``:``) separated string with the backend names:" msgstr "" -#: ../../using/configure.rst:125 +#: ../../using/configure.rst:148 msgid "``ndbm``;" msgstr "" -#: ../../using/configure.rst:126 +#: ../../using/configure.rst:149 msgid "``gdbm``;" msgstr "" -#: ../../using/configure.rst:127 +#: ../../using/configure.rst:150 msgid "``bdb``." msgstr "" -#: ../../using/configure.rst:131 +#: ../../using/configure.rst:154 msgid "Disable C locale coercion to a UTF-8 based locale (enabled by default)." msgstr "" -#: ../../using/configure.rst:133 +#: ../../using/configure.rst:156 msgid "Don't define the ``PY_COERCE_C_LOCALE`` macro." msgstr "" -#: ../../using/configure.rst:135 +#: ../../using/configure.rst:158 msgid "See :envvar:`PYTHONCOERCECLOCALE` and the :pep:`538`." msgstr "請見 :envvar:`PYTHONCOERCECLOCALE` 與 :pep:`538`。" -#: ../../using/configure.rst:139 +#: ../../using/configure.rst:162 msgid "Disable all freelists except the empty tuple singleton." msgstr "" -#: ../../using/configure.rst:145 +#: ../../using/configure.rst:168 msgid "Python library directory name (default is ``lib``)." msgstr "" -#: ../../using/configure.rst:147 +#: ../../using/configure.rst:170 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." msgstr "" -#: ../../using/configure.rst:149 +#: ../../using/configure.rst:172 msgid "See :data:`sys.platlibdir`." msgstr "參閱 :data:`sys.platlibdir`\\ 。" -#: ../../using/configure.rst:155 +#: ../../using/configure.rst:178 msgid "" "Directory of wheel packages used by the :mod:`ensurepip` module (none by " "default)." msgstr "" -#: ../../using/configure.rst:158 +#: ../../using/configure.rst:181 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -246,201 +271,201 @@ msgid "" "_bundled` package." msgstr "" -#: ../../using/configure.rst:167 +#: ../../using/configure.rst:190 msgid "" "Whether configure should use :program:`pkg-config` to detect build " "dependencies." msgstr "" -#: ../../using/configure.rst:170 +#: ../../using/configure.rst:193 msgid "``check`` (default): :program:`pkg-config` is optional" msgstr "" -#: ../../using/configure.rst:171 +#: ../../using/configure.rst:194 msgid "``yes``: :program:`pkg-config` is mandatory" msgstr "" -#: ../../using/configure.rst:172 +#: ../../using/configure.rst:195 msgid "``no``: configure does not use :program:`pkg-config` even when present" msgstr "" -#: ../../using/configure.rst:178 +#: ../../using/configure.rst:201 msgid "Turn on internal statistics gathering." msgstr "" -#: ../../using/configure.rst:180 +#: ../../using/configure.rst:203 msgid "" "The statistics will be dumped to a arbitrary (probably unique) file in ``/" "tmp/py_stats/``, or ``C:\\temp\\py_stats\\`` on Windows. If that directory " "does not exist, results will be printed on stdout." msgstr "" -#: ../../using/configure.rst:184 +#: ../../using/configure.rst:207 msgid "Use ``Tools/scripts/summarize_stats.py`` to read the stats." msgstr "" -#: ../../using/configure.rst:189 +#: ../../using/configure.rst:212 msgid "WebAssembly Options" msgstr "" -#: ../../using/configure.rst:193 +#: ../../using/configure.rst:216 msgid "Set build flavor for ``wasm32-emscripten``." msgstr "" -#: ../../using/configure.rst:195 +#: ../../using/configure.rst:218 msgid "``browser`` (default): preload minimal stdlib, default MEMFS." msgstr "" -#: ../../using/configure.rst:196 +#: ../../using/configure.rst:219 msgid "``node``: NODERAWFS and pthread support." msgstr "" -#: ../../using/configure.rst:202 +#: ../../using/configure.rst:225 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:204 +#: ../../using/configure.rst:227 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:211 +#: ../../using/configure.rst:234 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:217 +#: ../../using/configure.rst:240 msgid "Install Options" msgstr "" -#: ../../using/configure.rst:221 +#: ../../using/configure.rst:244 msgid "" "Install architecture-independent files in PREFIX. On Unix, it defaults to :" "file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:224 +#: ../../using/configure.rst:247 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "" -#: ../../using/configure.rst:226 +#: ../../using/configure.rst:249 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:231 +#: ../../using/configure.rst:254 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:233 +#: ../../using/configure.rst:256 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "" -#: ../../using/configure.rst:237 +#: ../../using/configure.rst:260 msgid "" "Don't build nor install test modules, like the :mod:`test` package or the :" "mod:`_testcapi` extension module (built and installed by default)." msgstr "" -#: ../../using/configure.rst:244 +#: ../../using/configure.rst:267 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "" -#: ../../using/configure.rst:246 +#: ../../using/configure.rst:269 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." msgstr "" -#: ../../using/configure.rst:248 +#: ../../using/configure.rst:271 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "" -#: ../../using/configure.rst:249 +#: ../../using/configure.rst:272 msgid "``no``: don't run ensurepip;" msgstr "" -#: ../../using/configure.rst:255 +#: ../../using/configure.rst:278 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:257 +#: ../../using/configure.rst:280 msgid "" "Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) " "is recommended for best performance. The experimental ``--enable-bolt`` flag " "can also be used to improve performance." msgstr "" -#: ../../using/configure.rst:263 +#: ../../using/configure.rst:286 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:266 +#: ../../using/configure.rst:289 msgid "" "The C compiler Clang requires ``llvm-profdata`` program for PGO. On macOS, " "GCC also requires it: GCC is just an alias to Clang on macOS." msgstr "" -#: ../../using/configure.rst:269 +#: ../../using/configure.rst:292 msgid "" "Disable also semantic interposition in libpython if ``--enable-shared`` and " "GCC is used: add ``-fno-semantic-interposition`` to the compiler and linker " "flags." msgstr "" -#: ../../using/configure.rst:275 +#: ../../using/configure.rst:298 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "" -#: ../../using/configure.rst:280 +#: ../../using/configure.rst:303 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:283 +#: ../../using/configure.rst:306 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "" -#: ../../using/configure.rst:289 +#: ../../using/configure.rst:312 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:291 +#: ../../using/configure.rst:314 msgid "" "The C compiler Clang requires ``llvm-ar`` for LTO (``ar`` on macOS), as well " "as an LTO-aware linker (``ld.gold`` or ``lld``)." msgstr "" -#: ../../using/configure.rst:296 +#: ../../using/configure.rst:319 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:299 +#: ../../using/configure.rst:322 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" -#: ../../using/configure.rst:304 +#: ../../using/configure.rst:327 msgid "" "Enable usage of the `BOLT post-link binary optimizer `_ (disabled by default)." msgstr "" -#: ../../using/configure.rst:308 +#: ../../using/configure.rst:331 msgid "" "BOLT is part of the LLVM project but is not always included in their binary " "distributions. This flag requires that ``llvm-bolt`` and ``merge-fdata`` are " "available." msgstr "" -#: ../../using/configure.rst:312 +#: ../../using/configure.rst:335 msgid "" "BOLT is still a fairly new project so this flag should be considered " "experimental for now. Because this tool operates on machine code its success " @@ -451,7 +476,7 @@ msgid "" "encouraged." msgstr "" -#: ../../using/configure.rst:320 +#: ../../using/configure.rst:343 msgid "" "The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" "program:`configure` variables can be defined to override the default set of " @@ -459,101 +484,101 @@ msgid "" "binaries, respectively." msgstr "" -#: ../../using/configure.rst:329 +#: ../../using/configure.rst:352 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:334 +#: ../../using/configure.rst:357 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:337 +#: ../../using/configure.rst:360 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:341 +#: ../../using/configure.rst:364 msgid "" "Disable static documentation strings to reduce the memory footprint (enabled " "by default). Documentation strings defined in Python are not affected." msgstr "" -#: ../../using/configure.rst:344 +#: ../../using/configure.rst:367 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "" -#: ../../using/configure.rst:346 +#: ../../using/configure.rst:369 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "" -#: ../../using/configure.rst:350 +#: ../../using/configure.rst:373 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:354 +#: ../../using/configure.rst:377 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" -#: ../../using/configure.rst:361 +#: ../../using/configure.rst:384 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:363 +#: ../../using/configure.rst:386 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:366 +#: ../../using/configure.rst:389 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:368 +#: ../../using/configure.rst:391 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:370 +#: ../../using/configure.rst:393 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "" -#: ../../using/configure.rst:371 +#: ../../using/configure.rst:394 msgid "Add :func:`sys.gettotalrefcount` function." msgstr "新增 :func:`sys.gettotalrefcount` 函式。" -#: ../../using/configure.rst:372 +#: ../../using/configure.rst:395 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" -#: ../../using/configure.rst:373 +#: ../../using/configure.rst:396 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" -#: ../../using/configure.rst:375 +#: ../../using/configure.rst:398 msgid "" "Add support for the ``__lltrace__`` variable: enable low-level tracing in " "the bytecode evaluation loop if the variable is defined." msgstr "" -#: ../../using/configure.rst:377 +#: ../../using/configure.rst:400 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:379 +#: ../../using/configure.rst:402 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" -#: ../../using/configure.rst:380 +#: ../../using/configure.rst:403 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -561,45 +586,45 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:385 +#: ../../using/configure.rst:408 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:386 +#: ../../using/configure.rst:409 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:388 +#: ../../using/configure.rst:411 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:390 +#: ../../using/configure.rst:413 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:391 +#: ../../using/configure.rst:414 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:393 +#: ../../using/configure.rst:416 msgid "" "The :c:macro:`Py_SAFE_DOWNCAST()` macro checks for integer underflow and " "overflow when downcasting from wide types to narrow types." msgstr "" -#: ../../using/configure.rst:396 +#: ../../using/configure.rst:419 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:399 +#: ../../using/configure.rst:422 msgid "" "Release builds and debug builds are now ABI compatible: defining the " "``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see the :" @@ -607,320 +632,320 @@ msgid "" "incompatibility." msgstr "" -#: ../../using/configure.rst:407 +#: ../../using/configure.rst:430 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:411 +#: ../../using/configure.rst:434 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:416 +#: ../../using/configure.rst:439 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:418 +#: ../../using/configure.rst:441 msgid "Effects:" msgstr "" -#: ../../using/configure.rst:420 +#: ../../using/configure.rst:443 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" -#: ../../using/configure.rst:421 +#: ../../using/configure.rst:444 msgid "Add :func:`sys.getobjects` function." msgstr "新增 :func:`sys.getobjects` 函式。" -#: ../../using/configure.rst:422 +#: ../../using/configure.rst:445 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" -#: ../../using/configure.rst:424 +#: ../../using/configure.rst:447 msgid "" "This build is not ABI compatible with release build (default build) or debug " "build (``Py_DEBUG`` and ``Py_REF_DEBUG`` macros)." msgstr "" -#: ../../using/configure.rst:431 +#: ../../using/configure.rst:454 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:434 +#: ../../using/configure.rst:457 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:437 +#: ../../using/configure.rst:460 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." msgstr "" -#: ../../using/configure.rst:444 +#: ../../using/configure.rst:467 msgid "Enable Valgrind support (default is no)." msgstr "啟用 Valgrind 支援(預設不啟用)。" -#: ../../using/configure.rst:448 +#: ../../using/configure.rst:471 msgid "Enable DTrace support (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:450 +#: ../../using/configure.rst:473 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" -#: ../../using/configure.rst:457 +#: ../../using/configure.rst:480 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:463 +#: ../../using/configure.rst:486 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:469 +#: ../../using/configure.rst:492 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:476 +#: ../../using/configure.rst:499 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:480 +#: ../../using/configure.rst:503 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:484 +#: ../../using/configure.rst:507 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:491 +#: ../../using/configure.rst:514 msgid "Libraries options" msgstr "" -#: ../../using/configure.rst:495 +#: ../../using/configure.rst:518 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:499 +#: ../../using/configure.rst:522 msgid "" "Build the :mod:`pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:504 +#: ../../using/configure.rst:527 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdec`` " "library, see the :mod:`decimal` module (default is no)." msgstr "" -#: ../../using/configure.rst:511 +#: ../../using/configure.rst:534 msgid "Use ``editline`` library for backend of the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:513 +#: ../../using/configure.rst:536 msgid "Define the ``WITH_EDITLINE`` macro." msgstr "定義 ``WITH_EDITLINE`` 巨集。" -#: ../../using/configure.rst:519 +#: ../../using/configure.rst:542 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" -#: ../../using/configure.rst:521 +#: ../../using/configure.rst:544 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" -#: ../../using/configure.rst:527 +#: ../../using/configure.rst:550 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:531 +#: ../../using/configure.rst:554 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:535 +#: ../../using/configure.rst:558 msgid "Root of the OpenSSL directory." msgstr "" -#: ../../using/configure.rst:541 +#: ../../using/configure.rst:564 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:543 +#: ../../using/configure.rst:566 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:544 +#: ../../using/configure.rst:567 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:546 +#: ../../using/configure.rst:569 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:552 +#: ../../using/configure.rst:575 msgid "Security Options" msgstr "" -#: ../../using/configure.rst:556 +#: ../../using/configure.rst:579 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:558 +#: ../../using/configure.rst:581 msgid "``siphash13`` (default);" msgstr "" -#: ../../using/configure.rst:559 +#: ../../using/configure.rst:582 msgid "``siphash24``;" msgstr "``siphash24``;" -#: ../../using/configure.rst:560 +#: ../../using/configure.rst:583 msgid "``fnv``." msgstr "``fnv``。" -#: ../../using/configure.rst:564 +#: ../../using/configure.rst:587 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:569 +#: ../../using/configure.rst:592 msgid "Built-in hash modules:" msgstr "內建雜湊模組:" -#: ../../using/configure.rst:571 +#: ../../using/configure.rst:594 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:572 +#: ../../using/configure.rst:595 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:573 +#: ../../using/configure.rst:596 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:574 +#: ../../using/configure.rst:597 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:575 +#: ../../using/configure.rst:598 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:576 +#: ../../using/configure.rst:599 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:582 +#: ../../using/configure.rst:605 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:584 +#: ../../using/configure.rst:607 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:585 +#: ../../using/configure.rst:608 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:586 +#: ../../using/configure.rst:609 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:588 +#: ../../using/configure.rst:611 msgid "See the :mod:`ssl` module." msgstr "請見 :mod:`ssl` 模組。" -#: ../../using/configure.rst:594 +#: ../../using/configure.rst:617 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:598 +#: ../../using/configure.rst:621 msgid "macOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:600 +#: ../../using/configure.rst:623 msgid "See ``Mac/README.rst``." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:605 +#: ../../using/configure.rst:628 msgid "" "Create a universal binary build. *SDKDIR* specifies which macOS SDK should " "be used to perform the build (default is no)." msgstr "" -#: ../../using/configure.rst:611 +#: ../../using/configure.rst:634 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:616 +#: ../../using/configure.rst:639 msgid "" "Specify the kind of universal binary that should be created. This option is " "only valid when :option:`--enable-universalsdk` is set." msgstr "" -#: ../../using/configure.rst:619 +#: ../../using/configure.rst:642 msgid "Options:" msgstr "選項:" -#: ../../using/configure.rst:621 +#: ../../using/configure.rst:644 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:622 +#: ../../using/configure.rst:645 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:623 +#: ../../using/configure.rst:646 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:624 +#: ../../using/configure.rst:647 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:625 +#: ../../using/configure.rst:648 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:626 +#: ../../using/configure.rst:649 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:627 +#: ../../using/configure.rst:650 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:628 +#: ../../using/configure.rst:651 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:632 +#: ../../using/configure.rst:655 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:637 +#: ../../using/configure.rst:660 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:639 +#: ../../using/configure.rst:662 msgid "" "Cross compiling, also known as cross building, can be used to build Python " "for another CPU architecture or platform. Cross compiling requires a Python " @@ -928,95 +953,95 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:646 +#: ../../using/configure.rst:669 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:650 +#: ../../using/configure.rst:673 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:654 +#: ../../using/configure.rst:677 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:660 +#: ../../using/configure.rst:683 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:662 +#: ../../using/configure.rst:685 msgid "Example *config.site* file::" msgstr "" -#: ../../using/configure.rst:670 +#: ../../using/configure.rst:693 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:679 +#: ../../using/configure.rst:702 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:682 +#: ../../using/configure.rst:705 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:684 +#: ../../using/configure.rst:707 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:685 +#: ../../using/configure.rst:708 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:686 +#: ../../using/configure.rst:709 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:687 +#: ../../using/configure.rst:710 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:691 +#: ../../using/configure.rst:714 msgid "Main build steps" msgstr "" -#: ../../using/configure.rst:693 +#: ../../using/configure.rst:716 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:694 +#: ../../using/configure.rst:717 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:695 +#: ../../using/configure.rst:718 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:697 +#: ../../using/configure.rst:720 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:700 +#: ../../using/configure.rst:723 msgid "Main Makefile targets" msgstr "" -#: ../../using/configure.rst:702 +#: ../../using/configure.rst:725 msgid "``make``: Build Python with the standard library." msgstr "" -#: ../../using/configure.rst:703 +#: ../../using/configure.rst:726 msgid "" "``make platform:``: build the ``python`` program, but don't build the " "standard library extension modules." msgstr "" -#: ../../using/configure.rst:705 +#: ../../using/configure.rst:728 msgid "" "``make profile-opt``: build Python using Profile Guided Optimization (PGO). " "You can use the configure :option:`--enable-optimizations` option to make " @@ -1024,53 +1049,53 @@ msgid "" "``make``)." msgstr "" -#: ../../using/configure.rst:709 +#: ../../using/configure.rst:732 msgid "" "``make buildbottest``: Build Python and run the Python test suite, the same " "way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds) to " "change the test timeout (1200 by default: 20 minutes)." msgstr "" -#: ../../using/configure.rst:712 +#: ../../using/configure.rst:735 msgid "``make install``: Build and install Python." msgstr "" -#: ../../using/configure.rst:713 +#: ../../using/configure.rst:736 msgid "" "``make regen-all``: Regenerate (almost) all generated files; ``make regen-" "stdlib-module-names`` and ``autoconf`` must be run separately for the " "remaining generated files." msgstr "" -#: ../../using/configure.rst:716 +#: ../../using/configure.rst:739 msgid "``make clean``: Remove built files." msgstr "" -#: ../../using/configure.rst:717 +#: ../../using/configure.rst:740 msgid "" "``make distclean``: Same than ``make clean``, but remove also files created " "by the configure script." msgstr "" -#: ../../using/configure.rst:721 +#: ../../using/configure.rst:744 msgid "C extensions" msgstr "" -#: ../../using/configure.rst:723 +#: ../../using/configure.rst:746 msgid "" "Some C extensions are built as built-in modules, like the ``sys`` module. " "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute::" msgstr "" -#: ../../using/configure.rst:735 +#: ../../using/configure.rst:758 msgid "" "Other C extensions are built as dynamic libraries, like the ``_asyncio`` " "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64::" msgstr "" -#: ../../using/configure.rst:745 +#: ../../using/configure.rst:768 msgid "" ":file:`Modules/Setup` is used to generate Makefile targets to build C " "extensions. At the beginning of the files, C extensions are built as built-" @@ -1078,303 +1103,303 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:749 +#: ../../using/configure.rst:772 msgid "" "The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_DATA()` and :c:macro:" "`PyMODINIT_FUNC` macros of :file:`Include/pyport.h` are defined differently " "depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:753 +#: ../../using/configure.rst:776 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "" -#: ../../using/configure.rst:754 +#: ../../using/configure.rst:777 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "" -#: ../../using/configure.rst:756 +#: ../../using/configure.rst:779 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its ``PyInit_xxx()`` function is not exported, " "causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:762 +#: ../../using/configure.rst:785 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:764 +#: ../../using/configure.rst:787 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:768 +#: ../../using/configure.rst:791 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:772 +#: ../../using/configure.rst:795 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:778 +#: ../../using/configure.rst:801 msgid "" "(Objective) C/C++ preprocessor flags, e.g. ``-I`` if you have " "headers in a nonstandard directory ````." msgstr "" -#: ../../using/configure.rst:781 ../../using/configure.rst:971 +#: ../../using/configure.rst:804 ../../using/configure.rst:994 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value to be able to build extension modules using the directories specified " "in the environment variables." msgstr "" -#: ../../using/configure.rst:791 +#: ../../using/configure.rst:814 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:793 +#: ../../using/configure.rst:816 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:798 +#: ../../using/configure.rst:821 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:802 +#: ../../using/configure.rst:825 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:804 +#: ../../using/configure.rst:827 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:808 +#: ../../using/configure.rst:831 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:810 +#: ../../using/configure.rst:833 msgid "Example: ``g++ -pthread``." msgstr "" -#: ../../using/configure.rst:814 +#: ../../using/configure.rst:837 msgid "C compiler flags." msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:818 +#: ../../using/configure.rst:841 msgid "" ":envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C " "extensions. Use it when a compiler flag should *not* be part of :envvar:" "`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:822 +#: ../../using/configure.rst:845 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:824 +#: ../../using/configure.rst:847 msgid "" "the compiler flag ``-I`` (for setting the search path for include files). " "The ``-I`` flags are processed from left to right, and any flags in :envvar:" "`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." msgstr "" -#: ../../using/configure.rst:829 +#: ../../using/configure.rst:852 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:837 +#: ../../using/configure.rst:860 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:844 +#: ../../using/configure.rst:867 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:848 +#: ../../using/configure.rst:871 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:855 +#: ../../using/configure.rst:878 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:862 +#: ../../using/configure.rst:885 msgid "Base compiler flags." msgstr "" -#: ../../using/configure.rst:866 +#: ../../using/configure.rst:889 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:870 +#: ../../using/configure.rst:893 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:876 +#: ../../using/configure.rst:899 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:878 +#: ../../using/configure.rst:901 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:882 +#: ../../using/configure.rst:905 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:884 +#: ../../using/configure.rst:907 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:889 +#: ../../using/configure.rst:912 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:893 +#: ../../using/configure.rst:916 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:899 +#: ../../using/configure.rst:922 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:901 +#: ../../using/configure.rst:924 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:907 +#: ../../using/configure.rst:930 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:913 +#: ../../using/configure.rst:936 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:916 +#: ../../using/configure.rst:939 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:922 +#: ../../using/configure.rst:945 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:924 +#: ../../using/configure.rst:947 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:928 +#: ../../using/configure.rst:951 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:932 +#: ../../using/configure.rst:955 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:934 +#: ../../using/configure.rst:957 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:938 +#: ../../using/configure.rst:961 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:940 +#: ../../using/configure.rst:963 msgid "" "Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use " "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" -#: ../../using/configure.rst:948 +#: ../../using/configure.rst:971 msgid "" ":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" "`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of :envvar:" "`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:952 +#: ../../using/configure.rst:975 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:954 +#: ../../using/configure.rst:977 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" -#: ../../using/configure.rst:961 +#: ../../using/configure.rst:984 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:968 +#: ../../using/configure.rst:991 msgid "" "Linker flags, e.g. ``-L`` if you have libraries in a nonstandard " "directory ````." msgstr "" -#: ../../using/configure.rst:977 +#: ../../using/configure.rst:1000 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:980 +#: ../../using/configure.rst:1003 msgid "Example: ``-lrt``." msgstr "" -#: ../../using/configure.rst:984 +#: ../../using/configure.rst:1007 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:986 +#: ../../using/configure.rst:1009 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:990 +#: ../../using/configure.rst:1013 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:992 +#: ../../using/configure.rst:1015 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:996 +#: ../../using/configure.rst:1019 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1000 +#: ../../using/configure.rst:1023 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1006 +#: ../../using/configure.rst:1029 msgid "Linker flags used for building the interpreter object files." msgstr "" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 33d9955dbd..d93137df29 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-06 00:03+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -147,7 +147,7 @@ msgid "" "in :gh:`91058`." msgstr "" -#: ../../whatsnew/3.12.rst:151 ../../whatsnew/3.12.rst:1672 +#: ../../whatsnew/3.12.rst:151 ../../whatsnew/3.12.rst:1681 msgid "New Features" msgstr "新增特性" @@ -741,24 +741,34 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:635 +msgid "importlib.resources" +msgstr "" + +#: ../../whatsnew/3.12.rst:637 +msgid "" +":func:`importlib.resources.as_file` now supports resource directories. " +"(Contributed by Jason R. Coombs in :gh:`97930`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:641 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:637 +#: ../../whatsnew/3.12.rst:643 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:641 +#: ../../whatsnew/3.12.rst:647 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :issue:`35759`.)" msgstr "" -#: ../../whatsnew/3.12.rst:645 +#: ../../whatsnew/3.12.rst:651 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -766,60 +776,60 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:651 +#: ../../whatsnew/3.12.rst:657 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:653 +#: ../../whatsnew/3.12.rst:659 msgid "" "Added :class:`itertools.batched()` for collecting into even-sized tuples " "where the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:658 +#: ../../whatsnew/3.12.rst:664 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:660 +#: ../../whatsnew/3.12.rst:666 msgid "" "Added :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -#: ../../whatsnew/3.12.rst:663 +#: ../../whatsnew/3.12.rst:669 msgid "" "Extended :func:`math.nextafter` to include a *steps* argument for moving up " "or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:668 +#: ../../whatsnew/3.12.rst:674 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:670 +#: ../../whatsnew/3.12.rst:676 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:674 +#: ../../whatsnew/3.12.rst:680 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:678 +#: ../../whatsnew/3.12.rst:684 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:682 +#: ../../whatsnew/3.12.rst:688 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -832,27 +842,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:693 +#: ../../whatsnew/3.12.rst:699 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:695 +#: ../../whatsnew/3.12.rst:701 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:698 +#: ../../whatsnew/3.12.rst:704 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:702 +#: ../../whatsnew/3.12.rst:708 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:704 +#: ../../whatsnew/3.12.rst:710 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -860,14 +870,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:709 +#: ../../whatsnew/3.12.rst:715 msgid "" "Add :meth:`~pathlib.Path.walk` for walking the directory trees and " "generating all file or directory names within them, similar to :func:`os." "walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:713 +#: ../../whatsnew/3.12.rst:719 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " @@ -875,13 +885,13 @@ msgid "" "issue:`40358`.)" msgstr "" -#: ../../whatsnew/3.12.rst:718 +#: ../../whatsnew/3.12.rst:724 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:721 +#: ../../whatsnew/3.12.rst:727 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -889,38 +899,38 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:726 +#: ../../whatsnew/3.12.rst:732 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:728 +#: ../../whatsnew/3.12.rst:734 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:734 +#: ../../whatsnew/3.12.rst:740 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:736 +#: ../../whatsnew/3.12.rst:742 msgid "" "Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" "gh:`81620`.)" msgstr "" -#: ../../whatsnew/3.12.rst:739 +#: ../../whatsnew/3.12.rst:745 msgid "" "Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:749 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:745 +#: ../../whatsnew/3.12.rst:751 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -928,7 +938,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:751 +#: ../../whatsnew/3.12.rst:757 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -936,14 +946,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:757 +#: ../../whatsnew/3.12.rst:763 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:762 +#: ../../whatsnew/3.12.rst:768 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -951,24 +961,24 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:767 +#: ../../whatsnew/3.12.rst:773 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:773 +#: ../../whatsnew/3.12.rst:779 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:775 +#: ../../whatsnew/3.12.rst:781 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -#: ../../whatsnew/3.12.rst:778 +#: ../../whatsnew/3.12.rst:784 msgid "" "Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." "Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " @@ -976,36 +986,36 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:785 +#: ../../whatsnew/3.12.rst:791 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:790 +#: ../../whatsnew/3.12.rst:796 msgid "" "Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection." "setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " "a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:796 +#: ../../whatsnew/3.12.rst:802 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:798 +#: ../../whatsnew/3.12.rst:804 msgid "" "Extended :func:`statistics.correlation` to include as a ``ranked`` method " "for computing the Spearman correlation of ranked data. (Contributed by " "Raymond Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:803 +#: ../../whatsnew/3.12.rst:809 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:805 +#: ../../whatsnew/3.12.rst:811 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -1015,7 +1025,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:814 +#: ../../whatsnew/3.12.rst:820 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1024,14 +1034,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:820 ../../whatsnew/3.12.rst:1580 +#: ../../whatsnew/3.12.rst:826 ../../whatsnew/3.12.rst:1589 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:824 +#: ../../whatsnew/3.12.rst:830 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1039,27 +1049,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:830 +#: ../../whatsnew/3.12.rst:836 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:832 +#: ../../whatsnew/3.12.rst:838 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:834 +#: ../../whatsnew/3.12.rst:840 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:840 +#: ../../whatsnew/3.12.rst:846 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:842 +#: ../../whatsnew/3.12.rst:848 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1067,11 +1077,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:848 +#: ../../whatsnew/3.12.rst:854 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:850 +#: ../../whatsnew/3.12.rst:856 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1081,11 +1091,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:859 +#: ../../whatsnew/3.12.rst:865 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:861 +#: ../../whatsnew/3.12.rst:867 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "( Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1093,22 +1103,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:867 +#: ../../whatsnew/3.12.rst:873 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:869 +#: ../../whatsnew/3.12.rst:875 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:874 +#: ../../whatsnew/3.12.rst:880 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:876 +#: ../../whatsnew/3.12.rst:882 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1121,7 +1131,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:887 +#: ../../whatsnew/3.12.rst:893 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1129,13 +1139,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:909 +#: ../../whatsnew/3.12.rst:915 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:912 +#: ../../whatsnew/3.12.rst:918 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1146,71 +1156,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:920 +#: ../../whatsnew/3.12.rst:926 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:924 +#: ../../whatsnew/3.12.rst:930 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:928 +#: ../../whatsnew/3.12.rst:934 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:930 +#: ../../whatsnew/3.12.rst:936 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:934 +#: ../../whatsnew/3.12.rst:940 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:936 +#: ../../whatsnew/3.12.rst:942 msgid "" "Added ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:952 +#: ../../whatsnew/3.12.rst:958 msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" msgstr "(由 Giampaolo Rodola 於 :issue:`4080` 中貢獻。)" -#: ../../whatsnew/3.12.rst:955 +#: ../../whatsnew/3.12.rst:961 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:957 +#: ../../whatsnew/3.12.rst:963 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:962 +#: ../../whatsnew/3.12.rst:968 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:964 +#: ../../whatsnew/3.12.rst:970 msgid "" "Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " "reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " "(Contributed by Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:968 +#: ../../whatsnew/3.12.rst:974 msgid "" "Added experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:972 +#: ../../whatsnew/3.12.rst:978 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1218,13 +1228,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:977 +#: ../../whatsnew/3.12.rst:983 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar O in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:980 +#: ../../whatsnew/3.12.rst:986 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1232,18 +1242,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:985 +#: ../../whatsnew/3.12.rst:991 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:991 +#: ../../whatsnew/3.12.rst:997 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:993 +#: ../../whatsnew/3.12.rst:999 msgid "" "Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1251,20 +1261,26 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:998 +#: ../../whatsnew/3.12.rst:1004 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1001 +#: ../../whatsnew/3.12.rst:1007 +msgid "" +"Removed the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" +"gh:`92925`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1010 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1004 +#: ../../whatsnew/3.12.rst:1013 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1273,35 +1289,35 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1010 +#: ../../whatsnew/3.12.rst:1019 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1014 +#: ../../whatsnew/3.12.rst:1023 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:1016 +#: ../../whatsnew/3.12.rst:1025 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1021 +#: ../../whatsnew/3.12.rst:1030 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1028 ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:1037 ../../whatsnew/3.12.rst:1980 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.12.rst:1030 +#: ../../whatsnew/3.12.rst:1039 msgid "" ":mod:`asyncio`: The :meth:`~asyncio.get_event_loop` method of the default " "event loop policy now emits a :exc:`DeprecationWarning` if there is no " @@ -1309,14 +1325,14 @@ msgid "" "Storchaka and Guido van Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1035 +#: ../../whatsnew/3.12.rst:1044 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." "FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1039 +#: ../../whatsnew/3.12.rst:1048 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1326,7 +1342,7 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1047 +#: ../../whatsnew/3.12.rst:1056 msgid "" ":mod:`os`: The ``st_ctime`` fields return by :func:`os.stat` and :func:`os." "lstat` on Windows are deprecated. In a future release, they will contain the " @@ -1335,25 +1351,25 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1053 +#: ../../whatsnew/3.12.rst:1062 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " "Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1068 +#: ../../whatsnew/3.12.rst:1077 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.12.rst:1057 +#: ../../whatsnew/3.12.rst:1066 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1063 +#: ../../whatsnew/3.12.rst:1072 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1363,28 +1379,28 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1070 +#: ../../whatsnew/3.12.rst:1079 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1074 +#: ../../whatsnew/3.12.rst:1083 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1078 +#: ../../whatsnew/3.12.rst:1087 msgid "" ":mod:`typing`: :class:`typing.Hashable` and :class:`typing.Sized` aliases " "for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:" "gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1081 +#: ../../whatsnew/3.12.rst:1090 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -1392,7 +1408,7 @@ msgid "" "implementation emitted nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1086 +#: ../../whatsnew/3.12.rst:1095 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" "meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " @@ -1400,14 +1416,14 @@ msgid "" "functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1091 +#: ../../whatsnew/3.12.rst:1100 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1096 +#: ../../whatsnew/3.12.rst:1105 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -1416,7 +1432,7 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:1101 +#: ../../whatsnew/3.12.rst:1110 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1425,156 +1441,156 @@ msgid "" "by Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1117 msgid "Pending Removal in Python 3.13" msgstr "" -#: ../../whatsnew/3.12.rst:1110 +#: ../../whatsnew/3.12.rst:1119 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1113 +#: ../../whatsnew/3.12.rst:1122 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1115 +#: ../../whatsnew/3.12.rst:1124 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1116 +#: ../../whatsnew/3.12.rst:1125 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1117 +#: ../../whatsnew/3.12.rst:1126 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1118 +#: ../../whatsnew/3.12.rst:1127 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1119 +#: ../../whatsnew/3.12.rst:1128 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1129 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1121 +#: ../../whatsnew/3.12.rst:1130 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1131 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1132 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1124 +#: ../../whatsnew/3.12.rst:1133 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1134 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1126 +#: ../../whatsnew/3.12.rst:1135 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1127 +#: ../../whatsnew/3.12.rst:1136 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1137 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1129 +#: ../../whatsnew/3.12.rst:1138 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1139 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1131 +#: ../../whatsnew/3.12.rst:1140 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1132 +#: ../../whatsnew/3.12.rst:1141 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1142 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1135 +#: ../../whatsnew/3.12.rst:1144 msgid "Other modules:" msgstr "" -#: ../../whatsnew/3.12.rst:1137 +#: ../../whatsnew/3.12.rst:1146 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1139 +#: ../../whatsnew/3.12.rst:1148 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1141 +#: ../../whatsnew/3.12.rst:1150 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1142 +#: ../../whatsnew/3.12.rst:1151 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1143 +#: ../../whatsnew/3.12.rst:1152 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1144 +#: ../../whatsnew/3.12.rst:1153 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1145 +#: ../../whatsnew/3.12.rst:1154 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1146 +#: ../../whatsnew/3.12.rst:1155 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1147 +#: ../../whatsnew/3.12.rst:1156 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1148 +#: ../../whatsnew/3.12.rst:1157 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1149 +#: ../../whatsnew/3.12.rst:1158 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1152 +#: ../../whatsnew/3.12.rst:1161 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1154 +#: ../../whatsnew/3.12.rst:1163 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1159 +#: ../../whatsnew/3.12.rst:1168 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1582,39 +1598,39 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1163 +#: ../../whatsnew/3.12.rst:1172 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1164 +#: ../../whatsnew/3.12.rst:1173 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1165 +#: ../../whatsnew/3.12.rst:1174 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1166 +#: ../../whatsnew/3.12.rst:1175 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1167 +#: ../../whatsnew/3.12.rst:1176 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1169 +#: ../../whatsnew/3.12.rst:1178 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1172 +#: ../../whatsnew/3.12.rst:1181 msgid "" ":mod:`asyncio`: the *msg* parameter of both :meth:`asyncio.Future.cancel` " "and :meth:`asyncio.Task.cancel` (:gh:`90985`)" msgstr "" -#: ../../whatsnew/3.12.rst:1176 +#: ../../whatsnew/3.12.rst:1185 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1622,47 +1638,47 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1181 +#: ../../whatsnew/3.12.rst:1190 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1184 +#: ../../whatsnew/3.12.rst:1193 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1187 +#: ../../whatsnew/3.12.rst:1196 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1188 +#: ../../whatsnew/3.12.rst:1197 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1189 +#: ../../whatsnew/3.12.rst:1198 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1191 +#: ../../whatsnew/3.12.rst:1200 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1193 +#: ../../whatsnew/3.12.rst:1202 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1194 +#: ../../whatsnew/3.12.rst:1203 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1196 +#: ../../whatsnew/3.12.rst:1205 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1198 +#: ../../whatsnew/3.12.rst:1207 msgid "" ":mod:`itertools`: The module had undocumented, inefficient, historically " "buggy, and inconsistent support for copy, deepcopy, and pickle operations. " @@ -1670,7 +1686,7 @@ msgid "" "maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1204 +#: ../../whatsnew/3.12.rst:1213 msgid "" ":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " "change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " @@ -1681,52 +1697,52 @@ msgid "" "code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../whatsnew/3.12.rst:1212 +#: ../../whatsnew/3.12.rst:1221 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1217 +#: ../../whatsnew/3.12.rst:1226 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " "gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1221 +#: ../../whatsnew/3.12.rst:1230 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "in 3.12, and will be removed in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1224 +#: ../../whatsnew/3.12.rst:1233 msgid "" ":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../whatsnew/3.12.rst:1227 +#: ../../whatsnew/3.12.rst:1236 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element` is deprecated and will raise an exception in " "Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1230 +#: ../../whatsnew/3.12.rst:1239 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases using the C API (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:1233 +#: ../../whatsnew/3.12.rst:1242 msgid "" "``__package__`` and ``__cached__`` will cease to be set or taken into " "consideration by the import system (:gh:`97879`)." msgstr "" -#: ../../whatsnew/3.12.rst:1236 +#: ../../whatsnew/3.12.rst:1245 msgid "" "Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " "planned to be removed in 3.12 but it only got a proper :exc:" @@ -1734,31 +1750,31 @@ msgid "" "Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1242 +#: ../../whatsnew/3.12.rst:1251 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases using the C API (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:1246 +#: ../../whatsnew/3.12.rst:1255 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1248 +#: ../../whatsnew/3.12.rst:1257 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1251 +#: ../../whatsnew/3.12.rst:1260 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1253 +#: ../../whatsnew/3.12.rst:1262 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1255 +#: ../../whatsnew/3.12.rst:1264 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1770,42 +1786,42 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1266 ../../whatsnew/3.12.rst:2053 +#: ../../whatsnew/3.12.rst:1275 ../../whatsnew/3.12.rst:2062 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1268 +#: ../../whatsnew/3.12.rst:1277 msgid "" "``asynchat`` and ``asyncore``: These two modules have been removed according " "to the schedule in :pep:`594`, having been deprecated in Python 3.6. Use :" "mod:`asyncio` instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1283 msgid "" ":mod:`configparser`: Several names deprecated in the :mod:`configparser` way " "back in 3.2 have been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1277 +#: ../../whatsnew/3.12.rst:1286 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1279 +#: ../../whatsnew/3.12.rst:1288 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1281 +#: ../../whatsnew/3.12.rst:1290 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1284 +#: ../../whatsnew/3.12.rst:1293 msgid "" "``distutils``: Remove the ``distutils`` package. It was deprecated in Python " "3.10 by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -1814,13 +1830,13 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1290 +#: ../../whatsnew/3.12.rst:1299 msgid "" ":mod:`ensurepip`: Remove the bundled setuptools wheel from :mod:`ensurepip`, " "and stop installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1293 +#: ../../whatsnew/3.12.rst:1302 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1828,7 +1844,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1299 +#: ../../whatsnew/3.12.rst:1308 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1838,23 +1854,23 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1306 +#: ../../whatsnew/3.12.rst:1315 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1308 +#: ../../whatsnew/3.12.rst:1317 msgid "" ":mod:`enum`: Remove ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1312 +#: ../../whatsnew/3.12.rst:1321 msgid "" ":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1316 +#: ../../whatsnew/3.12.rst:1325 msgid "" ":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -1863,7 +1879,7 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1322 +#: ../../whatsnew/3.12.rst:1331 msgid "" ":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -1872,179 +1888,179 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1328 +#: ../../whatsnew/3.12.rst:1337 msgid "" ":mod:`importlib`: Many previously deprecated cleanups in :mod:`importlib` " "have now been completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1331 +#: ../../whatsnew/3.12.rst:1340 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1343 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1347 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1350 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1344 +#: ../../whatsnew/3.12.rst:1353 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1356 msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1359 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1359 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1352 +#: ../../whatsnew/3.12.rst:1361 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1352 +#: ../../whatsnew/3.12.rst:1361 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1353 +#: ../../whatsnew/3.12.rst:1362 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1353 +#: ../../whatsnew/3.12.rst:1362 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1354 +#: ../../whatsnew/3.12.rst:1363 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1354 +#: ../../whatsnew/3.12.rst:1363 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1355 +#: ../../whatsnew/3.12.rst:1364 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1355 +#: ../../whatsnew/3.12.rst:1364 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1365 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1365 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1357 +#: ../../whatsnew/3.12.rst:1366 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1357 +#: ../../whatsnew/3.12.rst:1366 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1367 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1367 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1359 +#: ../../whatsnew/3.12.rst:1368 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1359 +#: ../../whatsnew/3.12.rst:1368 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1360 +#: ../../whatsnew/3.12.rst:1369 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1360 +#: ../../whatsnew/3.12.rst:1369 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1370 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1370 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1373 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1379 +#: ../../whatsnew/3.12.rst:1388 msgid "Removed :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1390 msgid "undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1383 +#: ../../whatsnew/3.12.rst:1392 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1393 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1385 +#: ../../whatsnew/3.12.rst:1394 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1395 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1388 +#: ../../whatsnew/3.12.rst:1397 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1399 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1403 msgid "" ":mod:`io`: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2053,14 +2069,14 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1409 msgid "" ":mod:`locale`: Remove the :func:`!locale.format` function, deprecated in " "Python 3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1404 +#: ../../whatsnew/3.12.rst:1413 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2068,27 +2084,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1412 +#: ../../whatsnew/3.12.rst:1421 msgid "" ":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " "deprecated in Python 3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1415 +#: ../../whatsnew/3.12.rst:1424 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1416 +#: ../../whatsnew/3.12.rst:1425 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1418 +#: ../../whatsnew/3.12.rst:1427 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1421 +#: ../../whatsnew/3.12.rst:1430 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2096,22 +2112,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1435 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1437 msgid ":mod:`ssl`:" msgstr "" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1439 msgid "" "Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " "3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " "by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1443 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2119,7 +2135,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1449 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2130,174 +2146,174 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1458 msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1451 +#: ../../whatsnew/3.12.rst:1460 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1454 +#: ../../whatsnew/3.12.rst:1463 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.12.rst:1454 +#: ../../whatsnew/3.12.rst:1463 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.12.rst:1454 +#: ../../whatsnew/3.12.rst:1463 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1456 +#: ../../whatsnew/3.12.rst:1465 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1456 ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1465 ../../whatsnew/3.12.rst:1472 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1456 ../../whatsnew/3.12.rst:1457 -#: ../../whatsnew/3.12.rst:1458 ../../whatsnew/3.12.rst:1459 -#: ../../whatsnew/3.12.rst:1460 ../../whatsnew/3.12.rst:1461 -#: ../../whatsnew/3.12.rst:1462 +#: ../../whatsnew/3.12.rst:1465 ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1469 ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1471 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1457 +#: ../../whatsnew/3.12.rst:1466 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1457 +#: ../../whatsnew/3.12.rst:1466 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1458 +#: ../../whatsnew/3.12.rst:1467 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1458 ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:1473 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1459 +#: ../../whatsnew/3.12.rst:1468 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1459 ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1468 ../../whatsnew/3.12.rst:1474 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1460 +#: ../../whatsnew/3.12.rst:1469 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1460 ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1469 ../../whatsnew/3.12.rst:1475 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:1470 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1461 ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1470 ../../whatsnew/3.12.rst:1476 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1462 +#: ../../whatsnew/3.12.rst:1471 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1462 +#: ../../whatsnew/3.12.rst:1471 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1472 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1463 ../../whatsnew/3.12.rst:1464 -#: ../../whatsnew/3.12.rst:1465 ../../whatsnew/3.12.rst:1466 -#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:1468 -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1472 ../../whatsnew/3.12.rst:1473 +#: ../../whatsnew/3.12.rst:1474 ../../whatsnew/3.12.rst:1475 +#: ../../whatsnew/3.12.rst:1476 ../../whatsnew/3.12.rst:1477 +#: ../../whatsnew/3.12.rst:1478 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1473 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1474 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1475 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1476 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1477 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1477 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1478 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1478 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1479 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1479 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1479 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1473 +#: ../../whatsnew/3.12.rst:1482 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1476 +#: ../../whatsnew/3.12.rst:1485 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1479 +#: ../../whatsnew/3.12.rst:1488 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1483 +#: ../../whatsnew/3.12.rst:1492 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1486 +#: ../../whatsnew/3.12.rst:1495 msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1488 +#: ../../whatsnew/3.12.rst:1497 msgid "" ":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" "`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " @@ -2305,7 +2321,7 @@ msgid "" "`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1501 msgid "" ":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " "method of the pure Python implementation, deprecated in Python 3.10, use " @@ -2314,21 +2330,21 @@ msgid "" "(Contributed by Victor Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1498 +#: ../../whatsnew/3.12.rst:1507 msgid "" ":mod:`zipimport`: Remove ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1503 +#: ../../whatsnew/3.12.rst:1512 msgid "" "Removed the ``suspicious`` rule from the documentation Makefile, and removed " "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1508 +#: ../../whatsnew/3.12.rst:1517 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2338,21 +2354,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1519 ../../whatsnew/3.12.rst:1831 +#: ../../whatsnew/3.12.rst:1528 ../../whatsnew/3.12.rst:1840 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1530 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1525 +#: ../../whatsnew/3.12.rst:1534 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1527 +#: ../../whatsnew/3.12.rst:1536 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2361,7 +2377,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1534 +#: ../../whatsnew/3.12.rst:1543 msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -2373,7 +2389,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1542 +#: ../../whatsnew/3.12.rst:1551 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2383,21 +2399,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1548 +#: ../../whatsnew/3.12.rst:1557 msgid "" "Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1552 +#: ../../whatsnew/3.12.rst:1561 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1557 +#: ../../whatsnew/3.12.rst:1566 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2405,7 +2421,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1562 +#: ../../whatsnew/3.12.rst:1571 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2417,7 +2433,7 @@ msgid "" "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1580 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2429,14 +2445,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1593 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1598 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2448,45 +2464,45 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1600 +#: ../../whatsnew/3.12.rst:1609 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1612 +#: ../../whatsnew/3.12.rst:1621 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1615 +#: ../../whatsnew/3.12.rst:1624 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1618 +#: ../../whatsnew/3.12.rst:1627 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1621 +#: ../../whatsnew/3.12.rst:1630 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1633 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1628 +#: ../../whatsnew/3.12.rst:1637 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1630 +#: ../../whatsnew/3.12.rst:1639 msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2495,21 +2511,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1636 +#: ../../whatsnew/3.12.rst:1645 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1641 +#: ../../whatsnew/3.12.rst:1650 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1654 msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2518,46 +2534,46 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1651 +#: ../../whatsnew/3.12.rst:1660 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1653 +#: ../../whatsnew/3.12.rst:1662 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1654 +#: ../../whatsnew/3.12.rst:1663 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1655 +#: ../../whatsnew/3.12.rst:1664 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1657 +#: ../../whatsnew/3.12.rst:1666 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1659 +#: ../../whatsnew/3.12.rst:1668 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1661 +#: ../../whatsnew/3.12.rst:1670 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1665 +#: ../../whatsnew/3.12.rst:1674 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1669 +#: ../../whatsnew/3.12.rst:1678 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1675 +#: ../../whatsnew/3.12.rst:1684 msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2565,84 +2581,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1681 +#: ../../whatsnew/3.12.rst:1690 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1683 +#: ../../whatsnew/3.12.rst:1692 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1684 +#: ../../whatsnew/3.12.rst:1693 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1686 +#: ../../whatsnew/3.12.rst:1695 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1688 +#: ../../whatsnew/3.12.rst:1697 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1689 +#: ../../whatsnew/3.12.rst:1698 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1699 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1701 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1704 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1706 msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1700 +#: ../../whatsnew/3.12.rst:1709 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1711 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1713 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1707 +#: ../../whatsnew/3.12.rst:1716 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1710 +#: ../../whatsnew/3.12.rst:1719 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1721 msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -2650,29 +2666,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1717 +#: ../../whatsnew/3.12.rst:1726 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1721 +#: ../../whatsnew/3.12.rst:1730 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1722 +#: ../../whatsnew/3.12.rst:1731 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1723 +#: ../../whatsnew/3.12.rst:1732 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1733 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1726 +#: ../../whatsnew/3.12.rst:1735 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -2683,7 +2699,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1734 +#: ../../whatsnew/3.12.rst:1743 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2691,32 +2707,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1739 +#: ../../whatsnew/3.12.rst:1748 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1743 +#: ../../whatsnew/3.12.rst:1752 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1744 +#: ../../whatsnew/3.12.rst:1753 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1745 +#: ../../whatsnew/3.12.rst:1754 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr "" -#: ../../whatsnew/3.12.rst:1747 +#: ../../whatsnew/3.12.rst:1756 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1751 +#: ../../whatsnew/3.12.rst:1760 msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -2724,14 +2740,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1757 +#: ../../whatsnew/3.12.rst:1766 msgid "" "Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " "sets the vectorcall field of a given :c:type:`PyFunctionObject`. " "(Contributed by Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1761 +#: ../../whatsnew/3.12.rst:1770 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2740,28 +2756,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1767 +#: ../../whatsnew/3.12.rst:1776 msgid "" "Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1771 +#: ../../whatsnew/3.12.rst:1780 msgid "" "Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1776 +#: ../../whatsnew/3.12.rst:1785 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1780 +#: ../../whatsnew/3.12.rst:1789 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2771,14 +2787,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1788 +#: ../../whatsnew/3.12.rst:1797 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1792 +#: ../../whatsnew/3.12.rst:1801 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2786,71 +2802,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1797 +#: ../../whatsnew/3.12.rst:1806 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1801 +#: ../../whatsnew/3.12.rst:1810 msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1804 +#: ../../whatsnew/3.12.rst:1813 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1805 +#: ../../whatsnew/3.12.rst:1814 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1806 +#: ../../whatsnew/3.12.rst:1815 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1807 +#: ../../whatsnew/3.12.rst:1816 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1808 +#: ../../whatsnew/3.12.rst:1817 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1809 +#: ../../whatsnew/3.12.rst:1818 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1810 +#: ../../whatsnew/3.12.rst:1819 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1811 +#: ../../whatsnew/3.12.rst:1820 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1812 +#: ../../whatsnew/3.12.rst:1821 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1815 +#: ../../whatsnew/3.12.rst:1824 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1814 +#: ../../whatsnew/3.12.rst:1823 msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1817 +#: ../../whatsnew/3.12.rst:1826 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1819 +#: ../../whatsnew/3.12.rst:1828 msgid "" ":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " "and :c:type:`PyInterpreterConfig`, which may be used to create sub-" @@ -2858,27 +2874,27 @@ msgid "" "info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1825 +#: ../../whatsnew/3.12.rst:1834 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1833 +#: ../../whatsnew/3.12.rst:1842 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1836 +#: ../../whatsnew/3.12.rst:1845 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1840 +#: ../../whatsnew/3.12.rst:1849 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2887,7 +2903,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1847 +#: ../../whatsnew/3.12.rst:1856 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -2895,13 +2911,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1852 +#: ../../whatsnew/3.12.rst:1861 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1856 +#: ../../whatsnew/3.12.rst:1865 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -2910,7 +2926,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1862 +#: ../../whatsnew/3.12.rst:1871 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2919,13 +2935,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1868 +#: ../../whatsnew/3.12.rst:1877 msgid "" "Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1872 +#: ../../whatsnew/3.12.rst:1881 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -2939,7 +2955,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1884 +#: ../../whatsnew/3.12.rst:1893 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -2947,7 +2963,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1889 +#: ../../whatsnew/3.12.rst:1898 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -2955,7 +2971,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1894 +#: ../../whatsnew/3.12.rst:1903 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -2963,7 +2979,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1899 +#: ../../whatsnew/3.12.rst:1908 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -2971,25 +2987,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1904 +#: ../../whatsnew/3.12.rst:1913 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1907 +#: ../../whatsnew/3.12.rst:1916 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1908 +#: ../../whatsnew/3.12.rst:1917 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1909 +#: ../../whatsnew/3.12.rst:1918 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1911 +#: ../../whatsnew/3.12.rst:1920 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -2997,14 +3013,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1916 +#: ../../whatsnew/3.12.rst:1925 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:1920 +#: ../../whatsnew/3.12.rst:1929 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -3013,17 +3029,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1927 +#: ../../whatsnew/3.12.rst:1936 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1929 +#: ../../whatsnew/3.12.rst:1938 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1931 +#: ../../whatsnew/3.12.rst:1940 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3031,20 +3047,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:1936 +#: ../../whatsnew/3.12.rst:1945 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:1940 +#: ../../whatsnew/3.12.rst:1949 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:1952 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3052,14 +3068,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:1948 +#: ../../whatsnew/3.12.rst:1957 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:1952 +#: ../../whatsnew/3.12.rst:1961 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3070,15 +3086,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:1969 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:1970 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1972 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3087,281 +3103,281 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:1973 +#: ../../whatsnew/3.12.rst:1982 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:1984 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:1985 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:1977 +#: ../../whatsnew/3.12.rst:1986 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:1987 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:1979 +#: ../../whatsnew/3.12.rst:1988 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:1980 +#: ../../whatsnew/3.12.rst:1989 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:1981 +#: ../../whatsnew/3.12.rst:1990 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:1982 +#: ../../whatsnew/3.12.rst:1991 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:1983 +#: ../../whatsnew/3.12.rst:1992 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:1984 +#: ../../whatsnew/3.12.rst:1993 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:1994 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:1986 +#: ../../whatsnew/3.12.rst:1995 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:1987 +#: ../../whatsnew/3.12.rst:1996 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1988 +#: ../../whatsnew/3.12.rst:1997 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:1990 +#: ../../whatsnew/3.12.rst:1999 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:1991 +#: ../../whatsnew/3.12.rst:2000 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1992 +#: ../../whatsnew/3.12.rst:2001 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1993 +#: ../../whatsnew/3.12.rst:2002 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1994 +#: ../../whatsnew/3.12.rst:2003 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1995 +#: ../../whatsnew/3.12.rst:2004 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:1996 +#: ../../whatsnew/3.12.rst:2005 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:1998 +#: ../../whatsnew/3.12.rst:2007 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2002 +#: ../../whatsnew/3.12.rst:2011 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:2005 +#: ../../whatsnew/3.12.rst:2014 msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:2008 +#: ../../whatsnew/3.12.rst:2017 msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2011 +#: ../../whatsnew/3.12.rst:2020 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" -#: ../../whatsnew/3.12.rst:2013 +#: ../../whatsnew/3.12.rst:2022 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2015 +#: ../../whatsnew/3.12.rst:2024 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:2018 +#: ../../whatsnew/3.12.rst:2027 msgid "Several items are not exposed from ``Python.h``:" msgstr "" -#: ../../whatsnew/3.12.rst:2020 +#: ../../whatsnew/3.12.rst:2029 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:2021 +#: ../../whatsnew/3.12.rst:2030 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:2022 +#: ../../whatsnew/3.12.rst:2031 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:2023 +#: ../../whatsnew/3.12.rst:2032 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:2025 +#: ../../whatsnew/3.12.rst:2034 msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2028 +#: ../../whatsnew/3.12.rst:2037 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2033 +#: ../../whatsnew/3.12.rst:2042 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2036 +#: ../../whatsnew/3.12.rst:2045 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2041 +#: ../../whatsnew/3.12.rst:2050 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2044 +#: ../../whatsnew/3.12.rst:2053 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2047 +#: ../../whatsnew/3.12.rst:2056 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2064 msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``token.h`` header file was only designed to be used by Python " "internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2060 +#: ../../whatsnew/3.12.rst:2069 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2062 +#: ../../whatsnew/3.12.rst:2071 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2063 +#: ../../whatsnew/3.12.rst:2072 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2064 +#: ../../whatsnew/3.12.rst:2073 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2065 +#: ../../whatsnew/3.12.rst:2074 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2066 +#: ../../whatsnew/3.12.rst:2075 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2067 +#: ../../whatsnew/3.12.rst:2076 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2068 +#: ../../whatsnew/3.12.rst:2077 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2069 +#: ../../whatsnew/3.12.rst:2078 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2070 +#: ../../whatsnew/3.12.rst:2079 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2072 +#: ../../whatsnew/3.12.rst:2081 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2075 +#: ../../whatsnew/3.12.rst:2084 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2078 +#: ../../whatsnew/3.12.rst:2087 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" From ec2ea2d20fdf54fb29c5555c601db1a602785977 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 Sep 2023 00:05:40 +0000 Subject: [PATCH 14/18] sync with cpython af83d1e8 --- library/typing.po | 1429 ++++++++++++++++++++++++++++----------------- 1 file changed, 882 insertions(+), 547 deletions(-) diff --git a/library/typing.po b/library/typing.po index 3d666e2c27..bfd82481d6 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-27 00:19+0000\n" +"POT-Creation-Date: 2023-09-11 00:03+0000\n" "PO-Revision-Date: 2023-09-05 14:49+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,8 +42,8 @@ msgid "" "specification of the typing system, see :pep:`484`. For a simplified " "introduction to type hints, see :pep:`483`." msgstr "" -"這個模組提供可以支援型別提示的 runtime。關於加註型別系統的原有規格" -",請看 :pep:`484`。關於型別提示的簡易介紹,請看 :pep:`483`。" +"這個模組提供可以支援型別提示的 runtime。關於加註型別系統的原有規格,請看 :" +"pep:`484`。關於型別提示的簡易介紹,請看 :pep:`483`。" #: ../../library/typing.rst:31 msgid "" @@ -103,8 +103,8 @@ msgid "" "broadly apply to most Python type checkers. (Some parts may still be " "specific to mypy.)" msgstr "" -"Python 的加註型別系統是基於 PEPs 進行標準化,所以這個參照 (reference) " -"應該在多數 Python 型別檢查器中廣為使用。(某些部分依然是特定給 mypy 使用。)" +"Python 的加註型別系統是基於 PEPs 進行標準化,所以這個參照 (reference) 應該在" +"多數 Python 型別檢查器中廣為使用。(某些部分依然是特定給 mypy 使用。)" #: ../../library/typing.rst:59 msgid "" @@ -437,11 +437,11 @@ msgid "" "Python 3.9." msgstr "" -#: ../../library/typing.rst:249 -msgid "Callable" +#: ../../library/typing.rst:264 +msgid "Annotating callable objects" msgstr "" -#: ../../library/typing.rst:251 +#: ../../library/typing.rst:266 msgid "" "Functions -- or other :term:`callable` objects -- can be annotated using :" "class:`collections.abc.Callable` or :data:`typing.Callable`. " @@ -449,11 +449,12 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:254 ../../library/typing.rst:2679 +#: ../../library/typing.rst:271 ../../library/typing.rst:2873 +#: ../../library/typing.rst:3015 msgid "For example:" msgstr "舉例來說:" -#: ../../library/typing.rst:272 ../../library/typing.rst:995 +#: ../../library/typing.rst:289 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " @@ -461,7 +462,22 @@ msgid "" "type must be a single type." msgstr "" -#: ../../library/typing.rst:276 ../../library/typing.rst:1008 +#: ../../library/typing.rst:294 +msgid "" +"If a literal ellipsis ``...`` is given as the argument list, it indicates " +"that a callable with any arbitrary parameter list would be acceptable:" +msgstr "" + +#: ../../library/typing.rst:306 +msgid "" +"``Callable`` cannot express complex signatures such as functions that take a " +"variadic number of arguments, :func:`overloaded functions `, or " +"functions that have keyword-only parameters. However, these signatures can " +"be expressed by defining a :class:`Protocol` class with a :meth:`~object." +"__call__` method:" +msgstr "" + +#: ../../library/typing.rst:333 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -472,46 +488,54 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:284 ../../library/typing.rst:1020 +#: ../../library/typing.rst:341 ../../library/typing.rst:3544 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:289 +#: ../../library/typing.rst:346 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:295 +#: ../../library/typing.rst:352 msgid "Generics" msgstr "" -#: ../../library/typing.rst:297 +#: ../../library/typing.rst:354 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, many container classes in the standard library " "support subscription to denote the expected types of container elements." msgstr "" -#: ../../library/typing.rst:314 +#: ../../library/typing.rst:371 msgid "" "Generic functions and classes can be parameterized by using :ref:`type " "parameter syntax `::" msgstr "" -#: ../../library/typing.rst:330 +#: ../../library/typing.rst:379 +msgid "Or by using the :class:`TypeVar` factory directly::" +msgstr "" + +#: ../../library/typing.rst:389 +msgid "Syntactic support for generics is new in Python 3.12." +msgstr "" + +#: ../../library/typing.rst:395 msgid "Annotating tuples" msgstr "" -#: ../../library/typing.rst:332 +#: ../../library/typing.rst:397 msgid "" "For most containers in Python, the typing system assumes that all elements " "in the container will be of the same type. For example::" msgstr "" -#: ../../library/typing.rst:347 +#: ../../library/typing.rst:412 msgid "" ":class:`list` only accepts one type argument, so a type checker would emit " "an error on the ``y`` assignment above. Similarly, :class:`~collections.abc." @@ -519,7 +543,7 @@ msgid "" "the keys, and the second indicates the type of the values." msgstr "" -#: ../../library/typing.rst:353 +#: ../../library/typing.rst:418 msgid "" "Unlike most other Python containers, however, it is common in idiomatic " "Python code for tuples to have elements which are not all of the same type. " @@ -527,7 +551,7 @@ msgid "" "`tuple` accepts *any number* of type arguments::" msgstr "" -#: ../../library/typing.rst:369 +#: ../../library/typing.rst:434 msgid "" "To denote a tuple which could be of *any* length, and in which all elements " "are of the same type ``T``, use ``tuple[T, ...]``. To denote an empty tuple, " @@ -535,11 +559,11 @@ msgid "" "using ``tuple[Any, ...]``::" msgstr "" -#: ../../library/typing.rst:392 +#: ../../library/typing.rst:457 msgid "The type of class objects" msgstr "" -#: ../../library/typing.rst:394 +#: ../../library/typing.rst:459 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``type[C]`` (or :class:`typing.Type[C] " @@ -547,85 +571,107 @@ msgid "" "will accept the *class object* of ``C``. For example::" msgstr "" -#: ../../library/typing.rst:404 +#: ../../library/typing.rst:469 msgid "Note that ``type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:420 +#: ../../library/typing.rst:485 msgid "" "The only legal parameters for :class:`type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:432 +#: ../../library/typing.rst:497 msgid "" "``type[Any]`` is equivalent to :class:`type`, which is the root of Python's :" "ref:`metaclass hierarchy `." msgstr "" -#: ../../library/typing.rst:438 +#: ../../library/typing.rst:503 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:440 +#: ../../library/typing.rst:505 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:466 +#: ../../library/typing.rst:528 msgid "" "This syntax indicates that the class ``LoggedVar`` is parameterised around a " "single :class:`type variable ` ``T`` . This also makes ``T`` valid " "as a type within the class body." msgstr "" -#: ../../library/typing.rst:470 +#: ../../library/typing.rst:532 msgid "" "Generic classes implicitly inherit from :class:`Generic`. For compatibility " "with Python 3.11 and lower, it is also possible to inherit explicitly from :" "class:`Generic` to indicate a generic class::" msgstr "" -#: ../../library/typing.rst:479 +#: ../../library/typing.rst:543 +msgid "" +"Generic classes have :meth:`~object.__class_getitem__` methods, meaning they " +"can be parameterised at runtime (e.g. ``LoggedVar[int]`` below)::" +msgstr "" + +#: ../../library/typing.rst:552 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:491 +#: ../../library/typing.rst:567 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:502 -msgid "You can use multiple inheritance with :class:`Generic`::" +#: ../../library/typing.rst:581 +msgid "Generic classes can also inherit from other classes::" msgstr "" -#: ../../library/typing.rst:512 +#: ../../library/typing.rst:588 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:522 +#: ../../library/typing.rst:595 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:524 +#: ../../library/typing.rst:597 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``:" msgstr "" -#: ../../library/typing.rst:535 +#: ../../library/typing.rst:608 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:552 +#: ../../library/typing.rst:623 +#, fuzzy +msgid "" +"For backward compatibility, generic type aliases can also be created through " +"a simple assignment::" +msgstr "" +":keyword:`type` 陳述式是 Python 3.12 的新功能。為了向後相容性,型別別名可以透" +"過簡單的賦值來建立: ::" + +#: ../../library/typing.rst:632 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:555 +#: ../../library/typing.rst:635 +msgid "" +"Syntactic support for generics and type aliases is new in version 3.12. " +"Previously, generic classes had to explicitly inherit from :class:`Generic` " +"or contain a type variable in one of their bases." +msgstr "" + +#: ../../library/typing.rst:640 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``[**P]``. The behavior is " @@ -635,26 +681,35 @@ msgid "" "a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:571 +#: ../../library/typing.rst:651 msgid "" "Classes generic over a :class:`ParamSpec` can also be created using explicit " "inheritance from :class:`Generic`. In this case, ``**`` is not used::" msgstr "" -#: ../../library/typing.rst:583 +#: ../../library/typing.rst:661 +msgid "" +"Another difference between :class:`TypeVar` and :class:`ParamSpec` is that a " +"generic with only one parameter specification variable will accept parameter " +"lists in the forms ``X[[Type1, Type2, ...]]`` and also ``X[Type1, " +"Type2, ...]`` for aesthetic reasons. Internally, the latter is converted to " +"the former, so the following are equivalent::" +msgstr "" + +#: ../../library/typing.rst:674 msgid "" "Note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:587 +#: ../../library/typing.rst:678 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:591 +#: ../../library/typing.rst:682 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -662,24 +717,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:598 +#: ../../library/typing.rst:689 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:600 +#: ../../library/typing.rst:691 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:604 +#: ../../library/typing.rst:695 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:622 +#: ../../library/typing.rst:713 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -688,19 +743,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:628 +#: ../../library/typing.rst:719 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:641 +#: ../../library/typing.rst:732 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:644 +#: ../../library/typing.rst:735 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -708,7 +763,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:649 +#: ../../library/typing.rst:740 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -716,24 +771,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:671 +#: ../../library/typing.rst:762 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:676 +#: ../../library/typing.rst:767 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:678 +#: ../../library/typing.rst:769 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:682 +#: ../../library/typing.rst:773 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -742,7 +797,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:695 +#: ../../library/typing.rst:786 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -751,85 +806,92 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:711 +#: ../../library/typing.rst:802 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:716 +#: ../../library/typing.rst:807 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:718 +#: ../../library/typing.rst:809 msgid "" "The ``typing`` module defines the following classes, functions and " "decorators." msgstr "" -#: ../../library/typing.rst:721 +#: ../../library/typing.rst:812 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:724 +#: ../../library/typing.rst:815 msgid "Special types" msgstr "" -#: ../../library/typing.rst:726 +#: ../../library/typing.rst:817 msgid "" "These can be used as types in annotations. They do not support subscription " "using ``[]``." msgstr "" -#: ../../library/typing.rst:731 +#: ../../library/typing.rst:822 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:733 +#: ../../library/typing.rst:824 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:734 +#: ../../library/typing.rst:825 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:736 +#: ../../library/typing.rst:827 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:743 +#: ../../library/typing.rst:834 msgid "A :ref:`constrained type variable `." msgstr "" -#: ../../library/typing.rst:745 +#: ../../library/typing.rst:836 msgid "Definition::" msgstr "" -#: ../../library/typing.rst:749 +#: ../../library/typing.rst:840 msgid "" "``AnyStr`` is meant to be used for functions that may accept :class:`str` " "or :class:`bytes` arguments but cannot allow the two to mix." msgstr "" -#: ../../library/typing.rst:752 ../../library/typing.rst:828 -#: ../../library/typing.rst:848 ../../library/typing.rst:894 -#: ../../library/typing.rst:1092 ../../library/typing.rst:1149 -#: ../../library/typing.rst:1357 ../../library/typing.rst:2519 +#: ../../library/typing.rst:843 ../../library/typing.rst:934 +#: ../../library/typing.rst:954 ../../library/typing.rst:1011 +#: ../../library/typing.rst:1180 ../../library/typing.rst:1237 +#: ../../library/typing.rst:1446 ../../library/typing.rst:2813 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:763 +#: ../../library/typing.rst:852 +msgid "" +"Note that, despite its name, ``AnyStr`` has nothing to do with the :class:" +"`Any` type, nor does it mean \"any string\". In particular, ``AnyStr`` and " +"``str | bytes`` are different from each other and have different use cases::" +msgstr "" + +#: ../../library/typing.rst:869 msgid "Special type that includes only literal strings." msgstr "" -#: ../../library/typing.rst:765 +#: ../../library/typing.rst:871 msgid "" "Any string literal is compatible with ``LiteralString``, as is another " "``LiteralString``. However, an object typed as just ``str`` is not. A string " @@ -837,14 +899,14 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:771 +#: ../../library/typing.rst:877 ../../library/typing.rst:1957 msgid "Example:" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:787 +#: ../../library/typing.rst:893 msgid "" "``LiteralString`` is useful for sensitive APIs where arbitrary user-" "generated strings could generate problems. For example, the two cases above " @@ -852,33 +914,33 @@ msgid "" "attack." msgstr "" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:898 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:798 +#: ../../library/typing.rst:904 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:801 +#: ../../library/typing.rst:907 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:821 +#: ../../library/typing.rst:927 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:826 +#: ../../library/typing.rst:932 msgid "Special type indicating that a function never returns." msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:941 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -886,126 +948,142 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:846 +#: ../../library/typing.rst:952 msgid "Special type to represent the current enclosed class." msgstr "" -#: ../../library/typing.rst:858 +#: ../../library/typing.rst:968 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:870 -msgid "In general if something currently follows the pattern of::" -msgstr "" - -#: ../../library/typing.rst:877 +#: ../../library/typing.rst:980 msgid "" -"You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " -"have ``Foo`` as the return type and not ``SubclassOfFoo``." +"In general, if something returns ``self``, as in the above examples, you " +"should use ``Self`` as the return annotation. If ``Foo.return_self`` was " +"annotated as returning ``\"Foo\"``, then the type checker would infer the " +"object returned from ``SubclassOfFoo.return_self`` as being of type ``Foo`` " +"rather than ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:880 +#: ../../library/typing.rst:986 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:882 +#: ../../library/typing.rst:988 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:884 +#: ../../library/typing.rst:990 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:886 +#: ../../library/typing.rst:992 +msgid "" +"You should not use ``Self`` as the return annotation if the method is not " +"guaranteed to return an instance of a subclass when the class is subclassed::" +msgstr "" + +#: ../../library/typing.rst:1003 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:892 +#: ../../library/typing.rst:1009 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: ../../library/typing.rst:900 +#: ../../library/typing.rst:1017 msgid "" "``TypeAlias`` is particularly useful on older Python versions for annotating " "aliases that make use of forward references, as it can be hard for type " "checkers to distinguish these from normal variable assignments:" msgstr "" -#: ../../library/typing.rst:920 +#: ../../library/typing.rst:1037 msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`613`。" -#: ../../library/typing.rst:925 +#: ../../library/typing.rst:1041 +msgid "" +":data:`TypeAlias` is deprecated in favor of the :keyword:`type` statement, " +"which creates instances of :class:`TypeAliasType` and which natively " +"supports forward references. Note that while :data:`TypeAlias` and :class:" +"`TypeAliasType` serve similar purposes and have similar names, they are " +"distinct and the latter is not the type of the former. Removal of :data:" +"`TypeAlias` is not currently planned, but users are encouraged to migrate " +"to :keyword:`type` statements." +msgstr "" + +#: ../../library/typing.rst:1052 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:927 +#: ../../library/typing.rst:1054 msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." msgstr "" -#: ../../library/typing.rst:932 +#: ../../library/typing.rst:1059 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:934 +#: ../../library/typing.rst:1061 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:936 +#: ../../library/typing.rst:1063 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:938 +#: ../../library/typing.rst:1065 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:942 +#: ../../library/typing.rst:1069 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:946 +#: ../../library/typing.rst:1073 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:950 +#: ../../library/typing.rst:1077 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:954 +#: ../../library/typing.rst:1081 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:956 +#: ../../library/typing.rst:1083 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:958 +#: ../../library/typing.rst:1085 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:961 +#: ../../library/typing.rst:1088 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:967 +#: ../../library/typing.rst:1094 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:969 +#: ../../library/typing.rst:1096 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -1013,56 +1091,24 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:977 +#: ../../library/typing.rst:1104 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:984 +#: ../../library/typing.rst:1111 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:990 -msgid "Deprecated alias to :class:`collections.abc.Callable`." -msgstr "" - -#: ../../library/typing.rst:992 -msgid "" -"``Callable[[int], str]`` signifies a function that takes a single parameter " -"of type :class:`int` and returns a :class:`str`." -msgstr "" - -#: ../../library/typing.rst:1000 -msgid "" -"There is no syntax to indicate optional or keyword arguments; such function " -"types are rarely used as callback types. ``Callable[..., ReturnType]`` " -"(literal ellipsis) can be used to type hint a callable taking any number of " -"arguments and returning ``ReturnType``. A plain :data:`Callable` is " -"equivalent to ``Callable[..., Any]``, and in turn to :class:`collections.abc." -"Callable`." -msgstr "" - -#: ../../library/typing.rst:1016 -msgid "" -":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1025 -msgid "" -"The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " -"examples of usage with ``Callable``." -msgstr "" - -#: ../../library/typing.rst:1030 +#: ../../library/typing.rst:1117 msgid "Special form for annotating higher-order functions." msgstr "" -#: ../../library/typing.rst:1032 +#: ../../library/typing.rst:1119 msgid "" "``Concatenate`` can be used in conjunction with :ref:`Callable ` and :class:`ParamSpec` to annotate a higher-order callable which " @@ -1073,7 +1119,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:1041 +#: ../../library/typing.rst:1128 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -1084,34 +1130,39 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1080 ../../library/typing.rst:1736 +#: ../../library/typing.rst:1167 ../../library/typing.rst:1925 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" msgstr "" -#: ../../library/typing.rst:1082 -msgid ":class:`ParamSpec` and :class:`Callable`." +#: ../../library/typing.rst:1169 +#, fuzzy +msgid ":class:`ParamSpec`" msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:1086 +#: ../../library/typing.rst:1170 ../../library/typing.rst:1928 +msgid ":ref:`annotating-callables`" +msgstr "" + +#: ../../library/typing.rst:1174 msgid "Special typing form to define \"literal types\"." msgstr "" -#: ../../library/typing.rst:1088 +#: ../../library/typing.rst:1176 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" -#: ../../library/typing.rst:1104 +#: ../../library/typing.rst:1192 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:1110 +#: ../../library/typing.rst:1198 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1119,22 +1170,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1118 +#: ../../library/typing.rst:1206 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1120 +#: ../../library/typing.rst:1208 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1128 +#: ../../library/typing.rst:1216 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1130 +#: ../../library/typing.rst:1218 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1142,27 +1193,27 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1144 +#: ../../library/typing.rst:1232 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: ../../library/typing.rst:1146 +#: ../../library/typing.rst:1234 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1160 ../../library/typing.rst:2535 +#: ../../library/typing.rst:1248 ../../library/typing.rst:2829 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1167 +#: ../../library/typing.rst:1255 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: ../../library/typing.rst:1169 +#: ../../library/typing.rst:1257 msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." @@ -1170,21 +1221,21 @@ msgstr "" "主要用於 ``total=False`` 的 TypedDict。更多細節請見 :class:`TypedDict` 與 :" "pep:`655`。" -#: ../../library/typing.rst:1176 +#: ../../library/typing.rst:1264 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: ../../library/typing.rst:1179 +#: ../../library/typing.rst:1267 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1185 +#: ../../library/typing.rst:1273 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1187 +#: ../../library/typing.rst:1275 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1192,7 +1243,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1192 +#: ../../library/typing.rst:1280 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1201,7 +1252,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1198 +#: ../../library/typing.rst:1286 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1211,7 +1262,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1205 +#: ../../library/typing.rst:1293 msgid "" "The responsibility of how to interpret the metadata lies with the the tool " "or library encountering an ``Annotated`` annotation. A tool or library " @@ -1219,108 +1270,108 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1213 +#: ../../library/typing.rst:1301 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1226 +#: ../../library/typing.rst:1314 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1228 +#: ../../library/typing.rst:1316 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1230 +#: ../../library/typing.rst:1318 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1239 +#: ../../library/typing.rst:1327 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1243 +#: ../../library/typing.rst:1331 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1246 +#: ../../library/typing.rst:1334 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1253 +#: ../../library/typing.rst:1341 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1260 +#: ../../library/typing.rst:1348 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1266 +#: ../../library/typing.rst:1354 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1279 +#: ../../library/typing.rst:1368 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1283 +#: ../../library/typing.rst:1372 msgid "This would be equivalent to::" msgstr "" "這會等價於:\n" "\n" "::" -#: ../../library/typing.rst:1287 +#: ../../library/typing.rst:1376 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1290 +#: ../../library/typing.rst:1379 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1303 +#: ../../library/typing.rst:1392 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1317 +#: ../../library/typing.rst:1406 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1318 +#: ../../library/typing.rst:1407 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1325 +#: ../../library/typing.rst:1414 msgid "Special typing construct for marking user-defined type guard functions." msgstr "" -#: ../../library/typing.rst:1327 +#: ../../library/typing.rst:1416 msgid "" "``TypeGuard`` can be used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1331 +#: ../../library/typing.rst:1420 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1329,44 +1380,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1346 +#: ../../library/typing.rst:1435 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1350 +#: ../../library/typing.rst:1439 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1353 +#: ../../library/typing.rst:1442 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1354 +#: ../../library/typing.rst:1443 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1371 +#: ../../library/typing.rst:1460 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1375 +#: ../../library/typing.rst:1464 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1381 +#: ../../library/typing.rst:1470 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1375,24 +1426,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1387 +#: ../../library/typing.rst:1476 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1394 +#: ../../library/typing.rst:1483 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1396 +#: ../../library/typing.rst:1485 msgid "" "For example, using the unpack operator ``*`` on a :class:`type variable " "tuple ` is equivalent to using ``Unpack`` to mark the type " "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1405 +#: ../../library/typing.rst:1494 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1400,42 +1451,93 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1422 -msgid "Building generic types" +#: ../../library/typing.rst:1508 +msgid "" +"``Unpack`` can also be used along with :class:`typing.TypedDict` for typing " +"``**kwargs`` in a function signature::" msgstr "" -#: ../../library/typing.rst:1424 +#: ../../library/typing.rst:1521 +#, fuzzy +msgid "" +"See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing." +msgstr ":pep:`692`:為更精準的 ``**kwargs`` 型別使用 ``TypedDict``" + +#: ../../library/typing.rst:1526 +msgid "Building generic types and type aliases" +msgstr "" + +#: ../../library/typing.rst:1528 msgid "" "The following classes should not be used directly as annotations. Their " "intended purpose is to be building blocks for creating generic types and " "type aliases." msgstr "" -#: ../../library/typing.rst:1430 +#: ../../library/typing.rst:1532 +msgid "" +"These objects can be created through special syntax (:ref:`type parameter " +"lists ` and the :keyword:`type` statement). For compatibility " +"with Python 3.11 and earlier, they can also be created without the dedicated " +"syntax, as documented below." +msgstr "" + +#: ../../library/typing.rst:1539 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1432 +#: ../../library/typing.rst:1541 msgid "" "A generic type is typically declared by adding a list of type parameters " "after the class name::" msgstr "" -#: ../../library/typing.rst:1441 +#: ../../library/typing.rst:1549 +msgid "" +"Such a class implicitly inherits from ``Generic``. The runtime semantics of " +"this syntax are discussed in the :ref:`Language Reference `." +msgstr "" + +#: ../../library/typing.rst:1553 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1454 +#: ../../library/typing.rst:1561 +msgid "" +"Here the brackets after the function name indicate a :ref:`generic function " +"`." +msgstr "" + +#: ../../library/typing.rst:1564 +msgid "" +"For backwards compatibility, generic classes can also be declared by " +"explicitly inheriting from ``Generic``. In this case, the type parameters " +"must be declared separately::" +msgstr "" + +#: ../../library/typing.rst:1579 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1456 ../../library/typing.rst:1551 -#: ../../library/typing.rst:1661 ../../library/typing.rst:1774 -#: ../../library/typing.rst:1845 ../../library/typing.rst:2719 -msgid "Usage::" +#: ../../library/typing.rst:1581 +msgid "" +"The preferred way to construct a type variable is via the dedicated syntax " +"for :ref:`generic functions `, :ref:`generic classes " +"`, and :ref:`generic type aliases `::" +msgstr "" + +#: ../../library/typing.rst:1589 +msgid "" +"This syntax can also be used to create bound and constrained type variables::" +msgstr "" + +#: ../../library/typing.rst:1599 +msgid "" +"However, if desired, reusable type variables can also be constructed " +"manually, like so::" msgstr "" -#: ../../library/typing.rst:1462 +#: ../../library/typing.rst:1605 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1443,13 +1545,13 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1483 +#: ../../library/typing.rst:1626 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1486 +#: ../../library/typing.rst:1629 msgid "" "The variance of type variables is inferred by type checkers when they are " "created through the :ref:`type parameter syntax ` or when " @@ -1459,56 +1561,92 @@ msgid "" "invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1490 +#: ../../library/typing.rst:1637 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1505 +#: ../../library/typing.rst:1652 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1513 +#: ../../library/typing.rst:1664 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1524 +#: ../../library/typing.rst:1675 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1528 +#: ../../library/typing.rst:1679 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1532 -msgid "Whether the type var has been marked as covariant." +#: ../../library/typing.rst:1683 +msgid "Whether the type var has been explicitly marked as covariant." msgstr "" -#: ../../library/typing.rst:1536 -msgid "Whether the type var has been marked as contravariant." +#: ../../library/typing.rst:1687 +msgid "Whether the type var has been explicitly marked as contravariant." msgstr "" -#: ../../library/typing.rst:1540 +#: ../../library/typing.rst:1691 +msgid "" +"Whether the type variable's variance should be inferred by type checkers." +msgstr "" + +#: ../../library/typing.rst:1697 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1544 +#: ../../library/typing.rst:1701 +msgid "" +"For type variables created through :ref:`type parameter syntax `, the bound is evaluated only when the attribute is accessed, not " +"when the type variable is created (see :ref:`lazy-evaluation`)." +msgstr "" + +#: ../../library/typing.rst:1707 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1548 +#: ../../library/typing.rst:1711 +msgid "" +"For type variables created through :ref:`type parameter syntax `, the constraints are evaluated only when the attribute is accessed, " +"not when the type variable is created (see :ref:`lazy-evaluation`)." +msgstr "" + +#: ../../library/typing.rst:1717 +msgid "" +"Type variables can now be declared using the :ref:`type parameter ` syntax introduced by :pep:`695`. The ``infer_variance`` parameter " +"was added." +msgstr "" + +#: ../../library/typing.rst:1723 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1559 +#: ../../library/typing.rst:1726 +msgid "" +"Type variable tuples can be declared in :ref:`type parameter lists ` using a single asterisk (``*``) before the name::" +msgstr "" + +#: ../../library/typing.rst:1732 +msgid "Or by explicitly invoking the ``TypeVarTuple`` constructor::" +msgstr "" + +#: ../../library/typing.rst:1740 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1516,7 +1654,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1762 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1526,36 +1664,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1589 +#: ../../library/typing.rst:1770 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1596 +#: ../../library/typing.rst:1777 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1605 +#: ../../library/typing.rst:1785 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1624 +#: ../../library/typing.rst:1801 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1631 +#: ../../library/typing.rst:1808 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1641 +#: ../../library/typing.rst:1818 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1564,21 +1702,39 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1648 +#: ../../library/typing.rst:1825 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1652 +#: ../../library/typing.rst:1829 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1658 +#: ../../library/typing.rst:1835 +msgid "" +"Type variable tuples can now be declared using the :ref:`type parameter " +"` syntax introduced by :pep:`695`." +msgstr "" + +#: ../../library/typing.rst:1840 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1665 +#: ../../library/typing.rst:1843 +msgid "" +"In :ref:`type parameter lists `, parameter specifications can " +"be declared with two asterisks (``**``)::" +msgstr "" + +#: ../../library/typing.rst:1848 +msgid "" +"For compatibility with Python 3.11 and earlier, ``ParamSpec`` objects can " +"also be created as follows::" +msgstr "" + +#: ../../library/typing.rst:1853 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1588,7 +1744,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1860 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1596,27 +1752,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1696 +#: ../../library/typing.rst:1880 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1700 +#: ../../library/typing.rst:1884 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1702 +#: ../../library/typing.rst:1886 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1709 +#: ../../library/typing.rst:1893 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1629,11 +1785,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1721 +#: ../../library/typing.rst:1905 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1907 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1642,17 +1798,23 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1732 +#: ../../library/typing.rst:1917 +msgid "" +"Parameter specifications can now be declared using the :ref:`type parameter " +"` syntax introduced by :pep:`695`." +msgstr "" + +#: ../../library/typing.rst:1921 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1738 -msgid ":class:`Callable` and :class:`Concatenate`." -msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" +#: ../../library/typing.rst:1927 +msgid ":data:`Concatenate`" +msgstr "" -#: ../../library/typing.rst:1743 +#: ../../library/typing.rst:1933 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1660,45 +1822,75 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1748 +#: ../../library/typing.rst:1938 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1764 +#: ../../library/typing.rst:1955 +msgid "The type of type aliases created through the :keyword:`type` statement." +msgstr "" + +#: ../../library/typing.rst:1969 +msgid "The name of the type alias:" +msgstr "" + +#: ../../library/typing.rst:1979 +msgid "The module in which the type alias was defined::" +msgstr "" + +#: ../../library/typing.rst:1987 +msgid "" +"The type parameters of the type alias, or an empty tuple if the alias is not " +"generic:" +msgstr "" + +#: ../../library/typing.rst:2001 +msgid "" +"The type alias's value. This is :ref:`lazily evaluated `, " +"so names used in the definition of the alias are not resolved until the " +"``__value__`` attribute is accessed:" +msgstr "" + +#: ../../library/typing.rst:2019 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1766 +#: ../../library/typing.rst:2021 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:1772 +#: ../../library/typing.rst:2027 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1780 +#: ../../library/typing.rst:2029 ../../library/typing.rst:2106 +#: ../../library/typing.rst:3055 +msgid "Usage::" +msgstr "" + +#: ../../library/typing.rst:2035 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1784 +#: ../../library/typing.rst:2039 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1793 +#: ../../library/typing.rst:2048 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1795 +#: ../../library/typing.rst:2050 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1707,83 +1899,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:2056 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1811 +#: ../../library/typing.rst:2066 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1817 +#: ../../library/typing.rst:2072 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1821 +#: ../../library/typing.rst:2082 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1824 +#: ../../library/typing.rst:2085 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1827 +#: ../../library/typing.rst:2088 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1831 +#: ../../library/typing.rst:2092 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1835 +#: ../../library/typing.rst:2096 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1840 +#: ../../library/typing.rst:2101 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:1842 +#: ../../library/typing.rst:2103 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:1852 +#: ../../library/typing.rst:2113 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1856 +#: ../../library/typing.rst:2117 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1860 +#: ../../library/typing.rst:2121 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1864 +#: ../../library/typing.rst:2125 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1869 +#: ../../library/typing.rst:2130 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:2132 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1877 +#: ../../library/typing.rst:2138 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1889 +#: ../../library/typing.rst:2150 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1791,15 +1983,21 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1894 +#: ../../library/typing.rst:2155 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1906 +#: ../../library/typing.rst:2161 +msgid "" +"In code that needs to be compatible with Python 3.11 or older, generic " +"Protocols can be written as follows::" +msgstr "" + +#: ../../library/typing.rst:2174 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1908 +#: ../../library/typing.rst:2176 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1808,7 +2006,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1928 +#: ../../library/typing.rst:2196 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1819,7 +2017,7 @@ msgid "" "(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:1939 +#: ../../library/typing.rst:2207 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1827,13 +2025,32 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1950 +#: ../../library/typing.rst:2215 +msgid "" +"The internal implementation of :func:`isinstance` checks against runtime-" +"checkable protocols now uses :func:`inspect.getattr_static` to look up " +"attributes (previously, :func:`hasattr` was used). As a result, some objects " +"which used to be considered instances of a runtime-checkable protocol may no " +"longer be considered instances of that protocol on Python 3.12+, and vice " +"versa. Most users are unlikely to be affected by this change." +msgstr "" + +#: ../../library/typing.rst:2224 +msgid "" +"The members of a runtime-checkable protocol are now considered \"frozen\" at " +"runtime as soon as the class has been created. Monkey-patching attributes " +"onto a runtime-checkable protocol will still work, but will have no impact " +"on :func:`isinstance` checks comparing objects to the protocol. See :ref:" +"`\"What's new in Python 3.12\" ` for more details." +msgstr "" + +#: ../../library/typing.rst:2235 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:2238 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1841,53 +2058,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:2254 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1973 +#: ../../library/typing.rst:2258 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1977 +#: ../../library/typing.rst:2262 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1984 +#: ../../library/typing.rst:2269 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1985 +#: ../../library/typing.rst:2270 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1997 +#: ../../library/typing.rst:2282 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:2008 +#: ../../library/typing.rst:2293 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2011 +#: ../../library/typing.rst:2296 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2306 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1895,61 +2112,67 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2026 +#: ../../library/typing.rst:2311 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2041 +#: ../../library/typing.rst:2326 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:2048 +#: ../../library/typing.rst:2333 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2056 +#: ../../library/typing.rst:2341 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2074 -msgid "A ``TypedDict`` can be generic:" +#: ../../library/typing.rst:2356 +msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:2084 +#: ../../library/typing.rst:2362 +msgid "" +"To create a generic ``TypedDict`` that is compatible with Python 3.11 or " +"lower, inherit from :class:`Generic` explicitly:" +msgstr "" + +#: ../../library/typing.rst:2373 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2090 +#: ../../library/typing.rst:2379 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2112 +#: ../../library/typing.rst:2401 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2115 +#: ../../library/typing.rst:2404 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2407 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1958,133 +2181,133 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2141 +#: ../../library/typing.rst:2430 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2145 +#: ../../library/typing.rst:2434 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2438 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2153 +#: ../../library/typing.rst:2442 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2444 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2160 +#: ../../library/typing.rst:2449 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2165 +#: ../../library/typing.rst:2454 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2169 +#: ../../library/typing.rst:2458 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2173 +#: ../../library/typing.rst:2462 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2177 +#: ../../library/typing.rst:2466 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2183 +#: ../../library/typing.rst:2472 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2187 +#: ../../library/typing.rst:2476 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2191 +#: ../../library/typing.rst:2480 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2197 +#: ../../library/typing.rst:2486 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2203 +#: ../../library/typing.rst:2492 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2496 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2209 +#: ../../library/typing.rst:2498 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2216 +#: ../../library/typing.rst:2505 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2218 +#: ../../library/typing.rst:2507 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2221 +#: ../../library/typing.rst:2510 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2228 +#: ../../library/typing.rst:2517 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2242 +#: ../../library/typing.rst:2531 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2244 +#: ../../library/typing.rst:2533 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2255 +#: ../../library/typing.rst:2544 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2260 +#: ../../library/typing.rst:2549 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2094,59 +2317,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2268 +#: ../../library/typing.rst:2557 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2560 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2279 +#: ../../library/typing.rst:2568 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2281 +#: ../../library/typing.rst:2570 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2287 +#: ../../library/typing.rst:2576 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2290 +#: ../../library/typing.rst:2579 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2295 +#: ../../library/typing.rst:2584 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2300 +#: ../../library/typing.rst:2589 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2312 +#: ../../library/typing.rst:2601 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2315 +#: ../../library/typing.rst:2604 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2155,19 +2378,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2322 +#: ../../library/typing.rst:2611 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2338 +#: ../../library/typing.rst:2625 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2347 +#: ../../library/typing.rst:2634 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2358 +#: ../../library/typing.rst:2645 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2489 +#: ../../library/typing.rst:2783 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2372,32 +2608,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2496 +#: ../../library/typing.rst:2790 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2504 +#: ../../library/typing.rst:2798 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2506 +#: ../../library/typing.rst:2800 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2513 +#: ../../library/typing.rst:2807 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2515 +#: ../../library/typing.rst:2809 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2540 +#: ../../library/typing.rst:2834 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2407,11 +2643,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2551 +#: ../../library/typing.rst:2845 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2553 +#: ../../library/typing.rst:2847 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2419,48 +2655,80 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2559 +#: ../../library/typing.rst:2853 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2563 +#: ../../library/typing.rst:2857 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2565 +#: ../../library/typing.rst:2859 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2570 +#: ../../library/typing.rst:2865 +msgid "" +"Decorator to indicate that a method in a subclass is intended to override a " +"method or attribute in a superclass." +msgstr "" + +#: ../../library/typing.rst:2868 +msgid "" +"Type checkers should emit an error if a method decorated with ``@override`` " +"does not, in fact, override anything. This helps prevent bugs that may occur " +"when a base class is changed without an equivalent change to a child class." +msgstr "" + +#: ../../library/typing.rst:2890 +msgid "There is no runtime checking of this property." +msgstr "" + +#: ../../library/typing.rst:2892 +msgid "" +"The decorator will attempt to set an ``__override__`` attribute to ``True`` " +"on the decorated object. Thus, a check like ``if getattr(obj, " +"\"__override__\", False)`` can be used at runtime to determine whether an " +"object ``obj`` has been marked as an override. If the decorated object does " +"not support setting attributes, the decorator returns the object unchanged " +"without raising an exception." +msgstr "" + +#: ../../library/typing.rst:2899 +#, fuzzy +msgid "See :pep:`698` for more details." +msgstr "更多細節請見 :pep:`681`。" + +#: ../../library/typing.rst:2906 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2908 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2583 +#: ../../library/typing.rst:2919 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2587 +#: ../../library/typing.rst:2923 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2591 +#: ../../library/typing.rst:2927 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2594 +#: ../../library/typing.rst:2930 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2469,21 +2737,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2600 +#: ../../library/typing.rst:2936 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example:" msgstr "" -#: ../../library/typing.rst:2617 +#: ../../library/typing.rst:2953 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2622 +#: ../../library/typing.rst:2958 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2491,20 +2759,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2626 +#: ../../library/typing.rst:2962 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2633 +#: ../../library/typing.rst:2969 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2636 +#: ../../library/typing.rst:2972 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2512,17 +2780,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2642 ../../library/typing.rst:2665 +#: ../../library/typing.rst:2978 ../../library/typing.rst:3001 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:2657 +#: ../../library/typing.rst:2993 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2996 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2530,40 +2798,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:2677 +#: ../../library/typing.rst:3013 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2698 +#: ../../library/typing.rst:3034 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:2700 +#: ../../library/typing.rst:3036 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2705 +#: ../../library/typing.rst:3041 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2712 +#: ../../library/typing.rst:3048 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2716 +#: ../../library/typing.rst:3052 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:2727 +#: ../../library/typing.rst:3063 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2571,7 +2839,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2734 +#: ../../library/typing.rst:3070 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2579,11 +2847,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2745 +#: ../../library/typing.rst:3082 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:2747 +#: ../../library/typing.rst:3084 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2592,7 +2860,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:2753 +#: ../../library/typing.rst:3091 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -2600,7 +2868,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:2758 +#: ../../library/typing.rst:3096 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " @@ -2608,176 +2876,188 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:2765 +#: ../../library/typing.rst:3101 +msgid "" +"Type checkers are encouraged to flag uses of the deprecated types if the " +"program they are checking targets a minimum Python version of 3.9 or newer." +msgstr "" + +#: ../../library/typing.rst:3107 msgid "Aliases to built-in types" msgstr "" -#: ../../library/typing.rst:2769 +#: ../../library/typing.rst:3111 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2771 +#: ../../library/typing.rst:3113 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2775 ../../library/typing.rst:3015 +#: ../../library/typing.rst:3117 ../../library/typing.rst:3359 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2780 +#: ../../library/typing.rst:3122 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2786 +#: ../../library/typing.rst:3128 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2788 +#: ../../library/typing.rst:3130 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2792 +#: ../../library/typing.rst:3134 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2802 +#: ../../library/typing.rst:3142 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2808 +#: ../../library/typing.rst:3148 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2810 +#: ../../library/typing.rst:3150 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2814 +#: ../../library/typing.rst:3154 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2820 +#: ../../library/typing.rst:3160 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2822 +#: ../../library/typing.rst:3162 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2829 +#: ../../library/typing.rst:3169 msgid "Deprecated alias for :class:`tuple`." msgstr "" -#: ../../library/typing.rst:2831 +#: ../../library/typing.rst:3171 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:2834 +#: ../../library/typing.rst:3174 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2840 +#: ../../library/typing.rst:3180 msgid "Deprecated alias to :class:`type`." msgstr "" -#: ../../library/typing.rst:2842 +#: ../../library/typing.rst:3182 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:3187 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2854 +#: ../../library/typing.rst:3194 msgid "Aliases to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:3198 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:3202 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:3208 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2872 +#: ../../library/typing.rst:3212 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2878 +#: ../../library/typing.rst:3218 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:3223 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:3229 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:3234 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2900 +#: ../../library/typing.rst:3240 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2905 +#: ../../library/typing.rst:3245 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2912 +#: ../../library/typing.rst:3252 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:2917 +#: ../../library/typing.rst:3257 +msgid "" +"The ``typing.io`` namespace is deprecated and will be removed. These types " +"should be directly imported from ``typing`` instead." +msgstr "" + +#: ../../library/typing.rst:3261 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2920 +#: ../../library/typing.rst:3264 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2785,367 +3065,391 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2928 +#: ../../library/typing.rst:3272 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2929 +#: ../../library/typing.rst:3273 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2935 +#: ../../library/typing.rst:3279 msgid "Deprecated alias for :class:`str`." msgstr "" -#: ../../library/typing.rst:2937 +#: ../../library/typing.rst:3281 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:2941 +#: ../../library/typing.rst:3285 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2949 +#: ../../library/typing.rst:3293 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2959 +#: ../../library/typing.rst:3303 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2963 +#: ../../library/typing.rst:3307 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2965 +#: ../../library/typing.rst:3309 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2971 +#: ../../library/typing.rst:3315 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2975 +#: ../../library/typing.rst:3319 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:2979 +#: ../../library/typing.rst:3323 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2983 +#: ../../library/typing.rst:3327 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2989 +#: ../../library/typing.rst:3333 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2991 +#: ../../library/typing.rst:3335 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2997 +#: ../../library/typing.rst:3341 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2999 +#: ../../library/typing.rst:3343 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3005 +#: ../../library/typing.rst:3349 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:3007 +#: ../../library/typing.rst:3351 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3013 +#: ../../library/typing.rst:3357 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:3020 +#: ../../library/typing.rst:3364 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3026 +#: ../../library/typing.rst:3370 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:3028 +#: ../../library/typing.rst:3372 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3034 +#: ../../library/typing.rst:3378 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:3036 +#: ../../library/typing.rst:3380 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3043 +#: ../../library/typing.rst:3387 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:3045 +#: ../../library/typing.rst:3389 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3052 +#: ../../library/typing.rst:3396 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:3054 +#: ../../library/typing.rst:3398 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3060 +#: ../../library/typing.rst:3404 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:3062 +#: ../../library/typing.rst:3406 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3068 +#: ../../library/typing.rst:3412 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:3414 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3077 +#: ../../library/typing.rst:3421 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3081 +#: ../../library/typing.rst:3425 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:3083 +#: ../../library/typing.rst:3427 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3094 +#: ../../library/typing.rst:3438 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3100 +#: ../../library/typing.rst:3444 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:3102 +#: ../../library/typing.rst:3446 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3455 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:3115 +#: ../../library/typing.rst:3459 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3123 +#: ../../library/typing.rst:3467 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3133 +#: ../../library/typing.rst:3477 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3140 +#: ../../library/typing.rst:3484 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:3144 +#: ../../library/typing.rst:3488 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3150 +#: ../../library/typing.rst:3494 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:3154 +#: ../../library/typing.rst:3498 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3160 +#: ../../library/typing.rst:3504 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:3164 +#: ../../library/typing.rst:3508 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3515 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3519 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:3177 +#: ../../library/typing.rst:3521 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3183 +#: ../../library/typing.rst:3527 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:3185 +#: ../../library/typing.rst:3529 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3191 +#: ../../library/typing.rst:3535 +msgid "Deprecated alias to :class:`collections.abc.Callable`." +msgstr "" + +#: ../../library/typing.rst:3537 +msgid "" +"See :ref:`annotating-callables` for details on how to use :class:" +"`collections.abc.Callable` and ``typing.Callable`` in type annotations." +msgstr "" + +#: ../../library/typing.rst:3540 +msgid "" +":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." +msgstr "" + +#: ../../library/typing.rst:3550 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:3193 +#: ../../library/typing.rst:3552 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3561 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:3206 +#: ../../library/typing.rst:3565 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3214 +#: ../../library/typing.rst:3573 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3222 +#: ../../library/typing.rst:3581 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3228 -msgid "Alias to :class:`collections.abc.Hashable`." +#: ../../library/typing.rst:3587 +msgid "Deprecated alias to :class:`collections.abc.Hashable`." +msgstr "" + +#: ../../library/typing.rst:3589 +msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "" -#: ../../library/typing.rst:3232 +#: ../../library/typing.rst:3594 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:3234 +#: ../../library/typing.rst:3596 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3240 -msgid "Alias to :class:`collections.abc.Sized`." +#: ../../library/typing.rst:3602 +msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:3245 +#: ../../library/typing.rst:3604 +msgid "Use :class:`collections.abc.Sized` directly instead." +msgstr "" + +#: ../../library/typing.rst:3610 msgid "Aliases to :mod:`contextlib` ABCs" msgstr "" -#: ../../library/typing.rst:3249 +#: ../../library/typing.rst:3614 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3254 +#: ../../library/typing.rst:3619 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3261 +#: ../../library/typing.rst:3626 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3266 +#: ../../library/typing.rst:3631 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3272 +#: ../../library/typing.rst:3637 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3274 +#: ../../library/typing.rst:3639 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3153,74 +3457,105 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3646 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3647 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3648 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3649 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3650 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3651 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3652 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3653 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3284 +#: ../../library/typing.rst:3654 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3284 ../../library/typing.rst:3287 +#: ../../library/typing.rst:3655 ../../library/typing.rst:3659 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3284 ../../library/typing.rst:3289 -msgid "Undecided" +#: ../../library/typing.rst:3656 +msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3284 +#: ../../library/typing.rst:3657 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3287 -msgid "``typing.ByteString``" +#: ../../library/typing.rst:3658 +#, fuzzy +msgid ":class:`typing.ByteString`" msgstr "``typing.Text``" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3660 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3661 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3289 -msgid "``typing.Text``" +#: ../../library/typing.rst:3662 +#, fuzzy +msgid ":data:`typing.Text`" msgstr "``typing.Text``" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3663 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3664 ../../library/typing.rst:3668 +#: ../../library/typing.rst:3672 +msgid "Undecided" +msgstr "" + +#: ../../library/typing.rst:3665 msgid ":gh:`92332`" msgstr ":gh:`92332`" + +#: ../../library/typing.rst:3666 +#, fuzzy +msgid ":class:`typing.Hashable` and :class:`typing.Sized`" +msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" + +#: ../../library/typing.rst:3667 ../../library/typing.rst:3671 +msgid "3.12" +msgstr "" + +#: ../../library/typing.rst:3669 +#, fuzzy +msgid ":gh:`94309`" +msgstr ":gh:`91896`" + +#: ../../library/typing.rst:3670 +#, fuzzy +msgid ":data:`typing.TypeAlias`" +msgstr "*引入* :data:`TypeAlias`" + +#: ../../library/typing.rst:3673 +#, fuzzy +msgid ":pep:`695`" +msgstr ":pep:`585`" From f369aec6a3a72ea72a737783ef29ceaffa3bc792 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 13 Sep 2023 00:06:27 +0000 Subject: [PATCH 15/18] sync with cpython 21f4e6d6 --- library/itertools.po | 4 +- library/zipapp.po | 34 +- whatsnew/3.12.po | 1232 ++++++++++++++++++++++-------------------- 3 files changed, 662 insertions(+), 608 deletions(-) diff --git a/library/itertools.po b/library/itertools.po index 9113d9bac3..1bae04ba61 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-04 16:14+0000\n" +"POT-Creation-Date: 2023-09-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -889,6 +889,6 @@ msgid "" "term:`generator`\\s which incur interpreter overhead." msgstr "" -#: ../../library/itertools.rst:1021 +#: ../../library/itertools.rst:1022 msgid "The following recipes have a more mathematical flavor:" msgstr "" diff --git a/library/zipapp.po b/library/zipapp.po index 8d2d45893f..ca5c1d6912 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -357,25 +357,17 @@ msgid "" msgstr "" #: ../../library/zipapp.rst:284 -msgid "" -"Optionally, delete the ``.dist-info`` directories created by pip in the " -"``myapp`` directory. These hold metadata for pip to manage the packages, and " -"as you won't be making any further use of pip they aren't required - " -"although it won't do any harm if you leave them." -msgstr "" - -#: ../../library/zipapp.rst:289 msgid "Package the application using:" msgstr "" -#: ../../library/zipapp.rst:295 +#: ../../library/zipapp.rst:290 msgid "" "This will produce a standalone executable, which can be run on any machine " "with the appropriate interpreter available. See :ref:`zipapp-specifying-the-" "interpreter` for details. It can be shipped to users as a single file." msgstr "" -#: ../../library/zipapp.rst:299 +#: ../../library/zipapp.rst:294 msgid "" "On Unix, the ``myapp.pyz`` file is executable as it stands. You can rename " "the file to remove the ``.pyz`` extension if you prefer a \"plain\" command " @@ -384,11 +376,11 @@ msgid "" "extensions when installed." msgstr "" -#: ../../library/zipapp.rst:307 +#: ../../library/zipapp.rst:302 msgid "Caveats" msgstr "" -#: ../../library/zipapp.rst:309 +#: ../../library/zipapp.rst:304 msgid "" "If your application depends on a package that includes a C extension, that " "package cannot be run from a zip file (this is an OS limitation, as " @@ -402,11 +394,11 @@ msgid "" "based on the user's machine)." msgstr "" -#: ../../library/zipapp.rst:321 +#: ../../library/zipapp.rst:316 msgid "The Python Zip Application Archive Format" msgstr "" -#: ../../library/zipapp.rst:323 +#: ../../library/zipapp.rst:318 msgid "" "Python has been able to execute zip files which contain a ``__main__.py`` " "file since version 2.6. In order to be executed by Python, an application " @@ -417,18 +409,18 @@ msgid "" "the zip file." msgstr "" -#: ../../library/zipapp.rst:330 +#: ../../library/zipapp.rst:325 msgid "" "The zip file format allows arbitrary data to be prepended to a zip file. " "The zip application format uses this ability to prepend a standard POSIX " "\"shebang\" line to the file (``#!/path/to/interpreter``)." msgstr "" -#: ../../library/zipapp.rst:334 +#: ../../library/zipapp.rst:329 msgid "Formally, the Python zip application format is therefore:" msgstr "" -#: ../../library/zipapp.rst:336 +#: ../../library/zipapp.rst:331 msgid "" "An optional shebang line, containing the characters ``b'#!'`` followed by an " "interpreter name, and then a newline (``b'\\n'``) character. The " @@ -438,7 +430,7 @@ msgid "" "POSIX." msgstr "" -#: ../../library/zipapp.rst:341 +#: ../../library/zipapp.rst:336 msgid "" "Standard zipfile data, as generated by the :mod:`zipfile` module. The " "zipfile content *must* include a file called ``__main__.py`` (which must be " @@ -446,13 +438,13 @@ msgid "" "zipfile data can be compressed or uncompressed." msgstr "" -#: ../../library/zipapp.rst:346 +#: ../../library/zipapp.rst:341 msgid "" "If an application archive has a shebang line, it may have the executable bit " "set on POSIX systems, to allow it to be executed directly." msgstr "" -#: ../../library/zipapp.rst:349 +#: ../../library/zipapp.rst:344 msgid "" "There is no requirement that the tools in this module are used to create " "application archives - the module is a convenience, but archives in the " diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index d93137df29..4d2e8f08c5 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-09-13 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -147,7 +147,7 @@ msgid "" "in :gh:`91058`." msgstr "" -#: ../../whatsnew/3.12.rst:151 ../../whatsnew/3.12.rst:1681 +#: ../../whatsnew/3.12.rst:151 ../../whatsnew/3.12.rst:1739 msgid "New Features" msgstr "新增特性" @@ -263,12 +263,19 @@ msgstr "" #: ../../whatsnew/3.12.rst:261 msgid "" +"The :mod:`symtable` module will no longer produce child symbol tables for " +"each comprehension; instead, the comprehension's locals will be included in " +"the parent function's symbol table." +msgstr "" + +#: ../../whatsnew/3.12.rst:264 +msgid "" "Calling :func:`locals` inside a comprehension now includes variables from " "outside the comprehension, and no longer includes the synthetic ``.0`` " "variable for the comprehension \"argument\"." msgstr "" -#: ../../whatsnew/3.12.rst:264 +#: ../../whatsnew/3.12.rst:267 msgid "" "A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " "locals()]``) may see \"RuntimeError: dictionary changed size during " @@ -278,22 +285,22 @@ msgid "" "[k for k in keys]``." msgstr "" -#: ../../whatsnew/3.12.rst:271 +#: ../../whatsnew/3.12.rst:274 msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." msgstr "" -#: ../../whatsnew/3.12.rst:276 +#: ../../whatsnew/3.12.rst:279 msgid "PEP 688: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:278 +#: ../../whatsnew/3.12.rst:281 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" -#: ../../whatsnew/3.12.rst:282 +#: ../../whatsnew/3.12.rst:285 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" @@ -301,41 +308,41 @@ msgid "" "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" -#: ../../whatsnew/3.12.rst:291 +#: ../../whatsnew/3.12.rst:294 msgid "PEP 684: A Per-Interpreter GIL" msgstr "" -#: ../../whatsnew/3.12.rst:293 +#: ../../whatsnew/3.12.rst:296 msgid "" "Sub-interpreters may now be created with a unique GIL per interpreter. This " "allows Python programs to take full advantage of multiple CPU cores." msgstr "" -#: ../../whatsnew/3.12.rst:297 +#: ../../whatsnew/3.12.rst:300 msgid "" "Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " "interpreter with its own GIL::" msgstr "" -#: ../../whatsnew/3.12.rst:311 +#: ../../whatsnew/3.12.rst:314 msgid "" "For further examples how to use the C-API for sub-interpreters with a per-" "interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." msgstr "" -#: ../../whatsnew/3.12.rst:314 +#: ../../whatsnew/3.12.rst:317 msgid "A Python API is anticipated for 3.13. (See :pep:`554`.)" msgstr "" -#: ../../whatsnew/3.12.rst:316 +#: ../../whatsnew/3.12.rst:319 msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" -#: ../../whatsnew/3.12.rst:321 +#: ../../whatsnew/3.12.rst:324 msgid "PEP 669: Low impact monitoring for CPython" msgstr "" -#: ../../whatsnew/3.12.rst:323 +#: ../../whatsnew/3.12.rst:326 msgid "" "CPython 3.12 now supports the ability to monitor calls, returns, lines, " "exceptions and other events using instrumentation. This means that you only " @@ -343,50 +350,50 @@ msgid "" "coverage tools." msgstr "" -#: ../../whatsnew/3.12.rst:328 +#: ../../whatsnew/3.12.rst:331 msgid "See :mod:`sys.monitoring` for details." msgstr "" -#: ../../whatsnew/3.12.rst:332 +#: ../../whatsnew/3.12.rst:335 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.12.rst:334 +#: ../../whatsnew/3.12.rst:337 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.12.rst:340 +#: ../../whatsnew/3.12.rst:343 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" msgstr "" -#: ../../whatsnew/3.12.rst:342 +#: ../../whatsnew/3.12.rst:345 msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" -#: ../../whatsnew/3.12.rst:346 +#: ../../whatsnew/3.12.rst:349 msgid "" "This PEP specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" -#: ../../whatsnew/3.12.rst:357 +#: ../../whatsnew/3.12.rst:360 msgid "See :pep:`692` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:359 +#: ../../whatsnew/3.12.rst:362 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" msgstr "(由 Franek Magiera 於 :gh:`103629` 中貢獻。)" -#: ../../whatsnew/3.12.rst:364 +#: ../../whatsnew/3.12.rst:367 msgid "PEP 698: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:366 +#: ../../whatsnew/3.12.rst:369 msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -395,51 +402,51 @@ msgid "" "class does not in fact do so." msgstr "" -#: ../../whatsnew/3.12.rst:372 +#: ../../whatsnew/3.12.rst:375 msgid "Example::" msgstr "" -#: ../../whatsnew/3.12.rst:390 +#: ../../whatsnew/3.12.rst:393 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" -#: ../../whatsnew/3.12.rst:395 +#: ../../whatsnew/3.12.rst:398 msgid "PEP 695: Type Parameter Syntax" msgstr "" -#: ../../whatsnew/3.12.rst:397 +#: ../../whatsnew/3.12.rst:400 msgid "" "Generic classes and functions under :pep:`484` were declared using a verbose " "syntax that left the scope of type parameters unclear and required explicit " "declarations of variance." msgstr "" -#: ../../whatsnew/3.12.rst:401 +#: ../../whatsnew/3.12.rst:404 msgid "" ":pep:`695` introduces a new, more compact and explicit way to create :ref:" "`generic classes ` and :ref:`functions `::" msgstr "" -#: ../../whatsnew/3.12.rst:414 +#: ../../whatsnew/3.12.rst:417 msgid "" "In addition, the PEP introduces a new way to declare :ref:`type aliases " "` using the :keyword:`type` statement, which creates an " "instance of :class:`~typing.TypeAliasType`::" msgstr "" -#: ../../whatsnew/3.12.rst:420 +#: ../../whatsnew/3.12.rst:423 msgid "Type aliases can also be :ref:`generic `::" msgstr "" -#: ../../whatsnew/3.12.rst:424 +#: ../../whatsnew/3.12.rst:427 msgid "" "The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" "`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " "parameters with bounds or constraints::" msgstr "" -#: ../../whatsnew/3.12.rst:433 +#: ../../whatsnew/3.12.rst:436 msgid "" "The value of type aliases and the bound and constraints of type variables " "created through this syntax are evaluated only on demand (see :ref:`lazy-" @@ -447,7 +454,7 @@ msgid "" "defined later in the file." msgstr "" -#: ../../whatsnew/3.12.rst:438 +#: ../../whatsnew/3.12.rst:441 msgid "" "Type parameters declared through a type parameter list are visible within " "the scope of the declaration and any nested scopes, but not in the outer " @@ -457,7 +464,7 @@ msgid "" "detailed description of the runtime semantics of type parameters." msgstr "" -#: ../../whatsnew/3.12.rst:445 +#: ../../whatsnew/3.12.rst:448 msgid "" "In order to support these scoping semantics, a new kind of scope is " "introduced, the :ref:`annotation scope `. Annotation " @@ -466,21 +473,21 @@ msgid "" "` will also be evaluated in annotation scopes." msgstr "" -#: ../../whatsnew/3.12.rst:451 +#: ../../whatsnew/3.12.rst:454 msgid "See :pep:`695` for more details." msgstr "詳情請見 :pep:`695`。" -#: ../../whatsnew/3.12.rst:453 +#: ../../whatsnew/3.12.rst:456 msgid "" "(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " "and others in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:457 +#: ../../whatsnew/3.12.rst:460 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.12.rst:459 +#: ../../whatsnew/3.12.rst:462 msgid "" "Add :ref:`perf_profiling` through the new environment variable :envvar:" "`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " @@ -491,7 +498,7 @@ msgid "" "in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:469 +#: ../../whatsnew/3.12.rst:472 msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " @@ -501,32 +508,32 @@ msgid "" "`706`.)" msgstr "" -#: ../../whatsnew/3.12.rst:477 +#: ../../whatsnew/3.12.rst:480 msgid "" ":class:`types.MappingProxyType` instances are now hashable if the underlying " "mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" msgstr "" -#: ../../whatsnew/3.12.rst:481 +#: ../../whatsnew/3.12.rst:484 msgid "" ":class:`memoryview` now supports the half-float type (the \"e\" format " "code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" -#: ../../whatsnew/3.12.rst:484 +#: ../../whatsnew/3.12.rst:487 msgid "" "The parser now raises :exc:`SyntaxError` when parsing source code containing " "null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:487 +#: ../../whatsnew/3.12.rst:490 msgid "" ":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " "when parsing source code containing null bytes. (Contributed by Pablo " "Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:491 +#: ../../whatsnew/3.12.rst:494 msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -536,7 +543,7 @@ msgid "" "`97922`.)" msgstr "" -#: ../../whatsnew/3.12.rst:498 +#: ../../whatsnew/3.12.rst:501 msgid "" "A backslash-character pair that is not a valid escape sequence now generates " "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " @@ -547,7 +554,7 @@ msgid "" "`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:507 +#: ../../whatsnew/3.12.rst:510 msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " "deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" @@ -555,14 +562,14 @@ msgid "" "a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:513 +#: ../../whatsnew/3.12.rst:516 msgid "" "All builtin and extension callables expecting boolean parameters now accept " "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" -#: ../../whatsnew/3.12.rst:517 +#: ../../whatsnew/3.12.rst:520 msgid "" "Variables used in the target part of comprehensions that are not stored to " "can now be used in assignment expressions (``:=``). For example, in ``[(b := " @@ -572,28 +579,28 @@ msgid "" "(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" -#: ../../whatsnew/3.12.rst:524 +#: ../../whatsnew/3.12.rst:527 msgid "" ":class:`slice` objects are now hashable, allowing them to be used as dict " "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" -#: ../../whatsnew/3.12.rst:527 +#: ../../whatsnew/3.12.rst:530 msgid "" ":func:`sum` now uses Neumaier summation to improve accuracy when summing " "floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" "`100425`.)" msgstr "" -#: ../../whatsnew/3.12.rst:531 +#: ../../whatsnew/3.12.rst:534 msgid "" "Exceptions raised in a typeobject's ``__set_name__`` method are no longer " "wrapped by a :exc:`RuntimeError`. Context information is added to the " "exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" -#: ../../whatsnew/3.12.rst:535 +#: ../../whatsnew/3.12.rst:538 msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " "and raises one other exception, that exception is no longer wrapped in an :" @@ -601,33 +608,33 @@ msgid "" "Katriel in :gh:`103590`.)" msgstr "" -#: ../../whatsnew/3.12.rst:542 +#: ../../whatsnew/3.12.rst:545 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.12.rst:544 +#: ../../whatsnew/3.12.rst:547 msgid "None." msgstr "" -#: ../../whatsnew/3.12.rst:548 +#: ../../whatsnew/3.12.rst:551 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.12.rst:551 +#: ../../whatsnew/3.12.rst:554 msgid "array" msgstr "array" -#: ../../whatsnew/3.12.rst:553 +#: ../../whatsnew/3.12.rst:556 msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" -#: ../../whatsnew/3.12.rst:557 +#: ../../whatsnew/3.12.rst:560 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.12.rst:559 +#: ../../whatsnew/3.12.rst:562 msgid "" "The performance of writing to sockets in :mod:`asyncio` has been " "significantly improved. ``asyncio`` now avoids unnecessary copying when " @@ -635,7 +642,7 @@ msgid "" "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" -#: ../../whatsnew/3.12.rst:564 +#: ../../whatsnew/3.12.rst:567 msgid "" "Added :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " @@ -643,7 +650,7 @@ msgid "" "Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" -#: ../../whatsnew/3.12.rst:569 +#: ../../whatsnew/3.12.rst:572 msgid "" "On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default " "if :func:`os.pidfd_open` is available and functional instead of :class:" @@ -651,7 +658,7 @@ msgid "" "`98024`.)" msgstr "" -#: ../../whatsnew/3.12.rst:574 +#: ../../whatsnew/3.12.rst:577 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -663,7 +670,7 @@ msgid "" "`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:583 +#: ../../whatsnew/3.12.rst:586 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -671,57 +678,57 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:589 +#: ../../whatsnew/3.12.rst:592 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:593 +#: ../../whatsnew/3.12.rst:596 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " "(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" -#: ../../whatsnew/3.12.rst:596 +#: ../../whatsnew/3.12.rst:599 msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" -#: ../../whatsnew/3.12.rst:600 +#: ../../whatsnew/3.12.rst:603 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" -#: ../../whatsnew/3.12.rst:605 +#: ../../whatsnew/3.12.rst:608 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.12.rst:607 +#: ../../whatsnew/3.12.rst:610 msgid "" "Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " "Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:611 +#: ../../whatsnew/3.12.rst:614 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.12.rst:613 +#: ../../whatsnew/3.12.rst:616 msgid "" "Add :const:`~csv.QUOTE_NOTNULL` and :const:`~csv.QUOTE_STRINGS` flags to " "provide finer grained control of ``None`` and empty strings by :class:`~csv." "writer` objects." msgstr "" -#: ../../whatsnew/3.12.rst:618 +#: ../../whatsnew/3.12.rst:621 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.12.rst:620 +#: ../../whatsnew/3.12.rst:623 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" @@ -730,45 +737,45 @@ msgid "" "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:629 +#: ../../whatsnew/3.12.rst:632 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.12.rst:631 +#: ../../whatsnew/3.12.rst:634 msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" -#: ../../whatsnew/3.12.rst:635 +#: ../../whatsnew/3.12.rst:638 msgid "importlib.resources" msgstr "" -#: ../../whatsnew/3.12.rst:637 +#: ../../whatsnew/3.12.rst:640 msgid "" ":func:`importlib.resources.as_file` now supports resource directories. " "(Contributed by Jason R. Coombs in :gh:`97930`.)" msgstr "" -#: ../../whatsnew/3.12.rst:641 +#: ../../whatsnew/3.12.rst:644 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:643 +#: ../../whatsnew/3.12.rst:646 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:647 +#: ../../whatsnew/3.12.rst:650 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :issue:`35759`.)" msgstr "" -#: ../../whatsnew/3.12.rst:651 +#: ../../whatsnew/3.12.rst:654 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -776,60 +783,60 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:657 +#: ../../whatsnew/3.12.rst:660 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:659 +#: ../../whatsnew/3.12.rst:662 msgid "" "Added :class:`itertools.batched()` for collecting into even-sized tuples " "where the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:664 +#: ../../whatsnew/3.12.rst:667 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:666 +#: ../../whatsnew/3.12.rst:669 msgid "" "Added :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -#: ../../whatsnew/3.12.rst:669 +#: ../../whatsnew/3.12.rst:672 msgid "" "Extended :func:`math.nextafter` to include a *steps* argument for moving up " "or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:674 +#: ../../whatsnew/3.12.rst:677 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:676 +#: ../../whatsnew/3.12.rst:679 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:680 +#: ../../whatsnew/3.12.rst:683 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:684 +#: ../../whatsnew/3.12.rst:687 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:688 +#: ../../whatsnew/3.12.rst:691 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -842,27 +849,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:699 +#: ../../whatsnew/3.12.rst:702 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:701 +#: ../../whatsnew/3.12.rst:704 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:704 +#: ../../whatsnew/3.12.rst:707 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:708 +#: ../../whatsnew/3.12.rst:711 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:710 +#: ../../whatsnew/3.12.rst:713 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -870,14 +877,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:715 +#: ../../whatsnew/3.12.rst:718 msgid "" "Add :meth:`~pathlib.Path.walk` for walking the directory trees and " "generating all file or directory names within them, similar to :func:`os." "walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:719 +#: ../../whatsnew/3.12.rst:722 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " @@ -885,13 +892,13 @@ msgid "" "issue:`40358`.)" msgstr "" -#: ../../whatsnew/3.12.rst:724 +#: ../../whatsnew/3.12.rst:727 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:727 +#: ../../whatsnew/3.12.rst:730 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -899,38 +906,38 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:732 +#: ../../whatsnew/3.12.rst:735 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:734 +#: ../../whatsnew/3.12.rst:737 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:740 +#: ../../whatsnew/3.12.rst:743 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:742 +#: ../../whatsnew/3.12.rst:745 msgid "" "Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" "gh:`81620`.)" msgstr "" -#: ../../whatsnew/3.12.rst:745 +#: ../../whatsnew/3.12.rst:748 msgid "" "Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:749 +#: ../../whatsnew/3.12.rst:752 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:751 +#: ../../whatsnew/3.12.rst:754 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -938,7 +945,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:757 +#: ../../whatsnew/3.12.rst:760 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -946,14 +953,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:763 +#: ../../whatsnew/3.12.rst:766 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:768 +#: ../../whatsnew/3.12.rst:771 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -961,24 +968,24 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:773 +#: ../../whatsnew/3.12.rst:776 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:779 +#: ../../whatsnew/3.12.rst:782 ../../whatsnew/3.12.rst:1461 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:781 +#: ../../whatsnew/3.12.rst:784 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -#: ../../whatsnew/3.12.rst:784 +#: ../../whatsnew/3.12.rst:787 msgid "" "Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." "Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " @@ -986,36 +993,36 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:791 +#: ../../whatsnew/3.12.rst:794 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:796 +#: ../../whatsnew/3.12.rst:799 msgid "" "Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection." "setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " "a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:802 +#: ../../whatsnew/3.12.rst:805 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:804 +#: ../../whatsnew/3.12.rst:807 msgid "" "Extended :func:`statistics.correlation` to include as a ``ranked`` method " "for computing the Spearman correlation of ranked data. (Contributed by " "Raymond Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:809 +#: ../../whatsnew/3.12.rst:812 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:811 +#: ../../whatsnew/3.12.rst:814 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -1025,7 +1032,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:820 +#: ../../whatsnew/3.12.rst:823 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1034,14 +1041,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:826 ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:829 ../../whatsnew/3.12.rst:1647 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:830 +#: ../../whatsnew/3.12.rst:833 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1049,27 +1056,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:836 +#: ../../whatsnew/3.12.rst:839 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:838 +#: ../../whatsnew/3.12.rst:841 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:840 +#: ../../whatsnew/3.12.rst:843 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:846 +#: ../../whatsnew/3.12.rst:849 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:848 +#: ../../whatsnew/3.12.rst:851 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1077,11 +1084,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:854 +#: ../../whatsnew/3.12.rst:857 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:856 +#: ../../whatsnew/3.12.rst:859 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1091,11 +1098,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:865 +#: ../../whatsnew/3.12.rst:868 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:867 +#: ../../whatsnew/3.12.rst:870 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "( Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1103,22 +1110,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:873 +#: ../../whatsnew/3.12.rst:876 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:875 +#: ../../whatsnew/3.12.rst:878 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:880 +#: ../../whatsnew/3.12.rst:883 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:882 +#: ../../whatsnew/3.12.rst:885 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1131,7 +1138,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:893 +#: ../../whatsnew/3.12.rst:896 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1139,13 +1146,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:915 +#: ../../whatsnew/3.12.rst:918 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:918 +#: ../../whatsnew/3.12.rst:921 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1156,71 +1163,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:926 +#: ../../whatsnew/3.12.rst:929 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:930 +#: ../../whatsnew/3.12.rst:933 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:934 +#: ../../whatsnew/3.12.rst:937 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:936 +#: ../../whatsnew/3.12.rst:939 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:940 +#: ../../whatsnew/3.12.rst:943 ../../whatsnew/3.12.rst:1502 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:942 +#: ../../whatsnew/3.12.rst:945 msgid "" "Added ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:958 +#: ../../whatsnew/3.12.rst:961 msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" msgstr "(由 Giampaolo Rodola 於 :issue:`4080` 中貢獻。)" -#: ../../whatsnew/3.12.rst:961 +#: ../../whatsnew/3.12.rst:964 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:963 +#: ../../whatsnew/3.12.rst:966 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:968 +#: ../../whatsnew/3.12.rst:971 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:970 +#: ../../whatsnew/3.12.rst:973 msgid "" "Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " "reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " "(Contributed by Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:974 +#: ../../whatsnew/3.12.rst:977 msgid "" "Added experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:978 +#: ../../whatsnew/3.12.rst:981 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1228,13 +1235,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:983 +#: ../../whatsnew/3.12.rst:986 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar O in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:986 +#: ../../whatsnew/3.12.rst:989 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1242,18 +1249,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:991 +#: ../../whatsnew/3.12.rst:994 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:997 +#: ../../whatsnew/3.12.rst:1000 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:999 +#: ../../whatsnew/3.12.rst:1002 msgid "" "Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1261,26 +1268,26 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1004 +#: ../../whatsnew/3.12.rst:1007 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1007 +#: ../../whatsnew/3.12.rst:1010 msgid "" "Removed the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" "gh:`92925`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1010 +#: ../../whatsnew/3.12.rst:1013 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1013 +#: ../../whatsnew/3.12.rst:1016 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1289,35 +1296,35 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1019 +#: ../../whatsnew/3.12.rst:1022 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1023 +#: ../../whatsnew/3.12.rst:1026 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:1025 +#: ../../whatsnew/3.12.rst:1028 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1030 +#: ../../whatsnew/3.12.rst:1033 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1037 ../../whatsnew/3.12.rst:1980 +#: ../../whatsnew/3.12.rst:1040 ../../whatsnew/3.12.rst:2038 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.12.rst:1039 +#: ../../whatsnew/3.12.rst:1042 msgid "" ":mod:`asyncio`: The :meth:`~asyncio.get_event_loop` method of the default " "event loop policy now emits a :exc:`DeprecationWarning` if there is no " @@ -1325,14 +1332,14 @@ msgid "" "Storchaka and Guido van Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1044 +#: ../../whatsnew/3.12.rst:1047 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." "FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1048 +#: ../../whatsnew/3.12.rst:1051 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1342,7 +1349,7 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1056 +#: ../../whatsnew/3.12.rst:1059 msgid "" ":mod:`os`: The ``st_ctime`` fields return by :func:`os.stat` and :func:`os." "lstat` on Windows are deprecated. In a future release, they will contain the " @@ -1351,25 +1358,25 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1062 +#: ../../whatsnew/3.12.rst:1065 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " "Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1077 +#: ../../whatsnew/3.12.rst:1080 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.12.rst:1066 +#: ../../whatsnew/3.12.rst:1069 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1072 +#: ../../whatsnew/3.12.rst:1075 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1379,28 +1386,28 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1079 +#: ../../whatsnew/3.12.rst:1082 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1083 +#: ../../whatsnew/3.12.rst:1086 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1087 +#: ../../whatsnew/3.12.rst:1090 msgid "" ":mod:`typing`: :class:`typing.Hashable` and :class:`typing.Sized` aliases " "for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:" "gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1090 +#: ../../whatsnew/3.12.rst:1093 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -1408,7 +1415,7 @@ msgid "" "implementation emitted nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1095 +#: ../../whatsnew/3.12.rst:1098 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" "meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " @@ -1416,14 +1423,14 @@ msgid "" "functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1100 +#: ../../whatsnew/3.12.rst:1103 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1105 +#: ../../whatsnew/3.12.rst:1108 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -1432,7 +1439,7 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:1110 +#: ../../whatsnew/3.12.rst:1113 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1441,156 +1448,156 @@ msgid "" "by Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1117 +#: ../../whatsnew/3.12.rst:1120 msgid "Pending Removal in Python 3.13" msgstr "" -#: ../../whatsnew/3.12.rst:1119 +#: ../../whatsnew/3.12.rst:1122 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1125 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1124 +#: ../../whatsnew/3.12.rst:1127 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1128 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1126 +#: ../../whatsnew/3.12.rst:1129 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1127 +#: ../../whatsnew/3.12.rst:1130 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1131 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1129 +#: ../../whatsnew/3.12.rst:1132 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1133 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1131 +#: ../../whatsnew/3.12.rst:1134 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1132 +#: ../../whatsnew/3.12.rst:1135 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1136 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1134 +#: ../../whatsnew/3.12.rst:1137 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1135 +#: ../../whatsnew/3.12.rst:1138 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1136 +#: ../../whatsnew/3.12.rst:1139 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1137 +#: ../../whatsnew/3.12.rst:1140 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1138 +#: ../../whatsnew/3.12.rst:1141 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1139 +#: ../../whatsnew/3.12.rst:1142 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1140 +#: ../../whatsnew/3.12.rst:1143 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1141 +#: ../../whatsnew/3.12.rst:1144 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1142 +#: ../../whatsnew/3.12.rst:1145 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1144 +#: ../../whatsnew/3.12.rst:1147 msgid "Other modules:" msgstr "" -#: ../../whatsnew/3.12.rst:1146 +#: ../../whatsnew/3.12.rst:1149 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1148 +#: ../../whatsnew/3.12.rst:1151 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1150 +#: ../../whatsnew/3.12.rst:1153 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1151 +#: ../../whatsnew/3.12.rst:1154 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1152 +#: ../../whatsnew/3.12.rst:1155 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1153 +#: ../../whatsnew/3.12.rst:1156 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1154 +#: ../../whatsnew/3.12.rst:1157 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1155 +#: ../../whatsnew/3.12.rst:1158 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1156 +#: ../../whatsnew/3.12.rst:1159 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1160 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1158 +#: ../../whatsnew/3.12.rst:1161 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1161 +#: ../../whatsnew/3.12.rst:1164 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1163 +#: ../../whatsnew/3.12.rst:1166 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1168 +#: ../../whatsnew/3.12.rst:1171 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1598,39 +1605,39 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1172 +#: ../../whatsnew/3.12.rst:1175 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1173 +#: ../../whatsnew/3.12.rst:1176 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1174 +#: ../../whatsnew/3.12.rst:1177 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1175 +#: ../../whatsnew/3.12.rst:1178 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1176 +#: ../../whatsnew/3.12.rst:1179 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1178 +#: ../../whatsnew/3.12.rst:1181 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1181 +#: ../../whatsnew/3.12.rst:1184 msgid "" ":mod:`asyncio`: the *msg* parameter of both :meth:`asyncio.Future.cancel` " "and :meth:`asyncio.Task.cancel` (:gh:`90985`)" msgstr "" -#: ../../whatsnew/3.12.rst:1185 +#: ../../whatsnew/3.12.rst:1188 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1638,47 +1645,47 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1190 +#: ../../whatsnew/3.12.rst:1193 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1193 +#: ../../whatsnew/3.12.rst:1196 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1196 +#: ../../whatsnew/3.12.rst:1199 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1197 +#: ../../whatsnew/3.12.rst:1200 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1198 +#: ../../whatsnew/3.12.rst:1201 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1200 +#: ../../whatsnew/3.12.rst:1203 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1202 +#: ../../whatsnew/3.12.rst:1205 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1203 +#: ../../whatsnew/3.12.rst:1206 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1205 +#: ../../whatsnew/3.12.rst:1208 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1207 +#: ../../whatsnew/3.12.rst:1210 msgid "" ":mod:`itertools`: The module had undocumented, inefficient, historically " "buggy, and inconsistent support for copy, deepcopy, and pickle operations. " @@ -1686,7 +1693,7 @@ msgid "" "maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1213 +#: ../../whatsnew/3.12.rst:1216 msgid "" ":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " "change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " @@ -1697,52 +1704,52 @@ msgid "" "code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../whatsnew/3.12.rst:1221 +#: ../../whatsnew/3.12.rst:1224 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1226 +#: ../../whatsnew/3.12.rst:1229 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " "gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1230 +#: ../../whatsnew/3.12.rst:1233 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "in 3.12, and will be removed in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1233 +#: ../../whatsnew/3.12.rst:1236 msgid "" ":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../whatsnew/3.12.rst:1236 +#: ../../whatsnew/3.12.rst:1239 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element` is deprecated and will raise an exception in " "Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1239 +#: ../../whatsnew/3.12.rst:1242 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases using the C API (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:1242 +#: ../../whatsnew/3.12.rst:1245 msgid "" "``__package__`` and ``__cached__`` will cease to be set or taken into " "consideration by the import system (:gh:`97879`)." msgstr "" -#: ../../whatsnew/3.12.rst:1245 +#: ../../whatsnew/3.12.rst:1248 msgid "" "Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " "planned to be removed in 3.12 but it only got a proper :exc:" @@ -1750,31 +1757,31 @@ msgid "" "Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1251 +#: ../../whatsnew/3.12.rst:1254 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases using the C API (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:1255 +#: ../../whatsnew/3.12.rst:1258 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1257 +#: ../../whatsnew/3.12.rst:1260 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1260 +#: ../../whatsnew/3.12.rst:1263 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1262 +#: ../../whatsnew/3.12.rst:1265 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1264 +#: ../../whatsnew/3.12.rst:1267 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1786,57 +1793,73 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1275 ../../whatsnew/3.12.rst:2062 +#: ../../whatsnew/3.12.rst:1278 ../../whatsnew/3.12.rst:2120 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1277 -msgid "" -"``asynchat`` and ``asyncore``: These two modules have been removed according " -"to the schedule in :pep:`594`, having been deprecated in Python 3.6. Use :" -"mod:`asyncio` instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" +#: ../../whatsnew/3.12.rst:1281 +msgid "asynchat and asyncore" msgstr "" #: ../../whatsnew/3.12.rst:1283 msgid "" -":mod:`configparser`: Several names deprecated in the :mod:`configparser` way " -"back in 3.2 have been removed per :gh:`89336`:" +"These two modules have been removed according to the schedule in :pep:`594`, " +"having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " +"(Contributed by Nikita Sobolev in :gh:`96580`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1290 +msgid "configparser" msgstr "" -#: ../../whatsnew/3.12.rst:1286 +#: ../../whatsnew/3.12.rst:1292 +msgid "" +"Several names deprecated in the :mod:`configparser` way back in 3.2 have " +"been removed per :gh:`89336`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1295 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1288 +#: ../../whatsnew/3.12.rst:1297 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1290 +#: ../../whatsnew/3.12.rst:1299 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1293 +#: ../../whatsnew/3.12.rst:1303 +msgid "distutils" +msgstr "" + +#: ../../whatsnew/3.12.rst:1305 msgid "" -"``distutils``: Remove the ``distutils`` package. It was deprecated in Python " -"3.10 by :pep:`632` \"Deprecate distutils module\". For projects still using " +"Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " +"by :pep:`632` \"Deprecate distutils module\". For projects still using " "``distutils`` and cannot be updated to something else, the ``setuptools`` " "project can be installed: it still provides ``distutils``. (Contributed by " "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1299 +#: ../../whatsnew/3.12.rst:1312 +msgid "ensurepip" +msgstr "" + +#: ../../whatsnew/3.12.rst:1314 msgid "" -":mod:`ensurepip`: Remove the bundled setuptools wheel from :mod:`ensurepip`, " -"and stop installing setuptools in environments created by :mod:`venv`." +"Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " +"installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1302 +#: ../../whatsnew/3.12.rst:1317 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1844,7 +1867,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1308 +#: ../../whatsnew/3.12.rst:1323 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1854,229 +1877,253 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1315 +#: ../../whatsnew/3.12.rst:1330 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1333 +msgid "enum" +msgstr "" + +#: ../../whatsnew/3.12.rst:1335 msgid "" -":mod:`enum`: Remove ``EnumMeta.__getattr__``, which is no longer needed for " +"Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1321 +#: ../../whatsnew/3.12.rst:1340 +msgid "ftplib" +msgstr "" + +#: ../../whatsnew/3.12.rst:1342 msgid "" -":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " +"Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1325 +#: ../../whatsnew/3.12.rst:1347 +msgid "gzip" +msgstr "" + +#: ../../whatsnew/3.12.rst:1349 msgid "" -":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " +"Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " "instead. In write mode, the ``filename`` attribute added ``'.gz'`` file " "extension if it was not present. (Contributed by Victor Stinner in :gh:" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1331 +#: ../../whatsnew/3.12.rst:1356 +msgid "hashlib" +msgstr "" + +#: ../../whatsnew/3.12.rst:1358 msgid "" -":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." +"Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " "OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a C implementation " "of :func:`~hashlib.pbkdf2_hmac()` which is faster. (Contributed by Victor " "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1365 ../../whatsnew/3.12.rst:1392 +msgid "importlib" +msgstr "importlib" + +#: ../../whatsnew/3.12.rst:1367 msgid "" -":mod:`importlib`: Many previously deprecated cleanups in :mod:`importlib` " -"have now been completed:" +"Many previously deprecated cleanups in :mod:`importlib` have now been " +"completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1370 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1343 +#: ../../whatsnew/3.12.rst:1373 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1377 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1380 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1353 +#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1392 +msgid "imp" +msgstr "imp" + +#: ../../whatsnew/3.12.rst:1386 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1389 msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1359 -msgid "imp" -msgstr "imp" - -#: ../../whatsnew/3.12.rst:1359 -msgid "importlib" -msgstr "importlib" - -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1394 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1394 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1362 +#: ../../whatsnew/3.12.rst:1395 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1362 +#: ../../whatsnew/3.12.rst:1395 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1363 +#: ../../whatsnew/3.12.rst:1396 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1363 +#: ../../whatsnew/3.12.rst:1396 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1397 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1397 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1398 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1398 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1399 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1399 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1400 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1400 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1368 +#: ../../whatsnew/3.12.rst:1401 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1368 +#: ../../whatsnew/3.12.rst:1401 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1369 +#: ../../whatsnew/3.12.rst:1402 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1369 +#: ../../whatsnew/3.12.rst:1402 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1403 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1403 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1373 +#: ../../whatsnew/3.12.rst:1406 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1388 +#: ../../whatsnew/3.12.rst:1421 msgid "Removed :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1423 msgid "undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1425 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1426 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1427 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1428 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1430 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1432 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1403 +#: ../../whatsnew/3.12.rst:1437 +msgid "io" +msgstr "" + +#: ../../whatsnew/3.12.rst:1439 msgid "" -":mod:`io`: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " +"Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." "open`) function is a built-in function. Since Python 3.10, :func:`!_pyio." "open` is also a static method. (Contributed by Victor Stinner in :gh:" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1409 +#: ../../whatsnew/3.12.rst:1446 +msgid "locale" +msgstr "" + +#: ../../whatsnew/3.12.rst:1448 msgid "" -":mod:`locale`: Remove the :func:`!locale.format` function, deprecated in " -"Python 3.7: use :func:`locale.format_string` instead. (Contributed by Victor " +"Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " +"3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1413 +#: ../../whatsnew/3.12.rst:1452 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2084,27 +2131,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1421 +#: ../../whatsnew/3.12.rst:1463 msgid "" -":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " -"deprecated in Python 3.10, are now removed:" +"The following undocumented :mod:`sqlite3` features, deprecated in Python " +"3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1466 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1425 +#: ../../whatsnew/3.12.rst:1467 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1427 +#: ../../whatsnew/3.12.rst:1469 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1472 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2112,22 +2159,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1477 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1437 -msgid ":mod:`ssl`:" +#: ../../whatsnew/3.12.rst:1480 +msgid "ssl" msgstr "" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1482 msgid "" -"Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " -"3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " -"by Victor Stinner in :gh:`94199`.)" +"Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " +"Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " +"(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1486 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2135,7 +2182,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1492 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2146,205 +2193,220 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1458 -msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" +#: ../../whatsnew/3.12.rst:1504 +msgid "Removed many old deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1460 +#: ../../whatsnew/3.12.rst:1506 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1509 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1509 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1509 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1511 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1465 ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1518 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1465 ../../whatsnew/3.12.rst:1466 -#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:1468 -#: ../../whatsnew/3.12.rst:1469 ../../whatsnew/3.12.rst:1470 -#: ../../whatsnew/3.12.rst:1471 +#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1516 +#: ../../whatsnew/3.12.rst:1517 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1512 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1512 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1513 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:1473 +#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1519 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1514 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1468 ../../whatsnew/3.12.rst:1474 +#: ../../whatsnew/3.12.rst:1514 ../../whatsnew/3.12.rst:1520 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1515 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1469 ../../whatsnew/3.12.rst:1475 +#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1521 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1516 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1470 ../../whatsnew/3.12.rst:1476 +#: ../../whatsnew/3.12.rst:1516 ../../whatsnew/3.12.rst:1522 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1471 +#: ../../whatsnew/3.12.rst:1517 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1471 +#: ../../whatsnew/3.12.rst:1517 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1518 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1472 ../../whatsnew/3.12.rst:1473 -#: ../../whatsnew/3.12.rst:1474 ../../whatsnew/3.12.rst:1475 -#: ../../whatsnew/3.12.rst:1476 ../../whatsnew/3.12.rst:1477 -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1518 ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1520 ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1522 ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1524 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1473 +#: ../../whatsnew/3.12.rst:1519 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1474 +#: ../../whatsnew/3.12.rst:1520 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1475 +#: ../../whatsnew/3.12.rst:1521 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1476 +#: ../../whatsnew/3.12.rst:1522 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1477 +#: ../../whatsnew/3.12.rst:1523 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1477 +#: ../../whatsnew/3.12.rst:1523 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1524 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1524 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1479 +#: ../../whatsnew/3.12.rst:1525 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1479 +#: ../../whatsnew/3.12.rst:1525 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1479 +#: ../../whatsnew/3.12.rst:1525 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1482 +#: ../../whatsnew/3.12.rst:1528 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1485 +#: ../../whatsnew/3.12.rst:1531 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1488 +#: ../../whatsnew/3.12.rst:1534 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1538 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1495 +#: ../../whatsnew/3.12.rst:1541 msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1497 +#: ../../whatsnew/3.12.rst:1544 +msgid "webbrowser" +msgstr "" + +#: ../../whatsnew/3.12.rst:1546 msgid "" -":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" -"`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " -"Skipstone, Iceape, Firebird, and Firefox versions 35 and below (:gh:" -"`102871`)." +"Remove support for obsolete browsers from :mod:`webbrowser`. Removed " +"browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " +"Firebird, and Firefox versions 35 and below (:gh:`102871`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1551 +msgid "xml.etree.ElementTree" msgstr "" -#: ../../whatsnew/3.12.rst:1501 +#: ../../whatsnew/3.12.rst:1553 msgid "" -":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " -"method of the pure Python implementation, deprecated in Python 3.10, use " -"the :func:`copy.copy` function instead. The C implementation of :mod:`xml." -"etree.ElementTree` has no ``copy()`` method, only a ``__copy__()`` method. " -"(Contributed by Victor Stinner in :gh:`94383`.)" +"Remove the ``ElementTree.Element.copy()`` method of the pure Python " +"implementation, deprecated in Python 3.10, use the :func:`copy.copy` " +"function instead. The C implementation of :mod:`xml.etree.ElementTree` has " +"no ``copy()`` method, only a ``__copy__()`` method. (Contributed by Victor " +"Stinner in :gh:`94383`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1560 +msgid "zipimport" msgstr "" -#: ../../whatsnew/3.12.rst:1507 +#: ../../whatsnew/3.12.rst:1562 msgid "" -":mod:`zipimport`: Remove ``find_loader()`` and ``find_module()`` methods, " +"Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1568 +msgid "Others" +msgstr "" + +#: ../../whatsnew/3.12.rst:1570 msgid "" "Removed the ``suspicious`` rule from the documentation Makefile, and removed " "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1575 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2354,21 +2416,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1528 ../../whatsnew/3.12.rst:1840 +#: ../../whatsnew/3.12.rst:1586 ../../whatsnew/3.12.rst:1898 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1530 +#: ../../whatsnew/3.12.rst:1588 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1534 +#: ../../whatsnew/3.12.rst:1592 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1536 +#: ../../whatsnew/3.12.rst:1594 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2377,7 +2439,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1543 +#: ../../whatsnew/3.12.rst:1601 msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -2389,7 +2451,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1609 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2399,21 +2461,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1557 +#: ../../whatsnew/3.12.rst:1615 msgid "" "Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1561 +#: ../../whatsnew/3.12.rst:1619 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1566 +#: ../../whatsnew/3.12.rst:1624 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2421,7 +2483,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1629 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2433,7 +2495,7 @@ msgid "" "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1580 +#: ../../whatsnew/3.12.rst:1638 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2445,64 +2507,64 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1651 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1598 +#: ../../whatsnew/3.12.rst:1656 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" "pep:`701`. This means that ``STRING`` tokens are not emitted any more for f-" "strings and the tokens described in :pep:`701` are now produced instead: " -"``FSTRING_START``, ``FSRING_MIDDLE`` and ``FSTRING_END`` are now emitted for " -"f-string \"string\" parts in addition to the appropriate tokens for the " +"``FSTRING_START``, ``FSTRING_MIDDLE`` and ``FSTRING_END`` are now emitted " +"for f-string \"string\" parts in addition to the appropriate tokens for the " "tokenization in the expression components. For example for the f-string " "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1609 +#: ../../whatsnew/3.12.rst:1667 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1621 +#: ../../whatsnew/3.12.rst:1679 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1682 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1627 +#: ../../whatsnew/3.12.rst:1685 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1630 +#: ../../whatsnew/3.12.rst:1688 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1633 +#: ../../whatsnew/3.12.rst:1691 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1637 +#: ../../whatsnew/3.12.rst:1695 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1697 msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2511,21 +2573,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1703 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1650 +#: ../../whatsnew/3.12.rst:1708 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1654 +#: ../../whatsnew/3.12.rst:1712 msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2534,46 +2596,46 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1660 +#: ../../whatsnew/3.12.rst:1718 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1662 +#: ../../whatsnew/3.12.rst:1720 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1663 +#: ../../whatsnew/3.12.rst:1721 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1664 +#: ../../whatsnew/3.12.rst:1722 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1666 +#: ../../whatsnew/3.12.rst:1724 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1668 +#: ../../whatsnew/3.12.rst:1726 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1670 +#: ../../whatsnew/3.12.rst:1728 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1674 +#: ../../whatsnew/3.12.rst:1732 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1678 +#: ../../whatsnew/3.12.rst:1736 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1684 +#: ../../whatsnew/3.12.rst:1742 msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2581,84 +2643,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1748 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1750 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1693 +#: ../../whatsnew/3.12.rst:1751 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1753 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1755 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1756 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1699 +#: ../../whatsnew/3.12.rst:1757 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1759 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1762 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1764 msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1709 +#: ../../whatsnew/3.12.rst:1767 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1711 +#: ../../whatsnew/3.12.rst:1769 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1713 +#: ../../whatsnew/3.12.rst:1771 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1774 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1777 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1721 +#: ../../whatsnew/3.12.rst:1779 msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -2666,29 +2728,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1726 +#: ../../whatsnew/3.12.rst:1784 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1730 +#: ../../whatsnew/3.12.rst:1788 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1731 +#: ../../whatsnew/3.12.rst:1789 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1732 +#: ../../whatsnew/3.12.rst:1790 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1733 +#: ../../whatsnew/3.12.rst:1791 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1735 +#: ../../whatsnew/3.12.rst:1793 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -2699,7 +2761,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1743 +#: ../../whatsnew/3.12.rst:1801 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2707,32 +2769,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1748 +#: ../../whatsnew/3.12.rst:1806 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1752 +#: ../../whatsnew/3.12.rst:1810 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1753 +#: ../../whatsnew/3.12.rst:1811 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1754 +#: ../../whatsnew/3.12.rst:1812 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr "" -#: ../../whatsnew/3.12.rst:1756 +#: ../../whatsnew/3.12.rst:1814 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1760 +#: ../../whatsnew/3.12.rst:1818 msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -2740,14 +2802,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1766 +#: ../../whatsnew/3.12.rst:1824 msgid "" "Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " "sets the vectorcall field of a given :c:type:`PyFunctionObject`. " "(Contributed by Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1770 +#: ../../whatsnew/3.12.rst:1828 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2756,28 +2818,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1776 +#: ../../whatsnew/3.12.rst:1834 msgid "" "Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1780 +#: ../../whatsnew/3.12.rst:1838 msgid "" "Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1785 +#: ../../whatsnew/3.12.rst:1843 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1789 +#: ../../whatsnew/3.12.rst:1847 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2787,14 +2849,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1797 +#: ../../whatsnew/3.12.rst:1855 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1801 +#: ../../whatsnew/3.12.rst:1859 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2802,71 +2864,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1806 +#: ../../whatsnew/3.12.rst:1864 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1810 +#: ../../whatsnew/3.12.rst:1868 msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1813 +#: ../../whatsnew/3.12.rst:1871 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1814 +#: ../../whatsnew/3.12.rst:1872 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1815 +#: ../../whatsnew/3.12.rst:1873 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1816 +#: ../../whatsnew/3.12.rst:1874 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1817 +#: ../../whatsnew/3.12.rst:1875 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1818 +#: ../../whatsnew/3.12.rst:1876 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1819 +#: ../../whatsnew/3.12.rst:1877 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1820 +#: ../../whatsnew/3.12.rst:1878 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1821 +#: ../../whatsnew/3.12.rst:1879 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1824 +#: ../../whatsnew/3.12.rst:1882 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1823 +#: ../../whatsnew/3.12.rst:1881 msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1826 +#: ../../whatsnew/3.12.rst:1884 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1828 +#: ../../whatsnew/3.12.rst:1886 msgid "" ":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " "and :c:type:`PyInterpreterConfig`, which may be used to create sub-" @@ -2874,27 +2936,27 @@ msgid "" "info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1834 +#: ../../whatsnew/3.12.rst:1892 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1842 +#: ../../whatsnew/3.12.rst:1900 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1845 +#: ../../whatsnew/3.12.rst:1903 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1849 +#: ../../whatsnew/3.12.rst:1907 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2903,7 +2965,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1856 +#: ../../whatsnew/3.12.rst:1914 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -2911,13 +2973,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1861 +#: ../../whatsnew/3.12.rst:1919 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1865 +#: ../../whatsnew/3.12.rst:1923 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -2926,7 +2988,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1871 +#: ../../whatsnew/3.12.rst:1929 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2935,13 +2997,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1877 +#: ../../whatsnew/3.12.rst:1935 msgid "" "Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1881 +#: ../../whatsnew/3.12.rst:1939 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -2955,7 +3017,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1893 +#: ../../whatsnew/3.12.rst:1951 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -2963,7 +3025,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1898 +#: ../../whatsnew/3.12.rst:1956 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -2971,7 +3033,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1903 +#: ../../whatsnew/3.12.rst:1961 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -2979,7 +3041,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1908 +#: ../../whatsnew/3.12.rst:1966 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -2987,25 +3049,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1913 +#: ../../whatsnew/3.12.rst:1971 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1916 +#: ../../whatsnew/3.12.rst:1974 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1917 +#: ../../whatsnew/3.12.rst:1975 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1918 +#: ../../whatsnew/3.12.rst:1976 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1920 +#: ../../whatsnew/3.12.rst:1978 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -3013,14 +3075,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1925 +#: ../../whatsnew/3.12.rst:1983 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:1929 +#: ../../whatsnew/3.12.rst:1987 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -3029,17 +3091,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1936 +#: ../../whatsnew/3.12.rst:1994 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1938 +#: ../../whatsnew/3.12.rst:1996 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1940 +#: ../../whatsnew/3.12.rst:1998 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3047,20 +3109,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:1945 +#: ../../whatsnew/3.12.rst:2003 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:1949 +#: ../../whatsnew/3.12.rst:2007 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:1952 +#: ../../whatsnew/3.12.rst:2010 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3068,14 +3130,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:1957 +#: ../../whatsnew/3.12.rst:2015 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:2019 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3086,15 +3148,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:2027 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr "" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:2028 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr "" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:2030 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3103,281 +3165,281 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:1982 +#: ../../whatsnew/3.12.rst:2040 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:1984 +#: ../../whatsnew/3.12.rst:2042 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:2043 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:1986 +#: ../../whatsnew/3.12.rst:2044 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:1987 +#: ../../whatsnew/3.12.rst:2045 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:1988 +#: ../../whatsnew/3.12.rst:2046 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:1989 +#: ../../whatsnew/3.12.rst:2047 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:1990 +#: ../../whatsnew/3.12.rst:2048 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:1991 +#: ../../whatsnew/3.12.rst:2049 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:1992 +#: ../../whatsnew/3.12.rst:2050 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:1993 +#: ../../whatsnew/3.12.rst:2051 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:1994 +#: ../../whatsnew/3.12.rst:2052 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:1995 +#: ../../whatsnew/3.12.rst:2053 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:1996 +#: ../../whatsnew/3.12.rst:2054 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1997 +#: ../../whatsnew/3.12.rst:2055 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:1999 +#: ../../whatsnew/3.12.rst:2057 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:2000 +#: ../../whatsnew/3.12.rst:2058 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2001 +#: ../../whatsnew/3.12.rst:2059 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:2002 +#: ../../whatsnew/3.12.rst:2060 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2061 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2004 +#: ../../whatsnew/3.12.rst:2062 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:2005 +#: ../../whatsnew/3.12.rst:2063 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:2007 +#: ../../whatsnew/3.12.rst:2065 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2011 +#: ../../whatsnew/3.12.rst:2069 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:2014 +#: ../../whatsnew/3.12.rst:2072 msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:2017 +#: ../../whatsnew/3.12.rst:2075 msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2020 +#: ../../whatsnew/3.12.rst:2078 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" -#: ../../whatsnew/3.12.rst:2022 +#: ../../whatsnew/3.12.rst:2080 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2024 +#: ../../whatsnew/3.12.rst:2082 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:2027 +#: ../../whatsnew/3.12.rst:2085 msgid "Several items are not exposed from ``Python.h``:" msgstr "" -#: ../../whatsnew/3.12.rst:2029 +#: ../../whatsnew/3.12.rst:2087 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:2030 +#: ../../whatsnew/3.12.rst:2088 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:2031 +#: ../../whatsnew/3.12.rst:2089 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:2032 +#: ../../whatsnew/3.12.rst:2090 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:2034 +#: ../../whatsnew/3.12.rst:2092 msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2037 +#: ../../whatsnew/3.12.rst:2095 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2042 +#: ../../whatsnew/3.12.rst:2100 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2103 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2050 +#: ../../whatsnew/3.12.rst:2108 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2053 +#: ../../whatsnew/3.12.rst:2111 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2056 +#: ../../whatsnew/3.12.rst:2114 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2064 +#: ../../whatsnew/3.12.rst:2122 msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``token.h`` header file was only designed to be used by Python " "internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2069 +#: ../../whatsnew/3.12.rst:2127 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2071 +#: ../../whatsnew/3.12.rst:2129 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2072 +#: ../../whatsnew/3.12.rst:2130 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2073 +#: ../../whatsnew/3.12.rst:2131 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2074 +#: ../../whatsnew/3.12.rst:2132 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2075 +#: ../../whatsnew/3.12.rst:2133 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2076 +#: ../../whatsnew/3.12.rst:2134 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2077 +#: ../../whatsnew/3.12.rst:2135 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2078 +#: ../../whatsnew/3.12.rst:2136 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2079 +#: ../../whatsnew/3.12.rst:2137 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2081 +#: ../../whatsnew/3.12.rst:2139 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2084 +#: ../../whatsnew/3.12.rst:2142 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2087 +#: ../../whatsnew/3.12.rst:2145 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" From b482970ec0fe59bd52b0e7d7e31091de7f17a91f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 14 Sep 2023 00:05:41 +0000 Subject: [PATCH 16/18] sync with cpython 5b38bdea --- library/importlib.po | 427 ++++++++++++++++++++--------- library/importlib.resources.abc.po | 55 ++-- library/traceback.po | 159 +++++------ sphinx.po | 7 +- 4 files changed, 412 insertions(+), 236 deletions(-) diff --git a/library/importlib.po b/library/importlib.po index 2f7398079e..ae8037bd2d 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-29 12:27+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -728,7 +728,7 @@ msgstr "" msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:548 ../../library/importlib.rst:989 +#: ../../library/importlib.rst:548 ../../library/importlib.rst:1143 msgid "Returns :attr:`path`." msgstr "" @@ -855,58 +855,231 @@ msgid "" msgstr "" #: ../../library/importlib.rst:650 -msgid ":mod:`importlib.machinery` -- Importers and path hooks" +msgid "*Superseded by TraversableResources*" +msgstr "" + +#: ../../library/importlib.rst:652 +msgid "" +"An :term:`abstract base class` to provide the ability to read *resources*." msgstr "" #: ../../library/importlib.rst:655 +msgid "" +"From the perspective of this ABC, a *resource* is a binary artifact that is " +"shipped within a package. Typically this is something like a data file that " +"lives next to the ``__init__.py`` file of the package. The purpose of this " +"class is to help abstract out the accessing of such data files so that it " +"does not matter if the package and its data file(s) are stored in a e.g. zip " +"file versus on the file system." +msgstr "" + +#: ../../library/importlib.rst:663 +msgid "" +"For any of methods of this class, a *resource* argument is expected to be a :" +"term:`path-like object` which represents conceptually just a file name. This " +"means that no subdirectory paths should be included in the *resource* " +"argument. This is because the location of the package the reader is for, " +"acts as the \"directory\". Hence the metaphor for directories and file names " +"is packages and resources, respectively. This is also why instances of this " +"class are expected to directly correlate to a specific package (instead of " +"potentially representing multiple packages or a module)." +msgstr "" + +#: ../../library/importlib.rst:674 +msgid "" +"Loaders that wish to support resource reading are expected to provide a " +"method called ``get_resource_reader(fullname)`` which returns an object " +"implementing this ABC's interface. If the module specified by fullname is " +"not a package, this method should return :const:`None`. An object compatible " +"with this ABC should only be returned when the specified module is a package." +msgstr "" + +#: ../../library/importlib.rst:685 ../../library/importlib.rst:795 +msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." +msgstr "" + +#: ../../library/importlib.rst:688 +msgid "" +"Returns an opened, :term:`file-like object` for binary reading of the " +"*resource*." +msgstr "" + +#: ../../library/importlib.rst:691 +msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." +msgstr "" + +#: ../../library/importlib.rst:696 +msgid "Returns the file system path to the *resource*." +msgstr "" + +#: ../../library/importlib.rst:698 +msgid "" +"If the resource does not concretely exist on the file system, raise :exc:" +"`FileNotFoundError`." +msgstr "" + +#: ../../library/importlib.rst:703 +msgid "" +"Returns ``True`` if the named *name* is considered a resource. :exc:" +"`FileNotFoundError` is raised if *name* does not exist." +msgstr "" + +#: ../../library/importlib.rst:708 +msgid "" +"Returns an :term:`iterable` of strings over the contents of the package. Do " +"note that it is not required that all names returned by the iterator be " +"actual resources, e.g. it is acceptable to return names for which :meth:" +"`is_resource` would be false." +msgstr "" + +#: ../../library/importlib.rst:714 +msgid "" +"Allowing non-resource names to be returned is to allow for situations where " +"how a package and its resources are stored are known a priori and the non-" +"resource names would be useful. For instance, returning subdirectory names " +"is allowed so that when it is known that the package and resources are " +"stored on the file system then those subdirectory names can be used directly." +msgstr "" + +#: ../../library/importlib.rst:722 +msgid "The abstract method returns an iterable of no items." +msgstr "" + +#: ../../library/importlib.rst:727 +msgid "" +"An object with a subset of :class:`pathlib.Path` methods suitable for " +"traversing directories and opening files." +msgstr "" + +#: ../../library/importlib.rst:730 +msgid "" +"For a representation of the object on the file-system, use :meth:`importlib." +"resources.as_file`." +msgstr "" + +#: ../../library/importlib.rst:737 +msgid "Use :class:`importlib.resources.abc.Traversable` instead." +msgstr "" + +#: ../../library/importlib.rst:740 +msgid "Abstract. The base name of this object without any parent references." +msgstr "" + +#: ../../library/importlib.rst:744 +msgid "Yield ``Traversable`` objects in ``self``." +msgstr "" + +#: ../../library/importlib.rst:748 +msgid "Return ``True`` if ``self`` is a directory." +msgstr "" + +#: ../../library/importlib.rst:752 +msgid "Return ``True`` if ``self`` is a file." +msgstr "" + +#: ../../library/importlib.rst:756 +msgid "Return Traversable child in ``self``." +msgstr "" + +#: ../../library/importlib.rst:760 +msgid "Return ``Traversable`` child in ``self``." +msgstr "" + +#: ../../library/importlib.rst:764 +msgid "" +"*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " +"suitable for reading (same as :attr:`pathlib.Path.open`)." +msgstr "" + +#: ../../library/importlib.rst:767 +msgid "" +"When opening as text, accepts encoding parameters such as those accepted by :" +"attr:`io.TextIOWrapper`." +msgstr "" + +#: ../../library/importlib.rst:772 +msgid "Read contents of ``self`` as bytes." +msgstr "" + +#: ../../library/importlib.rst:776 +msgid "Read contents of ``self`` as text." +msgstr "" + +#: ../../library/importlib.rst:781 +msgid "" +"An abstract base class for resource readers capable of serving the :meth:" +"`importlib.resources.files` interface. Subclasses :class:`importlib." +"resources.abc.ResourceReader` and provides concrete implementations of the :" +"class:`importlib.resources.abc.ResourceReader`'s abstract methods. " +"Therefore, any loader supplying :class:`importlib.abc.TraversableResources` " +"also supplies ResourceReader." +msgstr "" + +#: ../../library/importlib.rst:788 +msgid "" +"Loaders that wish to support resource reading are expected to implement this " +"interface." +msgstr "" + +#: ../../library/importlib.rst:798 +msgid "" +"Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " +"package." +msgstr "" + +#: ../../library/importlib.rst:804 +msgid ":mod:`importlib.machinery` -- Importers and path hooks" +msgstr "" + +#: ../../library/importlib.rst:809 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:659 +#: ../../library/importlib.rst:813 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:664 +#: ../../library/importlib.rst:818 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:671 +#: ../../library/importlib.rst:825 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:676 ../../library/importlib.rst:686 +#: ../../library/importlib.rst:830 ../../library/importlib.rst:840 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:681 +#: ../../library/importlib.rst:835 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:691 +#: ../../library/importlib.rst:845 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:696 +#: ../../library/importlib.rst:850 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:701 +#: ../../library/importlib.rst:855 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:708 +#: ../../library/importlib.rst:862 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -915,57 +1088,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:719 +#: ../../library/importlib.rst:873 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:724 ../../library/importlib.rst:738 -#: ../../library/importlib.rst:751 ../../library/importlib.rst:766 +#: ../../library/importlib.rst:878 ../../library/importlib.rst:892 +#: ../../library/importlib.rst:905 ../../library/importlib.rst:920 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:727 +#: ../../library/importlib.rst:881 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:734 +#: ../../library/importlib.rst:888 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:741 +#: ../../library/importlib.rst:895 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:748 +#: ../../library/importlib.rst:902 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:756 +#: ../../library/importlib.rst:910 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:763 +#: ../../library/importlib.rst:917 msgid "" "A :term:`Finder ` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:771 +#: ../../library/importlib.rst:925 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -979,43 +1152,43 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:785 +#: ../../library/importlib.rst:939 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:792 +#: ../../library/importlib.rst:946 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:797 +#: ../../library/importlib.rst:951 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:800 +#: ../../library/importlib.rst:954 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:807 +#: ../../library/importlib.rst:961 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:810 +#: ../../library/importlib.rst:964 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:813 +#: ../../library/importlib.rst:967 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1023,7 +1196,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:818 +#: ../../library/importlib.rst:972 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1036,166 +1209,166 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:832 +#: ../../library/importlib.rst:986 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:836 +#: ../../library/importlib.rst:990 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:842 +#: ../../library/importlib.rst:996 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:846 +#: ../../library/importlib.rst:1000 msgid "" "A class method which returns a closure for use on :data:`sys.path_hooks`. An " "instance of :class:`FileFinder` is returned by the closure using the path " "argument given to the closure directly and *loader_details* indirectly." msgstr "" -#: ../../library/importlib.rst:851 +#: ../../library/importlib.rst:1005 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:857 +#: ../../library/importlib.rst:1011 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:865 +#: ../../library/importlib.rst:1019 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:869 +#: ../../library/importlib.rst:1023 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:873 +#: ../../library/importlib.rst:1027 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:877 +#: ../../library/importlib.rst:1031 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:881 +#: ../../library/importlib.rst:1035 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:885 ../../library/importlib.rst:928 +#: ../../library/importlib.rst:1039 ../../library/importlib.rst:1082 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:890 ../../library/importlib.rst:933 +#: ../../library/importlib.rst:1044 ../../library/importlib.rst:1087 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:895 +#: ../../library/importlib.rst:1049 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:898 +#: ../../library/importlib.rst:1052 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:907 +#: ../../library/importlib.rst:1061 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:911 +#: ../../library/importlib.rst:1065 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:915 +#: ../../library/importlib.rst:1069 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:919 +#: ../../library/importlib.rst:1073 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:923 +#: ../../library/importlib.rst:1077 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:938 +#: ../../library/importlib.rst:1092 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:941 +#: ../../library/importlib.rst:1095 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:944 +#: ../../library/importlib.rst:1098 msgid "" "Note that, by default, importing an extension module will fail in " "subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " "even if it would otherwise import successfully." msgstr "" -#: ../../library/importlib.rst:950 +#: ../../library/importlib.rst:1104 msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: ../../library/importlib.rst:955 +#: ../../library/importlib.rst:1109 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:959 +#: ../../library/importlib.rst:1113 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:963 +#: ../../library/importlib.rst:1117 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:970 +#: ../../library/importlib.rst:1124 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:976 +#: ../../library/importlib.rst:1130 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:981 +#: ../../library/importlib.rst:1135 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:985 +#: ../../library/importlib.rst:1139 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:996 +#: ../../library/importlib.rst:1150 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1014 +#: ../../library/importlib.rst:1168 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's :attr:`__spec__` attribute. In the " @@ -1208,31 +1381,31 @@ msgid "" "reflected in the module's :attr:`__spec__.origin`, and vice versa." msgstr "" -#: ../../library/importlib.rst:1028 +#: ../../library/importlib.rst:1182 msgid "(:attr:`__name__`)" msgstr "(:attr:`__name__`)" -#: ../../library/importlib.rst:1030 +#: ../../library/importlib.rst:1184 msgid "" "The module's fully qualified name. The :term:`finder` should always set this " "attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1035 +#: ../../library/importlib.rst:1189 msgid "(:attr:`__loader__`)" msgstr "(:attr:`__loader__`)" -#: ../../library/importlib.rst:1037 +#: ../../library/importlib.rst:1191 msgid "" "The :term:`loader` used to load the module. The :term:`finder` should always " "set this attribute." msgstr "" -#: ../../library/importlib.rst:1042 +#: ../../library/importlib.rst:1196 msgid "(:attr:`__file__`)" msgstr "(:attr:`__file__`)" -#: ../../library/importlib.rst:1044 +#: ../../library/importlib.rst:1198 msgid "" "The location the :term:`loader` should use to load the module. For example, " "for modules loaded from a .py file this is the filename. The :term:`finder` " @@ -1241,11 +1414,11 @@ msgid "" "namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1052 +#: ../../library/importlib.rst:1206 msgid "(:attr:`__path__`)" msgstr "(:attr:`__path__`)" -#: ../../library/importlib.rst:1054 +#: ../../library/importlib.rst:1208 msgid "" "The list of locations where the package's submodules will be found. Most of " "the time this is a single directory. The :term:`finder` should set this " @@ -1255,66 +1428,66 @@ msgid "" "packages." msgstr "" -#: ../../library/importlib.rst:1063 +#: ../../library/importlib.rst:1217 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1069 +#: ../../library/importlib.rst:1223 msgid "(:attr:`__cached__`)" msgstr "(:attr:`__cached__`)" -#: ../../library/importlib.rst:1071 +#: ../../library/importlib.rst:1225 msgid "" "The filename of a compiled version of the module's code. The :term:`finder` " "should always set this attribute but it may be ``None`` for modules that do " "not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1077 +#: ../../library/importlib.rst:1231 msgid "(:attr:`__package__`)" msgstr "(:attr:`__package__`)" -#: ../../library/importlib.rst:1079 +#: ../../library/importlib.rst:1233 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " "empty string for a top-level module). If the module is a package then this " "is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1086 +#: ../../library/importlib.rst:1240 msgid "``True`` if the spec's :attr:`origin` refers to a loadable location," msgstr "" -#: ../../library/importlib.rst:1086 +#: ../../library/importlib.rst:1240 msgid "" "``False`` otherwise. This value impacts how :attr:`origin` is interpreted " "and how the module's :attr:`__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1091 +#: ../../library/importlib.rst:1245 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1097 +#: ../../library/importlib.rst:1251 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1101 +#: ../../library/importlib.rst:1255 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1106 +#: ../../library/importlib.rst:1260 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1113 +#: ../../library/importlib.rst:1267 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1324,7 +1497,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1120 +#: ../../library/importlib.rst:1274 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1337,7 +1510,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1130 +#: ../../library/importlib.rst:1284 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1346,18 +1519,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1138 +#: ../../library/importlib.rst:1292 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1142 ../../library/importlib.rst:1158 -#: ../../library/importlib.rst:1247 +#: ../../library/importlib.rst:1296 ../../library/importlib.rst:1312 +#: ../../library/importlib.rst:1401 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1148 +#: ../../library/importlib.rst:1302 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1367,25 +1540,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1163 +#: ../../library/importlib.rst:1317 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1171 +#: ../../library/importlib.rst:1325 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1173 +#: ../../library/importlib.rst:1327 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1178 +#: ../../library/importlib.rst:1332 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1393,13 +1566,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1186 +#: ../../library/importlib.rst:1340 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1193 +#: ../../library/importlib.rst:1347 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1409,30 +1582,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1200 +#: ../../library/importlib.rst:1354 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1203 +#: ../../library/importlib.rst:1357 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1207 +#: ../../library/importlib.rst:1361 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1214 +#: ../../library/importlib.rst:1368 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1217 +#: ../../library/importlib.rst:1371 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1440,14 +1613,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1222 +#: ../../library/importlib.rst:1376 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1230 +#: ../../library/importlib.rst:1384 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1456,7 +1629,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1240 +#: ../../library/importlib.rst:1394 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1464,14 +1637,14 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1252 +#: ../../library/importlib.rst:1406 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1260 +#: ../../library/importlib.rst:1414 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1480,33 +1653,33 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: ../../library/importlib.rst:1267 +#: ../../library/importlib.rst:1421 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: ../../library/importlib.rst:1271 +#: ../../library/importlib.rst:1425 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " "multiple interpreters (or per-interpreter GIL)." msgstr "" -#: ../../library/importlib.rst:1276 +#: ../../library/importlib.rst:1430 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1284 +#: ../../library/importlib.rst:1438 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1287 +#: ../../library/importlib.rst:1441 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1519,7 +1692,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1298 +#: ../../library/importlib.rst:1452 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1528,70 +1701,70 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1306 +#: ../../library/importlib.rst:1460 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1313 +#: ../../library/importlib.rst:1467 msgid "" "A class method which returns a callable that creates a lazy loader. This is " "meant to be used in situations where the loader is passed by class instead " "of by instance. ::" msgstr "" -#: ../../library/importlib.rst:1326 +#: ../../library/importlib.rst:1480 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1329 +#: ../../library/importlib.rst:1483 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1331 +#: ../../library/importlib.rst:1485 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1340 +#: ../../library/importlib.rst:1494 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1342 +#: ../../library/importlib.rst:1496 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1345 +#: ../../library/importlib.rst:1499 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1368 +#: ../../library/importlib.rst:1522 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1370 +#: ../../library/importlib.rst:1524 msgid "To import a Python source file directly, use the following recipe::" msgstr "" -#: ../../library/importlib.rst:1387 +#: ../../library/importlib.rst:1541 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1389 +#: ../../library/importlib.rst:1543 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1411 +#: ../../library/importlib.rst:1565 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1413 +#: ../../library/importlib.rst:1567 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1605,11 +1778,11 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1445 +#: ../../library/importlib.rst:1599 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1447 +#: ../../library/importlib.rst:1601 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index c600f6586d..31ba47eca2 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -65,38 +65,37 @@ msgid "" "with this ABC should only be returned when the specified module is a package." msgstr "" -#: ../../library/importlib.resources.abc.rst:50 -#: ../../library/importlib.resources.abc.rst:160 +#: ../../library/importlib.resources.abc.rst:48 msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." msgstr "" -#: ../../library/importlib.resources.abc.rst:53 +#: ../../library/importlib.resources.abc.rst:51 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:56 +#: ../../library/importlib.resources.abc.rst:54 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.resources.abc.rst:61 +#: ../../library/importlib.resources.abc.rst:59 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:63 +#: ../../library/importlib.resources.abc.rst:61 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.resources.abc.rst:68 +#: ../../library/importlib.resources.abc.rst:66 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.resources.abc.rst:73 +#: ../../library/importlib.resources.abc.rst:71 msgid "" "Returns an :term:`iterable` of strings over the contents of the package. Do " "note that it is not required that all names returned by the iterator be " @@ -104,7 +103,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.resources.abc.rst:79 +#: ../../library/importlib.resources.abc.rst:77 msgid "" "Allowing non-resource names to be returned is to allow for situations where " "how a package and its resources are stored are known a priori and the non-" @@ -113,68 +112,64 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.resources.abc.rst:87 +#: ../../library/importlib.resources.abc.rst:85 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.resources.abc.rst:92 +#: ../../library/importlib.resources.abc.rst:90 msgid "" "An object with a subset of :class:`pathlib.Path` methods suitable for " "traversing directories and opening files." msgstr "" -#: ../../library/importlib.resources.abc.rst:95 +#: ../../library/importlib.resources.abc.rst:93 msgid "" "For a representation of the object on the file-system, use :meth:`importlib." "resources.as_file`." msgstr "" -#: ../../library/importlib.resources.abc.rst:102 -msgid "Use :class:`importlib.resources.abc.Traversable` instead." -msgstr "" - -#: ../../library/importlib.resources.abc.rst:105 +#: ../../library/importlib.resources.abc.rst:98 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.resources.abc.rst:109 +#: ../../library/importlib.resources.abc.rst:102 msgid "Yield Traversable objects in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:113 +#: ../../library/importlib.resources.abc.rst:106 msgid "Return True if self is a directory." msgstr "" -#: ../../library/importlib.resources.abc.rst:117 +#: ../../library/importlib.resources.abc.rst:110 msgid "Return True if self is a file." msgstr "" -#: ../../library/importlib.resources.abc.rst:121 -#: ../../library/importlib.resources.abc.rst:125 +#: ../../library/importlib.resources.abc.rst:114 +#: ../../library/importlib.resources.abc.rst:118 msgid "Return Traversable child in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:129 +#: ../../library/importlib.resources.abc.rst:122 msgid "" "*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " "suitable for reading (same as :attr:`pathlib.Path.open`)." msgstr "" -#: ../../library/importlib.resources.abc.rst:132 +#: ../../library/importlib.resources.abc.rst:125 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "class:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.resources.abc.rst:137 +#: ../../library/importlib.resources.abc.rst:130 msgid "Read contents of self as bytes." msgstr "" -#: ../../library/importlib.resources.abc.rst:141 +#: ../../library/importlib.resources.abc.rst:134 msgid "Read contents of self as text." msgstr "" -#: ../../library/importlib.resources.abc.rst:146 +#: ../../library/importlib.resources.abc.rst:139 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`ResourceReader` " @@ -183,13 +178,13 @@ msgid "" "TraversableResources` also supplies :class:`!ResourceReader`." msgstr "" -#: ../../library/importlib.resources.abc.rst:153 +#: ../../library/importlib.resources.abc.rst:146 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.resources.abc.rst:163 +#: ../../library/importlib.resources.abc.rst:151 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." diff --git a/library/traceback.po b/library/traceback.po index 775bdb77a3..98b2965651 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -117,7 +117,7 @@ msgid "" "exception." msgstr "" -#: ../../library/traceback.rst:73 ../../library/traceback.rst:165 +#: ../../library/traceback.rst:73 ../../library/traceback.rst:168 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" @@ -183,11 +183,11 @@ msgstr "" msgid "" "Format the exception part of a traceback using an exception value such as " "given by ``sys.last_value``. The return value is a list of strings, each " -"ending in a newline. Normally, the list contains a single string; however, " -"for :exc:`SyntaxError` exceptions, it contains several lines that (when " -"printed) display detailed information about where the syntax error occurred. " -"The message indicating which exception occurred is the always last string in " -"the list." +"ending in a newline. The list contains the exception's message, which is " +"normally a single string; however, for :exc:`SyntaxError` exceptions, it " +"contains several lines that (when printed) display detailed information " +"about where the syntax error occurred. Following the message, the list " +"contains the exception's :attr:`notes `." msgstr "" #: ../../library/traceback.rst:148 @@ -197,7 +197,11 @@ msgid "" "ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:159 +#: ../../library/traceback.rst:156 +msgid "The returned list now includes any notes attached to the exception." +msgstr "" + +#: ../../library/traceback.rst:162 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -206,66 +210,66 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: ../../library/traceback.rst:168 +#: ../../library/traceback.rst:171 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: ../../library/traceback.rst:175 +#: ../../library/traceback.rst:178 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: ../../library/traceback.rst:181 +#: ../../library/traceback.rst:184 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "" -#: ../../library/traceback.rst:186 +#: ../../library/traceback.rst:189 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "" -#: ../../library/traceback.rst:190 +#: ../../library/traceback.rst:193 msgid "" "Clears the local variables of all the stack frames in a traceback *tb* by " "calling the :meth:`clear` method of each frame object." msgstr "" -#: ../../library/traceback.rst:197 +#: ../../library/traceback.rst:200 msgid "" "Walk a stack following ``f.f_back`` from the given frame, yielding the frame " "and line number for each frame. If *f* is ``None``, the current stack is " "used. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:205 +#: ../../library/traceback.rst:208 msgid "" "Walk a traceback following ``tb_next`` yielding the frame and line number " "for each frame. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:210 +#: ../../library/traceback.rst:213 msgid "The module also defines the following classes:" msgstr "" -#: ../../library/traceback.rst:213 +#: ../../library/traceback.rst:216 msgid ":class:`TracebackException` Objects" msgstr ":class:`TracebackException` 物件" -#: ../../library/traceback.rst:217 +#: ../../library/traceback.rst:220 msgid "" ":class:`TracebackException` objects are created from actual exceptions to " "capture data for later printing in a lightweight fashion." msgstr "" -#: ../../library/traceback.rst:222 ../../library/traceback.rst:310 +#: ../../library/traceback.rst:225 ../../library/traceback.rst:319 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." msgstr "" -#: ../../library/traceback.rst:225 +#: ../../library/traceback.rst:228 msgid "" "If *compact* is true, only data that is required by :class:" "`TracebackException`'s ``format`` method is saved in the class attributes. " @@ -273,12 +277,12 @@ msgid "" "is ``None`` and ``__suppress_context__`` is false." msgstr "" -#: ../../library/traceback.rst:230 ../../library/traceback.rst:313 +#: ../../library/traceback.rst:233 ../../library/traceback.rst:322 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:232 +#: ../../library/traceback.rst:235 msgid "" "*max_group_width* and *max_group_depth* control the formatting of exception " "groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting " @@ -287,140 +291,139 @@ msgid "" "limit is exceeded." msgstr "" -#: ../../library/traceback.rst:240 +#: ../../library/traceback.rst:241 +msgid "Added the *compact* parameter." +msgstr "新增 *compact* 參數。" + +#: ../../library/traceback.rst:244 +msgid "Added the *max_group_width* and *max_group_depth* parameters." +msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" + +#: ../../library/traceback.rst:249 msgid "A :class:`TracebackException` of the original ``__cause__``." msgstr "" -#: ../../library/traceback.rst:244 +#: ../../library/traceback.rst:253 msgid "A :class:`TracebackException` of the original ``__context__``." msgstr "" -#: ../../library/traceback.rst:248 +#: ../../library/traceback.rst:257 msgid "" "If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of :" "class:`TracebackException` instances representing the nested exceptions. " "Otherwise it is ``None``." msgstr "" -#: ../../library/traceback.rst:256 +#: ../../library/traceback.rst:265 msgid "The ``__suppress_context__`` value from the original exception." msgstr "" -#: ../../library/traceback.rst:260 +#: ../../library/traceback.rst:269 msgid "" "The ``__notes__`` value from the original exception, or ``None`` if the " "exception does not have any notes. If it is not ``None`` is it formatted in " "the traceback after the exception string." msgstr "" -#: ../../library/traceback.rst:268 +#: ../../library/traceback.rst:277 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:272 +#: ../../library/traceback.rst:281 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:276 +#: ../../library/traceback.rst:285 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:280 +#: ../../library/traceback.rst:289 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:284 +#: ../../library/traceback.rst:293 msgid "" "For syntax errors - the end line number where the error occurred. Can be " "``None`` if not present." msgstr "" -#: ../../library/traceback.rst:291 +#: ../../library/traceback.rst:300 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:295 +#: ../../library/traceback.rst:304 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:299 +#: ../../library/traceback.rst:308 msgid "" "For syntax errors - the end offset into the text where the error occurred. " "Can be ``None`` if not present." msgstr "" -#: ../../library/traceback.rst:306 +#: ../../library/traceback.rst:315 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:317 +#: ../../library/traceback.rst:326 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:324 +#: ../../library/traceback.rst:333 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:326 +#: ../../library/traceback.rst:335 msgid "" "If *chain* is not ``True``, ``__cause__`` and ``__context__`` will not be " "formatted." msgstr "" -#: ../../library/traceback.rst:329 +#: ../../library/traceback.rst:338 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: ../../library/traceback.rst:333 ../../library/traceback.rst:347 -msgid "" -"The message indicating which exception occurred is always the last string in " -"the output." -msgstr "" - -#: ../../library/traceback.rst:338 +#: ../../library/traceback.rst:344 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:340 +#: ../../library/traceback.rst:346 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:342 +#: ../../library/traceback.rst:348 msgid "" -"Normally, the generator emits a single string; however, for :exc:" -"`SyntaxError` exceptions, it emits several lines that (when printed) display " -"detailed information about where the syntax error occurred." +"The generator emits the exception's message followed by its notes (if it has " +"any). The exception message is normally a single string; however, for :exc:" +"`SyntaxError` exceptions, it consists of several lines that (when printed) " +"display detailed information about where the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:350 -msgid "Added the *compact* parameter." -msgstr "新增 *compact* 參數。" - -#: ../../library/traceback.rst:353 -msgid "Added the *max_group_width* and *max_group_depth* parameters." -msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" +#: ../../library/traceback.rst:354 +msgid "The exception's notes are now included in the output." +msgstr "" -#: ../../library/traceback.rst:358 +#: ../../library/traceback.rst:360 msgid ":class:`StackSummary` Objects" msgstr ":class:`StackSummary` 物件" -#: ../../library/traceback.rst:362 +#: ../../library/traceback.rst:364 msgid "" ":class:`StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:368 +#: ../../library/traceback.rst:370 msgid "" "Construct a :class:`StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: ../../library/traceback.rst:372 +#: ../../library/traceback.rst:374 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -430,20 +433,20 @@ msgid "" "class:`FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:380 +#: ../../library/traceback.rst:382 msgid "" "Exceptions raised from :func:`repr` on a local variable (when " "*capture_locals* is ``True``) are no longer propagated to the caller." msgstr "" -#: ../../library/traceback.rst:386 +#: ../../library/traceback.rst:388 msgid "" "Construct a :class:`StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with filename, lineno, name, line as the elements." msgstr "" -#: ../../library/traceback.rst:392 +#: ../../library/traceback.rst:394 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single frame from the stack. Each string ends in a " @@ -451,18 +454,18 @@ msgid "" "with source text lines." msgstr "" -#: ../../library/traceback.rst:397 +#: ../../library/traceback.rst:399 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: ../../library/traceback.rst:401 +#: ../../library/traceback.rst:403 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:406 +#: ../../library/traceback.rst:408 msgid "" "Returns a string for printing one of the frames involved in the stack. This " "method is called for each :class:`FrameSummary` object to be printed by :" @@ -470,16 +473,16 @@ msgid "" "from the output." msgstr "" -#: ../../library/traceback.rst:415 +#: ../../library/traceback.rst:417 msgid ":class:`FrameSummary` Objects" msgstr ":class:`FrameSummary` 物件" -#: ../../library/traceback.rst:419 +#: ../../library/traceback.rst:421 msgid "" "A :class:`FrameSummary` object represents a single frame in a traceback." msgstr "" -#: ../../library/traceback.rst:423 +#: ../../library/traceback.rst:425 msgid "" "Represent a single frame in the traceback or stack that is being formatted " "or printed. It may optionally have a stringified version of the frames " @@ -492,11 +495,11 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:436 +#: ../../library/traceback.rst:438 msgid "Traceback Examples" msgstr "" -#: ../../library/traceback.rst:438 +#: ../../library/traceback.rst:440 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -504,23 +507,23 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:460 +#: ../../library/traceback.rst:462 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:495 +#: ../../library/traceback.rst:497 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:537 +#: ../../library/traceback.rst:539 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:563 +#: ../../library/traceback.rst:565 msgid "This last example demonstrates the final few formatting functions:" msgstr "" diff --git a/sphinx.po b/sphinx.po index 443deb3bf7..7ccdcf1a0d 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-26 00:03+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -244,6 +244,11 @@ msgstr "Python 的沿革與授權" msgid "Copyright" msgstr "版權" +#: ../../tools/templates/indexcontent.html:65 +#, fuzzy +msgid "Download the documentation" +msgstr "下載這些說明文件" + #: ../../tools/templates/indexsidebar.html:1 msgid "Download" msgstr "下載" From 9f587f08958da9d6036339a8732f5f59748e519a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 15 Sep 2023 00:06:29 +0000 Subject: [PATCH 17/18] sync with cpython 35c633d2 --- library/turtle.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/turtle.po b/library/turtle.po index 6cba6b1450..718deff5da 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-28 00:03+0000\n" +"POT-Creation-Date: 2023-09-15 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2117,7 +2117,7 @@ msgstr "" #: ../../library/turtle.rst:2332 msgid "" -"a :class:`tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" +"a :class:`!tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" @@ -2134,7 +2134,7 @@ msgid "" msgstr "" #: ../../library/turtle.rst:2347 -msgid "a :class:`tkinter.Canvas`" +msgid "a :class:`!tkinter.Canvas`" msgstr "" #: ../../library/turtle.rst:2349 @@ -2280,7 +2280,7 @@ msgstr "" msgid "" "``Turtle`` is a subclass of :class:`RawTurtle`, which *doesn't* " "automatically create a drawing surface - a *canvas* will need to be provided " -"or created for it. The *canvas* can be a :class:`tkinter.Canvas`, :class:" +"or created for it. The *canvas* can be a :class:`!tkinter.Canvas`, :class:" "`ScrolledCanvas` or :class:`TurtleScreen`." msgstr "" @@ -2290,7 +2290,7 @@ msgid "" "`Screen` is a subclass of ``TurtleScreen``, and includes :ref:`some " "additional methods ` for managing its appearance (including " "size and title) and behaviour. ``TurtleScreen``'s constructor needs a :class:" -"`tkinter.Canvas` or a :class:`ScrolledCanvas` as an argument." +"`!tkinter.Canvas` or a :class:`ScrolledCanvas` as an argument." msgstr "" #: ../../library/turtle.rst:2442 From 3c3d8b56245d5efb63e3568ae3a78741f0395dcd Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Thu, 12 Oct 2023 00:27:26 +0800 Subject: [PATCH 18/18] fix: resolve fuzzy entries --- faq/gui.po | 19 +++---- library/calendar.po | 12 ++--- library/typing.po | 120 +++++++++++++++++++------------------------ library/uuid.po | 26 ++++------ sphinx.po | 3 +- tutorial/appendix.po | 14 +++-- tutorial/classes.po | 5 +- using/configure.po | 44 ++++++++-------- whatsnew/3.12.po | 10 ++-- 9 files changed, 113 insertions(+), 140 deletions(-) diff --git a/faq/gui.po b/faq/gui.po index 2911cabe0a..8526ae7277 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -84,14 +84,13 @@ msgstr "" "用程式不是真正的獨立,因為該應用程式仍然需要 Tcl 和 Tk 函式庫。" #: ../../faq/gui.rst:45 -#, fuzzy msgid "" "One solution is to ship the application with the Tcl and Tk libraries, and " "point to them at run-time using the :envvar:`!TCL_LIBRARY` and :envvar:`!" "TK_LIBRARY` environment variables." msgstr "" "將應用程式與 Tcl 和 Tk 函式庫一併發送是一種解決方法,並在執行環境 (run-time) " -"使用 :envvar:`TCL_LIBRARY` 和 :envvar:`TK_LIBRARY` 環境變數來指向該函式庫。" +"使用 :envvar:`!TCL_LIBRARY` 和 :envvar:`!TK_LIBRARY` 環境變數來指向該函式庫。" #: ../../faq/gui.rst:49 msgid "" @@ -105,14 +104,13 @@ msgstr "" "一部分 (https://tix.sourceforge.net/)。" #: ../../faq/gui.rst:54 -#, fuzzy msgid "" "Build Tix with SAM enabled, perform the appropriate call to :c:func:`!" "Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link " "with libtclsam and libtksam (you might include the Tix libraries as well)." msgstr "" "請在 SAM 被啟用的情況下建置 Tix,對 Python 的 :file:`Modules/tkappinit.c` 中" -"的 :c:func:`Tclsam_init` 等函式執行適當的呼叫,並與 libtclsam 和 libtksam 連" +"的 :c:func:`!Tclsam_init` 等函式執行適當的呼叫,並與 libtclsam 和 libtksam 連" "結(你可能也會 include Tix 函式庫)。" #: ../../faq/gui.rst:61 @@ -120,7 +118,6 @@ msgid "Can I have Tk events handled while waiting for I/O?" msgstr "是否可以在等待 I/O 時處理 Tk 事件?" #: ../../faq/gui.rst:63 -#, fuzzy msgid "" "On platforms other than Windows, yes, and you don't even need threads! But " "you'll have to restructure your I/O code a bit. Tk has the equivalent of " @@ -129,9 +126,9 @@ msgid "" "file descriptor. See :ref:`tkinter-file-handlers`." msgstr "" "在 Windows 以外的平台上是可以的,你甚至不需要執行緒!但是,你必須稍微調整你" -"的 I/O 程式碼。Tk 具有等效於 Xt 的 :c:func:`XtAddInput()` 的函式呼叫,它能讓" -"你記錄一個回呼 (callback) 函式,當 I/O 在一個檔案描述符 (file descriptor) 上" -"可進行時,該函式將會從 Tk mainloop 被呼叫。請參閱\\ :ref:`tkinter-file-" +"的 I/O 程式碼。Tk 具有等效於 Xt 的 :c:func:`!XtAddInput` 的函式呼叫,它能讓你" +"記錄一個回呼 (callback) 函式,當 I/O 在一個檔案描述符 (file descriptor) 上可" +"進行時,該函式將會從 Tk mainloop 被呼叫。請參閱\\ :ref:`tkinter-file-" "handlers`。" #: ../../faq/gui.rst:71 @@ -139,14 +136,14 @@ msgid "I can't get key bindings to work in Tkinter: why?" msgstr "我無法讓鍵繫結 (key binding) 在 Tkinter 中作用:為什麼?" #: ../../faq/gui.rst:73 -#, fuzzy msgid "" "An often-heard complaint is that event handlers :ref:`bound ` to events with the :meth:`!bind` method don't get handled even when " "the appropriate key is pressed." msgstr "" -"一個經常聽到的抱怨是,儘管事件處理程式 (event handler) 已經繫結到帶有 :meth:" -"`bind` method 的事件,但在按下相應的鍵時,該事件也沒有被處理。" +"一個經常聽到的抱怨是,儘管事件處理程式 (event handler) 已經\\ :ref:`繫結" +"`\\ 到帶有 :meth:`!bind` method 的事件,但在按下相應的鍵" +"時,該事件也沒有被處理。" #: ../../faq/gui.rst:77 msgid "" diff --git a/library/calendar.po b/library/calendar.po index 0b57c63fdb..fc1ca1cc53 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -405,7 +405,8 @@ msgstr "如果 *year* 是閏年回傳 :const:`True`,否則回傳 :const:`False msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." -msgstr "回傳從 *y1* 到 *y2*\\ (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" +msgstr "" +"回傳從 *y1* 到 *y2*\\ (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" #: ../../library/calendar.rst:326 msgid "This function works for ranges spanning a century change." @@ -437,8 +438,8 @@ msgid "" "week; days outside of the month are represented by zeros. Each week begins " "with Monday unless set by :func:`setfirstweekday`." msgstr "" -"回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。每一週以" -"週一開始,除非有使用 :func:`setfirstweekday` 改變設定。" +"回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。每一週以週" +"一開始,除非有使用 :func:`setfirstweekday` 改變設定。" #: ../../library/calendar.rst:356 msgid "Prints a month's calendar as returned by :func:`month`." @@ -492,7 +493,6 @@ msgid "" msgstr "以目前語系來表示的一週每一天縮寫名稱的陣列。" #: ../../library/calendar.rst:405 -#, fuzzy msgid "" "Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " "is ``6``." @@ -524,11 +524,11 @@ msgstr "" "月,因此它的長度為 13,而 ``month_abbr[0]`` 是空字串。" #: ../../library/calendar.rst:447 -#, fuzzy msgid "" "Aliases for the months of the year, where ``JANUARY`` is ``1`` and " "``DECEMBER`` is ``12``." -msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" +msgstr "" +"一年內每個月的別名,其中 ``JANUARY`` 是 ``ㄅ`` 而 ``DECEMBER`` 是 ``12``。" #: ../../library/calendar.rst:455 msgid "" diff --git a/library/typing.po b/library/typing.po index bfd82481d6..5a8c520a50 100644 --- a/library/typing.po +++ b/library/typing.po @@ -652,13 +652,10 @@ msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" #: ../../library/typing.rst:623 -#, fuzzy msgid "" "For backward compatibility, generic type aliases can also be created through " "a simple assignment::" -msgstr "" -":keyword:`type` 陳述式是 Python 3.12 的新功能。為了向後相容性,型別別名可以透" -"過簡單的賦值來建立: ::" +msgstr "為了向後相容性,泛型型別別名可以透過簡單的賦值來建立: ::" #: ../../library/typing.rst:632 msgid ":class:`Generic` no longer has a custom metaclass." @@ -1137,13 +1134,12 @@ msgid "" msgstr "" #: ../../library/typing.rst:1169 -#, fuzzy msgid ":class:`ParamSpec`" -msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" +msgstr ":class:`ParamSpec`。" #: ../../library/typing.rst:1170 ../../library/typing.rst:1928 msgid ":ref:`annotating-callables`" -msgstr "" +msgstr ":ref:`annotating-callables`" #: ../../library/typing.rst:1174 msgid "Special typing form to define \"literal types\"." @@ -1458,10 +1454,9 @@ msgid "" msgstr "" #: ../../library/typing.rst:1521 -#, fuzzy msgid "" "See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing." -msgstr ":pep:`692`:為更精準的 ``**kwargs`` 型別使用 ``TypedDict``" +msgstr "" #: ../../library/typing.rst:1526 msgid "Building generic types and type aliases" @@ -2697,9 +2692,8 @@ msgid "" msgstr "" #: ../../library/typing.rst:2899 -#, fuzzy msgid "See :pep:`698` for more details." -msgstr "更多細節請見 :pep:`681`。" +msgstr "更多細節請見 :pep:`698`。" #: ../../library/typing.rst:2906 msgid "Decorator to mark a class or function as unavailable at runtime." @@ -2884,11 +2878,11 @@ msgstr "" #: ../../library/typing.rst:3107 msgid "Aliases to built-in types" -msgstr "" +msgstr "內建型別的別名" #: ../../library/typing.rst:3111 msgid "Deprecated alias to :class:`dict`." -msgstr "" +msgstr "棄用 :class:`dict` 的別名。" #: ../../library/typing.rst:3113 msgid "" @@ -2909,7 +2903,7 @@ msgstr "" #: ../../library/typing.rst:3128 msgid "Deprecated alias to :class:`list`." -msgstr "" +msgstr "棄用 :class:`list` 的別名。" #: ../../library/typing.rst:3130 msgid "" @@ -2930,7 +2924,7 @@ msgstr "" #: ../../library/typing.rst:3148 msgid "Deprecated alias to :class:`builtins.set `." -msgstr "" +msgstr "棄用 :class:`builtins.set ` 的別名。" #: ../../library/typing.rst:3150 msgid "" @@ -2947,7 +2941,7 @@ msgstr "" #: ../../library/typing.rst:3160 msgid "Deprecated alias to :class:`builtins.frozenset `." -msgstr "" +msgstr "棄用 :class:`builtins.frozenset ` 的別名。" #: ../../library/typing.rst:3162 msgid "" @@ -2957,7 +2951,7 @@ msgstr "" #: ../../library/typing.rst:3169 msgid "Deprecated alias for :class:`tuple`." -msgstr "" +msgstr "棄用 :class:`tuple` 的別名。" #: ../../library/typing.rst:3171 msgid "" @@ -2973,7 +2967,7 @@ msgstr "" #: ../../library/typing.rst:3180 msgid "Deprecated alias to :class:`type`." -msgstr "" +msgstr "棄用 :class:`type` 的別名。" #: ../../library/typing.rst:3182 msgid "" @@ -2989,11 +2983,11 @@ msgstr "" #: ../../library/typing.rst:3194 msgid "Aliases to types in :mod:`collections`" -msgstr "" +msgstr ":mod:`collections` 中型別的別名" #: ../../library/typing.rst:3198 msgid "Deprecated alias to :class:`collections.defaultdict`." -msgstr "" +msgstr "棄用 :class:`collections.defaultdict` 的別名。" #: ../../library/typing.rst:3202 msgid "" @@ -3003,7 +2997,7 @@ msgstr "" #: ../../library/typing.rst:3208 msgid "Deprecated alias to :class:`collections.OrderedDict`." -msgstr "" +msgstr "棄用 :class:`collections.OrderedDict` 的別名。" #: ../../library/typing.rst:3212 msgid "" @@ -3013,7 +3007,7 @@ msgstr "" #: ../../library/typing.rst:3218 msgid "Deprecated alias to :class:`collections.ChainMap`." -msgstr "" +msgstr "棄用 :class:`collections.ChainMap` 的別名。" #: ../../library/typing.rst:3223 msgid "" @@ -3023,7 +3017,7 @@ msgstr "" #: ../../library/typing.rst:3229 msgid "Deprecated alias to :class:`collections.Counter`." -msgstr "" +msgstr "棄用 :class:`collections.Counter` 的別名。" #: ../../library/typing.rst:3234 msgid "" @@ -3033,7 +3027,7 @@ msgstr "" #: ../../library/typing.rst:3240 msgid "Deprecated alias to :class:`collections.deque`." -msgstr "" +msgstr "棄用 :class:`collections.deque` 的別名。" #: ../../library/typing.rst:3245 msgid "" @@ -3079,7 +3073,7 @@ msgstr "" #: ../../library/typing.rst:3279 msgid "Deprecated alias for :class:`str`." -msgstr "" +msgstr "棄用 :class:`str` 的別名。" #: ../../library/typing.rst:3281 msgid "" @@ -3102,11 +3096,11 @@ msgstr "" #: ../../library/typing.rst:3303 msgid "Aliases to container ABCs in :mod:`collections.abc`" -msgstr "" +msgstr ":mod:`collections.abc` 中容器 ABC 的別名" #: ../../library/typing.rst:3307 msgid "Deprecated alias to :class:`collections.abc.Set`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Set` 的別名。" #: ../../library/typing.rst:3309 msgid "" @@ -3128,7 +3122,7 @@ msgstr "" #: ../../library/typing.rst:3323 msgid "Deprecated alias to :class:`collections.abc.Collection`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Collection` 的別名。" #: ../../library/typing.rst:3327 msgid "" @@ -3138,7 +3132,7 @@ msgstr "" #: ../../library/typing.rst:3333 msgid "Deprecated alias to :class:`collections.abc.Container`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Container` 的別名。" #: ../../library/typing.rst:3335 msgid "" @@ -3148,7 +3142,7 @@ msgstr "" #: ../../library/typing.rst:3341 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" #: ../../library/typing.rst:3343 msgid "" @@ -3158,7 +3152,7 @@ msgstr "" #: ../../library/typing.rst:3349 msgid "Deprecated alias to :class:`collections.abc.KeysView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" #: ../../library/typing.rst:3351 msgid "" @@ -3168,7 +3162,7 @@ msgstr "" #: ../../library/typing.rst:3357 msgid "Deprecated alias to :class:`collections.abc.Mapping`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" #: ../../library/typing.rst:3364 msgid "" @@ -3178,7 +3172,7 @@ msgstr "" #: ../../library/typing.rst:3370 msgid "Deprecated alias to :class:`collections.abc.MappingView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" #: ../../library/typing.rst:3372 msgid "" @@ -3188,7 +3182,7 @@ msgstr "" #: ../../library/typing.rst:3378 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" #: ../../library/typing.rst:3380 msgid "" @@ -3198,7 +3192,7 @@ msgstr "" #: ../../library/typing.rst:3387 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" #: ../../library/typing.rst:3389 msgid "" @@ -3208,7 +3202,7 @@ msgstr "" #: ../../library/typing.rst:3396 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" #: ../../library/typing.rst:3398 msgid "" @@ -3218,7 +3212,7 @@ msgstr "" #: ../../library/typing.rst:3404 msgid "Deprecated alias to :class:`collections.abc.Sequence`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" #: ../../library/typing.rst:3406 msgid "" @@ -3228,7 +3222,7 @@ msgstr "" #: ../../library/typing.rst:3412 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" #: ../../library/typing.rst:3414 msgid "" @@ -3242,7 +3236,7 @@ msgstr "" #: ../../library/typing.rst:3425 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" #: ../../library/typing.rst:3427 msgid "" @@ -3258,7 +3252,7 @@ msgstr "" #: ../../library/typing.rst:3444 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." -msgstr "" +msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" #: ../../library/typing.rst:3446 msgid "" @@ -3292,7 +3286,7 @@ msgstr "" #: ../../library/typing.rst:3484 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." -msgstr "" +msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" #: ../../library/typing.rst:3488 msgid "" @@ -3302,7 +3296,7 @@ msgstr "" #: ../../library/typing.rst:3494 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." -msgstr "" +msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" #: ../../library/typing.rst:3498 msgid "" @@ -3312,7 +3306,7 @@ msgstr "" #: ../../library/typing.rst:3504 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" #: ../../library/typing.rst:3508 msgid "" @@ -3326,7 +3320,7 @@ msgstr "" #: ../../library/typing.rst:3519 msgid "Deprecated alias to :class:`collections.abc.Iterable`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" #: ../../library/typing.rst:3521 msgid "" @@ -3336,7 +3330,7 @@ msgstr "" #: ../../library/typing.rst:3527 msgid "Deprecated alias to :class:`collections.abc.Iterator`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" #: ../../library/typing.rst:3529 msgid "" @@ -3346,7 +3340,7 @@ msgstr "" #: ../../library/typing.rst:3535 msgid "Deprecated alias to :class:`collections.abc.Callable`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Callable` 的別名。" #: ../../library/typing.rst:3537 msgid "" @@ -3362,7 +3356,7 @@ msgstr "" #: ../../library/typing.rst:3550 msgid "Deprecated alias to :class:`collections.abc.Generator`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Generator` 的別名。" #: ../../library/typing.rst:3552 msgid "" @@ -3397,15 +3391,15 @@ msgstr "" #: ../../library/typing.rst:3587 msgid "Deprecated alias to :class:`collections.abc.Hashable`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" #: ../../library/typing.rst:3589 msgid "Use :class:`collections.abc.Hashable` directly instead." -msgstr "" +msgstr "改為直接使用 :class:`collections.abc.Hashable`。" #: ../../library/typing.rst:3594 msgid "Deprecated alias to :class:`collections.abc.Reversible`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" #: ../../library/typing.rst:3596 msgid "" @@ -3415,15 +3409,15 @@ msgstr "" #: ../../library/typing.rst:3602 msgid "Deprecated alias to :class:`collections.abc.Sized`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Sized` 的別名。" #: ../../library/typing.rst:3604 msgid "Use :class:`collections.abc.Sized` directly instead." -msgstr "" +msgstr "改為直接使用 :class:`collections.abc.Sized`。" #: ../../library/typing.rst:3610 msgid "Aliases to :mod:`contextlib` ABCs" -msgstr "" +msgstr ":mod:`contextlib` ABC 的別名" #: ../../library/typing.rst:3614 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." @@ -3475,7 +3469,7 @@ msgstr "" #: ../../library/typing.rst:3650 msgid "``typing.io`` and ``typing.re`` submodules" -msgstr "" +msgstr "``typing.io`` 和 ``typing.re`` 子模組" #: ../../library/typing.rst:3651 msgid "3.8" @@ -3506,9 +3500,8 @@ msgid ":pep:`585`" msgstr ":pep:`585`" #: ../../library/typing.rst:3658 -#, fuzzy msgid ":class:`typing.ByteString`" -msgstr "``typing.Text``" +msgstr ":class:`typing.ByteString`" #: ../../library/typing.rst:3660 msgid "3.14" @@ -3519,9 +3512,8 @@ msgid ":gh:`91896`" msgstr ":gh:`91896`" #: ../../library/typing.rst:3662 -#, fuzzy msgid ":data:`typing.Text`" -msgstr "``typing.Text``" +msgstr ":data:`typing.Text`" #: ../../library/typing.rst:3663 msgid "3.11" @@ -3537,25 +3529,21 @@ msgid ":gh:`92332`" msgstr ":gh:`92332`" #: ../../library/typing.rst:3666 -#, fuzzy msgid ":class:`typing.Hashable` and :class:`typing.Sized`" -msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" +msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`。" #: ../../library/typing.rst:3667 ../../library/typing.rst:3671 msgid "3.12" msgstr "" #: ../../library/typing.rst:3669 -#, fuzzy msgid ":gh:`94309`" -msgstr ":gh:`91896`" +msgstr ":gh:`94309`" #: ../../library/typing.rst:3670 -#, fuzzy msgid ":data:`typing.TypeAlias`" -msgstr "*引入* :data:`TypeAlias`" +msgstr ":data:`typing.TypeAlias`" #: ../../library/typing.rst:3673 -#, fuzzy msgid ":pep:`695`" -msgstr ":pep:`585`" +msgstr ":pep:`695`" diff --git a/library/uuid.po b/library/uuid.po index 13cbf26b97..9048e97b5b 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -49,7 +49,6 @@ msgstr "" "UUID。而 :func:`uuid4` 則會建立一個隨機的 UUID。" #: ../../library/uuid.rst:22 -#, fuzzy msgid "" "Depending on support from the underlying platform, :func:`uuid1` may or may " "not return a \"safe\" UUID. A safe UUID is one which is generated using " @@ -60,8 +59,8 @@ msgid "" msgstr "" "根據底層平台的支援情況,:func:`uuid1` 可能會也可能不會回傳一個「安全的」" "UUID。安全的 UUID 是使用同步方法生成的,以確保不會有兩個行程獲取到相同的 " -"UUID。所有 :class:`UUID` 的實例都有一個 :attr:`is_safe` 屬性,該屬性使用下面" -"這個列舉來傳遞有關 UUID 安全性的任何資訊:" +"UUID。所有 :class:`UUID` 的實例都有一個 :attr:`~UUID.is_safe` 屬性,該屬性使" +"用下面這個列舉來傳遞有關 UUID 安全性的任何資訊:" #: ../../library/uuid.rst:34 msgid "The UUID was generated by the platform in a multiprocessing-safe way." @@ -165,34 +164,28 @@ msgid "Meaning" msgstr "意義" #: ../../library/uuid.rst:104 -#, fuzzy msgid "The first 32 bits of the UUID." -msgstr "UUID 的前 32 位元" +msgstr "UUID 的前 32 位元。" #: ../../library/uuid.rst:107 ../../library/uuid.rst:110 -#, fuzzy msgid "The next 16 bits of the UUID." -msgstr "UUID 接下來的 16 位元" +msgstr "UUID 接下來的 16 位元。" #: ../../library/uuid.rst:113 ../../library/uuid.rst:116 -#, fuzzy msgid "The next 8 bits of the UUID." -msgstr "UUID 接下來的 8 位元" +msgstr "UUID 接下來的 8 位元。" #: ../../library/uuid.rst:119 -#, fuzzy msgid "The last 48 bits of the UUID." -msgstr "UUID 最後的 48 位元" +msgstr "UUID 最後的 48 位元。" #: ../../library/uuid.rst:122 -#, fuzzy msgid "The 60-bit timestamp." -msgstr "60 位元的時間戳" +msgstr "60 位元的時間戳。" #: ../../library/uuid.rst:125 -#, fuzzy msgid "The 14-bit sequence number." -msgstr "14 位元的序列號" +msgstr "14 位元的序列號。" #: ../../library/uuid.rst:130 msgid "The UUID as a 32-character lowercase hexadecimal string." @@ -327,11 +320,10 @@ msgstr "" "當指定這個命名空間時,*name* 字串是以 DER 或文字輸出格式表示的 X.500 DN。" #: ../../library/uuid.rst:244 -#, fuzzy msgid "" "The :mod:`uuid` module defines the following constants for the possible " "values of the :attr:`~UUID.variant` attribute:" -msgstr ":mod:`uuid` 模組為 :attr:`variant` 屬性的可能值定義了以下常數:" +msgstr ":mod:`uuid` 模組為 :attr:`~UUID.variant` 屬性的可能值定義了以下常數:" #: ../../library/uuid.rst:250 msgid "Reserved for NCS compatibility." diff --git a/sphinx.po b/sphinx.po index 7ccdcf1a0d..3172c142e8 100644 --- a/sphinx.po +++ b/sphinx.po @@ -245,9 +245,8 @@ msgid "Copyright" msgstr "版權" #: ../../tools/templates/indexcontent.html:65 -#, fuzzy msgid "Download the documentation" -msgstr "下載這些說明文件" +msgstr "下載說明文件" #: ../../tools/templates/indexsidebar.html:1 msgid "Download" diff --git a/tutorial/appendix.po b/tutorial/appendix.po index bdb234b8b7..3ac06d2f35 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -162,16 +162,15 @@ msgid "The Customization Modules" msgstr "客製化模組" #: ../../tutorial/appendix.rst:104 -#, fuzzy msgid "" "Python provides two hooks to let you customize it: :index:`sitecustomize` " "and :index:`usercustomize`. To see how it works, you need first to find the " "location of your user site-packages directory. Start Python and run this " "code::" msgstr "" -"Python 提供了兩個鉤子(hook)讓你可以將它客製化: :mod:`sitecustomize` 和 :" -"mod:`usercustomize` 。要看它是如何運作的,你首先需要找到你的 site-packages 的" -"位置。啟動 Python 並運行這段程式碼:\n" +"Python 提供了兩個鉤子 (hook) 讓你可以將它客製化: :index:`sitecustomize` 和 :" +"index:`usercustomize` 。要看它是如何運作的,你首先需要找到你的 site-packages " +"的位置。啟動 Python 並運行這段程式碼:\n" "\n" "::" @@ -187,16 +186,15 @@ msgstr "" "啟動以禁用自動 import 。" #: ../../tutorial/appendix.rst:116 -#, fuzzy msgid "" ":index:`sitecustomize` works in the same way, but is typically created by an " "administrator of the computer in the global site-packages directory, and is " "imported before :index:`usercustomize`. See the documentation of the :mod:" "`site` module for more details." msgstr "" -":mod:`sitecustomize` 的運作方式相同,但通常是由電腦的管理員在全域 site-" -"packages 目錄下創建,並在 :mod:`usercustomize` 之前 import 。更多細節請參閱 :" -"mod:`site` 模組的文件。" +":index:`sitecustomize` 的運作方式相同,但通常是由電腦的管理員在全域 site-" +"packages 目錄下創建,並在 :index:`usercustomize` 之前 import 。更多細節請參" +"閱 :mod:`site` 模組的文件。" #: ../../tutorial/appendix.rst:123 msgid "Footnotes" diff --git a/tutorial/classes.po b/tutorial/classes.po index 8f2b1af576..a00a286b46 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -471,7 +471,6 @@ msgstr "" "::" #: ../../tutorial/classes.rst:276 -#, fuzzy msgid "" "then ``MyClass.i`` and ``MyClass.f`` are valid attribute references, " "returning an integer and a function object, respectively. Class attributes " @@ -481,8 +480,8 @@ msgid "" msgstr "" "那麼 ``MyClass.i`` 和 ``MyClass.f`` 都是有效的屬性參照,會分別回傳一個整數和" "一個函式物件。Class 屬性也可以被指派 (assign),所以您可以透過賦值改變 " -"``MyClass.i`` 的值。:attr:`__doc__` 也是一個有效的屬性,會回傳屬於該 class 的" -"說明字串 (docstring):``\"A simple example class\"``。" +"``MyClass.i`` 的值。:attr:`!__doc__` 也是一個有效的屬性,會回傳屬於該 class " +"的說明字串 (docstring):``\"A simple example class\"``。" #: ../../tutorial/classes.rst:282 msgid "" diff --git a/using/configure.po b/using/configure.po index 9e76574cb8..f461e35107 100644 --- a/using/configure.po +++ b/using/configure.po @@ -64,7 +64,7 @@ msgstr "" #: ../../using/configure.rst:29 msgid "OpenSSL 1.1.1 is now required." -msgstr "" +msgstr "OpenSSL 1.1.1 現在是必要的。" #: ../../using/configure.rst:32 msgid "Thread support and OpenSSL 1.0.2 are now required." @@ -78,7 +78,7 @@ msgstr "" #: ../../using/configure.rst:39 msgid "On Windows, Visual Studio 2015 or later is required." -msgstr "" +msgstr "在 Windows 上需要 Visual Studio 2015 或更新版本。" #: ../../using/configure.rst:42 msgid "" @@ -88,7 +88,7 @@ msgstr "" #: ../../using/configure.rst:47 msgid "Generated files" -msgstr "" +msgstr "產生的檔案" #: ../../using/configure.rst:49 msgid "" @@ -113,7 +113,7 @@ msgstr "" #: ../../using/configure.rst:72 msgid "Configure Options" -msgstr "" +msgstr "設定選項" #: ../../using/configure.rst:74 msgid "List all ``./configure`` script options using::" @@ -127,7 +127,7 @@ msgstr "" #: ../../using/configure.rst:81 msgid "General Options" -msgstr "" +msgstr "一般選項" #: ../../using/configure.rst:85 msgid "" @@ -219,15 +219,15 @@ msgstr "" #: ../../using/configure.rst:148 msgid "``ndbm``;" -msgstr "" +msgstr "``ndbm``;" #: ../../using/configure.rst:149 msgid "``gdbm``;" -msgstr "" +msgstr "``gdbm``;" #: ../../using/configure.rst:150 msgid "``bdb``." -msgstr "" +msgstr "``bdb``." #: ../../using/configure.rst:154 msgid "Disable C locale coercion to a UTF-8 based locale (enabled by default)." @@ -235,7 +235,7 @@ msgstr "" #: ../../using/configure.rst:156 msgid "Don't define the ``PY_COERCE_C_LOCALE`` macro." -msgstr "" +msgstr "不要定義 ``PY_COERCE_C_LOCALE`` 巨集。" #: ../../using/configure.rst:158 msgid "See :envvar:`PYTHONCOERCECLOCALE` and the :pep:`538`." @@ -251,7 +251,7 @@ msgstr "" #: ../../using/configure.rst:170 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." -msgstr "" +msgstr "Fedora 和 SuSE 在 64 位元平台上使用 ``lib64``。" #: ../../using/configure.rst:172 msgid "See :data:`sys.platlibdir`." @@ -302,11 +302,11 @@ msgstr "" #: ../../using/configure.rst:207 msgid "Use ``Tools/scripts/summarize_stats.py`` to read the stats." -msgstr "" +msgstr "使用 ``Tools/scripts/summarize_stats.py`` 來讀取統計資料。" #: ../../using/configure.rst:212 msgid "WebAssembly Options" -msgstr "" +msgstr "WebAssembly 選項" #: ../../using/configure.rst:216 msgid "Set build flavor for ``wasm32-emscripten``." @@ -336,7 +336,7 @@ msgstr "" #: ../../using/configure.rst:240 msgid "Install Options" -msgstr "" +msgstr "安裝選項" #: ../../using/configure.rst:244 msgid "" @@ -731,7 +731,7 @@ msgstr "" #: ../../using/configure.rst:514 msgid "Libraries options" -msgstr "" +msgstr "函式庫選項" #: ../../using/configure.rst:518 msgid "Link against additional libraries (default is no)." @@ -1007,7 +1007,7 @@ msgstr "" #: ../../using/configure.rst:714 msgid "Main build steps" -msgstr "" +msgstr "主要建置步驟" #: ../../using/configure.rst:716 msgid "C files (``.c``) are built as object files (``.o``)." @@ -1029,7 +1029,7 @@ msgstr "" #: ../../using/configure.rst:723 msgid "Main Makefile targets" -msgstr "" +msgstr "主要 Makefile 目標" #: ../../using/configure.rst:725 msgid "``make``: Build Python with the standard library." @@ -1079,7 +1079,7 @@ msgstr "" #: ../../using/configure.rst:744 msgid "C extensions" -msgstr "" +msgstr "C 擴充模組" #: ../../using/configure.rst:746 msgid "" @@ -1112,11 +1112,11 @@ msgstr "" #: ../../using/configure.rst:776 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" -msgstr "" +msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" #: ../../using/configure.rst:777 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." -msgstr "" +msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" #: ../../using/configure.rst:779 msgid "" @@ -1186,7 +1186,7 @@ msgstr "C++ 編譯器指令。" #: ../../using/configure.rst:833 msgid "Example: ``g++ -pthread``." -msgstr "" +msgstr "範例:``g++ -pthread``。" #: ../../using/configure.rst:837 msgid "C compiler flags." @@ -1239,7 +1239,7 @@ msgstr "" #: ../../using/configure.rst:885 msgid "Base compiler flags." -msgstr "" +msgstr "基本編譯器旗標。" #: ../../using/configure.rst:889 msgid "Optimization flags." @@ -1374,7 +1374,7 @@ msgstr "" #: ../../using/configure.rst:1003 msgid "Example: ``-lrt``." -msgstr "" +msgstr "範例:``-lrt``。" #: ../../using/configure.rst:1007 msgid "Command to build a shared library." diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 4d2e8f08c5..0d4fc1eb05 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -63,7 +63,7 @@ msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:71 msgid ":ref:`whatsnew312-pep701`" -msgstr "" +msgstr ":ref:`whatsnew312-pep701`" #: ../../whatsnew/3.12.rst:73 msgid "Interpreter improvements:" @@ -71,11 +71,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:75 msgid ":ref:`whatsnew312-pep684`" -msgstr "" +msgstr ":ref:`whatsnew312-pep684`" #: ../../whatsnew/3.12.rst:77 msgid ":ref:`whatsnew312-pep669`" -msgstr "" +msgstr ":ref:`whatsnew312-pep669`" #: ../../whatsnew/3.12.rst:79 msgid "New typing features:" @@ -83,7 +83,7 @@ msgstr "新增型別特性:" #: ../../whatsnew/3.12.rst:81 msgid ":ref:`whatsnew312-pep688`" -msgstr "" +msgstr ":ref:`whatsnew312-pep688`" #: ../../whatsnew/3.12.rst:83 msgid ":ref:`whatsnew312-pep692`" @@ -95,7 +95,7 @@ msgstr ":ref:`whatsnew312-pep695`" #: ../../whatsnew/3.12.rst:87 msgid ":ref:`whatsnew312-pep698`" -msgstr "" +msgstr ":ref:`whatsnew312-pep698`" #: ../../whatsnew/3.12.rst:89 msgid "Important deprecations, removals or restrictions:"