diff --git a/c-api/init.po b/c-api/init.po index 3b5b946f41..3de24c2095 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-10-10 00:15+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1573,7 +1573,7 @@ msgid "" "deadlock ensues. *tstate* will be attached upon returning." msgstr "" -#: ../../c-api/init.rst:1244 ../../c-api/init.rst:1615 +#: ../../c-api/init.rst:1244 ../../c-api/init.rst:1631 msgid "" "Calling this function from a thread when the runtime is finalizing will hang " "the thread until the program exits, even if the thread was not created by " @@ -1581,8 +1581,8 @@ msgid "" "details." msgstr "" -#: ../../c-api/init.rst:1249 ../../c-api/init.rst:1320 -#: ../../c-api/init.rst:1625 +#: ../../c-api/init.rst:1249 ../../c-api/init.rst:1333 +#: ../../c-api/init.rst:1641 msgid "" "Hangs the current thread, rather than terminating it, if called while the " "interpreter is finalizing." @@ -1625,6 +1625,11 @@ msgid "" "will simply return ``NULL`` indicating that there was no prior thread state." msgstr "" +#: ../../c-api/init.rst:1282 +#, fuzzy +msgid ":c:func:`PyEval_ReleaseThread`" +msgstr "PyEval_ReleaseThread()" + #: ../../c-api/init.rst:1285 msgid "" "Similar to :c:func:`PyGILState_Ensure`, this function will hang the thread " @@ -1639,6 +1644,20 @@ msgstr "" #: ../../c-api/init.rst:1294 msgid "" +"The type of the value returned by :c:func:`PyGILState_Ensure` and passed to :" +"c:func:`PyGILState_Release`." +msgstr "" + +#: ../../c-api/init.rst:1299 +msgid "The GIL was already held when :c:func:`PyGILState_Ensure` was called." +msgstr "" + +#: ../../c-api/init.rst:1303 +msgid "The GIL was not held when :c:func:`PyGILState_Ensure` was called." +msgstr "" + +#: ../../c-api/init.rst:1307 +msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the :term:`attached thread state`. " "This may be called as many times as desired by a thread as long as each call " @@ -1650,7 +1669,7 @@ msgid "" "is acceptable." msgstr "" -#: ../../c-api/init.rst:1304 +#: ../../c-api/init.rst:1317 msgid "" "The return value is an opaque \"handle\" to the :term:`attached thread " "state` when :c:func:`PyGILState_Ensure` was called, and must be passed to :c:" @@ -1660,14 +1679,14 @@ msgid "" "to :c:func:`PyGILState_Release`." msgstr "" -#: ../../c-api/init.rst:1311 +#: ../../c-api/init.rst:1324 msgid "" "When the function returns, there will be an :term:`attached thread state` " "and the thread will be able to call arbitrary Python code. Failure is a " "fatal error." msgstr "" -#: ../../c-api/init.rst:1315 +#: ../../c-api/init.rst:1328 msgid "" "Calling this function when the runtime is finalizing is unsafe. Doing so " "will either hang the thread until the program ends, or fully crash the " @@ -1675,7 +1694,7 @@ msgid "" "finalization` for more details." msgstr "" -#: ../../c-api/init.rst:1326 +#: ../../c-api/init.rst:1339 msgid "" "Release any resources previously acquired. After this call, Python's state " "will be the same as it was prior to the corresponding :c:func:" @@ -1683,13 +1702,13 @@ msgid "" "caller, hence the use of the GILState API)." msgstr "" -#: ../../c-api/init.rst:1331 +#: ../../c-api/init.rst:1344 msgid "" "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" "func:`PyGILState_Release` on the same thread." msgstr "" -#: ../../c-api/init.rst:1336 +#: ../../c-api/init.rst:1349 msgid "" "Get the :term:`attached thread state` for this thread. May return ``NULL`` " "if no GILState API has been used on the current thread. Note that the main " @@ -1697,15 +1716,19 @@ msgid "" "been made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: ../../c-api/init.rst:1342 +#: ../../c-api/init.rst:1355 msgid "" -"This function does not account for :term:`thread states ` " -"created by something other than :c:func:`PyGILState_Ensure` (such as :c:func:" -"`PyThreadState_New`). Prefer :c:func:`PyThreadState_Get` or :c:func:" +"This function may return non-``NULL`` even when the :term:`thread state` is " +"detached. Prefer :c:func:`PyThreadState_Get` or :c:func:" "`PyThreadState_GetUnchecked` for most cases." msgstr "" -#: ../../c-api/init.rst:1351 +#: ../../c-api/init.rst:1360 +#, fuzzy +msgid ":c:func:`PyThreadState_Get`" +msgstr "也請見 :c:func:`PyThreadState_GetUnchecked`。" + +#: ../../c-api/init.rst:1364 msgid "" "Return ``1`` if the current thread is holding the :term:`GIL` and ``0`` " "otherwise. This function can be called from any thread at any time. Only if " @@ -1717,20 +1740,20 @@ msgid "" "differently." msgstr "" -#: ../../c-api/init.rst:1361 +#: ../../c-api/init.rst:1374 msgid "" "If the current Python process has ever created a subinterpreter, this " "function will *always* return ``1``. Prefer :c:func:" "`PyThreadState_GetUnchecked` for most cases." msgstr "" -#: ../../c-api/init.rst:1368 +#: ../../c-api/init.rst:1381 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: ../../c-api/init.rst:1374 +#: ../../c-api/init.rst:1387 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " @@ -1738,7 +1761,7 @@ msgid "" "discussion of this macro." msgstr "" -#: ../../c-api/init.rst:1382 +#: ../../c-api/init.rst:1395 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" @@ -1746,42 +1769,42 @@ msgid "" "macro." msgstr "" -#: ../../c-api/init.rst:1390 +#: ../../c-api/init.rst:1403 msgid "" "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" "c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" -#: ../../c-api/init.rst:1396 +#: ../../c-api/init.rst:1409 msgid "" "This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" "c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " "declaration." msgstr "" -#: ../../c-api/init.rst:1402 +#: ../../c-api/init.rst:1415 msgid "Low-level API" msgstr "低階 API" -#: ../../c-api/init.rst:1404 +#: ../../c-api/init.rst:1417 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:1406 +#: ../../c-api/init.rst:1419 msgid "" ":c:func:`Py_Initialize()` now initializes the :term:`GIL` and sets an :term:" "`attached thread state`." msgstr "" -#: ../../c-api/init.rst:1413 +#: ../../c-api/init.rst:1426 msgid "" "Create a new interpreter state object. An :term:`attached thread state` is " "not needed, but may optionally exist if it is necessary to serialize calls " "to this function." msgstr "" -#: ../../c-api/init.rst:1417 +#: ../../c-api/init.rst:1430 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1789,13 +1812,13 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_New``。" -#: ../../c-api/init.rst:1422 +#: ../../c-api/init.rst:1435 msgid "" "Reset all information in an interpreter state object. There must be an :" "term:`attached thread state` for the interpreter." msgstr "" -#: ../../c-api/init.rst:1425 +#: ../../c-api/init.rst:1438 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." @@ -1803,7 +1826,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_Clear``。" -#: ../../c-api/init.rst:1430 +#: ../../c-api/init.rst:1443 msgid "" "Destroy an interpreter state object. There **should not** be an :term:" "`attached thread state` for the target interpreter. The interpreter state " @@ -1811,165 +1834,172 @@ msgid "" "`PyInterpreterState_Clear`." msgstr "" -#: ../../c-api/init.rst:1437 +#: ../../c-api/init.rst:1450 msgid "" "Create a new thread state object belonging to the given interpreter object. " "An :term:`attached thread state` is not needed." msgstr "" -#: ../../c-api/init.rst:1442 +#: ../../c-api/init.rst:1455 msgid "" "Reset all information in a :term:`thread state` object. *tstate* must be :" "term:`attached `" msgstr "" -#: ../../c-api/init.rst:1445 +#: ../../c-api/init.rst:1458 msgid "" -"This function now calls the :c:member:`PyThreadState.on_delete` callback. " +"This function now calls the :c:member:`!PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1449 -msgid "The :c:member:`PyThreadState.on_delete` callback was removed." +#: ../../c-api/init.rst:1462 +#, fuzzy +msgid "The :c:member:`!PyThreadState.on_delete` callback was removed." msgstr ":c:member:`PyThreadState.on_delete` 回呼已被移除。" -#: ../../c-api/init.rst:1455 +#: ../../c-api/init.rst:1468 msgid "" "Destroy a :term:`thread state` object. *tstate* should not be :term:" "`attached ` to any thread. *tstate* must have been " "reset with a previous call to :c:func:`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1463 +#: ../../c-api/init.rst:1476 msgid "" "Detach the :term:`attached thread state` (which must have been reset with a " "previous call to :c:func:`PyThreadState_Clear`) and then destroy it." msgstr "" -#: ../../c-api/init.rst:1466 +#: ../../c-api/init.rst:1479 msgid "" "No :term:`thread state` will be :term:`attached ` " "upon returning." msgstr "" -#: ../../c-api/init.rst:1471 +#: ../../c-api/init.rst:1484 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1473 +#: ../../c-api/init.rst:1486 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1476 +#: ../../c-api/init.rst:1489 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "也請見 :c:func:`PyEval_GetFrame`。" -#: ../../c-api/init.rst:1478 ../../c-api/init.rst:1487 -#: ../../c-api/init.rst:1496 +#: ../../c-api/init.rst:1491 ../../c-api/init.rst:1500 +#: ../../c-api/init.rst:1509 msgid "" "*tstate* must not be ``NULL``, and must be :term:`attached `." msgstr "" -#: ../../c-api/init.rst:1485 +#: ../../c-api/init.rst:1498 msgid "" "Get the unique :term:`thread state` identifier of the Python thread state " "*tstate*." msgstr "" -#: ../../c-api/init.rst:1494 +#: ../../c-api/init.rst:1507 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1503 +#: ../../c-api/init.rst:1516 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1505 +#: ../../c-api/init.rst:1518 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1512 +#: ../../c-api/init.rst:1525 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1515 +#: ../../c-api/init.rst:1528 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1523 +#: ../../c-api/init.rst:1536 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1525 +#: ../../c-api/init.rst:1538 msgid "" "Issue a fatal error if there no :term:`attached thread state`. It cannot " "return NULL." msgstr "" -#: ../../c-api/init.rst:1533 +#: ../../c-api/init.rst:1546 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1536 ../../c-api/init.rst:2125 -#: ../../c-api/init.rst:2132 ../../c-api/init.rst:2151 -#: ../../c-api/init.rst:2158 +#: ../../c-api/init.rst:1549 ../../c-api/init.rst:2145 +#: ../../c-api/init.rst:2152 ../../c-api/init.rst:2171 +#: ../../c-api/init.rst:2178 msgid "The caller must have an :term:`attached thread state`." msgstr "呼叫者必須擁有一個 :term:`attached thread state`。" -#: ../../c-api/init.rst:1543 +#: ../../c-api/init.rst:1556 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1547 +#: ../../c-api/init.rst:1560 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1555 +#: ../../c-api/init.rst:1563 +msgid "" +"The returned dictionary is borrowed from the interpreter and is valid until " +"interpreter shutdown." +msgstr "" + +#: ../../c-api/init.rst:1571 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1557 +#: ../../c-api/init.rst:1573 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1560 +#: ../../c-api/init.rst:1576 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1563 +#: ../../c-api/init.rst:1579 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1568 +#: ../../c-api/init.rst:1584 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1570 ../../c-api/init.rst:1578 +#: ../../c-api/init.rst:1586 ../../c-api/init.rst:1594 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1576 +#: ../../c-api/init.rst:1592 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1585 +#: ../../c-api/init.rst:1601 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1979,7 +2009,7 @@ msgid "" "thread state is attached." msgstr "" -#: ../../c-api/init.rst:1595 +#: ../../c-api/init.rst:1611 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1991,54 +2021,54 @@ msgid "" "is cleared. This raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1603 +#: ../../c-api/init.rst:1619 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1609 +#: ../../c-api/init.rst:1625 msgid "" ":term:`Attach ` *tstate* to the current thread, which " "must not be ``NULL`` or already :term:`attached `." msgstr "" -#: ../../c-api/init.rst:1612 +#: ../../c-api/init.rst:1628 msgid "" "The calling thread must not already have an :term:`attached thread state`." msgstr "" -#: ../../c-api/init.rst:1620 +#: ../../c-api/init.rst:1636 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1629 +#: ../../c-api/init.rst:1645 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1635 +#: ../../c-api/init.rst:1651 msgid "" "Detach the :term:`attached thread state`. The *tstate* argument, which must " "not be ``NULL``, is only used to check that it represents the :term:" "`attached thread state` --- if it isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1640 +#: ../../c-api/init.rst:1656 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1647 +#: ../../c-api/init.rst:1663 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1649 +#: ../../c-api/init.rst:1665 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -2046,7 +2076,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1654 +#: ../../c-api/init.rst:1670 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -2057,31 +2087,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1661 +#: ../../c-api/init.rst:1677 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: ../../c-api/init.rst:1667 +#: ../../c-api/init.rst:1683 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: ../../c-api/init.rst:1673 +#: ../../c-api/init.rst:1689 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1677 +#: ../../c-api/init.rst:1693 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: ../../c-api/init.rst:1681 +#: ../../c-api/init.rst:1697 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -2089,44 +2119,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1689 +#: ../../c-api/init.rst:1705 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: ../../c-api/init.rst:1693 +#: ../../c-api/init.rst:1709 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1698 +#: ../../c-api/init.rst:1714 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: ../../c-api/init.rst:1703 +#: ../../c-api/init.rst:1719 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1708 +#: ../../c-api/init.rst:1724 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: ../../c-api/init.rst:1714 +#: ../../c-api/init.rst:1730 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create daemon threads. Otherwise daemon threads are allowed (as long as :c:" "member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1721 +#: ../../c-api/init.rst:1737 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " @@ -2135,37 +2165,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1728 +#: ../../c-api/init.rst:1744 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1733 +#: ../../c-api/init.rst:1749 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1740 +#: ../../c-api/init.rst:1756 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1744 +#: ../../c-api/init.rst:1760 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1748 +#: ../../c-api/init.rst:1764 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1750 +#: ../../c-api/init.rst:1766 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1764 +#: ../../c-api/init.rst:1780 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -2178,13 +2208,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1774 +#: ../../c-api/init.rst:1790 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1777 +#: ../../c-api/init.rst:1793 msgid "" "Upon success, *tstate_p* will be set to the first :term:`thread state` " "created in the new sub-interpreter. This thread state is :term:`attached " @@ -2195,7 +2225,7 @@ msgid "" "not exist." msgstr "" -#: ../../c-api/init.rst:1786 +#: ../../c-api/init.rst:1802 msgid "" "Like all other Python/C API functions, an :term:`attached thread state` must " "be present before calling this function, but it might be detached upon " @@ -2208,13 +2238,13 @@ msgid "" "will remain detached." msgstr "" -#: ../../c-api/init.rst:1797 +#: ../../c-api/init.rst:1813 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1800 +#: ../../c-api/init.rst:1816 msgid "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -2246,7 +2276,7 @@ msgstr "" " Py_ExitStatusException(status);\n" "}" -#: ../../c-api/init.rst:1815 +#: ../../c-api/init.rst:1831 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -2254,11 +2284,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1824 +#: ../../c-api/init.rst:1840 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1826 +#: ../../c-api/init.rst:1842 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -2266,7 +2296,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1832 +#: ../../c-api/init.rst:1848 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -2278,7 +2308,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1843 +#: ../../c-api/init.rst:1859 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -2288,7 +2318,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1863 +#: ../../c-api/init.rst:1879 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -2297,7 +2327,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1875 +#: ../../c-api/init.rst:1891 msgid "" "Destroy the (sub-)interpreter represented by the given :term:`thread state`. " "The given thread state must be :term:`attached `. " @@ -2305,17 +2335,17 @@ msgid "" "thread states associated with this interpreter are destroyed." msgstr "" -#: ../../c-api/init.rst:1880 +#: ../../c-api/init.rst:1896 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1887 +#: ../../c-api/init.rst:1903 msgid "A Per-Interpreter GIL" msgstr "直譯器各別持有的 GIL" -#: ../../c-api/init.rst:1889 +#: ../../c-api/init.rst:1905 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -2327,7 +2357,7 @@ msgid "" "just using threads. (See :pep:`554` and :pep:`684`.)" msgstr "" -#: ../../c-api/init.rst:1899 +#: ../../c-api/init.rst:1915 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2341,7 +2371,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1910 +#: ../../c-api/init.rst:1926 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2349,7 +2379,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1915 +#: ../../c-api/init.rst:1931 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2359,11 +2389,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1926 +#: ../../c-api/init.rst:1942 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1944 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2376,7 +2406,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1938 +#: ../../c-api/init.rst:1954 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2385,7 +2415,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1944 +#: ../../c-api/init.rst:1960 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2397,25 +2427,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1955 +#: ../../c-api/init.rst:1971 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1957 +#: ../../c-api/init.rst:1973 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1964 +#: ../../c-api/init.rst:1980 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1968 +#: ../../c-api/init.rst:1984 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2423,17 +2453,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1973 +#: ../../c-api/init.rst:1989 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1974 +#: ../../c-api/init.rst:1990 msgid "" "with the main thread holding an :term:`attached thread state` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1977 +#: ../../c-api/init.rst:1993 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2441,7 +2471,7 @@ msgid "" "if the :term:`thread state ` is detached." msgstr "" -#: ../../c-api/init.rst:1982 +#: ../../c-api/init.rst:1998 msgid "" "This function doesn't need an :term:`attached thread state`. However, to " "call this function in a subinterpreter, the caller must have an :term:" @@ -2449,7 +2479,7 @@ msgid "" "be called from the wrong interpreter." msgstr "" -#: ../../c-api/init.rst:1987 +#: ../../c-api/init.rst:2003 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2459,7 +2489,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1996 +#: ../../c-api/init.rst:2012 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2467,18 +2497,23 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:2005 +#: ../../c-api/init.rst:2018 +msgid "" +"This function now always schedules *func* to be run in the main interpreter." +msgstr "" + +#: ../../c-api/init.rst:2025 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:2010 +#: ../../c-api/init.rst:2030 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:2014 +#: ../../c-api/init.rst:2034 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2488,7 +2523,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:2024 +#: ../../c-api/init.rst:2044 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " @@ -2500,66 +2535,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:2033 +#: ../../c-api/init.rst:2053 msgid "Value of *what*" msgstr "*what* 的值" -#: ../../c-api/init.rst:2033 +#: ../../c-api/init.rst:2053 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:2035 +#: ../../c-api/init.rst:2055 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:2035 ../../c-api/init.rst:2040 -#: ../../c-api/init.rst:2051 +#: ../../c-api/init.rst:2055 ../../c-api/init.rst:2060 +#: ../../c-api/init.rst:2071 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:2037 +#: ../../c-api/init.rst:2057 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:2037 +#: ../../c-api/init.rst:2057 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:2040 +#: ../../c-api/init.rst:2060 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:2042 +#: ../../c-api/init.rst:2062 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:2042 +#: ../../c-api/init.rst:2062 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:2045 +#: ../../c-api/init.rst:2065 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:2045 ../../c-api/init.rst:2047 -#: ../../c-api/init.rst:2049 +#: ../../c-api/init.rst:2065 ../../c-api/init.rst:2067 +#: ../../c-api/init.rst:2069 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:2047 +#: ../../c-api/init.rst:2067 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:2049 +#: ../../c-api/init.rst:2069 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:2051 +#: ../../c-api/init.rst:2071 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:2056 +#: ../../c-api/init.rst:2076 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2568,7 +2603,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:2065 +#: ../../c-api/init.rst:2085 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2580,7 +2615,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:2076 +#: ../../c-api/init.rst:2096 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2588,31 +2623,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:2084 +#: ../../c-api/init.rst:2104 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:2090 +#: ../../c-api/init.rst:2110 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:2096 +#: ../../c-api/init.rst:2116 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:2102 +#: ../../c-api/init.rst:2122 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:2108 +#: ../../c-api/init.rst:2128 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2620,7 +2655,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:2116 +#: ../../c-api/init.rst:2136 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2630,24 +2665,24 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:2123 +#: ../../c-api/init.rst:2143 msgid "See also the :func:`sys.setprofile` function." msgstr "另請參閱 :func:`sys.setprofile` 函式。" -#: ../../c-api/init.rst:2129 +#: ../../c-api/init.rst:2149 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:2134 +#: ../../c-api/init.rst:2154 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:2142 +#: ../../c-api/init.rst:2162 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2658,28 +2693,28 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:2149 +#: ../../c-api/init.rst:2169 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:2155 +#: ../../c-api/init.rst:2175 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:2160 +#: ../../c-api/init.rst:2180 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2166 +#: ../../c-api/init.rst:2186 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:2172 +#: ../../c-api/init.rst:2192 msgid "" "The type of the trace function registered using :c:func:" "`PyRefTracer_SetTracer`. The first parameter is a Python object that has " @@ -2689,19 +2724,19 @@ msgid "" "provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:2182 +#: ../../c-api/init.rst:2202 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:2187 +#: ../../c-api/init.rst:2207 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:2192 +#: ../../c-api/init.rst:2212 msgid "" "Register a reference tracer function. The function will be called when a new " "Python has been created or when an object is going to be destroyed. If " @@ -2710,7 +2745,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:2198 +#: ../../c-api/init.rst:2218 msgid "" "Not that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " @@ -2718,12 +2753,12 @@ msgid "" "active every time the tracer function is called." msgstr "" -#: ../../c-api/init.rst:2203 ../../c-api/init.rst:2214 +#: ../../c-api/init.rst:2223 ../../c-api/init.rst:2234 msgid "" "There must be an :term:`attached thread state` when calling this function." msgstr "" -#: ../../c-api/init.rst:2209 +#: ../../c-api/init.rst:2229 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2731,48 +2766,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:2221 +#: ../../c-api/init.rst:2241 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2226 +#: ../../c-api/init.rst:2246 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2231 +#: ../../c-api/init.rst:2251 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2236 +#: ../../c-api/init.rst:2256 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2241 +#: ../../c-api/init.rst:2261 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2247 +#: ../../c-api/init.rst:2267 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2253 +#: ../../c-api/init.rst:2273 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2260 +#: ../../c-api/init.rst:2280 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2264 +#: ../../c-api/init.rst:2284 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2782,19 +2817,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2271 +#: ../../c-api/init.rst:2291 msgid "" "A :term:`thread state` does *not* need to be :term:`attached ` when calling these functions; they suppl their own locking." msgstr "" -#: ../../c-api/init.rst:2274 +#: ../../c-api/init.rst:2294 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2278 +#: ../../c-api/init.rst:2298 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2802,22 +2837,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2286 +#: ../../c-api/init.rst:2306 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2288 +#: ../../c-api/init.rst:2308 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2294 +#: ../../c-api/init.rst:2314 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2299 +#: ../../c-api/init.rst:2319 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2825,52 +2860,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2304 +#: ../../c-api/init.rst:2324 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2310 +#: ../../c-api/init.rst:2330 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2315 +#: ../../c-api/init.rst:2335 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2317 +#: ../../c-api/init.rst:2337 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2324 +#: ../../c-api/init.rst:2344 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2331 +#: ../../c-api/init.rst:2351 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2337 +#: ../../c-api/init.rst:2357 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2342 +#: ../../c-api/init.rst:2362 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2344 +#: ../../c-api/init.rst:2364 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2878,13 +2913,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2352 +#: ../../c-api/init.rst:2372 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2358 +#: ../../c-api/init.rst:2378 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2893,7 +2928,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2367 +#: ../../c-api/init.rst:2387 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2902,31 +2937,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2376 +#: ../../c-api/init.rst:2396 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2383 +#: ../../c-api/init.rst:2403 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2391 +#: ../../c-api/init.rst:2411 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2393 +#: ../../c-api/init.rst:2413 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2398 +#: ../../c-api/init.rst:2418 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2935,45 +2970,45 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2403 +#: ../../c-api/init.rst:2423 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" -#: ../../c-api/init.rst:2414 +#: ../../c-api/init.rst:2434 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2416 +#: ../../c-api/init.rst:2436 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2420 +#: ../../c-api/init.rst:2440 msgid "" "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " "zero to represent the unlocked state. For example::" msgstr "" -#: ../../c-api/init.rst:2423 +#: ../../c-api/init.rst:2443 msgid "PyMutex mutex = {0};" msgstr "PyMutex mutex = {0};" -#: ../../c-api/init.rst:2425 +#: ../../c-api/init.rst:2445 msgid "" "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " "contents and address of a :c:type:`!PyMutex` are meaningful, and it must " "remain at a fixed, writable location in memory." msgstr "" -#: ../../c-api/init.rst:2431 +#: ../../c-api/init.rst:2451 msgid "" "A :c:type:`!PyMutex` currently occupies one byte, but the size should be " "considered unstable. The size may change in future Python releases without " "a deprecation period." msgstr "" -#: ../../c-api/init.rst:2439 +#: ../../c-api/init.rst:2459 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " @@ -2981,28 +3016,28 @@ msgid "" "exists." msgstr "" -#: ../../c-api/init.rst:2447 +#: ../../c-api/init.rst:2467 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2454 +#: ../../c-api/init.rst:2474 msgid "Returns non-zero if the mutex *m* is currently locked, zero otherwise." msgstr "" -#: ../../c-api/init.rst:2458 +#: ../../c-api/init.rst:2478 msgid "" "This function is intended for use in assertions and debugging only and " "should not be used to make concurrency control decisions, as the lock state " "may change immediately after the check." msgstr "" -#: ../../c-api/init.rst:2467 +#: ../../c-api/init.rst:2487 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2469 +#: ../../c-api/init.rst:2489 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded ` CPython. They are " @@ -3010,7 +3045,7 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2474 +#: ../../c-api/init.rst:2494 msgid "" "Critical sections are intended to be used for custom types implemented in C-" "API extensions. They should generally not be used with built-in types like :" @@ -3019,7 +3054,7 @@ msgid "" "`PyDict_Next`, which requires critical section to be acquired externally." msgstr "" -#: ../../c-api/init.rst:2481 +#: ../../c-api/init.rst:2501 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " "sections, hence, they do not provide exclusive access such as provided by " @@ -3030,7 +3065,7 @@ msgid "" "threads can acquire the per-object lock for the same object." msgstr "" -#: ../../c-api/init.rst:2489 +#: ../../c-api/init.rst:2509 msgid "" "Variants that accept :c:type:`PyMutex` pointers rather than Python objects " "are also available. Use these variants to start a critical section in a " @@ -3039,7 +3074,7 @@ msgid "" "needs to call into the C API in a manner that might lead to deadlocks." msgstr "" -#: ../../c-api/init.rst:2495 +#: ../../c-api/init.rst:2515 msgid "" "The functions and structs used by the macros are exposed for cases where C " "macros are not available. They should only be used as in the given macro " @@ -3047,7 +3082,7 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2502 +#: ../../c-api/init.rst:2522 msgid "" "Operations that need to lock two objects at once must use :c:macro:" "`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " @@ -3056,11 +3091,11 @@ msgid "" "lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2508 +#: ../../c-api/init.rst:2528 msgid "Example usage::" msgstr "範例用法: ::" -#: ../../c-api/init.rst:2510 +#: ../../c-api/init.rst:2530 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -3080,7 +3115,7 @@ msgstr "" " Py_RETURN_NONE;\n" "}" -#: ../../c-api/init.rst:2519 +#: ../../c-api/init.rst:2539 msgid "" "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " "can call arbitrary code through an object's deallocation function. The " @@ -3090,19 +3125,19 @@ msgid "" "`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2527 +#: ../../c-api/init.rst:2547 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2530 ../../c-api/init.rst:2544 -#: ../../c-api/init.rst:2561 ../../c-api/init.rst:2576 -#: ../../c-api/init.rst:2590 ../../c-api/init.rst:2607 +#: ../../c-api/init.rst:2550 ../../c-api/init.rst:2564 +#: ../../c-api/init.rst:2581 ../../c-api/init.rst:2596 +#: ../../c-api/init.rst:2610 ../../c-api/init.rst:2627 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2532 +#: ../../c-api/init.rst:2552 msgid "" "{\n" " PyCriticalSection _py_cs;\n" @@ -3112,15 +3147,15 @@ msgstr "" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" -#: ../../c-api/init.rst:2536 ../../c-api/init.rst:2582 +#: ../../c-api/init.rst:2556 ../../c-api/init.rst:2602 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2542 +#: ../../c-api/init.rst:2562 msgid "Locks the mutex *m* and begins a critical section." msgstr "" -#: ../../c-api/init.rst:2546 +#: ../../c-api/init.rst:2566 msgid "" "{\n" " PyCriticalSection _py_cs;\n" @@ -3130,21 +3165,21 @@ msgstr "" " PyCriticalSection _py_cs;\n" " PyCriticalSection_BeginMutex(&_py_cs, m)" -#: ../../c-api/init.rst:2550 +#: ../../c-api/init.rst:2570 msgid "" "Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION`, there is no cast for " "the argument of the macro - it must be a :c:type:`PyMutex` pointer." msgstr "" -#: ../../c-api/init.rst:2553 ../../c-api/init.rst:2599 +#: ../../c-api/init.rst:2573 ../../c-api/init.rst:2619 msgid "On the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2559 +#: ../../c-api/init.rst:2579 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2563 +#: ../../c-api/init.rst:2583 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" @@ -3152,18 +3187,18 @@ msgstr "" " PyCriticalSection_End(&_py_cs);\n" "}" -#: ../../c-api/init.rst:2566 ../../c-api/init.rst:2612 +#: ../../c-api/init.rst:2586 ../../c-api/init.rst:2632 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2572 +#: ../../c-api/init.rst:2592 msgid "" "Acquires the per-objects locks for the objects *a* and *b* and begins a " "critical section. The locks are acquired in a consistent order (lowest " "address first) to avoid lock ordering deadlocks." msgstr "" -#: ../../c-api/init.rst:2578 +#: ../../c-api/init.rst:2598 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" @@ -3173,11 +3208,11 @@ msgstr "" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" -#: ../../c-api/init.rst:2588 +#: ../../c-api/init.rst:2608 msgid "Locks the mutexes *m1* and *m2* and begins a critical section." msgstr "" -#: ../../c-api/init.rst:2592 +#: ../../c-api/init.rst:2612 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" @@ -3187,17 +3222,17 @@ msgstr "" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection2_BeginMutex(&_py_cs2, m1, m2)" -#: ../../c-api/init.rst:2596 +#: ../../c-api/init.rst:2616 msgid "" "Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION2`, there is no cast for " "the arguments of the macro - they must be :c:type:`PyMutex` pointers." msgstr "" -#: ../../c-api/init.rst:2605 +#: ../../c-api/init.rst:2625 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2609 +#: ../../c-api/init.rst:2629 msgid "" " PyCriticalSection2_End(&_py_cs2);\n" "}" @@ -3218,19 +3253,19 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/init.rst:350 ../../c-api/init.rst:712 ../../c-api/init.rst:1228 -#: ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 +#: ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 msgid "sys" msgstr "sys" @@ -3242,7 +3277,7 @@ msgstr "search(搜尋)" msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1820 ../../c-api/init.rst:1873 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1836 ../../c-api/init.rst:1889 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" @@ -3338,23 +3373,23 @@ msgstr "PyEval_RestoreThread()" msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 +#: ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 +#: ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 +#: ../../c-api/init.rst:1772 ../../c-api/init.rst:1871 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1820 +#: ../../c-api/init.rst:1836 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1850 +#: ../../c-api/init.rst:1866 msgid "close (in module os)" msgstr "close(os 模組中)" diff --git a/c-api/unicode.po b/c-api/unicode.po index 6a742dde0b..031c9279e7 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -114,8 +114,8 @@ msgstr "" msgid "" "Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 " "integer types for direct character access. No checks are performed if the " -"canonical representation has the correct character size; " -"use :c:func:`PyUnicode_KIND` to select the right function." +"canonical representation has the correct character size; use :c:func:" +"`PyUnicode_KIND` to select the right function." msgstr "" #: ../../c-api/unicode.rst:107 @@ -162,15 +162,15 @@ msgstr "" #: ../../c-api/unicode.rst:152 msgid "" -"Read a code point from a canonical representation *data* (as obtained " -"with :c:func:`PyUnicode_DATA`). No checks or ready calls are performed." +"Read a code point from a canonical representation *data* (as obtained with :" +"c:func:`PyUnicode_DATA`). No checks or ready calls are performed." msgstr "" #: ../../c-api/unicode.rst:160 msgid "" "Read a character from a Unicode object *unicode*, which must be in the " -"\"canonical\" representation. This is less efficient " -"than :c:func:`PyUnicode_READ` if you do multiple consecutive reads." +"\"canonical\" representation. This is less efficient than :c:func:" +"`PyUnicode_READ` if you do multiple consecutive reads." msgstr "" #: ../../c-api/unicode.rst:169 @@ -194,8 +194,8 @@ msgstr "" #: ../../c-api/unicode.rst:188 msgid "" -"Return true if the string only contains ASCII characters. Equivalent " -"to :py:meth:`str.isascii`." +"Return true if the string only contains ASCII characters. Equivalent to :py:" +"meth:`str.isascii`." msgstr "" #: ../../c-api/unicode.rst:195 @@ -353,11 +353,11 @@ msgstr "" #: ../../c-api/unicode.rst:330 msgid "" -"After creation, the string can be filled " -"by :c:func:`PyUnicode_WriteChar`, :c:func:`PyUnicode_CopyCharacters`, :c:func:`PyUnicode_Fill`, :c:func:`PyUnicode_WRITE` " -"or similar. Since strings are supposed to be immutable, take care to not " -"“use” the result while it is being modified. In particular, before it's " -"filled with its final contents, a string:" +"After creation, the string can be filled by :c:func:`PyUnicode_WriteChar`, :" +"c:func:`PyUnicode_CopyCharacters`, :c:func:`PyUnicode_Fill`, :c:func:" +"`PyUnicode_WRITE` or similar. Since strings are supposed to be immutable, " +"take care to not “use” the result while it is being modified. In particular, " +"before it's filled with its final contents, a string:" msgstr "" #: ../../c-api/unicode.rst:337 @@ -393,19 +393,18 @@ msgstr "" #: ../../c-api/unicode.rst:357 msgid "" -"Create a new Unicode object with the given *kind* (possible values " -"are :c:macro:`PyUnicode_1BYTE_KIND` etc., as returned " -"by :c:func:`PyUnicode_KIND`). The *buffer* must point to an array of *size* " -"units of 1, 2 or 4 bytes per character, as given by the kind." +"Create a new Unicode object with the given *kind* (possible values are :c:" +"macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:" +"`PyUnicode_KIND`). The *buffer* must point to an array of *size* units of " +"1, 2 or 4 bytes per character, as given by the kind." msgstr "" #: ../../c-api/unicode.rst:362 msgid "" "If necessary, the input *buffer* is copied and transformed into the " -"canonical representation. For example, if the *buffer* is a UCS4 string " -"(:c:macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in the " -"UCS1 range, it will be transformed into UCS1 " -"(:c:macro:`PyUnicode_1BYTE_KIND`)." +"canonical representation. For example, if the *buffer* is a UCS4 string (:c:" +"macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in the UCS1 " +"range, it will be transformed into UCS1 (:c:macro:`PyUnicode_1BYTE_KIND`)." msgstr "" #: ../../c-api/unicode.rst:373 @@ -466,9 +465,9 @@ msgstr "" #: ../../c-api/unicode.rst:410 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " -"actual width is given in the next argument, which must be of " -"type :c:expr:`int`, and the object to convert comes after the minimum field " -"width and optional precision." +"actual width is given in the next argument, which must be of type :c:expr:" +"`int`, and the object to convert comes after the minimum field width and " +"optional precision." msgstr "" #: ../../c-api/unicode.rst:415 @@ -750,8 +749,8 @@ msgstr "``T``" #: ../../c-api/unicode.rst:533 msgid "" -"Get the fully qualified name of an object type; " -"call :c:func:`PyType_GetFullyQualifiedName`." +"Get the fully qualified name of an object type; call :c:func:" +"`PyType_GetFullyQualifiedName`." msgstr "" #: ../../c-api/unicode.rst:536 @@ -774,8 +773,8 @@ msgstr ":c:expr:`PyTypeObject*`" #: ../../c-api/unicode.rst:543 msgid "" -"Get the fully qualified name of a type; " -"call :c:func:`PyType_GetFullyQualifiedName`." +"Get the fully qualified name of a type; call :c:func:" +"`PyType_GetFullyQualifiedName`." msgstr "" #: ../../c-api/unicode.rst:546 @@ -895,8 +894,8 @@ msgstr "" #: ../../c-api/unicode.rst:633 msgid "" -"Append the string *right* to the end of *p_left*. *p_left* must point to " -"a :term:`strong reference` to a Unicode object; :c:func:`!PyUnicode_Append` " +"Append the string *right* to the end of *p_left*. *p_left* must point to a :" +"term:`strong reference` to a Unicode object; :c:func:`!PyUnicode_Append` " "releases (\"steals\") this reference." msgstr "" @@ -925,8 +924,8 @@ msgstr "" #: ../../c-api/unicode.rst:661 msgid "" -"Return the name of the default string encoding, ``\"utf-8\"``. " -"See :func:`sys.getdefaultencoding`." +"Return the name of the default string encoding, ``\"utf-8\"``. See :func:" +"`sys.getdefaultencoding`." msgstr "" #: ../../c-api/unicode.rst:664 @@ -984,8 +983,8 @@ msgstr "" #: ../../c-api/unicode.rst:712 msgid "" -"Fill a string with a character: write *fill_char* into " -"``unicode[start:start+length]``." +"Fill a string with a character: write *fill_char* into ``unicode[start:" +"start+length]``." msgstr "" #: ../../c-api/unicode.rst:715 @@ -1009,16 +1008,16 @@ msgstr "" #: ../../c-api/unicode.rst:733 msgid "" "This function checks that *unicode* is a Unicode object, that the index is " -"not out of bounds, and that the object's reference count is one). " -"See :c:func:`PyUnicode_WRITE` for a version that skips these checks, making " -"them your responsibility." +"not out of bounds, and that the object's reference count is one. See :c:func:" +"`PyUnicode_WRITE` for a version that skips these checks, making them your " +"responsibility." msgstr "" #: ../../c-api/unicode.rst:746 msgid "" "Read a character from a string. This function checks that *unicode* is a " -"Unicode object and the index is not out of bounds, in contrast " -"to :c:func:`PyUnicode_READ_CHAR`, which performs no error checking." +"Unicode object and the index is not out of bounds, in contrast to :c:func:" +"`PyUnicode_READ_CHAR`, which performs no error checking." msgstr "" #: ../../c-api/unicode.rst:750 @@ -1042,10 +1041,10 @@ msgstr "" #: ../../c-api/unicode.rst:778 msgid "" -"Copy the string *unicode* into a new UCS4 buffer that is allocated " -"using :c:func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with " -"a :exc:`MemoryError` set. The returned buffer always has an extra null code " -"point appended." +"Copy the string *unicode* into a new UCS4 buffer that is allocated using :c:" +"func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" +"`MemoryError` set. The returned buffer always has an extra null code point " +"appended." msgstr "" #: ../../c-api/unicode.rst:787 @@ -1069,8 +1068,8 @@ msgstr "" #: ../../c-api/unicode.rst:803 msgid "" -"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from " -"the :term:`filesystem encoding and error handler`." +"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the :" +"term:`filesystem encoding and error handler`." msgstr "" #: ../../c-api/unicode.rst:806 ../../c-api/unicode.rst:841 @@ -1084,9 +1083,9 @@ msgstr ":c:func:`Py_DecodeLocale` 函式。" #: ../../c-api/unicode.rst:814 msgid "" "The function now also uses the current locale encoding for the " -"``surrogateescape`` error handler, except on Android. " -"Previously, :c:func:`Py_DecodeLocale` was used for the ``surrogateescape``, " -"and the current locale encoding was used for ``strict``." +"``surrogateescape`` error handler, except on Android. Previously, :c:func:" +"`Py_DecodeLocale` was used for the ``surrogateescape``, and the current " +"locale encoding was used for ``strict``." msgstr "" #: ../../c-api/unicode.rst:823 @@ -1102,14 +1101,14 @@ msgid "" "Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current " "locale encoding on other platforms. The supported error handlers are " "``\"strict\"`` and ``\"surrogateescape\"`` (:pep:`383`). The encoder uses " -"``\"strict\"`` error handler if *errors* is ``NULL``. Return " -"a :class:`bytes` object. *unicode* cannot contain embedded null characters." +"``\"strict\"`` error handler if *errors* is ``NULL``. Return a :class:" +"`bytes` object. *unicode* cannot contain embedded null characters." msgstr "" #: ../../c-api/unicode.rst:838 msgid "" -"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to " -"the :term:`filesystem encoding and error handler`." +"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the :term:" +"`filesystem encoding and error handler`." msgstr "" #: ../../c-api/unicode.rst:845 ../../c-api/unicode.rst:957 @@ -1119,9 +1118,9 @@ msgstr ":c:func:`Py_EncodeLocale` 函式。" #: ../../c-api/unicode.rst:849 msgid "" "The function now also uses the current locale encoding for the " -"``surrogateescape`` error handler, except on Android. " -"Previously, :c:func:`Py_EncodeLocale` was used for the ``surrogateescape``, " -"and the current locale encoding was used for ``strict``." +"``surrogateescape`` error handler, except on Android. Previously, :c:func:" +"`Py_EncodeLocale` was used for the ``surrogateescape``, and the current " +"locale encoding was used for ``strict``." msgstr "" #: ../../c-api/unicode.rst:858 @@ -1144,8 +1143,8 @@ msgstr "" #: ../../c-api/unicode.rst:869 msgid "" ":ref:`PyArg_Parse\\* converter `: encode :class:`str` objects " -"-- obtained directly or through the :class:`os.PathLike` interface -- " -"to :class:`bytes` using :c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` " +"-- obtained directly or through the :class:`os.PathLike` interface -- to :" +"class:`bytes` using :c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` " "objects are output as-is. *result* must be an address of a C variable of " "type :c:expr:`PyObject*` (or :c:expr:`PyBytesObject*`). On success, set the " "variable to a new :term:`strong reference` to a :ref:`bytes object " @@ -1175,15 +1174,14 @@ msgstr "" msgid "" ":ref:`PyArg_Parse\\* converter `: decode :class:`bytes` objects " "-- obtained either directly or indirectly through the :class:`os.PathLike` " -"interface -- to :class:`str` " -"using :c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are " -"output as-is. *result* must be an address of a C variable of " -"type :c:expr:`PyObject*` (or :c:expr:`PyUnicodeObject*`). On success, set " -"the variable to a new :term:`strong reference` to a :ref:`Unicode object " -"` which must be released when it is no longer used and " -"return a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null " -"characters are not allowed in the result. On failure, return ``0`` with an " -"exception set." +"interface -- to :class:`str` using :c:func:" +"`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are output as-is. " +"*result* must be an address of a C variable of type :c:expr:`PyObject*` (or :" +"c:expr:`PyUnicodeObject*`). On success, set the variable to a new :term:" +"`strong reference` to a :ref:`Unicode object ` which must be " +"released when it is no longer used and return a non-zero value (:c:macro:" +"`Py_CLEANUP_SUPPORTED`). Embedded null characters are not allowed in the " +"result. On failure, return ``0`` with an exception set." msgstr "" #: ../../c-api/unicode.rst:908 @@ -1198,8 +1196,8 @@ msgstr "" #: ../../c-api/unicode.rst:921 msgid "" -"If you need to decode a string from the current locale encoding, " -"use :c:func:`PyUnicode_DecodeLocaleAndSize`." +"If you need to decode a string from the current locale encoding, use :c:func:" +"`PyUnicode_DecodeLocaleAndSize`." msgstr "" #: ../../c-api/unicode.rst:928 ../../c-api/unicode.rst:941 @@ -1217,8 +1215,8 @@ msgstr "" #: ../../c-api/unicode.rst:938 msgid "" -"If the string length is known, " -"use :c:func:`PyUnicode_DecodeFSDefaultAndSize`." +"If the string length is known, use :c:func:" +"`PyUnicode_DecodeFSDefaultAndSize`." msgstr "如果字串長度已知,請使用 :c:func:`PyUnicode_DecodeFSDefaultAndSize`。" #: ../../c-api/unicode.rst:948 @@ -1230,8 +1228,8 @@ msgstr "" #: ../../c-api/unicode.rst:952 msgid "" -"If you need to encode a string to the current locale encoding, " -"use :c:func:`PyUnicode_EncodeLocale`." +"If you need to encode a string to the current locale encoding, use :c:func:" +"`PyUnicode_EncodeLocale`." msgstr "" #: ../../c-api/unicode.rst:966 @@ -1254,8 +1252,8 @@ msgstr "" msgid "" "Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. " "At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " -"trailing null termination character). Return the number " -"of :c:type:`wchar_t` characters copied or ``-1`` in case of an error." +"trailing null termination character). Return the number of :c:type:" +"`wchar_t` characters copied or ``-1`` in case of an error." msgstr "" #: ../../c-api/unicode.rst:985 @@ -1267,9 +1265,9 @@ msgstr "" #: ../../c-api/unicode.rst:988 msgid "" "Note that the resulting :c:expr:`wchar_t*` string may or may not be null-" -"terminated. It is the responsibility of the caller to make sure that " -"the :c:expr:`wchar_t*` string is null-terminated in case this is required by " -"the application. Also, note that the :c:expr:`wchar_t*` string might contain " +"terminated. It is the responsibility of the caller to make sure that the :c:" +"expr:`wchar_t*` string is null-terminated in case this is required by the " +"application. Also, note that the :c:expr:`wchar_t*` string might contain " "null characters, which would cause the string to be truncated when used with " "most C functions." msgstr "" @@ -1281,9 +1279,8 @@ msgid "" "number of wide characters (excluding the trailing null termination " "character) into *\\*size*. Note that the resulting :c:type:`wchar_t` string " "might contain null characters, which would cause the string to be truncated " -"when used with most C functions. If *size* is ``NULL`` and " -"the :c:expr:`wchar_t*` string contains null characters a :exc:`ValueError` " -"is raised." +"when used with most C functions. If *size* is ``NULL`` and the :c:expr:" +"`wchar_t*` string contains null characters a :exc:`ValueError` is raised." msgstr "" #: ../../c-api/unicode.rst:1006 @@ -1456,8 +1453,8 @@ msgid "" "`_ embedded within *unicode*. " "As a result, strings containing null characters will remain in the returned " "string, which some C functions might interpret as the end of the string, " -"leading to truncation. If truncation is an issue, it is recommended to " -"use :c:func:`PyUnicode_AsUTF8AndSize` instead." +"leading to truncation. If truncation is an issue, it is recommended to use :" +"c:func:`PyUnicode_AsUTF8AndSize` instead." msgstr "" #: ../../c-api/unicode.rst:1159 @@ -1807,8 +1804,8 @@ msgstr "" #: ../../c-api/unicode.rst:1457 msgid "" "Encode the Unicode object using the specified code page and return a Python " -"bytes object. Return ``NULL`` if an exception was raised by the codec. " -"Use :c:macro:`!CP_ACP` code page to get the MBCS encoder." +"bytes object. Return ``NULL`` if an exception was raised by the codec. Use :" +"c:macro:`!CP_ACP` code page to get the MBCS encoder." msgstr "" #: ../../c-api/unicode.rst:1467 @@ -1950,8 +1947,8 @@ msgstr "" #: ../../c-api/unicode.rst:1596 msgid "" -"This function returns ``-1`` upon failure, so one should " -"call :c:func:`PyErr_Occurred` to check for errors." +"This function returns ``-1`` upon failure, so one should call :c:func:" +"`PyErr_Occurred` to check for errors." msgstr "" #: ../../c-api/unicode.rst:1601 @@ -1972,8 +1969,8 @@ msgstr "如果 *a* 不等於 *b*,則回傳 ``0``。" #: ../../c-api/unicode.rst:1610 msgid "" -"Set a :exc:`TypeError` exception and return ``-1`` if *a* or *b* is not " -"a :class:`str` object." +"Set a :exc:`TypeError` exception and return ``-1`` if *a* or *b* is not a :" +"class:`str` object." msgstr "" #: ../../c-api/unicode.rst:1613 @@ -2036,9 +2033,8 @@ msgstr "" #: ../../c-api/unicode.rst:1666 msgid "" -"Possible values for *op* " -"are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, " -"and :c:macro:`Py_LE`." +"Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:" +"`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`." msgstr "" #: ../../c-api/unicode.rst:1672 @@ -2063,11 +2059,11 @@ msgstr "" msgid "" "Intern the argument :c:expr:`*p_unicode` in place. The argument must be the " "address of a pointer variable pointing to a Python Unicode string object. " -"If there is an existing interned string that is the same " -"as :c:expr:`*p_unicode`, it sets :c:expr:`*p_unicode` to it (releasing the " -"reference to the old string object and creating a new :term:`strong " -"reference` to the interned string object), otherwise it " -"leaves :c:expr:`*p_unicode` alone and interns it." +"If there is an existing interned string that is the same as :c:expr:" +"`*p_unicode`, it sets :c:expr:`*p_unicode` to it (releasing the reference to " +"the old string object and creating a new :term:`strong reference` to the " +"interned string object), otherwise it leaves :c:expr:`*p_unicode` alone and " +"interns it." msgstr "" #: ../../c-api/unicode.rst:1694 @@ -2086,9 +2082,9 @@ msgstr "" #: ../../c-api/unicode.rst:1702 msgid "" -"Instances of subclasses of :py:class:`str` may not be interned, that " -"is, :c:expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, " -"then -- as with any other error -- the argument is left unchanged." +"Instances of subclasses of :py:class:`str` may not be interned, that is, :c:" +"expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- " +"as with any other error -- the argument is left unchanged." msgstr "" #: ../../c-api/unicode.rst:1706 @@ -2099,9 +2095,8 @@ msgstr "" #: ../../c-api/unicode.rst:1712 msgid "" -"A combination of :c:func:`PyUnicode_FromString` " -"and :c:func:`PyUnicode_InternInPlace`, meant for statically allocated " -"strings." +"A combination of :c:func:`PyUnicode_FromString` and :c:func:" +"`PyUnicode_InternInPlace`, meant for statically allocated strings." msgstr "" #: ../../c-api/unicode.rst:1715 @@ -2116,8 +2111,8 @@ msgid "" "Python may keep a reference to the result, or make it :term:`immortal`, " "preventing it from being garbage-collected promptly. For interning an " "unbounded number of different strings, such as ones coming from user input, " -"prefer calling :c:func:`PyUnicode_FromString` " -"and :c:func:`PyUnicode_InternInPlace` directly." +"prefer calling :c:func:`PyUnicode_FromString` and :c:func:" +"`PyUnicode_InternInPlace` directly." msgstr "" #: ../../c-api/unicode.rst:1728 @@ -2141,8 +2136,8 @@ msgstr "PyUnicodeWriter" #: ../../c-api/unicode.rst:1743 msgid "" -"The :c:type:`PyUnicodeWriter` API can be used to create a " -"Python :class:`str` object." +"The :c:type:`PyUnicodeWriter` API can be used to create a Python :class:" +"`str` object." msgstr "" #: ../../c-api/unicode.rst:1750 @@ -2274,8 +2269,7 @@ msgstr "" msgid "" "Similar to :c:func:`PyUnicode_FromFormat`, but write the output directly " "into *writer*." -msgstr "" -"類似於 :c:func:`PyUnicode_FromFormat`,但是直接將輸出寫入 *writer*。" +msgstr "類似於 :c:func:`PyUnicode_FromFormat`,但是直接將輸出寫入 *writer*。" #: ../../c-api/unicode.rst:1869 msgid "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 2deb1dabda..3149d8034c 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-03 00:19+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -216,34 +216,35 @@ msgid "" "objects *globals* and *locals* with the compiler flags specified by " "*flags*. *globals* must be a dictionary; *locals* can be any object that " "implements the mapping protocol. The parameter *start* specifies the start " -"token that should be used to parse the source code." +"symbol and must one of the following: :c:data:`Py_eval_input`, :c:data:" +"`Py_file_input`, or :c:data:`Py_single_input`." msgstr "" -#: ../../c-api/veryhigh.rst:188 +#: ../../c-api/veryhigh.rst:189 msgid "" "Returns the result of executing the code as a Python object, or ``NULL`` if " "an exception was raised." msgstr "" -#: ../../c-api/veryhigh.rst:194 +#: ../../c-api/veryhigh.rst:195 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:200 +#: ../../c-api/veryhigh.rst:201 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:206 +#: ../../c-api/veryhigh.rst:207 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0``." msgstr "" -#: ../../c-api/veryhigh.rst:212 +#: ../../c-api/veryhigh.rst:213 msgid "" "Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read " "from *fp* instead of an in-memory string. *filename* should be the name of " @@ -252,22 +253,22 @@ msgid "" "`PyRun_FileExFlags` returns." msgstr "" -#: ../../c-api/veryhigh.rst:221 +#: ../../c-api/veryhigh.rst:222 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:227 +#: ../../c-api/veryhigh.rst:228 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, " "with *optimize* set to ``-1``." msgstr "" -#: ../../c-api/veryhigh.rst:233 +#: ../../c-api/veryhigh.rst:234 msgid "" "Parse and compile the Python source code in *str*, returning the resulting " -"code object. The start token is given by *start*; this can be used to " +"code object. The start symbol is given by *start*; this can be used to " "constrain the code which can be compiled and should be :c:data:" "`Py_eval_input`, :c:data:`Py_file_input`, or :c:data:`Py_single_input`. The " "filename specified by *filename* is used to construct the code object and " @@ -275,7 +276,7 @@ msgid "" "returns ``NULL`` if the code cannot be parsed or compiled." msgstr "" -#: ../../c-api/veryhigh.rst:241 +#: ../../c-api/veryhigh.rst:242 msgid "" "The integer *optimize* specifies the optimization level of the compiler; a " "value of ``-1`` selects the optimization level of the interpreter as given " @@ -284,20 +285,20 @@ msgid "" "or ``2`` (docstrings are removed too)." msgstr "" -#: ../../c-api/veryhigh.rst:252 +#: ../../c-api/veryhigh.rst:253 msgid "" "Like :c:func:`Py_CompileStringObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/veryhigh.rst:259 +#: ../../c-api/veryhigh.rst:260 msgid "" "This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just the " "code object, and global and local variables. The other arguments are set to " "``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:266 +#: ../../c-api/veryhigh.rst:267 msgid "" "Evaluate a precompiled code object, given a particular environment for its " "evaluation. This environment consists of a dictionary of global variables, " @@ -306,13 +307,13 @@ msgid "" "only_parameter>` arguments and a closure tuple of cells." msgstr "" -#: ../../c-api/veryhigh.rst:275 +#: ../../c-api/veryhigh.rst:276 msgid "" "Evaluate an execution frame. This is a simplified interface to :c:func:" "`PyEval_EvalFrameEx`, for backward compatibility." msgstr "" -#: ../../c-api/veryhigh.rst:281 +#: ../../c-api/veryhigh.rst:282 msgid "" "This is the main, unvarnished function of Python interpretation. The code " "object associated with the execution frame *f* is executed, interpreting " @@ -322,39 +323,39 @@ msgid "" "of generator objects." msgstr "" -#: ../../c-api/veryhigh.rst:288 +#: ../../c-api/veryhigh.rst:289 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." msgstr "" -#: ../../c-api/veryhigh.rst:295 +#: ../../c-api/veryhigh.rst:296 msgid "" "This function changes the flags of the current evaluation frame, and returns " "true on success, false on failure." msgstr "" -#: ../../c-api/veryhigh.rst:303 +#: ../../c-api/veryhigh.rst:304 msgid "" "The start symbol from the Python grammar for isolated expressions; for use " "with :c:func:`Py_CompileString`." msgstr "" -#: ../../c-api/veryhigh.rst:311 +#: ../../c-api/veryhigh.rst:312 msgid "" "The start symbol from the Python grammar for sequences of statements as read " "from a file or other source; for use with :c:func:`Py_CompileString`. This " "is the symbol to use when compiling arbitrarily long Python source code." msgstr "" -#: ../../c-api/veryhigh.rst:320 +#: ../../c-api/veryhigh.rst:321 msgid "" "The start symbol from the Python grammar for a single statement; for use " "with :c:func:`Py_CompileString`. This is the symbol used for the interactive " "interpreter loop." msgstr "" -#: ../../c-api/veryhigh.rst:327 +#: ../../c-api/veryhigh.rst:328 msgid "" "This is the structure used to hold compiler flags. In cases where code is " "only being compiled, it is passed as ``int flags``, and in cases where code " @@ -362,44 +363,44 @@ msgid "" "case, ``from __future__ import`` can modify *flags*." msgstr "" -#: ../../c-api/veryhigh.rst:332 +#: ../../c-api/veryhigh.rst:333 msgid "" "Whenever ``PyCompilerFlags *flags`` is ``NULL``, :c:member:`~PyCompilerFlags." "cf_flags` is treated as equal to ``0``, and any modification due to ``from " "__future__ import`` is discarded." msgstr "" -#: ../../c-api/veryhigh.rst:338 +#: ../../c-api/veryhigh.rst:339 msgid "Compiler flags." msgstr "" -#: ../../c-api/veryhigh.rst:342 +#: ../../c-api/veryhigh.rst:343 msgid "" "*cf_feature_version* is the minor Python version. It should be initialized " "to ``PY_MINOR_VERSION``." msgstr "" -#: ../../c-api/veryhigh.rst:345 +#: ../../c-api/veryhigh.rst:346 msgid "" "The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` " "flag is set in :c:member:`~PyCompilerFlags.cf_flags`." msgstr "" -#: ../../c-api/veryhigh.rst:348 +#: ../../c-api/veryhigh.rst:349 msgid "Added *cf_feature_version* field." msgstr "新增 *cf_feature_version* 欄位。" -#: ../../c-api/veryhigh.rst:351 +#: ../../c-api/veryhigh.rst:352 msgid "The available compiler flags are accessible as macros:" msgstr "" -#: ../../c-api/veryhigh.rst:360 +#: ../../c-api/veryhigh.rst:361 msgid "" "See :ref:`compiler flags ` in documentation of the :py:" "mod:`!ast` Python module, which exports these constants under the same names." msgstr "" -#: ../../c-api/veryhigh.rst:364 +#: ../../c-api/veryhigh.rst:365 msgid "" "The \"``PyCF``\" flags above can be combined with \"``CO_FUTURE``\" flags " "such as :c:macro:`CO_FUTURE_ANNOTATIONS` to enable features normally " @@ -407,7 +408,7 @@ msgid "" "`c_codeobject_flags` for a complete list." msgstr "" -#: ../../c-api/veryhigh.rst:301 ../../c-api/veryhigh.rst:309 -#: ../../c-api/veryhigh.rst:318 +#: ../../c-api/veryhigh.rst:302 ../../c-api/veryhigh.rst:310 +#: ../../c-api/veryhigh.rst:319 msgid "Py_CompileString (C function)" msgstr "Py_CompileString(C 函式)" diff --git a/deprecations/index.po b/deprecations/index.po index 06b7a16536..89688a14a2 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-18 00:15+0000\n" +"POT-Creation-Date: 2025-10-06 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,7 +86,7 @@ msgstr "" "cgi` 旗標已被棄用。" #: ../../deprecations/pending-removal-in-3.15.rst:32 -#: ../../deprecations/pending-removal-in-future.rst:64 +#: ../../deprecations/pending-removal-in-future.rst:63 msgid ":mod:`importlib`:" msgstr ":mod:`importlib`:" @@ -181,7 +181,7 @@ msgstr "" "`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:80 -#: ../../deprecations/pending-removal-in-3.17.rst:4 +#: ../../deprecations/pending-removal-in-3.17.rst:26 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" @@ -476,8 +476,46 @@ msgstr "" msgid "Pending removal in Python 3.17" msgstr "Python 3.17 中待移除的項目" +#: ../../deprecations/pending-removal-in-3.17.rst:4 +msgid ":mod:`collections.abc`:" +msgstr ":mod:`collections.abc`:" + #: ../../deprecations/pending-removal-in-3.17.rst:6 msgid "" +":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:8 +#: ../../deprecations/pending-removal-in-3.17.rst:36 +msgid "" +"Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " +"implements the :ref:`buffer protocol ` at runtime. For use in " +"type annotations, either use :class:`~collections.abc.Buffer` or a union " +"that explicitly specifies the types your code supports (e.g., ``bytes | " +"bytearray | memoryview``)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:14 +#: ../../deprecations/pending-removal-in-3.17.rst:42 +msgid "" +":class:`!ByteString` was originally intended to be an abstract class that " +"would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " +"However, since the ABC never had any methods, knowing that an object was an " +"instance of :class:`!ByteString` never actually told you anything useful " +"about the object. Other common buffer types such as :class:`memoryview` were " +"also never understood as subtypes of :class:`!ByteString` (either at runtime " +"or by static type checkers)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:22 +#: ../../deprecations/pending-removal-in-3.17.rst:50 +msgid "" +"See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:28 +msgid "" "Before Python 3.14, old-style unions were implemented using the private " "class ``typing._UnionGenericAlias``. This class is no longer needed for the " "implementation, but it has been retained for backward compatibility, with " @@ -490,35 +528,11 @@ msgstr "" "除。使用者應該改用文件中記錄的內省輔助函式,例如 :func:`typing.get_origin` " "和 :func:`typing.get_args`,或者依賴私有實作細節。" -#: ../../deprecations/pending-removal-in-3.17.rst:11 +#: ../../deprecations/pending-removal-in-3.17.rst:33 msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " -"removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :class:" -"`~collections.abc.Buffer`. For use in type annotations, prefer a union, like " -"``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by " -"Shantanu Jain in :gh:`91896`.)" +"removal in Python 3.17." msgstr "" -"自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python " -"3.17 中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:`~" -"collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " -"bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" - -#: ../../deprecations/pending-removal-in-3.17.rst:17 -msgid ":mod:`collections.abc`:" -msgstr ":mod:`collections.abc`:" - -#: ../../deprecations/pending-removal-in-3.17.rst:19 -msgid "" -":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. " -"Prefer :class:`~collections.abc.Sequence` or :class:`~collections.abc." -"Buffer`. For use in type annotations, prefer a union, like ``bytes | " -"bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " -"Jain in :gh:`91896`.)" -msgstr "" -":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 " -":class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" -"型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections.abc." -"Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" #: ../../deprecations/pending-removal-in-3.19.rst:2 msgid "Pending removal in Python 3.19" @@ -566,10 +580,6 @@ msgid "The :class:`argparse.FileType` type converter is deprecated." msgstr ":class:`argparse.FileType` 型別轉換器已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:18 -msgid "``bool(NotImplemented)``." -msgstr "``bool(NotImplemented)``。" - -#: ../../deprecations/pending-removal-in-future.rst:19 msgid "" "Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " "is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " @@ -578,7 +588,7 @@ msgstr "" "產生器:``throw(type, exc, tb)`` 和 ``athrow(type, exc, tb)`` 簽名已被棄用:" "請改用 ``throw(exc)`` 和 ``athrow(exc)``,為單引數簽名。" -#: ../../deprecations/pending-removal-in-future.rst:22 +#: ../../deprecations/pending-removal-in-future.rst:21 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -596,7 +606,7 @@ msgstr "" "`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版" "本中,它將被更改為語法錯誤。(:gh:`87999`)" -#: ../../deprecations/pending-removal-in-future.rst:30 +#: ../../deprecations/pending-removal-in-future.rst:29 msgid "" "Support for ``__index__()`` and ``__int__()`` method returning non-int type: " "these methods will be required to return an instance of a strict subclass " @@ -605,7 +615,7 @@ msgstr "" "``__index__()`` 和 ``__int__()`` 方法回傳非 int 型別的支援:這些方法將需要回" "傳 :class:`int` 的嚴格子類別實例。" -#: ../../deprecations/pending-removal-in-future.rst:33 +#: ../../deprecations/pending-removal-in-future.rst:32 msgid "" "Support for ``__float__()`` method returning a strict subclass of :class:" "`float`: these methods will be required to return an instance of :class:" @@ -614,7 +624,7 @@ msgstr "" "回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回" "傳 :class:`float` 的實例。" -#: ../../deprecations/pending-removal-in-future.rst:36 +#: ../../deprecations/pending-removal-in-future.rst:35 msgid "" "Support for ``__complex__()`` method returning a strict subclass of :class:" "`complex`: these methods will be required to return an instance of :class:" @@ -623,11 +633,11 @@ msgstr "" "回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要" "回傳 :class:`complex` 的實例。" -#: ../../deprecations/pending-removal-in-future.rst:39 +#: ../../deprecations/pending-removal-in-future.rst:38 msgid "Delegation of ``int()`` to ``__trunc__()`` method." msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" -#: ../../deprecations/pending-removal-in-future.rst:40 +#: ../../deprecations/pending-removal-in-future.rst:39 msgid "" "Passing a complex number as the *real* or *imag* argument in the :func:" "`complex` constructor is now deprecated; it should only be passed as a " @@ -637,7 +647,7 @@ msgstr "" "在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" "它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:45 +#: ../../deprecations/pending-removal-in-future.rst:44 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." @@ -647,25 +657,25 @@ msgstr "" "被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince " "Roshan 於 :gh:`103636` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:50 +#: ../../deprecations/pending-removal-in-future.rst:49 msgid "" ":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:" "`133038`)" msgstr "" ":mod:`codecs`:請改用 :func:`open` 而非 :func:`codecs.open`。(:gh:`133038`)" -#: ../../deprecations/pending-removal-in-future.rst:52 +#: ../../deprecations/pending-removal-in-future.rst:51 msgid "" ":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " "instead." msgstr "" ":attr:`codeobject.co_lnotab`:請改用 :meth:`codeobject.co_lines` 方法。" -#: ../../deprecations/pending-removal-in-future.rst:55 +#: ../../deprecations/pending-removal-in-future.rst:54 msgid ":mod:`datetime`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-future.rst:57 +#: ../../deprecations/pending-removal-in-future.rst:56 msgid "" ":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." "UTC)``." @@ -673,7 +683,7 @@ msgstr "" ":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime." "now(tz=datetime.UTC)``。" -#: ../../deprecations/pending-removal-in-future.rst:59 +#: ../../deprecations/pending-removal-in-future.rst:58 msgid "" ":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." "fromtimestamp(timestamp, tz=datetime.UTC)``." @@ -681,11 +691,11 @@ msgstr "" ":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime." "fromtimestamp(timestamp, tz=datetime.UTC)``。" -#: ../../deprecations/pending-removal-in-future.rst:62 +#: ../../deprecations/pending-removal-in-future.rst:61 msgid ":mod:`gettext`: Plural value must be an integer." msgstr ":mod:`gettext`:複數值必須是整數。" -#: ../../deprecations/pending-removal-in-future.rst:66 +#: ../../deprecations/pending-removal-in-future.rst:65 msgid "" ":func:`~importlib.util.cache_from_source` *debug_override* parameter is " "deprecated: use the *optimization* parameter instead." @@ -693,19 +703,19 @@ msgstr "" ":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改" "用 *optimization* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:69 +#: ../../deprecations/pending-removal-in-future.rst:68 msgid ":mod:`importlib.metadata`:" msgstr ":mod:`importlib.metadata`:" -#: ../../deprecations/pending-removal-in-future.rst:71 +#: ../../deprecations/pending-removal-in-future.rst:70 msgid "``EntryPoints`` tuple interface." msgstr "``EntryPoints`` 元組介面。" -#: ../../deprecations/pending-removal-in-future.rst:72 +#: ../../deprecations/pending-removal-in-future.rst:71 msgid "Implicit ``None`` on return values." msgstr "回傳值上的隱式 ``None``。" -#: ../../deprecations/pending-removal-in-future.rst:74 +#: ../../deprecations/pending-removal-in-future.rst:73 msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." @@ -713,19 +723,19 @@ msgstr "" ":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" "`~logging.warning`。" -#: ../../deprecations/pending-removal-in-future.rst:77 +#: ../../deprecations/pending-removal-in-future.rst:76 msgid "" ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " "BytesIO and binary mode instead." msgstr "" ":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。" -#: ../../deprecations/pending-removal-in-future.rst:80 +#: ../../deprecations/pending-removal-in-future.rst:79 msgid "" ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。" -#: ../../deprecations/pending-removal-in-future.rst:82 +#: ../../deprecations/pending-removal-in-future.rst:81 msgid "" ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " "deprecated, use an exception instance." @@ -733,7 +743,7 @@ msgstr "" ":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外" "實例。" -#: ../../deprecations/pending-removal-in-future.rst:85 +#: ../../deprecations/pending-removal-in-future.rst:84 msgid "" ":mod:`re`: More strict rules are now applied for numerical group references " "and group names in regular expressions. Only sequence of ASCII digits is " @@ -745,12 +755,12 @@ msgstr "" "有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能" "包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:92 +#: ../../deprecations/pending-removal-in-future.rst:91 msgid "" ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。" -#: ../../deprecations/pending-removal-in-future.rst:94 +#: ../../deprecations/pending-removal-in-future.rst:93 msgid "" ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " "Python 3.12; use the *onexc* parameter instead." @@ -758,15 +768,15 @@ msgstr "" ":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被" "棄用;請改用 *onexc* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:97 +#: ../../deprecations/pending-removal-in-future.rst:96 msgid ":mod:`ssl` options and protocols:" msgstr ":mod:`ssl` 選項和協定:" -#: ../../deprecations/pending-removal-in-future.rst:99 +#: ../../deprecations/pending-removal-in-future.rst:98 msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:100 +#: ../../deprecations/pending-removal-in-future.rst:99 msgid "" ":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" "`!selected_npn_protocol` are deprecated: use ALPN instead." @@ -774,51 +784,51 @@ msgstr "" ":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" "`!selected_npn_protocol` 已被棄用:請改用 ALPN。" -#: ../../deprecations/pending-removal-in-future.rst:103 +#: ../../deprecations/pending-removal-in-future.rst:102 msgid "``ssl.OP_NO_SSL*`` options" msgstr "``ssl.OP_NO_SSL*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:104 +#: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.OP_NO_TLS*`` options" msgstr "``ssl.OP_NO_TLS*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:105 +#: ../../deprecations/pending-removal-in-future.rst:104 msgid "``ssl.PROTOCOL_SSLv3``" msgstr "``ssl.PROTOCOL_SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:106 +#: ../../deprecations/pending-removal-in-future.rst:105 msgid "``ssl.PROTOCOL_TLS``" msgstr "``ssl.PROTOCOL_TLS``" -#: ../../deprecations/pending-removal-in-future.rst:107 +#: ../../deprecations/pending-removal-in-future.rst:106 msgid "``ssl.PROTOCOL_TLSv1``" msgstr "``ssl.PROTOCOL_TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:108 +#: ../../deprecations/pending-removal-in-future.rst:107 msgid "``ssl.PROTOCOL_TLSv1_1``" msgstr "``ssl.PROTOCOL_TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:109 +#: ../../deprecations/pending-removal-in-future.rst:108 msgid "``ssl.PROTOCOL_TLSv1_2``" msgstr "``ssl.PROTOCOL_TLSv1_2``" -#: ../../deprecations/pending-removal-in-future.rst:110 +#: ../../deprecations/pending-removal-in-future.rst:109 msgid "``ssl.TLSVersion.SSLv3``" msgstr "``ssl.TLSVersion.SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:111 +#: ../../deprecations/pending-removal-in-future.rst:110 msgid "``ssl.TLSVersion.TLSv1``" msgstr "``ssl.TLSVersion.TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:112 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "``ssl.TLSVersion.TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:113 msgid ":mod:`threading` methods:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-future.rst:116 +#: ../../deprecations/pending-removal-in-future.rst:115 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." @@ -826,11 +836,11 @@ msgstr "" ":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." "notify_all`。" -#: ../../deprecations/pending-removal-in-future.rst:117 +#: ../../deprecations/pending-removal-in-future.rst:116 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。" -#: ../../deprecations/pending-removal-in-future.rst:118 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." @@ -838,7 +848,7 @@ msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." @@ -846,20 +856,20 @@ msgstr "" ":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" "attr:`threading.Thread.name` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:122 +#: ../../deprecations/pending-removal-in-future.rst:121 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" ":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。" -#: ../../deprecations/pending-removal-in-future.rst:123 +#: ../../deprecations/pending-removal-in-future.rst:122 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。" -#: ../../deprecations/pending-removal-in-future.rst:125 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr ":class:`typing.Text` (:gh:`92332`)。" -#: ../../deprecations/pending-removal-in-future.rst:127 +#: ../../deprecations/pending-removal-in-future.rst:126 msgid "" "The internal class ``typing._UnionGenericAlias`` is no longer used to " "implement :class:`typing.Union`. To preserve compatibility with users using " @@ -870,7 +880,7 @@ msgstr "" "了保持與此私有類別使用者的相容性,直到至少 Python 3.17 都將提供一個相容性 " "shim。(由 Jelle Zijlstra 於 :gh:`105499` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." @@ -878,64 +888,64 @@ msgstr "" ":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已" "被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" ":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``splitattr()``" msgstr "``splitattr()``" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:137 msgid "``splithost()``" msgstr "``splithost()``" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "``splitnport()``" msgstr "``splitnport()``" -#: ../../deprecations/pending-removal-in-future.rst:140 +#: ../../deprecations/pending-removal-in-future.rst:139 msgid "``splitpasswd()``" msgstr "``splitpasswd()``" -#: ../../deprecations/pending-removal-in-future.rst:141 +#: ../../deprecations/pending-removal-in-future.rst:140 msgid "``splitport()``" msgstr "``splitport()``" -#: ../../deprecations/pending-removal-in-future.rst:142 +#: ../../deprecations/pending-removal-in-future.rst:141 msgid "``splitquery()``" msgstr "``splitquery()``" -#: ../../deprecations/pending-removal-in-future.rst:143 +#: ../../deprecations/pending-removal-in-future.rst:142 msgid "``splittag()``" msgstr "``splittag()``" -#: ../../deprecations/pending-removal-in-future.rst:144 +#: ../../deprecations/pending-removal-in-future.rst:143 msgid "``splittype()``" msgstr "``splittype()``" -#: ../../deprecations/pending-removal-in-future.rst:145 +#: ../../deprecations/pending-removal-in-future.rst:144 msgid "``splituser()``" msgstr "``splituser()``" -#: ../../deprecations/pending-removal-in-future.rst:146 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "``splitvalue()``" msgstr "``splitvalue()``" -#: ../../deprecations/pending-removal-in-future.rst:147 +#: ../../deprecations/pending-removal-in-future.rst:146 msgid "``to_bytes()``" msgstr "``to_bytes()``" -#: ../../deprecations/pending-removal-in-future.rst:149 +#: ../../deprecations/pending-removal-in-future.rst:148 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。" -#: ../../deprecations/pending-removal-in-future.rst:152 +#: ../../deprecations/pending-removal-in-future.rst:151 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -946,7 +956,7 @@ msgstr "" "Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " "``len(elem)`` 或 ``elem is not None`` 測試。" -#: ../../deprecations/pending-removal-in-future.rst:157 +#: ../../deprecations/pending-removal-in-future.rst:156 msgid "" ":func:`sys._clear_type_cache` is deprecated: use :func:`sys." "_clear_internal_caches` instead." @@ -1469,8 +1479,8 @@ msgid "" "(Contributed by Victor Stinner in :gh:`128863`.)" msgstr "" "可以使用 `pythoncapi-compat project `__ 來取得這些於 Python 3.13 及更早版本的新公開函式。(由 " -"Victor Stinner 在 :gh:`128863` 貢獻)" +"compat/>`__ 來取得這些於 Python 3.13 及更早版本的新公開函式。(由 Victor " +"Stinner 在 :gh:`128863` 貢獻)" #: ../../deprecations/c-api-pending-removal-in-future.rst:4 msgid "" @@ -1574,3 +1584,31 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-future.rst:41 msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" + +#~ msgid "``bool(NotImplemented)``." +#~ msgstr "``bool(NotImplemented)``。" + +#~ msgid "" +#~ ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " +#~ "removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :" +#~ "class:`~collections.abc.Buffer`. For use in type annotations, prefer a " +#~ "union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. " +#~ "(Contributed by Shantanu Jain in :gh:`91896`.)" +#~ msgstr "" +#~ "自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python 3.17 " +#~ "中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:" +#~ "`~collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " +#~ "bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:" +#~ "`91896` 貢獻。)" + +#~ msgid "" +#~ ":class:`collections.abc.ByteString` is scheduled for removal in Python " +#~ "3.17. Prefer :class:`~collections.abc.Sequence` or :class:`~collections." +#~ "abc.Buffer`. For use in type annotations, prefer a union, like ``bytes | " +#~ "bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " +#~ "Jain in :gh:`91896`.)" +#~ msgstr "" +#~ ":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 :" +#~ "class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" +#~ "型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections." +#~ "abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" diff --git a/deprecations/pending-removal-in-3.17.po b/deprecations/pending-removal-in-3.17.po index 49abbd6744..967084d32f 100644 --- a/deprecations/pending-removal-in-3.17.po +++ b/deprecations/pending-removal-in-3.17.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-18 00:15+0000\n" +"POT-Creation-Date: 2025-09-19 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,10 +21,48 @@ msgid "Pending removal in Python 3.17" msgstr "Python 3.17 中待移除的項目" #: ../../deprecations/pending-removal-in-3.17.rst:4 +msgid ":mod:`collections.abc`:" +msgstr ":mod:`collections.abc`:" + +#: ../../deprecations/pending-removal-in-3.17.rst:6 +msgid "" +":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:8 +#: ../../deprecations/pending-removal-in-3.17.rst:36 +msgid "" +"Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " +"implements the :ref:`buffer protocol ` at runtime. For use in " +"type annotations, either use :class:`~collections.abc.Buffer` or a union " +"that explicitly specifies the types your code supports (e.g., ``bytes | " +"bytearray | memoryview``)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:14 +#: ../../deprecations/pending-removal-in-3.17.rst:42 +msgid "" +":class:`!ByteString` was originally intended to be an abstract class that " +"would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " +"However, since the ABC never had any methods, knowing that an object was an " +"instance of :class:`!ByteString` never actually told you anything useful " +"about the object. Other common buffer types such as :class:`memoryview` were " +"also never understood as subtypes of :class:`!ByteString` (either at runtime " +"or by static type checkers)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:22 +#: ../../deprecations/pending-removal-in-3.17.rst:50 +msgid "" +"See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:26 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" -#: ../../deprecations/pending-removal-in-3.17.rst:6 +#: ../../deprecations/pending-removal-in-3.17.rst:28 msgid "" "Before Python 3.14, old-style unions were implemented using the private " "class ``typing._UnionGenericAlias``. This class is no longer needed for the " @@ -38,32 +76,33 @@ msgstr "" "除。使用者應該改用文件中記錄的內省輔助函式,例如 :func:`typing.get_origin` " "和 :func:`typing.get_args`,或者依賴私有實作細節。" -#: ../../deprecations/pending-removal-in-3.17.rst:11 +#: ../../deprecations/pending-removal-in-3.17.rst:33 msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " -"removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :class:" -"`~collections.abc.Buffer`. For use in type annotations, prefer a union, like " -"``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by " -"Shantanu Jain in :gh:`91896`.)" +"removal in Python 3.17." msgstr "" -"自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python " -"3.17 中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:`~" -"collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " -"bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.17.rst:17 -msgid ":mod:`collections.abc`:" -msgstr ":mod:`collections.abc`:" +#~ msgid "" +#~ ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " +#~ "removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :" +#~ "class:`~collections.abc.Buffer`. For use in type annotations, prefer a " +#~ "union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. " +#~ "(Contributed by Shantanu Jain in :gh:`91896`.)" +#~ msgstr "" +#~ "自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python 3.17 " +#~ "中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:" +#~ "`~collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " +#~ "bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:" +#~ "`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.17.rst:19 -msgid "" -":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. " -"Prefer :class:`~collections.abc.Sequence` or :class:`~collections.abc." -"Buffer`. For use in type annotations, prefer a union, like ``bytes | " -"bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " -"Jain in :gh:`91896`.)" -msgstr "" -":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 " -":class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" -"型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections.abc." -"Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" +#~ msgid "" +#~ ":class:`collections.abc.ByteString` is scheduled for removal in Python " +#~ "3.17. Prefer :class:`~collections.abc.Sequence` or :class:`~collections." +#~ "abc.Buffer`. For use in type annotations, prefer a union, like ``bytes | " +#~ "bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " +#~ "Jain in :gh:`91896`.)" +#~ msgstr "" +#~ ":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 :" +#~ "class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" +#~ "型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections." +#~ "abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po index 60bdaf627e..8e1c4d5103 100644 --- a/deprecations/pending-removal-in-future.po +++ b/deprecations/pending-removal-in-future.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-06 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,11 +37,11 @@ msgstr "巢狀引數群組和巢狀互斥群組已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:11 msgid "" -"Passing the undocumented keyword argument *prefix_chars* " -"to :meth:`~argparse.ArgumentParser.add_argument_group` is now deprecated." +"Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse." +"ArgumentParser.add_argument_group` is now deprecated." msgstr "" -"將未以文件記錄的關鍵字引數 *prefix_chars* 傳遞" -"給 :meth:`~argparse.ArgumentParser.add_argument_group` 的做法現在已被棄用。" +"將未以文件記錄的關鍵字引數 *prefix_chars* 傳遞給 :meth:`~argparse." +"ArgumentParser.add_argument_group` 的做法現在已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:14 msgid "The :class:`argparse.FileType` type converter is deprecated." @@ -52,10 +52,6 @@ msgid ":mod:`builtins`:" msgstr ":mod:`builtins`:" #: ../../deprecations/pending-removal-in-future.rst:18 -msgid "``bool(NotImplemented)``." -msgstr "``bool(NotImplemented)``。" - -#: ../../deprecations/pending-removal-in-future.rst:19 msgid "" "Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " "is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " @@ -64,25 +60,25 @@ msgstr "" "產生器:``throw(type, exc, tb)`` 和 ``athrow(type, exc, tb)`` 簽名已被棄用:" "請改用 ``throw(exc)`` 和 ``athrow(exc)``,為單引數簽名。" -#: ../../deprecations/pending-removal-in-future.rst:22 +#: ../../deprecations/pending-removal-in-future.rst:21 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " "ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " "``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " -"if the numeric literal is immediately followed by one of " -"keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :keyword:`is` " -"and :keyword:`or`. In a future release it will be changed to a syntax " -"error. (:gh:`87999`)" +"if the numeric literal is immediately followed by one of keywords :keyword:" +"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" +"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " +"syntax error. (:gh:`87999`)" msgstr "" "目前 Python 接受數值字面值後面立即接關鍵字,例如 ``0in x``、``1or x``、``0if " "1else 2``。它讓表達式模糊且容易混淆,如 ``[0x1for x in y]``\\ (可以解釋為 " -"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即" -"接 :keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:`in`、:keyword:`is` " -"和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版本中,它將被更改為語" -"法錯誤。(:gh:`87999`)" +"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即接 :" +"keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:" +"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版" +"本中,它將被更改為語法錯誤。(:gh:`87999`)" -#: ../../deprecations/pending-removal-in-future.rst:30 +#: ../../deprecations/pending-removal-in-future.rst:29 msgid "" "Support for ``__index__()`` and ``__int__()`` method returning non-int type: " "these methods will be required to return an instance of a strict subclass " @@ -91,92 +87,91 @@ msgstr "" "``__index__()`` 和 ``__int__()`` 方法回傳非 int 型別的支援:這些方法將需要回" "傳 :class:`int` 的嚴格子類別實例。" -#: ../../deprecations/pending-removal-in-future.rst:33 +#: ../../deprecations/pending-removal-in-future.rst:32 msgid "" -"Support for ``__float__()`` method returning a strict subclass " -"of :class:`float`: these methods will be required to return an instance " -"of :class:`float`." +"Support for ``__float__()`` method returning a strict subclass of :class:" +"`float`: these methods will be required to return an instance of :class:" +"`float`." msgstr "" "回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回" "傳 :class:`float` 的實例。" -#: ../../deprecations/pending-removal-in-future.rst:36 +#: ../../deprecations/pending-removal-in-future.rst:35 msgid "" -"Support for ``__complex__()`` method returning a strict subclass " -"of :class:`complex`: these methods will be required to return an instance " -"of :class:`complex`." +"Support for ``__complex__()`` method returning a strict subclass of :class:" +"`complex`: these methods will be required to return an instance of :class:" +"`complex`." msgstr "" "回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要" "回傳 :class:`complex` 的實例。" -#: ../../deprecations/pending-removal-in-future.rst:39 +#: ../../deprecations/pending-removal-in-future.rst:38 msgid "Delegation of ``int()`` to ``__trunc__()`` method." msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" -#: ../../deprecations/pending-removal-in-future.rst:40 +#: ../../deprecations/pending-removal-in-future.rst:39 msgid "" -"Passing a complex number as the *real* or *imag* argument in " -"the :func:`complex` constructor is now deprecated; it should only be passed " -"as a single positional argument. (Contributed by Serhiy Storchaka " -"in :gh:`109218`.)" +"Passing a complex number as the *real* or *imag* argument in the :func:" +"`complex` constructor is now deprecated; it should only be passed as a " +"single positional argument. (Contributed by Serhiy Storchaka in :gh:" +"`109218`.)" msgstr "" "在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" "它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:45 +#: ../../deprecations/pending-removal-in-future.rst:44 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`.)" +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" ":mod:`calendar`:``calendar.January`` 和 ``calendar.February`` 常數已被棄用並" "被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince " "Roshan 於 :gh:`103636` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:50 +#: ../../deprecations/pending-removal-in-future.rst:49 msgid "" -":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. " -"(:gh:`133038`)" +":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:" +"`133038`)" msgstr "" ":mod:`codecs`:請改用 :func:`open` 而非 :func:`codecs.open`。(:gh:`133038`)" -#: ../../deprecations/pending-removal-in-future.rst:52 +#: ../../deprecations/pending-removal-in-future.rst:51 msgid "" ":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " "instead." msgstr "" ":attr:`codeobject.co_lnotab`:請改用 :meth:`codeobject.co_lines` 方法。" -#: ../../deprecations/pending-removal-in-future.rst:55 +#: ../../deprecations/pending-removal-in-future.rst:54 msgid ":mod:`datetime`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-future.rst:57 +#: ../../deprecations/pending-removal-in-future.rst:56 msgid "" -":meth:`~datetime.datetime.utcnow`: use " -"``datetime.datetime.now(tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." +"UTC)``." msgstr "" -":meth:`~datetime.datetime.utcnow`:請改用 " -"``datetime.datetime.now(tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime." +"now(tz=datetime.UTC)``。" -#: ../../deprecations/pending-removal-in-future.rst:59 +#: ../../deprecations/pending-removal-in-future.rst:58 msgid "" -":meth:`~datetime.datetime.utcfromtimestamp`: use " -"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" -":meth:`~datetime.datetime.utcfromtimestamp`:請改用 " -"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``。" -#: ../../deprecations/pending-removal-in-future.rst:62 +#: ../../deprecations/pending-removal-in-future.rst:61 msgid ":mod:`gettext`: Plural value must be an integer." msgstr ":mod:`gettext`:複數值必須是整數。" -#: ../../deprecations/pending-removal-in-future.rst:64 +#: ../../deprecations/pending-removal-in-future.rst:63 msgid ":mod:`importlib`:" msgstr ":mod:`importlib`:" -#: ../../deprecations/pending-removal-in-future.rst:66 +#: ../../deprecations/pending-removal-in-future.rst:65 msgid "" ":func:`~importlib.util.cache_from_source` *debug_override* parameter is " "deprecated: use the *optimization* parameter instead." @@ -184,39 +179,39 @@ msgstr "" ":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改" "用 *optimization* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:69 +#: ../../deprecations/pending-removal-in-future.rst:68 msgid ":mod:`importlib.metadata`:" msgstr ":mod:`importlib.metadata`:" -#: ../../deprecations/pending-removal-in-future.rst:71 +#: ../../deprecations/pending-removal-in-future.rst:70 msgid "``EntryPoints`` tuple interface." msgstr "``EntryPoints`` 元組介面。" -#: ../../deprecations/pending-removal-in-future.rst:72 +#: ../../deprecations/pending-removal-in-future.rst:71 msgid "Implicit ``None`` on return values." msgstr "回傳值上的隱式 ``None``。" -#: ../../deprecations/pending-removal-in-future.rst:74 +#: ../../deprecations/pending-removal-in-future.rst:73 msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改" -"用 :meth:`~logging.warning`。" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" +"`~logging.warning`。" -#: ../../deprecations/pending-removal-in-future.rst:77 +#: ../../deprecations/pending-removal-in-future.rst:76 msgid "" ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " "BytesIO and binary mode instead." msgstr "" ":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。" -#: ../../deprecations/pending-removal-in-future.rst:80 +#: ../../deprecations/pending-removal-in-future.rst:79 msgid "" ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。" -#: ../../deprecations/pending-removal-in-future.rst:82 +#: ../../deprecations/pending-removal-in-future.rst:81 msgid "" ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " "deprecated, use an exception instance." @@ -224,7 +219,7 @@ msgstr "" ":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外" "實例。" -#: ../../deprecations/pending-removal-in-future.rst:85 +#: ../../deprecations/pending-removal-in-future.rst:84 msgid "" ":mod:`re`: More strict rules are now applied for numerical group references " "and group names in regular expressions. Only sequence of ASCII digits is " @@ -236,12 +231,12 @@ msgstr "" "有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能" "包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:92 +#: ../../deprecations/pending-removal-in-future.rst:91 msgid "" ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。" -#: ../../deprecations/pending-removal-in-future.rst:94 +#: ../../deprecations/pending-removal-in-future.rst:93 msgid "" ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " "Python 3.12; use the *onexc* parameter instead." @@ -249,108 +244,108 @@ msgstr "" ":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被" "棄用;請改用 *onexc* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:97 +#: ../../deprecations/pending-removal-in-future.rst:96 msgid ":mod:`ssl` options and protocols:" msgstr ":mod:`ssl` 選項和協定:" -#: ../../deprecations/pending-removal-in-future.rst:99 +#: ../../deprecations/pending-removal-in-future.rst:98 msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:100 +#: ../../deprecations/pending-removal-in-future.rst:99 msgid "" -":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` " -"and :meth:`!selected_npn_protocol` are deprecated: use ALPN instead." +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" +"`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" -":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` " -"和 :meth:`!selected_npn_protocol` 已被棄用:請改用 ALPN。" +":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" +"`!selected_npn_protocol` 已被棄用:請改用 ALPN。" -#: ../../deprecations/pending-removal-in-future.rst:103 +#: ../../deprecations/pending-removal-in-future.rst:102 msgid "``ssl.OP_NO_SSL*`` options" msgstr "``ssl.OP_NO_SSL*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:104 +#: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.OP_NO_TLS*`` options" msgstr "``ssl.OP_NO_TLS*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:105 +#: ../../deprecations/pending-removal-in-future.rst:104 msgid "``ssl.PROTOCOL_SSLv3``" msgstr "``ssl.PROTOCOL_SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:106 +#: ../../deprecations/pending-removal-in-future.rst:105 msgid "``ssl.PROTOCOL_TLS``" msgstr "``ssl.PROTOCOL_TLS``" -#: ../../deprecations/pending-removal-in-future.rst:107 +#: ../../deprecations/pending-removal-in-future.rst:106 msgid "``ssl.PROTOCOL_TLSv1``" msgstr "``ssl.PROTOCOL_TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:108 +#: ../../deprecations/pending-removal-in-future.rst:107 msgid "``ssl.PROTOCOL_TLSv1_1``" msgstr "``ssl.PROTOCOL_TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:109 +#: ../../deprecations/pending-removal-in-future.rst:108 msgid "``ssl.PROTOCOL_TLSv1_2``" msgstr "``ssl.PROTOCOL_TLSv1_2``" -#: ../../deprecations/pending-removal-in-future.rst:110 +#: ../../deprecations/pending-removal-in-future.rst:109 msgid "``ssl.TLSVersion.SSLv3``" msgstr "``ssl.TLSVersion.SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:111 +#: ../../deprecations/pending-removal-in-future.rst:110 msgid "``ssl.TLSVersion.TLSv1``" msgstr "``ssl.TLSVersion.TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:112 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "``ssl.TLSVersion.TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:113 msgid ":mod:`threading` methods:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-future.rst:116 +#: ../../deprecations/pending-removal-in-future.rst:115 msgid "" -":meth:`!threading.Condition.notifyAll`: " -"use :meth:`~threading.Condition.notify_all`." +":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." +"notify_all`." msgstr "" -":meth:`!threading.Condition.notifyAll`:請" -"用 :meth:`~threading.Condition.notify_all`。" +":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." +"notify_all`。" -#: ../../deprecations/pending-removal-in-future.rst:117 +#: ../../deprecations/pending-removal-in-future.rst:116 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。" -#: ../../deprecations/pending-removal-in-future.rst:118 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid "" -":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: " -"use :attr:`threading.Thread.daemon` attribute." +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" +"attr:`threading.Thread.daemon` attribute." msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid "" -":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: " -"use :attr:`threading.Thread.name` attribute." +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" +"attr:`threading.Thread.name` attribute." msgstr "" -":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請" -"用 :attr:`threading.Thread.name` 屬性。" +":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" +"attr:`threading.Thread.name` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:122 +#: ../../deprecations/pending-removal-in-future.rst:121 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" ":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。" -#: ../../deprecations/pending-removal-in-future.rst:123 +#: ../../deprecations/pending-removal-in-future.rst:122 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。" -#: ../../deprecations/pending-removal-in-future.rst:125 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr ":class:`typing.Text` (:gh:`92332`)。" -#: ../../deprecations/pending-removal-in-future.rst:127 +#: ../../deprecations/pending-removal-in-future.rst:126 msgid "" "The internal class ``typing._UnionGenericAlias`` is no longer used to " "implement :class:`typing.Union`. To preserve compatibility with users using " @@ -361,7 +356,7 @@ msgstr "" "了保持與此私有類別使用者的相容性,直到至少 Python 3.17 都將提供一個相容性 " "shim。(由 Jelle Zijlstra 於 :gh:`105499` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." @@ -369,78 +364,81 @@ msgstr "" ":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已" "被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" ":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``splitattr()``" msgstr "``splitattr()``" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:137 msgid "``splithost()``" msgstr "``splithost()``" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "``splitnport()``" msgstr "``splitnport()``" -#: ../../deprecations/pending-removal-in-future.rst:140 +#: ../../deprecations/pending-removal-in-future.rst:139 msgid "``splitpasswd()``" msgstr "``splitpasswd()``" -#: ../../deprecations/pending-removal-in-future.rst:141 +#: ../../deprecations/pending-removal-in-future.rst:140 msgid "``splitport()``" msgstr "``splitport()``" -#: ../../deprecations/pending-removal-in-future.rst:142 +#: ../../deprecations/pending-removal-in-future.rst:141 msgid "``splitquery()``" msgstr "``splitquery()``" -#: ../../deprecations/pending-removal-in-future.rst:143 +#: ../../deprecations/pending-removal-in-future.rst:142 msgid "``splittag()``" msgstr "``splittag()``" -#: ../../deprecations/pending-removal-in-future.rst:144 +#: ../../deprecations/pending-removal-in-future.rst:143 msgid "``splittype()``" msgstr "``splittype()``" -#: ../../deprecations/pending-removal-in-future.rst:145 +#: ../../deprecations/pending-removal-in-future.rst:144 msgid "``splituser()``" msgstr "``splituser()``" -#: ../../deprecations/pending-removal-in-future.rst:146 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "``splitvalue()``" msgstr "``splitvalue()``" -#: ../../deprecations/pending-removal-in-future.rst:147 +#: ../../deprecations/pending-removal-in-future.rst:146 msgid "``to_bytes()``" msgstr "``to_bytes()``" -#: ../../deprecations/pending-removal-in-future.rst:149 +#: ../../deprecations/pending-removal-in-future.rst:148 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。" -#: ../../deprecations/pending-removal-in-future.rst:152 +#: ../../deprecations/pending-removal-in-future.rst:151 msgid "" -":mod:`xml.etree.ElementTree`: Testing the truth value of " -"an :class:`~xml.etree.ElementTree.Element` is deprecated. In a future " -"release it will always return ``True``. Prefer explicit ``len(elem)`` or " -"``elem is not None`` tests instead." +":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." +"etree.ElementTree.Element` is deprecated. In a future release it will always " +"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " +"instead." msgstr "" -":mod:`xml.etree.ElementTree`:已棄用" -"對 :class:`~xml.etree.ElementTree.Element` 的真值測試。在未來版本中,它將始終" -"回傳 ``True``。請改用明確的 ``len(elem)`` 或 ``elem is not None`` 測試。" +":mod:`xml.etree.ElementTree`:已棄用對 :class:`~xml.etree.ElementTree." +"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " +"``len(elem)`` 或 ``elem is not None`` 測試。" -#: ../../deprecations/pending-removal-in-future.rst:157 +#: ../../deprecations/pending-removal-in-future.rst:156 msgid "" -":func:`sys._clear_type_cache` is deprecated: " -"use :func:`sys._clear_internal_caches` instead." +":func:`sys._clear_type_cache` is deprecated: use :func:`sys." +"_clear_internal_caches` instead." msgstr "" -":func:`sys._clear_type_cache` 已被棄用:請改" -"用 :func:`sys._clear_internal_caches`。" +":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." +"_clear_internal_caches`。" + +#~ msgid "``bool(NotImplemented)``." +#~ msgstr "``bool(NotImplemented)``。" diff --git a/extending/extending.po b/extending/extending.po index 452fcb6374..ec9327dda4 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2025-02-17 14:34+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -113,7 +113,7 @@ msgstr "" msgid "The first two lines of our file can be::" msgstr "我們檔案的前兩列可以為: ::" -#: ../../extending/extending.rst:60 ../../extending/extending.rst:681 +#: ../../extending/extending.rst:60 ../../extending/extending.rst:706 msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include " @@ -152,15 +152,86 @@ msgstr "" #: ../../extending/extending.rst:77 msgid "" "All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` " -"or ``PY``, except those defined in standard header files. For convenience, " -"and since they are used extensively by the Python interpreter, ``\"Python." -"h\"`` includes a few standard header files: ````, ````, " -"````, and ````. If the latter header file does not exist " -"on your system, it declares the functions :c:func:`malloc`, :c:func:`free` " -"and :c:func:`realloc` directly." +"or ``PY``, except those defined in standard header files." msgstr "" -#: ../../extending/extending.rst:85 +#: ../../extending/extending.rst:82 +msgid "" +"For backward compatibility, :file:`Python.h` includes several standard " +"header files. C extensions should include the standard headers that they " +"use, and should not rely on these implicit includes. If using the limited C " +"API version 3.13 or newer, the implicit includes are:" +msgstr "" + +#: ../../extending/extending.rst:87 +msgid "````" +msgstr "````" + +#: ../../extending/extending.rst:88 +msgid "```` (on Windows)" +msgstr "````\\ (在 Windows 上)" + +#: ../../extending/extending.rst:89 +msgid "````" +msgstr "````" + +#: ../../extending/extending.rst:90 +msgid "````" +msgstr "````" + +#: ../../extending/extending.rst:91 +msgid "````" +msgstr "````" + +#: ../../extending/extending.rst:92 +msgid "````" +msgstr "````" + +#: ../../extending/extending.rst:93 +msgid "````" +msgstr "````" + +#: ../../extending/extending.rst:94 +msgid "```` (if present)" +msgstr "````\\ (如果存在)" + +#: ../../extending/extending.rst:96 +msgid "" +"If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.12 or " +"older, the headers below are also included:" +msgstr "" + +#: ../../extending/extending.rst:99 +msgid "````" +msgstr "````" + +#: ../../extending/extending.rst:100 +msgid "```` (on POSIX)" +msgstr "````\\ (在 POSIX 上)" + +#: ../../extending/extending.rst:102 +msgid "" +"If :c:macro:`Py_LIMITED_API` is not defined, or is set to version 3.10 or " +"older, the headers below are also included:" +msgstr "" + +#: ../../extending/extending.rst:105 +msgid "````" +msgstr "````" + +#: ../../extending/extending.rst:106 +msgid "````" +msgstr "````" + +#: ../../extending/extending.rst:107 +msgid "````" +msgstr "````" + +#: ../../extending/extending.rst:108 +msgid "````" +msgstr "````" + +#: ../../extending/extending.rst:110 msgid "" "The next thing we add to our module file is the C function that will be " "called when the Python expression ``spam.system(string)`` is evaluated " @@ -170,7 +241,7 @@ msgstr "" "system(string)`` 要被求值 (evaluated) 時就會被呼叫(我們很快就會看到它最後是" "如何被呼叫的): ::" -#: ../../extending/extending.rst:89 +#: ../../extending/extending.rst:114 msgid "" "static PyObject *\n" "spam_system(PyObject *self, PyObject *args)\n" @@ -196,7 +267,7 @@ msgstr "" " return PyLong_FromLong(sts);\n" "}" -#: ../../extending/extending.rst:101 +#: ../../extending/extending.rst:126 msgid "" "There is a straightforward translation from the argument list in Python (for " "example, the single expression ``\"ls -l\"``) to the arguments passed to the " @@ -206,7 +277,7 @@ msgstr "" "可以很直觀地從 Python 的引數串列(例如單一的運算式 ``\"ls -l\"``)直接轉換成" "傳給 C 函式的引數。C 函式總是有兩個引數,習慣上會命名為 *self* 和 *args*。" -#: ../../extending/extending.rst:106 +#: ../../extending/extending.rst:131 msgid "" "The *self* argument points to the module object for module-level functions; " "for a method it would point to the object instance." @@ -214,7 +285,7 @@ msgstr "" "對於模組層級的函式,*self* 引數會指向模組物件;而對於方法來說則是指向物件的實" "例。" -#: ../../extending/extending.rst:109 +#: ../../extending/extending.rst:134 msgid "" "The *args* argument will be a pointer to a Python tuple object containing " "the arguments. Each item of the tuple corresponds to an argument in the " @@ -231,7 +302,7 @@ msgstr "" "`PyArg_ParseTuple` 函式能夠檢查引數型別並將他們轉換為 C 值。它使用模板字串來" "決定所需的引數型別以及儲存轉換值的 C 變數型別。稍後會再詳細說明。" -#: ../../extending/extending.rst:118 +#: ../../extending/extending.rst:143 msgid "" ":c:func:`PyArg_ParseTuple` returns true (nonzero) if all arguments have the " "right type and its components have been stored in the variables whose " @@ -245,11 +316,11 @@ msgstr "" "(零)。在後者情況下,它也會產生適當的例外,因此呼叫函式可以立即回傳 " "``NULL``\\ (就像我們在範例中所看到的)。" -#: ../../extending/extending.rst:128 +#: ../../extending/extending.rst:153 msgid "Intermezzo: Errors and Exceptions" msgstr "插曲:錯誤與例外" -#: ../../extending/extending.rst:130 +#: ../../extending/extending.rst:155 msgid "" "An important convention throughout the Python interpreter is the following: " "when a function fails, it should set an exception condition and return an " @@ -266,13 +337,13 @@ msgstr "" "們是由 :meth:`sys.exc_info` 所回傳的 Python 元組中的 C 等效元組。它們是例外型" "別、例外實例和回溯物件。了解它們對於理解錯誤是如何傳遞是很重要的。" -#: ../../extending/extending.rst:139 +#: ../../extending/extending.rst:164 msgid "" "The Python API defines a number of functions to set various types of " "exceptions." msgstr "Python API 定義了許多能夠設定各種類型例外的函式。" -#: ../../extending/extending.rst:141 +#: ../../extending/extending.rst:166 msgid "" "The most common one is :c:func:`PyErr_SetString`. Its arguments are an " "exception object and a C string. The exception object is usually a " @@ -285,7 +356,7 @@ msgstr "" "指出錯誤的原因,並被轉換為 Python 字串物件且被儲存為例外的「關聯值 " "(associated value)」。" -#: ../../extending/extending.rst:147 +#: ../../extending/extending.rst:172 msgid "" "Another useful function is :c:func:`PyErr_SetFromErrno`, which only takes an " "exception argument and constructs the associated value by inspection of the " @@ -299,7 +370,7 @@ msgstr "" "`PyErr_SetObject`,它接受兩個物件引數,即例外和它的關聯值。你不需要對傳給任何" "這些函式的物件呼叫 :c:func:`Py_INCREF`。" -#: ../../extending/extending.rst:154 +#: ../../extending/extending.rst:179 msgid "" "You can test non-destructively whether an exception has been set with :c:" "func:`PyErr_Occurred`. This returns the current exception object, or " @@ -311,7 +382,7 @@ msgstr "" "回傳目前的例外物件,如果沒有例外發生則回傳 ``NULL``。你通常不需要呼叫 :c:" "func:`PyErr_Occurred` 來查看函式呼叫是否發生錯誤,因為你應可從回傳值就得知。" -#: ../../extending/extending.rst:160 +#: ../../extending/extending.rst:185 msgid "" "When a function *f* that calls another function *g* detects that the latter " "fails, *f* should itself return an error value (usually ``NULL`` or " @@ -330,7 +401,7 @@ msgstr "" "首先檢測到它的函式回報了。一旦錯誤到達 Python 直譯器的主要迴圈,這會中止目前" "執行的 Python 程式碼,並嘗試尋找 Python 程式設計者指定的例外處理程式。" -#: ../../extending/extending.rst:170 +#: ../../extending/extending.rst:195 msgid "" "(There are situations where a module can actually give a more detailed error " "message by calling another ``PyErr_*`` function, and in such cases it is " @@ -342,7 +413,7 @@ msgstr "" "息,在這種情況下這樣做是沒問題的。然而這一般來說並非必要,而且可能會導致錯誤" "原因資訊的遺失:大多數的操作都可能因為各種原因而失敗。)" -#: ../../extending/extending.rst:176 +#: ../../extending/extending.rst:201 msgid "" "To ignore an exception set by a function call that failed, the exception " "condition must be cleared explicitly by calling :c:func:`PyErr_Clear`. The " @@ -355,7 +426,7 @@ msgstr "" "給直譯器而想要完全是自己來處理它時(可能是要再嘗試其他東西,或者假裝什麼都沒" "出錯)。" -#: ../../extending/extending.rst:182 +#: ../../extending/extending.rst:207 msgid "" "Every failing :c:func:`malloc` call must be turned into an exception --- the " "direct caller of :c:func:`malloc` (or :c:func:`realloc`) must call :c:func:" @@ -369,7 +440,7 @@ msgstr "" "`PyLong_FromLong`)都已經這麼做了,所以這個注意事項只和那些直接呼叫 :c:func:" "`malloc` 的函式有關。" -#: ../../extending/extending.rst:188 +#: ../../extending/extending.rst:213 msgid "" "Also note that, with the important exception of :c:func:`PyArg_ParseTuple` " "and friends, functions that return an integer status usually return a " @@ -380,7 +451,7 @@ msgstr "" "整數狀態的函式通常會回傳一個正值或 0 表示成功、回傳 ``-1`` 表示失敗,就像 " "Unix 系統呼叫一樣。" -#: ../../extending/extending.rst:192 +#: ../../extending/extending.rst:217 msgid "" "Finally, be careful to clean up garbage (by making :c:func:`Py_XDECREF` or :" "c:func:`Py_DECREF` calls for objects you have already created) when you " @@ -389,7 +460,7 @@ msgstr "" "最後,在回傳錯誤指示器時要注意垃圾清理(透過對你已經建立的物件呼叫 :c:func:" "`Py_XDECREF` 或 :c:func:`Py_DECREF`)!" -#: ../../extending/extending.rst:196 +#: ../../extending/extending.rst:221 msgid "" "The choice of which exception to raise is entirely yours. There are " "predeclared C objects corresponding to all built-in Python exceptions, such " @@ -409,7 +480,7 @@ msgstr "" "的值必須在一個特定的範圍內或必須滿足其他條件,則可以使用 :c:data:" "`PyExc_ValueError`。" -#: ../../extending/extending.rst:206 +#: ../../extending/extending.rst:231 msgid "" "You can also define a new exception that is unique to your module. The " "simplest way to do this is to declare a static global object variable at the " @@ -418,34 +489,34 @@ msgstr "" "你也可以定義一個你的模組特有的新例外。最簡單的方式是在檔案的開頭宣告一個靜態" "全域物件變數: ::" -#: ../../extending/extending.rst:210 +#: ../../extending/extending.rst:235 msgid "static PyObject *SpamError = NULL;" msgstr "static PyObject *SpamError = NULL;" -#: ../../extending/extending.rst:212 +#: ../../extending/extending.rst:237 msgid "" "and initialize it by calling :c:func:`PyErr_NewException` in the module's :c:" "data:`Py_mod_exec` function (:c:func:`!spam_module_exec`)::" msgstr "" -#: ../../extending/extending.rst:215 +#: ../../extending/extending.rst:240 msgid "SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);" msgstr "" -#: ../../extending/extending.rst:217 +#: ../../extending/extending.rst:242 msgid "" "Since :c:data:`!SpamError` is a global variable, it will be overwritten " "every time the module is reinitialized, when the :c:data:`Py_mod_exec` " "function is called." msgstr "" -#: ../../extending/extending.rst:220 +#: ../../extending/extending.rst:245 msgid "" "For now, let's avoid the issue: we will block repeated initialization by " "raising an :py:exc:`ImportError`::" msgstr "" -#: ../../extending/extending.rst:223 +#: ../../extending/extending.rst:248 msgid "" "static PyObject *SpamError = NULL;\n" "\n" @@ -484,7 +555,7 @@ msgid "" "}" msgstr "" -#: ../../extending/extending.rst:259 +#: ../../extending/extending.rst:284 msgid "" "Note that the Python name for the exception object is :exc:`!spam.error`. " "The :c:func:`PyErr_NewException` function may create a class with the base " @@ -495,7 +566,7 @@ msgstr "" "exceptions`\\ 所述,:c:func:`PyErr_NewException` 函式可能會建立一個基底類別" "為 :exc:`Exception` 的類別(除非傳入另一個類別來代替 ``NULL``)。" -#: ../../extending/extending.rst:264 +#: ../../extending/extending.rst:289 msgid "" "Note also that the :c:data:`!SpamError` variable retains a reference to the " "newly created exception class; this is intentional! Since the exception " @@ -511,7 +582,7 @@ msgstr "" "如果它變成迷途指標,那產生例外的 C 程式碼可能會導致核心轉儲 (core dump) 或其" "他不預期的 side effect。" -#: ../../extending/extending.rst:271 +#: ../../extending/extending.rst:296 msgid "" "For now, the :c:func:`Py_DECREF` call to remove this reference is missing. " "Even when the Python interpreter shuts down, the global :c:data:`!SpamError` " @@ -519,13 +590,13 @@ msgid "" "ensure that this will happen at most once per process." msgstr "" -#: ../../extending/extending.rst:276 +#: ../../extending/extending.rst:301 msgid "" "We discuss the use of :c:macro:`PyMODINIT_FUNC` as a function return type " "later in this sample." msgstr "我們稍後會討論 :c:macro:`PyMODINIT_FUNC` 作為函式回傳型別的用法。" -#: ../../extending/extending.rst:279 +#: ../../extending/extending.rst:304 msgid "" "The :exc:`!spam.error` exception can be raised in your extension module " "using a call to :c:func:`PyErr_SetString` as shown below::" @@ -533,7 +604,7 @@ msgstr "" "可以在你的擴充模組中呼叫 :c:func:`PyErr_SetString` 來引發 :exc:`!spam.error` " "例外,如下所示: ::" -#: ../../extending/extending.rst:282 +#: ../../extending/extending.rst:307 msgid "" "static PyObject *\n" "spam_system(PyObject *self, PyObject *args)\n" @@ -567,17 +638,17 @@ msgstr "" " return PyLong_FromLong(sts);\n" "}" -#: ../../extending/extending.rst:302 +#: ../../extending/extending.rst:327 msgid "Back to the Example" msgstr "回到範例" -#: ../../extending/extending.rst:304 +#: ../../extending/extending.rst:329 msgid "" "Going back to our example function, you should now be able to understand " "this statement::" msgstr "回到我們的範例函式,現在你應該可以理解這個陳述式了: ::" -#: ../../extending/extending.rst:307 +#: ../../extending/extending.rst:332 msgid "" "if (!PyArg_ParseTuple(args, \"s\", &command))\n" " return NULL;" @@ -585,7 +656,7 @@ msgstr "" "if (!PyArg_ParseTuple(args, \"s\", &command))\n" " return NULL;" -#: ../../extending/extending.rst:310 +#: ../../extending/extending.rst:335 msgid "" "It returns ``NULL`` (the error indicator for functions returning object " "pointers) if an error is detected in the argument list, relying on the " @@ -601,7 +672,7 @@ msgstr "" "的字串(所以在標準 C 中,:c:data:`!command` 變數應該正確地被宣告為 ``const " "char *command``)。" -#: ../../extending/extending.rst:318 +#: ../../extending/extending.rst:343 msgid "" "The next statement is a call to the Unix function :c:func:`system`, passing " "it the string we just got from :c:func:`PyArg_ParseTuple`::" @@ -609,11 +680,11 @@ msgstr "" "接下來的陳述式會呼叫 Unix 函式 :c:func:`system`,並將剛才從 :c:func:" "`PyArg_ParseTuple` 得到的字串傳給它:" -#: ../../extending/extending.rst:321 +#: ../../extending/extending.rst:346 msgid "sts = system(command);" msgstr "sts = system(command);" -#: ../../extending/extending.rst:323 +#: ../../extending/extending.rst:348 msgid "" "Our :func:`!spam.system` function must return the value of :c:data:`!sts` as " "a Python object. This is done using the function :c:func:" @@ -622,11 +693,11 @@ msgstr "" "我們的 :func:`!spam.system` 函式必須以 Python 物件的形式來回傳 :c:data:`!" "sts` 的值。這是透過 :c:func:`PyLong_FromLong` 函式來達成。 ::" -#: ../../extending/extending.rst:326 +#: ../../extending/extending.rst:351 msgid "return PyLong_FromLong(sts);" msgstr "return PyLong_FromLong(sts);" -#: ../../extending/extending.rst:328 +#: ../../extending/extending.rst:353 msgid "" "In this case, it will return an integer object. (Yes, even integers are " "objects on the heap in Python!)" @@ -634,7 +705,7 @@ msgstr "" "在這種情況下它會回傳一個整數物件。(是的,在 Python 中連整數也是堆積 (heap) 上" "的物件!)" -#: ../../extending/extending.rst:331 +#: ../../extending/extending.rst:356 msgid "" "If you have a C function that returns no useful argument (a function " "returning :c:expr:`void`), the corresponding Python function must return " @@ -645,7 +716,7 @@ msgstr "" "應的 Python 函式必須回傳 ``None``。你需要以下這個慣例來達成(由 :c:macro:" "`Py_RETURN_NONE` 巨集實作): ::" -#: ../../extending/extending.rst:336 +#: ../../extending/extending.rst:361 msgid "" "Py_INCREF(Py_None);\n" "return Py_None;" @@ -653,7 +724,7 @@ msgstr "" "Py_INCREF(Py_None);\n" "return Py_None;" -#: ../../extending/extending.rst:339 +#: ../../extending/extending.rst:364 msgid "" ":c:data:`Py_None` is the C name for the special Python object ``None``. It " "is a genuine Python object rather than a ``NULL`` pointer, which means " @@ -663,11 +734,11 @@ msgstr "" "Python 物件而不是一個 ``NULL`` 指標,在大多數的情況下它的意思是「錯誤」,如我" "們所見過的那樣。" -#: ../../extending/extending.rst:347 +#: ../../extending/extending.rst:372 msgid "The Module's Method Table and Initialization Function" msgstr "模組的方法表和初始化函式" -#: ../../extending/extending.rst:349 +#: ../../extending/extending.rst:374 msgid "" "I promised to show how :c:func:`!spam_system` is called from Python " "programs. First, we need to list its name and address in a \"method table\"::" @@ -675,7 +746,7 @@ msgstr "" "我承諾過要展示 :c:func:`!spam_system` 是如何從 Python 程式中呼叫的。首先,我" "們需要在「方法表」中列出它的名稱和位址: ::" -#: ../../extending/extending.rst:352 +#: ../../extending/extending.rst:377 msgid "" "static PyMethodDef spam_methods[] = {\n" " ...\n" @@ -693,7 +764,7 @@ msgstr "" " {NULL, NULL, 0, NULL} /* Sentinel */\n" "};" -#: ../../extending/extending.rst:360 +#: ../../extending/extending.rst:385 msgid "" "Note the third entry (``METH_VARARGS``). This is a flag telling the " "interpreter the calling convention to be used for the C function. It should " @@ -705,7 +776,7 @@ msgstr "" "標。通常應該是 ``METH_VARARGS`` 或 ``METH_VARARGS | METH_KEYWORDS``;``0`` 表" "示是使用 :c:func:`PyArg_ParseTuple` 的一個過時變體。" -#: ../../extending/extending.rst:365 +#: ../../extending/extending.rst:390 msgid "" "When using only ``METH_VARARGS``, the function should expect the Python-" "level parameters to be passed in as a tuple acceptable for parsing via :c:" @@ -715,7 +786,7 @@ msgstr "" "能夠接受以 :c:func:`PyArg_ParseTuple` 進行剖析;有關此函式的更多資訊將在下面" "提供。" -#: ../../extending/extending.rst:369 +#: ../../extending/extending.rst:394 msgid "" "The :c:macro:`METH_KEYWORDS` bit may be set in the third field if keyword " "arguments should be passed to the function. In this case, the C function " @@ -728,12 +799,12 @@ msgstr "" "是關鍵字的字典。可使用 :c:func:`PyArg_ParseTupleAndKeywords` 來剖析這種函式的" "引數。" -#: ../../extending/extending.rst:375 +#: ../../extending/extending.rst:400 msgid "" "The method table must be referenced in the module definition structure::" msgstr "方法表必須在模組定義結構中被參照: ::" -#: ../../extending/extending.rst:377 +#: ../../extending/extending.rst:402 msgid "" "static struct PyModuleDef spam_module = {\n" " ...\n" @@ -742,7 +813,7 @@ msgid "" "};" msgstr "" -#: ../../extending/extending.rst:383 +#: ../../extending/extending.rst:408 msgid "" "This structure, in turn, must be passed to the interpreter in the module's " "initialization function. The initialization function must be named :c:func:" @@ -753,7 +824,7 @@ msgstr "" "為 :c:func:`!PyInit_name`,其中 *name* 是模組的名稱,且應該是模組檔案中唯一定" "義的非「靜態 (``static``)」項目: ::" -#: ../../extending/extending.rst:388 +#: ../../extending/extending.rst:413 msgid "" "PyMODINIT_FUNC\n" "PyInit_spam(void)\n" @@ -767,7 +838,7 @@ msgstr "" " return PyModuleDef_Init(&spam_module);\n" "}" -#: ../../extending/extending.rst:394 +#: ../../extending/extending.rst:419 msgid "" "Note that :c:macro:`PyMODINIT_FUNC` declares the function as ``PyObject *`` " "return type, declares any special linkage declarations required by the " @@ -776,7 +847,7 @@ msgstr "" "請注意,:c:macro:`PyMODINIT_FUNC` 宣告函式的回傳型別為 ``PyObject *``、宣告平" "台所需的任何特殊連結宣告、並針對 C++ 宣告函式為 ``extern \"C\"``。" -#: ../../extending/extending.rst:398 +#: ../../extending/extending.rst:423 msgid "" ":c:func:`!PyInit_spam` is called when each interpreter imports its module :" "mod:`!spam` for the first time. (See below for comments about embedding " @@ -785,7 +856,7 @@ msgid "" "store it in ``sys.modules``." msgstr "" -#: ../../extending/extending.rst:403 +#: ../../extending/extending.rst:428 msgid "" "When embedding Python, the :c:func:`!PyInit_spam` function is not called " "automatically unless there's an entry in the :c:data:`!PyImport_Inittab` " @@ -796,7 +867,7 @@ msgstr "" "動呼叫 :c:func:`!PyInit_spam` 函式。要將模組加入初始化表,請使用 :c:func:" "`PyImport_AppendInittab` 並在隨後選擇性地將該模組引入: ::" -#: ../../extending/extending.rst:408 +#: ../../extending/extending.rst:433 msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include \n" @@ -898,7 +969,7 @@ msgstr "" " Py_ExitStatusException(status);\n" "}" -#: ../../extending/extending.rst:458 +#: ../../extending/extending.rst:483 msgid "" "If you declare a global variable or a local static one, the module may " "experience unintended side-effects on re-initialisation, for example when " @@ -910,7 +981,7 @@ msgid "" "`Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED`)." msgstr "" -#: ../../extending/extending.rst:467 +#: ../../extending/extending.rst:492 msgid "" "A more substantial example module is included in the Python source " "distribution as :file:`Modules/xxlimited.c`. This file may be used as a " @@ -919,11 +990,11 @@ msgstr "" "Python 原始碼發行版本中包含了一個更實質的範例模組 :file:`Modules/xxlimited." "c`。這個檔案可以當作模板使用,也可以簡單地當作範例來閱讀。" -#: ../../extending/extending.rst:475 +#: ../../extending/extending.rst:500 msgid "Compilation and Linkage" msgstr "" -#: ../../extending/extending.rst:477 +#: ../../extending/extending.rst:502 msgid "" "There are two more things to do before you can use your new extension: " "compiling and linking it with the Python system. If you use dynamic " @@ -933,7 +1004,7 @@ msgid "" "Windows (chapter :ref:`building-on-windows`) for more information about this." msgstr "" -#: ../../extending/extending.rst:484 +#: ../../extending/extending.rst:509 msgid "" "If you can't use dynamic loading, or if you want to make your module a " "permanent part of the Python interpreter, you will have to change the " @@ -943,11 +1014,11 @@ msgid "" "line to the file :file:`Modules/Setup.local` describing your file:" msgstr "" -#: ../../extending/extending.rst:491 +#: ../../extending/extending.rst:516 msgid "spam spammodule.o" msgstr "spam spammodule.o" -#: ../../extending/extending.rst:495 +#: ../../extending/extending.rst:520 msgid "" "and rebuild the interpreter by running :program:`make` in the toplevel " "directory. You can also run :program:`make` in the :file:`Modules/` " @@ -956,21 +1027,21 @@ msgid "" "the :file:`Setup` file.)" msgstr "" -#: ../../extending/extending.rst:501 +#: ../../extending/extending.rst:526 msgid "" "If your module requires additional libraries to link with, these can be " "listed on the line in the configuration file as well, for instance:" msgstr "" -#: ../../extending/extending.rst:504 +#: ../../extending/extending.rst:529 msgid "spam spammodule.o -lX11" msgstr "spam spammodule.o -lX11" -#: ../../extending/extending.rst:512 +#: ../../extending/extending.rst:537 msgid "Calling Python Functions from C" msgstr "" -#: ../../extending/extending.rst:514 +#: ../../extending/extending.rst:539 msgid "" "So far we have concentrated on making C functions callable from Python. The " "reverse is also useful: calling Python functions from C. This is especially " @@ -981,7 +1052,7 @@ msgid "" "uses are also imaginable." msgstr "" -#: ../../extending/extending.rst:522 +#: ../../extending/extending.rst:547 msgid "" "Fortunately, the Python interpreter is easily called recursively, and there " "is a standard interface to call a Python function. (I won't dwell on how to " @@ -990,7 +1061,7 @@ msgid "" "line option in :file:`Modules/main.c` from the Python source code.)" msgstr "" -#: ../../extending/extending.rst:528 +#: ../../extending/extending.rst:553 msgid "" "Calling a Python function is easy. First, the Python program must somehow " "pass you the Python function object. You should provide a function (or some " @@ -1000,7 +1071,7 @@ msgid "" "function might be part of a module definition::" msgstr "" -#: ../../extending/extending.rst:535 +#: ../../extending/extending.rst:560 msgid "" "static PyObject *my_callback = NULL;\n" "\n" @@ -1027,7 +1098,7 @@ msgid "" "}" msgstr "" -#: ../../extending/extending.rst:558 +#: ../../extending/extending.rst:583 msgid "" "This function must be registered with the interpreter using the :c:macro:" "`METH_VARARGS` flag; this is described in section :ref:`methodtable`. The :" @@ -1035,7 +1106,7 @@ msgid "" "section :ref:`parsetuple`." msgstr "" -#: ../../extending/extending.rst:563 +#: ../../extending/extending.rst:588 msgid "" "The macros :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF` increment/decrement " "the reference count of an object and are safe in the presence of ``NULL`` " @@ -1043,7 +1114,7 @@ msgid "" "info on them in section :ref:`refcounts`." msgstr "" -#: ../../extending/extending.rst:570 +#: ../../extending/extending.rst:595 msgid "" "Later, when it is time to call the function, you call the C function :c:func:" "`PyObject_CallObject`. This function has two arguments, both pointers to " @@ -1055,7 +1126,7 @@ msgid "" "or more format codes between parentheses. For example::" msgstr "" -#: ../../extending/extending.rst:579 +#: ../../extending/extending.rst:604 msgid "" "int arg;\n" "PyObject *arglist;\n" @@ -1069,7 +1140,7 @@ msgid "" "Py_DECREF(arglist);" msgstr "" -#: ../../extending/extending.rst:590 +#: ../../extending/extending.rst:615 msgid "" ":c:func:`PyObject_CallObject` returns a Python object pointer: this is the " "return value of the Python function. :c:func:`PyObject_CallObject` is " @@ -1078,7 +1149,7 @@ msgid "" "`Py_DECREF`\\ -ed immediately after the :c:func:`PyObject_CallObject` call." msgstr "" -#: ../../extending/extending.rst:597 +#: ../../extending/extending.rst:622 msgid "" "The return value of :c:func:`PyObject_CallObject` is \"new\": either it is a " "brand new object, or it is an existing object whose reference count has been " @@ -1087,7 +1158,7 @@ msgid "" "not interested in its value." msgstr "" -#: ../../extending/extending.rst:603 +#: ../../extending/extending.rst:628 msgid "" "Before you do this, however, it is important to check that the return value " "isn't ``NULL``. If it is, the Python function terminated by raising an " @@ -1098,7 +1169,7 @@ msgid "" "should be cleared by calling :c:func:`PyErr_Clear`. For example::" msgstr "" -#: ../../extending/extending.rst:611 +#: ../../extending/extending.rst:636 msgid "" "if (result == NULL)\n" " return NULL; /* Pass error back */\n" @@ -1106,7 +1177,7 @@ msgid "" "Py_DECREF(result);" msgstr "" -#: ../../extending/extending.rst:616 +#: ../../extending/extending.rst:641 msgid "" "Depending on the desired interface to the Python callback function, you may " "also have to provide an argument list to :c:func:`PyObject_CallObject`. In " @@ -1118,7 +1189,7 @@ msgid "" "you want to pass an integral event code, you might use the following code::" msgstr "" -#: ../../extending/extending.rst:625 +#: ../../extending/extending.rst:650 msgid "" "PyObject *arglist;\n" "...\n" @@ -1131,7 +1202,7 @@ msgid "" "Py_DECREF(result);" msgstr "" -#: ../../extending/extending.rst:635 +#: ../../extending/extending.rst:660 msgid "" "Note the placement of ``Py_DECREF(arglist)`` immediately after the call, " "before the error check! Also note that strictly speaking this code is not " @@ -1139,14 +1210,14 @@ msgid "" "checked." msgstr "" -#: ../../extending/extending.rst:639 +#: ../../extending/extending.rst:664 msgid "" "You may also call a function with keyword arguments by using :c:func:" "`PyObject_Call`, which supports arguments and keyword arguments. As in the " "above example, we use :c:func:`Py_BuildValue` to construct the dictionary. ::" msgstr "" -#: ../../extending/extending.rst:643 +#: ../../extending/extending.rst:668 msgid "" "PyObject *dict;\n" "...\n" @@ -1159,19 +1230,19 @@ msgid "" "Py_DECREF(result);" msgstr "" -#: ../../extending/extending.rst:657 +#: ../../extending/extending.rst:682 msgid "Extracting Parameters in Extension Functions" msgstr "" -#: ../../extending/extending.rst:661 +#: ../../extending/extending.rst:686 msgid "The :c:func:`PyArg_ParseTuple` function is declared as follows::" msgstr "" -#: ../../extending/extending.rst:663 +#: ../../extending/extending.rst:688 msgid "int PyArg_ParseTuple(PyObject *arg, const char *format, ...);" msgstr "" -#: ../../extending/extending.rst:665 +#: ../../extending/extending.rst:690 msgid "" "The *arg* argument must be a tuple object containing an argument list passed " "from Python to a C function. The *format* argument must be a format string, " @@ -1180,7 +1251,7 @@ msgid "" "whose type is determined by the format string." msgstr "" -#: ../../extending/extending.rst:671 +#: ../../extending/extending.rst:696 msgid "" "Note that while :c:func:`PyArg_ParseTuple` checks that the Python arguments " "have the required types, it cannot check the validity of the addresses of C " @@ -1188,17 +1259,17 @@ msgid "" "probably crash or at least overwrite random bits in memory. So be careful!" msgstr "" -#: ../../extending/extending.rst:676 +#: ../../extending/extending.rst:701 msgid "" "Note that any Python object references which are provided to the caller are " "*borrowed* references; do not decrement their reference count!" msgstr "" -#: ../../extending/extending.rst:679 +#: ../../extending/extending.rst:704 msgid "Some example calls::" msgstr "一些呼叫範例: ::" -#: ../../extending/extending.rst:686 +#: ../../extending/extending.rst:711 msgid "" "int ok;\n" "int i, j;\n" @@ -1218,27 +1289,27 @@ msgstr "" "ok = PyArg_ParseTuple(args, \"\"); /* 沒有引數 */\n" " /* Python 呼叫:f() */" -#: ../../extending/extending.rst:697 +#: ../../extending/extending.rst:722 msgid "" "ok = PyArg_ParseTuple(args, \"s\", &s); /* A string */\n" " /* Possible Python call: f('whoops!') */" msgstr "" -#: ../../extending/extending.rst:702 +#: ../../extending/extending.rst:727 msgid "" "ok = PyArg_ParseTuple(args, \"lls\", &k, &l, &s); /* Two longs and a string " "*/\n" " /* Possible Python call: f(1, 2, 'three') */" msgstr "" -#: ../../extending/extending.rst:707 +#: ../../extending/extending.rst:732 msgid "" "ok = PyArg_ParseTuple(args, \"(ii)s#\", &i, &j, &s, &size);\n" " /* A pair of ints and a string, whose size is also returned */\n" " /* Possible Python call: f((1, 2), 'three') */" msgstr "" -#: ../../extending/extending.rst:713 +#: ../../extending/extending.rst:738 msgid "" "{\n" " const char *file;\n" @@ -1253,7 +1324,7 @@ msgid "" "}" msgstr "" -#: ../../extending/extending.rst:727 +#: ../../extending/extending.rst:752 msgid "" "{\n" " int left, top, right, bottom, h, v;\n" @@ -1265,7 +1336,7 @@ msgid "" "}" msgstr "" -#: ../../extending/extending.rst:738 +#: ../../extending/extending.rst:763 msgid "" "{\n" " Py_complex c;\n" @@ -1275,16 +1346,16 @@ msgid "" "}" msgstr "" -#: ../../extending/extending.rst:749 +#: ../../extending/extending.rst:774 msgid "Keyword Parameters for Extension Functions" msgstr "" -#: ../../extending/extending.rst:753 +#: ../../extending/extending.rst:778 msgid "" "The :c:func:`PyArg_ParseTupleAndKeywords` function is declared as follows::" msgstr "" -#: ../../extending/extending.rst:755 +#: ../../extending/extending.rst:780 msgid "" "int PyArg_ParseTupleAndKeywords(PyObject *arg, PyObject *kwdict,\n" " const char *format, char * const " @@ -1294,7 +1365,7 @@ msgstr "" " const char *format, char * const " "*kwlist, ...);" -#: ../../extending/extending.rst:758 +#: ../../extending/extending.rst:783 msgid "" "The *arg* and *format* parameters are identical to those of the :c:func:" "`PyArg_ParseTuple` function. The *kwdict* parameter is the dictionary of " @@ -1306,20 +1377,20 @@ msgid "" "raises an appropriate exception." msgstr "" -#: ../../extending/extending.rst:768 +#: ../../extending/extending.rst:793 msgid "" "Nested tuples cannot be parsed when using keyword arguments! Keyword " "parameters passed in which are not present in the *kwlist* will cause :exc:" "`TypeError` to be raised." msgstr "" -#: ../../extending/extending.rst:774 +#: ../../extending/extending.rst:799 msgid "" "Here is an example module which uses keywords, based on an example by Geoff " "Philbrick (philbrick@hks.com)::" msgstr "" -#: ../../extending/extending.rst:777 +#: ../../extending/extending.rst:802 msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include \n" @@ -1372,21 +1443,21 @@ msgid "" "}" msgstr "" -#: ../../extending/extending.rst:828 +#: ../../extending/extending.rst:853 msgid "Building Arbitrary Values" msgstr "" -#: ../../extending/extending.rst:830 +#: ../../extending/extending.rst:855 msgid "" "This function is the counterpart to :c:func:`PyArg_ParseTuple`. It is " "declared as follows::" msgstr "" -#: ../../extending/extending.rst:833 +#: ../../extending/extending.rst:858 msgid "PyObject *Py_BuildValue(const char *format, ...);" msgstr "PyObject *Py_BuildValue(const char *format, ...);" -#: ../../extending/extending.rst:835 +#: ../../extending/extending.rst:860 msgid "" "It recognizes a set of format units similar to the ones recognized by :c:" "func:`PyArg_ParseTuple`, but the arguments (which are input to the function, " @@ -1394,7 +1465,7 @@ msgid "" "object, suitable for returning from a C function called from Python." msgstr "" -#: ../../extending/extending.rst:840 +#: ../../extending/extending.rst:865 msgid "" "One difference with :c:func:`PyArg_ParseTuple`: while the latter requires " "its first argument to be a tuple (since Python argument lists are always " @@ -1406,12 +1477,12 @@ msgid "" "parenthesize the format string." msgstr "" -#: ../../extending/extending.rst:848 +#: ../../extending/extending.rst:873 msgid "" "Examples (to the left the call, to the right the resulting Python value):" msgstr "" -#: ../../extending/extending.rst:850 +#: ../../extending/extending.rst:875 msgid "" "Py_BuildValue(\"\") None\n" "Py_BuildValue(\"i\", 123) 123\n" @@ -1449,11 +1520,11 @@ msgstr "" "Py_BuildValue(\"((ii)(ii)) (ii)\",\n" " 1, 2, 3, 4, 5, 6) (((1, 2), (3, 4)), (5, 6))" -#: ../../extending/extending.rst:874 +#: ../../extending/extending.rst:899 msgid "Reference Counts" msgstr "參照計數" -#: ../../extending/extending.rst:876 +#: ../../extending/extending.rst:901 msgid "" "In languages like C or C++, the programmer is responsible for dynamic " "allocation and deallocation of memory on the heap. In C, this is done using " @@ -1462,7 +1533,7 @@ msgid "" "restrict the following discussion to the C case." msgstr "" -#: ../../extending/extending.rst:882 +#: ../../extending/extending.rst:907 msgid "" "Every block of memory allocated with :c:func:`malloc` should eventually be " "returned to the pool of available memory by exactly one call to :c:func:" @@ -1477,7 +1548,7 @@ msgid "" "crashes." msgstr "" -#: ../../extending/extending.rst:893 +#: ../../extending/extending.rst:918 msgid "" "Common causes of memory leaks are unusual paths through the code. For " "instance, a function may allocate a block of memory, do some calculation, " @@ -1494,7 +1565,7 @@ msgid "" "of errors." msgstr "" -#: ../../extending/extending.rst:906 +#: ../../extending/extending.rst:931 msgid "" "Since Python makes heavy use of :c:func:`malloc` and :c:func:`free`, it " "needs a strategy to avoid memory leaks as well as the use of freed memory. " @@ -1505,7 +1576,7 @@ msgid "" "reference to the object has been deleted and the object is freed." msgstr "" -#: ../../extending/extending.rst:914 +#: ../../extending/extending.rst:939 msgid "" "An alternative strategy is called :dfn:`automatic garbage collection`. " "(Sometimes, reference counting is also referred to as a garbage collection " @@ -1521,7 +1592,7 @@ msgid "" "with reference counts." msgstr "" -#: ../../extending/extending.rst:926 +#: ../../extending/extending.rst:951 msgid "" "While Python uses the traditional reference counting implementation, it also " "offers a cycle detector that works to detect reference cycles. This allows " @@ -1535,7 +1606,7 @@ msgid "" "though there are no further references to the cycle itself." msgstr "" -#: ../../extending/extending.rst:937 +#: ../../extending/extending.rst:962 msgid "" "The cycle detector is able to detect garbage cycles and can reclaim them. " "The :mod:`gc` module exposes a way to run the detector (the :func:`~gc." @@ -1543,11 +1614,11 @@ msgid "" "disable the detector at runtime." msgstr "" -#: ../../extending/extending.rst:946 +#: ../../extending/extending.rst:971 msgid "Reference Counting in Python" msgstr "Python 中的參照計數" -#: ../../extending/extending.rst:948 +#: ../../extending/extending.rst:973 msgid "" "There are two macros, ``Py_INCREF(x)`` and ``Py_DECREF(x)``, which handle " "the incrementing and decrementing of the reference count. :c:func:" @@ -1558,7 +1629,7 @@ msgid "" "object." msgstr "" -#: ../../extending/extending.rst:955 +#: ../../extending/extending.rst:980 msgid "" "The big question now remains: when to use ``Py_INCREF(x)`` and " "``Py_DECREF(x)``? Let's first introduce some terms. Nobody \"owns\" an " @@ -1571,7 +1642,7 @@ msgid "" "reference creates a memory leak." msgstr "" -#: ../../extending/extending.rst:964 +#: ../../extending/extending.rst:989 msgid "" "It is also possible to :dfn:`borrow` [#]_ a reference to an object. The " "borrower of a reference should not call :c:func:`Py_DECREF`. The borrower " @@ -1580,7 +1651,7 @@ msgid "" "risks using freed memory and should be avoided completely [#]_." msgstr "" -#: ../../extending/extending.rst:970 +#: ../../extending/extending.rst:995 msgid "" "The advantage of borrowing over owning a reference is that you don't need to " "take care of disposing of the reference on all possible paths through the " @@ -1591,7 +1662,7 @@ msgid "" "borrowed has in fact disposed of it." msgstr "" -#: ../../extending/extending.rst:978 +#: ../../extending/extending.rst:1003 msgid "" "A borrowed reference can be changed into an owned reference by calling :c:" "func:`Py_INCREF`. This does not affect the status of the owner from which " @@ -1600,18 +1671,18 @@ msgid "" "properly, as well as the previous owner)." msgstr "" -#: ../../extending/extending.rst:988 +#: ../../extending/extending.rst:1013 msgid "Ownership Rules" msgstr "" -#: ../../extending/extending.rst:990 +#: ../../extending/extending.rst:1015 msgid "" "Whenever an object reference is passed into or out of a function, it is part " "of the function's interface specification whether ownership is transferred " "with the reference or not." msgstr "" -#: ../../extending/extending.rst:994 +#: ../../extending/extending.rst:1019 msgid "" "Most functions that return a reference to an object pass on ownership with " "the reference. In particular, all functions whose function it is to create " @@ -1622,7 +1693,7 @@ msgid "" "reference to a cached item." msgstr "" -#: ../../extending/extending.rst:1002 +#: ../../extending/extending.rst:1027 msgid "" "Many functions that extract objects from other objects also transfer " "ownership with the reference, for instance :c:func:" @@ -1633,14 +1704,14 @@ msgid "" "list or dictionary." msgstr "" -#: ../../extending/extending.rst:1009 +#: ../../extending/extending.rst:1034 msgid "" "The function :c:func:`PyImport_AddModule` also returns a borrowed reference, " "even though it may actually create the object it returns: this is possible " "because an owned reference to the object is stored in ``sys.modules``." msgstr "" -#: ../../extending/extending.rst:1013 +#: ../../extending/extending.rst:1038 msgid "" "When you pass an object reference into another function, in general, the " "function borrows the reference from you --- if it needs to store it, it will " @@ -1651,7 +1722,7 @@ msgid "" "don't take over ownership --- they are \"normal.\")" msgstr "" -#: ../../extending/extending.rst:1021 +#: ../../extending/extending.rst:1046 msgid "" "When a C function is called from Python, it borrows references to its " "arguments from the caller. The caller owns a reference to the object, so " @@ -1660,18 +1731,18 @@ msgid "" "turned into an owned reference by calling :c:func:`Py_INCREF`." msgstr "" -#: ../../extending/extending.rst:1027 +#: ../../extending/extending.rst:1052 msgid "" "The object reference returned from a C function that is called from Python " "must be an owned reference --- ownership is transferred from the function to " "its caller." msgstr "" -#: ../../extending/extending.rst:1035 +#: ../../extending/extending.rst:1060 msgid "Thin Ice" msgstr "" -#: ../../extending/extending.rst:1037 +#: ../../extending/extending.rst:1062 msgid "" "There are a few situations where seemingly harmless use of a borrowed " "reference can lead to problems. These all have to do with implicit " @@ -1679,14 +1750,14 @@ msgid "" "dispose of it." msgstr "" -#: ../../extending/extending.rst:1041 +#: ../../extending/extending.rst:1066 msgid "" "The first and most important case to know about is using :c:func:`Py_DECREF` " "on an unrelated object while borrowing a reference to a list item. For " "instance::" msgstr "" -#: ../../extending/extending.rst:1044 +#: ../../extending/extending.rst:1069 msgid "" "void\n" "bug(PyObject *list)\n" @@ -1706,14 +1777,14 @@ msgstr "" " PyObject_Print(item, stdout, 0); /* BUG! */\n" "}" -#: ../../extending/extending.rst:1053 +#: ../../extending/extending.rst:1078 msgid "" "This function first borrows a reference to ``list[0]``, then replaces " "``list[1]`` with the value ``0``, and finally prints the borrowed reference. " "Looks harmless, right? But it's not!" msgstr "" -#: ../../extending/extending.rst:1057 +#: ../../extending/extending.rst:1082 msgid "" "Let's follow the control flow into :c:func:`PyList_SetItem`. The list owns " "references to all its items, so when item 1 is replaced, it has to dispose " @@ -1730,7 +1801,7 @@ msgid "" "`PyList_SetItem` call." msgstr "" -#: ../../extending/extending.rst:1071 +#: ../../extending/extending.rst:1096 msgid "" "Since it is written in Python, the :meth:`!__del__` method can execute " "arbitrary Python code. Could it perhaps do something to invalidate the " @@ -1741,13 +1812,13 @@ msgid "" "associated with it, thereby invalidating ``item``." msgstr "" -#: ../../extending/extending.rst:1079 +#: ../../extending/extending.rst:1104 msgid "" "The solution, once you know the source of the problem, is easy: temporarily " "increment the reference count. The correct version of the function reads::" msgstr "" -#: ../../extending/extending.rst:1082 +#: ../../extending/extending.rst:1107 msgid "" "void\n" "no_bug(PyObject *list)\n" @@ -1771,14 +1842,14 @@ msgstr "" " Py_DECREF(item);\n" "}" -#: ../../extending/extending.rst:1093 +#: ../../extending/extending.rst:1118 msgid "" "This is a true story. An older version of Python contained variants of this " "bug and someone spent a considerable amount of time in a C debugger to " "figure out why his :meth:`!__del__` methods would fail..." msgstr "" -#: ../../extending/extending.rst:1097 +#: ../../extending/extending.rst:1122 msgid "" "The second case of problems with a borrowed reference is a variant involving " "threads. Normally, multiple threads in the Python interpreter can't get in " @@ -1791,7 +1862,7 @@ msgid "" "Obviously, the following function has the same problem as the previous one::" msgstr "" -#: ../../extending/extending.rst:1107 +#: ../../extending/extending.rst:1132 msgid "" "void\n" "bug(PyObject *list)\n" @@ -1804,11 +1875,11 @@ msgid "" "}" msgstr "" -#: ../../extending/extending.rst:1121 +#: ../../extending/extending.rst:1146 msgid "NULL Pointers" msgstr "NULL 指標" -#: ../../extending/extending.rst:1123 +#: ../../extending/extending.rst:1148 msgid "" "In general, functions that take object references as arguments do not expect " "you to pass them ``NULL`` pointers, and will dump core (or cause later core " @@ -1820,21 +1891,21 @@ msgid "" "more slowly." msgstr "" -#: ../../extending/extending.rst:1131 +#: ../../extending/extending.rst:1156 msgid "" "It is better to test for ``NULL`` only at the \"source:\" when a pointer " "that may be ``NULL`` is received, for example, from :c:func:`malloc` or from " "a function that may raise an exception." msgstr "" -#: ../../extending/extending.rst:1135 +#: ../../extending/extending.rst:1160 msgid "" "The macros :c:func:`Py_INCREF` and :c:func:`Py_DECREF` do not check for " "``NULL`` pointers --- however, their variants :c:func:`Py_XINCREF` and :c:" "func:`Py_XDECREF` do." msgstr "" -#: ../../extending/extending.rst:1139 +#: ../../extending/extending.rst:1164 msgid "" "The macros for checking for a particular object type (``Pytype_Check()``) " "don't check for ``NULL`` pointers --- again, there is much code that calls " @@ -1843,24 +1914,24 @@ msgid "" "variants with ``NULL`` checking." msgstr "" -#: ../../extending/extending.rst:1145 +#: ../../extending/extending.rst:1170 msgid "" "The C function calling mechanism guarantees that the argument list passed to " "C functions (``args`` in the examples) is never ``NULL`` --- in fact it " "guarantees that it is always a tuple [#]_." msgstr "" -#: ../../extending/extending.rst:1149 +#: ../../extending/extending.rst:1174 msgid "" "It is a severe error to ever let a ``NULL`` pointer \"escape\" to the Python " "user." msgstr "" -#: ../../extending/extending.rst:1160 +#: ../../extending/extending.rst:1185 msgid "Writing Extensions in C++" msgstr "" -#: ../../extending/extending.rst:1162 +#: ../../extending/extending.rst:1187 msgid "" "It is possible to write extension modules in C++. Some restrictions apply. " "If the main program (the Python interpreter) is compiled and linked by the C " @@ -1873,11 +1944,11 @@ msgid "" "(all recent C++ compilers define this symbol)." msgstr "" -#: ../../extending/extending.rst:1176 +#: ../../extending/extending.rst:1201 msgid "Providing a C API for an Extension Module" msgstr "" -#: ../../extending/extending.rst:1181 +#: ../../extending/extending.rst:1206 msgid "" "Many extension modules just provide new functions and types to be used from " "Python, but sometimes the code in an extension module can be useful for " @@ -1888,7 +1959,7 @@ msgid "" "functions for direct manipulation from other extension modules." msgstr "" -#: ../../extending/extending.rst:1189 +#: ../../extending/extending.rst:1214 msgid "" "At first sight this seems easy: just write the functions (without declaring " "them ``static``, of course), provide an appropriate header file, and " @@ -1904,7 +1975,7 @@ msgid "" "call might not have been loaded yet!" msgstr "" -#: ../../extending/extending.rst:1201 +#: ../../extending/extending.rst:1226 msgid "" "Portability therefore requires not to make any assumptions about symbol " "visibility. This means that all symbols in extension modules should be " @@ -1914,7 +1985,7 @@ msgid "" "accessible from other extension modules must be exported in a different way." msgstr "" -#: ../../extending/extending.rst:1208 +#: ../../extending/extending.rst:1233 msgid "" "Python provides a special mechanism to pass C-level information (pointers) " "from one extension module to another one: Capsules. A Capsule is a Python " @@ -1926,7 +1997,7 @@ msgid "" "the Capsule." msgstr "" -#: ../../extending/extending.rst:1216 +#: ../../extending/extending.rst:1241 msgid "" "There are many ways in which Capsules can be used to export the C API of an " "extension module. Each function could get its own Capsule, or all C API " @@ -1936,7 +2007,7 @@ msgid "" "client modules." msgstr "" -#: ../../extending/extending.rst:1222 +#: ../../extending/extending.rst:1247 msgid "" "Whichever method you choose, it's important to name your Capsules properly. " "The function :c:func:`PyCapsule_New` takes a name parameter (:c:expr:`const " @@ -1946,17 +2017,17 @@ msgid "" "from another." msgstr "" -#: ../../extending/extending.rst:1229 +#: ../../extending/extending.rst:1254 msgid "" "In particular, Capsules used to expose C APIs should be given a name " "following this convention::" msgstr "" -#: ../../extending/extending.rst:1232 +#: ../../extending/extending.rst:1257 msgid "modulename.attributename" msgstr "modulename.attributename" -#: ../../extending/extending.rst:1234 +#: ../../extending/extending.rst:1259 msgid "" "The convenience function :c:func:`PyCapsule_Import` makes it easy to load a " "C API provided via a Capsule, but only if the Capsule's name matches this " @@ -1964,7 +2035,7 @@ msgid "" "the Capsule they load contains the correct C API." msgstr "" -#: ../../extending/extending.rst:1239 +#: ../../extending/extending.rst:1264 msgid "" "The following example demonstrates an approach that puts most of the burden " "on the writer of the exporting module, which is appropriate for commonly " @@ -1975,7 +2046,7 @@ msgid "" "modules only have to call this macro before accessing the C API." msgstr "" -#: ../../extending/extending.rst:1247 +#: ../../extending/extending.rst:1272 msgid "" "The exporting module is a modification of the :mod:`!spam` module from " "section :ref:`extending-simpleexample`. The function :func:`!spam.system` " @@ -1986,13 +2057,13 @@ msgid "" "modules." msgstr "" -#: ../../extending/extending.rst:1254 +#: ../../extending/extending.rst:1279 msgid "" "The function :c:func:`!PySpam_System` is a plain C function, declared " "``static`` like everything else::" msgstr "" -#: ../../extending/extending.rst:1257 +#: ../../extending/extending.rst:1282 msgid "" "static int\n" "PySpam_System(const char *command)\n" @@ -2006,11 +2077,11 @@ msgstr "" " return system(command);\n" "}" -#: ../../extending/extending.rst:1263 +#: ../../extending/extending.rst:1288 msgid "The function :c:func:`!spam_system` is modified in a trivial way::" msgstr "" -#: ../../extending/extending.rst:1265 +#: ../../extending/extending.rst:1290 msgid "" "static PyObject *\n" "spam_system(PyObject *self, PyObject *args)\n" @@ -2036,19 +2107,19 @@ msgstr "" " return PyLong_FromLong(sts);\n" "}" -#: ../../extending/extending.rst:1277 +#: ../../extending/extending.rst:1302 msgid "In the beginning of the module, right after the line ::" msgstr "" -#: ../../extending/extending.rst:1279 +#: ../../extending/extending.rst:1304 msgid "#include " msgstr "#include " -#: ../../extending/extending.rst:1281 +#: ../../extending/extending.rst:1306 msgid "two more lines must be added::" msgstr "" -#: ../../extending/extending.rst:1283 +#: ../../extending/extending.rst:1308 msgid "" "#define SPAM_MODULE\n" "#include \"spammodule.h\"" @@ -2056,7 +2127,7 @@ msgstr "" "#define SPAM_MODULE\n" "#include \"spammodule.h\"" -#: ../../extending/extending.rst:1286 +#: ../../extending/extending.rst:1311 msgid "" "The ``#define`` is used to tell the header file that it is being included in " "the exporting module, not a client module. Finally, the module's :c:data:" @@ -2064,7 +2135,7 @@ msgid "" "pointer array::" msgstr "" -#: ../../extending/extending.rst:1290 +#: ../../extending/extending.rst:1315 msgid "" "static int\n" "spam_module_exec(PyObject *m)\n" @@ -2087,19 +2158,19 @@ msgid "" "}" msgstr "" -#: ../../extending/extending.rst:1309 +#: ../../extending/extending.rst:1334 msgid "" "Note that ``PySpam_API`` is declared ``static``; otherwise the pointer array " "would disappear when :c:func:`!PyInit_spam` terminates!" msgstr "" -#: ../../extending/extending.rst:1312 +#: ../../extending/extending.rst:1337 msgid "" "The bulk of the work is in the header file :file:`spammodule.h`, which looks " "like this::" msgstr "" -#: ../../extending/extending.rst:1315 +#: ../../extending/extending.rst:1340 msgid "" "#ifndef Py_SPAMMODULE_H\n" "#define Py_SPAMMODULE_H\n" @@ -2151,14 +2222,14 @@ msgid "" "#endif /* !defined(Py_SPAMMODULE_H) */" msgstr "" -#: ../../extending/extending.rst:1363 +#: ../../extending/extending.rst:1388 msgid "" "All that a client module must do in order to have access to the function :c:" "func:`!PySpam_System` is to call the function (or rather macro) :c:func:`!" "import_spam` in its :c:data:`mod_exec ` function::" msgstr "" -#: ../../extending/extending.rst:1367 +#: ../../extending/extending.rst:1392 msgid "" "static int\n" "client_module_exec(PyObject *m)\n" @@ -2171,14 +2242,14 @@ msgid "" "}" msgstr "" -#: ../../extending/extending.rst:1377 +#: ../../extending/extending.rst:1402 msgid "" "The main disadvantage of this approach is that the file :file:`spammodule.h` " "is rather complicated. However, the basic structure is the same for each " "function that is exported, so it has to be learned only once." msgstr "" -#: ../../extending/extending.rst:1381 +#: ../../extending/extending.rst:1406 msgid "" "Finally it should be mentioned that Capsules offer additional functionality, " "which is especially useful for memory allocation and deallocation of the " @@ -2188,89 +2259,47 @@ msgid "" "in the Python source code distribution)." msgstr "" -#: ../../extending/extending.rst:1389 +#: ../../extending/extending.rst:1414 msgid "Footnotes" msgstr "註腳" -#: ../../extending/extending.rst:1390 +#: ../../extending/extending.rst:1415 msgid "" "An interface for this function already exists in the standard module :mod:" "`os` --- it was chosen as a simple and straightforward example." msgstr "" -#: ../../extending/extending.rst:1393 +#: ../../extending/extending.rst:1418 msgid "" "The metaphor of \"borrowing\" a reference is not completely correct: the " "owner still has a copy of the reference." msgstr "" -#: ../../extending/extending.rst:1396 +#: ../../extending/extending.rst:1421 msgid "" "Checking that the reference count is at least 1 **does not work** --- the " "reference count itself could be in freed memory and may thus be reused for " "another object!" msgstr "" -#: ../../extending/extending.rst:1400 +#: ../../extending/extending.rst:1425 msgid "" "These guarantees don't hold when you use the \"old\" style calling " "convention --- this is still found in much existing code." msgstr "" -#: ../../extending/extending.rst:568 +#: ../../extending/extending.rst:593 msgid "PyObject_CallObject (C function)" msgstr "PyObject_CallObject(C 函式)" -#: ../../extending/extending.rst:659 +#: ../../extending/extending.rst:684 msgid "PyArg_ParseTuple (C function)" msgstr "PyArg_ParseTuple(C 函式)" -#: ../../extending/extending.rst:751 +#: ../../extending/extending.rst:776 msgid "PyArg_ParseTupleAndKeywords (C function)" msgstr "PyArg_ParseTupleAndKeywords(C 函式)" -#: ../../extending/extending.rst:772 +#: ../../extending/extending.rst:797 msgid "Philbrick, Geoff" msgstr "Philbrick, Geoff" - -#~ msgid "````" -#~ msgstr "````" - -#~ msgid "```` (on Windows)" -#~ msgstr "````\\ (在 Windows 上)" - -#~ msgid "````" -#~ msgstr "````" - -#~ msgid "````" -#~ msgstr "````" - -#~ msgid "````" -#~ msgstr "````" - -#~ msgid "````" -#~ msgstr "````" - -#~ msgid "````" -#~ msgstr "````" - -#~ msgid "```` (if present)" -#~ msgstr "````\\ (如果存在)" - -#~ msgid "````" -#~ msgstr "````" - -#~ msgid "```` (on POSIX)" -#~ msgstr "````\\ (在 POSIX 上)" - -#~ msgid "````" -#~ msgstr "````" - -#~ msgid "````" -#~ msgstr "````" - -#~ msgid "````" -#~ msgstr "````" - -#~ msgid "````" -#~ msgstr "````" diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index 29ef9ec453..7f18a47ce5 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2022-02-20 18:34+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,8 +39,8 @@ msgstr "" #: ../../library/asyncio-queue.rst:17 msgid "" -"Note that methods of asyncio queues don't have a *timeout* parameter; " -"use :func:`asyncio.wait_for` function to do queue operations with a timeout." +"Note that methods of asyncio queues don't have a *timeout* parameter; use :" +"func:`asyncio.wait_for` function to do queue operations with a timeout." msgstr "" "注意 asyncio 的佇列沒有 *timeout* 參數;請使用 :func:`asyncio.wait_for` 函式" "來為佇列新增具有超時 (timeout) 設定的操作。" @@ -64,8 +64,8 @@ msgid "" "queue reaches *maxsize* until an item is removed by :meth:`get`." msgstr "" "如果 *maxsize* 小於或等於零,則佇列大小是無限制的。如果是大於 ``0`` 的整數," -"則當佇列達到 *maxsize* 時,``await put()`` 將會阻塞 (block),直到某個元素" -"被 :meth:`get` 取出。" +"則當佇列達到 *maxsize* 時,``await put()`` 將會阻塞 (block),直到某個元素被 :" +"meth:`get` 取出。" #: ../../library/asyncio-queue.rst:35 msgid "" @@ -97,8 +97,8 @@ msgstr "如果有 :attr:`maxsize` 個條目在佇列中,則回傳 ``True``。" #: ../../library/asyncio-queue.rst:57 msgid "" -"If the queue was initialized with ``maxsize=0`` (the default), " -"then :meth:`full` never returns ``True``." +"If the queue was initialized with ``maxsize=0`` (the default), then :meth:" +"`full` never returns ``True``." msgstr "" "如果佇列用 ``maxsize=0`` (預設)初始化,則 :meth:`full` 永遠不會回傳 " "``True``。" @@ -127,10 +127,10 @@ msgstr "持續阻塞直到佇列中所有的元素都被接收和處理完畢。 #: ../../library/asyncio-queue.rst:79 msgid "" "The count of unfinished tasks goes up whenever an item is added to the " -"queue. The count goes down whenever a consumer coroutine " -"calls :meth:`task_done` to indicate that the item was retrieved and all work " -"on it is complete. When the count of unfinished tasks drops to " -"zero, :meth:`join` unblocks." +"queue. The count goes down whenever a consumer coroutine calls :meth:" +"`task_done` to indicate that the item was retrieved and all work on it is " +"complete. When the count of unfinished tasks drops to zero, :meth:`join` " +"unblocks." msgstr "" "當條目新增到佇列的時候,未完成任務的計數就會增加。每當一個消耗者 (consumer) " "協程呼叫 :meth:`task_done`,表示這個條目已經被取回且被它包含的所有工作都已完" @@ -162,40 +162,64 @@ msgid "Return the number of items in the queue." msgstr "回傳佇列中的元素數量。" #: ../../library/asyncio-queue.rst:105 -msgid "" -"Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` " -"raise :exc:`QueueShutDown`." +msgid "Put a :class:`Queue` instance into a shutdown mode." msgstr "" -#: ../../library/asyncio-queue.rst:108 +#: ../../library/asyncio-queue.rst:107 msgid "" -"By default, :meth:`~Queue.get` on a shut down queue will only raise once the " -"queue is empty. Set *immediate* to true to make :meth:`~Queue.get` raise " -"immediately instead." +"The queue can no longer grow. Future calls to :meth:`~Queue.put` raise :exc:" +"`QueueShutDown`. Currently blocked callers of :meth:`~Queue.put` will be " +"unblocked and will raise :exc:`QueueShutDown` in the formerly blocked thread." msgstr "" #: ../../library/asyncio-queue.rst:112 msgid "" -"All blocked callers of :meth:`~Queue.put` and :meth:`~Queue.get` will be " -"unblocked. If *immediate* is true, a task will be marked as done for each " -"remaining item in the queue, which may unblock callers " -"of :meth:`~Queue.join`." +"If *immediate* is false (the default), the queue can be wound down normally " +"with :meth:`~Queue.get` calls to extract tasks that have already been loaded." +msgstr "" + +#: ../../library/asyncio-queue.rst:116 +msgid "" +"And if :meth:`~Queue.task_done` is called for each remaining task, a " +"pending :meth:`~Queue.join` will be unblocked normally." msgstr "" -#: ../../library/asyncio-queue.rst:121 +#: ../../library/asyncio-queue.rst:119 +msgid "" +"Once the queue is empty, future calls to :meth:`~Queue.get` will raise :exc:" +"`QueueShutDown`." +msgstr "" + +#: ../../library/asyncio-queue.rst:122 +msgid "" +"If *immediate* is true, the queue is terminated immediately. The queue is " +"drained to be completely empty. All callers of :meth:`~Queue.join` are " +"unblocked regardless of the number of unfinished tasks. Blocked callers of :" +"meth:`~Queue.get` are unblocked and will raise :exc:`QueueShutDown` because " +"the queue is empty." +msgstr "" + +#: ../../library/asyncio-queue.rst:129 +msgid "" +"Use caution when using :meth:`~Queue.join` with *immediate* set to true. " +"This unblocks the join even when no work has been done on the tasks, " +"violating the usual invariant for joining a queue." +msgstr "" + +#: ../../library/asyncio-queue.rst:137 msgid "Indicate that a formerly enqueued work item is complete." msgstr "表示前面一個排隊的工作項目已經完成。" -#: ../../library/asyncio-queue.rst:123 +#: ../../library/asyncio-queue.rst:139 msgid "" "Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work " "item, a subsequent call to :meth:`task_done` tells the queue that the " "processing on the work item is complete." msgstr "" -"由佇列消耗者使用。對於每個用於取得一個工作項目的 :meth:`~Queue.get`,接續" -"的 :meth:`task_done` 呼叫會告訴佇列這個工作項目的處理已經完成。" +"由佇列消耗者使用。對於每個用於取得一個工作項目的 :meth:`~Queue.get`,接續的 :" +"meth:`task_done` 呼叫會告訴佇列這個工作項目的處理已經完成。" -#: ../../library/asyncio-queue.rst:127 +#: ../../library/asyncio-queue.rst:143 msgid "" "If a :meth:`join` is currently blocking, it will resume when all items have " "been processed (meaning that a :meth:`task_done` call was received for every " @@ -204,53 +228,47 @@ msgstr "" "如果 :meth:`join` 目前正在阻塞,在所有項目都被處理後會解除阻塞(意味著每個" "以 :meth:`~Queue.put` 放進佇列的條目都會收到一個 :meth:`task_done`)。" -#: ../../library/asyncio-queue.rst:132 -msgid "" -"``shutdown(immediate=True)`` calls :meth:`task_done` for each remaining item " -"in the queue." -msgstr "" - -#: ../../library/asyncio-queue.rst:135 +#: ../../library/asyncio-queue.rst:148 msgid "" "Raises :exc:`ValueError` if called more times than there were items placed " "in the queue." msgstr "如果被呼叫的次數多於放入佇列中的項目數量,將引發 :exc:`ValueError`。" -#: ../../library/asyncio-queue.rst:140 +#: ../../library/asyncio-queue.rst:153 msgid "Priority Queue" msgstr "Priority Queue(優先佇列)" -#: ../../library/asyncio-queue.rst:144 +#: ../../library/asyncio-queue.rst:157 msgid "" "A variant of :class:`Queue`; retrieves entries in priority order (lowest " "first)." msgstr ":class:`Queue` 的變形;按優先順序取出條目 (最小的先取出)。" -#: ../../library/asyncio-queue.rst:147 +#: ../../library/asyncio-queue.rst:160 msgid "Entries are typically tuples of the form ``(priority_number, data)``." msgstr "條目通常是 ``(priority_number, data)`` 形式的 tuple(元組)。" -#: ../../library/asyncio-queue.rst:152 +#: ../../library/asyncio-queue.rst:165 msgid "LIFO Queue" msgstr "LIFO Queue" -#: ../../library/asyncio-queue.rst:156 +#: ../../library/asyncio-queue.rst:169 msgid "" "A variant of :class:`Queue` that retrieves most recently added entries first " "(last in, first out)." msgstr ":class:`Queue` 的變形,先取出最近新增的條目(後進先出)。" -#: ../../library/asyncio-queue.rst:161 +#: ../../library/asyncio-queue.rst:174 msgid "Exceptions" msgstr "例外" -#: ../../library/asyncio-queue.rst:165 +#: ../../library/asyncio-queue.rst:178 msgid "" "This exception is raised when the :meth:`~Queue.get_nowait` method is called " "on an empty queue." msgstr "當佇列為空的時候,呼叫 :meth:`~Queue.get_nowait` 方法會引發這個例外。" -#: ../../library/asyncio-queue.rst:171 +#: ../../library/asyncio-queue.rst:184 msgid "" "Exception raised when the :meth:`~Queue.put_nowait` method is called on a " "queue that has reached its *maxsize*." @@ -258,22 +276,22 @@ msgstr "" "當佇列中條目數量已經達到它的 *maxsize* 時,呼叫 :meth:`~Queue.put_nowait` 方" "法會引發這個例外。" -#: ../../library/asyncio-queue.rst:177 +#: ../../library/asyncio-queue.rst:190 msgid "" "Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is called on " "a queue which has been shut down." msgstr "" -#: ../../library/asyncio-queue.rst:184 +#: ../../library/asyncio-queue.rst:197 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-queue.rst:188 +#: ../../library/asyncio-queue.rst:201 msgid "" "Queues can be used to distribute workload between several concurrent tasks::" msgstr "佇列能被用於多個並行任務的工作分配:" -#: ../../library/asyncio-queue.rst:191 +#: ../../library/asyncio-queue.rst:204 msgid "" "import asyncio\n" "import random\n" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 0ed40b78cb..064b189944 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-19 00:16+0000\n" +"POT-Creation-Date: 2025-10-05 00:16+0000\n" "PO-Revision-Date: 2022-10-31 16:28+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,7 +42,7 @@ msgstr "" msgid "Here is an example of a TCP echo client written using asyncio streams::" msgstr "這是一個使用 asyncio 串流編寫的 TCP echo 用戶端範例: ::" -#: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:440 +#: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:441 msgid "" "import asyncio\n" "\n" @@ -146,7 +146,7 @@ msgstr "移除 *loop* 參數。" #: ../../library/asyncio-stream.rst:87 ../../library/asyncio-stream.rst:131 #: ../../library/asyncio-stream.rst:167 ../../library/asyncio-stream.rst:202 -#: ../../library/asyncio-stream.rst:407 +#: ../../library/asyncio-stream.rst:408 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "新增 *ssl_shutdown_timeout* 參數。" @@ -409,11 +409,17 @@ msgstr "" "此方法會嘗試立即將 *data* 寫入到底層的 socket。如果失敗,資料會被放到內部寫入" "緩衝中排隊等待 (queue),直到它可被發送。" -#: ../../library/asyncio-stream.rst:319 ../../library/asyncio-stream.rst:334 +#: ../../library/asyncio-stream.rst:319 +msgid "" +"The *data* buffer should be a bytes, bytearray, or C-contiguous one-" +"dimensional memoryview object." +msgstr "" + +#: ../../library/asyncio-stream.rst:322 ../../library/asyncio-stream.rst:335 msgid "The method should be used along with the ``drain()`` method::" msgstr "此方法應當與 ``drain()`` 方法一起使用: ::" -#: ../../library/asyncio-stream.rst:321 +#: ../../library/asyncio-stream.rst:324 msgid "" "stream.write(data)\n" "await stream.drain()" @@ -421,13 +427,7 @@ msgstr "" "stream.write(data)\n" "await stream.drain()" -#: ../../library/asyncio-stream.rst:325 -msgid "" -"The *data* buffer should be a C contiguous one-dimensional :term:`bytes-like " -"object `." -msgstr "" - -#: ../../library/asyncio-stream.rst:329 +#: ../../library/asyncio-stream.rst:330 msgid "" "The method writes a list (or any iterable) of bytes to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -436,7 +436,7 @@ msgstr "" "此方法會立即嘗試將一個位元組 list(或任何可疊代物件 (iterable))寫入到底層的 " "socket。如果失敗,資料會被放到內部寫入緩衝中排隊等待,直到它可被發送。" -#: ../../library/asyncio-stream.rst:336 +#: ../../library/asyncio-stream.rst:337 msgid "" "stream.writelines(lines)\n" "await stream.drain()" @@ -444,17 +444,17 @@ msgstr "" "stream.writelines(lines)\n" "await stream.drain()" -#: ../../library/asyncio-stream.rst:341 +#: ../../library/asyncio-stream.rst:342 msgid "The method closes the stream and the underlying socket." msgstr "此方法會關閉串流以及底層的 socket。" -#: ../../library/asyncio-stream.rst:343 +#: ../../library/asyncio-stream.rst:344 msgid "" "The method should be used, though not mandatory, along with the " "``wait_closed()`` method::" msgstr "此方法應與 ``wait_closed()`` 方法一起使用,但並非強制: ::" -#: ../../library/asyncio-stream.rst:346 +#: ../../library/asyncio-stream.rst:347 msgid "" "stream.close()\n" "await stream.wait_closed()" @@ -462,7 +462,7 @@ msgstr "" "stream.close()\n" "await stream.wait_closed()" -#: ../../library/asyncio-stream.rst:351 +#: ../../library/asyncio-stream.rst:352 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." @@ -470,26 +470,26 @@ msgstr "" "如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 " "``False``。" -#: ../../library/asyncio-stream.rst:356 +#: ../../library/asyncio-stream.rst:357 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。" -#: ../../library/asyncio-stream.rst:361 +#: ../../library/asyncio-stream.rst:362 msgid "Return the underlying asyncio transport." msgstr "回傳底層的 asyncio 傳輸。" -#: ../../library/asyncio-stream.rst:365 +#: ../../library/asyncio-stream.rst:366 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。" -#: ../../library/asyncio-stream.rst:371 +#: ../../library/asyncio-stream.rst:372 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "等待直到可以繼續寫入到串流。範例: ::" -#: ../../library/asyncio-stream.rst:374 +#: ../../library/asyncio-stream.rst:375 msgid "" "writer.write(data)\n" "await writer.drain()" @@ -497,7 +497,7 @@ msgstr "" "writer.write(data)\n" "await writer.drain()" -#: ../../library/asyncio-stream.rst:377 +#: ../../library/asyncio-stream.rst:378 msgid "" "This is a flow control method that interacts with the underlying IO write " "buffer. When the size of the buffer reaches the high watermark, *drain()* " @@ -509,48 +509,48 @@ msgstr "" "(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low " "watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。" -#: ../../library/asyncio-stream.rst:388 +#: ../../library/asyncio-stream.rst:389 msgid "Upgrade an existing stream-based connection to TLS." msgstr "將現有的基於串流的連線升級到 TLS。" -#: ../../library/asyncio-stream.rst:390 +#: ../../library/asyncio-stream.rst:391 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-stream.rst:392 +#: ../../library/asyncio-stream.rst:393 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "*sslcontext*:一個 :class:`~ssl.SSLContext` 的已配置實例。" -#: ../../library/asyncio-stream.rst:394 +#: ../../library/asyncio-stream.rst:395 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "*server_hostname*:設定或覆寫將會被目標伺服器憑證比對的主機名稱。" -#: ../../library/asyncio-stream.rst:397 +#: ../../library/asyncio-stream.rst:398 msgid "" "*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake " "to complete before aborting the connection. ``60.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-stream.rst:401 +#: ../../library/asyncio-stream.rst:402 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-stream.rst:413 +#: ../../library/asyncio-stream.rst:414 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:421 +#: ../../library/asyncio-stream.rst:422 msgid "Wait until the stream is closed." msgstr "等待直到串流被關閉。" -#: ../../library/asyncio-stream.rst:423 +#: ../../library/asyncio-stream.rst:424 msgid "" "Should be called after :meth:`close` to wait until the underlying connection " "is closed, ensuring that all data has been flushed before e.g. exiting the " @@ -559,19 +559,19 @@ msgstr "" "應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉,以確保在" "這之前(例如在程式退出前)所有資料都已經被清空" -#: ../../library/asyncio-stream.rst:431 +#: ../../library/asyncio-stream.rst:432 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-stream.rst:436 +#: ../../library/asyncio-stream.rst:437 msgid "TCP echo client using streams" msgstr "使用串流的 TCP echo 用戶端" -#: ../../library/asyncio-stream.rst:438 +#: ../../library/asyncio-stream.rst:439 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "使用 :func:`asyncio.open_connection` 函式的 TCP echo 用戶端: ::" -#: ../../library/asyncio-stream.rst:462 +#: ../../library/asyncio-stream.rst:463 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" @@ -580,15 +580,15 @@ msgstr "" "使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 用戶端協定 " "`\\ 範例。" -#: ../../library/asyncio-stream.rst:469 +#: ../../library/asyncio-stream.rst:470 msgid "TCP echo server using streams" msgstr "使用串流的 TCP echo 伺服器" -#: ../../library/asyncio-stream.rst:471 +#: ../../library/asyncio-stream.rst:472 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式: ::" -#: ../../library/asyncio-stream.rst:473 +#: ../../library/asyncio-stream.rst:474 msgid "" "import asyncio\n" "\n" @@ -648,7 +648,7 @@ msgstr "" "\n" "asyncio.run(main())" -#: ../../library/asyncio-stream.rst:505 +#: ../../library/asyncio-stream.rst:506 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." @@ -657,16 +657,16 @@ msgstr "" "使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 " "` 範例。" -#: ../../library/asyncio-stream.rst:510 +#: ../../library/asyncio-stream.rst:511 msgid "Get HTTP headers" msgstr "取得 HTTP 標頭" -#: ../../library/asyncio-stream.rst:512 +#: ../../library/asyncio-stream.rst:513 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "查詢自命令列傳入之 URL 所帶有 HTTP 標頭的簡單範例: ::" -#: ../../library/asyncio-stream.rst:514 +#: ../../library/asyncio-stream.rst:515 msgid "" "import asyncio\n" "import urllib.parse\n" @@ -705,34 +705,34 @@ msgid "" "asyncio.run(print_http_headers(url))" msgstr "" -#: ../../library/asyncio-stream.rst:551 +#: ../../library/asyncio-stream.rst:552 msgid "Usage::" msgstr "用法: ::" -#: ../../library/asyncio-stream.rst:553 +#: ../../library/asyncio-stream.rst:554 msgid "python example.py http://example.com/path/page.html" msgstr "python example.py http://example.com/path/page.html" -#: ../../library/asyncio-stream.rst:555 +#: ../../library/asyncio-stream.rst:556 msgid "or with HTTPS::" msgstr "或使用 HTTPS: ::" -#: ../../library/asyncio-stream.rst:557 +#: ../../library/asyncio-stream.rst:558 msgid "python example.py https://example.com/path/page.html" msgstr "python example.py https://example.com/path/page.html" -#: ../../library/asyncio-stream.rst:563 +#: ../../library/asyncio-stream.rst:564 msgid "Register an open socket to wait for data using streams" msgstr "註冊一個使用串流來等待資料的開放 socket" -#: ../../library/asyncio-stream.rst:565 +#: ../../library/asyncio-stream.rst:566 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" msgstr "" "等待直到 socket 透過使用 :func:`open_connection` 函式接收到資料的協程: ::" -#: ../../library/asyncio-stream.rst:568 +#: ../../library/asyncio-stream.rst:569 msgid "" "import asyncio\n" "import socket\n" @@ -765,7 +765,7 @@ msgid "" "asyncio.run(wait_for_data())" msgstr "" -#: ../../library/asyncio-stream.rst:600 +#: ../../library/asyncio-stream.rst:601 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " @@ -775,7 +775,7 @@ msgstr "" "`\\ 範例中,有使用了低階協定以及 :meth:" "`loop.create_connection` 方法。" -#: ../../library/asyncio-stream.rst:604 +#: ../../library/asyncio-stream.rst:605 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." diff --git a/library/codecs.po b/library/codecs.po index e9bfa3e9fe..f0fef149df 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+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-" @@ -51,9 +51,9 @@ msgstr "" #: ../../library/codecs.rst:40 msgid "" "*Errors* may be given to set the desired error handling scheme. The default " -"error handler is ``'strict'`` meaning that encoding errors " -"raise :exc:`ValueError` (or a more codec specific subclass, such " -"as :exc:`UnicodeEncodeError`). Refer to :ref:`codec-base-classes` for more " +"error handler is ``'strict'`` meaning that encoding errors raise :exc:" +"`ValueError` (or a more codec specific subclass, such as :exc:" +"`UnicodeEncodeError`). Refer to :ref:`codec-base-classes` for more " "information on codec error handling." msgstr "" @@ -64,9 +64,9 @@ msgstr "" #: ../../library/codecs.rst:50 msgid "" "*Errors* may be given to set the desired error handling scheme. The default " -"error handler is ``'strict'`` meaning that decoding errors " -"raise :exc:`ValueError` (or a more codec specific subclass, such " -"as :exc:`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more " +"error handler is ``'strict'`` meaning that decoding errors raise :exc:" +"`ValueError` (or a more codec specific subclass, such as :exc:" +"`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more " "information on codec error handling." msgstr "" @@ -85,17 +85,16 @@ msgstr "" #: ../../library/codecs.rst:68 msgid "" -"Looks up the codec info in the Python codec registry and returns " -"a :class:`CodecInfo` object as defined below." +"Looks up the codec info in the Python codec registry and returns a :class:" +"`CodecInfo` object as defined below." msgstr "" #: ../../library/codecs.rst:71 msgid "" "Encodings are first looked up in the registry's cache. If not found, the " "list of registered search functions is scanned. If no :class:`CodecInfo` " -"object is found, a :exc:`LookupError` is raised. Otherwise, " -"the :class:`CodecInfo` object is stored in the cache and returned to the " -"caller." +"object is found, a :exc:`LookupError` is raised. Otherwise, the :class:" +"`CodecInfo` object is stored in the cache and returned to the caller." msgstr "" #: ../../library/codecs.rst:78 @@ -111,25 +110,25 @@ msgstr "編碼的名稱。" #: ../../library/codecs.rst:90 msgid "" "The stateless encoding and decoding functions. These must be functions or " -"methods which have the same interface as the :meth:`~Codec.encode` " -"and :meth:`~Codec.decode` methods of Codec instances (see :ref:`Codec " -"Interface `). The functions or methods are expected to work " -"in a stateless mode." +"methods which have the same interface as the :meth:`~Codec.encode` and :meth:" +"`~Codec.decode` methods of Codec instances (see :ref:`Codec Interface `). The functions or methods are expected to work in a stateless " +"mode." msgstr "" #: ../../library/codecs.rst:100 msgid "" "Incremental encoder and decoder classes or factory functions. These have to " -"provide the interface defined by the base " -"classes :class:`IncrementalEncoder` and :class:`IncrementalDecoder`, " -"respectively. Incremental codecs can maintain state." +"provide the interface defined by the base classes :class:" +"`IncrementalEncoder` and :class:`IncrementalDecoder`, respectively. " +"Incremental codecs can maintain state." msgstr "" #: ../../library/codecs.rst:109 msgid "" "Stream writer and reader classes or factory functions. These have to provide " -"the interface defined by the base classes :class:`StreamWriter` " -"and :class:`StreamReader`, respectively. Stream codecs can maintain state." +"the interface defined by the base classes :class:`StreamWriter` and :class:" +"`StreamReader`, respectively. Stream codecs can maintain state." msgstr "" #: ../../library/codecs.rst:114 @@ -179,14 +178,14 @@ msgstr "" #: ../../library/codecs.rst:151 msgid "" -"Look up the codec for the given encoding and return " -"its :class:`StreamReader` class or factory function." +"Look up the codec for the given encoding and return its :class:" +"`StreamReader` class or factory function." msgstr "" #: ../../library/codecs.rst:159 msgid "" -"Look up the codec for the given encoding and return " -"its :class:`StreamWriter` class or factory function." +"Look up the codec for the given encoding and return its :class:" +"`StreamWriter` class or factory function." msgstr "" #: ../../library/codecs.rst:164 @@ -224,9 +223,9 @@ msgstr "" #: ../../library/codecs.rst:194 msgid "" -"Open an encoded file using the given *mode* and return an instance " -"of :class:`StreamReaderWriter`, providing transparent encoding/decoding. The " -"default file mode is ``'r'``, meaning to open the file in read mode." +"Open an encoded file using the given *mode* and return an instance of :class:" +"`StreamReaderWriter`, providing transparent encoding/decoding. The default " +"file mode is ``'r'``, meaning to open the file in read mode." msgstr "" #: ../../library/codecs.rst:200 @@ -294,8 +293,8 @@ msgstr "" #: ../../library/codecs.rst:245 msgid "" "Uses an incremental encoder to iteratively encode the input provided by " -"*iterator*. *iterator* must yield :class:`str` objects. This function is " -"a :term:`generator`. The *errors* argument (as well as any other keyword " +"*iterator*. *iterator* must yield :class:`str` objects. This function is a :" +"term:`generator`. The *errors* argument (as well as any other keyword " "argument) is passed through to the incremental encoder." msgstr "" @@ -318,8 +317,8 @@ msgstr "" msgid "" "This function requires that the codec accept :class:`bytes` objects to " "decode. Therefore it does not support text-to-text encoders such as " -"``rot_13``, although ``rot_13`` may be used equivalently " -"with :func:`iterencode`." +"``rot_13``, although ``rot_13`` may be used equivalently with :func:" +"`iterencode`." msgstr "" #: ../../library/codecs.rst:270 @@ -352,11 +351,11 @@ msgid "" "These constants define various byte sequences, being Unicode byte order " "marks (BOMs) for several encodings. They are used in UTF-16 and UTF-32 data " "streams to indicate the byte order used, and in UTF-8 as a Unicode " -"signature. :const:`BOM_UTF16` is either :const:`BOM_UTF16_BE` " -"or :const:`BOM_UTF16_LE` depending on the platform's native byte " -"order, :const:`BOM` is an alias for :const:`BOM_UTF16`, :const:`BOM_LE` " -"for :const:`BOM_UTF16_LE` and :const:`BOM_BE` for :const:`BOM_UTF16_BE`. The " -"others represent the BOM in UTF-8 and UTF-32 encodings." +"signature. :const:`BOM_UTF16` is either :const:`BOM_UTF16_BE` or :const:" +"`BOM_UTF16_LE` depending on the platform's native byte order, :const:`BOM` " +"is an alias for :const:`BOM_UTF16`, :const:`BOM_LE` for :const:" +"`BOM_UTF16_LE` and :const:`BOM_BE` for :const:`BOM_UTF16_BE`. The others " +"represent the BOM in UTF-8 and UTF-32 encodings." msgstr "" #: ../../library/codecs.rst:311 @@ -402,7 +401,7 @@ msgstr "" #: ../../library/codecs.rst:356 ../../library/codecs.rst:399 #: ../../library/codecs.rst:419 ../../library/codecs.rst:1371 -#: ../../library/codecs.rst:1443 ../../library/codecs.rst:1498 +#: ../../library/codecs.rst:1443 ../../library/codecs.rst:1528 msgid "Meaning" msgstr "含義" @@ -444,10 +443,9 @@ msgstr "``'backslashreplace'``" #: ../../library/codecs.rst:372 msgid "" "Replace with backslashed escape sequences. On encoding, use hexadecimal form " -"of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}" -"` :samp:`\\\\U{xxxxxxxx}`. On decoding, use hexadecimal form of byte value " -"with format :samp:`\\\\x{hh}`. Implemented " -"in :func:`backslashreplace_errors`." +"of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}` :" +"samp:`\\\\U{xxxxxxxx}`. On decoding, use hexadecimal form of byte value with " +"format :samp:`\\\\x{hh}`. Implemented in :func:`backslashreplace_errors`." msgstr "" #: ../../library/codecs.rst:381 @@ -464,8 +462,8 @@ msgstr "" #: ../../library/codecs.rst:395 msgid "" -"The following error handlers are only applicable to encoding " -"(within :term:`text encodings `):" +"The following error handlers are only applicable to encoding (within :term:" +"`text encodings `):" msgstr "" #: ../../library/codecs.rst:401 @@ -475,8 +473,8 @@ msgstr "``'xmlcharrefreplace'``" #: ../../library/codecs.rst:401 msgid "" "Replace with XML/HTML numeric character reference, which is a decimal form " -"of Unicode code point with format :samp:`&#{num};`. Implemented " -"in :func:`xmlcharrefreplace_errors`." +"of Unicode code point with format :samp:`&#{num};`. Implemented in :func:" +"`xmlcharrefreplace_errors`." msgstr "" #: ../../library/codecs.rst:407 @@ -486,8 +484,8 @@ msgstr "``'namereplace'``" #: ../../library/codecs.rst:407 msgid "" "Replace with ``\\N{...}`` escape sequences, what appears in the braces is " -"the Name property from Unicode Character Database. Implemented " -"in :func:`namereplace_errors`." +"the Name property from Unicode Character Database. Implemented in :func:" +"`namereplace_errors`." msgstr "" #: ../../library/codecs.rst:416 @@ -549,18 +547,17 @@ msgstr "" #: ../../library/codecs.rst:451 msgid "" -"For encoding, *error_handler* will be called with " -"a :exc:`UnicodeEncodeError` instance, which contains information about the " -"location of the error. The error handler must either raise this or a " -"different exception, or return a tuple with a replacement for the " -"unencodable part of the input and a position where encoding should continue. " -"The replacement may be either :class:`str` or :class:`bytes`. If the " -"replacement is bytes, the encoder will simply copy them into the output " -"buffer. If the replacement is a string, the encoder will encode the " -"replacement. Encoding continues on original input at the specified position. " -"Negative position values will be treated as being relative to the end of the " -"input string. If the resulting position is out of bound an :exc:`IndexError` " -"will be raised." +"For encoding, *error_handler* will be called with a :exc:" +"`UnicodeEncodeError` instance, which contains information about the location " +"of the error. The error handler must either raise this or a different " +"exception, or return a tuple with a replacement for the unencodable part of " +"the input and a position where encoding should continue. The replacement may " +"be either :class:`str` or :class:`bytes`. If the replacement is bytes, the " +"encoder will simply copy them into the output buffer. If the replacement is " +"a string, the encoder will encode the replacement. Encoding continues on " +"original input at the specified position. Negative position values will be " +"treated as being relative to the end of the input string. If the resulting " +"position is out of bound an :exc:`IndexError` will be raised." msgstr "" #: ../../library/codecs.rst:463 @@ -636,8 +633,8 @@ msgstr "" #: ../../library/codecs.rst:519 msgid "" -"Implements the ``'xmlcharrefreplace'`` error handling (for encoding " -"within :term:`text encoding` only)." +"Implements the ``'xmlcharrefreplace'`` error handling (for encoding within :" +"term:`text encoding` only)." msgstr "" #: ../../library/codecs.rst:522 @@ -649,8 +646,8 @@ msgstr "" #: ../../library/codecs.rst:529 msgid "" -"Implements the ``'namereplace'`` error handling (for encoding " -"within :term:`text encoding` only)." +"Implements the ``'namereplace'`` error handling (for encoding within :term:" +"`text encoding` only)." msgstr "" #: ../../library/codecs.rst:532 @@ -687,9 +684,9 @@ msgstr "" #: ../../library/codecs.rst:561 msgid "" -"The method may not store state in the :class:`Codec` instance. " -"Use :class:`StreamWriter` for codecs which have to keep state in order to " -"make encoding efficient." +"The method may not store state in the :class:`Codec` instance. Use :class:" +"`StreamWriter` for codecs which have to keep state in order to make encoding " +"efficient." msgstr "" #: ../../library/codecs.rst:565 @@ -715,9 +712,9 @@ msgstr "" #: ../../library/codecs.rst:583 msgid "" -"The method may not store state in the :class:`Codec` instance. " -"Use :class:`StreamReader` for codecs which have to keep state in order to " -"make decoding efficient." +"The method may not store state in the :class:`Codec` instance. Use :class:" +"`StreamReader` for codecs which have to keep state in order to make decoding " +"efficient." msgstr "" #: ../../library/codecs.rst:587 @@ -735,18 +732,18 @@ msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" "decoding the input isn't done with one call to the stateless encoder/decoder " -"function, but with multiple calls to " -"the :meth:`~IncrementalEncoder.encode`/:meth:`~IncrementalDecoder.decode` " -"method of the incremental encoder/decoder. The incremental encoder/decoder " -"keeps track of the encoding/decoding process during method calls." +"function, but with multiple calls to the :meth:`~IncrementalEncoder.encode`/:" +"meth:`~IncrementalDecoder.decode` method of the incremental encoder/decoder. " +"The incremental encoder/decoder keeps track of the encoding/decoding process " +"during method calls." msgstr "" #: ../../library/codecs.rst:602 msgid "" -"The joined output of calls to " -"the :meth:`~IncrementalEncoder.encode`/:meth:`~IncrementalDecoder.decode` " -"method is the same as if all the single inputs were joined into one, and " -"this input was encoded/decoded with the stateless encoder/decoder." +"The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" +"`~IncrementalDecoder.decode` method is the same as if all the single inputs " +"were joined into one, and this input was encoded/decoded with the stateless " +"encoder/decoder." msgstr "" #: ../../library/codecs.rst:611 @@ -782,21 +779,21 @@ msgstr "" msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " -"error handling strategies during the lifetime of " -"the :class:`IncrementalEncoder` object." +"error handling strategies during the lifetime of the :class:" +"`IncrementalEncoder` object." msgstr "" #: ../../library/codecs.rst:638 msgid "" "Encodes *object* (taking the current state of the encoder into account) and " -"returns the resulting encoded object. If this is the last call " -"to :meth:`encode` *final* must be true (the default is false)." +"returns the resulting encoded object. If this is the last call to :meth:" +"`encode` *final* must be true (the default is false)." msgstr "" #: ../../library/codecs.rst:645 msgid "" -"Reset the encoder to the initial state. The output is discarded: call " -"``.encode(object, final=True)``, passing an empty byte or text string if " +"Reset the encoder to the initial state. The output is discarded: call ``." +"encode(object, final=True)``, passing an empty byte or text string if " "necessary, to reset the encoder and to get the output." msgstr "" @@ -848,19 +845,19 @@ msgstr "" msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " -"error handling strategies during the lifetime of " -"the :class:`IncrementalDecoder` object." +"error handling strategies during the lifetime of the :class:" +"`IncrementalDecoder` object." msgstr "" #: ../../library/codecs.rst:695 msgid "" "Decodes *object* (taking the current state of the decoder into account) and " -"returns the resulting decoded object. If this is the last call " -"to :meth:`decode` *final* must be true (the default is false). If *final* is " -"true the decoder must decode the input completely and must flush all " -"buffers. If this isn't possible (e.g. because of incomplete byte sequences " -"at the end of the input) it must initiate error handling just like in the " -"stateless case (which might raise an exception)." +"returns the resulting decoded object. If this is the last call to :meth:" +"`decode` *final* must be true (the default is false). If *final* is true the " +"decoder must decode the input completely and must flush all buffers. If this " +"isn't possible (e.g. because of incomplete byte sequences at the end of the " +"input) it must initiate error handling just like in the stateless case " +"(which might raise an exception)." msgstr "" #: ../../library/codecs.rst:706 @@ -1015,8 +1012,8 @@ msgstr "" #: ../../library/codecs.rst:823 msgid "" -"The set of allowed values for the *errors* argument can be extended " -"with :func:`register_error`." +"The set of allowed values for the *errors* argument can be extended with :" +"func:`register_error`." msgstr "" #: ../../library/codecs.rst:829 @@ -1082,8 +1079,8 @@ msgstr "" #: ../../library/codecs.rst:872 msgid "" -"*sizehint*, if given, is passed as the *size* argument to the " -"stream's :meth:`read` method." +"*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" +"`read` method." msgstr "" #: ../../library/codecs.rst:880 @@ -1110,8 +1107,8 @@ msgstr "" #: ../../library/codecs.rst:895 ../../library/codecs.rst:919 msgid "" -"The design is such that one can use the factory functions returned by " -"the :func:`lookup` function to construct the instance." +"The design is such that one can use the factory functions returned by the :" +"func:`lookup` function to construct the instance." msgstr "" #: ../../library/codecs.rst:901 @@ -1125,8 +1122,8 @@ msgstr "" #: ../../library/codecs.rst:906 msgid "" -":class:`StreamReaderWriter` instances define the combined interfaces " -"of :class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " +":class:`StreamReaderWriter` instances define the combined interfaces of :" +"class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " "other methods and attributes from the underlying stream." msgstr "" @@ -1174,9 +1171,9 @@ msgstr "" #: ../../library/codecs.rst:945 msgid "" -":class:`StreamRecoder` instances define the combined interfaces " -"of :class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " -"other methods and attributes from the underlying stream." +":class:`StreamRecoder` instances define the combined interfaces of :class:" +"`StreamReader` and :class:`StreamWriter` classes. They inherit all other " +"methods and attributes from the underlying stream." msgstr "" #: ../../library/codecs.rst:953 @@ -1418,12 +1415,12 @@ msgid "an IBM PC code page, which is ASCII compatible" msgstr "" #: ../../library/codecs.rst:1112 ../../library/codecs.rst:1371 -#: ../../library/codecs.rst:1443 ../../library/codecs.rst:1498 +#: ../../library/codecs.rst:1443 ../../library/codecs.rst:1528 msgid "Codec" msgstr "" #: ../../library/codecs.rst:1112 ../../library/codecs.rst:1371 -#: ../../library/codecs.rst:1443 ../../library/codecs.rst:1498 +#: ../../library/codecs.rst:1443 ../../library/codecs.rst:1528 msgid "Aliases" msgstr "" @@ -1550,7 +1547,7 @@ msgid "IBM775" msgstr "IBM775" #: ../../library/codecs.rst:1137 ../../library/codecs.rst:1204 -#: ../../library/codecs.rst:1254 ../../library/codecs.rst:1271 +#: ../../library/codecs.rst:1271 msgid "Baltic languages" msgstr "" @@ -2032,6 +2029,10 @@ msgstr "iso8859_4" msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" +#: ../../library/codecs.rst:1254 +msgid "Northern Europe" +msgstr "" + #: ../../library/codecs.rst:1256 msgid "iso8859_5" msgstr "iso8859_5" @@ -2363,9 +2364,9 @@ msgstr "" #: ../../library/codecs.rst:1364 msgid "" -"The following codecs provide :class:`str` to :class:`bytes` encoding " -"and :term:`bytes-like object` to :class:`str` decoding, similar to the " -"Unicode text encodings." +"The following codecs provide :class:`str` to :class:`bytes` encoding and :" +"term:`bytes-like object` to :class:`str` decoding, similar to the Unicode " +"text encodings." msgstr "" #: ../../library/codecs.rst:1373 @@ -2587,49 +2588,87 @@ msgid "Restoration of the aliases for the binary transforms." msgstr "" #: ../../library/codecs.rst:1489 -msgid "Text Transforms" +msgid "Standalone Codec Functions" msgstr "" #: ../../library/codecs.rst:1491 msgid "" -"The following codec provides a text transform: a :class:`str` " -"to :class:`str` mapping. It is not supported by :meth:`str.encode` (which " -"only produces :class:`bytes` output)." +"The following functions provide encoding and decoding functionality similar " +"to codecs, but are not available as named codecs through :func:`codecs." +"encode` or :func:`codecs.decode`. They are used internally (for example, by :" +"mod:`pickle`) and behave similarly to the ``string_escape`` codec that was " +"removed in Python 3." msgstr "" -#: ../../library/codecs.rst:1500 +#: ../../library/codecs.rst:1498 +msgid "" +"Encode *input* using escape sequences. Similar to how :func:`repr` on bytes " +"produces escaped byte values." +msgstr "" + +#: ../../library/codecs.rst:1501 +msgid "*input* must be a :class:`bytes` object." +msgstr "" + +#: ../../library/codecs.rst:1503 ../../library/codecs.rst:1512 +msgid "" +"Returns a tuple ``(output, length)`` where *output* is a :class:`bytes` " +"object and *length* is the number of bytes consumed." +msgstr "" + +#: ../../library/codecs.rst:1508 +msgid "Decode *input* from escape sequences back to the original bytes." +msgstr "" + +#: ../../library/codecs.rst:1510 +#, fuzzy +msgid "*input* must be a :term:`bytes-like object`." +msgstr "*stream* 引數必須是類檔案物件。" + +#: ../../library/codecs.rst:1519 +msgid "Text Transforms" +msgstr "" + +#: ../../library/codecs.rst:1521 +msgid "" +"The following codec provides a text transform: a :class:`str` to :class:" +"`str` mapping. It is not supported by :meth:`str.encode` (which only " +"produces :class:`bytes` output)." +msgstr "" + +#: ../../library/codecs.rst:1530 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1500 +#: ../../library/codecs.rst:1530 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1500 +#: ../../library/codecs.rst:1530 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1505 +#: ../../library/codecs.rst:1535 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1508 +#: ../../library/codecs.rst:1538 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1513 +#: ../../library/codecs.rst:1543 msgid ":mod:`encodings` --- Encodings package" msgstr "" -#: ../../library/codecs.rst:1518 +#: ../../library/codecs.rst:1548 msgid "This module implements the following functions:" msgstr "" -#: ../../library/codecs.rst:1522 +#: ../../library/codecs.rst:1552 msgid "Normalize encoding name *encoding*." msgstr "" -#: ../../library/codecs.rst:1524 +#: ../../library/codecs.rst:1554 msgid "" "Normalization works as follows: all non-alphanumeric characters except the " "dot used for Python package names are collapsed and replaced with a single " @@ -2637,67 +2676,67 @@ msgid "" "-;#'`` becomes ``'_'``." msgstr "" -#: ../../library/codecs.rst:1529 +#: ../../library/codecs.rst:1559 msgid "Note that *encoding* should be ASCII only." msgstr "" -#: ../../library/codecs.rst:1533 +#: ../../library/codecs.rst:1563 msgid "" "The following functions should not be used directly, except for testing " "purposes; :func:`codecs.lookup` should be used instead." msgstr "" -#: ../../library/codecs.rst:1539 +#: ../../library/codecs.rst:1569 msgid "" "Search for the codec module corresponding to the given encoding name " "*encoding*." msgstr "" -#: ../../library/codecs.rst:1542 +#: ../../library/codecs.rst:1572 msgid "" -"This function first normalizes the *encoding* " -"using :func:`normalize_encoding`, then looks for a corresponding alias. It " -"attempts to import a codec module from the encodings package using either " -"the alias or the normalized name. If the module is found and defines a valid " +"This function first normalizes the *encoding* using :func:" +"`normalize_encoding`, then looks for a corresponding alias. It attempts to " +"import a codec module from the encodings package using either the alias or " +"the normalized name. If the module is found and defines a valid " "``getregentry()`` function that returns a :class:`codecs.CodecInfo` object, " "the codec is cached and returned." msgstr "" -#: ../../library/codecs.rst:1549 +#: ../../library/codecs.rst:1579 msgid "" "If the codec module defines a ``getaliases()`` function any returned aliases " "are registered for future use." msgstr "" -#: ../../library/codecs.rst:1555 +#: ../../library/codecs.rst:1585 msgid "" "Search for a Windows code page encoding *encoding* of the form ``cpXXXX``." msgstr "" -#: ../../library/codecs.rst:1557 +#: ../../library/codecs.rst:1587 msgid "" "If the code page is valid and supported, return a :class:`codecs.CodecInfo` " "object for it." msgstr "" -#: ../../library/codecs.rst:1560 ../../library/codecs.rst:1646 +#: ../../library/codecs.rst:1590 ../../library/codecs.rst:1676 msgid "Availability" msgstr "可用性" -#: ../../library/codecs.rst:1565 +#: ../../library/codecs.rst:1595 msgid "This module implements the following exception:" msgstr "" -#: ../../library/codecs.rst:1569 +#: ../../library/codecs.rst:1599 msgid "Raised when a codec is invalid or incompatible." msgstr "" -#: ../../library/codecs.rst:1573 +#: ../../library/codecs.rst:1603 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1579 +#: ../../library/codecs.rst:1609 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2705,27 +2744,27 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1584 +#: ../../library/codecs.rst:1614 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party :pypi:`idna` module." msgstr "" -#: ../../library/codecs.rst:1587 +#: ../../library/codecs.rst:1617 msgid "" "These RFCs together define a protocol to support non-ASCII characters in " -"domain names. A domain name containing non-ASCII characters (such as " -"``www.Alliancefrançaise.nu``) is converted into an ASCII-compatible encoding " -"(ACE, such as ``www.xn--alliancefranaise-npb.nu``). The ACE form of the " -"domain name is then used in all places where arbitrary characters are not " -"allowed by the protocol, such as DNS queries, HTTP :mailheader:`Host` " -"fields, and so on. This conversion is carried out in the application; if " -"possible invisible to the user: The application should transparently convert " -"Unicode domain labels to IDNA on the wire, and convert back ACE labels to " -"Unicode before presenting them to the user." +"domain names. A domain name containing non-ASCII characters (such as ``www." +"Alliancefrançaise.nu``) is converted into an ASCII-compatible encoding (ACE, " +"such as ``www.xn--alliancefranaise-npb.nu``). The ACE form of the domain " +"name is then used in all places where arbitrary characters are not allowed " +"by the protocol, such as DNS queries, HTTP :mailheader:`Host` fields, and so " +"on. This conversion is carried out in the application; if possible invisible " +"to the user: The application should transparently convert Unicode domain " +"labels to IDNA on the wire, and convert back ACE labels to Unicode before " +"presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1598 +#: ../../library/codecs.rst:1628 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2736,20 +2775,20 @@ msgid "" "the :mod:`socket` module transparently converts Unicode host names to ACE, " "so that applications need not be concerned about converting host names " "themselves when they pass them to the socket module. On top of that, modules " -"that have host names as function parameters, such as :mod:`http.client` " -"and :mod:`ftplib`, accept Unicode host names (:mod:`http.client` then also " +"that have host names as function parameters, such as :mod:`http.client` and :" +"mod:`ftplib`, accept Unicode host names (:mod:`http.client` then also " "transparently sends an IDNA hostname in the :mailheader:`Host` field if it " "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1611 +#: ../../library/codecs.rst:1641 msgid "" "When receiving host names from the wire (such as in reverse name lookup), no " "automatic conversion to Unicode is performed: applications wishing to " "present such host names to the user should decode them to Unicode." msgstr "" -#: ../../library/codecs.rst:1615 +#: ../../library/codecs.rst:1645 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2757,45 +2796,45 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1623 +#: ../../library/codecs.rst:1653 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1629 +#: ../../library/codecs.rst:1659 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1635 +#: ../../library/codecs.rst:1665 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1639 +#: ../../library/codecs.rst:1669 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr ":mod:`encodings.mbcs` --- Windows ANSI 碼頁" -#: ../../library/codecs.rst:1644 +#: ../../library/codecs.rst:1674 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "這個模組實作了 ANSI 碼頁 (CP_ACP)。" -#: ../../library/codecs.rst:1648 +#: ../../library/codecs.rst:1678 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1652 +#: ../../library/codecs.rst:1682 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1657 +#: ../../library/codecs.rst:1687 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1663 +#: ../../library/codecs.rst:1693 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " diff --git a/library/collections.abc.po b/library/collections.abc.po index 9cd5830693..c9cfd4581d 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-18 00:15+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+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-" @@ -608,49 +608,69 @@ msgid "" msgstr "" #: ../../library/collections.abc.rst:292 +msgid "The :class:`ByteString` ABC has been deprecated." +msgstr "" + +#: ../../library/collections.abc.rst:295 msgid "" -"The :class:`ByteString` ABC has been deprecated. For use in type " -"annotations, prefer a union, like ``bytes | bytearray``, or :class:" -"`collections.abc.Buffer`. For use as an ABC, prefer :class:`Sequence` or :" -"class:`collections.abc.Buffer`." +"Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " +"implements the :ref:`buffer protocol ` at runtime. For use in " +"type annotations, either use :class:`Buffer` or a union that explicitly " +"specifies the types your code supports (e.g., ``bytes | bytearray | " +"memoryview``)." msgstr "" #: ../../library/collections.abc.rst:301 +msgid "" +":class:`!ByteString` was originally intended to be an abstract class that " +"would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " +"However, since the ABC never had any methods, knowing that an object was an " +"instance of :class:`!ByteString` never actually told you anything useful " +"about the object. Other common buffer types such as :class:`memoryview` were " +"also never understood as subtypes of :class:`!ByteString` (either at runtime " +"or by static type checkers)." +msgstr "" + +#: ../../library/collections.abc.rst:309 +msgid "See :pep:`PEP 688 <688#current-options>` for more details." +msgstr "" + +#: ../../library/collections.abc.rst:314 msgid "ABCs for read-only and mutable :ref:`sets `." msgstr "" -#: ../../library/collections.abc.rst:306 +#: ../../library/collections.abc.rst:319 msgid "ABCs for read-only and mutable :term:`mappings `." msgstr "" -#: ../../library/collections.abc.rst:313 +#: ../../library/collections.abc.rst:326 msgid "" "ABCs for mapping, items, keys, and values :term:`views `." msgstr "" -#: ../../library/collections.abc.rst:317 +#: ../../library/collections.abc.rst:330 msgid "" "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " "expressions. Custom implementations must provide the :meth:`~object." "__await__` method." msgstr "" -#: ../../library/collections.abc.rst:321 +#: ../../library/collections.abc.rst:334 msgid "" ":term:`Coroutine ` objects and instances of the :class:" "`~collections.abc.Coroutine` ABC are all instances of this ABC." msgstr "" -#: ../../library/collections.abc.rst:325 +#: ../../library/collections.abc.rst:338 msgid "" "In CPython, generator-based coroutines (:term:`generators ` " -"decorated with :func:`@types.coroutine `) are *awaitables*, " -"even though they do not have an :meth:`~object.__await__` method. Using " -"``isinstance(gencoro, Awaitable)`` for them will return ``False``. Use :func:" -"`inspect.isawaitable` to detect them." +"decorated with :deco:`types.coroutine`) are *awaitables*, even though they " +"do not have an :meth:`~object.__await__` method. Using ``isinstance(gencoro, " +"Awaitable)`` for them will return ``False``. Use :func:`inspect.isawaitable` " +"to detect them." msgstr "" -#: ../../library/collections.abc.rst:335 +#: ../../library/collections.abc.rst:348 msgid "" "ABC for :term:`coroutine` compatible classes. These implement the following " "methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:" @@ -659,63 +679,63 @@ msgid "" "instances are also instances of :class:`Awaitable`." msgstr "" -#: ../../library/collections.abc.rst:343 +#: ../../library/collections.abc.rst:356 msgid "" "In CPython, generator-based coroutines (:term:`generators ` " -"decorated with :func:`@types.coroutine `) are *awaitables*, " -"even though they do not have an :meth:`~object.__await__` method. Using " -"``isinstance(gencoro, Coroutine)`` for them will return ``False``. Use :func:" -"`inspect.isawaitable` to detect them." +"decorated with :deco:`types.coroutine`) are *awaitables*, even though they " +"do not have an :meth:`~object.__await__` method. Using ``isinstance(gencoro, " +"Coroutine)`` for them will return ``False``. Use :func:`inspect.isawaitable` " +"to detect them." msgstr "" -#: ../../library/collections.abc.rst:349 +#: ../../library/collections.abc.rst:362 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`!Coroutine` in type annotations. The variance and order of type parameters " "correspond to those of :class:`Generator`." msgstr "" -#: ../../library/collections.abc.rst:358 +#: ../../library/collections.abc.rst:371 msgid "" "ABC for classes that provide an ``__aiter__`` method. See also the " "definition of :term:`asynchronous iterable`." msgstr "" -#: ../../library/collections.abc.rst:365 +#: ../../library/collections.abc.rst:378 msgid "" "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " "also the definition of :term:`asynchronous iterator`." msgstr "" -#: ../../library/collections.abc.rst:372 +#: ../../library/collections.abc.rst:385 msgid "" "ABC for :term:`asynchronous generator` classes that implement the protocol " "defined in :pep:`525` and :pep:`492`." msgstr "" -#: ../../library/collections.abc.rst:375 +#: ../../library/collections.abc.rst:388 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`!AsyncGenerator` in type annotations." msgstr "" -#: ../../library/collections.abc.rst:382 +#: ../../library/collections.abc.rst:395 msgid "" "ABC for classes that provide the :meth:`~object.__buffer__` method, " "implementing the :ref:`buffer protocol `. See :pep:`688`." msgstr "" -#: ../../library/collections.abc.rst:388 +#: ../../library/collections.abc.rst:401 msgid "Examples and Recipes" msgstr "" -#: ../../library/collections.abc.rst:390 +#: ../../library/collections.abc.rst:403 msgid "" "ABCs allow us to ask classes or instances if they provide particular " "functionality, for example::" msgstr "" -#: ../../library/collections.abc.rst:393 +#: ../../library/collections.abc.rst:406 msgid "" "size = None\n" "if isinstance(myvar, collections.abc.Sized):\n" @@ -725,7 +745,7 @@ msgstr "" "if isinstance(myvar, collections.abc.Sized):\n" " size = len(myvar)" -#: ../../library/collections.abc.rst:397 +#: ../../library/collections.abc.rst:410 msgid "" "Several of the ABCs are also useful as mixins that make it easier to develop " "classes supporting container APIs. For example, to write a class supporting " @@ -735,7 +755,7 @@ msgid "" "methods such as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::" msgstr "" -#: ../../library/collections.abc.rst:404 +#: ../../library/collections.abc.rst:417 msgid "" "class ListBasedSet(collections.abc.Set):\n" " ''' Alternate set implementation favoring space over speed\n" @@ -761,11 +781,11 @@ msgid "" "automatically" msgstr "" -#: ../../library/collections.abc.rst:426 +#: ../../library/collections.abc.rst:439 msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "" -#: ../../library/collections.abc.rst:429 +#: ../../library/collections.abc.rst:442 msgid "" "Since some set operations create new sets, the default mixin methods need a " "way to create new instances from an :term:`iterable`. The class constructor " @@ -778,14 +798,14 @@ msgid "" "iterable argument." msgstr "" -#: ../../library/collections.abc.rst:440 +#: ../../library/collections.abc.rst:453 msgid "" "To override the comparisons (presumably for speed, as the semantics are " "fixed), redefine :meth:`~object.__le__` and :meth:`~object.__ge__`, then the " "other operations will automatically follow suit." msgstr "" -#: ../../library/collections.abc.rst:446 +#: ../../library/collections.abc.rst:459 msgid "" "The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash " "value for the set; however, :meth:`~object.__hash__` is not defined because " @@ -794,12 +814,12 @@ msgid "" "define ``__hash__ = Set._hash``." msgstr "" -#: ../../library/collections.abc.rst:454 +#: ../../library/collections.abc.rst:467 msgid "" "`OrderedSet recipe `_ for an " "example built on :class:`MutableSet`." msgstr "" -#: ../../library/collections.abc.rst:457 +#: ../../library/collections.abc.rst:470 msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." msgstr "關於 ABC 的更多資訊請見 :mod:`abc` module 和 :pep:`3119`。" diff --git a/library/compression.po b/library/compression.po index 8bedbc98d6..12e02613ad 100644 --- a/library/compression.po +++ b/library/compression.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-05 00:16+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,7 +20,7 @@ msgstr "" msgid "The :mod:`!compression` package" msgstr ":mod:`!compression` 套件" -#: ../../library/compression.rst:6 +#: ../../library/compression.rst:8 msgid "" "The :mod:`!compression` package contains the canonical compression modules " "containing interfaces to several different compression algorithms. Some of " @@ -30,23 +30,23 @@ msgid "" "modules in :mod:`!compression` is encouraged where practical." msgstr "" -#: ../../library/compression.rst:13 +#: ../../library/compression.rst:15 msgid ":mod:`!compression.bz2` -- Re-exports :mod:`bz2`" msgstr "" -#: ../../library/compression.rst:14 +#: ../../library/compression.rst:16 msgid ":mod:`!compression.gzip` -- Re-exports :mod:`gzip`" msgstr "" -#: ../../library/compression.rst:15 +#: ../../library/compression.rst:17 msgid ":mod:`!compression.lzma` -- Re-exports :mod:`lzma`" msgstr "" -#: ../../library/compression.rst:16 +#: ../../library/compression.rst:18 msgid ":mod:`!compression.zlib` -- Re-exports :mod:`zlib`" msgstr "" -#: ../../library/compression.rst:17 +#: ../../library/compression.rst:19 msgid "" ":mod:`compression.zstd` -- Wrapper for the Zstandard compression library" msgstr "" diff --git a/library/crypt.po b/library/crypt.po index b8cf2e9438..89ad6c3321 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-18 00:15+0000\n" +"POT-Creation-Date: 2025-10-10 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,11 +31,12 @@ msgstr "" "`594` 中決定的。" #: ../../library/crypt.rst:14 +#, fuzzy msgid "" "Applications can use the :mod:`hashlib` module from the standard library. " "Other possible replacements are third-party libraries from PyPI: :pypi:" -"`legacycrypt`, :pypi:`bcrypt`, :pypi:`argon2-cffi`, or :pypi:`passlib`. " -"These are not supported or maintained by the Python core team." +"`legacycrypt`, :pypi:`bcrypt`, or :pypi:`argon2-cffi`. These are not " +"supported or maintained by the Python core team." msgstr "" "應用程式可以改用標準函式庫中的 :mod:`hashlib` 模組。其他可能的替代方案是 " "PyPI 上的第三方庫::pypi:`legacycrypt`、:pypi:`bcrypt`、:pypi:`argon2-cffi` " diff --git a/library/csv.po b/library/csv.po index 300da9c590..377a9de593 100644 --- a/library/csv.po +++ b/library/csv.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-10-09 00:15+0000\n" "PO-Revision-Date: 2023-11-08 15:06+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -122,8 +122,8 @@ msgstr "" "`QUOTE_NONNUMERIC` 有被指定(在這個情況之下,沒有引號的欄位都會被轉換成浮點" "數),否則不會進行自動資料型別轉換。" -#: ../../library/csv.rst:76 ../../library/csv.rst:106 ../../library/csv.rst:181 -#: ../../library/csv.rst:219 +#: ../../library/csv.rst:76 ../../library/csv.rst:106 ../../library/csv.rst:182 +#: ../../library/csv.rst:220 msgid "A short usage example::" msgstr "一個簡短的用法範例: ::" @@ -228,7 +228,7 @@ msgstr "" msgid "Return the names of all registered dialects." msgstr "回傳所有已註冊的 dialect 名稱。" -#: ../../library/csv.rst:144 +#: ../../library/csv.rst:145 msgid "" "Returns the current maximum field size allowed by the parser. If *new_limit* " "is given, this becomes the new limit." @@ -236,11 +236,11 @@ msgstr "" "回傳目前的剖析器 (parser) 允許的最大字串大小。如果 *new_limit* 被給定,則會變" "成新的最大字串大小。" -#: ../../library/csv.rst:148 +#: ../../library/csv.rst:149 msgid "The :mod:`csv` module defines the following classes:" msgstr ":mod:`csv` 模組定義了下列的類別:" -#: ../../library/csv.rst:153 +#: ../../library/csv.rst:154 msgid "" "Create an object that operates like a regular reader but maps the " "information in each row to a :class:`dict` whose keys are given by the " @@ -249,7 +249,7 @@ msgstr "" "建立一個物件,其運作上就像一般的讀取器,但可以將每一列資訊 map (對映) 到 :" "class:`dict` 中,可以透過選填的參數 *fieldnames* 設定 key。" -#: ../../library/csv.rst:157 +#: ../../library/csv.rst:158 msgid "" "The *fieldnames* parameter is a :term:`sequence`. If *fieldnames* is " "omitted, the values in the first row of file *f* will be used as the " @@ -263,7 +263,7 @@ msgstr "" "供,它們就會被使用,且第一列會被包含在結果中。不管欄位標題是如何決定的," "dictionary 都會保留原始的排序。" -#: ../../library/csv.rst:164 +#: ../../library/csv.rst:165 msgid "" "If a row has more fields than fieldnames, the remaining data is put in a " "list and stored with the fieldname specified by *restkey* (which defaults to " @@ -275,28 +275,28 @@ msgstr "" "``None``)特指的欄位標題會放入列表當中並儲存。如果一個非空的 (non-blank) 列中" "的欄位比欄位標題還少,缺少的值則會填入 *restval* (預設為 ``None``)的值。" -#: ../../library/csv.rst:170 +#: ../../library/csv.rst:171 msgid "" "All other optional or keyword arguments are passed to the underlying :class:" "`reader` instance." msgstr "所有其他選填的引數或關鍵字引數皆會傳遞至下層的 :class:`reader` 實例。" -#: ../../library/csv.rst:173 ../../library/csv.rst:217 +#: ../../library/csv.rst:174 ../../library/csv.rst:218 msgid "" "If the argument passed to *fieldnames* is an iterator, it will be coerced to " "a :class:`list`." msgstr "" "如果傳遞至 *fieldnames* 的引數是個疊代器,則會被迫成為一個 :class:`list`。" -#: ../../library/csv.rst:175 +#: ../../library/csv.rst:176 msgid "Returned rows are now of type :class:`OrderedDict`." msgstr "回傳的列已成為型別 :class:`OrderedDict`。" -#: ../../library/csv.rst:178 +#: ../../library/csv.rst:179 msgid "Returned rows are now of type :class:`dict`." msgstr "回傳的列已成為型別 :class:`dict`。" -#: ../../library/csv.rst:183 +#: ../../library/csv.rst:184 msgid "" ">>> import csv\n" ">>> with open('names.csv', newline='') as csvfile:\n" @@ -322,7 +322,7 @@ msgstr "" ">>> print(row)\n" "{'first_name': 'John', 'last_name': 'Cleese'}" -#: ../../library/csv.rst:199 +#: ../../library/csv.rst:200 msgid "" "Create an object which operates like a regular writer but maps dictionaries " "onto output rows. The *fieldnames* parameter is a :mod:`sequence " @@ -347,7 +347,7 @@ msgstr "" "被設定為 ``'ignore'``,dictionary 中額外的值會被忽略。其他選填的引數或關鍵字" "引數皆會傳遞至下層的 :class:`writer` 實例。" -#: ../../library/csv.rst:214 +#: ../../library/csv.rst:215 msgid "" "Note that unlike the :class:`DictReader` class, the *fieldnames* parameter " "of the :class:`DictWriter` class is not optional." @@ -355,7 +355,7 @@ msgstr "" "請記得這不像類別 :class:`DictReader`,在類別 :class:`DictWriter` 中,參數 " "*fieldnames* 並不是選填的。" -#: ../../library/csv.rst:221 +#: ../../library/csv.rst:222 msgid "" "import csv\n" "\n" @@ -379,7 +379,7 @@ msgstr "" " writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})\n" " writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})" -#: ../../library/csv.rst:235 +#: ../../library/csv.rst:236 msgid "" "The :class:`Dialect` class is a container class whose attributes contain " "information for how to handle doublequotes, whitespace, delimiters, etc. Due " @@ -392,7 +392,7 @@ msgstr "" "巧妙不同的 CSV 資料。:class:`Dialect` 實例定義了 :class:`reader` 以及 :class:" "`writer` 的實例該如何表示。" -#: ../../library/csv.rst:241 +#: ../../library/csv.rst:242 msgid "" "All available :class:`Dialect` names are returned by :func:`list_dialects`, " "and they can be registered with specific :class:`reader` and :class:`writer` " @@ -402,7 +402,7 @@ msgstr "" "透過特定 :class:`reader` 及 :class:`writer` 類別的初始器 (initializer, " "``__init__``) 函式進行註冊,就像這樣: ::" -#: ../../library/csv.rst:245 +#: ../../library/csv.rst:246 msgid "" "import csv\n" "\n" @@ -414,7 +414,7 @@ msgstr "" "with open('students.csv', 'w', newline='') as csvfile:\n" " writer = csv.writer(csvfile, dialect='unix')" -#: ../../library/csv.rst:253 +#: ../../library/csv.rst:254 msgid "" "The :class:`excel` class defines the usual properties of an Excel-generated " "CSV file. It is registered with the dialect name ``'excel'``." @@ -422,7 +422,7 @@ msgstr "" "類別 :class:`excel` 定義了透過 Excel 產生的 CSV 檔案的慣用屬性。它被註冊的 " "dialect 名稱為 ``'excel'``。" -#: ../../library/csv.rst:259 +#: ../../library/csv.rst:260 msgid "" "The :class:`excel_tab` class defines the usual properties of an Excel-" "generated TAB-delimited file. It is registered with the dialect name " @@ -431,7 +431,7 @@ msgstr "" "類別 :class:`excel_tab` 定義了透過 Excel 產生並以 Tab 作為分隔的 CSV 檔案的慣" "用屬性。它被註冊的 dialect 名稱為 ``'excel-tab'``。" -#: ../../library/csv.rst:265 +#: ../../library/csv.rst:266 msgid "" "The :class:`unix_dialect` class defines the usual properties of a CSV file " "generated on UNIX systems, i.e. using ``'\\n'`` as line terminator and " @@ -441,15 +441,15 @@ msgstr "" "句話說,使用 ``'\\n'`` 作為換行符號且所有欄位都被引號包覆起來。它被註冊的 " "dialect 名稱為 ``'unix'``。" -#: ../../library/csv.rst:274 +#: ../../library/csv.rst:275 msgid "The :class:`Sniffer` class is used to deduce the format of a CSV file." msgstr "類別 :class:`Sniffer` 被用來推斷 CSV 檔案的格式。" -#: ../../library/csv.rst:276 +#: ../../library/csv.rst:277 msgid "The :class:`Sniffer` class provides two methods:" msgstr "類別 :class:`Sniffer` 提供了兩個 method:" -#: ../../library/csv.rst:280 +#: ../../library/csv.rst:281 msgid "" "Analyze the given *sample* and return a :class:`Dialect` subclass reflecting " "the parameters found. If the optional *delimiters* parameter is given, it " @@ -459,7 +459,7 @@ msgstr "" "數。如果給定選填的參數 *delimiters*,它會被解釋為一個字串且含有可能、有效的分" "隔字元。" -#: ../../library/csv.rst:288 +#: ../../library/csv.rst:289 msgid "" "Analyze the sample text (presumed to be in CSV format) and return :const:" "`True` if the first row appears to be a series of column headers. Inspecting " @@ -470,18 +470,18 @@ msgstr "" "格式)並回傳 :const:`True`。檢查每一欄時,會考慮是否滿足兩個關鍵標準其中之" "一,判斷 sample 是否包含標題:" -#: ../../library/csv.rst:293 +#: ../../library/csv.rst:294 msgid "the second through n-th rows contain numeric values" msgstr "第二列至第 n 列包含數字" -#: ../../library/csv.rst:294 +#: ../../library/csv.rst:295 msgid "" "the second through n-th rows contain strings where at least one value's " "length differs from that of the putative header of that column." msgstr "" "第二列到第 n 列包含的字串中至少有一個值的長度與該行的假定標題的長度不同。" -#: ../../library/csv.rst:297 +#: ../../library/csv.rst:298 msgid "" "Twenty rows after the first row are sampled; if more than half of columns + " "rows meet the criteria, :const:`True` is returned." @@ -489,7 +489,7 @@ msgstr "" "對第一列之後的二十個列進行取樣;如果超過一半的行及列滿足條件,則返回 :const:" "`True`。" -#: ../../library/csv.rst:302 +#: ../../library/csv.rst:303 msgid "" "This method is a rough heuristic and may produce both false positives and " "negatives." @@ -497,11 +497,11 @@ msgstr "" "此方法是一個粗略的啟發,可能會產生偽陽性及偽陰性 (false positives and " "negatives)。" -#: ../../library/csv.rst:305 +#: ../../library/csv.rst:306 msgid "An example for :class:`Sniffer` use::" msgstr "一個 :class:`Sniffer` 的使用範例: ::" -#: ../../library/csv.rst:307 +#: ../../library/csv.rst:308 msgid "" "with open('example.csv', newline='') as csvfile:\n" " dialect = csv.Sniffer().sniff(csvfile.read(1024))\n" @@ -515,15 +515,15 @@ msgstr "" " reader = csv.reader(csvfile, dialect)\n" " # ... 在這邊處理 CSV 檔案 ..." -#: ../../library/csv.rst:316 +#: ../../library/csv.rst:317 msgid "The :mod:`csv` module defines the following constants:" msgstr ":mod:`csv` 模組定義了以下常數:" -#: ../../library/csv.rst:320 +#: ../../library/csv.rst:321 msgid "Instructs :class:`writer` objects to quote all fields." msgstr "引導 :class:`writer` 物件引用所有欄位。" -#: ../../library/csv.rst:325 +#: ../../library/csv.rst:326 msgid "" "Instructs :class:`writer` objects to only quote those fields which contain " "special characters such as *delimiter*, *quotechar*, ``'\\r'``, ``'\\n'`` or " @@ -532,17 +532,17 @@ msgstr "" "引導 :class:`writer` 物件只引用包含特殊字元的欄位,例如:*delimiter*、" "*quotechar*、``'\\r'``、``'\\n'`` 或是 *lineterminator* 的其他字元。" -#: ../../library/csv.rst:332 +#: ../../library/csv.rst:333 msgid "Instructs :class:`writer` objects to quote all non-numeric fields." msgstr "引導 :class:`writer` 物件引用所有非數字的欄位。" -#: ../../library/csv.rst:334 +#: ../../library/csv.rst:335 msgid "" "Instructs :class:`reader` objects to convert all non-quoted fields to type :" "class:`float`." msgstr "引導 :class:`reader` 物件轉換所有非引用的欄位為 :class:`float`。" -#: ../../library/csv.rst:337 +#: ../../library/csv.rst:338 msgid "" "Some numeric types, such as :class:`bool`, :class:`~fractions.Fraction`, or :" "class:`~enum.IntEnum`, have a string representation that cannot be converted " @@ -550,7 +550,7 @@ msgid "" "data:`QUOTE_STRINGS` modes." msgstr "" -#: ../../library/csv.rst:345 +#: ../../library/csv.rst:346 msgid "" "Instructs :class:`writer` objects to never quote fields. When the current " "*delimiter*, *quotechar*, *escapechar*, ``'\\r'``, ``'\\n'`` or any of the " @@ -564,13 +564,13 @@ msgstr "" "前的字元是目前的 *escapechar*。如果沒有設定 *escapechar*,若遇到任何字元需要" "逸出,寫入器則會引發 :exc:`Error`。設定 *quotechar* 為 ``None`` 以防止逸出。" -#: ../../library/csv.rst:353 +#: ../../library/csv.rst:354 msgid "" "Instructs :class:`reader` objects to perform no special processing of quote " "characters." msgstr "引導 :class:`reader` 物件不對引號進行特別處理。" -#: ../../library/csv.rst:357 +#: ../../library/csv.rst:358 msgid "" "Instructs :class:`writer` objects to quote all fields which are not " "``None``. This is similar to :data:`QUOTE_ALL`, except that if a field " @@ -579,7 +579,7 @@ msgstr "" "引導 :class:`writer` 物件引用所有非 ``None`` 的欄位。這與 :data:`QUOTE_ALL` " "相似,除非如果欄位值為 ``None``,該欄位則被寫成空(沒有引號)字串。" -#: ../../library/csv.rst:361 +#: ../../library/csv.rst:362 msgid "" "Instructs :class:`reader` objects to interpret an empty (unquoted) field as " "``None`` and to otherwise behave as :data:`QUOTE_ALL`." @@ -587,7 +587,7 @@ msgstr "" "引導 :class:`reader` 物件將空(沒有引號)欄位直譯 (interpret) 為 ``None``,否" "則會和 :data:`QUOTE_ALL` 有相同的表現方式。" -#: ../../library/csv.rst:368 +#: ../../library/csv.rst:369 msgid "" "Instructs :class:`writer` objects to always place quotes around fields which " "are strings. This is similar to :data:`QUOTE_NONNUMERIC`, except that if a " @@ -597,7 +597,7 @@ msgstr "" "`QUOTE_NONNUMERIC` 相似,除非如果欄位值為 ``None``,該欄位則被寫成空(沒有引" "號)字串。" -#: ../../library/csv.rst:372 +#: ../../library/csv.rst:373 msgid "" "Instructs :class:`reader` objects to interpret an empty (unquoted) string as " "``None`` and to otherwise behave as :data:`QUOTE_NONNUMERIC`." @@ -605,19 +605,19 @@ msgstr "" "引導 :class:`reader` 物件將空(沒有引號)字串直譯為 ``None``,否則會和 :data:" "`QUOTE_ALL` 有相同的表現方式。" -#: ../../library/csv.rst:377 +#: ../../library/csv.rst:378 msgid "The :mod:`csv` module defines the following exception:" msgstr ":mod:`csv` 模組定義下列例外:" -#: ../../library/csv.rst:382 +#: ../../library/csv.rst:383 msgid "Raised by any of the functions when an error is detected." msgstr "當偵測到錯誤時,任何函式都可以引發。" -#: ../../library/csv.rst:387 +#: ../../library/csv.rst:388 msgid "Dialects and Formatting Parameters" msgstr "Dialect 與格式參數" -#: ../../library/csv.rst:389 +#: ../../library/csv.rst:390 msgid "" "To make it easier to specify the format of input and output records, " "specific formatting parameters are grouped together into dialects. A " @@ -636,16 +636,16 @@ msgstr "" "代,在\\ *dialect*\\ 參數中,程式設計師可以指定個別的格式化參數,其與 :class:" "`Dialect` 類別定義的屬性具有相同的名字。" -#: ../../library/csv.rst:399 +#: ../../library/csv.rst:400 msgid "Dialects support the following attributes:" msgstr "Dialect 支援下列屬性:" -#: ../../library/csv.rst:404 +#: ../../library/csv.rst:405 msgid "" "A one-character string used to separate fields. It defaults to ``','``." msgstr "一個單一字元 (one-character) 的字串可已用來分割欄位。預設為 ``','``。" -#: ../../library/csv.rst:409 +#: ../../library/csv.rst:410 msgid "" "Controls how instances of *quotechar* appearing inside a field should " "themselves be quoted. When :const:`True`, the character is doubled. When :" @@ -656,7 +656,7 @@ msgstr "" "為 :const:`True`,字元會是雙引號。若為 :const:`False`,在 *quotechar* 之前會" "先使用 *escapechar* 作為前綴字。預設為 :const:`True`。" -#: ../../library/csv.rst:414 +#: ../../library/csv.rst:415 msgid "" "On output, if *doublequote* is :const:`False` and no *escapechar* is set, :" "exc:`Error` is raised if a *quotechar* is found in a field." @@ -664,28 +664,28 @@ msgstr "" "在輸出時,若 *doublequote* 是 :const:`False` 且\\ *逸出字元*\\ 沒有被設定,當" "一個\\ *引號*\\ 在欄位中被發現時,:exc:`Error` 會被引發。" -#: ../../library/csv.rst:420 +#: ../../library/csv.rst:421 msgid "" "A one-character string used by the writer to escape characters that require " "escaping:" msgstr "一個單一字元的字串,會被寫入器用來逸出需要逸出的字元:" -#: ../../library/csv.rst:423 +#: ../../library/csv.rst:424 msgid "" "the *delimiter*, the *quotechar*, ``'\\r'``, ``'\\n'`` and any of the " "characters in *lineterminator* are escaped if *quoting* is set to :const:" "`QUOTE_NONE`;" msgstr "" -#: ../../library/csv.rst:426 +#: ../../library/csv.rst:427 msgid "the *quotechar* is escaped if *doublequote* is :const:`False`;" msgstr "" -#: ../../library/csv.rst:427 +#: ../../library/csv.rst:428 msgid "the *escapechar* itself." msgstr "*escapechar* 本身。" -#: ../../library/csv.rst:429 +#: ../../library/csv.rst:430 msgid "" "On reading, the *escapechar* removes any special meaning from the following " "character. It defaults to :const:`None`, which disables escaping." @@ -693,17 +693,17 @@ msgstr "" "在讀取時,*escapechar* 會移除後面字元的任何特殊意義。預設為 :const:`None`,表" "示禁止逸出。" -#: ../../library/csv.rst:432 +#: ../../library/csv.rst:433 msgid "An empty *escapechar* is not allowed." msgstr "*escapechar* 為空是不被接受的。" -#: ../../library/csv.rst:437 +#: ../../library/csv.rst:438 msgid "" "The string used to terminate lines produced by the :class:`writer`. It " "defaults to ``'\\r\\n'``." msgstr "由 :class:`writer` 產生被用來分行的字串。預設為 ``'\\r\\n'``。" -#: ../../library/csv.rst:442 +#: ../../library/csv.rst:443 msgid "" "The :class:`reader` is hard-coded to recognise either ``'\\r'`` or ``'\\n'`` " "as end-of-line, and ignores *lineterminator*. This behavior may change in " @@ -712,7 +712,7 @@ msgstr "" ":class:`reader` 是 hard-coded 辨別 ``'\\r'`` or ``'\\n'`` 作為行尾 (end-of-" "line),並忽略\\ *lineterminator*。未來可能會改變這個行為。" -#: ../../library/csv.rst:449 +#: ../../library/csv.rst:450 msgid "" "A one-character string used to quote fields containing special characters, " "such as the *delimiter* or the *quotechar*, or which contain new-line " @@ -725,11 +725,11 @@ msgstr "" "元)。預設為 ``'\"'``。如果 *quoting* 設定為 :const:`QUOTE_NONE`,可以設定為 " "``None`` 以防止逸出 ``'\"'``。" -#: ../../library/csv.rst:456 +#: ../../library/csv.rst:457 msgid "An empty *quotechar* is not allowed." msgstr "*quotechar* 為空是不被允許的。" -#: ../../library/csv.rst:461 +#: ../../library/csv.rst:462 msgid "" "Controls when quotes should be generated by the writer and recognised by the " "reader. It can take on any of the :ref:`QUOTE_\\* constants `\\ 且預設為 :" "const:`QUOTE_MINIMAL`。否則預設為 :const:`QUOTE_NONE`。" -#: ../../library/csv.rst:469 +#: ../../library/csv.rst:470 msgid "" "When :const:`True`, spaces immediately following the *delimiter* are " "ignored. The default is :const:`False`. When combining ``delimiter=' '`` " "with ``skipinitialspace=True``, unquoted empty fields are not allowed." msgstr "" "若為 :const:`True`,在緊接著\\ *delimiter*\\ 後的空格會被忽略。預設為 :const:" -"`False`。當結合 ``delimiter=' '`` 與 ``skipinitialspace=True`` 時,不允許沒有引號的空欄位。" +"`False`。當結合 ``delimiter=' '`` 與 ``skipinitialspace=True`` 時,不允許沒有" +"引號的空欄位。" -#: ../../library/csv.rst:476 +#: ../../library/csv.rst:477 msgid "" "When ``True``, raise exception :exc:`Error` on bad CSV input. The default is " "``False``." msgstr "" "若為 ``True``,若有錯誤的 CSV 輸入則會引發 :exc:`Error`。預設為 ``False``。" -#: ../../library/csv.rst:482 +#: ../../library/csv.rst:483 msgid "Reader Objects" msgstr "讀取器物件" -#: ../../library/csv.rst:484 +#: ../../library/csv.rst:485 msgid "" "Reader objects (:class:`DictReader` instances and objects returned by the :" "func:`reader` function) have the following public methods:" @@ -768,7 +769,7 @@ msgstr "" "讀取器物件(:func:`reader` 函式回傳的 :class:`DictReader` 實例與物件)有下列" "公開方法 (public method):" -#: ../../library/csv.rst:489 +#: ../../library/csv.rst:490 msgid "" "Return the next row of the reader's iterable object as a list (if the object " "was returned from :func:`reader`) or a dict (if it is a :class:`DictReader` " @@ -779,25 +780,25 @@ msgstr "" "傳)或是一個 dict(若為 :class:`DictReader` 實例),會依據目前的 :class:" "`Dialect` 進行剖析。通常會用 ``next(reader)`` 來進行呼叫。" -#: ../../library/csv.rst:495 +#: ../../library/csv.rst:496 msgid "Reader objects have the following public attributes:" msgstr "讀取器物件有下列公開屬性 (public attributes):" -#: ../../library/csv.rst:499 +#: ../../library/csv.rst:500 msgid "A read-only description of the dialect in use by the parser." msgstr "dialect 的唯讀敘述,會被剖析器使用。" -#: ../../library/csv.rst:504 +#: ../../library/csv.rst:505 msgid "" "The number of lines read from the source iterator. This is not the same as " "the number of records returned, as records can span multiple lines." msgstr "來源疊代器所讀取的行數。這與回傳的紀錄數不同,因為可以進行跨行紀錄。" -#: ../../library/csv.rst:508 +#: ../../library/csv.rst:509 msgid "DictReader objects have the following public attribute:" msgstr "DictReader 物件有下列公開屬性:" -#: ../../library/csv.rst:512 +#: ../../library/csv.rst:513 msgid "" "If not passed as a parameter when creating the object, this attribute is " "initialized upon first access or when the first record is read from the file." @@ -805,11 +806,11 @@ msgstr "" "若在建立物件時沒有作為參數傳遞,這個屬性會在第一次存取之前或是第一筆資料被讀" "取之前進行初始化 (initialize)。" -#: ../../library/csv.rst:519 +#: ../../library/csv.rst:520 msgid "Writer Objects" msgstr "寫入器物件" -#: ../../library/csv.rst:521 +#: ../../library/csv.rst:522 msgid "" ":class:`writer` objects (:class:`DictWriter` instances and objects returned " "by the :func:`writer` function) have the following public methods. A *row* " @@ -827,7 +828,7 @@ msgstr "" "遞)。請注意,在寫入複數 (complex number) 時會用小括號 (parens) 包起來。這可" "能在其他程式讀取 CSV 檔案時導致某些問題(假設他們完全支援複雜數字)。" -#: ../../library/csv.rst:532 +#: ../../library/csv.rst:533 msgid "" "Write the *row* parameter to the writer's file object, formatted according " "to the current :class:`Dialect`. Return the return value of the call to the " @@ -836,11 +837,11 @@ msgstr "" "將參數 *row* 寫入至寫入器的檔案物件中,並依照目前的 :class:`Dialect` 進行格式" "化。回傳下層檔案物件 *write* 方法的回傳值。" -#: ../../library/csv.rst:536 +#: ../../library/csv.rst:537 msgid "Added support of arbitrary iterables." msgstr "新增對任意可疊代物件 (arbitrary iterables) 的支援。" -#: ../../library/csv.rst:541 +#: ../../library/csv.rst:542 msgid "" "Write all elements in *rows* (an iterable of *row* objects as described " "above) to the writer's file object, formatted according to the current " @@ -849,19 +850,19 @@ msgstr "" "將 *rows* 中所有元素(為上述的一個可疊代的 *row* 物件)寫入至寫入器的檔案物件" "中,並依照目前的 dialect 進行格式化。" -#: ../../library/csv.rst:545 +#: ../../library/csv.rst:546 msgid "Writer objects have the following public attribute:" msgstr "寫入器物件有下列公開屬性:" -#: ../../library/csv.rst:550 +#: ../../library/csv.rst:551 msgid "A read-only description of the dialect in use by the writer." msgstr "dialect 的唯讀敘述,會被寫入器使用。" -#: ../../library/csv.rst:553 +#: ../../library/csv.rst:554 msgid "DictWriter objects have the following public method:" msgstr "DictWriter 物件有下列公開方法:" -#: ../../library/csv.rst:558 +#: ../../library/csv.rst:559 msgid "" "Write a row with the field names (as specified in the constructor) to the " "writer's file object, formatted according to the current dialect. Return the " @@ -871,7 +872,7 @@ msgstr "" "中,並依照目前的 dialect 進行格式化。回傳內部呼叫 :meth:`csvwriter.writerow` " "的回傳值。" -#: ../../library/csv.rst:563 +#: ../../library/csv.rst:564 msgid "" ":meth:`writeheader` now also returns the value returned by the :meth:" "`csvwriter.writerow` method it uses internally." @@ -879,15 +880,15 @@ msgstr "" ":meth:`writeheader` 現在也會回傳內部呼叫 :meth:`csvwriter.writerow` 的回傳" "值。" -#: ../../library/csv.rst:571 +#: ../../library/csv.rst:572 msgid "Examples" msgstr "範例" -#: ../../library/csv.rst:573 +#: ../../library/csv.rst:574 msgid "The simplest example of reading a CSV file::" msgstr "最簡單的讀取 CSV 檔案範例: ::" -#: ../../library/csv.rst:575 +#: ../../library/csv.rst:576 msgid "" "import csv\n" "with open('some.csv', newline='') as f:\n" @@ -901,11 +902,11 @@ msgstr "" " for row in reader:\n" " print(row)" -#: ../../library/csv.rst:581 +#: ../../library/csv.rst:582 msgid "Reading a file with an alternate format::" msgstr "讀取一個其他格式的檔案: ::" -#: ../../library/csv.rst:583 +#: ../../library/csv.rst:584 msgid "" "import csv\n" "with open('passwd', newline='') as f:\n" @@ -919,11 +920,11 @@ msgstr "" " for row in reader:\n" " print(row)" -#: ../../library/csv.rst:589 +#: ../../library/csv.rst:590 msgid "The corresponding simplest possible writing example is::" msgstr "相對最簡單、可行的寫入範例為: ::" -#: ../../library/csv.rst:591 +#: ../../library/csv.rst:592 msgid "" "import csv\n" "with open('some.csv', 'w', newline='') as f:\n" @@ -931,7 +932,7 @@ msgid "" " writer.writerows(someiterable)" msgstr "" -#: ../../library/csv.rst:596 +#: ../../library/csv.rst:597 msgid "" "Since :func:`open` is used to open a CSV file for reading, the file will by " "default be decoded into unicode using the system default encoding (see :func:" @@ -942,7 +943,7 @@ msgstr "" "碼格式(請見 :func:`locale.getencoding`),並解碼為 unicode。若要使用不同編碼" "格式進行檔案解碼,請使用 open 函式的 ``encoding`` 引數: ::" -#: ../../library/csv.rst:601 +#: ../../library/csv.rst:602 msgid "" "import csv\n" "with open('some.csv', newline='', encoding='utf-8') as f:\n" @@ -956,7 +957,7 @@ msgstr "" " for row in reader:\n" " print(row)" -#: ../../library/csv.rst:607 +#: ../../library/csv.rst:608 msgid "" "The same applies to writing in something other than the system default " "encoding: specify the encoding argument when opening the output file." @@ -964,11 +965,11 @@ msgstr "" "同理可以應用到使用不同編碼格式進行寫入:當開啟輸出檔案時,指定 ``encoding`` " "引數。" -#: ../../library/csv.rst:610 +#: ../../library/csv.rst:611 msgid "Registering a new dialect::" msgstr "註冊一個新的 dialect : ::" -#: ../../library/csv.rst:612 +#: ../../library/csv.rst:613 msgid "" "import csv\n" "csv.register_dialect('unixpwd', delimiter=':', quoting=csv.QUOTE_NONE)\n" @@ -980,13 +981,13 @@ msgstr "" "with open('passwd', newline='') as f:\n" " reader = csv.reader(f, 'unixpwd')" -#: ../../library/csv.rst:617 +#: ../../library/csv.rst:618 msgid "" "A slightly more advanced use of the reader --- catching and reporting " "errors::" msgstr "稍微進階的讀取器用法 -- 擷取及回報錯誤: ::" -#: ../../library/csv.rst:619 +#: ../../library/csv.rst:620 msgid "" "import csv, sys\n" "filename = 'some.csv'\n" @@ -1008,13 +1009,13 @@ msgstr "" " except csv.Error as e:\n" " sys.exit(f'file {filename}, line {reader.line_num}: {e}')" -#: ../../library/csv.rst:629 +#: ../../library/csv.rst:630 msgid "" "And while the module doesn't directly support parsing strings, it can easily " "be done::" msgstr "而當模組無法直接支援剖析字串時,仍可以輕鬆的解決: ::" -#: ../../library/csv.rst:632 +#: ../../library/csv.rst:633 msgid "" "import csv\n" "for row in csv.reader(['one,two,three']):\n" @@ -1024,11 +1025,11 @@ msgstr "" "for row in csv.reader(['one,two,three']):\n" " print(row)" -#: ../../library/csv.rst:638 +#: ../../library/csv.rst:639 msgid "Footnotes" msgstr "註解" -#: ../../library/csv.rst:639 +#: ../../library/csv.rst:640 msgid "" "If ``newline=''`` is not specified, newlines embedded inside quoted fields " "will not be interpreted correctly, and on platforms that use ``\\r\\n`` line " @@ -1037,9 +1038,9 @@ msgid "" "`universal `) newline handling." msgstr "" "如果 ``newline=''`` 沒有被指定,則嵌入引號中的換行符號不會被正確直譯,使用 " -"``\\r\\n`` 行尾 (line ending) 的平台會寫入額外的 ``\\r``。自從 csv 模組有自己 " -"(:term:`統一的 `) 換行處理方式,因此指定 ``newline=''`` " -"會永遠是安全的。" +"``\\r\\n`` 行尾 (line ending) 的平台會寫入額外的 ``\\r``。自從 csv 模組有自" +"己 (:term:`統一的 `) 換行處理方式,因此指定 " +"``newline=''`` 會永遠是安全的。" #: ../../library/csv.rst:11 msgid "csv" diff --git a/library/ctypes.po b/library/ctypes.po index e930f5d30e..fbc9e9afce 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -47,10 +47,9 @@ msgstr "" #: ../../library/ctypes.rst:27 msgid "" "Note: Some code samples reference the ctypes :class:`c_int` type. On " -"platforms where ``sizeof(long) == sizeof(int)`` it is an alias " -"to :class:`c_long`. So, you should not be confused if :class:`c_long` is " -"printed if you would expect :class:`c_int` --- they are actually the same " -"type." +"platforms where ``sizeof(long) == sizeof(int)`` it is an alias to :class:" +"`c_long`. So, you should not be confused if :class:`c_long` is printed if " +"you would expect :class:`c_int` --- they are actually the same type." msgstr "" #: ../../library/ctypes.rst:35 @@ -76,8 +75,8 @@ msgstr "" #: ../../library/ctypes.rst:48 msgid "" -"Windows errors used to raise :exc:`WindowsError`, which is now an alias " -"of :exc:`OSError`." +"Windows errors used to raise :exc:`WindowsError`, which is now an alias of :" +"exc:`OSError`." msgstr "" #: ../../library/ctypes.rst:53 @@ -209,8 +208,8 @@ msgstr "" #: ../../library/ctypes.rst:125 msgid "" "Sometimes, dlls export functions with names which aren't valid Python " -"identifiers, like ``\"??2@YAPAXI@Z\"``. In this case you have to " -"use :func:`getattr` to retrieve the function::" +"identifiers, like ``\"??2@YAPAXI@Z\"``. In this case you have to use :func:" +"`getattr` to retrieve the function::" msgstr "" #: ../../library/ctypes.rst:129 @@ -364,10 +363,10 @@ msgid "" "``None``, integers, bytes objects and (unicode) strings are the only native " "Python objects that can directly be used as parameters in these function " "calls. ``None`` is passed as a C ``NULL`` pointer, bytes objects and strings " -"are passed as pointer to the memory block that contains their data " -"(:c:expr:`char *` or :c:expr:`wchar_t *`). Python integers are passed as " -"the platform's default C :c:expr:`int` type, their value is masked to fit " -"into the C type." +"are passed as pointer to the memory block that contains their data (:c:expr:" +"`char *` or :c:expr:`wchar_t *`). Python integers are passed as the " +"platform's default C :c:expr:`int` type, their value is masked to fit into " +"the C type." msgstr "" #: ../../library/ctypes.rst:205 @@ -376,7 +375,7 @@ msgid "" "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2430 +#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2426 msgid "Fundamental data types" msgstr "" @@ -768,10 +767,10 @@ msgstr "" #: ../../library/ctypes.rst:322 msgid "" -"Assigning a new value to instances of the pointer " -"types :class:`c_char_p`, :class:`c_wchar_p`, and :class:`c_void_p` changes " -"the *memory location* they point to, *not the contents* of the memory block " -"(of course not, because Python string objects are immutable)::" +"Assigning a new value to instances of the pointer types :class:`c_char_p`, :" +"class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they " +"point to, *not the contents* of the memory block (of course not, because " +"Python string objects are immutable)::" msgstr "" #: ../../library/ctypes.rst:327 @@ -809,11 +808,11 @@ msgstr "" #: ../../library/ctypes.rst:342 msgid "" "You should be careful, however, not to pass them to functions expecting " -"pointers to mutable memory. If you need mutable memory blocks, ctypes has " -"a :func:`create_string_buffer` function which creates these in various " -"ways. The current memory block contents can be accessed (or changed) with " -"the ``raw`` property; if you want to access it as NUL terminated string, use " -"the ``value`` property::" +"pointers to mutable memory. If you need mutable memory blocks, ctypes has a :" +"func:`create_string_buffer` function which creates these in various ways. " +"The current memory block contents can be accessed (or changed) with the " +"``raw`` property; if you want to access it as NUL terminated string, use the " +"``value`` property::" msgstr "" #: ../../library/ctypes.rst:349 @@ -852,9 +851,9 @@ msgstr "" #: ../../library/ctypes.rst:377 msgid "" -"Note that printf prints to the real standard output channel, *not* " -"to :data:`sys.stdout`, so these examples will only work at the console " -"prompt, not from within *IDLE* or *PythonWin*::" +"Note that printf prints to the real standard output channel, *not* to :data:" +"`sys.stdout`, so these examples will only work at the console prompt, not " +"from within *IDLE* or *PythonWin*::" msgstr "" #: ../../library/ctypes.rst:381 @@ -1049,13 +1048,13 @@ msgstr "" msgid "" "If you have defined your own classes which you pass to function calls, you " "have to implement a :meth:`~_CData.from_param` class method for them to be " -"able to use them in the :attr:`~_CFuncPtr.argtypes` sequence. " -"The :meth:`~_CData.from_param` class method receives the Python object " -"passed to the function call, it should do a typecheck or whatever is needed " -"to make sure this object is acceptable, and then return the object itself, " -"its :attr:`!_as_parameter_` attribute, or whatever you want to pass as the C " -"function argument in this case. Again, the result should be an integer, " -"string, bytes, a :mod:`ctypes` instance, or an object with an :attr:`!" +"able to use them in the :attr:`~_CFuncPtr.argtypes` sequence. The :meth:" +"`~_CData.from_param` class method receives the Python object passed to the " +"function call, it should do a typecheck or whatever is needed to make sure " +"this object is acceptable, and then return the object itself, its :attr:`!" +"_as_parameter_` attribute, or whatever you want to pass as the C function " +"argument in this case. Again, the result should be an integer, string, " +"bytes, a :mod:`ctypes` instance, or an object with an :attr:`!" "_as_parameter_` attribute." msgstr "" @@ -1072,10 +1071,9 @@ msgstr "" #: ../../library/ctypes.rst:512 msgid "" -"The C prototype of :c:func:`time` is ``time_t time(time_t *)``. " -"Because :c:type:`time_t` might be of a different type than the default " -"return type :c:expr:`int`, you should specify the :attr:`!restype` " -"attribute::" +"The C prototype of :c:func:`time` is ``time_t time(time_t *)``. Because :c:" +"type:`time_t` might be of a different type than the default return type :c:" +"expr:`int`, you should specify the :attr:`!restype` attribute::" msgstr "" #: ../../library/ctypes.rst:516 @@ -1245,10 +1243,10 @@ msgstr "" #: ../../library/ctypes.rst:601 msgid "" ":mod:`ctypes` exports the :func:`byref` function which is used to pass " -"parameters by reference. The same effect can be achieved with " -"the :func:`pointer` function, although :func:`pointer` does a lot more work " -"since it constructs a real pointer object, so it is faster to " -"use :func:`byref` if you don't need the pointer object in Python itself::" +"parameters by reference. The same effect can be achieved with the :func:" +"`pointer` function, although :func:`pointer` does a lot more work since it " +"constructs a real pointer object, so it is faster to use :func:`byref` if " +"you don't need the pointer object in Python itself::" msgstr "" #: ../../library/ctypes.rst:607 @@ -1283,11 +1281,11 @@ msgstr "" #: ../../library/ctypes.rst:625 msgid "" -"Structures and unions must derive from the :class:`Structure` " -"and :class:`Union` base classes which are defined in the :mod:`ctypes` " -"module. Each subclass must define a :attr:`~Structure._fields_` " -"attribute. :attr:`!_fields_` must be a list of *2-tuples*, containing a " -"*field name* and a *field type*." +"Structures and unions must derive from the :class:`Structure` and :class:" +"`Union` base classes which are defined in the :mod:`ctypes` module. Each " +"subclass must define a :attr:`~Structure._fields_` attribute. :attr:`!" +"_fields_` must be a list of *2-tuples*, containing a *field name* and a " +"*field type*." msgstr "" #: ../../library/ctypes.rst:630 @@ -1392,8 +1390,8 @@ msgstr "" #: ../../library/ctypes.rst:675 msgid "" "Field :term:`descriptor`\\s can be retrieved from the *class*, they are " -"useful for debugging because they can provide useful information. " -"See :class:`CField`::" +"useful for debugging because they can provide useful information. See :class:" +"`CField`::" msgstr "" #: ../../library/ctypes.rst:679 @@ -1432,40 +1430,33 @@ msgstr "" #: ../../library/ctypes.rst:703 msgid "" -"It is possible to specify the maximum alignment for the fields by setting " -"the :attr:`~Structure._pack_` class attribute to a positive integer. This " -"matches what ``#pragma pack(n)`` does in MSVC." -msgstr "" - -#: ../../library/ctypes.rst:707 -msgid "" -"It is also possible to set a minimum alignment for how the subclass itself " -"is packed in the same way ``#pragma align(n)`` works in MSVC. This can be " -"achieved by specifying a :attr:`~Structure._align_` class attribute in the " -"subclass definition." +"It is possible to specify the maximum alignment for the fields and/or for " +"the structure itself by setting the class attributes :attr:`~Structure." +"_pack_` and/or :attr:`~Structure._align_`, respectively. See the attribute " +"documentation for details." msgstr "" -#: ../../library/ctypes.rst:712 +#: ../../library/ctypes.rst:708 msgid "" ":mod:`ctypes` uses the native byte order for Structures and Unions. To " -"build structures with non-native byte order, you can use one of " -"the :class:`BigEndianStructure`, :class:`LittleEndianStructure`, :class:`BigEndianUnion`, " -"and :class:`LittleEndianUnion` base classes. These classes cannot contain " -"pointer fields." +"build structures with non-native byte order, you can use one of the :class:" +"`BigEndianStructure`, :class:`LittleEndianStructure`, :class:" +"`BigEndianUnion`, and :class:`LittleEndianUnion` base classes. These " +"classes cannot contain pointer fields." msgstr "" -#: ../../library/ctypes.rst:722 +#: ../../library/ctypes.rst:718 msgid "Bit fields in structures and unions" msgstr "" -#: ../../library/ctypes.rst:724 +#: ../../library/ctypes.rst:720 msgid "" "It is possible to create structures and unions containing bit fields. Bit " "fields are only possible for integer fields, the bit width is specified as " "the third item in the :attr:`~Structure._fields_` tuples::" msgstr "" -#: ../../library/ctypes.rst:728 +#: ../../library/ctypes.rst:724 msgid "" ">>> class Int(Structure):\n" "... _fields_ = [(\"first_16\", c_int, 16),\n" @@ -1485,7 +1476,7 @@ msgstr "" ">>> print(Int.second_16)\n" "" -#: ../../library/ctypes.rst:737 +#: ../../library/ctypes.rst:733 msgid "" "It is important to note that bit field allocation and layout in memory are " "not defined as a C standard; their implementation is compiler-specific. By " @@ -1494,33 +1485,33 @@ msgid "" "details on the default behavior and how to change it." msgstr "" -#: ../../library/ctypes.rst:748 +#: ../../library/ctypes.rst:744 msgid "Arrays" msgstr "" -#: ../../library/ctypes.rst:750 +#: ../../library/ctypes.rst:746 msgid "" "Arrays are sequences, containing a fixed number of instances of the same " "type." msgstr "" -#: ../../library/ctypes.rst:752 +#: ../../library/ctypes.rst:748 msgid "" "The recommended way to create array types is by multiplying a data type with " "a positive integer::" msgstr "" -#: ../../library/ctypes.rst:755 +#: ../../library/ctypes.rst:751 msgid "TenPointsArrayType = POINT * 10" msgstr "" -#: ../../library/ctypes.rst:757 +#: ../../library/ctypes.rst:753 msgid "" "Here is an example of a somewhat artificial data type, a structure " "containing 4 POINTs among other stuff::" msgstr "" -#: ../../library/ctypes.rst:760 +#: ../../library/ctypes.rst:756 msgid "" ">>> from ctypes import *\n" ">>> class POINT(Structure):\n" @@ -1548,11 +1539,11 @@ msgstr "" "4\n" ">>>" -#: ../../library/ctypes.rst:773 +#: ../../library/ctypes.rst:769 msgid "Instances are created in the usual way, by calling the class::" msgstr "" -#: ../../library/ctypes.rst:775 +#: ../../library/ctypes.rst:771 msgid "" "arr = TenPointsArrayType()\n" "for pt in arr:\n" @@ -1562,17 +1553,17 @@ msgstr "" "for pt in arr:\n" " print(pt.x, pt.y)" -#: ../../library/ctypes.rst:779 +#: ../../library/ctypes.rst:775 msgid "" "The above code print a series of ``0 0`` lines, because the array contents " "is initialized to zeros." msgstr "" -#: ../../library/ctypes.rst:782 +#: ../../library/ctypes.rst:778 msgid "Initializers of the correct type can also be specified::" msgstr "" -#: ../../library/ctypes.rst:784 +#: ../../library/ctypes.rst:780 msgid "" ">>> from ctypes import *\n" ">>> TenIntegers = c_int * 10\n" @@ -1594,17 +1585,17 @@ msgstr "" "1 2 3 4 5 6 7 8 9 10\n" ">>>" -#: ../../library/ctypes.rst:798 +#: ../../library/ctypes.rst:794 msgid "Pointers" msgstr "指標" -#: ../../library/ctypes.rst:800 +#: ../../library/ctypes.rst:796 msgid "" -"Pointer instances are created by calling the :func:`pointer` function on " -"a :mod:`ctypes` type::" +"Pointer instances are created by calling the :func:`pointer` function on a :" +"mod:`ctypes` type::" msgstr "" -#: ../../library/ctypes.rst:803 +#: ../../library/ctypes.rst:799 msgid "" ">>> from ctypes import *\n" ">>> i = c_int(42)\n" @@ -1616,13 +1607,13 @@ msgstr "" ">>> pi = pointer(i)\n" ">>>" -#: ../../library/ctypes.rst:808 +#: ../../library/ctypes.rst:804 msgid "" "Pointer instances have a :attr:`~_Pointer.contents` attribute which returns " "the object to which the pointer points, the ``i`` object above::" msgstr "" -#: ../../library/ctypes.rst:811 +#: ../../library/ctypes.rst:807 msgid "" ">>> pi.contents\n" "c_long(42)\n" @@ -1632,13 +1623,13 @@ msgstr "" "c_long(42)\n" ">>>" -#: ../../library/ctypes.rst:815 +#: ../../library/ctypes.rst:811 msgid "" "Note that :mod:`ctypes` does not have OOR (original object return), it " "constructs a new, equivalent object each time you retrieve an attribute::" msgstr "" -#: ../../library/ctypes.rst:818 +#: ../../library/ctypes.rst:814 msgid "" ">>> pi.contents is i\n" "False\n" @@ -1652,14 +1643,14 @@ msgstr "" "False\n" ">>>" -#: ../../library/ctypes.rst:824 +#: ../../library/ctypes.rst:820 msgid "" "Assigning another :class:`c_int` instance to the pointer's contents " "attribute would cause the pointer to point to the memory location where this " "is stored::" msgstr "" -#: ../../library/ctypes.rst:827 +#: ../../library/ctypes.rst:823 msgid "" ">>> i = c_int(99)\n" ">>> pi.contents = i\n" @@ -1673,11 +1664,11 @@ msgstr "" "c_long(99)\n" ">>>" -#: ../../library/ctypes.rst:836 +#: ../../library/ctypes.rst:832 msgid "Pointer instances can also be indexed with integers::" msgstr "" -#: ../../library/ctypes.rst:838 +#: ../../library/ctypes.rst:834 msgid "" ">>> pi[0]\n" "99\n" @@ -1687,11 +1678,11 @@ msgstr "" "99\n" ">>>" -#: ../../library/ctypes.rst:842 +#: ../../library/ctypes.rst:838 msgid "Assigning to an integer index changes the pointed to value::" msgstr "" -#: ../../library/ctypes.rst:844 +#: ../../library/ctypes.rst:840 msgid "" ">>> print(i)\n" "c_long(99)\n" @@ -1707,7 +1698,7 @@ msgstr "" "c_long(22)\n" ">>>" -#: ../../library/ctypes.rst:851 +#: ../../library/ctypes.rst:847 msgid "" "It is also possible to use indexes different from 0, but you must know what " "you're doing, just as in C: You can access or change arbitrary memory " @@ -1716,7 +1707,7 @@ msgid "" "instead of a single item." msgstr "" -#: ../../library/ctypes.rst:857 +#: ../../library/ctypes.rst:853 msgid "" "Behind the scenes, the :func:`pointer` function does more than simply create " "pointer instances, it has to create pointer *types* first. This is done with " @@ -1724,7 +1715,7 @@ msgid "" "returns a new type::" msgstr "" -#: ../../library/ctypes.rst:862 +#: ../../library/ctypes.rst:858 msgid "" ">>> PI = POINTER(c_int)\n" ">>> PI\n" @@ -1748,13 +1739,13 @@ msgstr "" "\n" ">>>" -#: ../../library/ctypes.rst:873 +#: ../../library/ctypes.rst:869 msgid "" "Calling the pointer type without an argument creates a ``NULL`` pointer. " "``NULL`` pointers have a ``False`` boolean value::" msgstr "" -#: ../../library/ctypes.rst:876 +#: ../../library/ctypes.rst:872 msgid "" ">>> null_ptr = POINTER(c_int)()\n" ">>> print(bool(null_ptr))\n" @@ -1766,13 +1757,13 @@ msgstr "" "False\n" ">>>" -#: ../../library/ctypes.rst:881 +#: ../../library/ctypes.rst:877 msgid "" ":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but " "dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" msgstr "" -#: ../../library/ctypes.rst:884 +#: ../../library/ctypes.rst:880 msgid "" ">>> null_ptr[0]\n" "Traceback (most recent call last):\n" @@ -1798,34 +1789,34 @@ msgstr "" "ValueError: NULL pointer access\n" ">>>" -#: ../../library/ctypes.rst:899 +#: ../../library/ctypes.rst:895 msgid "Thread safety without the GIL" msgstr "" -#: ../../library/ctypes.rst:901 +#: ../../library/ctypes.rst:897 msgid "" "From Python 3.13 onward, the :term:`GIL` can be disabled on :term:`free " "threaded ` builds. In ctypes, reads and writes to a single " "object concurrently is safe, but not across multiple objects:" msgstr "" -#: ../../library/ctypes.rst:904 +#: ../../library/ctypes.rst:900 msgid "" ">>> number = c_int(42)\n" ">>> pointer_a = pointer(number)\n" ">>> pointer_b = pointer(number)" msgstr "" -#: ../../library/ctypes.rst:910 +#: ../../library/ctypes.rst:906 msgid "" "In the above, it's only safe for one object to read and write to the address " "at once if the GIL is disabled. So, ``pointer_a`` can be shared and written " "to across multiple threads, but only if ``pointer_b`` is not also attempting " -"to do the same. If this is an issue, consider using " -"a :class:`threading.Lock` to synchronize access to memory:" +"to do the same. If this is an issue, consider using a :class:`threading." +"Lock` to synchronize access to memory:" msgstr "" -#: ../../library/ctypes.rst:915 +#: ../../library/ctypes.rst:911 msgid "" ">>> import threading\n" ">>> lock = threading.Lock()\n" @@ -1837,11 +1828,11 @@ msgid "" "... pointer_b.contents = 42" msgstr "" -#: ../../library/ctypes.rst:930 +#: ../../library/ctypes.rst:926 msgid "Type conversions" msgstr "" -#: ../../library/ctypes.rst:932 +#: ../../library/ctypes.rst:928 msgid "" "Usually, ctypes does strict type checking. This means, if you have " "``POINTER(c_int)`` in the :attr:`~_CFuncPtr.argtypes` list of a function or " @@ -1852,7 +1843,7 @@ msgid "" "ctypes accepts an array of c_int::" msgstr "" -#: ../../library/ctypes.rst:939 +#: ../../library/ctypes.rst:935 msgid "" ">>> class Bar(Structure):\n" "... _fields_ = [(\"count\", c_int), (\"values\", POINTER(c_int))]\n" @@ -1882,7 +1873,7 @@ msgstr "" "3\n" ">>>" -#: ../../library/ctypes.rst:953 +#: ../../library/ctypes.rst:949 msgid "" "In addition, if a function argument is explicitly declared to be a pointer " "type (such as ``POINTER(c_int)``) in :attr:`~_CFuncPtr.argtypes`, an object " @@ -1891,11 +1882,11 @@ msgid "" "automatically." msgstr "" -#: ../../library/ctypes.rst:958 +#: ../../library/ctypes.rst:954 msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" msgstr "" -#: ../../library/ctypes.rst:960 +#: ../../library/ctypes.rst:956 msgid "" ">>> bar.values = None\n" ">>>" @@ -1903,7 +1894,7 @@ msgstr "" ">>> bar.values = None\n" ">>>" -#: ../../library/ctypes.rst:965 +#: ../../library/ctypes.rst:961 msgid "" "Sometimes you have instances of incompatible types. In C, you can cast one " "type into another type. :mod:`ctypes` provides a :func:`cast` function " @@ -1912,7 +1903,7 @@ msgid "" "``values`` field, but not instances of other types::" msgstr "" -#: ../../library/ctypes.rst:971 +#: ../../library/ctypes.rst:967 msgid "" ">>> bar.values = (c_byte * 4)()\n" "Traceback (most recent call last):\n" @@ -1928,11 +1919,11 @@ msgstr "" "instance\n" ">>>" -#: ../../library/ctypes.rst:977 +#: ../../library/ctypes.rst:973 msgid "For these cases, the :func:`cast` function is handy." msgstr "" -#: ../../library/ctypes.rst:979 +#: ../../library/ctypes.rst:975 msgid "" "The :func:`cast` function can be used to cast a ctypes instance into a " "pointer to a different ctypes data type. :func:`cast` takes two parameters, " @@ -1941,7 +1932,7 @@ msgid "" "references the same memory block as the first argument::" msgstr "" -#: ../../library/ctypes.rst:985 +#: ../../library/ctypes.rst:981 msgid "" ">>> a = (c_byte * 4)()\n" ">>> cast(a, POINTER(c_int))\n" @@ -1953,13 +1944,13 @@ msgstr "" "\n" ">>>" -#: ../../library/ctypes.rst:990 +#: ../../library/ctypes.rst:986 msgid "" "So, :func:`cast` can be used to assign to the ``values`` field of ``Bar`` " "the structure::" msgstr "" -#: ../../library/ctypes.rst:993 +#: ../../library/ctypes.rst:989 msgid "" ">>> bar = Bar()\n" ">>> bar.values = cast((c_byte * 4)(), POINTER(c_int))\n" @@ -1973,18 +1964,18 @@ msgstr "" "0\n" ">>>" -#: ../../library/ctypes.rst:1003 +#: ../../library/ctypes.rst:999 msgid "Incomplete Types" msgstr "" -#: ../../library/ctypes.rst:1005 +#: ../../library/ctypes.rst:1001 msgid "" "*Incomplete Types* are structures, unions or arrays whose members are not " "yet specified. In C, they are specified by forward declarations, which are " "defined later::" msgstr "" -#: ../../library/ctypes.rst:1009 +#: ../../library/ctypes.rst:1005 msgid "" "struct cell; /* forward declaration */\n" "\n" @@ -1994,13 +1985,13 @@ msgid "" "};" msgstr "" -#: ../../library/ctypes.rst:1016 +#: ../../library/ctypes.rst:1012 msgid "" "The straightforward translation into ctypes code would be this, but it does " "not work::" msgstr "" -#: ../../library/ctypes.rst:1019 +#: ../../library/ctypes.rst:1015 msgid "" ">>> class cell(Structure):\n" "... _fields_ = [(\"name\", c_char_p),\n" @@ -2022,14 +2013,14 @@ msgstr "" "NameError: name 'cell' is not defined\n" ">>>" -#: ../../library/ctypes.rst:1029 +#: ../../library/ctypes.rst:1025 msgid "" "because the new ``class cell`` is not available in the class statement " -"itself. In :mod:`ctypes`, we can define the ``cell`` class and set " -"the :attr:`~Structure._fields_` attribute later, after the class statement::" +"itself. In :mod:`ctypes`, we can define the ``cell`` class and set the :attr:" +"`~Structure._fields_` attribute later, after the class statement::" msgstr "" -#: ../../library/ctypes.rst:1033 +#: ../../library/ctypes.rst:1029 msgid "" ">>> from ctypes import *\n" ">>> class cell(Structure):\n" @@ -2047,13 +2038,13 @@ msgstr "" "... (\"next\", POINTER(cell))]\n" ">>>" -#: ../../library/ctypes.rst:1041 +#: ../../library/ctypes.rst:1037 msgid "" "Let's try it. We create two instances of ``cell``, and let them point to " "each other, and finally follow the pointer chain a few times::" msgstr "" -#: ../../library/ctypes.rst:1044 +#: ../../library/ctypes.rst:1040 msgid "" ">>> c1 = cell()\n" ">>> c1.name = b\"foo\"\n" @@ -2083,24 +2074,24 @@ msgstr "" "foo bar foo bar foo bar foo bar\n" ">>>" -#: ../../library/ctypes.rst:1062 +#: ../../library/ctypes.rst:1058 msgid "Callback functions" msgstr "回呼函式" -#: ../../library/ctypes.rst:1064 +#: ../../library/ctypes.rst:1060 msgid "" ":mod:`ctypes` allows creating C callable function pointers from Python " "callables. These are sometimes called *callback functions*." msgstr "" -#: ../../library/ctypes.rst:1067 +#: ../../library/ctypes.rst:1063 msgid "" "First, you must create a class for the callback function. The class knows " "the calling convention, the return type, and the number and types of " "arguments this function will receive." msgstr "" -#: ../../library/ctypes.rst:1071 +#: ../../library/ctypes.rst:1067 msgid "" "The :func:`CFUNCTYPE` factory function creates types for callback functions " "using the ``cdecl`` calling convention. On Windows, the :func:`WINFUNCTYPE` " @@ -2108,21 +2099,21 @@ msgid "" "calling convention." msgstr "" -#: ../../library/ctypes.rst:1076 +#: ../../library/ctypes.rst:1072 msgid "" "Both of these factory functions are called with the result type as first " "argument, and the callback functions expected argument types as the " "remaining arguments." msgstr "" -#: ../../library/ctypes.rst:1080 +#: ../../library/ctypes.rst:1076 msgid "" "I will present an example here which uses the standard C library's :c:func:`!" "qsort` function, that is used to sort items with the help of a callback " "function. :c:func:`!qsort` will be used to sort an array of integers::" msgstr "" -#: ../../library/ctypes.rst:1084 +#: ../../library/ctypes.rst:1080 msgid "" ">>> IntArray5 = c_int * 5\n" ">>> ia = IntArray5(5, 1, 7, 33, 99)\n" @@ -2136,7 +2127,7 @@ msgstr "" ">>> qsort.restype = None\n" ">>>" -#: ../../library/ctypes.rst:1090 +#: ../../library/ctypes.rst:1086 msgid "" ":func:`!qsort` must be called with a pointer to the data to sort, the number " "of items in the data array, the size of one item, and a pointer to the " @@ -2146,13 +2137,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/ctypes.rst:1096 +#: ../../library/ctypes.rst:1092 msgid "" "So our callback function receives pointers to integers, and must return an " "integer. First we create the ``type`` for the callback function::" msgstr "" -#: ../../library/ctypes.rst:1099 +#: ../../library/ctypes.rst:1095 msgid "" ">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" ">>>" @@ -2160,13 +2151,13 @@ msgstr "" ">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" ">>>" -#: ../../library/ctypes.rst:1102 +#: ../../library/ctypes.rst:1098 msgid "" "To get started, here is a simple callback that shows the values it gets " "passed::" msgstr "" -#: ../../library/ctypes.rst:1105 +#: ../../library/ctypes.rst:1101 msgid "" ">>> def py_cmp_func(a, b):\n" "... print(\"py_cmp_func\", a[0], b[0])\n" @@ -2182,11 +2173,11 @@ msgstr "" ">>> cmp_func = CMPFUNC(py_cmp_func)\n" ">>>" -#: ../../library/ctypes.rst:1112 +#: ../../library/ctypes.rst:1108 msgid "The result::" msgstr "結果為: ::" -#: ../../library/ctypes.rst:1114 +#: ../../library/ctypes.rst:1110 msgid "" ">>> qsort(ia, len(ia), sizeof(c_int), cmp_func)\n" "py_cmp_func 5 1\n" @@ -2204,11 +2195,11 @@ msgstr "" "py_cmp_func 1 7\n" ">>>" -#: ../../library/ctypes.rst:1122 +#: ../../library/ctypes.rst:1118 msgid "Now we can actually compare the two items and return a useful result::" msgstr "" -#: ../../library/ctypes.rst:1124 +#: ../../library/ctypes.rst:1120 msgid "" ">>> def py_cmp_func(a, b):\n" "... print(\"py_cmp_func\", a[0], b[0])\n" @@ -2236,11 +2227,11 @@ msgstr "" "py_cmp_func 5 7\n" ">>>" -#: ../../library/ctypes.rst:1137 +#: ../../library/ctypes.rst:1133 msgid "As we can easily check, our array is sorted now::" msgstr "" -#: ../../library/ctypes.rst:1139 +#: ../../library/ctypes.rst:1135 msgid "" ">>> for i in ia: print(i, end=\" \")\n" "...\n" @@ -2252,13 +2243,13 @@ msgstr "" "1 5 7 33 99\n" ">>>" -#: ../../library/ctypes.rst:1144 +#: ../../library/ctypes.rst:1140 msgid "" "The function factories can be used as decorator factories, so we may as well " "write::" msgstr "" -#: ../../library/ctypes.rst:1147 +#: ../../library/ctypes.rst:1143 msgid "" ">>> @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" "... def py_cmp_func(a, b):\n" @@ -2286,14 +2277,14 @@ msgstr "" "py_cmp_func 5 7\n" ">>>" -#: ../../library/ctypes.rst:1162 +#: ../../library/ctypes.rst:1158 msgid "" "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " "are used from C code. :mod:`ctypes` doesn't, and if you don't, they may be " "garbage collected, crashing your program when a callback is made." msgstr "" -#: ../../library/ctypes.rst:1166 +#: ../../library/ctypes.rst:1162 msgid "" "Also, note that if the callback function is called in a thread created " "outside of Python's control (e.g. by the foreign code that calls the " @@ -2303,25 +2294,25 @@ msgid "" "even when those calls are made from the same C thread." msgstr "" -#: ../../library/ctypes.rst:1176 +#: ../../library/ctypes.rst:1172 msgid "Accessing values exported from dlls" msgstr "" -#: ../../library/ctypes.rst:1178 +#: ../../library/ctypes.rst:1174 msgid "" "Some shared libraries not only export functions, they also export variables. " "An example in the Python library itself is the :c:data:`Py_Version`, Python " "runtime version number encoded in a single constant integer." msgstr "" -#: ../../library/ctypes.rst:1182 +#: ../../library/ctypes.rst:1178 msgid "" ":mod:`ctypes` can access values like this with the :meth:`~_CData.in_dll` " "class methods of the type. *pythonapi* is a predefined symbol giving access " "to the Python C api::" msgstr "" -#: ../../library/ctypes.rst:1186 +#: ../../library/ctypes.rst:1182 msgid "" ">>> version = ctypes.c_int.in_dll(ctypes.pythonapi, \"Py_Version\")\n" ">>> print(hex(version.value))\n" @@ -2331,17 +2322,17 @@ msgstr "" ">>> print(hex(version.value))\n" "0x30c00a0" -#: ../../library/ctypes.rst:1190 +#: ../../library/ctypes.rst:1186 msgid "" "An extended example which also demonstrates the use of pointers accesses " "the :c:data:`PyImport_FrozenModules` pointer exported by Python." msgstr "" -#: ../../library/ctypes.rst:1193 +#: ../../library/ctypes.rst:1189 msgid "Quoting the docs for that value:" msgstr "" -#: ../../library/ctypes.rst:1195 +#: ../../library/ctypes.rst:1191 msgid "" "This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " @@ -2350,13 +2341,13 @@ msgid "" "frozen modules." msgstr "" -#: ../../library/ctypes.rst:1200 +#: ../../library/ctypes.rst:1196 msgid "" "So manipulating this pointer could even prove useful. To restrict the " "example size, we show only how this table can be read with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1203 +#: ../../library/ctypes.rst:1199 msgid "" ">>> from ctypes import *\n" ">>>\n" @@ -2380,13 +2371,13 @@ msgstr "" "...\n" ">>>" -#: ../../library/ctypes.rst:1214 +#: ../../library/ctypes.rst:1210 msgid "" "We have defined the :c:struct:`_frozen` data type, so we can get the pointer " "to the table::" msgstr "" -#: ../../library/ctypes.rst:1217 +#: ../../library/ctypes.rst:1213 msgid "" ">>> FrozenTable = POINTER(struct_frozen)\n" ">>> table = FrozenTable.in_dll(pythonapi, \"_PyImport_FrozenBootstrap\")\n" @@ -2396,7 +2387,7 @@ msgstr "" ">>> table = FrozenTable.in_dll(pythonapi, \"_PyImport_FrozenBootstrap\")\n" ">>>" -#: ../../library/ctypes.rst:1221 +#: ../../library/ctypes.rst:1217 msgid "" "Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, " "we can iterate over it, but we just have to make sure that our loop " @@ -2405,7 +2396,7 @@ msgid "" "the loop when we hit the ``NULL`` entry::" msgstr "" -#: ../../library/ctypes.rst:1227 +#: ../../library/ctypes.rst:1223 msgid "" ">>> for item in table:\n" "... if item.name is None:\n" @@ -2427,28 +2418,28 @@ msgstr "" "zipimport 12345\n" ">>>" -#: ../../library/ctypes.rst:1237 +#: ../../library/ctypes.rst:1233 msgid "" "The fact that standard Python has a frozen module and a frozen package " "(indicated by the negative ``size`` member) is not well known, it is only " "used for testing. Try it out with ``import __hello__`` for example." msgstr "" -#: ../../library/ctypes.rst:1245 +#: ../../library/ctypes.rst:1241 msgid "Surprises" msgstr "" -#: ../../library/ctypes.rst:1247 +#: ../../library/ctypes.rst:1243 msgid "" "There are some edges in :mod:`ctypes` where you might expect something other " "than what actually happens." msgstr "" -#: ../../library/ctypes.rst:1250 +#: ../../library/ctypes.rst:1246 msgid "Consider the following example::" msgstr "" -#: ../../library/ctypes.rst:1252 +#: ../../library/ctypes.rst:1248 msgid "" ">>> from ctypes import *\n" ">>> class POINT(Structure):\n" @@ -2486,13 +2477,13 @@ msgstr "" "3 4 3 4\n" ">>>" -#: ../../library/ctypes.rst:1270 +#: ../../library/ctypes.rst:1266 msgid "" "Hm. We certainly expected the last statement to print ``3 4 1 2``. What " "happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" msgstr "" -#: ../../library/ctypes.rst:1273 +#: ../../library/ctypes.rst:1269 msgid "" ">>> temp0, temp1 = rc.b, rc.a\n" ">>> rc.a = temp0\n" @@ -2504,7 +2495,7 @@ msgstr "" ">>> rc.b = temp1\n" ">>>" -#: ../../library/ctypes.rst:1278 +#: ../../library/ctypes.rst:1274 msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " "buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the " @@ -2513,20 +2504,20 @@ msgid "" "have the expected effect." msgstr "" -#: ../../library/ctypes.rst:1284 +#: ../../library/ctypes.rst:1280 msgid "" "Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays " "doesn't *copy* the sub-object, instead it retrieves a wrapper object " "accessing the root-object's underlying buffer." msgstr "" -#: ../../library/ctypes.rst:1288 +#: ../../library/ctypes.rst:1284 msgid "" "Another example that may behave differently from what one would expect is " "this::" msgstr "" -#: ../../library/ctypes.rst:1290 +#: ../../library/ctypes.rst:1286 msgid "" ">>> s = c_char_p()\n" ">>> s.value = b\"abc def ghi\"\n" @@ -2544,13 +2535,13 @@ msgstr "" "False\n" ">>>" -#: ../../library/ctypes.rst:1300 +#: ../../library/ctypes.rst:1296 msgid "" "Objects instantiated from :class:`c_char_p` can only have their value set to " "bytes or integers." msgstr "" -#: ../../library/ctypes.rst:1303 +#: ../../library/ctypes.rst:1299 msgid "" "Why is it printing ``False``? ctypes instances are objects containing a " "memory block plus some :term:`descriptor`\\s accessing the contents of the " @@ -2559,16 +2550,16 @@ msgid "" "the contents again constructs a new Python object each time!" msgstr "" -#: ../../library/ctypes.rst:1313 +#: ../../library/ctypes.rst:1309 msgid "Variable-sized data types" msgstr "" -#: ../../library/ctypes.rst:1315 +#: ../../library/ctypes.rst:1311 msgid "" ":mod:`ctypes` provides some support for variable-sized arrays and structures." msgstr "" -#: ../../library/ctypes.rst:1317 +#: ../../library/ctypes.rst:1313 msgid "" "The :func:`resize` function can be used to resize the memory buffer of an " "existing ctypes object. The function takes the object as first argument, " @@ -2577,7 +2568,7 @@ msgid "" "objects type, a :exc:`ValueError` is raised if this is tried::" msgstr "" -#: ../../library/ctypes.rst:1323 +#: ../../library/ctypes.rst:1319 msgid "" ">>> short_array = (c_short * 4)()\n" ">>> print(sizeof(short_array))\n" @@ -2607,14 +2598,14 @@ msgstr "" "8\n" ">>>" -#: ../../library/ctypes.rst:1337 +#: ../../library/ctypes.rst:1333 msgid "" "This is nice and fine, but how would one access the additional elements " "contained in this array? Since the type still only knows about 4 elements, " "we get errors accessing other elements::" msgstr "" -#: ../../library/ctypes.rst:1341 +#: ../../library/ctypes.rst:1337 msgid "" ">>> short_array[:]\n" "[0, 0, 0, 0]\n" @@ -2632,28 +2623,28 @@ msgstr "" "IndexError: invalid index\n" ">>>" -#: ../../library/ctypes.rst:1349 +#: ../../library/ctypes.rst:1345 msgid "" "Another way to use variable-sized data types with :mod:`ctypes` is to use " "the dynamic nature of Python, and (re-)define the data type after the " "required size is already known, on a case by case basis." msgstr "" -#: ../../library/ctypes.rst:1357 +#: ../../library/ctypes.rst:1353 msgid "ctypes reference" msgstr "" -#: ../../library/ctypes.rst:1363 +#: ../../library/ctypes.rst:1359 msgid "Finding shared libraries" msgstr "" -#: ../../library/ctypes.rst:1365 +#: ../../library/ctypes.rst:1361 msgid "" "When programming in a compiled language, shared libraries are accessed when " "compiling/linking a program, and when the program is run." msgstr "" -#: ../../library/ctypes.rst:1368 +#: ../../library/ctypes.rst:1364 msgid "" "The purpose of the :func:`~ctypes.util.find_library` function is to locate a " "library in a way similar to what the compiler or runtime loader does (on " @@ -2662,13 +2653,13 @@ msgid "" "and call the runtime loader directly." msgstr "" -#: ../../library/ctypes.rst:1374 +#: ../../library/ctypes.rst:1370 msgid "" "The :mod:`!ctypes.util` module provides a function which can help to " "determine the library to load." msgstr "" -#: ../../library/ctypes.rst:1382 +#: ../../library/ctypes.rst:1378 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like *lib*, suffix like ``.so``, ``.dylib`` or version " @@ -2676,29 +2667,29 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1387 ../../library/ctypes.rst:2135 +#: ../../library/ctypes.rst:1383 ../../library/ctypes.rst:2131 msgid "The exact functionality is system dependent." msgstr "" -#: ../../library/ctypes.rst:1389 +#: ../../library/ctypes.rst:1385 msgid "" "On Linux, :func:`~ctypes.util.find_library` tries to run external programs " "(``/sbin/ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library " "file. It returns the filename of the library file." msgstr "" -#: ../../library/ctypes.rst:1393 +#: ../../library/ctypes.rst:1389 msgid "" "On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used " "when searching for libraries, if a library cannot be found by any other " "means." msgstr "" -#: ../../library/ctypes.rst:1397 +#: ../../library/ctypes.rst:1393 msgid "Here are some examples::" msgstr "以下是一些範例: ::" -#: ../../library/ctypes.rst:1399 +#: ../../library/ctypes.rst:1395 msgid "" ">>> from ctypes.util import find_library\n" ">>> find_library(\"m\")\n" @@ -2718,14 +2709,14 @@ msgstr "" "'libbz2.so.1.0'\n" ">>>" -#: ../../library/ctypes.rst:1408 +#: ../../library/ctypes.rst:1404 msgid "" "On macOS and Android, :func:`~ctypes.util.find_library` uses the system's " "standard naming schemes and paths to locate the library, and returns a full " "pathname if successful::" msgstr "" -#: ../../library/ctypes.rst:1412 +#: ../../library/ctypes.rst:1408 msgid "" ">>> from ctypes.util import find_library\n" ">>> find_library(\"c\")\n" @@ -2749,7 +2740,7 @@ msgstr "" "'/System/Library/Frameworks/AGL.framework/AGL'\n" ">>>" -#: ../../library/ctypes.rst:1423 +#: ../../library/ctypes.rst:1419 msgid "" "On Windows, :func:`~ctypes.util.find_library` searches along the system " "search path, and returns the full pathname, but since there is no predefined " @@ -2757,7 +2748,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/ctypes.rst:1427 +#: ../../library/ctypes.rst:1423 msgid "" "If wrapping a shared library with :mod:`ctypes`, it *may* be better to " "determine the shared library name at development time, and hardcode that " @@ -2765,18 +2756,18 @@ msgid "" "to locate the library at runtime." msgstr "" -#: ../../library/ctypes.rst:1435 +#: ../../library/ctypes.rst:1431 msgid "Listing loaded shared libraries" msgstr "" -#: ../../library/ctypes.rst:1437 +#: ../../library/ctypes.rst:1433 msgid "" "When writing code that relies on code loaded from shared libraries, it can " "be useful to know which shared libraries have already been loaded into the " "current process." msgstr "" -#: ../../library/ctypes.rst:1441 +#: ../../library/ctypes.rst:1437 msgid "" "The :mod:`!ctypes.util` module provides the :func:`~ctypes.util.dllist` " "function, which calls the different APIs provided by the various platforms " @@ -2784,7 +2775,7 @@ msgid "" "current process." msgstr "" -#: ../../library/ctypes.rst:1445 +#: ../../library/ctypes.rst:1441 msgid "" "The exact output of this function will be system dependent. On most " "platforms, the first entry of this list represents the current process " @@ -2792,7 +2783,7 @@ msgid "" "return may look like::" msgstr "" -#: ../../library/ctypes.rst:1450 +#: ../../library/ctypes.rst:1446 msgid "" ">>> from ctypes.util import dllist\n" ">>> dllist()\n" @@ -2800,48 +2791,47 @@ msgid "" "linux-gnu/libc.so.6', ... ]" msgstr "" -#: ../../library/ctypes.rst:1457 +#: ../../library/ctypes.rst:1453 msgid "Loading shared libraries" msgstr "" -#: ../../library/ctypes.rst:1459 +#: ../../library/ctypes.rst:1455 msgid "" "There are several ways to load shared libraries into the Python process. " "One way is to instantiate one of the following classes:" msgstr "" -#: ../../library/ctypes.rst:1465 +#: ../../library/ctypes.rst:1461 msgid "" "Instances of this class represent loaded shared libraries. Functions in " "these libraries use the standard C calling convention, and are assumed to " "return :c:expr:`int`." msgstr "" -#: ../../library/ctypes.rst:1469 +#: ../../library/ctypes.rst:1465 msgid "" "On Windows creating a :class:`CDLL` instance may fail even if the DLL name " -"exists. When a dependent DLL of the loaded DLL is not found, " -"a :exc:`OSError` error is raised with the message *\"[WinError 126] The " -"specified module could not be found\".* This error message does not contain " -"the name of the missing DLL because the Windows API does not return this " -"information making this error hard to diagnose. To resolve this error and " -"determine which DLL is not found, you need to find the list of dependent " -"DLLs and determine which one is not found using Windows debugging and " -"tracing tools." -msgstr "" - -#: ../../library/ctypes.rst:1481 ../../library/ctypes.rst:1506 -#: ../../library/ctypes.rst:1519 ../../library/ctypes.rst:1537 +"exists. When a dependent DLL of the loaded DLL is not found, a :exc:" +"`OSError` error is raised with the message *\"[WinError 126] The specified " +"module could not be found\".* This error message does not contain the name " +"of the missing DLL because the Windows API does not return this information " +"making this error hard to diagnose. To resolve this error and determine " +"which DLL is not found, you need to find the list of dependent DLLs and " +"determine which one is not found using Windows debugging and tracing tools." +msgstr "" + +#: ../../library/ctypes.rst:1477 ../../library/ctypes.rst:1502 +#: ../../library/ctypes.rst:1515 ../../library/ctypes.rst:1533 msgid "The *name* parameter can now be a :term:`path-like object`." msgstr "" -#: ../../library/ctypes.rst:1485 +#: ../../library/ctypes.rst:1481 msgid "" "`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." msgstr "" -#: ../../library/ctypes.rst:1491 +#: ../../library/ctypes.rst:1487 msgid "" "Instances of this class represent loaded shared libraries, functions in " "these libraries use the ``stdcall`` calling convention, and are assumed to " @@ -2851,38 +2841,38 @@ msgid "" "a failure, an :class:`OSError` is automatically raised." msgstr "" -#: ../../library/ctypes.rst:1498 ../../library/ctypes.rst:1515 -#: ../../library/ctypes.rst:1659 ../../library/ctypes.rst:1667 -#: ../../library/ctypes.rst:1839 ../../library/ctypes.rst:1891 -#: ../../library/ctypes.rst:2043 ../../library/ctypes.rst:2115 -#: ../../library/ctypes.rst:2124 ../../library/ctypes.rst:2149 -#: ../../library/ctypes.rst:2163 ../../library/ctypes.rst:2172 -#: ../../library/ctypes.rst:2181 ../../library/ctypes.rst:2196 -#: ../../library/ctypes.rst:2263 ../../library/ctypes.rst:2290 -#: ../../library/ctypes.rst:2690 ../../library/ctypes.rst:3088 +#: ../../library/ctypes.rst:1494 ../../library/ctypes.rst:1511 +#: ../../library/ctypes.rst:1655 ../../library/ctypes.rst:1663 +#: ../../library/ctypes.rst:1835 ../../library/ctypes.rst:1887 +#: ../../library/ctypes.rst:2039 ../../library/ctypes.rst:2111 +#: ../../library/ctypes.rst:2120 ../../library/ctypes.rst:2145 +#: ../../library/ctypes.rst:2159 ../../library/ctypes.rst:2168 +#: ../../library/ctypes.rst:2177 ../../library/ctypes.rst:2192 +#: ../../library/ctypes.rst:2259 ../../library/ctypes.rst:2286 +#: ../../library/ctypes.rst:2686 ../../library/ctypes.rst:3104 msgid "Availability" msgstr "可用性" -#: ../../library/ctypes.rst:1500 +#: ../../library/ctypes.rst:1496 msgid "" -":exc:`WindowsError` used to be raised, which is now an alias " -"of :exc:`OSError`." +":exc:`WindowsError` used to be raised, which is now an alias of :exc:" +"`OSError`." msgstr "" -#: ../../library/ctypes.rst:1511 +#: ../../library/ctypes.rst:1507 msgid "" "Instances of this class represent loaded shared libraries, functions in " "these libraries use the ``stdcall`` calling convention, and are assumed to " "return :c:expr:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1522 +#: ../../library/ctypes.rst:1518 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1528 +#: ../../library/ctypes.rst:1524 msgid "" "Instances of this class behave like :class:`CDLL` instances, except that the " "Python GIL is *not* released during the function call, and after the " @@ -2890,11 +2880,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1533 +#: ../../library/ctypes.rst:1529 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1539 +#: ../../library/ctypes.rst:1535 msgid "" "All these classes can be instantiated by calling them with at least one " "argument, the pathname of the shared library. If you have an existing " @@ -2904,7 +2894,7 @@ msgid "" "the process, and to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1546 +#: ../../library/ctypes.rst:1542 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " @@ -2912,35 +2902,33 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1551 +#: ../../library/ctypes.rst:1547 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " -"allows accessing the system :data:`errno` error number in a safe " -"way. :mod:`ctypes` maintains a thread-local copy of the " -"system's :data:`errno` variable; if you call foreign functions created with " -"``use_errno=True`` then the :data:`errno` value before the function call is " -"swapped with the ctypes private copy, the same happens immediately after the " -"function call." +"allows accessing the system :data:`errno` error number in a safe way. :mod:" +"`ctypes` maintains a thread-local copy of the system's :data:`errno` " +"variable; if you call foreign functions created with ``use_errno=True`` then " +"the :data:`errno` value before the function call is swapped with the ctypes " +"private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1558 +#: ../../library/ctypes.rst:1554 msgid "" "The function :func:`ctypes.get_errno` returns the value of the ctypes " "private copy, and the function :func:`ctypes.set_errno` changes the ctypes " "private copy to a new value and returns the former value." msgstr "" -#: ../../library/ctypes.rst:1562 +#: ../../library/ctypes.rst:1558 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " -"for the Windows error code which is managed by the :func:`GetLastError` " -"and :func:`!SetLastError` Windows API " -"functions; :func:`ctypes.get_last_error` and :func:`ctypes.set_last_error` " -"are used to request and change the ctypes private copy of the windows error " -"code." +"for the Windows error code which is managed by the :func:`GetLastError` and :" +"func:`!SetLastError` Windows API functions; :func:`ctypes.get_last_error` " +"and :func:`ctypes.set_last_error` are used to request and change the ctypes " +"private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1568 +#: ../../library/ctypes.rst:1564 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " @@ -2950,29 +2938,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1575 +#: ../../library/ctypes.rst:1571 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1582 +#: ../../library/ctypes.rst:1578 msgid "" "Flag to use as *mode* parameter. On platforms where this flag is not " "available, it is defined as the integer zero." msgstr "" -#: ../../library/ctypes.rst:1589 +#: ../../library/ctypes.rst:1585 msgid "" "Flag to use as *mode* parameter. On platforms where this is not available, " "it is the same as *RTLD_GLOBAL*." msgstr "" -#: ../../library/ctypes.rst:1596 +#: ../../library/ctypes.rst:1592 msgid "" "The default mode which is used to load shared libraries. On OSX 10.3, this " "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." msgstr "" -#: ../../library/ctypes.rst:1599 +#: ../../library/ctypes.rst:1595 msgid "" "Instances of these classes have no public methods. Functions exported by " "the shared library can be accessed as attributes or by index. Please note " @@ -2981,7 +2969,7 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1605 +#: ../../library/ctypes.rst:1601 msgid "" ">>> from ctypes import CDLL\n" ">>> libc = CDLL(\"libc.so.6\") # On Linux\n" @@ -2997,21 +2985,21 @@ msgstr "" ">>> libc['time'] == libc['time']\n" "False" -#: ../../library/ctypes.rst:1612 +#: ../../library/ctypes.rst:1608 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1618 +#: ../../library/ctypes.rst:1614 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1623 +#: ../../library/ctypes.rst:1619 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1625 +#: ../../library/ctypes.rst:1621 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -3019,13 +3007,13 @@ msgid "" "library as attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1633 +#: ../../library/ctypes.rst:1629 msgid "" -"Class which loads shared libraries. *dlltype* should be one of " -"the :class:`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." +"Class which loads shared libraries. *dlltype* should be one of the :class:" +"`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" -#: ../../library/ctypes.rst:1636 +#: ../../library/ctypes.rst:1632 msgid "" ":meth:`!__getattr__` has special behavior: It allows loading a shared " "library by accessing it as attribute of a library loader instance. The " @@ -3033,72 +3021,72 @@ msgid "" "each time." msgstr "" -#: ../../library/ctypes.rst:1642 +#: ../../library/ctypes.rst:1638 msgid "" "Load a shared library into the process and return it. This method always " "returns a new instance of the library." msgstr "" -#: ../../library/ctypes.rst:1646 +#: ../../library/ctypes.rst:1642 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1651 +#: ../../library/ctypes.rst:1647 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1657 +#: ../../library/ctypes.rst:1653 msgid "Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1665 +#: ../../library/ctypes.rst:1661 msgid "Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1673 +#: ../../library/ctypes.rst:1669 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1676 +#: ../../library/ctypes.rst:1672 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1682 +#: ../../library/ctypes.rst:1678 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " -"attributes. Note that all these functions are assumed to return " -"C :c:expr:`int`, which is of course not always the truth, so you have to " -"assign the correct :attr:`!restype` attribute to use these functions." +"attributes. Note that all these functions are assumed to return C :c:expr:" +"`int`, which is of course not always the truth, so you have to assign the " +"correct :attr:`!restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1687 ../../library/ctypes.rst:1689 +#: ../../library/ctypes.rst:1683 ../../library/ctypes.rst:1685 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" -#: ../../library/ctypes.rst:1693 ../../library/ctypes.rst:1695 +#: ../../library/ctypes.rst:1689 ../../library/ctypes.rst:1691 msgid "" -"Accessing a function on a loaded library raises an auditing event " -"``ctypes.dlsym`` with arguments ``library`` (the library object) and " -"``name`` (the symbol's name as a string or integer)." +"Accessing a function on a loaded library raises an auditing event ``ctypes." +"dlsym`` with arguments ``library`` (the library object) and ``name`` (the " +"symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1699 ../../library/ctypes.rst:1701 +#: ../../library/ctypes.rst:1695 ../../library/ctypes.rst:1697 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" -#: ../../library/ctypes.rst:1708 +#: ../../library/ctypes.rst:1704 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1710 +#: ../../library/ctypes.rst:1706 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -3107,13 +3095,13 @@ msgid "" "library loader." msgstr "" -#: ../../library/ctypes.rst:1715 +#: ../../library/ctypes.rst:1711 msgid "" "They are instances of a private local class :class:`!_FuncPtr` (not exposed " "in :mod:`!ctypes`) which inherits from the private :class:`_CFuncPtr` class:" msgstr "" -#: ../../library/ctypes.rst:1718 +#: ../../library/ctypes.rst:1714 msgid "" ">>> import ctypes\n" ">>> lib = ctypes.CDLL(None)\n" @@ -3123,29 +3111,29 @@ msgid "" "False" msgstr "" -#: ../../library/ctypes.rst:1729 +#: ../../library/ctypes.rst:1725 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1731 +#: ../../library/ctypes.rst:1727 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1734 +#: ../../library/ctypes.rst:1730 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1739 +#: ../../library/ctypes.rst:1735 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1742 +#: ../../library/ctypes.rst:1738 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:expr:`int`, and the " @@ -3155,7 +3143,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1751 +#: ../../library/ctypes.rst:1747 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -3164,17 +3152,17 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1757 +#: ../../library/ctypes.rst:1753 msgid "" -"When a foreign function is called, each actual argument is passed to " -"the :meth:`~_CData.from_param` class method of the items in " -"the :attr:`argtypes` tuple, this method allows adapting the actual argument " -"to an object that the foreign function accepts. For example, " -"a :class:`c_char_p` item in the :attr:`argtypes` tuple will convert a string " -"passed as argument into a bytes object using ctypes conversion rules." +"When a foreign function is called, each actual argument is passed to the :" +"meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " +"tuple, this method allows adapting the actual argument to an object that the " +"foreign function accepts. For example, a :class:`c_char_p` item in the :" +"attr:`argtypes` tuple will convert a string passed as argument into a bytes " +"object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1764 +#: ../../library/ctypes.rst:1760 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`~_CData.from_param` method which returns a " @@ -3182,58 +3170,58 @@ msgid "" "defining adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1771 +#: ../../library/ctypes.rst:1767 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" msgstr "" -#: ../../library/ctypes.rst:1778 +#: ../../library/ctypes.rst:1774 msgid "" "*result* is what the foreign function returns, as specified by the :attr:`!" "restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1781 +#: ../../library/ctypes.rst:1777 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." msgstr "" -#: ../../library/ctypes.rst:1785 +#: ../../library/ctypes.rst:1781 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." msgstr "" -#: ../../library/ctypes.rst:1789 +#: ../../library/ctypes.rst:1785 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " "if the foreign function call failed." msgstr "" -#: ../../library/ctypes.rst:1794 ../../library/ctypes.rst:1796 +#: ../../library/ctypes.rst:1790 ../../library/ctypes.rst:1792 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " -"a suitable Python exception. Further, an auditing event " -"``ctypes.set_exception`` with argument ``code`` will be raised, allowing an " -"audit hook to replace the exception with its own." +"a suitable Python exception. Further, an auditing event ``ctypes." +"set_exception`` with argument ``code`` will be raised, allowing an audit " +"hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1802 ../../library/ctypes.rst:1804 +#: ../../library/ctypes.rst:1798 ../../library/ctypes.rst:1800 msgid "" "Some ways to invoke foreign function calls as well as some of the functions " "in this module may raise an auditing event ``ctypes.call_function`` with " "arguments ``function pointer`` and ``arguments``." msgstr "" -#: ../../library/ctypes.rst:1811 +#: ../../library/ctypes.rst:1807 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1813 +#: ../../library/ctypes.rst:1809 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -3244,47 +3232,46 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1824 +#: ../../library/ctypes.rst:1820 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " -"*use_errno* is set to true, the ctypes private copy of the " -"system :data:`errno` variable is exchanged with the real :data:`errno` value " -"before and after the call; *use_last_error* does the same for the Windows " -"error code." +"*use_errno* is set to true, the ctypes private copy of the system :data:" +"`errno` variable is exchanged with the real :data:`errno` value before and " +"after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1834 +#: ../../library/ctypes.rst:1830 msgid "" "The returned function prototype creates functions that use the ``stdcall`` " "calling convention. The function will release the GIL during the call. " "*use_errno* and *use_last_error* have the same meaning as above." msgstr "" -#: ../../library/ctypes.rst:1844 +#: ../../library/ctypes.rst:1840 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." msgstr "" -#: ../../library/ctypes.rst:1847 +#: ../../library/ctypes.rst:1843 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " "call:" msgstr "" -#: ../../library/ctypes.rst:1854 +#: ../../library/ctypes.rst:1850 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1861 +#: ../../library/ctypes.rst:1857 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1868 +#: ../../library/ctypes.rst:1864 msgid "" "Returns a foreign function exported by a shared library. *func_spec* must be " "a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the " @@ -3292,7 +3279,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1878 +#: ../../library/ctypes.rst:1874 msgid "" "Returns a foreign function that will call a COM method. *vtbl_index* is the " "index into the virtual function table, a small non-negative integer. *name* " @@ -3300,86 +3287,86 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1883 +#: ../../library/ctypes.rst:1879 msgid "" "If *iid* is not specified, an :exc:`OSError` is raised if the COM method " "call fails. If *iid* is specified, a :exc:`~ctypes.COMError` is raised " "instead." msgstr "" -#: ../../library/ctypes.rst:1887 +#: ../../library/ctypes.rst:1883 msgid "" "COM methods use a special calling convention: They require a pointer to the " "COM interface as first argument, in addition to those parameters that are " "specified in the :attr:`!argtypes` tuple." msgstr "" -#: ../../library/ctypes.rst:1894 +#: ../../library/ctypes.rst:1890 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: ../../library/ctypes.rst:1897 +#: ../../library/ctypes.rst:1893 msgid "" -"*paramflags* must be a tuple of the same length " -"as :attr:`~_CFuncPtr.argtypes`." +"*paramflags* must be a tuple of the same length as :attr:`~_CFuncPtr." +"argtypes`." msgstr "" -#: ../../library/ctypes.rst:1899 +#: ../../library/ctypes.rst:1895 msgid "" "Each item in this tuple contains further information about a parameter, it " "must be a tuple containing one, two, or three items." msgstr "" -#: ../../library/ctypes.rst:1902 +#: ../../library/ctypes.rst:1898 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1905 +#: ../../library/ctypes.rst:1901 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1906 +#: ../../library/ctypes.rst:1902 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1908 +#: ../../library/ctypes.rst:1904 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1909 +#: ../../library/ctypes.rst:1905 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1911 +#: ../../library/ctypes.rst:1907 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1912 +#: ../../library/ctypes.rst:1908 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1914 +#: ../../library/ctypes.rst:1910 msgid "" "The optional second item is the parameter name as string. If this is " "specified, the foreign function can be called with named parameters." msgstr "" -#: ../../library/ctypes.rst:1917 +#: ../../library/ctypes.rst:1913 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1920 +#: ../../library/ctypes.rst:1916 msgid "" "The following example demonstrates how to wrap the Windows ``MessageBoxW`` " "function so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" -#: ../../library/ctypes.rst:1924 +#: ../../library/ctypes.rst:1920 msgid "" "WINUSERAPI int WINAPI\n" "MessageBoxW(\n" @@ -3395,11 +3382,11 @@ msgstr "" " LPCWSTR lpCaption,\n" " UINT uType);" -#: ../../library/ctypes.rst:1931 ../../library/ctypes.rst:1954 +#: ../../library/ctypes.rst:1927 ../../library/ctypes.rst:1950 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1933 +#: ../../library/ctypes.rst:1929 msgid "" ">>> from ctypes import c_int, WINFUNCTYPE, windll\n" ">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" @@ -3415,11 +3402,11 @@ msgstr "" "\"Hello from ctypes\"), (1, \"flags\", 0)\n" ">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" -#: ../../library/ctypes.rst:1939 +#: ../../library/ctypes.rst:1935 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1941 +#: ../../library/ctypes.rst:1937 msgid "" ">>> MessageBox()\n" ">>> MessageBox(text=\"Spam, spam, spam\")\n" @@ -3429,7 +3416,7 @@ msgstr "" ">>> MessageBox(text=\"Spam, spam, spam\")\n" ">>> MessageBox(flags=2, text=\"foo bar\")" -#: ../../library/ctypes.rst:1945 +#: ../../library/ctypes.rst:1941 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -3437,7 +3424,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1949 +#: ../../library/ctypes.rst:1945 msgid "" "WINUSERAPI BOOL WINAPI\n" "GetWindowRect(\n" @@ -3449,7 +3436,7 @@ msgstr "" " HWND hWnd,\n" " LPRECT lpRect);" -#: ../../library/ctypes.rst:1956 +#: ../../library/ctypes.rst:1952 msgid "" ">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" ">>> from ctypes.wintypes import BOOL, HWND, RECT\n" @@ -3467,7 +3454,7 @@ msgstr "" "paramflags)\n" ">>>" -#: ../../library/ctypes.rst:1963 +#: ../../library/ctypes.rst:1959 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -3475,7 +3462,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1968 +#: ../../library/ctypes.rst:1964 msgid "" "Output parameters can be combined with the :attr:`~_CFuncPtr.errcheck` " "protocol to do further output processing and error checking. The win32 " @@ -3484,7 +3471,7 @@ msgid "" "exception when the api call failed::" msgstr "" -#: ../../library/ctypes.rst:1973 +#: ../../library/ctypes.rst:1969 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3502,7 +3489,7 @@ msgstr "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" -#: ../../library/ctypes.rst:1981 +#: ../../library/ctypes.rst:1977 msgid "" "If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it " "receives unchanged, :mod:`ctypes` continues the normal processing it does on " @@ -3511,7 +3498,7 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1987 +#: ../../library/ctypes.rst:1983 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3531,64 +3518,64 @@ msgstr "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" -#: ../../library/ctypes.rst:2000 +#: ../../library/ctypes.rst:1996 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:2004 +#: ../../library/ctypes.rst:2000 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:2007 +#: ../../library/ctypes.rst:2003 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." msgstr "" -"引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` " -"``ctypes.addressof``。" +"引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." +"addressof``。" -#: ../../library/ctypes.rst:2012 +#: ../../library/ctypes.rst:2008 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:2018 +#: ../../library/ctypes.rst:2014 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " "added to the internal pointer value." msgstr "" -#: ../../library/ctypes.rst:2022 +#: ../../library/ctypes.rst:2018 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:2024 +#: ../../library/ctypes.rst:2020 msgid "(((char *)&obj) + offset)" msgstr "(((char *)&obj) + offset)" -#: ../../library/ctypes.rst:2026 +#: ../../library/ctypes.rst:2022 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." msgstr "" -#: ../../library/ctypes.rst:2032 +#: ../../library/ctypes.rst:2028 msgid "" -"Copies a COM pointer from *src* to *dst* and returns the Windows " -"specific :c:type:`!HRESULT` value." +"Copies a COM pointer from *src* to *dst* and returns the Windows specific :c:" +"type:`!HRESULT` value." msgstr "" -#: ../../library/ctypes.rst:2035 +#: ../../library/ctypes.rst:2031 msgid "" "If *src* is not ``NULL``, its ``AddRef`` method is called, incrementing the " "reference count." msgstr "" -#: ../../library/ctypes.rst:2038 +#: ../../library/ctypes.rst:2034 msgid "" "In contrast, the reference count of *dst* will not be decremented before " "assigning the new value. Unless *dst* is ``NULL``, the caller is responsible " @@ -3596,7 +3583,7 @@ msgid "" "necessary." msgstr "" -#: ../../library/ctypes.rst:2050 +#: ../../library/ctypes.rst:2046 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -3604,47 +3591,47 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:2059 +#: ../../library/ctypes.rst:2055 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:2062 +#: ../../library/ctypes.rst:2058 msgid "" "If *size* is given (and not ``None``), it must be an :class:`int`. It " "specifies the size of the returned array." msgstr "" -#: ../../library/ctypes.rst:2065 +#: ../../library/ctypes.rst:2061 msgid "" "If the *init* argument is given, it must be :class:`bytes`. It is used to " "initialize the array items. Bytes not initialized this way are set to zero " "(NUL)." msgstr "" -#: ../../library/ctypes.rst:2069 +#: ../../library/ctypes.rst:2065 msgid "" "If *size* is not given (or if it is ``None``), the buffer is made one " "element larger than *init*, effectively adding a NUL terminator." msgstr "" -#: ../../library/ctypes.rst:2072 +#: ../../library/ctypes.rst:2068 msgid "" "If both arguments are given, *size* must not be less than ``len(init)``." msgstr "" -#: ../../library/ctypes.rst:2076 +#: ../../library/ctypes.rst:2072 msgid "" "If *size* is equal to ``len(init)``, a NUL terminator is not added. Do not " "treat such a buffer as a C string." msgstr "" -#: ../../library/ctypes.rst:2079 +#: ../../library/ctypes.rst:2075 msgid "For example::" msgstr "" -#: ../../library/ctypes.rst:2081 +#: ../../library/ctypes.rst:2077 msgid "" ">>> bytes(create_string_buffer(2))\n" "b'\\x00\\x00'\n" @@ -3660,7 +3647,7 @@ msgid "" "ValueError: byte string too long" msgstr "" -#: ../../library/ctypes.rst:2094 +#: ../../library/ctypes.rst:2090 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -3668,19 +3655,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:2100 +#: ../../library/ctypes.rst:2096 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:2103 +#: ../../library/ctypes.rst:2099 msgid "" "The function takes the same arguments as :func:`~create_string_buffer` " "except *init* must be a string and *size* counts :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:2106 +#: ../../library/ctypes.rst:2102 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -3688,21 +3675,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:2111 +#: ../../library/ctypes.rst:2107 msgid "" "This function is a hook which allows implementing in-process COM servers " "with ctypes. It is called from the DllCanUnloadNow function that the " "_ctypes extension dll exports." msgstr "" -#: ../../library/ctypes.rst:2120 +#: ../../library/ctypes.rst:2116 msgid "" "This function is a hook which allows implementing in-process COM servers " "with ctypes. It is called from the DllGetClassObject function that the " "``_ctypes`` extension dll exports." msgstr "" -#: ../../library/ctypes.rst:2130 +#: ../../library/ctypes.rst:2126 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -3710,21 +3697,21 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:2141 +#: ../../library/ctypes.rst:2137 msgid "" "Returns the filename of the VC runtime library used by Python, and by the " "extension modules. If the name of the library cannot be determined, " "``None`` is returned." msgstr "" -#: ../../library/ctypes.rst:2145 +#: ../../library/ctypes.rst:2141 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " "function in the same library that allocated the memory." msgstr "" -#: ../../library/ctypes.rst:2155 +#: ../../library/ctypes.rst:2151 msgid "" "Try to provide a list of paths of the shared libraries loaded into the " "current process. These paths are not normalized or processed in any way. " @@ -3732,74 +3719,74 @@ msgid "" "The exact functionality is system dependent." msgstr "" -#: ../../library/ctypes.rst:2160 +#: ../../library/ctypes.rst:2156 msgid "" "On most platforms, the first element of the list represents the current " "executable file. It may be an empty string." msgstr "" -#: ../../library/ctypes.rst:2168 +#: ../../library/ctypes.rst:2164 msgid "" "Returns a textual description of the error code *code*. If no error code is " -"specified, the last error code is used by calling the Windows API " -"function :func:`GetLastError`." +"specified, the last error code is used by calling the Windows API function :" +"func:`GetLastError`." msgstr "" -#: ../../library/ctypes.rst:2177 +#: ../../library/ctypes.rst:2173 msgid "" "Returns the last error code set by Windows in the calling thread. This " "function calls the Windows ``GetLastError()`` function directly, it does not " "return the ctypes-private copy of the error code." msgstr "" -#: ../../library/ctypes.rst:2186 +#: ../../library/ctypes.rst:2182 msgid "" -"Returns the current value of the ctypes-private copy of the " -"system :data:`errno` variable in the calling thread." +"Returns the current value of the ctypes-private copy of the system :data:" +"`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2189 +#: ../../library/ctypes.rst:2185 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:2193 +#: ../../library/ctypes.rst:2189 msgid "" "Returns the current value of the ctypes-private copy of the system :data:`!" "LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2198 +#: ../../library/ctypes.rst:2194 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:2203 +#: ../../library/ctypes.rst:2199 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " "can be converted to pointers." msgstr "" -#: ../../library/ctypes.rst:2210 +#: ../../library/ctypes.rst:2206 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " "specifying an address, or a ctypes instance." msgstr "" -#: ../../library/ctypes.rst:2217 +#: ../../library/ctypes.rst:2213 msgid "" "Create or return a ctypes pointer type. Pointer types are cached and reused " "internally, so calling this function repeatedly is cheap. *type* must be a " "ctypes type." msgstr "" -#: ../../library/ctypes.rst:2223 +#: ../../library/ctypes.rst:2219 msgid "" "The resulting pointer type is cached in the ``__pointer_type__`` attribute " "of *type*. It is possible to set this attribute before the first call to " @@ -3808,19 +3795,19 @@ msgid "" "relying on implementation details that may change in future Python versions." msgstr "" -#: ../../library/ctypes.rst:2234 +#: ../../library/ctypes.rst:2230 msgid "" "Create a new pointer instance, pointing to *obj*. The returned object is of " "the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2237 +#: ../../library/ctypes.rst:2233 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." msgstr "" -#: ../../library/ctypes.rst:2243 +#: ../../library/ctypes.rst:2239 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -3828,145 +3815,145 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2251 +#: ../../library/ctypes.rst:2247 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." msgstr "" -#: ../../library/ctypes.rst:2254 +#: ../../library/ctypes.rst:2250 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." msgstr "" -"引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` " -"``ctypes.set_errno``。" +"引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." +"set_errno``。" -#: ../../library/ctypes.rst:2259 +#: ../../library/ctypes.rst:2255 msgid "" "Sets the current value of the ctypes-private copy of the system :data:`!" "LastError` variable in the calling thread to *value* and return the previous " "value." msgstr "" -#: ../../library/ctypes.rst:2265 +#: ../../library/ctypes.rst:2261 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." msgstr "" -"引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` " -"``ctypes.set_last_error``。" +"引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." +"set_last_error``。" -#: ../../library/ctypes.rst:2270 +#: ../../library/ctypes.rst:2266 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." msgstr "" -#: ../../library/ctypes.rst:2276 +#: ../../library/ctypes.rst:2272 msgid "" "Return the byte string at *void \\*ptr*. If *size* is specified, it is used " "as size, otherwise the string is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2280 +#: ../../library/ctypes.rst:2276 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``ptr``, ``size``." msgstr "" -"引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` " -"``ctypes.string_at``。" +"引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` ``ctypes." +"string_at``。" -#: ../../library/ctypes.rst:2285 +#: ../../library/ctypes.rst:2281 msgid "" -"Creates an instance of :exc:`OSError`. If *code* is not " -"specified, :func:`GetLastError` is called to determine the error code. If " -"*descr* is not specified, :func:`FormatError` is called to get a textual " -"description of the error." +"Creates an instance of :exc:`OSError`. If *code* is not specified, :func:" +"`GetLastError` is called to determine the error code. If *descr* is not " +"specified, :func:`FormatError` is called to get a textual description of the " +"error." msgstr "" -#: ../../library/ctypes.rst:2292 +#: ../../library/ctypes.rst:2288 msgid "" "An instance of :exc:`WindowsError` used to be created, which is now an alias " "of :exc:`OSError`." msgstr "" -#: ../../library/ctypes.rst:2299 +#: ../../library/ctypes.rst:2295 msgid "" "Return the wide-character string at *void \\*ptr*. If *size* is specified, " "it is used as the number of characters of the string, otherwise the string " "is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2304 +#: ../../library/ctypes.rst:2300 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``ptr``, ``size``." msgstr "" -"引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` " -"``ctypes.wstring_at``。" +"引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` ``ctypes." +"wstring_at``。" -#: ../../library/ctypes.rst:2309 +#: ../../library/ctypes.rst:2305 msgid "" "Return a :class:`memoryview` object of length *size* that references memory " "starting at *void \\*ptr*." msgstr "" -#: ../../library/ctypes.rst:2312 +#: ../../library/ctypes.rst:2308 msgid "" "If *readonly* is true, the returned :class:`!memoryview` object can not be " "used to modify the underlying memory. (Changes made by other means will " "still be reflected in the returned object.)" msgstr "" -#: ../../library/ctypes.rst:2317 +#: ../../library/ctypes.rst:2313 msgid "" "This function is similar to :func:`string_at` with the key difference of not " "making a copy of the specified memory. It is a semantically equivalent (but " -"more efficient) alternative to ``memoryview((c_byte * " -"size).from_address(ptr))``. (While :meth:`~_CData.from_address` only takes " -"integers, *ptr* can also be given as a :class:`ctypes.POINTER` or " -"a :func:`~ctypes.byref` object.)" +"more efficient) alternative to ``memoryview((c_byte * size)." +"from_address(ptr))``. (While :meth:`~_CData.from_address` only takes " +"integers, *ptr* can also be given as a :class:`ctypes.POINTER` or a :func:" +"`~ctypes.byref` object.)" msgstr "" -#: ../../library/ctypes.rst:2324 +#: ../../library/ctypes.rst:2320 msgid "" "Raises an :ref:`auditing event ` ``ctypes.memoryview_at`` with " "arguments ``address``, ``size``, ``readonly``." msgstr "" -"引發一個附帶引數 ``address``、``size`` 與 ``readonly`` 的\\ :ref:`稽核事件 ` " -"``ctypes.memoryview_at``。" +"引發一個附帶引數 ``address``、``size`` 與 ``readonly`` 的\\ :ref:`稽核事件 " +"` ``ctypes.memoryview_at``。" -#: ../../library/ctypes.rst:2332 +#: ../../library/ctypes.rst:2328 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2337 +#: ../../library/ctypes.rst:2333 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " -"hold C compatible data; the address of the memory block is returned by " -"the :func:`addressof` helper function. Another instance variable is exposed " -"as :attr:`_objects`; this contains other Python objects that need to be kept " +"hold C compatible data; the address of the memory block is returned by the :" +"func:`addressof` helper function. Another instance variable is exposed as :" +"attr:`_objects`; this contains other Python objects that need to be kept " "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2344 +#: ../../library/ctypes.rst:2340 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -#: ../../library/ctypes.rst:2349 +#: ../../library/ctypes.rst:2345 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " "The optional *offset* parameter specifies an offset into the source buffer " -"in bytes; the default is zero. If the source buffer is not large enough " -"a :exc:`ValueError` is raised." +"in bytes; the default is zero. If the source buffer is not large enough a :" +"exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2355 ../../library/ctypes.rst:2365 +#: ../../library/ctypes.rst:2351 ../../library/ctypes.rst:2361 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -3974,7 +3961,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2359 +#: ../../library/ctypes.rst:2355 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -3982,20 +3969,19 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2369 +#: ../../library/ctypes.rst:2365 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2372 ../../library/ctypes.rst:2374 +#: ../../library/ctypes.rst:2368 ../../library/ctypes.rst:2370 msgid "" -"This method, and others that indirectly call this method, raises " -"an :ref:`auditing event ` ``ctypes.cdata`` with argument " -"``address``." +"This method, and others that indirectly call this method, raises an :ref:" +"`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2380 +#: ../../library/ctypes.rst:2376 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " @@ -4003,50 +3989,50 @@ msgid "" "object that can be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2385 +#: ../../library/ctypes.rst:2381 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " "accept other objects as well." msgstr "" -#: ../../library/ctypes.rst:2391 +#: ../../library/ctypes.rst:2387 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " "loaded shared library." msgstr "" -#: ../../library/ctypes.rst:2395 +#: ../../library/ctypes.rst:2391 msgid "Common class variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2399 +#: ../../library/ctypes.rst:2395 msgid "" "The pointer type that was created by calling :func:`POINTER` for " "corresponding ctypes data type. If a pointer type was not yet created, the " "attribute is missing." msgstr "" -#: ../../library/ctypes.rst:2405 +#: ../../library/ctypes.rst:2401 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2409 +#: ../../library/ctypes.rst:2405 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " -"instead they share part of the memory block of a base object. " -"The :attr:`_b_base_` read-only member is the root ctypes object that owns " -"the memory block." +"instead they share part of the memory block of a base object. The :attr:" +"`_b_base_` read-only member is the root ctypes object that owns the memory " +"block." msgstr "" -#: ../../library/ctypes.rst:2416 +#: ../../library/ctypes.rst:2412 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2421 +#: ../../library/ctypes.rst:2417 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -4054,20 +4040,20 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2434 +#: ../../library/ctypes.rst:2430 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " -"fundamental ctypes data types. :class:`_SimpleCData` is a subclass " -"of :class:`_CData`, so it inherits their methods and attributes. ctypes data " +"fundamental ctypes data types. :class:`_SimpleCData` is a subclass of :" +"class:`_CData`, so it inherits their methods and attributes. ctypes data " "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2440 +#: ../../library/ctypes.rst:2436 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2444 +#: ../../library/ctypes.rst:2440 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -4075,7 +4061,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2449 +#: ../../library/ctypes.rst:2445 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -4083,7 +4069,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2455 +#: ../../library/ctypes.rst:2451 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -4093,7 +4079,7 @@ msgid "" "instance." msgstr "" -#: ../../library/ctypes.rst:2463 +#: ../../library/ctypes.rst:2459 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " "a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " @@ -4101,25 +4087,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2468 +#: ../../library/ctypes.rst:2464 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2472 +#: ../../library/ctypes.rst:2468 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2479 +#: ../../library/ctypes.rst:2475 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2486 +#: ../../library/ctypes.rst:2482 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -4127,287 +4113,287 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2494 +#: ../../library/ctypes.rst:2490 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2500 +#: ../../library/ctypes.rst:2496 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2506 +#: ../../library/ctypes.rst:2502 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2512 +#: ../../library/ctypes.rst:2508 msgid "" "Represents the C :c:expr:`double complex` datatype, if available. The " "constructor accepts an optional :class:`complex` initializer." msgstr "" -#: ../../library/ctypes.rst:2520 +#: ../../library/ctypes.rst:2516 msgid "" "Represents the C :c:expr:`float complex` datatype, if available. The " "constructor accepts an optional :class:`complex` initializer." msgstr "" -#: ../../library/ctypes.rst:2528 +#: ../../library/ctypes.rst:2524 msgid "" "Represents the C :c:expr:`long double complex` datatype, if available. The " "constructor accepts an optional :class:`complex` initializer." msgstr "" -#: ../../library/ctypes.rst:2536 +#: ../../library/ctypes.rst:2532 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2543 +#: ../../library/ctypes.rst:2539 msgid "" -"Represents the C 8-bit :c:expr:`signed int` datatype. It is an alias " -"for :class:`c_byte`." +"Represents the C 8-bit :c:expr:`signed int` datatype. It is an alias for :" +"class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2549 +#: ../../library/ctypes.rst:2545 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2555 +#: ../../library/ctypes.rst:2551 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2561 +#: ../../library/ctypes.rst:2557 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2567 +#: ../../library/ctypes.rst:2563 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2573 +#: ../../library/ctypes.rst:2569 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2579 +#: ../../library/ctypes.rst:2575 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2585 +#: ../../library/ctypes.rst:2581 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2590 +#: ../../library/ctypes.rst:2586 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2597 +#: ../../library/ctypes.rst:2593 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2604 +#: ../../library/ctypes.rst:2600 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2611 +#: ../../library/ctypes.rst:2607 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2618 +#: ../../library/ctypes.rst:2614 msgid "" -"Represents the C 8-bit :c:expr:`unsigned int` datatype. It is an alias " -"for :class:`c_ubyte`." +"Represents the C 8-bit :c:expr:`unsigned int` datatype. It is an alias for :" +"class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2624 +#: ../../library/ctypes.rst:2620 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2630 +#: ../../library/ctypes.rst:2626 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2636 +#: ../../library/ctypes.rst:2632 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2642 +#: ../../library/ctypes.rst:2638 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2648 +#: ../../library/ctypes.rst:2644 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2654 +#: ../../library/ctypes.rst:2650 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2660 +#: ../../library/ctypes.rst:2656 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2666 +#: ../../library/ctypes.rst:2662 msgid "" "Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2673 +#: ../../library/ctypes.rst:2669 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2680 +#: ../../library/ctypes.rst:2676 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2687 +#: ../../library/ctypes.rst:2683 msgid "" "Represents a :c:type:`!HRESULT` value, which contains success or error " "information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2695 +#: ../../library/ctypes.rst:2691 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2698 +#: ../../library/ctypes.rst:2694 msgid ":class:`!py_object` is now a :term:`generic type`." msgstr "" -#: ../../library/ctypes.rst:2701 +#: ../../library/ctypes.rst:2697 msgid "" "The :mod:`!ctypes.wintypes` module provides quite some other Windows " -"specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, " -"or :c:type:`!DWORD`. Some useful structures like :c:type:`!MSG` or :c:type:`!" -"RECT` are also defined." +"specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" +"type:`!DWORD`. Some useful structures like :c:type:`!MSG` or :c:type:`!RECT` " +"are also defined." msgstr "" -#: ../../library/ctypes.rst:2709 +#: ../../library/ctypes.rst:2705 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2714 +#: ../../library/ctypes.rst:2710 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2716 +#: ../../library/ctypes.rst:2712 msgid "" -"Unions share common attributes and behavior with structures; " -"see :class:`Structure` documentation for details." +"Unions share common attributes and behavior with structures; see :class:" +"`Structure` documentation for details." msgstr "" -#: ../../library/ctypes.rst:2721 +#: ../../library/ctypes.rst:2717 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2727 +#: ../../library/ctypes.rst:2723 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2733 +#: ../../library/ctypes.rst:2729 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2738 +#: ../../library/ctypes.rst:2734 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2740 +#: ../../library/ctypes.rst:2736 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2746 +#: ../../library/ctypes.rst:2742 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2748 +#: ../../library/ctypes.rst:2744 msgid "" "Concrete structure and union types must be created by subclassing one of " -"these types, and at least define a :attr:`_fields_` class " -"variable. :mod:`ctypes` will create :term:`descriptor`\\s which allow " -"reading and writing the fields by direct attribute accesses. These are the" +"these types, and at least define a :attr:`_fields_` class variable. :mod:" +"`ctypes` will create :term:`descriptor`\\s which allow reading and writing " +"the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2756 +#: ../../library/ctypes.rst:2752 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " "the type of the field; it can be any ctypes data type." msgstr "" -#: ../../library/ctypes.rst:2760 +#: ../../library/ctypes.rst:2756 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " "field." msgstr "" -#: ../../library/ctypes.rst:2764 +#: ../../library/ctypes.rst:2760 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." msgstr "" -#: ../../library/ctypes.rst:2767 +#: ../../library/ctypes.rst:2763 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " "data types that directly or indirectly reference themselves::" msgstr "" -#: ../../library/ctypes.rst:2771 +#: ../../library/ctypes.rst:2767 msgid "" "class List(Structure):\n" " pass\n" @@ -4421,41 +4407,55 @@ msgstr "" " ...\n" " ]" -#: ../../library/ctypes.rst:2777 +#: ../../library/ctypes.rst:2773 msgid "" "The :attr:`!_fields_` class variable can only be set once. Later assignments " "will raise an :exc:`AttributeError`." msgstr "" -#: ../../library/ctypes.rst:2780 +#: ../../library/ctypes.rst:2776 msgid "" "Additionally, the :attr:`!_fields_` class variable must be defined before " "the structure or union type is first used: an instance or subclass is " -"created, :func:`sizeof` is called on it, and so on. Later assignments " -"to :attr:`!_fields_` will raise an :exc:`AttributeError`. If :attr:`!" -"_fields_` has not been set before such use, the structure or union will have " -"no own fields, as if :attr:`!_fields_` was empty." +"created, :func:`sizeof` is called on it, and so on. Later assignments to :" +"attr:`!_fields_` will raise an :exc:`AttributeError`. If :attr:`!_fields_` " +"has not been set before such use, the structure or union will have no own " +"fields, as if :attr:`!_fields_` was empty." msgstr "" -#: ../../library/ctypes.rst:2788 +#: ../../library/ctypes.rst:2784 msgid "" "Sub-subclasses of structure types inherit the fields of the base class plus " "the :attr:`_fields_` defined in the sub-subclass, if any." msgstr "" -#: ../../library/ctypes.rst:2794 +#: ../../library/ctypes.rst:2790 msgid "" "An optional small integer that allows overriding the alignment of structure " -"fields in the instance. :attr:`_pack_` must already be defined " -"when :attr:`_fields_` is assigned, otherwise it will have no effect. Setting " -"this attribute to 0 is the same as not setting it at all." +"fields in the instance." +msgstr "" + +#: ../../library/ctypes.rst:2793 +msgid "" +"This is only implemented for the MSVC-compatible memory layout (see :attr:" +"`_layout_`)." +msgstr "" + +#: ../../library/ctypes.rst:2796 +msgid "" +"Setting :attr:`!_pack_` to 0 is the same as not setting it at all. " +"Otherwise, the value must be a positive power of two. The effect is " +"equivalent to ``#pragma pack(N)`` in C, except :mod:`ctypes` may allow " +"larger *n* than what the compiler accepts." msgstr "" -#: ../../library/ctypes.rst:2799 -msgid "This is only implemented for the MSVC-compatible memory layout." +#: ../../library/ctypes.rst:2801 +msgid "" +":attr:`!_pack_` must already be defined when :attr:`_fields_` is assigned, " +"otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2803 +#: ../../library/ctypes.rst:2806 msgid "" "For historical reasons, if :attr:`!_pack_` is non-zero, the MSVC-compatible " "layout will be used by default. On non-Windows platforms, this default is " @@ -4463,33 +4463,57 @@ msgid "" "intended, set :attr:`~Structure._layout_` to ``'ms'`` explicitly." msgstr "" -#: ../../library/ctypes.rst:2812 +#: ../../library/ctypes.rst:2815 msgid "" -"An optional small integer that allows overriding the alignment of the " -"structure when being packed or unpacked to/from memory. Setting this " -"attribute to 0 is the same as not setting it at all." +"An optional small integer that allows increasing the alignment of the " +"structure when being packed or unpacked to/from memory." msgstr "" -#: ../../library/ctypes.rst:2820 +#: ../../library/ctypes.rst:2818 +msgid "" +"The value must not be negative. The effect is equivalent to " +"``__attribute__((aligned(N)))`` on GCC or ``#pragma align(N)`` on MSVC, " +"except :mod:`ctypes` may allow values that the compiler would reject." +msgstr "" + +#: ../../library/ctypes.rst:2823 +msgid "" +":attr:`!_align_` can only *increase* a structure's alignment requirements. " +"Setting it to 0 or 1 has no effect." +msgstr "" + +#: ../../library/ctypes.rst:2826 +msgid "" +"Using values that are not powers of two is discouraged and may lead to " +"surprising behavior." +msgstr "" + +#: ../../library/ctypes.rst:2829 +msgid "" +":attr:`!_align_` must already be defined when :attr:`_fields_` is assigned, " +"otherwise it will have no effect." +msgstr "" + +#: ../../library/ctypes.rst:2836 msgid "" "An optional string naming the struct/union layout. It can currently be set " "to:" msgstr "" -#: ../../library/ctypes.rst:2823 +#: ../../library/ctypes.rst:2839 msgid "" "``\"ms\"``: the layout used by the Microsoft compiler (MSVC). On GCC and " "Clang, this layout can be selected with ``__attribute__((ms_struct))``." msgstr "" -#: ../../library/ctypes.rst:2826 +#: ../../library/ctypes.rst:2842 msgid "" "``\"gcc-sysv\"``: the layout used by GCC with the System V or “SysV-like” " -"data model, as used on Linux and macOS. With this " -"layout, :attr:`~Structure._pack_` must be unset or zero." +"data model, as used on Linux and macOS. With this layout, :attr:`~Structure." +"_pack_` must be unset or zero." msgstr "" -#: ../../library/ctypes.rst:2830 +#: ../../library/ctypes.rst:2846 msgid "" "If not set explicitly, ``ctypes`` will use a default that matches the " "platform conventions. This default may change in future Python releases (for " @@ -4497,46 +4521,46 @@ msgid "" "between similar platforms is found). Currently the default will be:" msgstr "" -#: ../../library/ctypes.rst:2836 +#: ../../library/ctypes.rst:2852 msgid "On Windows: ``\"ms\"``" msgstr "" -#: ../../library/ctypes.rst:2837 +#: ../../library/ctypes.rst:2853 msgid "" "When :attr:`~Structure._pack_` is specified: ``\"ms\"``. (This is " "deprecated; see :attr:`~Structure._pack_` documentation.)" msgstr "" -#: ../../library/ctypes.rst:2839 +#: ../../library/ctypes.rst:2855 msgid "Otherwise: ``\"gcc-sysv\"``" msgstr "" -#: ../../library/ctypes.rst:2841 +#: ../../library/ctypes.rst:2857 msgid "" ":attr:`!_layout_` must already be defined when :attr:`~Structure._fields_` " "is assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2848 +#: ../../library/ctypes.rst:2864 msgid "" -"An optional sequence that lists the names of unnamed (anonymous) " -"fields. :attr:`_anonymous_` must be already defined when :attr:`_fields_` is " +"An optional sequence that lists the names of unnamed (anonymous) fields. :" +"attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2852 +#: ../../library/ctypes.rst:2868 msgid "" -"The fields listed in this variable must be structure or union type " -"fields. :mod:`ctypes` will create descriptors in the structure type that " -"allows accessing the nested fields directly, without the need to create the " +"The fields listed in this variable must be structure or union type fields. :" +"mod:`ctypes` will create descriptors in the structure type that allows " +"accessing the nested fields directly, without the need to create the " "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2857 +#: ../../library/ctypes.rst:2873 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2859 +#: ../../library/ctypes.rst:2875 msgid "" "class _U(Union):\n" " _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" @@ -4558,7 +4582,7 @@ msgstr "" " _fields_ = [(\"u\", _U),\n" " (\"vt\", VARTYPE)]" -#: ../../library/ctypes.rst:2870 +#: ../../library/ctypes.rst:2886 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -4568,7 +4592,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2877 +#: ../../library/ctypes.rst:2893 msgid "" "td = TYPEDESC()\n" "td.vt = VT_PTR\n" @@ -4580,15 +4604,15 @@ msgstr "" "td.lptdesc = POINTER(some_type)\n" "td.u.lptdesc = POINTER(some_type)" -#: ../../library/ctypes.rst:2882 +#: ../../library/ctypes.rst:2898 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " -"fields of the base class. If the subclass definition has a " -"separate :attr:`_fields_` variable, the fields specified in this are " -"appended to the fields of the base class." +"fields of the base class. If the subclass definition has a separate :attr:" +"`_fields_` variable, the fields specified in this are appended to the fields " +"of the base class." msgstr "" -#: ../../library/ctypes.rst:2887 +#: ../../library/ctypes.rst:2903 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -4598,13 +4622,13 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2897 +#: ../../library/ctypes.rst:2913 msgid "" "Descriptor for fields of a :class:`Structure` and :class:`Union`. For " "example::" msgstr "" -#: ../../library/ctypes.rst:2900 +#: ../../library/ctypes.rst:2916 msgid "" ">>> class Color(Structure):\n" "... _fields_ = (\n" @@ -4627,195 +4651,194 @@ msgid "" "1" msgstr "" -#: ../../library/ctypes.rst:2920 +#: ../../library/ctypes.rst:2936 msgid "All attributes are read-only." msgstr "" -#: ../../library/ctypes.rst:2922 +#: ../../library/ctypes.rst:2938 msgid "" ":class:`!CField` objects are created via :attr:`~Structure._fields_`; do not " "instantiate the class directly." msgstr "" -#: ../../library/ctypes.rst:2927 +#: ../../library/ctypes.rst:2943 msgid "" "Previously, descriptors only had ``offset`` and ``size`` attributes and a " "readable string representation; the :class:`!CField` class was not available " "directly." msgstr "" -#: ../../library/ctypes.rst:2933 +#: ../../library/ctypes.rst:2949 msgid "Name of the field, as a string." msgstr "" -#: ../../library/ctypes.rst:2937 +#: ../../library/ctypes.rst:2953 msgid "Type of the field, as a :ref:`ctypes class `." msgstr "" -#: ../../library/ctypes.rst:2942 +#: ../../library/ctypes.rst:2958 msgid "Offset of the field, in bytes." msgstr "" -#: ../../library/ctypes.rst:2944 +#: ../../library/ctypes.rst:2960 msgid "" "For bitfields, this is the offset of the underlying byte-aligned *storage " "unit*; see :attr:`~CField.bit_offset`." msgstr "" -#: ../../library/ctypes.rst:2949 +#: ../../library/ctypes.rst:2965 msgid "Size of the field, in bytes." msgstr "" -#: ../../library/ctypes.rst:2951 +#: ../../library/ctypes.rst:2967 msgid "" "For bitfields, this is the size of the underlying *storage unit*. Typically, " "it has the same size as the bitfield's type." msgstr "" -#: ../../library/ctypes.rst:2956 +#: ../../library/ctypes.rst:2972 msgid "For non-bitfields, equivalent to :attr:`~CField.byte_size`." msgstr "" -#: ../../library/ctypes.rst:2958 +#: ../../library/ctypes.rst:2974 msgid "" "For bitfields, this contains a backwards-compatible bit-packed value that " "combines :attr:`~CField.bit_size` and :attr:`~CField.bit_offset`. Prefer " "using the explicit attributes instead." msgstr "" -#: ../../library/ctypes.rst:2965 +#: ../../library/ctypes.rst:2981 msgid "True if this is a bitfield." msgstr "" -#: ../../library/ctypes.rst:2970 +#: ../../library/ctypes.rst:2986 msgid "" -"The location of a bitfield within its *storage unit*, that is, " -"within :attr:`~CField.byte_size` bytes of memory starting " -"at :attr:`~CField.byte_offset`." +"The location of a bitfield within its *storage unit*, that is, within :attr:" +"`~CField.byte_size` bytes of memory starting at :attr:`~CField.byte_offset`." msgstr "" -#: ../../library/ctypes.rst:2974 +#: ../../library/ctypes.rst:2990 msgid "" "To get the field's value, read the storage unit as an integer, :ref:`shift " "left ` by :attr:`!bit_offset` and take the :attr:`!bit_size` least " "significant bits." msgstr "" -#: ../../library/ctypes.rst:2978 +#: ../../library/ctypes.rst:2994 msgid "" "For non-bitfields, :attr:`!bit_offset` is zero and :attr:`!bit_size` is " "equal to ``byte_size * 8``." msgstr "" -#: ../../library/ctypes.rst:2983 +#: ../../library/ctypes.rst:2999 msgid "" "True if this field is anonymous, that is, it contains nested sub-fields that " "should be merged into a containing structure or union." msgstr "" -#: ../../library/ctypes.rst:2990 +#: ../../library/ctypes.rst:3006 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2994 +#: ../../library/ctypes.rst:3010 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2996 +#: ../../library/ctypes.rst:3012 msgid "" -"The recommended way to create concrete array types is by multiplying " -"any :mod:`ctypes` data type with a non-negative integer. Alternatively, you " -"can subclass this type and define :attr:`_length_` and :attr:`_type_` class " +"The recommended way to create concrete array types is by multiplying any :" +"mod:`ctypes` data type with a non-negative integer. Alternatively, you can " +"subclass this type and define :attr:`_length_` and :attr:`_type_` class " "variables. Array elements can be read and written using standard subscript " "and slice accesses; for slice reads, the resulting object is *not* itself " "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:3006 +#: ../../library/ctypes.rst:3022 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" -"range subscripts result in an :exc:`IndexError`. Will be returned " -"by :func:`len`." +"range subscripts result in an :exc:`IndexError`. Will be returned by :func:" +"`len`." msgstr "" -#: ../../library/ctypes.rst:3013 +#: ../../library/ctypes.rst:3029 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:3016 +#: ../../library/ctypes.rst:3032 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:3021 +#: ../../library/ctypes.rst:3037 msgid "" -"Create an array. Equivalent to ``type * length``, where *type* is " -"a :mod:`ctypes` data type and *length* an integer." +"Create an array. Equivalent to ``type * length``, where *type* is a :mod:" +"`ctypes` data type and *length* an integer." msgstr "" -#: ../../library/ctypes.rst:3025 +#: ../../library/ctypes.rst:3041 msgid "" "This function is :term:`soft deprecated` in favor of multiplication. There " "are no plans to remove it." msgstr "" -#: ../../library/ctypes.rst:3031 +#: ../../library/ctypes.rst:3047 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:3033 +#: ../../library/ctypes.rst:3049 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:3037 +#: ../../library/ctypes.rst:3053 msgid "" "If a pointer points to an array, its elements can be read and written using " -"standard subscript and slice accesses. Pointer objects have no size, " -"so :func:`len` will raise :exc:`TypeError`. Negative subscripts will read " -"from the memory *before* the pointer (as in C), and out-of-range subscripts " -"will probably crash with an access violation (if you're lucky)." +"standard subscript and slice accesses. Pointer objects have no size, so :" +"func:`len` will raise :exc:`TypeError`. Negative subscripts will read from " +"the memory *before* the pointer (as in C), and out-of-range subscripts will " +"probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:3047 +#: ../../library/ctypes.rst:3063 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:3051 +#: ../../library/ctypes.rst:3067 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." msgstr "" -#: ../../library/ctypes.rst:3058 +#: ../../library/ctypes.rst:3074 msgid "Exceptions" msgstr "" -#: ../../library/ctypes.rst:3062 +#: ../../library/ctypes.rst:3078 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:3068 +#: ../../library/ctypes.rst:3084 msgid "This exception is raised when a COM method call failed." msgstr "" -#: ../../library/ctypes.rst:3072 +#: ../../library/ctypes.rst:3088 msgid "The integer value representing the error code." msgstr "" -#: ../../library/ctypes.rst:3076 +#: ../../library/ctypes.rst:3092 msgid "The error message." msgstr "" -#: ../../library/ctypes.rst:3080 +#: ../../library/ctypes.rst:3096 msgid "The 5-tuple ``(descr, source, helpfile, helpcontext, progid)``." msgstr "" -#: ../../library/ctypes.rst:3082 +#: ../../library/ctypes.rst:3098 msgid "" "*descr* is the textual description. *source* is the language-dependent " "``ProgID`` for the class or application that raised the error. *helpfile* " diff --git a/library/curses.po b/library/curses.po index 10b29c30bb..22a634e968 100644 --- a/library/curses.po +++ b/library/curses.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -183,9 +183,9 @@ msgstr "" msgid "" "Return the attribute value for displaying text in the specified color pair. " "Only the first 256 color pairs are supported. This attribute value can be " -"combined with :const:`A_STANDOUT`, :const:`A_REVERSE`, and the " -"other :const:`!A_\\*` attributes. :func:`pair_number` is the counterpart to " -"this function." +"combined with :const:`A_STANDOUT`, :const:`A_REVERSE`, and the other :const:" +"`!A_\\*` attributes. :func:`pair_number` is the counterpart to this " +"function." msgstr "" #: ../../library/curses.rst:133 @@ -201,16 +201,16 @@ msgstr "" msgid "" "Save the current terminal mode as the \"program\" mode, the mode when the " "running program is using curses. (Its counterpart is the \"shell\" mode, " -"for when the program is not in curses.) Subsequent calls " -"to :func:`reset_prog_mode` will restore this mode." +"for when the program is not in curses.) Subsequent calls to :func:" +"`reset_prog_mode` will restore this mode." msgstr "" #: ../../library/curses.rst:150 msgid "" "Save the current terminal mode as the \"shell\" mode, the mode when the " "running program is not using curses. (Its counterpart is the \"program\" " -"mode, when the program is using curses capabilities.) Subsequent calls " -"to :func:`reset_shell_mode` will restore this mode." +"mode, when the program is using curses capabilities.) Subsequent calls to :" +"func:`reset_shell_mode` will restore this mode." msgstr "" #: ../../library/curses.rst:158 @@ -232,8 +232,8 @@ msgid "" "a window. The normal :meth:`~window.refresh` call is simply :meth:`!" "noutrefresh` followed by :func:`!doupdate`; if you have to update multiple " "windows, you can speed performance and perhaps reduce screen flicker by " -"issuing :meth:`!noutrefresh` calls on all windows, followed by a " -"single :func:`!doupdate`." +"issuing :meth:`!noutrefresh` calls on all windows, followed by a single :" +"func:`!doupdate`." msgstr "" #: ../../library/curses.rst:178 @@ -286,8 +286,10 @@ msgid "" "coordinates. (*z* is currently unused.) *bstate* is an integer value whose " "bits will be set to indicate the type of event, and will be the bitwise OR " "of one or more of the following constants, where *n* is the button number " -"from 1 to " -"5: :const:`BUTTONn_PRESSED`, :const:`BUTTONn_RELEASED`, :const:`BUTTONn_CLICKED`, :const:`BUTTONn_DOUBLE_CLICKED`, :const:`BUTTONn_TRIPLE_CLICKED`, :const:`BUTTON_SHIFT`, :const:`BUTTON_CTRL`, :const:`BUTTON_ALT`." +"from 1 to 5: :const:`BUTTONn_PRESSED`, :const:`BUTTONn_RELEASED`, :const:" +"`BUTTONn_CLICKED`, :const:`BUTTONn_DOUBLE_CLICKED`, :const:" +"`BUTTONn_TRIPLE_CLICKED`, :const:`BUTTON_SHIFT`, :const:`BUTTON_CTRL`, :" +"const:`BUTTON_ALT`." msgstr "" #: ../../library/curses.rst:230 ../../library/curses.rst:1799 @@ -305,9 +307,9 @@ msgstr "" #: ../../library/curses.rst:243 msgid "" -"Read window related data stored in the file by an " -"earlier :func:`window.putwin` call. The routine then creates and initializes " -"a new window using that data, returning the new window object." +"Read window related data stored in the file by an earlier :func:`window." +"putwin` call. The routine then creates and initializes a new window using " +"that data, returning the new window object." msgstr "" #: ../../library/curses.rst:250 @@ -374,10 +376,10 @@ msgid "" "Change the definition of a color-pair. It takes three arguments: the number " "of the color-pair to be changed, the foreground color number, and the " "background color number. The value of *pair_number* must be between ``1`` " -"and ``COLOR_PAIRS - 1`` (the ``0`` color pair can only be changed " -"by :func:`use_default_colors` and :func:`assume_default_colors`). The value " -"of *fg* and *bg* arguments must be between ``0`` and ``COLORS - 1``, or, " -"after calling :func:`!use_default_colors` or :func:`!assume_default_colors`, " +"and ``COLOR_PAIRS - 1`` (the ``0`` color pair can only be changed by :func:" +"`use_default_colors` and :func:`assume_default_colors`). The value of *fg* " +"and *bg* arguments must be between ``0`` and ``COLORS - 1``, or, after " +"calling :func:`!use_default_colors` or :func:`!assume_default_colors`, " "``-1``. If the color-pair was previously initialized, the screen is " "refreshed and all occurrences of that color-pair are changed to the new " "definition." @@ -471,14 +473,14 @@ msgid "" "and is not necessarily associated with a particular part of the screen. " "Pads can be used when a large window is needed, and only a part of the " "window will be on the screen at one time. Automatic refreshes of pads (such " -"as from scrolling or echoing of input) do not occur. " -"The :meth:`~window.refresh` and :meth:`~window.noutrefresh` methods of a pad " -"require 6 arguments to specify the part of the pad to be displayed and the " -"location on the screen to be used for the display. The arguments are " -"*pminrow*, *pmincol*, *sminrow*, *smincol*, *smaxrow*, *smaxcol*; the *p* " -"arguments refer to the upper left corner of the pad region to be displayed " -"and the *s* arguments define a clipping box on the screen within which the " -"pad region is to be displayed." +"as from scrolling or echoing of input) do not occur. The :meth:`~window." +"refresh` and :meth:`~window.noutrefresh` methods of a pad require 6 " +"arguments to specify the part of the pad to be displayed and the location on " +"the screen to be used for the display. The arguments are *pminrow*, " +"*pmincol*, *sminrow*, *smincol*, *smaxrow*, *smaxcol*; the *p* arguments " +"refer to the upper left corner of the pad region to be displayed and the *s* " +"arguments define a clipping box on the screen within which the pad region is " +"to be displayed." msgstr "" #: ../../library/curses.rst:413 @@ -541,15 +543,15 @@ msgstr "" #: ../../library/curses.rst:468 msgid "" -"Return the number of the color-pair set by the attribute value " -"*attr*. :func:`color_pair` is the counterpart to this function." +"Return the number of the color-pair set by the attribute value *attr*. :func:" +"`color_pair` is the counterpart to this function." msgstr "" #: ../../library/curses.rst:474 msgid "" "Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified " -"terminfo capability for the current terminal. Note that the output " -"of :func:`putp` always goes to standard output." +"terminfo capability for the current terminal. Note that the output of :func:" +"`putp` always goes to standard output." msgstr "" #: ../../library/curses.rst:481 @@ -568,20 +570,20 @@ msgstr "" #: ../../library/curses.rst:495 msgid "" -"Restore the terminal to \"program\" mode, as previously saved " -"by :func:`def_prog_mode`." +"Restore the terminal to \"program\" mode, as previously saved by :func:" +"`def_prog_mode`." msgstr "" #: ../../library/curses.rst:501 msgid "" -"Restore the terminal to \"shell\" mode, as previously saved " -"by :func:`def_shell_mode`." +"Restore the terminal to \"shell\" mode, as previously saved by :func:" +"`def_shell_mode`." msgstr "" #: ../../library/curses.rst:507 msgid "" -"Restore the state of the terminal modes to what it was at the last call " -"to :func:`savetty`." +"Restore the state of the terminal modes to what it was at the last call to :" +"func:`savetty`." msgstr "" #: ../../library/curses.rst:513 @@ -603,8 +605,8 @@ msgstr "" #: ../../library/curses.rst:530 msgid "" -"Save the current state of the terminal modes in a buffer, usable " -"by :func:`resetty`." +"Save the current state of the terminal modes in a buffer, usable by :func:" +"`resetty`." msgstr "" #: ../../library/curses.rst:535 @@ -653,11 +655,11 @@ msgstr "" #: ../../library/curses.rst:581 msgid "" ":func:`start_color` initializes eight basic colors (black, red, green, " -"yellow, blue, magenta, cyan, and white), and two global variables in " -"the :mod:`curses` module, :const:`COLORS` and :const:`COLOR_PAIRS`, " -"containing the maximum number of colors and color-pairs the terminal can " -"support. It also restores the colors on the terminal to the values they had " -"when the terminal was just turned on." +"yellow, blue, magenta, cyan, and white), and two global variables in the :" +"mod:`curses` module, :const:`COLORS` and :const:`COLOR_PAIRS`, containing " +"the maximum number of colors and color-pairs the terminal can support. It " +"also restores the colors on the terminal to the values they had when the " +"terminal was just turned on." msgstr "" #: ../../library/curses.rst:590 @@ -846,8 +848,8 @@ msgstr "" #: ../../library/curses.rst:775 msgid "" -"Add attribute *attr* from the \"background\" set applied to all writes to " -"the current window." +"Add attribute *attr* to the \"background\" set applied to all writes to the " +"current window." msgstr "" #: ../../library/curses.rst:781 @@ -1065,8 +1067,8 @@ msgstr "" #: ../../library/curses.rst:910 msgid "" -"Add character *ch* with attribute *attr*, and immediately " -"call :meth:`refresh` on the window." +"Add character *ch* with attribute *attr*, and immediately call :meth:" +"`refresh` on the window." msgstr "" #: ../../library/curses.rst:916 @@ -1236,15 +1238,15 @@ msgstr "" #: ../../library/curses.rst:1096 msgid "" -"Return ``True`` if the specified line was modified since the last call " -"to :meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " +"Return ``True`` if the specified line was modified since the last call to :" +"meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " "exception if *line* is not valid for the given window." msgstr "" #: ../../library/curses.rst:1103 msgid "" -"Return ``True`` if the specified window was modified since the last call " -"to :meth:`refresh`; otherwise return ``False``." +"Return ``True`` if the specified window was modified since the last call to :" +"meth:`refresh`; otherwise return ``False``." msgstr "" #: ../../library/curses.rst:1109 @@ -1313,8 +1315,8 @@ msgstr "" #: ../../library/curses.rst:1167 msgid "" -"To get fine-grained control over the copied region, the second form " -"of :meth:`overlay` can be used. *sminrow* and *smincol* are the upper-left " +"To get fine-grained control over the copied region, the second form of :meth:" +"`overlay` can be used. *sminrow* and *smincol* are the upper-left " "coordinates of the source window, and the other variables mark a rectangle " "in the destination window." msgstr "" @@ -1329,8 +1331,8 @@ msgstr "" #: ../../library/curses.rst:1180 msgid "" -"To get fine-grained control over the copied region, the second form " -"of :meth:`overwrite` can be used. *sminrow* and *smincol* are the upper-left " +"To get fine-grained control over the copied region, the second form of :meth:" +"`overwrite` can be used. *sminrow* and *smincol* are the upper-left " "coordinates of the source window, the other variables mark a rectangle in " "the destination window." msgstr "" @@ -1349,8 +1351,8 @@ msgstr "" #: ../../library/curses.rst:1200 msgid "" -"Touch the entire window, causing it to be completely redrawn on the " -"next :meth:`refresh` call." +"Touch the entire window, causing it to be completely redrawn on the next :" +"meth:`refresh` call." msgstr "" #: ../../library/curses.rst:1206 @@ -1448,9 +1450,9 @@ msgid "" "Set blocking or non-blocking read behavior for the window. If *delay* is " "negative, blocking read is used (which will wait indefinitely for input). " "If *delay* is zero, then non-blocking read is used, and :meth:`getch` will " -"return ``-1`` if no input is waiting. If *delay* is positive, " -"then :meth:`getch` will block for *delay* milliseconds, and return ``-1`` if " -"there is still no input at the end of that time." +"return ``-1`` if no input is waiting. If *delay* is positive, then :meth:" +"`getch` will block for *delay* milliseconds, and return ``-1`` if there is " +"still no input at the end of that time." msgstr "" #: ../../library/curses.rst:1309 @@ -1469,8 +1471,8 @@ msgstr "" #: ../../library/curses.rst:1322 msgid "" -"Mark all lines in the window as unchanged since the last call " -"to :meth:`refresh`." +"Mark all lines in the window as unchanged since the last call to :meth:" +"`refresh`." msgstr "" #: ../../library/curses.rst:1329 @@ -1489,8 +1491,8 @@ msgstr ":mod:`curses` 模組定義了以下資料成員:" #: ../../library/curses.rst:1341 msgid "" -"Some curses routines that return an integer, such " -"as :meth:`~window.getch`, return :const:`ERR` upon failure." +"Some curses routines that return an integer, such as :meth:`~window." +"getch`, return :const:`ERR` upon failure." msgstr "" #: ../../library/curses.rst:1347 @@ -1530,15 +1532,15 @@ msgstr "" #: ../../library/curses.rst:1380 msgid "" "The width of the screen, i.e., the number of columns. It is defined only " -"after the call to :func:`initscr`. Updated " -"by :func:`update_lines_cols`, :func:`resizeterm` and :func:`resize_term`." +"after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" +"func:`resizeterm` and :func:`resize_term`." msgstr "" #: ../../library/curses.rst:1387 msgid "" "The height of the screen, i.e., the number of lines. It is defined only " -"after the call to :func:`initscr`. Updated " -"by :func:`update_lines_cols`, :func:`resizeterm` and :func:`resize_term`." +"after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" +"func:`resizeterm` and :func:`resize_term`." msgstr "" #: ../../library/curses.rst:1393 @@ -2043,14 +2045,13 @@ msgstr "" #: ../../library/curses.rst:1652 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " -"are normally at least four function keys (:const:`KEY_F1 " -"`, :const:`KEY_F2 `, :const:`KEY_F3 " -"`, :const:`KEY_F4 `) available, and the arrow keys mapped " -"to :const:`KEY_UP`, :const:`KEY_DOWN`, :const:`KEY_LEFT` " -"and :const:`KEY_RIGHT` in the obvious way. If your machine has a PC " -"keyboard, it is safe to expect arrow keys and twelve function keys (older PC " -"keyboards may have only ten function keys); also, the following keypad " -"mappings are standard:" +"are normally at least four function keys (:const:`KEY_F1 `, :const:" +"`KEY_F2 `, :const:`KEY_F3 `, :const:`KEY_F4 `) " +"available, and the arrow keys mapped to :const:`KEY_UP`, :const:`KEY_DOWN`, :" +"const:`KEY_LEFT` and :const:`KEY_RIGHT` in the obvious way. If your machine " +"has a PC keyboard, it is safe to expect arrow keys and twelve function keys " +"(older PC keyboards may have only ten function keys); also, the following " +"keypad mappings are standard:" msgstr "" #: ../../library/curses.rst:1661 @@ -2415,11 +2416,11 @@ msgstr "" #: ../../library/curses.rst:1866 msgid "" -"Return a textbox widget object. The *win* argument should be a " -"curses :ref:`window ` object in which the textbox is " -"to be contained. The edit cursor of the textbox is initially located at the " -"upper left hand corner of the containing window, with coordinates ``(0, " -"0)``. The instance's :attr:`stripspaces` flag is initially on." +"Return a textbox widget object. The *win* argument should be a curses :ref:" +"`window ` object in which the textbox is to be " +"contained. The edit cursor of the textbox is initially located at the upper " +"left hand corner of the containing window, with coordinates ``(0, 0)``. The " +"instance's :attr:`stripspaces` flag is initially on." msgstr "" #: ../../library/curses.rst:1872 @@ -2433,8 +2434,8 @@ msgid "" "*validator* is supplied, it must be a function. It will be called for each " "keystroke entered with the keystroke as a parameter; command dispatch is " "done on the result. This method returns the window contents as a string; " -"whether blanks in the window are included is affected by " -"the :attr:`stripspaces` attribute." +"whether blanks in the window are included is affected by the :attr:" +"`stripspaces` attribute." msgstr "" #: ../../library/curses.rst:1888 diff --git a/library/dataclasses.po b/library/dataclasses.po index 9eeb64a381..a76ca8eece 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-10 20:44+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2023-02-11 15:02+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,9 +27,9 @@ msgstr "**原始碼:**\\ :source:`Lib/dataclasses.py`" #, fuzzy msgid "" "This module provides a decorator and functions for automatically adding " -"generated :term:`special methods ` such " -"as :meth:`~object.__init__` and :meth:`~object.__repr__` to user-defined " -"classes. It was originally described in :pep:`557`." +"generated :term:`special methods ` such as :meth:`~object." +"__init__` and :meth:`~object.__repr__` to user-defined classes. It was " +"originally described in :pep:`557`." msgstr "" "該模組提供了一個裝飾器和函式,用於自動新增生成的\\ :term:`特殊方法 `,例如 :meth:`~object.__init__` 和 :meth:`~object.__repr__` 到使用者" @@ -38,8 +38,8 @@ msgstr "" #: ../../library/dataclasses.rst:19 #, fuzzy msgid "" -"The member variables to use in these generated methods are defined " -"using :pep:`526` type annotations. For example, this code::" +"The member variables to use in these generated methods are defined using :" +"pep:`526` type annotations. For example, this code::" msgstr "" "在這些生成的方法中使用的成員變數是使用 :pep:`526` 型別註釋定義的。例如,這段" "程式碼: ::" @@ -94,9 +94,8 @@ msgstr "模組內容" #: ../../library/dataclasses.rst:51 #, fuzzy msgid "" -"This function is a :term:`decorator` that is used to add " -"generated :term:`special methods ` to classes, as described " -"below." +"This function is a :term:`decorator` that is used to add generated :term:" +"`special methods ` to classes, as described below." msgstr "" "此函式是一個 :term:`decorator`,用於將生成的\\ :term:`特殊方法 `\\新增到類別中,如下所述。" @@ -109,9 +108,9 @@ msgid "" "`. With two exceptions described below, nothing in " "``@dataclass`` examines the type specified in the variable annotation." msgstr "" -"``@dataclass`` 裝飾器檢查類別以找到 ``field``\\s。 ``field`` 被定義為具" -"有 :term:`type annotation ` 的類別變數。除了下面描述的兩" -"個例外,``@dataclass`` 中沒有任何內容檢查變數註釋中指定的型別。" +"``@dataclass`` 裝飾器檢查類別以找到 ``field``\\s。 ``field`` 被定義為具有 :" +"term:`type annotation ` 的類別變數。除了下面描述的兩個例" +"外,``@dataclass`` 中沒有任何內容檢查變數註釋中指定的型別。" #: ../../library/dataclasses.rst:60 #, fuzzy @@ -226,35 +225,32 @@ msgstr "如果該類別已經定義了 :meth:`!__eq__`,則此參數會被忽 #: ../../library/dataclasses.rst:113 #, fuzzy msgid "" -"*order*: If true (the default is " -"``False``), :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__`, " -"and :meth:`~object.__ge__` methods will be generated. These compare the " -"class as if it were a tuple of its fields, in order. Both instances in the " -"comparison must be of the identical type. If *order* is true and *eq* is " -"false, a :exc:`ValueError` is raised." +"*order*: If true (the default is ``False``), :meth:`~object.__lt__`, :meth:" +"`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` methods " +"will be generated. These compare the class as if it were a tuple of its " +"fields, in order. Both instances in the comparison must be of the identical " +"type. If *order* is true and *eq* is false, a :exc:`ValueError` is raised." msgstr "" -"*order*:如果為真(預設為 " -"``False``),:meth:`~object.__lt__`、:meth:`~object.__le__`、:meth:`~object.__gt__` " -"和 :meth:`~object.__ge__` 方法將是產生。它們按順序比較類別,就好像它是其欄位" -"的元組一樣。比較中的兩個實例必須屬於同一型別。如果 *order* 為真且 *eq* 為假," -"則會引發 :exc:`ValueError`。" +"*order*:如果為真(預設為 ``False``),:meth:`~object.__lt__`、:meth:" +"`~object.__le__`、:meth:`~object.__gt__` 和 :meth:`~object.__ge__` 方法將是產" +"生。它們按順序比較類別,就好像它是其欄位的元組一樣。比較中的兩個實例必須屬於" +"同一型別。如果 *order* 為真且 *eq* 為假,則會引發 :exc:`ValueError`。" #: ../../library/dataclasses.rst:120 msgid "" -"If the class already defines any of :meth:`!__lt__`, :meth:`!" -"__le__`, :meth:`!__gt__`, or :meth:`!__ge__`, then :exc:`TypeError` is " -"raised." +"If the class already defines any of :meth:`!__lt__`, :meth:`!__le__`, :meth:" +"`!__gt__`, or :meth:`!__ge__`, then :exc:`TypeError` is raised." msgstr "" -"如果該類別已經定義了 :meth:`!__lt__`、:meth:`!__le__`、:meth:`!__gt__` " -"或 :meth:`!__ge__` 中的任何一個,則引發 :exc:`TypeError`。" +"如果該類別已經定義了 :meth:`!__lt__`、:meth:`!__le__`、:meth:`!__gt__` 或 :" +"meth:`!__ge__` 中的任何一個,則引發 :exc:`TypeError`。" #: ../../library/dataclasses.rst:124 #, fuzzy msgid "" -"*unsafe_hash*: If true, force ``dataclasses`` to create " -"a :meth:`~object.__hash__` method, even though it may not be safe to do so. " -"Otherwise, generate a :meth:`~object.__hash__` method according to how *eq* " -"and *frozen* are set. The default value is ``False``." +"*unsafe_hash*: If true, force ``dataclasses`` to create a :meth:`~object." +"__hash__` method, even though it may not be safe to do so. Otherwise, " +"generate a :meth:`~object.__hash__` method according to how *eq* and " +"*frozen* are set. The default value is ``False``." msgstr "" "*unsafe_hash*:如果 ``False``(預設值),將根據 *eq* 和 *frozen* 的設定生成一" "個 :meth:`~object.__hash__` 方法。" @@ -277,11 +273,11 @@ msgstr "" #: ../../library/dataclasses.rst:137 #, fuzzy msgid "" -"By default, ``@dataclass`` will not implicitly add " -"a :meth:`~object.__hash__` method unless it is safe to do so. Neither will " -"it add or change an existing explicitly defined :meth:`!__hash__` method. " -"Setting the class attribute ``__hash__ = None`` has a specific meaning to " -"Python, as described in the :meth:`!__hash__` documentation." +"By default, ``@dataclass`` will not implicitly add a :meth:`~object." +"__hash__` method unless it is safe to do so. Neither will it add or change " +"an existing explicitly defined :meth:`!__hash__` method. Setting the class " +"attribute ``__hash__ = None`` has a specific meaning to Python, as described " +"in the :meth:`!__hash__` documentation." msgstr "" "預設情況下,``@dataclass`` 不會隱式新增 :meth:`~object.__hash__` 方法,除非這" "樣做是安全的。它也不會新增或更改現有的明確定義的 :meth:`!__hash__` 方法。設定" @@ -309,35 +305,35 @@ msgstr "" msgid "" "Here are the rules governing implicit creation of a :meth:`!__hash__` " "method. Note that you cannot both have an explicit :meth:`!__hash__` method " -"in your dataclass and set ``unsafe_hash=True``; this will result in " -"a :exc:`TypeError`." +"in your dataclass and set ``unsafe_hash=True``; this will result in a :exc:" +"`TypeError`." msgstr "" "以下是管理隱式建立 :meth:`!__hash__` 方法的規則。請注意,你不能在資料類別中既" -"有顯式的 :meth:`!__hash__` 方法又設定 ``unsafe_hash=True``;這將導" -"致 :exc:`TypeError`。" +"有顯式的 :meth:`!__hash__` 方法又設定 ``unsafe_hash=True``;這將導致 :exc:" +"`TypeError`。" #: ../../library/dataclasses.rst:155 msgid "" "If *eq* and *frozen* are both true, by default ``@dataclass`` will generate " -"a :meth:`!__hash__` method for you. If *eq* is true and *frozen* is " -"false, :meth:`!__hash__` will be set to ``None``, marking it unhashable " -"(which it is, since it is mutable). If *eq* is false, :meth:`!__hash__` " -"will be left untouched meaning the :meth:`!__hash__` method of the " -"superclass will be used (if the superclass is :class:`object`, this means it " -"will fall back to id-based hashing)." -msgstr "" -"如果 *eq* 和 *frozen* 都為真,預設情況下 ``@dataclass`` 會為你生成一" -"個 :meth:`!__hash__` 方法。如果 *eq* 為真且 *frozen* 為假,:meth:`!__hash__` " -"將被設定為 ``None``,並將其標記為不可雜湊(因為它是可變的)。如果 *eq* 為" -"假,:meth:`!__hash__` 將保持不變,這意味著將使用超類別的 :meth:`!__hash__` 方" -"法(如果超類別是 :class:`object`,這意味著它將回退到基於 id 的雜湊)。" +"a :meth:`!__hash__` method for you. If *eq* is true and *frozen* is false, :" +"meth:`!__hash__` will be set to ``None``, marking it unhashable (which it " +"is, since it is mutable). If *eq* is false, :meth:`!__hash__` will be left " +"untouched meaning the :meth:`!__hash__` method of the superclass will be " +"used (if the superclass is :class:`object`, this means it will fall back to " +"id-based hashing)." +msgstr "" +"如果 *eq* 和 *frozen* 都為真,預設情況下 ``@dataclass`` 會為你生成一個 :meth:" +"`!__hash__` 方法。如果 *eq* 為真且 *frozen* 為假,:meth:`!__hash__` 將被設定" +"為 ``None``,並將其標記為不可雜湊(因為它是可變的)。如果 *eq* 為假,:meth:`!" +"__hash__` 將保持不變,這意味著將使用超類別的 :meth:`!__hash__` 方法(如果超類" +"別是 :class:`object`,這意味著它將回退到基於 id 的雜湊)。" #: ../../library/dataclasses.rst:163 #, fuzzy msgid "" "*frozen*: If true (the default is ``False``), assigning to fields will " -"generate an exception. This emulates read-only frozen instances. See " -"the :ref:`discussion ` below." +"generate an exception. This emulates read-only frozen instances. See the :" +"ref:`discussion ` below." msgstr "" "*frozen*:如果為真(預設為 ``False``),分配給欄位將產生例外。這模擬了只讀的" "凍結實例。如果 :meth:`~object.__setattr__` 或 :meth:`~object.__delattr__` 在" @@ -354,11 +350,11 @@ msgstr "" #: ../../library/dataclasses.rst:170 #, fuzzy msgid "" -"*match_args*: If true (the default is ``True``), " -"the :attr:`~object.__match_args__` tuple will be created from the list of " -"non keyword-only parameters to the generated :meth:`~object.__init__` method " -"(even if :meth:`!__init__` is not generated, see above). If false, or " -"if :attr:`!__match_args__` is already defined in the class, then :attr:`!" +"*match_args*: If true (the default is ``True``), the :attr:`~object." +"__match_args__` tuple will be created from the list of non keyword-only " +"parameters to the generated :meth:`~object.__init__` method (even if :meth:`!" +"__init__` is not generated, see above). If false, or if :attr:`!" +"__match_args__` is already defined in the class, then :attr:`!" "__match_args__` will not be generated." msgstr "" "*match_args*:如果為真(預設為 ``True``),``__match_args__`` 元組將從參數列" @@ -377,10 +373,10 @@ msgid "" "the :const:`KW_ONLY` section." msgstr "" "``kw_only``:如果為 true(預設值為 ``False``),則所有欄位將被標記為僅限關鍵" -"字。如果一個欄位被標記為僅限關鍵字,那麼唯一的影響是從僅限關鍵字欄位生成" -"的 :meth:`~object.__init__` 參數必須在呼叫 :meth:`!__init__` 時指定關鍵字。對" -"資料類別的任何其他方面都沒有影響。有關詳細資訊,請參閱 :term:`parameter` 詞彙" -"表條目。另請參閱 :const:`KW_ONLY` 部分。" +"字。如果一個欄位被標記為僅限關鍵字,那麼唯一的影響是從僅限關鍵字欄位生成的 :" +"meth:`~object.__init__` 參數必須在呼叫 :meth:`!__init__` 時指定關鍵字。對資料" +"類別的任何其他方面都沒有影響。有關詳細資訊,請參閱 :term:`parameter` 詞彙表條" +"目。另請參閱 :const:`KW_ONLY` 部分。" #: ../../library/dataclasses.rst:187 msgid "Keyword-only fields are not included in :attr:`!__match_args__`." @@ -391,8 +387,8 @@ msgstr "" msgid "" "*slots*: If true (the default is ``False``), :attr:`~object.__slots__` " "attribute will be generated and new class will be returned instead of the " -"original one. If :attr:`!__slots__` is already defined in the class, " -"then :exc:`TypeError` is raised." +"original one. If :attr:`!__slots__` is already defined in the class, then :" +"exc:`TypeError` is raised." msgstr "" "``slots``:如果為 true(預設為 ``False``),將生成 :attr:`~object.__slots__` " "屬性並回傳新類別而不是原始類別。如果 :attr:`!__slots__` 已經在類別中定義," @@ -412,9 +408,9 @@ msgid "" "If a field name is already included in the :attr:`!__slots__` of a base " "class, it will not be included in the generated :attr:`!__slots__` to " "prevent :ref:`overriding them `. Therefore, do not " -"use :attr:`!__slots__` to retrieve the field names of a dataclass. " -"Use :func:`fields` instead. To be able to determine inherited slots, base " -"class :attr:`!__slots__` may be any iterable, but *not* an iterator." +"use :attr:`!__slots__` to retrieve the field names of a dataclass. Use :func:" +"`fields` instead. To be able to determine inherited slots, base class :attr:" +"`!__slots__` may be any iterable, but *not* an iterator." msgstr "" "如果欄位名稱已經包含在基底類別的 :attr:`!__slots__` 中,它將不會包含在生成" "的 :attr:`!__slots__` 中以防止 :ref:`覆蓋它們 `。因此," @@ -455,8 +451,8 @@ msgid "" "In this example, both :attr:`!a` and :attr:`!b` will be included in the " "added :meth:`~object.__init__` method, which will be defined as::" msgstr "" -"在此示例中,:attr:`!a` 和 :attr:`!b` 都將包含在新增" -"的 :meth:`~object.__init__` 方法中,該方法將定義為: ::" +"在此示例中,:attr:`!a` 和 :attr:`!b` 都將包含在新增的 :meth:`~object." +"__init__` 方法中,該方法將定義為: ::" #: ../../library/dataclasses.rst:234 msgid "def __init__(self, a: int, b: int = 0):" @@ -568,10 +564,10 @@ msgid "" "comparisons. Setting this value to anything other than ``None`` is " "discouraged." msgstr "" -"*hash*:這可以是 bool 或 ``None``。如果為真,則此欄位包含在生成" -"的 :meth:`__hash__` 方法中。如果 ``None``\\ (預設值),則使用\\ *比較*\\ 的" -"值:這通常是預期的行為。如果一個欄位用於比較,則應在雜湊中考慮該欄位。不鼓勵" -"將此值設定為 ``None`` 以外的任何值。" +"*hash*:這可以是 bool 或 ``None``。如果為真,則此欄位包含在生成的 :meth:" +"`__hash__` 方法中。如果 ``None``\\ (預設值),則使用\\ *比較*\\ 的值:這通常" +"是預期的行為。如果一個欄位用於比較,則應在雜湊中考慮該欄位。不鼓勵將此值設定" +"為 ``None`` 以外的任何值。" #: ../../library/dataclasses.rst:286 #, fuzzy @@ -590,11 +586,11 @@ msgstr "" #, fuzzy msgid "" "*compare*: If true (the default), this field is included in the generated " -"equality and comparison methods " -"(:meth:`~object.__eq__`, :meth:`~object.__gt__`, et al.)." +"equality and comparison methods (:meth:`~object.__eq__`, :meth:`~object." +"__gt__`, et al.)." msgstr "" -"*compare*:如果為真(預設值),則此欄位包含在生成的相等和比較方法中" -"(:meth:`~object.__eq__`、:meth:`~object.__gt__` 等)。" +"*compare*:如果為真(預設值),則此欄位包含在生成的相等和比較方法中(:meth:" +"`~object.__eq__`、:meth:`~object.__gt__` 等)。" #: ../../library/dataclasses.rst:296 #, fuzzy @@ -606,10 +602,10 @@ msgid "" "mechanism. Multiple third-parties can each have their own key, to use as a " "namespace in the metadata." msgstr "" -"*metadata*:這可以是對映或無。 None 被視為空字典。此值包含" -"在 :func:`~types.MappingProxyType` 中以使其成為只讀的,並暴露" -"在 :class:`Field` 對像上。它根本不被資料類別使用,而是作為第三方擴充機制提供" -"的。多個第三方可以各自擁有自己的密鑰,用作元資料中的命名空間。" +"*metadata*:這可以是對映或無。 None 被視為空字典。此值包含在 :func:`~types." +"MappingProxyType` 中以使其成為只讀的,並暴露在 :class:`Field` 對像上。它根本" +"不被資料類別使用,而是作為第三方擴充機制提供的。多個第三方可以各自擁有自己的" +"密鑰,用作元資料中的命名空間。" #: ../../library/dataclasses.rst:304 #, fuzzy @@ -617,8 +613,8 @@ msgid "" "*kw_only*: If true, this field will be marked as keyword-only. This is used " "when the generated :meth:`~object.__init__` method's parameters are computed." msgstr "" -"*kw_only*:如果為真,該欄位將被標記為僅限關鍵字。這在計算生成" -"的 :meth:`~object.__init__` 方法的參數時使用。" +"*kw_only*:如果為真,該欄位將被標記為僅限關鍵字。這在計算生成的 :meth:" +"`~object.__init__` 方法的參數時使用。" #: ../../library/dataclasses.rst:308 msgid "Keyword-only fields are also not included in :attr:`!__match_args__`." @@ -634,10 +630,10 @@ msgid "" "If the default value of a field is specified by a call to :func:`!field`, " "then the class attribute for this field will be replaced by the specified " "*default* value. If *default* is not provided, then the class attribute " -"will be deleted. The intent is that after the :func:`@dataclass " -"` decorator runs, the class attributes will all contain the " -"default values for the fields, just as if the default value itself were " -"specified. For example, after::" +"will be deleted. The intent is that after the :deco:`dataclass` decorator " +"runs, the class attributes will all contain the default values for the " +"fields, just as if the default value itself were specified. For example, " +"after::" msgstr "" "如果欄位的預設值是通過呼叫 :func:`!field` 指定的,那麼該欄位的類別屬性將被指" "定的 *default* 值替換。如果沒有提供 *default*,那麼類別屬性將被刪除。目的是" @@ -678,9 +674,9 @@ msgid "" "method (see below). Users should never instantiate a :class:`!Field` object " "directly. Its documented attributes are:" msgstr "" -":class:`!Field` 物件描述每個定義的欄位。這些對像在內部建立,並" -"由 :func:`fields` 模組級方法回傳(見下文)。使用者不應該直接實例化 :class:`!" -"Field` 物件。它記錄的屬性是:" +":class:`!Field` 物件描述每個定義的欄位。這些對像在內部建立,並由 :func:" +"`fields` 模組級方法回傳(見下文)。使用者不應該直接實例化 :class:`!Field` 物" +"件。它記錄的屬性是:" #: ../../library/dataclasses.rst:343 msgid ":attr:`!name`: The name of the field." @@ -693,14 +689,13 @@ msgstr ":attr:`!type`:欄位的型別。" #: ../../library/dataclasses.rst:345 #, fuzzy msgid "" -":attr:`!default`, :attr:`!default_factory`, :attr:`!init`, :attr:`!" -"repr`, :attr:`!hash`, :attr:`!compare`, :attr:`!metadata`, and :attr:`!" -"kw_only` have the identical meaning and values as they do in " -"the :func:`field` function." +":attr:`!default`, :attr:`!default_factory`, :attr:`!init`, :attr:`!repr`, :" +"attr:`!hash`, :attr:`!compare`, :attr:`!metadata`, and :attr:`!kw_only` have " +"the identical meaning and values as they do in the :func:`field` function." msgstr "" -":attr:`!default`、:attr:`!default_factory`、:attr:`!init`、:attr:`!" -"repr`、:attr:`!hash`、:attr:`!compare`, :attr:`!metadata` 和 :attr:`!" -"kw_only` 有與它們在 :func:`field` 函式中的含義和值相同。" +":attr:`!default`、:attr:`!default_factory`、:attr:`!init`、:attr:`!repr`、:" +"attr:`!hash`、:attr:`!compare`, :attr:`!metadata` 和 :attr:`!kw_only` 有與它" +"們在 :func:`field` 函式中的含義和值相同。" #: ../../library/dataclasses.rst:349 #, fuzzy @@ -713,9 +708,9 @@ msgstr "可能存在其他屬性,但它們是私有的,不得檢查或依賴 msgid "" "``InitVar[T]`` type annotations describe variables that are :ref:`init-only " "`. Fields annotated with :class:`!InitVar` " -"are considered pseudo-fields, and thus are neither returned by " -"the :func:`fields` function nor used in any way except adding them as " -"parameters to :meth:`~object.__init__` and an optional :meth:`__post_init__`." +"are considered pseudo-fields, and thus are neither returned by the :func:" +"`fields` function nor used in any way except adding them as parameters to :" +"meth:`~object.__init__` and an optional :meth:`__post_init__`." msgstr "" #: ../../library/dataclasses.rst:363 @@ -803,8 +798,8 @@ msgid "" "objects are copied with :func:`copy.deepcopy`." msgstr "" "將資料類別 *obj* 轉換為元組(通過使用工廠函式 *tuple_factory*)。每個資料類別" -"都被轉換為其欄位值的元組。資料類別、字典、列表和元組被遞迴到。其他物件使" -"用 :func:`copy.deepcopy` 複製。" +"都被轉換為其欄位值的元組。資料類別、字典、列表和元組被遞迴到。其他物件使用 :" +"func:`copy.deepcopy` 複製。" #: ../../library/dataclasses.rst:408 msgid "Continuing from the previous example::" @@ -839,8 +834,8 @@ msgid "" "``name``, ``(name, type)``, or ``(name, type, Field)``. If just ``name`` is " "supplied, :data:`typing.Any` is used for ``type``. The values of *init*, " "*repr*, *eq*, *order*, *unsafe_hash*, *frozen*, *match_args*, *kw_only*, " -"*slots*, and *weakref_slot* have the same meaning as they do " -"in :func:`@dataclass `." +"*slots*, and *weakref_slot* have the same meaning as they do in :deco:" +"`dataclass`." msgstr "" "建立一個名為 *cls_name* 的新資料類別,欄位在 *fields* 中定義,基底類別在 " "*bases* 中給出,並使用 *namespace* 中給出的命名空間進行初始化。 ``fields`` 是" @@ -860,8 +855,8 @@ msgstr "" msgid "" "The *decorator* parameter is a callable that will be used to create the " "dataclass. It should take the class object as a first argument and the same " -"keyword arguments as :func:`@dataclass `. By default, " -"the :func:`@dataclass ` function is used." +"keyword arguments as :deco:`dataclass`. By default, the :deco:`dataclass` " +"function is used." msgstr "" #: ../../library/dataclasses.rst:441 @@ -869,12 +864,12 @@ msgstr "" msgid "" "This function is not strictly required, because any Python mechanism for " "creating a new class with :attr:`~object.__annotations__` can then apply " -"the :func:`@dataclass ` function to convert that class to a " -"dataclass. This function is provided as a convenience. For example::" +"the :deco:`dataclass` function to convert that class to a dataclass. This " +"function is provided as a convenience. For example::" msgstr "" -"這個函式不是嚴格要求的,因為任何使用 :attr:`~object.__annotations__` 建立新類別的 Python " -"機制都可以應用 :func:`dataclass` 函式將該類別轉換為資料類別。提供此功能是為了" -"方便。例如: ::" +"這個函式不是嚴格要求的,因為任何使用 :attr:`~object.__annotations__` 建立新類" +"別的 Python 機制都可以應用 :func:`dataclass` 函式將該類別轉換為資料類別。提供" +"此功能是為了方便。例如: ::" #: ../../library/dataclasses.rst:447 msgid "" @@ -915,8 +910,8 @@ msgstr "" msgid "" "Creates a new object of the same type as *obj*, replacing fields with values " "from *changes*. If *obj* is not a Data Class, raises :exc:`TypeError`. If " -"keys in *changes* are not field names of the given dataclass, " -"raises :exc:`TypeError`." +"keys in *changes* are not field names of the given dataclass, raises :exc:" +"`TypeError`." msgstr "" "建立一個與 ``obj`` 型別相同的新物件,用 ``changes`` 中的值替換欄位。如果 " "``obj`` 不是資料類別,則引發 :exc:`TypeError`。如果 ``changes`` 中的值未指定" @@ -970,8 +965,8 @@ msgstr "" #: ../../library/dataclasses.rst:495 msgid "" -"Dataclass instances are also supported by generic " -"function :func:`copy.replace`." +"Dataclass instances are also supported by generic function :func:`copy." +"replace`." msgstr "" #: ../../library/dataclasses.rst:499 @@ -1010,9 +1005,9 @@ msgid "" "with the type of :const:`!KW_ONLY` are marked as keyword-only fields. Note " "that a pseudo-field of type :const:`!KW_ONLY` is otherwise completely " "ignored. This includes the name of such a field. By convention, a name of " -"``_`` is used for a :const:`!KW_ONLY` field. Keyword-only fields " -"signify :meth:`~object.__init__` parameters that must be specified as " -"keywords when the class is instantiated." +"``_`` is used for a :const:`!KW_ONLY` field. Keyword-only fields signify :" +"meth:`~object.__init__` parameters that must be specified as keywords when " +"the class is instantiated." msgstr "" "用作型別註釋的標記值。型別為 :const:`!KW_ONLY` 的偽欄位之後的任何欄位都被標記" "為僅關鍵字欄位。請注意,:const:`!KW_ONLY` 型別的偽欄位將被完全忽略。這包括此" @@ -1056,12 +1051,12 @@ msgstr "在單個資料類別中,指定多個型別為 :const:`!KW_ONLY` 的 #: ../../library/dataclasses.rst:542 #, fuzzy msgid "" -"Raised when an implicitly defined :meth:`~object.__setattr__` " -"or :meth:`~object.__delattr__` is called on a dataclass which was defined " -"with ``frozen=True``. It is a subclass of :exc:`AttributeError`." +"Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" +"`~object.__delattr__` is called on a dataclass which was defined with " +"``frozen=True``. It is a subclass of :exc:`AttributeError`." msgstr "" -"當在使用 frozen=True 定義的資料類別上呼叫隱式定義的 :meth:`__setattr__` " -"或 :meth:`__delattr__` 時引發。它是 :exc:`AttributeError` 的子類別。" +"當在使用 frozen=True 定義的資料類別上呼叫隱式定義的 :meth:`__setattr__` 或 :" +"meth:`__delattr__` 時引發。它是 :exc:`AttributeError` 的子類別。" #: ../../library/dataclasses.rst:549 #, fuzzy @@ -1071,18 +1066,18 @@ msgstr "初始化後處理" #: ../../library/dataclasses.rst:553 #, fuzzy msgid "" -"When defined on the class, it will be called by the " -"generated :meth:`~object.__init__`, normally as :meth:`!self.__post_init__`. " -"However, if any ``InitVar`` fields are defined, they will also be passed " -"to :meth:`!__post_init__` in the order they were defined in the class. If " -"no :meth:`!__init__` method is generated, then :meth:`!__post_init__` will " -"not automatically be called." +"When defined on the class, it will be called by the generated :meth:`~object." +"__init__`, normally as :meth:`!self.__post_init__`. However, if any " +"``InitVar`` fields are defined, they will also be passed to :meth:`!" +"__post_init__` in the order they were defined in the class. If no :meth:`!" +"__init__` method is generated, then :meth:`!__post_init__` will not " +"automatically be called." msgstr "" -"生成的 :meth:`~object.__init__` 程式碼將呼叫一個名為 :meth:`!" -"self.__post_init__` 的方法,如果 :meth:`!__post_init__` 是在類別上定義的。它" -"通常被稱為 ``self.!__post_init__()``。但是,如果定義了任何 ``InitVar`` 欄位," -"它們也將按照它們在類別中定義的順序傳遞給 :meth:`!__post_init__` 。如果沒有生" -"成 :meth:`!__init__` 方法,那麼 :meth:`!__post_init__` 將不會被自動呼叫。" +"生成的 :meth:`~object.__init__` 程式碼將呼叫一個名為 :meth:`!self." +"__post_init__` 的方法,如果 :meth:`!__post_init__` 是在類別上定義的。它通常被" +"稱為 ``self.!__post_init__()``。但是,如果定義了任何 ``InitVar`` 欄位,它們也" +"將按照它們在類別中定義的順序傳遞給 :meth:`!__post_init__` 。如果沒有生成 :" +"meth:`!__init__` 方法,那麼 :meth:`!__post_init__` 將不會被自動呼叫。" #: ../../library/dataclasses.rst:560 #, fuzzy @@ -1114,10 +1109,10 @@ msgstr "" #: ../../library/dataclasses.rst:572 #, fuzzy msgid "" -"The :meth:`~object.__init__` method generated by :func:`@dataclass " -"` does not call base class :meth:`!__init__` methods. If the base " -"class has an :meth:`!__init__` method that has to be called, it is common to " -"call this method in a :meth:`__post_init__` method::" +"The :meth:`~object.__init__` method generated by :deco:`dataclass` does not " +"call base class :meth:`!__init__` methods. If the base class has an :meth:`!" +"__init__` method that has to be called, it is common to call this method in " +"a :meth:`__post_init__` method::" msgstr "" ":func:`@dataclass ` 生成的 :meth:`~object.__init__` 方法不呼叫基底" "類別 :meth:`!__init__` 方法。如果基底類別有一個必須呼叫的 :meth:`!__init__` " @@ -1162,8 +1157,8 @@ msgstr "" #: ../../library/dataclasses.rst:593 #, fuzzy msgid "" -"See the section below on init-only variables for ways to pass parameters " -"to :meth:`!__post_init__`. Also see the warning about how :func:`replace` " +"See the section below on init-only variables for ways to pass parameters to :" +"meth:`!__post_init__`. Also see the warning about how :func:`replace` " "handles ``init=False`` fields." msgstr "" "請參閱下面有關僅初始化變數的部分,了解將參數傳遞給 :meth:`!__post_init__` 的" @@ -1176,19 +1171,18 @@ msgstr "類別變數" #: ../../library/dataclasses.rst:602 #, fuzzy msgid "" -"One of the few places where :func:`@dataclass ` actually inspects " -"the type of a field is to determine if a field is a class variable as " -"defined in :pep:`526`. It does this by checking if the type of the field " -"is :data:`typing.ClassVar`. If a field is a ``ClassVar``, it is excluded " -"from consideration as a field and is ignored by the dataclass mechanisms. " -"Such ``ClassVar`` pseudo-fields are not returned by the module-" -"level :func:`fields` function." +"One of the few places where :deco:`dataclass` actually inspects the type of " +"a field is to determine if a field is a class variable as defined in :pep:" +"`526`. It does this by checking if the type of the field is :data:`typing." +"ClassVar`. If a field is a ``ClassVar``, it is excluded from consideration " +"as a field and is ignored by the dataclass mechanisms. Such ``ClassVar`` " +"pseudo-fields are not returned by the module-level :func:`fields` function." msgstr "" ":func:`@dataclass ` 實際檢查欄位型別的少數地方之一是確定欄位是否" -"是 :pep:`526` 中定義的類別變數。它通過檢查欄位的型別是否" -"為 :data:`typing.ClassVar` 來做到這一點。如果一個欄位是一個 ``ClassVar``,它" -"就被排除在考慮之外,並被資料類別機制忽略。模組級 :func:`fields` 函式不會回傳" -"此類別 ``ClassVar`` 偽欄位。" +"是 :pep:`526` 中定義的類別變數。它通過檢查欄位的型別是否為 :data:`typing." +"ClassVar` 來做到這一點。如果一個欄位是一個 ``ClassVar``,它就被排除在考慮之" +"外,並被資料類別機制忽略。模組級 :func:`fields` 函式不會回傳此類別 " +"``ClassVar`` 偽欄位。" #: ../../library/dataclasses.rst:613 #, fuzzy @@ -1198,15 +1192,14 @@ msgstr "僅初始化變數" #: ../../library/dataclasses.rst:615 #, fuzzy msgid "" -"Another place where :func:`@dataclass ` inspects a type " -"annotation is to determine if a field is an init-only variable. It does " -"this by seeing if the type of a field is of type :class:`InitVar`. If a " -"field is an :class:`InitVar`, it is considered a pseudo-field called an init-" -"only field. As it is not a true field, it is not returned by the module-" -"level :func:`fields` function. Init-only fields are added as parameters to " -"the generated :meth:`~object.__init__` method, and are passed to the " -"optional :meth:`__post_init__` method. They are not otherwise used by " -"dataclasses." +"Another place where :deco:`dataclass` inspects a type annotation is to " +"determine if a field is an init-only variable. It does this by seeing if " +"the type of a field is of type :class:`InitVar`. If a field is an :class:" +"`InitVar`, it is considered a pseudo-field called an init-only field. As it " +"is not a true field, it is not returned by the module-level :func:`fields` " +"function. Init-only fields are added as parameters to the generated :meth:" +"`~object.__init__` method, and are passed to the optional :meth:" +"`__post_init__` method. They are not otherwise used by dataclasses." msgstr "" ":func:`dataclass` 檢查型別註解的另一個地方是確定欄位是否是僅初始化變數。它通" "過查看欄位的型別是否為 ``dataclasses.InitVar`` 型別來執行此操作。如果一個欄位" @@ -1254,8 +1247,8 @@ msgid "" "In this case, :func:`fields` will return :class:`Field` objects for :attr:`!" "i` and :attr:`!j`, but not for :attr:`!database`." msgstr "" -"在這種情況下,:func:`fields` 將為 :attr:`!i` 和 :attr:`!j` 回" -"傳 :class:`Field` 物件,但不會為 :attr:`!database` 回傳。" +"在這種情況下,:func:`fields` 將為 :attr:`!i` 和 :attr:`!j` 回傳 :class:" +"`Field` 物件,但不會為 :attr:`!database` 回傳。" #: ../../library/dataclasses.rst:646 msgid "Frozen instances" @@ -1265,24 +1258,22 @@ msgstr "凍結實例" #, fuzzy msgid "" "It is not possible to create truly immutable Python objects. However, by " -"passing ``frozen=True`` to the :func:`@dataclass ` decorator you " -"can emulate immutability. In that case, dataclasses will " -"add :meth:`~object.__setattr__` and :meth:`~object.__delattr__` methods to " -"the class. These methods will raise a :exc:`FrozenInstanceError` when " -"invoked." -msgstr "" -"不可能建立真正不可變的 Python 物件。但是,通過將 ``frozen=True`` 傳遞" -"給 :func:`@dataclass ` 裝飾器,你可以模擬不變性。在這種情況下,資" -"料類別將向類別新增 :meth:`~object.__setattr__` " -"和 :meth:`~object.__delattr__` 方法。這些方法在叫用時會引" -"發 :exc:`FrozenInstanceError`。" +"passing ``frozen=True`` to the :deco:`dataclass` decorator you can emulate " +"immutability. In that case, dataclasses will add :meth:`~object." +"__setattr__` and :meth:`~object.__delattr__` methods to the class. These " +"methods will raise a :exc:`FrozenInstanceError` when invoked." +msgstr "" +"不可能建立真正不可變的 Python 物件。但是,通過將 ``frozen=True`` 傳遞給 :" +"func:`@dataclass ` 裝飾器,你可以模擬不變性。在這種情況下,資料類" +"別將向類別新增 :meth:`~object.__setattr__` 和 :meth:`~object.__delattr__` 方" +"法。這些方法在叫用時會引發 :exc:`FrozenInstanceError`。" #: ../../library/dataclasses.rst:654 #, fuzzy msgid "" -"There is a tiny performance penalty when using " -"``frozen=True``: :meth:`~object.__init__` cannot use simple assignment to " -"initialize fields, and must use :meth:`!object.__setattr__`." +"There is a tiny performance penalty when using ``frozen=True``: :meth:" +"`~object.__init__` cannot use simple assignment to initialize fields, and " +"must use :meth:`!object.__setattr__`." msgstr "" "使用 ``frozen=True`` 時有一個微小的性能損失::meth:`~object.__init__` 不能使" "用簡單賦值來初始化欄位,必須使用 :meth:`!object.__setattr__`。" @@ -1294,14 +1285,14 @@ msgstr "繼承" #: ../../library/dataclasses.rst:665 #, fuzzy msgid "" -"When the dataclass is being created by the :func:`@dataclass ` " -"decorator, it looks through all of the class's base classes in reverse MRO " -"(that is, starting at :class:`object`) and, for each dataclass that it " -"finds, adds the fields from that base class to an ordered mapping of fields. " -"After all of the base class fields are added, it adds its own fields to the " -"ordered mapping. All of the generated methods will use this combined, " -"calculated ordered mapping of fields. Because the fields are in insertion " -"order, derived classes override base classes. An example::" +"When the dataclass is being created by the :deco:`dataclass` decorator, it " +"looks through all of the class's base classes in reverse MRO (that is, " +"starting at :class:`object`) and, for each dataclass that it finds, adds the " +"fields from that base class to an ordered mapping of fields. After all of " +"the base class fields are added, it adds its own fields to the ordered " +"mapping. All of the generated methods will use this combined, calculated " +"ordered mapping of fields. Because the fields are in insertion order, " +"derived classes override base classes. An example::" msgstr "" "當 :func:`@dataclass ` 裝飾器建立資料類別時,它會以反向 MRO(即" "從 :class:`object` 開始)查看該類別的所有基底類別,並且對於它找到的每個資料類" @@ -1463,9 +1454,8 @@ msgid "" "initial value." msgstr "" "如果一個欄位從 :meth:`~object.__init__` 中排除(使用 ``init=False``)並且該欄" -"位還指定了 ``default_factory``,那麼預設工廠函式將始終從生成" -"的 :meth:`__init__ 中呼叫`功能。發生這種情況是因為沒有其他方法可以為該欄位賦" -"予初始值。" +"位還指定了 ``default_factory``,那麼預設工廠函式將始終從生成的 :meth:" +"`__init__ 中呼叫`功能。發生這種情況是因為沒有其他方法可以為該欄位賦予初始值。" #: ../../library/dataclasses.rst:744 msgid "Mutable default values" @@ -1561,14 +1551,14 @@ msgstr "" #, fuzzy msgid "" "This has the same issue as the original example using class :class:`!C`. " -"That is, two instances of class :class:`!D` that do not specify a value " -"for :attr:`!x` when creating a class instance will share the same copy " -"of :attr:`!x`. Because dataclasses just use normal Python class creation " -"they also share this behavior. There is no general way for Data Classes to " -"detect this condition. Instead, the :func:`@dataclass ` " -"decorator will raise a :exc:`ValueError` if it detects an unhashable default " -"parameter. The assumption is that if a value is unhashable, it is mutable. " -"This is a partial solution, but it does protect against many common errors." +"That is, two instances of class :class:`!D` that do not specify a value for :" +"attr:`!x` when creating a class instance will share the same copy of :attr:`!" +"x`. Because dataclasses just use normal Python class creation they also " +"share this behavior. There is no general way for Data Classes to detect " +"this condition. Instead, the :deco:`dataclass` decorator will raise a :exc:" +"`ValueError` if it detects an unhashable default parameter. The assumption " +"is that if a value is unhashable, it is mutable. This is a partial " +"solution, but it does protect against many common errors." msgstr "" "這與使用類別 :class:`!C` 的原始示例存在相同的問題。也就是說,類別 :class:`!" "D` 的兩個實例在建立類別實例時沒有為 :attr:`!x` 指定值,它們將共享 :attr:`!x` " @@ -1601,10 +1591,9 @@ msgstr "" #: ../../library/dataclasses.rst:803 #, fuzzy msgid "" -"Instead of looking for and disallowing objects of " -"type :class:`list`, :class:`dict`, or :class:`set`, unhashable objects are " -"now not allowed as default values. Unhashability is used to approximate " -"mutability." +"Instead of looking for and disallowing objects of type :class:`list`, :class:" +"`dict`, or :class:`set`, unhashable objects are now not allowed as default " +"values. Unhashability is used to approximate mutability." msgstr "" "不再查找和禁止型別為 :class:`list`、:class:`dict` 或 :class:`set` 的物件,現" "在不允許使用不可散列的對像作為預設值。不可散列性用於近似可變性。" @@ -1629,15 +1618,15 @@ msgid "" "method is passed to the descriptor's :meth:`~object.__set__` method rather " "than overwriting the descriptor object." msgstr "" -"傳遞給資料類別的 :meth:`~object.__init__` 方法的欄位值被傳遞給描述器" -"的 :meth:`~object.__set__` 方法,而不是覆蓋描述器物件。" +"傳遞給資料類別的 :meth:`~object.__init__` 方法的欄位值被傳遞給描述器的 :meth:" +"`~object.__set__` 方法,而不是覆蓋描述器物件。" #: ../../library/dataclasses.rst:819 #, fuzzy msgid "" -"Similarly, when getting or setting the field, the " -"descriptor's :meth:`~object.__get__` or :meth:`!__set__` method is called " -"rather than returning or overwriting the descriptor object." +"Similarly, when getting or setting the field, the descriptor's :meth:" +"`~object.__get__` or :meth:`!__set__` method is called rather than returning " +"or overwriting the descriptor object." msgstr "" "同樣,在取得或設定欄位時,將呼叫描述器的 :meth:`~object.__get__` 或 :meth:`!" "__set__` 方法,而不是回傳或覆蓋描述器物件。" @@ -1645,12 +1634,12 @@ msgstr "" #: ../../library/dataclasses.rst:823 #, fuzzy msgid "" -"To determine whether a field contains a default value, :func:`@dataclass " -"` will call the descriptor's :meth:`!__get__` method using its " -"class access form: ``descriptor.__get__(obj=None, type=cls)``. If the " -"descriptor returns a value in this case, it will be used as the field's " -"default. On the other hand, if the descriptor raises :exc:`AttributeError` " -"in this situation, no default value will be provided for the field." +"To determine whether a field contains a default value, :deco:`dataclass` " +"will call the descriptor's :meth:`!__get__` method using its class access " +"form: ``descriptor.__get__(obj=None, type=cls)``. If the descriptor returns " +"a value in this case, it will be used as the field's default. On the other " +"hand, if the descriptor raises :exc:`AttributeError` in this situation, no " +"default value will be provided for the field." msgstr "" "為了確定一個欄位是否包含預設值,:func:`@dataclass ` 將使用其類別存" "取形式呼叫描述器的 :meth:`!__get__` 方法(即 ``descriptor.__get__(obj=None, " diff --git a/library/dbm.po b/library/dbm.po index 7dfd3dbb89..137468d0aa 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -59,8 +59,8 @@ msgstr "" #: ../../library/dbm.rst:31 msgid "" "This function attempts to guess which of the several simple database modules " -"available --- :mod:`dbm.sqlite3`, :mod:`dbm.gnu`, :mod:`dbm.ndbm`, " -"or :mod:`dbm.dumb` --- should be used to open a given file." +"available --- :mod:`dbm.sqlite3`, :mod:`dbm.gnu`, :mod:`dbm.ndbm`, or :mod:" +"`dbm.dumb` --- should be used to open a given file." msgstr "" #: ../../library/dbm.rst:35 @@ -82,7 +82,7 @@ msgid "" "``'dbm.gnu'``" msgstr "" -#: ../../library/dbm.rst:41 ../../library/dbm.rst:250 ../../library/dbm.rst:448 +#: ../../library/dbm.rst:41 ../../library/dbm.rst:270 ../../library/dbm.rst:471 msgid "*filename* accepts a :term:`path-like object`." msgstr "" @@ -96,13 +96,13 @@ msgstr "參數" #: ../../library/dbm.rst:67 msgid "" -"The database file to open. If the database file already exists, " -"the :func:`whichdb` function is used to determine its type and the " -"appropriate module is used; if it does not exist, the first submodule listed " -"above that can be imported is used." +"The database file to open. If the database file already exists, the :func:" +"`whichdb` function is used to determine its type and the appropriate module " +"is used; if it does not exist, the first submodule listed above that can be " +"imported is used." msgstr "" -#: ../../library/dbm.rst:68 ../../library/dbm.rst:222 +#: ../../library/dbm.rst:68 ../../library/dbm.rst:242 msgid "The database file to open." msgstr "要打開的資料庫檔案" @@ -113,7 +113,7 @@ msgid "" "the first submodule listed above that can be imported is used." msgstr "" -#: ../../library/dbm.rst:75 ../../library/dbm.rst:178 ../../library/dbm.rst:353 +#: ../../library/dbm.rst:75 ../../library/dbm.rst:182 ../../library/dbm.rst:374 msgid "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n|" @@ -121,28 +121,28 @@ msgstr "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n|" -#: ../../library/dbm.rst:76 ../../library/dbm.rst:180 ../../library/dbm.rst:227 -#: ../../library/dbm.rst:354 +#: ../../library/dbm.rst:76 ../../library/dbm.rst:184 ../../library/dbm.rst:247 +#: ../../library/dbm.rst:375 msgid "``'r'`` (default): |flag_r|" msgstr "``'r'`` (default): |flag_r|" -#: ../../library/dbm.rst:77 ../../library/dbm.rst:181 ../../library/dbm.rst:228 -#: ../../library/dbm.rst:355 ../../library/dbm.rst:429 +#: ../../library/dbm.rst:77 ../../library/dbm.rst:185 ../../library/dbm.rst:248 +#: ../../library/dbm.rst:376 ../../library/dbm.rst:452 msgid "``'w'``: |flag_w|" msgstr "``'w'``: |flag_w|" -#: ../../library/dbm.rst:78 ../../library/dbm.rst:182 ../../library/dbm.rst:229 -#: ../../library/dbm.rst:356 +#: ../../library/dbm.rst:78 ../../library/dbm.rst:186 ../../library/dbm.rst:249 +#: ../../library/dbm.rst:377 msgid "``'c'``: |flag_c|" msgstr "``'c'``: |flag_c|" -#: ../../library/dbm.rst:79 ../../library/dbm.rst:183 ../../library/dbm.rst:230 -#: ../../library/dbm.rst:357 ../../library/dbm.rst:431 +#: ../../library/dbm.rst:79 ../../library/dbm.rst:187 ../../library/dbm.rst:250 +#: ../../library/dbm.rst:378 ../../library/dbm.rst:454 msgid "``'n'``: |flag_n|" msgstr "``'n'``: |flag_n|" -#: ../../library/dbm.rst:81 ../../library/dbm.rst:244 ../../library/dbm.rst:359 -#: ../../library/dbm.rst:433 +#: ../../library/dbm.rst:81 ../../library/dbm.rst:264 ../../library/dbm.rst:380 +#: ../../library/dbm.rst:456 msgid "|mode_param_doc|" msgstr "|mode_param_doc|" @@ -152,51 +152,56 @@ msgstr "*file* 接受一個\\ :term:`類路徑物件 `。" #: ../../library/dbm.rst:87 msgid "" -"The object returned by :func:`~dbm.open` supports the same basic " -"functionality as a :class:`dict`; keys and their corresponding values can be " -"stored, retrieved, and deleted, and the :keyword:`in` operator and " -"the :meth:`!keys` method are available, as well as :meth:`!get` and :meth:`!" -"setdefault` methods." +"The object returned by :func:`~dbm.open` supports the basic functionality of " +"mutable :term:`mappings `; keys and their corresponding values can " +"be stored, retrieved, and deleted, and iteration, the :keyword:`in` operator " +"and methods :meth:`!keys`, :meth:`!get`, :meth:`!setdefault` and :meth:`!" +"clear` are available. The :meth:`!keys` method returns a list instead of a " +"view object. The :meth:`!setdefault` method requires two arguments." msgstr "" -#: ../../library/dbm.rst:92 +#: ../../library/dbm.rst:95 msgid "" "Key and values are always stored as :class:`bytes`. This means that when " "strings are used they are implicitly converted to the default encoding " "before being stored." msgstr "" -#: ../../library/dbm.rst:96 +#: ../../library/dbm.rst:99 msgid "" "These objects also support being used in a :keyword:`with` statement, which " "will automatically close them when done." msgstr "" -#: ../../library/dbm.rst:99 +#: ../../library/dbm.rst:102 msgid "" -":meth:`!get` and :meth:`!setdefault` methods are now available for " -"all :mod:`dbm` backends." +":meth:`!get` and :meth:`!setdefault` methods are now available for all :mod:" +"`dbm` backends." msgstr "" -#: ../../library/dbm.rst:103 +#: ../../library/dbm.rst:106 msgid "" "Added native support for the context management protocol to the objects " "returned by :func:`~dbm.open`." msgstr "" -#: ../../library/dbm.rst:107 +#: ../../library/dbm.rst:110 msgid "" "Deleting a key from a read-only database raises a database module specific " "exception instead of :exc:`KeyError`." msgstr "" -#: ../../library/dbm.rst:111 +#: ../../library/dbm.rst:114 +msgid ":meth:`!clear` methods are now available for all :mod:`dbm` backends." +msgstr ":meth:`!clear` 方法現在可用於所有 :mod:`dbm` 後端。" + +#: ../../library/dbm.rst:118 msgid "" "The following example records some hostnames and a corresponding title, and " "then prints out the contents of the database::" msgstr "" -#: ../../library/dbm.rst:114 +#: ../../library/dbm.rst:121 msgid "" "import dbm\n" "\n" @@ -223,32 +228,32 @@ msgid "" "# db is automatically closed when leaving the with statement." msgstr "" -#: ../../library/dbm.rst:141 +#: ../../library/dbm.rst:148 msgid "Module :mod:`shelve`" msgstr ":mod:`shelve` 模組" -#: ../../library/dbm.rst:142 +#: ../../library/dbm.rst:149 msgid "Persistence module which stores non-string data." msgstr "" -#: ../../library/dbm.rst:145 +#: ../../library/dbm.rst:152 msgid "The individual submodules are described in the following sections." msgstr "" -#: ../../library/dbm.rst:148 +#: ../../library/dbm.rst:155 msgid ":mod:`dbm.sqlite3` --- SQLite backend for dbm" msgstr ":mod:`dbm.sqlite3` --- dbm 的 SQLite 後端" -#: ../../library/dbm.rst:156 +#: ../../library/dbm.rst:163 msgid "**Source code:** :source:`Lib/dbm/sqlite3.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/sqlite3.py`" -#: ../../library/dbm.rst:160 +#: ../../library/dbm.rst:167 msgid "" "This module uses the standard library :mod:`sqlite3` module to provide an " -"SQLite backend for the :mod:`dbm` module. The files created " -"by :mod:`dbm.sqlite3` can thus be opened by :mod:`sqlite3`, or any other " -"SQLite browser, including the SQLite CLI." +"SQLite backend for the :mod:`dbm` module. The files created by :mod:`dbm." +"sqlite3` can thus be opened by :mod:`sqlite3`, or any other SQLite browser, " +"including the SQLite CLI." msgstr "" #: ../../includes/wasm-mobile-notavail.rst:3 ../../includes/wasm-notavail.rst:3 @@ -263,39 +268,52 @@ msgstr "" "此模組在 WebAssembly 平台上不起作用或無法使用。更多資訊請參閱 :ref:`wasm-" "availability`。" -#: ../../library/dbm.rst:169 -msgid "" -"Open an SQLite database. The returned object behaves like a :term:`mapping`, " -"implements a :meth:`!close` method, and supports a \"closing\" context " -"manager via the :keyword:`with` keyword." -msgstr "" +#: ../../library/dbm.rst:176 +msgid "Open an SQLite database." +msgstr "打開一個 SQLite 資料庫。" -#: ../../library/dbm.rst:174 +#: ../../library/dbm.rst:178 msgid "The path to the database to be opened." msgstr "要打開的資料庫路徑" -#: ../../library/dbm.rst:185 +#: ../../library/dbm.rst:189 msgid "" "The Unix file access mode of the file (default: octal ``0o666``), used only " "when the database has to be created." msgstr "" -#: ../../library/dbm.rst:191 +#: ../../library/dbm.rst:193 +msgid "" +"The returned database object behaves similar to a mutable :term:`mapping`, " +"but the :meth:`!keys` method returns a list, and the :meth:`!setdefault` " +"method requires two arguments. It also supports a \"closing\" context " +"manager via the :keyword:`with` keyword." +msgstr "" + +#: ../../library/dbm.rst:198 ../../library/dbm.rst:399 +msgid "The following method is also provided:" +msgstr "也提供了以下方法:" + +#: ../../library/dbm.rst:202 +msgid "Close the SQLite database." +msgstr "關閉 SQLite 資料庫。" + +#: ../../library/dbm.rst:206 msgid ":mod:`dbm.gnu` --- GNU database manager" msgstr ":mod:`dbm.gnu` --- GNU 資料庫管理器" -#: ../../library/dbm.rst:197 +#: ../../library/dbm.rst:212 msgid "**Source code:** :source:`Lib/dbm/gnu.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/gnu.py`" -#: ../../library/dbm.rst:201 +#: ../../library/dbm.rst:216 msgid "" "The :mod:`dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU " "dbm)` library, similar to the :mod:`dbm.ndbm` module, but with additional " "functionality like crash tolerance." msgstr "" -#: ../../library/dbm.rst:207 ../../library/dbm.rst:321 +#: ../../library/dbm.rst:222 ../../library/dbm.rst:342 msgid "" "The file formats created by :mod:`dbm.gnu` and :mod:`dbm.ndbm` are " "incompatible and can not be used interchangeably." @@ -309,18 +327,24 @@ msgstr "" "此模組在\\ :ref:`行動平台 `\\ 或\\ :ref:`WebAssembly 平" "台 `\\ 上不支援。" -#: ../../library/dbm.rst:214 +#: ../../library/dbm.rst:229 msgid "" -"Raised on :mod:`dbm.gnu`-specific errors, such as I/O " -"errors. :exc:`KeyError` is raised for general mapping errors like specifying " -"an incorrect key." +"Raised on :mod:`dbm.gnu`-specific errors, such as I/O errors. :exc:" +"`KeyError` is raised for general mapping errors like specifying an incorrect " +"key." msgstr "" -#: ../../library/dbm.rst:220 +#: ../../library/dbm.rst:235 +msgid "" +"A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` " +"supports." +msgstr "" + +#: ../../library/dbm.rst:240 msgid "Open a GDBM database and return a :class:`!gdbm` object." msgstr "打開一個 GDBM 資料庫,並回傳一個 :class:`!gdbm` 物件。" -#: ../../library/dbm.rst:226 +#: ../../library/dbm.rst:246 msgid "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n| The following additional characters may be appended to " @@ -332,29 +356,29 @@ msgid "" "flag characters." msgstr "" -#: ../../library/dbm.rst:232 +#: ../../library/dbm.rst:252 msgid "" "The following additional characters may be appended to control how the " "database is opened:" msgstr "" -#: ../../library/dbm.rst:235 +#: ../../library/dbm.rst:255 msgid "" "``'f'``: Open the database in fast mode. Writes to the database will not be " "synchronized." msgstr "" -#: ../../library/dbm.rst:237 +#: ../../library/dbm.rst:257 msgid "" "``'s'``: Synchronized mode. Changes to the database will be written " "immediately to the file." msgstr "" -#: ../../library/dbm.rst:239 +#: ../../library/dbm.rst:259 msgid "``'u'``: Do not lock database." msgstr "``'u'``: 不要鎖住資料庫。" -#: ../../library/dbm.rst:241 +#: ../../library/dbm.rst:261 msgid "" "Not all flags are valid for all versions of GDBM. See the :data:`open_flags` " "member for a list of supported flag characters." @@ -364,24 +388,37 @@ msgstr "" msgid "Raises" msgstr "引發" -#: ../../library/dbm.rst:247 +#: ../../library/dbm.rst:267 msgid "If an invalid *flag* argument is passed." msgstr "如果一個無效的 *flag* 引數被傳入。" -#: ../../library/dbm.rst:255 +#: ../../library/dbm.rst:273 msgid "" -"A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` " -"supports." +":class:`!gdbm` objects behave similar to mutable :term:`mappings `, " +"but methods :meth:`!items`, :meth:`!values`, :meth:`!pop`, :meth:`!popitem`, " +"and :meth:`!update` are not supported, the :meth:`!keys` method returns a " +"list, and the :meth:`!setdefault` method requires two arguments. It also " +"supports a \"closing\" context manager via the :keyword:`with` keyword." msgstr "" -#: ../../library/dbm.rst:257 -msgid "" -":class:`!gdbm` objects behave similar to :term:`mappings `, " -"but :meth:`!items` and :meth:`!values` methods are not supported. The " -"following methods are also provided:" +#: ../../library/dbm.rst:280 ../../library/dbm.rst:393 +msgid "Added the :meth:`!get` and :meth:`!setdefault` methods." msgstr "" -#: ../../library/dbm.rst:263 +#: ../../library/dbm.rst:283 ../../library/dbm.rst:396 +msgid "Added the :meth:`!clear` method." +msgstr "" + +#: ../../library/dbm.rst:286 ../../library/dbm.rst:479 +#, fuzzy +msgid "The following methods are also provided:" +msgstr "也提供了以下方法:" + +#: ../../library/dbm.rst:290 +msgid "Close the GDBM database." +msgstr "關閉 GDBM 資料庫。" + +#: ../../library/dbm.rst:294 msgid "" "It's possible to loop over every key in the database using this method and " "the :meth:`nextkey` method. The traversal is ordered by GDBM's internal " @@ -389,14 +426,14 @@ msgid "" "starting key." msgstr "" -#: ../../library/dbm.rst:270 +#: ../../library/dbm.rst:301 msgid "" "Returns the key that follows *key* in the traversal. The following code " "prints every key in the database ``db``, without having to create a list in " "memory that contains them all::" msgstr "" -#: ../../library/dbm.rst:274 +#: ../../library/dbm.rst:305 msgid "" "k = db.firstkey()\n" "while k is not None:\n" @@ -408,45 +445,37 @@ msgstr "" " print(k)\n" " k = db.nextkey(k)" -#: ../../library/dbm.rst:281 +#: ../../library/dbm.rst:312 msgid "" "If you have carried out a lot of deletions and would like to shrink the " -"space used by the GDBM file, this routine will reorganize the " -"database. :class:`!gdbm` objects will not shorten the length of a database " -"file except by using this reorganization; otherwise, deleted file space will " -"be kept and reused as new (key, value) pairs are added." +"space used by the GDBM file, this routine will reorganize the database. :" +"class:`!gdbm` objects will not shorten the length of a database file except " +"by using this reorganization; otherwise, deleted file space will be kept and " +"reused as new (key, value) pairs are added." msgstr "" -#: ../../library/dbm.rst:289 +#: ../../library/dbm.rst:320 msgid "" "When the database has been opened in fast mode, this method forces any " "unwritten data to be written to the disk." msgstr "" -#: ../../library/dbm.rst:294 -msgid "Close the GDBM database." -msgstr "關閉 GDBM 資料庫。" - -#: ../../library/dbm.rst:298 -msgid "Remove all items from the GDBM database." -msgstr "移除 GDBM 資料庫的所有項目。" - -#: ../../library/dbm.rst:304 +#: ../../library/dbm.rst:325 msgid ":mod:`dbm.ndbm` --- New Database Manager" msgstr ":mod:`dbm.ndbm` --- 新資料庫管理器" -#: ../../library/dbm.rst:310 +#: ../../library/dbm.rst:331 msgid "**Source code:** :source:`Lib/dbm/ndbm.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/ndbm.py`" -#: ../../library/dbm.rst:314 +#: ../../library/dbm.rst:335 msgid "" "The :mod:`dbm.ndbm` module provides an interface to the :abbr:`NDBM (New " "Database Manager)` library. This module can be used with the \"classic\" " "NDBM interface or the :abbr:`GDBM (GNU dbm)` compatibility interface." msgstr "" -#: ../../library/dbm.rst:326 +#: ../../library/dbm.rst:347 msgid "" "The NDBM library shipped as part of macOS has an undocumented limitation on " "the size of values, which can result in corrupted database files when " @@ -454,109 +483,104 @@ msgid "" "result in a hard crash (segmentation fault)." msgstr "" -#: ../../library/dbm.rst:335 +#: ../../library/dbm.rst:356 msgid "" -"Raised on :mod:`dbm.ndbm`-specific errors, such as I/O " -"errors. :exc:`KeyError` is raised for general mapping errors like specifying " -"an incorrect key." +"Raised on :mod:`dbm.ndbm`-specific errors, such as I/O errors. :exc:" +"`KeyError` is raised for general mapping errors like specifying an incorrect " +"key." msgstr "" -#: ../../library/dbm.rst:341 +#: ../../library/dbm.rst:362 msgid "Name of the NDBM implementation library used." msgstr "" -#: ../../library/dbm.rst:346 +#: ../../library/dbm.rst:367 msgid "Open an NDBM database and return an :class:`!ndbm` object." msgstr "" -#: ../../library/dbm.rst:348 +#: ../../library/dbm.rst:369 msgid "" "The basename of the database file (without the :file:`.dir` or :file:`.pag` " "extensions)." msgstr "" -#: ../../library/dbm.rst:362 -msgid "" -":class:`!ndbm` objects behave similar to :term:`mappings `, " -"but :meth:`!items` and :meth:`!values` methods are not supported. The " -"following methods are also provided:" +#: ../../library/dbm.rst:383 +msgid "Accepts :term:`path-like object` for filename." msgstr "" -#: ../../library/dbm.rst:366 -msgid "Accepts :term:`path-like object` for filename." +#: ../../library/dbm.rst:386 +msgid "" +":class:`!ndbm` objects behave similar to mutable :term:`mappings `, " +"but methods :meth:`!items`, :meth:`!values`, :meth:`!pop`, :meth:`!popitem`, " +"and :meth:`!update` are not supported, the :meth:`!keys` method returns a " +"list, and the :meth:`!setdefault` method requires two arguments. It also " +"supports a \"closing\" context manager via the :keyword:`with` keyword." msgstr "" -#: ../../library/dbm.rst:371 +#: ../../library/dbm.rst:403 msgid "Close the NDBM database." msgstr "關閉 NDBM 資料庫。" -#: ../../library/dbm.rst:375 -msgid "Remove all items from the NDBM database." -msgstr "移除 NDBM 資料庫的所有項目。" - -#: ../../library/dbm.rst:381 +#: ../../library/dbm.rst:407 msgid ":mod:`dbm.dumb` --- Portable DBM implementation" msgstr ":mod:`dbm.dumb` --- 可攜式 DBM 實作" -#: ../../library/dbm.rst:386 +#: ../../library/dbm.rst:412 msgid "**Source code:** :source:`Lib/dbm/dumb.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/dumb.py`" -#: ../../library/dbm.rst:392 +#: ../../library/dbm.rst:418 msgid "" -"The :mod:`dbm.dumb` module is intended as a last resort fallback for " -"the :mod:`dbm` module when a more robust module is not available. " -"The :mod:`dbm.dumb` module is not written for speed and is not nearly as " -"heavily used as the other database modules." +"The :mod:`dbm.dumb` module is intended as a last resort fallback for the :" +"mod:`dbm` module when a more robust module is not available. The :mod:`dbm." +"dumb` module is not written for speed and is not nearly as heavily used as " +"the other database modules." msgstr "" -#: ../../library/dbm.rst:399 +#: ../../library/dbm.rst:425 msgid "" "The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like " "interface which is written entirely in Python. Unlike other :mod:`dbm` " "backends, such as :mod:`dbm.gnu`, no external library is required." msgstr "" -#: ../../library/dbm.rst:404 +#: ../../library/dbm.rst:430 msgid "The :mod:`!dbm.dumb` module defines the following:" msgstr ":mod:`!dbm.dumb` 模組定義了以下項目:" -#: ../../library/dbm.rst:408 +#: ../../library/dbm.rst:434 msgid "" -"Raised on :mod:`dbm.dumb`-specific errors, such as I/O " -"errors. :exc:`KeyError` is raised for general mapping errors like " -"specifying an incorrect key." +"Raised on :mod:`dbm.dumb`-specific errors, such as I/O errors. :exc:" +"`KeyError` is raised for general mapping errors like specifying an incorrect " +"key." msgstr "" -#: ../../library/dbm.rst:414 -msgid "" -"Open a :mod:`!dbm.dumb` database. The returned database object behaves " -"similar to a :term:`mapping`, in addition to providing :meth:`~dumbdbm.sync` " -"and :meth:`~dumbdbm.close` methods." +#: ../../library/dbm.rst:440 +msgid "Open a :mod:`!dbm.dumb` database." msgstr "" -#: ../../library/dbm.rst:419 +#: ../../library/dbm.rst:442 msgid "" "The basename of the database file (without extensions). A new database " -"creates the following files: - :file:`{filename}.dat` " -"- :file:`{filename}.dir`" +"creates the following files: - :file:`{filename}.dat` - :file:`{filename}." +"dir`" msgstr "" -#: ../../library/dbm.rst:420 +#: ../../library/dbm.rst:443 msgid "" "The basename of the database file (without extensions). A new database " "creates the following files:" msgstr "" -#: ../../library/dbm.rst:423 +#: ../../library/dbm.rst:446 msgid ":file:`{filename}.dat`" msgstr ":file:`{filename}.dat`" -#: ../../library/dbm.rst:424 +#: ../../library/dbm.rst:447 msgid ":file:`{filename}.dir`" msgstr ":file:`{filename}.dir`" -#: ../../library/dbm.rst:427 +#: ../../library/dbm.rst:450 msgid "" "* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * " "``'n'``: |flag_n|" @@ -564,62 +588,56 @@ msgstr "" "* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * " "``'n'``: |flag_n|" -#: ../../library/dbm.rst:428 +#: ../../library/dbm.rst:451 msgid "``'r'``: |flag_r|" msgstr "``'r'``: |flag_r|" -#: ../../library/dbm.rst:430 +#: ../../library/dbm.rst:453 msgid "``'c'`` (default): |flag_c|" msgstr "``'c'`` (default): |flag_c|" -#: ../../library/dbm.rst:437 +#: ../../library/dbm.rst:460 msgid "" "It is possible to crash the Python interpreter when loading a database with " "a sufficiently large/complex entry due to stack depth limitations in " "Python's AST compiler." msgstr "" -#: ../../library/dbm.rst:441 +#: ../../library/dbm.rst:464 msgid "" ":func:`~dbm.dumb.open` always creates a new database when *flag* is ``'n'``." msgstr "" -#: ../../library/dbm.rst:444 +#: ../../library/dbm.rst:467 msgid "" "A database opened read-only if *flag* is ``'r'``. A database is not created " "if it does not exist if *flag* is ``'r'`` or ``'w'``." msgstr "" -#: ../../library/dbm.rst:451 +#: ../../library/dbm.rst:474 msgid "" -"In addition to the methods provided by " -"the :class:`collections.abc.MutableMapping` class, the following methods are " -"provided:" +"The returned database object behaves similar to a mutable :term:`mapping`, " +"but the :meth:`!keys` and :meth:`!items` methods return lists, and the :meth:" +"`!setdefault` method requires two arguments. It also supports a \"closing\" " +"context manager via the :keyword:`with` keyword." msgstr "" -#: ../../library/dbm.rst:457 +#: ../../library/dbm.rst:483 +msgid "Close the database." +msgstr "關閉資料庫。" + +#: ../../library/dbm.rst:487 msgid "" "Synchronize the on-disk directory and data files. This method is called by " "the :meth:`shelve.Shelf.sync` method." msgstr "" -#: ../../library/dbm.rst:462 -msgid "Close the database." -msgstr "關閉資料庫。" - -#: ../../library/dbm.rst:388 +#: ../../library/dbm.rst:414 msgid "databases" msgstr "databases(資料庫)" -#~ msgid "" -#~ ":meth:`!clear` methods are now available for all :mod:`dbm` backends." -#~ msgstr ":meth:`!clear` 方法現在可用於所有 :mod:`dbm` 後端。" - -#~ msgid "Open an SQLite database." -#~ msgstr "打開一個 SQLite 資料庫。" - -#~ msgid "The following method is also provided:" -#~ msgstr "也提供了以下方法:" +#~ msgid "Remove all items from the GDBM database." +#~ msgstr "移除 GDBM 資料庫的所有項目。" -#~ msgid "Close the SQLite database." -#~ msgstr "關閉 SQLite 資料庫。" +#~ msgid "Remove all items from the NDBM database." +#~ msgstr "移除 NDBM 資料庫的所有項目。" diff --git a/library/difflib.po b/library/difflib.po index 3296ad6fc8..64788e9347 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-08 00:17+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -310,7 +310,7 @@ msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk, or false if not. The default is ``None``. There " "is also a module-level function :func:`IS_LINE_JUNK`, which filters out " -"lines without visible characters, except for at most one pound character " +"lines without visible characters, except for at most one hash character " "(``'#'``) -- however the underlying :class:`SequenceMatcher` class does a " "dynamic analysis of which lines are so frequent as to constitute noise, and " "this usually works better than using this function." diff --git a/library/dis.po b/library/dis.po index a786deae55..16850b6eef 100644 --- a/library/dis.po +++ b/library/dis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-10 20:44+0800\n" +"POT-Creation-Date: 2025-09-30 00:13+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-" @@ -61,17 +61,17 @@ msgstr "" msgid "" "Some instructions are accompanied by one or more inline cache entries, which " "take the form of :opcode:`CACHE` instructions. These instructions are hidden " -"by default, but can be shown by passing ``show_caches=True`` to " -"any :mod:`dis` utility. Furthermore, the interpreter now adapts the bytecode " -"to specialize it for different runtime conditions. The adaptive bytecode can " -"be shown by passing ``adaptive=True``." +"by default, but can be shown by passing ``show_caches=True`` to any :mod:" +"`dis` utility. Furthermore, the interpreter now adapts the bytecode to " +"specialize it for different runtime conditions. The adaptive bytecode can be " +"shown by passing ``adaptive=True``." msgstr "" #: ../../library/dis.rst:45 msgid "" "The argument of a jump is the offset of the target instruction relative to " -"the instruction that appears immediately after the jump " -"instruction's :opcode:`CACHE` entries." +"the instruction that appears immediately after the jump instruction's :" +"opcode:`CACHE` entries." msgstr "" #: ../../library/dis.rst:50 @@ -187,9 +187,9 @@ msgstr "" #: ../../library/dis.rst:136 msgid "" -"The bytecode analysis API allows pieces of Python code to be wrapped in " -"a :class:`Bytecode` object that provides easy access to details of the " -"compiled code." +"The bytecode analysis API allows pieces of Python code to be wrapped in a :" +"class:`Bytecode` object that provides easy access to details of the compiled " +"code." msgstr "" #: ../../library/dis.rst:144 @@ -261,8 +261,8 @@ msgstr "" #: ../../library/dis.rst:188 msgid "" -"Return a formatted view of the bytecode operations (the same as printed " -"by :func:`dis.dis`, but returned as a multi-line string)." +"Return a formatted view of the bytecode operations (the same as printed by :" +"func:`dis.dis`, but returned as a multi-line string)." msgstr "" #: ../../library/dis.rst:193 @@ -487,10 +487,10 @@ msgstr "" #: ../../library/dis.rst:393 msgid "" -"This generator function uses the :meth:`~codeobject.co_lines` method of " -"the :ref:`code object ` *code* to find the offsets which are " -"starts of lines in the source code. They are generated as ``(offset, " -"lineno)`` pairs." +"This generator function uses the :meth:`~codeobject.co_lines` method of the :" +"ref:`code object ` *code* to find the offsets which are starts " +"of lines in the source code. They are generated as ``(offset, lineno)`` " +"pairs." msgstr "" #: ../../library/dis.rst:398 @@ -499,8 +499,8 @@ msgstr "" #: ../../library/dis.rst:401 msgid "" -"The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of " -"the :attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab` " +"The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of the :" +"attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab` " "attributes of the :ref:`code object `." msgstr "" @@ -687,30 +687,41 @@ msgid "" msgstr "" #: ../../library/dis.rst:590 +msgid "" +"Do nothing code. Used by the interpreter to record :monitoring-event:" +"`BRANCH_LEFT` and :monitoring-event:`BRANCH_RIGHT` events for :mod:`sys." +"monitoring`." +msgstr "" + +#: ../../library/dis.rst:599 +msgid "Removes the iterator from the top of the stack." +msgstr "" + +#: ../../library/dis.rst:606 msgid "Removes the top-of-stack item::" msgstr "" -#: ../../library/dis.rst:592 +#: ../../library/dis.rst:608 msgid "STACK.pop()" msgstr "STACK.pop()" -#: ../../library/dis.rst:597 +#: ../../library/dis.rst:613 msgid "" "Removes the top-of-stack item. Equivalent to ``POP_TOP``. Used to clean up " "at the end of loops, hence the name." msgstr "" -#: ../../library/dis.rst:606 +#: ../../library/dis.rst:622 msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." msgstr "" -#: ../../library/dis.rst:614 +#: ../../library/dis.rst:630 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" -#: ../../library/dis.rst:617 +#: ../../library/dis.rst:633 msgid "" "assert i > 0\n" "STACK.append(STACK[-i])" @@ -718,15 +729,15 @@ msgstr "" "assert i > 0\n" "STACK.append(STACK[-i])" -#: ../../library/dis.rst:625 +#: ../../library/dis.rst:641 msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: ../../library/dis.rst:627 +#: ../../library/dis.rst:643 msgid "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" msgstr "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" -#: ../../library/dis.rst:634 +#: ../../library/dis.rst:650 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -734,86 +745,86 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: ../../library/dis.rst:639 +#: ../../library/dis.rst:655 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: ../../library/dis.rst:643 +#: ../../library/dis.rst:659 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: ../../library/dis.rst:650 +#: ../../library/dis.rst:666 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:652 +#: ../../library/dis.rst:668 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:658 +#: ../../library/dis.rst:674 msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "實作 ``STACK[-1] = -STACK[-1]``。" -#: ../../library/dis.rst:663 +#: ../../library/dis.rst:679 msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "實作 ``STACK[-1] = not STACK[-1]``。" -#: ../../library/dis.rst:665 ../../library/dis.rst:1372 -#: ../../library/dis.rst:1388 +#: ../../library/dis.rst:681 ../../library/dis.rst:1383 +#: ../../library/dis.rst:1399 msgid "This instruction now requires an exact :class:`bool` operand." msgstr "" -#: ../../library/dis.rst:671 +#: ../../library/dis.rst:687 msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "實作 ``STACK[-1] = ~STACK[-1]``。" -#: ../../library/dis.rst:676 +#: ../../library/dis.rst:692 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "實作 ``STACK[-1] = iter(STACK[-1])``。" -#: ../../library/dis.rst:681 +#: ../../library/dis.rst:697 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:689 +#: ../../library/dis.rst:705 msgid "Implements ``STACK[-1] = bool(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:694 +#: ../../library/dis.rst:710 msgid "**Binary and in-place operations**" msgstr "" -#: ../../library/dis.rst:696 +#: ../../library/dis.rst:712 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" -#: ../../library/dis.rst:699 +#: ../../library/dis.rst:715 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:706 +#: ../../library/dis.rst:722 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" -#: ../../library/dis.rst:709 +#: ../../library/dis.rst:725 msgid "" "rhs = STACK.pop()\n" "lhs = STACK.pop()\n" @@ -823,22 +834,22 @@ msgstr "" "lhs = STACK.pop()\n" "STACK.append(lhs op rhs)" -#: ../../library/dis.rst:714 +#: ../../library/dis.rst:730 msgid "" "With oparg :``NB_SUBSCR``, implements binary subscript (replaces opcode " "``BINARY_SUBSCR``)" msgstr "" -#: ../../library/dis.rst:720 ../../library/dis.rst:730 -#: ../../library/dis.rst:738 ../../library/dis.rst:750 -#: ../../library/dis.rst:828 ../../library/dis.rst:838 -#: ../../library/dis.rst:848 ../../library/dis.rst:1054 -#: ../../library/dis.rst:1065 ../../library/dis.rst:1215 -#: ../../library/dis.rst:1227 ../../library/dis.rst:1239 +#: ../../library/dis.rst:736 ../../library/dis.rst:746 +#: ../../library/dis.rst:754 ../../library/dis.rst:766 +#: ../../library/dis.rst:844 ../../library/dis.rst:854 +#: ../../library/dis.rst:864 ../../library/dis.rst:1070 +#: ../../library/dis.rst:1081 ../../library/dis.rst:1226 +#: ../../library/dis.rst:1238 ../../library/dis.rst:1250 msgid "Implements::" msgstr "實作了: ::" -#: ../../library/dis.rst:722 +#: ../../library/dis.rst:738 msgid "" "key = STACK.pop()\n" "container = STACK.pop()\n" @@ -850,7 +861,7 @@ msgstr "" "value = STACK.pop()\n" "container[key] = value" -#: ../../library/dis.rst:732 +#: ../../library/dis.rst:748 msgid "" "key = STACK.pop()\n" "container = STACK.pop()\n" @@ -860,7 +871,7 @@ msgstr "" "container = STACK.pop()\n" "del container[key]" -#: ../../library/dis.rst:740 +#: ../../library/dis.rst:756 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" @@ -872,7 +883,7 @@ msgstr "" "container = STACK.pop()\n" "STACK.append(container[start:end])" -#: ../../library/dis.rst:752 +#: ../../library/dis.rst:768 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" @@ -886,11 +897,11 @@ msgstr "" "values = STACK.pop()\n" "container[start:end] = value" -#: ../../library/dis.rst:761 +#: ../../library/dis.rst:777 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:765 +#: ../../library/dis.rst:781 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " @@ -898,39 +909,39 @@ msgid "" "resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:770 +#: ../../library/dis.rst:786 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: ../../library/dis.rst:773 +#: ../../library/dis.rst:789 msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: ../../library/dis.rst:774 +#: ../../library/dis.rst:790 msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: ../../library/dis.rst:778 +#: ../../library/dis.rst:794 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: ../../library/dis.rst:784 +#: ../../library/dis.rst:800 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: ../../library/dis.rst:787 +#: ../../library/dis.rst:803 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:794 +#: ../../library/dis.rst:810 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:802 +#: ../../library/dis.rst:818 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " @@ -938,25 +949,25 @@ msgid "" "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:809 ../../library/dis.rst:900 -#: ../../library/dis.rst:911 +#: ../../library/dis.rst:825 ../../library/dis.rst:916 +#: ../../library/dis.rst:927 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:815 +#: ../../library/dis.rst:831 msgid "" -"Handles an exception raised during a :meth:`~generator.throw` " -"or :meth:`~generator.close` call through the current frame. If " -"``STACK[-1]`` is an instance of :exc:`StopIteration`, pop three values from " -"the stack and push its ``value`` member. Otherwise, re-raise ``STACK[-1]``." +"Handles an exception raised during a :meth:`~generator.throw` or :meth:" +"`~generator.close` call through the current frame. If ``STACK[-1]`` is an " +"instance of :exc:`StopIteration`, pop three values from the stack and push " +"its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:824 +#: ../../library/dis.rst:840 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:830 +#: ../../library/dis.rst:846 msgid "" "item = STACK.pop()\n" "set.add(STACK[-i], item)" @@ -964,11 +975,11 @@ msgstr "" "item = STACK.pop()\n" "set.add(STACK[-i], item)" -#: ../../library/dis.rst:833 +#: ../../library/dis.rst:849 msgid "Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:840 +#: ../../library/dis.rst:856 msgid "" "item = STACK.pop()\n" "list.append(STACK[-i], item)" @@ -976,11 +987,11 @@ msgstr "" "item = STACK.pop()\n" "list.append(STACK[-i], item)" -#: ../../library/dis.rst:843 +#: ../../library/dis.rst:859 msgid "Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:850 +#: ../../library/dis.rst:866 msgid "" "value = STACK.pop()\n" "key = STACK.pop()\n" @@ -990,49 +1001,49 @@ msgstr "" "key = STACK.pop()\n" "dict.__setitem__(STACK[-i], key, value)" -#: ../../library/dis.rst:854 +#: ../../library/dis.rst:870 msgid "Used to implement dict comprehensions." msgstr "" -#: ../../library/dis.rst:857 +#: ../../library/dis.rst:873 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" -#: ../../library/dis.rst:861 +#: ../../library/dis.rst:877 msgid "" -"For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` " -"and :opcode:`MAP_ADD` instructions, while the added value or key/value pair " -"is popped off, the container object remains on the stack so that it is " -"available for further iterations of the loop." +"For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" +"`MAP_ADD` instructions, while the added value or key/value pair is popped " +"off, the container object remains on the stack so that it is available for " +"further iterations of the loop." msgstr "" -#: ../../library/dis.rst:869 +#: ../../library/dis.rst:885 msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:874 +#: ../../library/dis.rst:890 msgid "Yields ``STACK.pop()`` from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:876 +#: ../../library/dis.rst:892 msgid "oparg set to be the stack depth." msgstr "" -#: ../../library/dis.rst:879 +#: ../../library/dis.rst:895 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" -#: ../../library/dis.rst:882 +#: ../../library/dis.rst:898 msgid "" "oparg is ``1`` if this instruction is part of a yield-from or await, and " "``0`` otherwise." msgstr "" -#: ../../library/dis.rst:888 +#: ../../library/dis.rst:904 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -1040,39 +1051,39 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:898 +#: ../../library/dis.rst:914 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:905 +#: ../../library/dis.rst:921 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " -"pops an additional value from the stack which is used to " -"set :attr:`~frame.f_lasti` of the current frame." +"pops an additional value from the stack which is used to set :attr:`~frame." +"f_lasti` of the current frame." msgstr "" -#: ../../library/dis.rst:916 +#: ../../library/dis.rst:932 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: ../../library/dis.rst:924 +#: ../../library/dis.rst:940 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" -#: ../../library/dis.rst:932 +#: ../../library/dis.rst:948 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:935 +#: ../../library/dis.rst:951 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -1080,7 +1091,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:944 +#: ../../library/dis.rst:960 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -1088,32 +1099,32 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:951 +#: ../../library/dis.rst:967 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:958 +#: ../../library/dis.rst:974 msgid "" "Pushes a common constant onto the stack. The interpreter contains a " -"hardcoded list of constants supported by this instruction. Used by " -"the :keyword:`assert` statement to load :exc:`AssertionError`." +"hardcoded list of constants supported by this instruction. Used by the :" +"keyword:`assert` statement to load :exc:`AssertionError`." msgstr "" -#: ../../library/dis.rst:967 +#: ../../library/dis.rst:983 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:972 +#: ../../library/dis.rst:988 msgid "" "Perform ``STACK.append(len(STACK[-1]))``. Used in :keyword:`match` " "statements where comparison with structure of pattern is needed." msgstr "" -#: ../../library/dis.rst:980 +#: ../../library/dis.rst:996 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -1121,7 +1132,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:990 +#: ../../library/dis.rst:1006 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -1130,42 +1141,40 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:1000 +#: ../../library/dis.rst:1016 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " -"subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push " -"a :class:`tuple` containing the corresponding values. Otherwise, push " -"``None``." +"subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" +"class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1006 ../../library/dis.rst:1753 +#: ../../library/dis.rst:1022 ../../library/dis.rst:1764 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:1013 +#: ../../library/dis.rst:1029 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`~codeobject.co_names` of the :ref:`code object `. The compiler tries to use :opcode:`STORE_FAST` " -"or :opcode:`STORE_GLOBAL` if possible." +"objects>`. The compiler tries to use :opcode:`STORE_FAST` or :opcode:" +"`STORE_GLOBAL` if possible." msgstr "" -#: ../../library/dis.rst:1020 +#: ../../library/dis.rst:1036 msgid "" -"Implements ``del name``, where *namei* is the index " -"into :attr:`~codeobject.co_names` attribute of the :ref:`code object `." +"Implements ``del name``, where *namei* is the index into :attr:`~codeobject." +"co_names` attribute of the :ref:`code object `." msgstr "" -#: ../../library/dis.rst:1026 +#: ../../library/dis.rst:1042 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:1029 +#: ../../library/dis.rst:1045 msgid "" "assert(len(STACK[-1]) == count)\n" "STACK.extend(STACK.pop()[:-count-1:-1])" @@ -1173,7 +1182,7 @@ msgstr "" "assert(len(STACK[-1]) == count)\n" "STACK.extend(STACK.pop()[:-count-1:-1])" -#: ../../library/dis.rst:1035 +#: ../../library/dis.rst:1051 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -1181,11 +1190,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:1040 +#: ../../library/dis.rst:1056 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:1042 +#: ../../library/dis.rst:1058 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -1194,13 +1203,13 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:1048 +#: ../../library/dis.rst:1064 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:1056 +#: ../../library/dis.rst:1072 msgid "" "obj = STACK.pop()\n" "value = STACK.pop()\n" @@ -1210,13 +1219,13 @@ msgstr "" "value = STACK.pop()\n" "obj.name = value" -#: ../../library/dis.rst:1060 +#: ../../library/dis.rst:1076 msgid "" -"where *namei* is the index of name in :attr:`~codeobject.co_names` of " -"the :ref:`code object `." +"where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" +"ref:`code object `." msgstr "" -#: ../../library/dis.rst:1067 +#: ../../library/dis.rst:1083 msgid "" "obj = STACK.pop()\n" "del obj.name" @@ -1224,48 +1233,43 @@ msgstr "" "obj = STACK.pop()\n" "del obj.name" -#: ../../library/dis.rst:1070 +#: ../../library/dis.rst:1086 msgid "" -"where *namei* is the index of name into :attr:`~codeobject.co_names` of " -"the :ref:`code object `." +"where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" +"ref:`code object `." msgstr "" -#: ../../library/dis.rst:1076 +#: ../../library/dis.rst:1092 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:1081 +#: ../../library/dis.rst:1097 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:1086 +#: ../../library/dis.rst:1102 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1091 -msgid "" -"Works as :opcode:`LOAD_CONST`, but is more efficient for immortal objects." -msgstr "" - -#: ../../library/dis.rst:1096 +#: ../../library/dis.rst:1107 msgid "" "Pushes the integer ``i`` onto the stack. ``i`` must be in ``range(256)``" msgstr "" -#: ../../library/dis.rst:1104 +#: ../../library/dis.rst:1115 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:1110 +#: ../../library/dis.rst:1121 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`." +"prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" +"opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:1119 +#: ../../library/dis.rst:1130 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 " @@ -1274,14 +1278,14 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:1130 +#: ../../library/dis.rst:1141 msgid "" "Constructs a new :class:`~string.templatelib.Template` instance from a tuple " "of strings and a tuple of interpolations and pushes the resulting object " "onto the stack::" msgstr "" -#: ../../library/dis.rst:1134 +#: ../../library/dis.rst:1145 msgid "" "interpolations = STACK.pop()\n" "strings = STACK.pop()\n" @@ -1291,33 +1295,33 @@ msgstr "" "strings = STACK.pop()\n" "STACK.append(_build_template(strings, interpolations))" -#: ../../library/dis.rst:1143 +#: ../../library/dis.rst:1154 msgid "" "Constructs a new :class:`~string.templatelib.Interpolation` instance from a " "value and its source expression and pushes the resulting object onto the " "stack." msgstr "" -#: ../../library/dis.rst:1147 +#: ../../library/dis.rst:1158 msgid "" "If no conversion or format specification is present, ``format`` is set to " "``2``." msgstr "" -#: ../../library/dis.rst:1150 +#: ../../library/dis.rst:1161 msgid "" "If the low bit of ``format`` is set, it indicates that the interpolation " "contains a format specification." msgstr "" -#: ../../library/dis.rst:1153 +#: ../../library/dis.rst:1164 msgid "" "If ``format >> 2`` is non-zero, it indicates that the interpolation contains " "a conversion. The value of ``format >> 2`` is the conversion type (``0`` for " "no conversion, ``1`` for ``!s``, ``2`` for ``!r``, and ``3`` for ``!a``)::" msgstr "" -#: ../../library/dis.rst:1158 +#: ../../library/dis.rst:1169 msgid "" "conversion = format >> 2\n" "if format & 1:\n" @@ -1339,13 +1343,13 @@ msgstr "" "STACK.append(_build_interpolation(value, expression, conversion, " "format_spec))" -#: ../../library/dis.rst:1172 +#: ../../library/dis.rst:1183 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack::" msgstr "" -#: ../../library/dis.rst:1175 +#: ../../library/dis.rst:1186 msgid "" "if count == 0:\n" " value = ()\n" @@ -1363,34 +1367,34 @@ msgstr "" "\n" "STACK.append(value)" -#: ../../library/dis.rst:1186 +#: ../../library/dis.rst:1197 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:1191 +#: ../../library/dis.rst:1202 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:1196 +#: ../../library/dis.rst:1207 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:1200 +#: ../../library/dis.rst:1211 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:1207 +#: ../../library/dis.rst:1218 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1217 +#: ../../library/dis.rst:1228 msgid "" "seq = STACK.pop()\n" "list.extend(STACK[-i], seq)" @@ -1398,11 +1402,11 @@ msgstr "" "seq = STACK.pop()\n" "list.extend(STACK[-i], seq)" -#: ../../library/dis.rst:1220 +#: ../../library/dis.rst:1231 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1229 +#: ../../library/dis.rst:1240 msgid "" "seq = STACK.pop()\n" "set.update(STACK[-i], seq)" @@ -1410,11 +1414,11 @@ msgstr "" "seq = STACK.pop()\n" "set.update(STACK[-i], seq)" -#: ../../library/dis.rst:1232 +#: ../../library/dis.rst:1243 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1241 +#: ../../library/dis.rst:1252 msgid "" "map = STACK.pop()\n" "dict.update(STACK[-i], map)" @@ -1422,21 +1426,21 @@ msgstr "" "map = STACK.pop()\n" "dict.update(STACK[-i], map)" -#: ../../library/dis.rst:1244 +#: ../../library/dis.rst:1255 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1251 +#: ../../library/dis.rst:1262 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1258 +#: ../../library/dis.rst:1269 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:1261 +#: ../../library/dis.rst:1272 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 " @@ -1448,140 +1452,140 @@ msgid "" "pushed." msgstr "" -#: ../../library/dis.rst:1270 +#: ../../library/dis.rst:1281 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:1277 +#: ../../library/dis.rst:1288 msgid "" "This opcode implements :func:`super`, both in its zero-argument and two-" "argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " "self).method()``, ``super(cls, self).attr``)." msgstr "" -#: ../../library/dis.rst:1281 +#: ../../library/dis.rst:1292 msgid "It pops three values from the stack (from top of stack down):" msgstr "" -#: ../../library/dis.rst:1283 +#: ../../library/dis.rst:1294 msgid "``self``: the first argument to the current method" msgstr "" -#: ../../library/dis.rst:1284 +#: ../../library/dis.rst:1295 msgid "``cls``: the class within which the current method was defined" msgstr "" -#: ../../library/dis.rst:1285 +#: ../../library/dis.rst:1296 msgid "the global ``super``" msgstr "" -#: ../../library/dis.rst:1287 +#: ../../library/dis.rst:1298 msgid "" "With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " "except that ``namei`` is shifted left by 2 bits instead of 1." msgstr "" -#: ../../library/dis.rst:1290 +#: ../../library/dis.rst:1301 msgid "" -"The low bit of ``namei`` signals to attempt a method load, as " -"with :opcode:`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded " -"method. When it is unset a single value is pushed to the stack." +"The low bit of ``namei`` signals to attempt a method load, as with :opcode:" +"`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded method. When " +"it is unset a single value is pushed to the stack." msgstr "" -#: ../../library/dis.rst:1294 +#: ../../library/dis.rst:1305 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:1302 +#: ../../library/dis.rst:1313 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname >> 5]``. If the fifth-lowest bit of ``opname`` is set " "(``opname & 16``), the result should be coerced to ``bool``." msgstr "" -#: ../../library/dis.rst:1306 +#: ../../library/dis.rst:1317 msgid "" -"The fifth-lowest bit of the oparg now indicates a forced conversion " -"to :class:`bool`." +"The fifth-lowest bit of the oparg now indicates a forced conversion to :" +"class:`bool`." msgstr "" -#: ../../library/dis.rst:1313 +#: ../../library/dis.rst:1324 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1320 +#: ../../library/dis.rst:1331 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1327 +#: ../../library/dis.rst:1338 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " -"popped and provide the *fromlist* and *level* arguments " -"of :func:`__import__`. The module object is pushed onto the stack. The " -"current namespace is not affected: for a proper import statement, a " -"subsequent :opcode:`STORE_FAST` instruction modifies the namespace." +"popped and provide the *fromlist* and *level* arguments of :func:" +"`__import__`. The module object is pushed onto the stack. The current " +"namespace is not affected: for a proper import statement, a subsequent :" +"opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1335 +#: ../../library/dis.rst:1346 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:1342 +#: ../../library/dis.rst:1353 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1347 +#: ../../library/dis.rst:1358 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1354 +#: ../../library/dis.rst:1365 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1361 +#: ../../library/dis.rst:1372 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1364 ../../library/dis.rst:1380 +#: ../../library/dis.rst:1375 ../../library/dis.rst:1391 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:1369 ../../library/dis.rst:1385 -#: ../../library/dis.rst:1398 ../../library/dis.rst:1409 +#: ../../library/dis.rst:1380 ../../library/dis.rst:1396 +#: ../../library/dis.rst:1409 ../../library/dis.rst:1420 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1377 +#: ../../library/dis.rst:1388 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1393 +#: ../../library/dis.rst:1404 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1404 +#: ../../library/dis.rst:1415 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1414 +#: ../../library/dis.rst:1425 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 " @@ -1589,219 +1593,219 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1419 +#: ../../library/dis.rst:1430 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1424 +#: ../../library/dis.rst:1435 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1426 +#: ../../library/dis.rst:1437 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:1432 +#: ../../library/dis.rst:1443 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1434 +#: ../../library/dis.rst:1445 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:1440 +#: ../../library/dis.rst:1451 msgid "" "Pushes a borrowed reference to the local ``co_varnames[var_num]`` onto the " "stack." msgstr "" -#: ../../library/dis.rst:1447 +#: ../../library/dis.rst:1458 msgid "" "Pushes references to ``co_varnames[var_nums >> 4]`` and " "``co_varnames[var_nums & 15]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1455 +#: ../../library/dis.rst:1466 msgid "" "Pushes borrowed references to ``co_varnames[var_nums >> 4]`` and " "``co_varnames[var_nums & 15]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1462 +#: ../../library/dis.rst:1473 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:1470 +#: ../../library/dis.rst:1481 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:1478 +#: ../../library/dis.rst:1489 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1482 +#: ../../library/dis.rst:1493 msgid "" "Stores ``STACK[-1]`` into ``co_varnames[var_nums >> 4]`` and ``STACK[-2]`` " "into ``co_varnames[var_nums & 15]``." msgstr "" -#: ../../library/dis.rst:1489 +#: ../../library/dis.rst:1500 msgid "" "Stores ``STACK.pop()`` into the local ``co_varnames[var_nums >> 4]`` and " "pushes a reference to the local ``co_varnames[var_nums & 15]`` onto the " "stack." msgstr "" -#: ../../library/dis.rst:1497 +#: ../../library/dis.rst:1508 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1502 +#: ../../library/dis.rst:1513 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:1510 +#: ../../library/dis.rst:1521 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:1513 ../../library/dis.rst:1535 -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1524 ../../library/dis.rst:1546 +#: ../../library/dis.rst:1557 msgid "" "``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." msgstr "" -#: ../../library/dis.rst:1519 +#: ../../library/dis.rst:1530 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 " -"found there, loads it from the cell contained in slot ``i``, similar " -"to :opcode:`LOAD_DEREF`. This is used for loading :term:`closure variables " +"found there, loads it from the cell contained in slot ``i``, similar to :" +"opcode:`LOAD_DEREF`. This is used for loading :term:`closure variables " "` in class bodies (which previously used :opcode:`!" "LOAD_CLASSDEREF`) and in :ref:`annotation scopes ` within " "class bodies." msgstr "" -#: ../../library/dis.rst:1532 +#: ../../library/dis.rst:1543 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1541 +#: ../../library/dis.rst:1552 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1552 +#: ../../library/dis.rst:1563 msgid "" "Copies the ``n`` :term:`free (closure) 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:1561 +#: ../../library/dis.rst:1572 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1564 +#: ../../library/dis.rst:1575 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1576 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1566 +#: ../../library/dis.rst:1577 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:1572 +#: ../../library/dis.rst:1583 msgid "" "Calls a callable object with the number of arguments specified by ``argc``. " "On the stack are (in ascending order):" msgstr "" -#: ../../library/dis.rst:1575 ../../library/dis.rst:1599 +#: ../../library/dis.rst:1586 ../../library/dis.rst:1610 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1576 ../../library/dis.rst:1600 +#: ../../library/dis.rst:1587 ../../library/dis.rst:1611 msgid "``self`` or ``NULL``" msgstr "``self`` 或 ``NULL``" -#: ../../library/dis.rst:1577 ../../library/dis.rst:1601 +#: ../../library/dis.rst:1588 ../../library/dis.rst:1612 msgid "The remaining positional arguments" msgstr "剩餘的位置引數" -#: ../../library/dis.rst:1579 +#: ../../library/dis.rst:1590 msgid "``argc`` is the total of the positional arguments, excluding ``self``." msgstr "" -#: ../../library/dis.rst:1581 +#: ../../library/dis.rst:1592 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:1587 +#: ../../library/dis.rst:1598 msgid "The callable now always appears at the same position on the stack." msgstr "" -#: ../../library/dis.rst:1590 +#: ../../library/dis.rst:1601 msgid "Calls with keyword arguments are now handled by :opcode:`CALL_KW`." msgstr "" -#: ../../library/dis.rst:1596 +#: ../../library/dis.rst:1607 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including one or more named arguments. On the stack are (in ascending order):" msgstr "" -#: ../../library/dis.rst:1602 +#: ../../library/dis.rst:1613 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1603 +#: ../../library/dis.rst:1614 msgid "A :class:`tuple` of keyword argument names" msgstr "" -#: ../../library/dis.rst:1605 +#: ../../library/dis.rst:1616 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self``. The length of the tuple of keyword argument names is the number of " "named arguments." msgstr "" -#: ../../library/dis.rst:1608 +#: ../../library/dis.rst:1619 msgid "" "``CALL_KW`` pops all arguments, the keyword names, 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:1617 +#: ../../library/dis.rst:1628 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 " @@ -1813,33 +1817,33 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1632 +#: ../../library/dis.rst:1643 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." +"``NULL`` pushed by :opcode:`!LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1641 +#: ../../library/dis.rst:1652 msgid "" "Pushes a new function object on the stack built from the code object at " "``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:1643 +#: ../../library/dis.rst:1654 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1646 +#: ../../library/dis.rst:1657 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1649 +#: ../../library/dis.rst:1660 msgid "" "Extra function attributes on the stack, signaled by oparg flags, were " "removed. They now use :opcode:`SET_FUNCTION_ATTRIBUTE`." msgstr "" -#: ../../library/dis.rst:1656 +#: ../../library/dis.rst:1667 msgid "" "Sets an attribute on a function object. Expects the function at " "``STACK[-1]`` and the attribute value to set at ``STACK[-2]``; consumes both " @@ -1847,42 +1851,42 @@ msgid "" "attribute to set:" msgstr "" -#: ../../library/dis.rst:1660 +#: ../../library/dis.rst:1671 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1662 +#: ../../library/dis.rst:1673 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1663 +#: ../../library/dis.rst:1674 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1664 +#: ../../library/dis.rst:1675 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1673 +#: ../../library/dis.rst:1684 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1675 +#: ../../library/dis.rst:1686 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" "STACK.append(slice(start, end))" msgstr "" -#: ../../library/dis.rst:1679 +#: ../../library/dis.rst:1690 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1681 +#: ../../library/dis.rst:1692 msgid "" "step = STACK.pop()\n" "end = STACK.pop()\n" @@ -1894,11 +1898,11 @@ msgstr "" "start = STACK.pop()\n" "STACK.append(slice(start, end, step))" -#: ../../library/dis.rst:1686 +#: ../../library/dis.rst:1697 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1691 +#: ../../library/dis.rst:1702 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 " @@ -1906,11 +1910,11 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1699 +#: ../../library/dis.rst:1710 msgid "Convert value to a string, depending on ``oparg``::" msgstr "" -#: ../../library/dis.rst:1701 +#: ../../library/dis.rst:1712 msgid "" "value = STACK.pop()\n" "result = func(value)\n" @@ -1920,28 +1924,28 @@ msgstr "" "result = func(value)\n" "STACK.append(result)" -#: ../../library/dis.rst:1705 +#: ../../library/dis.rst:1716 msgid "``oparg == 1``: call :func:`str` on *value*" msgstr "" -#: ../../library/dis.rst:1706 +#: ../../library/dis.rst:1717 msgid "``oparg == 2``: call :func:`repr` on *value*" msgstr "" -#: ../../library/dis.rst:1707 +#: ../../library/dis.rst:1718 msgid "``oparg == 3``: call :func:`ascii` on *value*" msgstr "" -#: ../../library/dis.rst:1709 ../../library/dis.rst:1722 -#: ../../library/dis.rst:1735 +#: ../../library/dis.rst:1720 ../../library/dis.rst:1733 +#: ../../library/dis.rst:1746 msgid "Used for implementing formatted string literals (f-strings)." msgstr "" -#: ../../library/dis.rst:1716 +#: ../../library/dis.rst:1727 msgid "Formats the value on top of stack::" msgstr "" -#: ../../library/dis.rst:1718 +#: ../../library/dis.rst:1729 msgid "" "value = STACK.pop()\n" "result = value.__format__(\"\")\n" @@ -1951,11 +1955,11 @@ msgstr "" "result = value.__format__(\"\")\n" "STACK.append(result)" -#: ../../library/dis.rst:1728 +#: ../../library/dis.rst:1739 msgid "Formats the given value with the given format spec::" msgstr "" -#: ../../library/dis.rst:1730 +#: ../../library/dis.rst:1741 msgid "" "spec = STACK.pop()\n" "value = STACK.pop()\n" @@ -1967,14 +1971,14 @@ msgstr "" "result = value.__format__(spec)\n" "STACK.append(result)" -#: ../../library/dis.rst:1742 +#: ../../library/dis.rst:1753 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:1746 +#: ../../library/dis.rst:1757 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 " @@ -1982,219 +1986,219 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1760 +#: ../../library/dis.rst:1771 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1762 +#: ../../library/dis.rst:1773 msgid "" "The ``context`` operand consists of two parts. The lowest two bits indicate " "where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1765 +#: ../../library/dis.rst:1776 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1767 +#: ../../library/dis.rst:1778 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1768 +#: ../../library/dis.rst:1779 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1769 +#: ../../library/dis.rst:1780 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1771 +#: ../../library/dis.rst:1782 msgid "" "The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` " "otherwise." msgstr "" -#: ../../library/dis.rst:1776 +#: ../../library/dis.rst:1787 msgid "The oparg value changed to include information about except-depth" msgstr "" -#: ../../library/dis.rst:1782 +#: ../../library/dis.rst:1793 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:1791 +#: ../../library/dis.rst:1802 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1794 +#: ../../library/dis.rst:1805 msgid "" "If the call raises :exc:`StopIteration`, pop the top value from the stack, " "push the exception's ``value`` attribute, and increment the bytecode counter " "by *delta*." msgstr "" -#: ../../library/dis.rst:1803 +#: ../../library/dis.rst:1814 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:1807 +#: ../../library/dis.rst:1818 msgid "" "If your application uses pseudo instructions or specialized instructions, " "use the :data:`hasarg` collection instead." msgstr "" -#: ../../library/dis.rst:1810 +#: ../../library/dis.rst:1821 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:1814 +#: ../../library/dis.rst:1825 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:1819 +#: ../../library/dis.rst:1830 msgid "Use :data:`hasarg` instead." msgstr "" -#: ../../library/dis.rst:1824 +#: ../../library/dis.rst:1835 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 not performance critical." msgstr "" -#: ../../library/dis.rst:1828 ../../library/dis.rst:1882 +#: ../../library/dis.rst:1839 ../../library/dis.rst:1893 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1831 ../../library/dis.rst:1885 +#: ../../library/dis.rst:1842 ../../library/dis.rst:1896 msgid "Operand" msgstr "運算元" -#: ../../library/dis.rst:1831 ../../library/dis.rst:1885 +#: ../../library/dis.rst:1842 ../../library/dis.rst:1896 msgid "Description" msgstr "描述" -#: ../../library/dis.rst:1833 +#: ../../library/dis.rst:1844 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1833 ../../library/dis.rst:1887 +#: ../../library/dis.rst:1844 ../../library/dis.rst:1898 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1835 +#: ../../library/dis.rst:1846 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1835 +#: ../../library/dis.rst:1846 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1838 +#: ../../library/dis.rst:1849 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1838 +#: ../../library/dis.rst:1849 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1841 +#: ../../library/dis.rst:1852 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1841 +#: ../../library/dis.rst:1852 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1844 +#: ../../library/dis.rst:1855 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1844 +#: ../../library/dis.rst:1855 msgid "Wraps an async generator value" msgstr "" -#: ../../library/dis.rst:1846 +#: ../../library/dis.rst:1857 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1846 +#: ../../library/dis.rst:1857 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1849 +#: ../../library/dis.rst:1860 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1849 +#: ../../library/dis.rst:1860 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1851 +#: ../../library/dis.rst:1862 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1851 +#: ../../library/dis.rst:1862 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1853 +#: ../../library/dis.rst:1864 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1853 +#: ../../library/dis.rst:1864 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1856 +#: ../../library/dis.rst:1867 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1856 +#: ../../library/dis.rst:1867 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1859 +#: ../../library/dis.rst:1870 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1859 +#: ../../library/dis.rst:1870 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1862 +#: ../../library/dis.rst:1873 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1862 +#: ../../library/dis.rst:1873 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:1874 +#: ../../library/dis.rst:1885 msgid "" "Calls an intrinsic function with two arguments. Used to implement " "functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1877 +#: ../../library/dis.rst:1888 msgid "" "arg2 = STACK.pop()\n" "arg1 = STACK.pop()\n" @@ -2206,69 +2210,69 @@ msgstr "" "result = intrinsic2(arg1, arg2)\n" "STACK.append(result)" -#: ../../library/dis.rst:1887 +#: ../../library/dis.rst:1898 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1889 +#: ../../library/dis.rst:1900 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1889 +#: ../../library/dis.rst:1900 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1893 +#: ../../library/dis.rst:1904 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1893 +#: ../../library/dis.rst:1904 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1896 +#: ../../library/dis.rst:1907 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1896 +#: ../../library/dis.rst:1907 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1900 +#: ../../library/dis.rst:1911 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1900 +#: ../../library/dis.rst:1911 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1909 +#: ../../library/dis.rst:1920 msgid "" -"Performs special method lookup on ``STACK[-1]``. If " -"``type(STACK[-1]).__xxx__`` is a method, leave ``type(STACK[-1]).__xxx__; " -"STACK[-1]`` on the stack. If ``type(STACK[-1]).__xxx__`` is not a method, " -"leave ``STACK[-1].__xxx__; NULL`` on the stack." +"Performs special method lookup on ``STACK[-1]``. If ``type(STACK[-1])." +"__xxx__`` is a method, leave ``type(STACK[-1]).__xxx__; STACK[-1]`` on the " +"stack. If ``type(STACK[-1]).__xxx__`` is not a method, leave ``STACK[-1]." +"__xxx__; NULL`` on the stack." msgstr "" -#: ../../library/dis.rst:1918 +#: ../../library/dis.rst:1929 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1920 +#: ../../library/dis.rst:1931 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:1925 +#: ../../library/dis.rst:1936 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:1932 +#: ../../library/dis.rst:1943 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 " @@ -2277,98 +2281,96 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1941 +#: ../../library/dis.rst:1952 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:1945 +#: ../../library/dis.rst:1956 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." +"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:1952 +#: ../../library/dis.rst:1963 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1958 +#: ../../library/dis.rst:1969 +msgid "" +"Works as :opcode:`LOAD_CONST`, but is more efficient for immortal objects." +msgstr "" + +#: ../../library/dis.rst:1975 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1964 +#: ../../library/dis.rst:1981 msgid "" "Conditional jumps which do not impact the stack. Replaced by the sequence " "``COPY 1``, ``TO_BOOL``, ``POP_JUMP_IF_TRUE/FALSE``." msgstr "" -#: ../../library/dis.rst:1969 +#: ../../library/dis.rst:1986 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1972 +#: ../../library/dis.rst:1989 msgid "" "Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." msgstr "" -#: ../../library/dis.rst:1974 +#: ../../library/dis.rst:1991 msgid "This opcode is now a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1980 -msgid "" -"Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " -"flag set in the arg." -msgstr "" - -#: ../../library/dis.rst:1987 +#: ../../library/dis.rst:1998 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1989 +#: ../../library/dis.rst:2000 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1992 +#: ../../library/dis.rst:2003 msgid "" "The collections now contain pseudo instructions and instrumented " "instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " "and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: ../../library/dis.rst:1999 +#: ../../library/dis.rst:2010 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:2004 +#: ../../library/dis.rst:2015 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:2009 +#: ../../library/dis.rst:2020 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:2014 +#: ../../library/dis.rst:2025 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:2021 +#: ../../library/dis.rst:2032 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:2026 +#: ../../library/dis.rst:2037 msgid "" "Sequence of bytecodes that access a :term:`free (closure) variable `. 'free' in this context refers to names in the current scope that " @@ -2377,47 +2379,47 @@ msgid "" "scopes." msgstr "" -#: ../../library/dis.rst:2034 +#: ../../library/dis.rst:2045 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:2039 +#: ../../library/dis.rst:2050 msgid "Sequence of bytecodes that have a jump target. All jumps are relative." msgstr "" -#: ../../library/dis.rst:2046 +#: ../../library/dis.rst:2057 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:2051 +#: ../../library/dis.rst:2062 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:2055 +#: ../../library/dis.rst:2066 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:2062 +#: ../../library/dis.rst:2073 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:2064 +#: ../../library/dis.rst:2075 msgid "All jumps are now relative. Use :data:`hasjump`." msgstr "" -#: ../../library/dis.rst:2070 +#: ../../library/dis.rst:2081 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:2072 +#: ../../library/dis.rst:2083 msgid "All jumps are now relative. This list is empty." msgstr "" -#: ../../library/dis.rst:1671 +#: ../../library/dis.rst:1682 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1671 +#: ../../library/dis.rst:1682 msgid "slice" msgstr "slice(切片)" diff --git a/library/enum.po b/library/enum.po index 23d76be011..b4d1f3a876 100644 --- a/library/enum.po +++ b/library/enum.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-10-03 00:13+0000\n" "PO-Revision-Date: 2024-12-21 13:50+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -646,7 +646,9 @@ msgstr "" "*self.__class__* 上定義的公開方法: ::" #: ../../library/enum.rst:318 +#, fuzzy msgid "" +">>> from enum import Enum\n" ">>> from datetime import date\n" ">>> class Weekday(Enum):\n" "... MONDAY = 1\n" @@ -685,11 +687,11 @@ msgstr "" msgid "name" msgstr "name" -#: ../../library/enum.rst:336 +#: ../../library/enum.rst:337 msgid "The name of the member being defined (e.g. 'RED')." msgstr "定義的成員名稱(例如 'RED')。" -#: ../../library/enum.rst:337 +#: ../../library/enum.rst:338 msgid "The start value for the Enum; the default is 1." msgstr "列舉的開始值,預設為 1。" @@ -697,7 +699,7 @@ msgstr "列舉的開始值,預設為 1。" msgid "count" msgstr "count" -#: ../../library/enum.rst:338 +#: ../../library/enum.rst:339 msgid "The number of members currently defined, not including this one." msgstr "已定義的成員數量,不包含目前這一個。" @@ -705,19 +707,20 @@ msgstr "已定義的成員數量,不包含目前這一個。" msgid "last_values" msgstr "last_values" -#: ../../library/enum.rst:339 +#: ../../library/enum.rst:340 msgid "A list of the previous values." msgstr "一個之前值的串列。" -#: ../../library/enum.rst:341 +#: ../../library/enum.rst:342 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "一個 *staticmethod*,用來決定 :class:`auto` 下一個要回傳的值的: ::" -#: ../../library/enum.rst:344 +#: ../../library/enum.rst:345 +#, fuzzy msgid "" -">>> from enum import auto\n" +">>> from enum import auto, Enum\n" ">>> class PowersOfThree(Enum):\n" "... @staticmethod\n" "... def _generate_next_value_(name, start, count, last_values):\n" @@ -739,7 +742,7 @@ msgstr "" ">>> PowersOfThree.SECOND.value\n" "9" -#: ../../library/enum.rst:357 +#: ../../library/enum.rst:358 msgid "" "By default, does nothing. If multiple values are given in the member " "assignment, those values become separate arguments to ``__init__``; e.g." @@ -747,19 +750,19 @@ msgstr "" "預設情況下,不執行任何操作。如果在成員賦值中給出多個值,這些值將成為與 " "``__init__`` 分別的引數;例如" -#: ../../library/enum.rst:364 +#: ../../library/enum.rst:365 msgid "" "``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, " "'Mon')``" msgstr "``Weekday.__init__()`` 將被稱為 ``Weekday.__init__(self, 1, 'Mon')``" -#: ../../library/enum.rst:368 +#: ../../library/enum.rst:369 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "一個 *classmethod*,用來進一步設定後續的子類別,預設不做任何事。" -#: ../../library/enum.rst:373 +#: ../../library/enum.rst:374 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" @@ -767,9 +770,10 @@ msgstr "" "一個 *classmethod*,用來查詢在 *cls* 裡找不到的值。預設不做任何事,但可以被覆" "寫以實作客製化的搜尋行為: ::" -#: ../../library/enum.rst:376 +#: ../../library/enum.rst:377 +#, fuzzy msgid "" -">>> from enum import StrEnum\n" +">>> from enum import auto, StrEnum\n" ">>> class Build(StrEnum):\n" "... DEBUG = auto()\n" "... OPTIMIZED = auto()\n" @@ -803,7 +807,7 @@ msgstr "" ">>> Build('deBUG')\n" "" -#: ../../library/enum.rst:395 +#: ../../library/enum.rst:396 msgid "" "By default, doesn't exist. If specified, either in the enum class " "definition or in a mixin class (such as ``int``), all values given in the " @@ -812,12 +816,12 @@ msgstr "" "預設情況下不存在。如果有指定,無論是在列舉類別定義中還是在 mixin 類別中(例" "如 ``int``\\ ),都將傳遞成員賦值中給出的所有值;例如" -#: ../../library/enum.rst:403 +#: ../../library/enum.rst:404 msgid "" "results in the call ``int('1a', 16)`` and a value of ``26`` for the member." msgstr "會產生呼叫 ``int('1a', 16)`` 而該成員的值為 ``26``。" -#: ../../library/enum.rst:407 +#: ../../library/enum.rst:408 msgid "" "When writing a custom ``__new__``, do not use ``super().__new__`` -- call " "the appropriate ``__new__`` instead." @@ -825,7 +829,7 @@ msgstr "" "當寫自訂的 ``__new__`` 時,不要使用 ``super().__new__``,而是要呼叫適當的 " "``__new__``。" -#: ../../library/enum.rst:412 +#: ../../library/enum.rst:413 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" @@ -833,8 +837,10 @@ msgstr "" "回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" "覆寫: ::" -#: ../../library/enum.rst:415 +#: ../../library/enum.rst:416 +#, fuzzy msgid "" +">>> from enum import auto, Enum\n" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" "... OTHER = auto()\n" @@ -859,7 +865,7 @@ msgstr "" "ALTERNATE}\"\n" "(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" -#: ../../library/enum.rst:428 +#: ../../library/enum.rst:430 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" @@ -867,8 +873,10 @@ msgstr "" "回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" "寫: ::" -#: ../../library/enum.rst:431 +#: ../../library/enum.rst:433 +#, fuzzy msgid "" +">>> from enum import auto, Enum\n" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" "... OTHER = auto()\n" @@ -891,7 +899,7 @@ msgstr "" "ALTERNATE}\"\n" "(, 'ALTERNATE', 'ALTERNATE')" -#: ../../library/enum.rst:443 +#: ../../library/enum.rst:446 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" @@ -899,8 +907,10 @@ msgstr "" "回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" "傳值,但可以被覆寫: ::" -#: ../../library/enum.rst:446 +#: ../../library/enum.rst:449 +#, fuzzy msgid "" +">>> from enum import auto, Enum\n" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" "... OTHER = auto()\n" @@ -923,21 +933,21 @@ msgstr "" "ALTERNATE}\"\n" "(, 'OtherStyle.ALTERNATE', 'ALTERNATE')" -#: ../../library/enum.rst:458 +#: ../../library/enum.rst:462 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:461 +#: ../../library/enum.rst:465 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:465 +#: ../../library/enum.rst:469 msgid "Adds a new name as an alias to an existing member::" msgstr "新增一個名稱作為現有成員的別名: ::" -#: ../../library/enum.rst:467 +#: ../../library/enum.rst:471 msgid "" ">>> Color.RED._add_alias_(\"ERROR\")\n" ">>> Color.ERROR\n" @@ -947,17 +957,17 @@ msgstr "" ">>> Color.ERROR\n" "" -#: ../../library/enum.rst:471 +#: ../../library/enum.rst:475 msgid "" "Raises a :exc:`NameError` if the name is already assigned to a different " "member." msgstr "如果該名稱已經被指派給不同的成員,則會引發 :exc:`NameError`。" -#: ../../library/enum.rst:477 +#: ../../library/enum.rst:481 msgid "Adds a new value as an alias to an existing member::" msgstr "新增一個值作為現有成員的別名: ::" -#: ../../library/enum.rst:479 +#: ../../library/enum.rst:483 msgid "" ">>> Color.RED._add_value_alias_(42)\n" ">>> Color(42)\n" @@ -967,13 +977,13 @@ msgstr "" ">>> Color(42)\n" "" -#: ../../library/enum.rst:483 +#: ../../library/enum.rst:487 msgid "" "Raises a :exc:`ValueError` if the value is already linked with a different " "member." msgstr "如果該值已經被連結到不同的成員,則會引發 :exc:`ValueError`。" -#: ../../library/enum.rst:490 +#: ../../library/enum.rst:494 msgid "" "*IntEnum* is the same as :class:`Enum`, but its members are also integers " "and can be used anywhere that an integer can be used. If any integer " @@ -983,13 +993,13 @@ msgstr "" "*IntEnum* 和 :class:`Enum` 一樣,但其成員同時也是整數而可以被用在任何使用整數" "的地方。如果 *IntEnum* 成員經過任何整數運算,結果值會失去其列舉狀態。" -#: ../../library/enum.rst:511 +#: ../../library/enum.rst:515 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:514 +#: ../../library/enum.rst:518 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " @@ -999,7 +1009,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:521 +#: ../../library/enum.rst:525 msgid "" "*StrEnum* is the same as :class:`Enum`, but its members are also strings and " "can be used in most of the same places that a string can be used. The result " @@ -1009,7 +1019,7 @@ msgstr "" "*StrEnum* 和 :class:`Enum` 一樣,但其成員同時也是字串而可以被用在幾乎所有使用" "字串的地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" -#: ../../library/enum.rst:542 +#: ../../library/enum.rst:546 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -1020,13 +1030,13 @@ msgstr "" "是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" "你需要使用 ``str(MyStrEnum.MY_MEMBER)``。" -#: ../../library/enum.rst:549 +#: ../../library/enum.rst:553 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" -#: ../../library/enum.rst:554 +#: ../../library/enum.rst:558 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " @@ -1036,7 +1046,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" -#: ../../library/enum.rst:562 +#: ../../library/enum.rst:566 msgid "" "``Flag`` is the same as :class:`Enum`, but its members support the bitwise " "operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); " @@ -1046,11 +1056,11 @@ msgstr "" "(*OR*)、``^`` (*XOR*) 和 ``~`` (*INVERT*);這些操作的結果是列舉的成員(的別" "名)。" -#: ../../library/enum.rst:568 +#: ../../library/enum.rst:572 msgid "Returns *True* if value is in self::" msgstr "如果 value 在 self 裡則回傳 *True*: ::" -#: ../../library/enum.rst:570 +#: ../../library/enum.rst:574 msgid "" ">>> from enum import Flag, auto\n" ">>> class Color(Flag):\n" @@ -1086,11 +1096,11 @@ msgstr "" ">>> white in purple\n" "False" -#: ../../library/enum.rst:589 +#: ../../library/enum.rst:593 msgid "Returns all contained non-alias members::" msgstr "回傳所有包含的非別名成員: ::" -#: ../../library/enum.rst:591 +#: ../../library/enum.rst:595 msgid "" ">>> list(Color.RED)\n" "[]\n" @@ -1102,11 +1112,11 @@ msgstr "" ">>> list(purple)\n" "[, ]" -#: ../../library/enum.rst:600 +#: ../../library/enum.rst:604 msgid "Returns number of members in flag::" msgstr "回傳旗標裡的成員數量: ::" -#: ../../library/enum.rst:602 +#: ../../library/enum.rst:606 msgid "" ">>> len(Color.GREEN)\n" "1\n" @@ -1118,11 +1128,11 @@ msgstr "" ">>> len(white)\n" "3" -#: ../../library/enum.rst:611 +#: ../../library/enum.rst:615 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" -#: ../../library/enum.rst:613 +#: ../../library/enum.rst:617 msgid "" ">>> bool(Color.GREEN)\n" "True\n" @@ -1140,11 +1150,11 @@ msgstr "" ">>> bool(black)\n" "False" -#: ../../library/enum.rst:623 +#: ../../library/enum.rst:627 msgid "Returns current flag binary or'ed with other::" msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" -#: ../../library/enum.rst:625 +#: ../../library/enum.rst:629 msgid "" ">>> Color.RED | Color.GREEN\n" "" @@ -1152,11 +1162,11 @@ msgstr "" ">>> Color.RED | Color.GREEN\n" "" -#: ../../library/enum.rst:630 +#: ../../library/enum.rst:634 msgid "Returns current flag binary and'ed with other::" msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" -#: ../../library/enum.rst:632 +#: ../../library/enum.rst:636 msgid "" ">>> purple & white\n" "\n" @@ -1168,11 +1178,11 @@ msgstr "" ">>> purple & Color.GREEN\n" "" -#: ../../library/enum.rst:639 +#: ../../library/enum.rst:643 msgid "Returns current flag binary xor'ed with other::" msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" -#: ../../library/enum.rst:641 +#: ../../library/enum.rst:645 msgid "" ">>> purple ^ white\n" "\n" @@ -1184,11 +1194,11 @@ msgstr "" ">>> purple ^ Color.GREEN\n" "" -#: ../../library/enum.rst:648 +#: ../../library/enum.rst:652 msgid "Returns all the flags in *type(self)* that are not in *self*::" msgstr "回傳所有在 *type(self)* 但不在 *self* 裡的旗標: ::" -#: ../../library/enum.rst:650 +#: ../../library/enum.rst:654 msgid "" ">>> ~white\n" "\n" @@ -1204,7 +1214,7 @@ msgstr "" ">>> ~Color.RED\n" "" -#: ../../library/enum.rst:659 +#: ../../library/enum.rst:663 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." @@ -1212,17 +1222,17 @@ msgstr "" "用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " "和 :func:`oct`。" -#: ../../library/enum.rst:664 +#: ../../library/enum.rst:668 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:667 +#: ../../library/enum.rst:671 msgid "The *repr()* of zero-valued flags has changed. It is now:" msgstr "值為 0 的旗標的 *repr()* 已改變。現在是:" -#: ../../library/enum.rst:675 +#: ../../library/enum.rst:679 msgid "" "``IntFlag`` is the same as :class:`Flag`, but its members are also integers " "and can be used anywhere that an integer can be used." @@ -1230,13 +1240,13 @@ msgstr "" "``IntFlag`` 和 :class:`Flag` 一樣,但其成員同時也是整數而可以被用在任何使用整" "數的地方。" -#: ../../library/enum.rst:689 +#: ../../library/enum.rst:693 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" -#: ../../library/enum.rst:692 +#: ../../library/enum.rst:696 msgid "" ">>> Color.RED + 2\n" "3" @@ -1244,25 +1254,25 @@ msgstr "" ">>> Color.RED + 2\n" "3" -#: ../../library/enum.rst:695 +#: ../../library/enum.rst:699 msgid "If a :class:`Flag` operation is performed with an *IntFlag* member and:" msgstr "如果 *IntFlag* 成員經過 :class:`Flag` 操作且:" -#: ../../library/enum.rst:697 +#: ../../library/enum.rst:701 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" -#: ../../library/enum.rst:698 +#: ../../library/enum.rst:702 msgid "" "the result is not a valid *IntFlag*: the result depends on the :class:" "`FlagBoundary` setting" msgstr "結果不是合法的 *IntFlag*:結果會根據 :class:`FlagBoundary` 的設定" -#: ../../library/enum.rst:700 +#: ../../library/enum.rst:704 msgid "The :func:`repr` of unnamed zero-valued flags has changed. It is now::" msgstr "未命名且值為 0 的旗標的 :func:`repr` 已改變。現在是: ::" -#: ../../library/enum.rst:702 +#: ../../library/enum.rst:706 msgid "" ">>> Color(0)\n" "" @@ -1270,14 +1280,14 @@ msgstr "" ">>> Color(0)\n" "" -#: ../../library/enum.rst:707 +#: ../../library/enum.rst:711 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" ":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:712 +#: ../../library/enum.rst:716 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " @@ -1287,7 +1297,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:716 +#: ../../library/enum.rst:720 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " @@ -1296,7 +1306,7 @@ msgstr "" ":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" "旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" -#: ../../library/enum.rst:722 +#: ../../library/enum.rst:726 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" @@ -1304,15 +1314,15 @@ msgstr "" ":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() `,但使" "用混合資料型別的 :class:`str() `:" -#: ../../library/enum.rst:725 +#: ../../library/enum.rst:729 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" -#: ../../library/enum.rst:726 +#: ../../library/enum.rst:730 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" -#: ../../library/enum.rst:728 +#: ../../library/enum.rst:732 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" @@ -1321,7 +1331,7 @@ msgstr "" "繼承 :class:`!ReprEnum` 來保留混合資料型別的 :class:`str() ` / :func:" "`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() `。" -#: ../../library/enum.rst:737 +#: ../../library/enum.rst:741 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." @@ -1329,11 +1339,11 @@ msgstr "" "*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" "制會產生 :exc:`ValueError`。" -#: ../../library/enum.rst:742 +#: ../../library/enum.rst:746 msgid "Ensure that each value has only one name::" msgstr "確保每個值只有一個名稱: ::" -#: ../../library/enum.rst:744 +#: ../../library/enum.rst:748 msgid "" ">>> from enum import Enum, verify, UNIQUE\n" ">>> @verify(UNIQUE)\n" @@ -1357,13 +1367,13 @@ msgstr "" "...\n" "ValueError: aliases found in : CRIMSON -> RED" -#: ../../library/enum.rst:758 +#: ../../library/enum.rst:762 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" -#: ../../library/enum.rst:761 +#: ../../library/enum.rst:765 msgid "" ">>> from enum import Enum, verify, CONTINUOUS\n" ">>> @verify(CONTINUOUS)\n" @@ -1385,7 +1395,7 @@ msgstr "" "...\n" "ValueError: invalid enum 'Color': missing values 3, 4" -#: ../../library/enum.rst:773 +#: ../../library/enum.rst:777 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" @@ -1393,7 +1403,7 @@ msgstr "" "確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " "產生時是很實用的: ::" -#: ../../library/enum.rst:776 +#: ../../library/enum.rst:780 msgid "" ">>> from enum import Flag, verify, NAMED_FLAGS\n" ">>> @verify(NAMED_FLAGS)\n" @@ -1421,24 +1431,24 @@ msgstr "" "ValueError: invalid Flag 'Color': aliases WHITE and NEON are missing " "combined values of 0x18 [use enum.show_flag_values(value) for details]" -#: ../../library/enum.rst:790 +#: ../../library/enum.rst:794 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" -#: ../../library/enum.rst:796 +#: ../../library/enum.rst:800 msgid "" "``FlagBoundary`` controls how out-of-range values are handled in :class:" "`Flag` and its subclasses." msgstr "``FlagBoundary`` 控制在 :class:`Flag` 及其子類別中如何處理範圍外的值。" -#: ../../library/enum.rst:801 +#: ../../library/enum.rst:805 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" -#: ../../library/enum.rst:804 +#: ../../library/enum.rst:808 msgid "" ">>> from enum import Flag, STRICT, auto\n" ">>> class StrictFlag(Flag, boundary=STRICT):\n" @@ -1466,13 +1476,13 @@ msgstr "" " given 0b0 10100\n" " allowed 0b0 00111" -#: ../../library/enum.rst:819 +#: ../../library/enum.rst:823 msgid "" "Out-of-range values have invalid values removed, leaving a valid :class:" "`Flag` value::" msgstr "會移除範圍外的值中的非法值,留下合法的 :class:`Flag` 值: ::" -#: ../../library/enum.rst:822 +#: ../../library/enum.rst:826 msgid "" ">>> from enum import Flag, CONFORM, auto\n" ">>> class ConformFlag(Flag, boundary=CONFORM):\n" @@ -1492,13 +1502,13 @@ msgstr "" ">>> ConformFlag(2**2 + 2**4)\n" "" -#: ../../library/enum.rst:833 +#: ../../library/enum.rst:837 msgid "" "Out-of-range values lose their :class:`Flag` membership and revert to :class:" "`int`." msgstr "範圍外的值會失去它們的 :class:`Flag` 成員資格且恢復成 :class:`int`。" -#: ../../library/enum.rst:846 +#: ../../library/enum.rst:850 msgid "" "Out-of-range values are kept, and the :class:`Flag` membership is kept. This " "is the default for :class:`IntFlag`::" @@ -1506,7 +1516,7 @@ msgstr "" "範圍外的值會被保留,:class:`Flag` 成員資格也會被保留。這是 :class:`IntFlag` " "的預設行為: ::" -#: ../../library/enum.rst:849 +#: ../../library/enum.rst:853 msgid "" ">>> from enum import Flag, KEEP, auto\n" ">>> class KeepFlag(Flag, boundary=KEEP):\n" @@ -1526,7 +1536,7 @@ msgstr "" ">>> KeepFlag(2**2 + 2**4)\n" "" -#: ../../library/enum.rst:862 +#: ../../library/enum.rst:866 msgid "" "*EnumDict* is a subclass of :class:`dict` that is used as the namespace for " "defining enum classes (see :ref:`prepare`). It is exposed to allow " @@ -1540,7 +1550,7 @@ msgstr "" "如讓每個成員有多個值。它應該在被呼叫時帶上正在建立的列舉類別名稱,否則私有名" "稱和內部類別將無法被正確處理。" -#: ../../library/enum.rst:869 +#: ../../library/enum.rst:873 msgid "" "Note that only the :class:`~collections.abc.MutableMapping` interface (:meth:" "`~object.__setitem__` and :meth:`~dict.update`) is overridden. It may be " @@ -1551,15 +1561,15 @@ msgstr "" "__setitem__` 和 :meth:`~dict.update`)被覆寫。可能可以使用其他 :class:`!" "dict` 操作來繞過檢查,例如 :meth:`|= `。" -#: ../../library/enum.rst:876 +#: ../../library/enum.rst:880 msgid "A list of member names." msgstr "一個成員名稱的串列。" -#: ../../library/enum.rst:883 +#: ../../library/enum.rst:887 msgid "Supported ``__dunder__`` names" msgstr "支援的 ``__dunder__`` 名稱" -#: ../../library/enum.rst:885 +#: ../../library/enum.rst:889 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." @@ -1567,7 +1577,7 @@ msgstr "" ":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項" "目的對映。只有在類別上可用。" -#: ../../library/enum.rst:888 +#: ../../library/enum.rst:892 msgid "" ":meth:`~Enum.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " @@ -1577,26 +1587,26 @@ msgstr "" "的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" "到。" -#: ../../library/enum.rst:894 +#: ../../library/enum.rst:898 msgid "Supported ``_sunder_`` names" msgstr "支援的 ``_sunder_`` 名稱" -#: ../../library/enum.rst:896 +#: ../../library/enum.rst:900 msgid ":attr:`~Enum._name_` -- name of the member" msgstr ":attr:`~Enum._name_` -- 成員名稱" -#: ../../library/enum.rst:897 +#: ../../library/enum.rst:901 msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr ":attr:`~Enum._value_` -- 成員的值;可以在 ``__new__`` 設定" -#: ../../library/enum.rst:898 +#: ../../library/enum.rst:902 msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" msgstr "" ":meth:`~Enum._missing_` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" -#: ../../library/enum.rst:900 +#: ../../library/enum.rst:904 msgid "" ":attr:`~Enum._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 " @@ -1605,7 +1615,7 @@ msgstr "" ":attr:`~Enum._ignore_` -- 一個名稱的串列,可以是 :class:`list` 或 :class:" "`str`,它不會被轉換成成員,且在最後的類別上會被移除" -#: ../../library/enum.rst:903 +#: ../../library/enum.rst:907 msgid "" ":attr:`~Enum._order_` -- no longer used, kept for backward compatibility " "(class attribute, removed during class creation)" @@ -1613,40 +1623,40 @@ msgstr "" ":attr:`~Enum._order_` -- 不再被使用,僅為了向後相容而保留(類別屬性,在類別建" "立時移除)" -#: ../../library/enum.rst:905 +#: ../../library/enum.rst:909 msgid "" ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " "an enum member; may be overridden" msgstr "" ":meth:`~Enum._generate_next_value_` -- 用來為列舉成員取得合適的值;可以被覆寫" -#: ../../library/enum.rst:910 +#: ../../library/enum.rst:914 msgid "" "For standard :class:`Enum` classes the next value chosen is the highest " "value seen incremented by one." msgstr "" "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是所看過的最大值加一。" -#: ../../library/enum.rst:913 +#: ../../library/enum.rst:917 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two." msgstr "" "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方的數字。" -#: ../../library/enum.rst:916 +#: ../../library/enum.rst:920 msgid "" ":meth:`~Enum._add_alias_` -- adds a new name as an alias to an existing " "member." msgstr ":meth:`~Enum._add_alias_` -- 新增一個名稱作為現有成員的別名。" -#: ../../library/enum.rst:918 +#: ../../library/enum.rst:922 msgid "" ":meth:`~Enum._add_value_alias_` -- adds a new value as an alias to an " "existing member." msgstr ":meth:`~Enum._add_value_alias_` -- 新增一個值作為現有成員的別名。" -#: ../../library/enum.rst:921 +#: ../../library/enum.rst:925 msgid "" "While ``_sunder_`` names are generally reserved for the further development " "of the :class:`Enum` class and can not be used, some are explicitly allowed:" @@ -1654,30 +1664,30 @@ msgstr "" "雖然 ``_sunder_`` 名稱通常保留用於 :class:`Enum` 類別的進一步開發而不能被使" "用,但有些是明確允許的:" -#: ../../library/enum.rst:924 +#: ../../library/enum.rst:928 msgid "" "``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_" msgstr "" "``_repr_*``\\ (例如 ``_repr_html_``),例如用於 `IPython 的豐富顯示 " "`_" -#: ../../library/enum.rst:926 +#: ../../library/enum.rst:930 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``、``_order_``、``_generate_next_value_``" -#: ../../library/enum.rst:927 +#: ../../library/enum.rst:931 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:928 +#: ../../library/enum.rst:932 msgid "``_add_alias_``, ``_add_value_alias_``, ``_repr_*``" msgstr "``_add_alias_``、``_add_value_alias_``、``_repr_*``" -#: ../../library/enum.rst:934 +#: ../../library/enum.rst:938 msgid "Utilities and Decorators" msgstr "通用項目與裝飾器" -#: ../../library/enum.rst:938 +#: ../../library/enum.rst:942 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an :class:`Enum`'s :meth:`~Enum._generate_next_value_` to get an " @@ -1693,16 +1703,16 @@ msgstr "" "`IntFlag` 來說,是第一個比最大值還大的 2 的次方的數字;對 :class:`StrEnum` 來" "說,是成員名稱的小寫版本。如果混用 *auto()* 和手動指定值的話要特別注意。" -#: ../../library/enum.rst:946 +#: ../../library/enum.rst:950 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" -#: ../../library/enum.rst:948 +#: ../../library/enum.rst:952 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" -#: ../../library/enum.rst:949 +#: ../../library/enum.rst:953 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is used to create the ``SECOND`` enum member;" @@ -1710,7 +1720,7 @@ msgstr "" "``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會被" "用來建立列舉成員 ``SECOND``;" -#: ../../library/enum.rst:951 +#: ../../library/enum.rst:955 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" @@ -1718,19 +1728,19 @@ msgstr "" "``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``, -3`` 會被用來建立列" "舉成員 ``THREE``)" -#: ../../library/enum.rst:956 +#: ../../library/enum.rst:960 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" -#: ../../library/enum.rst:959 +#: ../../library/enum.rst:963 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" -#: ../../library/enum.rst:962 +#: ../../library/enum.rst:966 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " @@ -1739,7 +1749,7 @@ msgstr "" "在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" "是不相容的型別就會失敗。" -#: ../../library/enum.rst:968 +#: ../../library/enum.rst:972 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " @@ -1748,7 +1758,7 @@ msgstr "" "和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" "有相同名稱。" -#: ../../library/enum.rst:972 +#: ../../library/enum.rst:976 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -1758,7 +1768,7 @@ msgstr "" "*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " "*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" -#: ../../library/enum.rst:981 +#: ../../library/enum.rst:985 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " @@ -1768,7 +1778,7 @@ msgstr "" "__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" "`ValueError` 並附上細節: ::" -#: ../../library/enum.rst:985 +#: ../../library/enum.rst:989 msgid "" ">>> from enum import Enum, unique\n" ">>> @unique\n" @@ -1794,7 +1804,7 @@ msgstr "" "...\n" "ValueError: duplicate values found in : FOUR -> THREE" -#: ../../library/enum.rst:999 +#: ../../library/enum.rst:1003 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " @@ -1803,15 +1813,15 @@ msgstr "" "專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" "定在裝飾的列舉上應該檢查什麼限制。" -#: ../../library/enum.rst:1007 +#: ../../library/enum.rst:1011 msgid "A decorator for use in enums: its target will become a member." msgstr "列舉所使用的裝飾器:其目標會變成成員。" -#: ../../library/enum.rst:1013 +#: ../../library/enum.rst:1017 msgid "A decorator for use in enums: its target will not become a member." msgstr "列舉所使用的裝飾器:其目標不會變成成員。" -#: ../../library/enum.rst:1019 +#: ../../library/enum.rst:1023 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -1822,19 +1832,19 @@ msgstr "" "組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" "考 :class:`re.RegexFlag`)。" -#: ../../library/enum.rst:1029 +#: ../../library/enum.rst:1033 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" -#: ../../library/enum.rst:1036 +#: ../../library/enum.rst:1040 msgid "Notes" msgstr "備註" -#: ../../library/enum.rst:1038 +#: ../../library/enum.rst:1042 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" -#: ../../library/enum.rst:1040 +#: ../../library/enum.rst:1044 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" @@ -1842,17 +1852,17 @@ msgstr "" "這三種列舉型別是設計來直接取代現有以整數及字串為基底的值;因此它們有額外的限" "制:" -#: ../../library/enum.rst:1043 +#: ../../library/enum.rst:1047 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "``__str__`` 使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:1045 +#: ../../library/enum.rst:1049 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:1048 +#: ../../library/enum.rst:1052 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" @@ -1860,7 +1870,7 @@ msgstr "" "如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 型別來建立自" "己的基礎類別: ::" -#: ../../library/enum.rst:1051 +#: ../../library/enum.rst:1055 msgid "" ">>> from enum import Enum\n" ">>> class MyIntEnum(int, Enum):\n" @@ -1870,11 +1880,11 @@ msgstr "" ">>> class MyIntEnum(int, Enum):\n" "... pass" -#: ../../library/enum.rst:1055 +#: ../../library/enum.rst:1059 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" -#: ../../library/enum.rst:1057 +#: ../../library/enum.rst:1061 msgid "" ">>> from enum import Enum, IntEnum\n" ">>> class MyIntEnum(IntEnum):\n" diff --git a/library/fractions.po b/library/fractions.po index 722ae18f1a..03799a18f9 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2016-01-31 07:18+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,30 +32,30 @@ msgstr "" #: ../../library/fractions.rst:17 msgid "" -"A Fraction instance can be constructed from a pair of integers, from another " -"rational number, or from a string." +"A Fraction instance can be constructed from a pair of rational numbers, from " +"a single number, or from a string." msgstr "" #: ../../library/fractions.rst:26 msgid "" "The first version requires that *numerator* and *denominator* are instances " "of :class:`numbers.Rational` and returns a new :class:`Fraction` instance " -"with value ``numerator/denominator``. If *denominator* is ``0``, it raises " -"a :exc:`ZeroDivisionError`." +"with a value equal to ``numerator/denominator``. If *denominator* is zero, " +"it raises a :exc:`ZeroDivisionError`." msgstr "" #: ../../library/fractions.rst:31 msgid "" -"The second version requires that *number* is an instance " -"of :class:`numbers.Rational` or has the :meth:`!as_integer_ratio` method " -"(this includes :class:`float` and :class:`decimal.Decimal`). It returns " -"a :class:`Fraction` instance with exactly the same value. Assumed, that " -"the :meth:`!as_integer_ratio` method returns a pair of coprime integers and " -"last one is positive. Note that due to the usual issues with binary point " -"(see :ref:`tut-fp-issues`), the argument to ``Fraction(1.1)`` is not exactly " -"equal to 11/10, and so ``Fraction(1.1)`` does *not* return ``Fraction(11, " -"10)`` as one might expect. (But see the documentation for " -"the :meth:`limit_denominator` method below.)" +"The second version requires that *number* is an instance of :class:`numbers." +"Rational` or has the :meth:`!as_integer_ratio` method (this includes :class:" +"`float` and :class:`decimal.Decimal`). It returns a :class:`Fraction` " +"instance with exactly the same value. Assumed, that the :meth:`!" +"as_integer_ratio` method returns a pair of coprime integers and last one is " +"positive. Note that due to the usual issues with binary point (see :ref:`tut-" +"fp-issues`), the argument to ``Fraction(1.1)`` is not exactly equal to " +"11/10, and so ``Fraction(1.1)`` does *not* return ``Fraction(11, 10)`` as " +"one might expect. (But see the documentation for the :meth:" +"`limit_denominator` method below.)" msgstr "" #: ../../library/fractions.rst:43 @@ -73,10 +73,10 @@ msgid "" "where the optional ``sign`` may be either '+' or '-' and ``numerator`` and " "``denominator`` (if present) are strings of decimal digits (underscores may " "be used to delimit digits as with integral literals in code). In addition, " -"any string that represents a finite value and is accepted by " -"the :class:`float` constructor is also accepted by the :class:`Fraction` " -"constructor. In either form the input string may also have leading and/or " -"trailing whitespace. Here are some examples::" +"any string that represents a finite value and is accepted by the :class:" +"`float` constructor is also accepted by the :class:`Fraction` constructor. " +"In either form the input string may also have leading and/or trailing " +"whitespace. Here are some examples::" msgstr "" #: ../../library/fractions.rst:57 @@ -133,20 +133,20 @@ msgstr "" #: ../../library/fractions.rst:83 msgid "" -"The :class:`Fraction` class inherits from the abstract base " -"class :class:`numbers.Rational`, and implements all of the methods and " -"operations from that class. :class:`Fraction` instances " -"are :term:`hashable`, and should be treated as immutable. In " -"addition, :class:`Fraction` has the following properties and methods:" +"The :class:`Fraction` class inherits from the abstract base class :class:" +"`numbers.Rational`, and implements all of the methods and operations from " +"that class. :class:`Fraction` instances are :term:`hashable`, and should be " +"treated as immutable. In addition, :class:`Fraction` has the following " +"properties and methods:" msgstr "" #: ../../library/fractions.rst:89 msgid "" -"The :class:`Fraction` constructor now accepts :class:`float` " -"and :class:`decimal.Decimal` instances." +"The :class:`Fraction` constructor now accepts :class:`float` and :class:" +"`decimal.Decimal` instances." msgstr "" -":class:`Fraction` 建構函式現在可接受 :class:`float` " -"和 :class:`decimal.Decimal` 實例。" +":class:`Fraction` 建構函式現在可接受 :class:`float` 和 :class:`decimal." +"Decimal` 實例。" #: ../../library/fractions.rst:93 msgid "" @@ -163,8 +163,8 @@ msgstr "" #: ../../library/fractions.rst:102 msgid "" -":class:`Fraction` implements ``__int__`` now to satisfy " -"``typing.SupportsInt`` instance checks." +":class:`Fraction` implements ``__int__`` now to satisfy ``typing." +"SupportsInt`` instance checks." msgstr "" #: ../../library/fractions.rst:106 @@ -190,99 +190,100 @@ msgid "" "The :class:`Fraction` constructor now accepts any objects with the :meth:`!" "as_integer_ratio` method." msgstr "" -":class:`Fraction` 建構函式現在可接受任何具有 :meth:`!as_integer_ratio` 方法的物件。" +":class:`Fraction` 建構函式現在可接受任何具有 :meth:`!as_integer_ratio` 方法的" +"物件。" #: ../../library/fractions.rst:124 msgid "Numerator of the Fraction in lowest term." msgstr "" #: ../../library/fractions.rst:128 -msgid "Denominator of the Fraction in lowest term." +msgid "Denominator of the Fraction in lowest terms. Guaranteed to be positive." msgstr "" -#: ../../library/fractions.rst:133 +#: ../../library/fractions.rst:134 msgid "" "Return a tuple of two integers, whose ratio is equal to the original " "Fraction. The ratio is in lowest terms and has a positive denominator." msgstr "" -#: ../../library/fractions.rst:141 +#: ../../library/fractions.rst:142 msgid "Return ``True`` if the Fraction is an integer." msgstr "" -#: ../../library/fractions.rst:147 +#: ../../library/fractions.rst:148 msgid "" -"Alternative constructor which only accepts instances of :class:`float` " -"or :class:`numbers.Integral`. Beware that ``Fraction.from_float(0.3)`` is " -"not the same value as ``Fraction(3, 10)``." +"Alternative constructor which only accepts instances of :class:`float` or :" +"class:`numbers.Integral`. Beware that ``Fraction.from_float(0.3)`` is not " +"the same value as ``Fraction(3, 10)``." msgstr "" -#: ../../library/fractions.rst:153 +#: ../../library/fractions.rst:154 msgid "" "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " "directly from a :class:`float`." msgstr "" -#: ../../library/fractions.rst:159 +#: ../../library/fractions.rst:160 msgid "" -"Alternative constructor which only accepts instances " -"of :class:`decimal.Decimal` or :class:`numbers.Integral`." +"Alternative constructor which only accepts instances of :class:`decimal." +"Decimal` or :class:`numbers.Integral`." msgstr "" -#: ../../library/fractions.rst:164 +#: ../../library/fractions.rst:165 msgid "" "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " "directly from a :class:`decimal.Decimal` instance." msgstr "" -#: ../../library/fractions.rst:171 +#: ../../library/fractions.rst:172 msgid "" -"Alternative constructor which only accepts instances " -"of :class:`numbers.Integral`, :class:`numbers.Rational`, :class:`float` " -"or :class:`decimal.Decimal`, and objects with the :meth:`!as_integer_ratio` " -"method, but not strings." +"Alternative constructor which only accepts instances of :class:`numbers." +"Integral`, :class:`numbers.Rational`, :class:`float` or :class:`decimal." +"Decimal`, and objects with the :meth:`!as_integer_ratio` method, but not " +"strings." msgstr "" -#: ../../library/fractions.rst:181 +#: ../../library/fractions.rst:182 msgid "" "Finds and returns the closest :class:`Fraction` to ``self`` that has " "denominator at most max_denominator. This method is useful for finding " "rational approximations to a given floating-point number:" msgstr "" -#: ../../library/fractions.rst:189 +#: ../../library/fractions.rst:190 msgid "or for recovering a rational number that's represented as a float:" msgstr "" -#: ../../library/fractions.rst:202 +#: ../../library/fractions.rst:203 msgid "" "Returns the greatest :class:`int` ``<= self``. This method can also be " "accessed through the :func:`math.floor` function:" msgstr "" -#: ../../library/fractions.rst:212 +#: ../../library/fractions.rst:213 msgid "" "Returns the least :class:`int` ``>= self``. This method can also be " "accessed through the :func:`math.ceil` function." msgstr "" -#: ../../library/fractions.rst:219 +#: ../../library/fractions.rst:220 msgid "" "The first version returns the nearest :class:`int` to ``self``, rounding " "half to even. The second version rounds ``self`` to the nearest multiple of " "``Fraction(1, 10**ndigits)`` (logically, if ``ndigits`` is negative), again " -"rounding half toward even. This method can also be accessed through " -"the :func:`round` function." +"rounding half toward even. This method can also be accessed through the :" +"func:`round` function." msgstr "" -#: ../../library/fractions.rst:227 +#: ../../library/fractions.rst:228 msgid "" -"Provides support for formatting of :class:`Fraction` instances via " -"the :meth:`str.format` method, the :func:`format` built-in function, " -"or :ref:`Formatted string literals `." +"Provides support for formatting of :class:`Fraction` instances via the :meth:" +"`str.format` method, the :func:`format` built-in function, or :ref:" +"`Formatted string literals `." msgstr "" -#: ../../library/fractions.rst:231 +#: ../../library/fractions.rst:232 msgid "" "If the ``format_spec`` format specification string does not end with one of " "the presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` " @@ -294,7 +295,7 @@ msgid "" "exact integer. The zero-fill flag ``'0'`` is not supported." msgstr "" -#: ../../library/fractions.rst:241 +#: ../../library/fractions.rst:242 msgid "" "If the ``format_spec`` format specification string ends with one of the " "presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` or " @@ -302,11 +303,11 @@ msgid "" "type in the :ref:`formatspec` section." msgstr "" -#: ../../library/fractions.rst:246 +#: ../../library/fractions.rst:247 msgid "Here are some examples::" msgstr "" -#: ../../library/fractions.rst:248 +#: ../../library/fractions.rst:249 msgid "" ">>> from fractions import Fraction\n" ">>> format(Fraction(103993, 33102), '_')\n" @@ -346,11 +347,11 @@ msgstr "" ">>> \"{:.2%} price increase\".format(Fraction(new_price, old_price) - 1)\n" "'34.67% price increase'" -#: ../../library/fractions.rst:270 +#: ../../library/fractions.rst:271 msgid "Module :mod:`numbers`" msgstr ":mod:`numbers` 模組" -#: ../../library/fractions.rst:271 +#: ../../library/fractions.rst:272 msgid "The abstract base classes making up the numeric tower." msgstr "" diff --git a/library/functions.po b/library/functions.po index 9b4e6313e8..832a60eba5 100644 --- a/library/functions.po +++ b/library/functions.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-09 05:11+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2024-05-06 17:06+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -460,9 +460,9 @@ msgid "" "iterator. If *default* is given, it is returned if the iterator is " "exhausted, otherwise :exc:`StopAsyncIteration` is raised." msgstr "" -"呼叫 *async_iterator* 的 :meth:`~object.__anext__` 方法,回" -"傳 :term:`awaitable`。等待返回疊代器的下一個值。如果指定 *default*,當疊代器" -"結束時會返回該值,否則會引發 :exc:`StopAsyncIteration` 。" +"呼叫 *async_iterator* 的 :meth:`~object.__anext__` 方法,回傳 :term:" +"`awaitable`。等待返回疊代器的下一個值。如果指定 *default*,當疊代器結束時會返" +"回該值,否則會引發 :exc:`StopAsyncIteration` 。" #: ../../library/functions.rst:104 msgid "" @@ -489,9 +489,9 @@ msgstr "" #: ../../library/functions.rst:116 msgid "" "As :func:`repr`, return a string containing a printable representation of an " -"object, but escape the non-ASCII characters in the string returned " -"by :func:`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates " -"a string similar to that returned by :func:`repr` in Python 2." +"object, but escape the non-ASCII characters in the string returned by :func:" +"`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates a string " +"similar to that returned by :func:`repr` in Python 2." msgstr "" "就像函式 :func:`repr`,回傳一個表示物件的字串,但是 :func:`repr` 回傳的字串中" "非 ASCII 編碼的字元會被跳脫 (escape),像是 ``\\x``、``\\u`` 和 ``\\U``。這個" @@ -500,13 +500,13 @@ msgstr "" #: ../../library/functions.rst:124 msgid "" "Convert an integer number to a binary string prefixed with \"0b\". The " -"result is a valid Python expression. If *integer* is not a " -"Python :class:`int` object, it has to define an :meth:`~object.__index__` " -"method that returns an integer. Some examples:" +"result is a valid Python expression. If *integer* is not a Python :class:" +"`int` object, it has to define an :meth:`~object.__index__` method that " +"returns an integer. Some examples:" msgstr "" "將一個整數轉變為一個前綴為 \"0b\" 的二進位制字串。結果是一個有效的 Python 運" -"算式。如果 *integer* 不是 Python 的 :class:`int` 物件,那它需要定" -"義 :meth:`~object.__index__` method 回傳一個整數。舉例來說:" +"算式。如果 *integer* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" +"`~object.__index__` method 回傳一個整數。舉例來說:" #: ../../library/functions.rst:134 msgid "" @@ -524,9 +524,9 @@ msgid "" "Return a Boolean value, i.e. one of ``True`` or ``False``. The argument is " "converted using the standard :ref:`truth testing procedure `. If the " "argument is false or omitted, this returns ``False``; otherwise, it returns " -"``True``. The :class:`bool` class is a subclass of :class:`int` " -"(see :ref:`typesnumeric`). It cannot be subclassed further. Its only " -"instances are ``False`` and ``True`` (see :ref:`typebool`)." +"``True``. The :class:`bool` class is a subclass of :class:`int` (see :ref:" +"`typesnumeric`). It cannot be subclassed further. Its only instances are " +"``False`` and ``True`` (see :ref:`typebool`)." msgstr "" "回傳一個布林值,即 ``True`` 或者 ``False``。引數會使用標準的\\ :ref:`真值測試" "程序 `\\ 來轉換。如果引數為假或者被省略,則回傳 ``False``;其他情況回" @@ -551,18 +551,18 @@ msgid "" "not accessible, this function will raise :exc:`RuntimeError`." msgstr "" "這個函式將呼叫 :func:`sys.breakpointhook` 函式,並將 ``args`` 和 ``kws`` 傳遞" -"給它。這將有效地讓你在特定的呼叫點進入除錯器。預設情況下," -"``sys.breakpointhook()`` 呼叫 :func:`pdb.set_trace` 不須帶任何引數。這樣的設" -"計是為了方便使用者,讓他們不需要額外地導入 :mod:`pdb` 模組或輸入太多程式就可" -"以進入除錯器。然而,可以將 :func:`sys.breakpointhook` 設置為其他函式,並" -"且 :func:`breakpoint` 將自動呼叫該函式,讓你進入所選擇的除錯器。如果無法存" -"取 :func:`sys.breakpointhook` 這個函式,則此函式將引發 :exc:`RuntimeError`。" +"給它。這將有效地讓你在特定的呼叫點進入除錯器。預設情況下,``sys." +"breakpointhook()`` 呼叫 :func:`pdb.set_trace` 不須帶任何引數。這樣的設計是為" +"了方便使用者,讓他們不需要額外地導入 :mod:`pdb` 模組或輸入太多程式就可以進入" +"除錯器。然而,可以將 :func:`sys.breakpointhook` 設置為其他函式,並且 :func:" +"`breakpoint` 將自動呼叫該函式,讓你進入所選擇的除錯器。如果無法存取 :func:" +"`sys.breakpointhook` 這個函式,則此函式將引發 :exc:`RuntimeError`。" #: ../../library/functions.rst:173 msgid "" -"By default, the behavior of :func:`breakpoint` can be changed with " -"the :envvar:`PYTHONBREAKPOINT` environment variable. " -"See :func:`sys.breakpointhook` for usage details." +"By default, the behavior of :func:`breakpoint` can be changed with the :" +"envvar:`PYTHONBREAKPOINT` environment variable. See :func:`sys." +"breakpointhook` for usage details." msgstr "" "預設情況下,:func:`breakpoint` 的行為可以透過 :envvar:`PYTHONBREAKPOINT` 環境" "變數來更改。有關使用詳情,請參考 :func:`sys.breakpointhook`。" @@ -589,9 +589,9 @@ msgid "" "as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`." msgstr "" "回傳一個新的 bytes 陣列。:class:`bytearray` class 是一個可變的整數序列,包含" -"範圍為 0 <= x < 256 的整數。它有可變序列大部分常見的 method(如" -"在 :ref:`typesseq-mutable` 中所述),同時也有 :class:`bytes` 型別大部分的 " -"method,參見 :ref:`bytes-methods`。" +"範圍為 0 <= x < 256 的整數。它有可變序列大部分常見的 method(如在 :ref:" +"`typesseq-mutable` 中所述),同時也有 :class:`bytes` 型別大部分的 method,參" +"見 :ref:`bytes-methods`。" #: ../../library/functions.rst:194 msgid "" @@ -644,8 +644,8 @@ msgstr "可參考 :ref:`binaryseq` 和 :ref:`typebytearray`。" #: ../../library/functions.rst:220 msgid "" "Return a new \"bytes\" object which is an immutable sequence of integers in " -"the range ``0 <= x < 256``. :class:`bytes` is an immutable version " -"of :class:`bytearray` -- it has the same non-mutating methods and the same " +"the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :" +"class:`bytearray` -- it has the same non-mutating methods and the same " "indexing and slicing behavior." msgstr "" "回傳一個新的 \"bytes\" 物件,會是一個元素是範圍為 ``0 <= x < 256`` 整數的不可" @@ -667,12 +667,11 @@ msgstr "可參考 :ref:`binaryseq`、:ref:`typebytes` 和 :ref:`bytes-methods` #: ../../library/functions.rst:234 msgid "" -"Return :const:`True` if the *object* argument appears " -"callable, :const:`False` if not. If this returns ``True``, it is still " -"possible that a call fails, but if it is ``False``, calling *object* will " -"never succeed. Note that classes are callable (calling a class returns a new " -"instance); instances are callable if their class has " -"a :meth:`~object.__call__` method." +"Return :const:`True` if the *object* argument appears callable, :const:" +"`False` if not. If this returns ``True``, it is still possible that a call " +"fails, but if it is ``False``, calling *object* will never succeed. Note " +"that classes are callable (calling a class returns a new instance); " +"instances are callable if their class has a :meth:`~object.__call__` method." msgstr "" "如果引數 *object* 是可呼叫的,回傳 :const:`True`,否則回傳 :const:`False`。如" "果回傳 ``True``,呼叫仍可能會失敗;但如果回傳 ``False``,則呼叫 *object* 肯定" @@ -727,8 +726,8 @@ msgstr "" #: ../../library/functions.rst:267 msgid "" -"The ``@classmethod`` form is a function :term:`decorator` -- " -"see :ref:`function` for details." +"The ``@classmethod`` form is a function :term:`decorator` -- see :ref:" +"`function` for details." msgstr "" "``@classmethod`` 語法是一個函式 :term:`decorator` — 參見 :ref:`function` 中關" "於函式定義的詳細介紹。" @@ -756,30 +755,31 @@ msgstr "" #: ../../library/functions.rst:279 msgid "" -"Class methods can now wrap other :term:`descriptors ` such " -"as :func:`property`." +"Class methods can now wrap other :term:`descriptors ` such as :" +"func:`property`." msgstr "" -"Class methods 現在可以包裝其他\\ :term:`描述器 `,例" -"如 :func:`property`" +"Class methods 現在可以包裝其他\\ :term:`描述器 `,例如 :func:" +"`property`" #: ../../library/functions.rst:283 msgid "" -"Class methods now inherit the method attributes " -"(:attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__` " -"and :attr:`~function.__annotations__`) and have a new ``__wrapped__`` " -"attribute." +"Class methods now inherit the method attributes (:attr:`~function." +"__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" +"attr:`~function.__doc__` and :attr:`~function.__annotations__`) and have a " +"new ``__wrapped__`` attribute." msgstr "" -"Class method 現在繼承了 method 屬性" -"(:attr:`~function.__module__`、:attr:`~function.__name__`、:attr:`~function.__qualname__`、:attr:`~function.__doc__` " -"和 :attr:`~function.__annotations__`),並擁有一個新的 ``__wrapped__`` 屬性。" +"Class method 現在繼承了 method 屬性(:attr:`~function.__module__`、:attr:" +"`~function.__name__`、:attr:`~function.__qualname__`、:attr:`~function." +"__doc__` 和 :attr:`~function.__annotations__`),並擁有一個新的 " +"``__wrapped__`` 屬性。" #: ../../library/functions.rst:290 msgid "" "Class methods can no longer wrap other :term:`descriptors ` such " "as :func:`property`." msgstr "" -"Class methods 不能再包裝其他的\\ :term:`描述器 `,例" -"如 :func:`property`。" +"Class methods 不能再包裝其他的\\ :term:`描述器 `,例如 :func:" +"`property`。" #: ../../library/functions.rst:297 msgid "" @@ -788,9 +788,9 @@ msgid "" "string, a byte string, or an AST object. Refer to the :mod:`ast` module " "documentation for information on how to work with AST objects." msgstr "" -"將 *source* 編譯成程式碼或 AST 物件。程式碼物件可以被 :func:`exec` " -"或 :func:`eval` 執行。*source* 可以是一般的字串、bytes 字串、或者 AST 物件。" -"參見 :mod:`ast` module(模組)的說明文件瞭解如何使用 AST 物件。" +"將 *source* 編譯成程式碼或 AST 物件。程式碼物件可以被 :func:`exec` 或 :func:" +"`eval` 執行。*source* 可以是一般的字串、bytes 字串、或者 AST 物件。參見 :mod:" +"`ast` module(模組)的說明文件瞭解如何使用 AST 物件。" #: ../../library/functions.rst:302 msgid "" @@ -816,16 +816,16 @@ msgstr "" #: ../../library/functions.rst:312 msgid "" -"The optional arguments *flags* and *dont_inherit* control " -"which :ref:`compiler options ` should be activated and " -"which :ref:`future features ` should be allowed. If neither is " -"present (or both are zero) the code is compiled with the same flags that " -"affect the code that is calling :func:`compile`. If the *flags* argument is " -"given and *dont_inherit* is not (or is zero) then the compiler options and " -"the future statements specified by the *flags* argument are used in addition " -"to those that would be used anyway. If *dont_inherit* is a non-zero integer " -"then the *flags* argument is it -- the flags (future features and compiler " -"options) in the surrounding code are ignored." +"The optional arguments *flags* and *dont_inherit* control which :ref:" +"`compiler options ` should be activated and which :ref:" +"`future features ` should be allowed. If neither is present (or both " +"are zero) the code is compiled with the same flags that affect the code that " +"is calling :func:`compile`. If the *flags* argument is given and " +"*dont_inherit* is not (or is zero) then the compiler options and the future " +"statements specified by the *flags* argument are used in addition to those " +"that would be used anyway. If *dont_inherit* is a non-zero integer then the " +"*flags* argument is it -- the flags (future features and compiler options) " +"in the surrounding code are ignored." msgstr "" "可選引數 *flags* 和 *dont_inherit* 控制啟用哪個\\ :ref:`編譯器選項 `\\ 以及允許哪個\\ :ref:`未來功能 `。如果兩者都不存在" @@ -838,18 +838,16 @@ msgstr "" msgid "" "Compiler options and future statements are specified by bits which can be " "bitwise ORed together to specify multiple options. The bitfield required to " -"specify a given future feature can be found as " -"the :attr:`~__future__._Feature.compiler_flag` attribute on " -"the :class:`~__future__._Feature` instance in the :mod:`__future__` " -"module. :ref:`Compiler flags ` can be found " -"in :mod:`ast` module, with ``PyCF_`` prefix." +"specify a given future feature can be found as the :attr:`~__future__." +"_Feature.compiler_flag` attribute on the :class:`~__future__._Feature` " +"instance in the :mod:`__future__` module. :ref:`Compiler flags ` can be found in :mod:`ast` module, with ``PyCF_`` prefix." msgstr "" "編譯器選項和 future 陳述式使用 bits 來表示,可以一起被位元操作 OR 來表示複數" -"個選項。需要被具體定義特徵的位元域可以透過 :mod:`__future__` module " -"中 :class:`~__future__._Feature` 實例中" -"的 :attr:`~__future__._Feature.compiler_flag` 屬性來獲得。:ref:`編譯器旗標 " -"`\\ 可以在 :mod:`ast` module 中搜尋有 ``PyCF_`` 前綴的名" -"稱。" +"個選項。需要被具體定義特徵的位元域可以透過 :mod:`__future__` module 中 :" +"class:`~__future__._Feature` 實例中的 :attr:`~__future__._Feature." +"compiler_flag` 屬性來獲得。:ref:`編譯器旗標 `\\ 可以在 :" +"mod:`ast` module 中搜尋有 ``PyCF_`` 前綴的名稱。" #: ../../library/functions.rst:331 msgid "" @@ -859,8 +857,8 @@ msgid "" "optimization; ``__debug__`` is true), ``1`` (asserts are removed, " "``__debug__`` is false) or ``2`` (docstrings are removed too)." msgstr "" -"引數 *optimize* 用來指定編譯器的最佳化級別;預設值 ``-1`` 選擇與直譯器" -"的 :option:`-O` 選項相同的最佳化級別。其他級別為 ``0``\\ (沒有最佳化;\\ " +"引數 *optimize* 用來指定編譯器的最佳化級別;預設值 ``-1`` 選擇與直譯器的 :" +"option:`-O` 選項相同的最佳化級別。其他級別為 ``0``\\ (沒有最佳化;\\ " "``__debug__`` 為真值)、``1``\\ (assert 被刪除,``__debug__`` 為假值)或 " "``2``\\ (說明字串 (docstring) 也被刪除)。" @@ -874,8 +872,8 @@ msgstr "" #: ../../library/functions.rst:340 msgid "" -"If you want to parse Python code into its AST representation, " -"see :func:`ast.parse`." +"If you want to parse Python code into its AST representation, see :func:`ast." +"parse`." msgstr "如果你想解析 Python 程式碼為 AST 運算式,請參閱 :func:`ast.parse`。" #: ../../library/functions.rst:343 ../../library/functions.rst:345 @@ -891,8 +889,8 @@ msgstr "" msgid "" "When compiling a string with multi-line code in ``'single'`` or ``'eval'`` " "mode, input must be terminated by at least one newline character. This is " -"to facilitate detection of incomplete and complete statements in " -"the :mod:`code` module." +"to facilitate detection of incomplete and complete statements in the :mod:" +"`code` module." msgstr "" "在 ``'single'`` 或 ``'eval'`` 模式編譯多行程式碼時,輸入必須以至少一個換行符" "結尾。這使 :mod:`code` module 更容易檢測陳述式的完整性。" @@ -985,23 +983,23 @@ msgid "" "and ``')'``, which are ignored. The string must not contain whitespace " "between ``'+'``, ``'-'``, the ``'j'`` or ``'J'`` suffix, and the decimal " "number. For example, ``complex('1+2j')`` is fine, but ``complex('1 + 2j')`` " -"raises :exc:`ValueError`. More precisely, the input must conform to " -"the :token:`~float:complexvalue` production rule in the following grammar, " -"after parentheses and leading and trailing whitespace characters are removed:" +"raises :exc:`ValueError`. More precisely, the input must conform to the :" +"token:`~float:complexvalue` production rule in the following grammar, after " +"parentheses and leading and trailing whitespace characters are removed:" msgstr "" #: ../../library/functions.rst:422 msgid "" "If the argument is a number, the constructor serves as a numeric conversion " "like :class:`int` and :class:`float`. For a general Python object ``x``, " -"``complex(x)`` delegates to ``x.__complex__()``. " -"If :meth:`~object.__complex__` is not defined then it falls back " -"to :meth:`~object.__float__`. If :meth:`!__float__` is not defined then it " -"falls back to :meth:`~object.__index__`." +"``complex(x)`` delegates to ``x.__complex__()``. If :meth:`~object." +"__complex__` is not defined then it falls back to :meth:`~object.__float__`. " +"If :meth:`!__float__` is not defined then it falls back to :meth:`~object." +"__index__`." msgstr "" "如果引數是一個數字,則建構函式會像 :class:`int` 和 :class:`float` 一樣進行數" -"值轉換。對於一個普通的 Python 物件 ``x``,``complex(x)`` 會委派給 " -"``x.__complex__()``。如果 :meth:`~object.__complex__` 未定義,則會回退 (fall " +"值轉換。對於一個普通的 Python 物件 ``x``,``complex(x)`` 會委派給 ``x." +"__complex__()``。如果 :meth:`~object.__complex__` 未定義,則會回退 (fall " "back) 到 :meth:`~object.__float__`。如果 :meth:`!__float__` 未定義,則會再回" "退到 :meth:`~object.__index__`。" @@ -1037,8 +1035,8 @@ msgstr "可以使用底線將程式碼文字中的數字進行分組。" #: ../../library/functions.rst:450 msgid "" -"Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` " -"and :meth:`~object.__float__` are not defined." +"Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and :" +"meth:`~object.__float__` are not defined." msgstr "" "如果 :meth:`~object.__complex__` 和 :meth:`~object.__float__` 未定義,則會回" "退到 :meth:`~object.__index__`。" @@ -1072,8 +1070,8 @@ msgstr "" #: ../../library/functions.rst:477 msgid "" -"For other containers see the built-in :class:`list`, :class:`set`, " -"and :class:`tuple` classes, as well as the :mod:`collections` module." +"For other containers see the built-in :class:`list`, :class:`set`, and :" +"class:`tuple` classes, as well as the :mod:`collections` module." msgstr "" "其他容器型別,請參見內建的 :class:`list`、:class:`set` 和 :class:`tuple` " "class,以及 :mod:`collections` module。" @@ -1091,9 +1089,9 @@ msgstr "" msgid "" "If the object has a method named :meth:`~object.__dir__`, this method will " "be called and must return the list of attributes. This allows objects that " -"implement a custom :func:`~object.__getattr__` " -"or :func:`~object.__getattribute__` function to customize the " -"way :func:`dir` reports their attributes." +"implement a custom :func:`~object.__getattr__` or :func:`~object." +"__getattribute__` function to customize the way :func:`dir` reports their " +"attributes." msgstr "" "如果物件有一個名為 :meth:`~object.__dir__` 的 method,那麼該 method 將被呼" "叫,並且必須回傳一個屬性列表。這允許實現自定義 :func:`~object.__getattr__` " @@ -1105,12 +1103,12 @@ msgid "" "If the object does not provide :meth:`~object.__dir__`, the function tries " "its best to gather information from the object's :attr:`~object.__dict__` " "attribute, if defined, and from its type object. The resulting list is not " -"necessarily complete and may be inaccurate when the object has a " -"custom :func:`~object.__getattr__`." +"necessarily complete and may be inaccurate when the object has a custom :" +"func:`~object.__getattr__`." msgstr "" -"如果物件不提供 :meth:`~object.__dir__`,這個函式會嘗試從物件已定義" -"的 :attr:`~object.__dict__` 屬性和型別物件收集資訊。結果列表並不總是完整的," -"如果物件有自定義 :func:`~object.__getattr__`,那結果可能不準確。" +"如果物件不提供 :meth:`~object.__dir__`,這個函式會嘗試從物件已定義的 :attr:" +"`~object.__dict__` 屬性和型別物件收集資訊。結果列表並不總是完整的,如果物件有" +"自定義 :func:`~object.__getattr__`,那結果可能不準確。" #: ../../library/functions.rst:500 msgid "" @@ -1167,30 +1165,30 @@ msgid "" "consisting of their quotient and remainder when using integer division. " "With mixed operand types, the rules for binary arithmetic operators apply. " "For integers, the result is the same as ``(a // b, a % b)``. For floating-" -"point numbers the result is ``(q, a % b)``, where *q* is usually " -"``math.floor(a / b)`` but may be 1 less than that. In any case ``q * b + a " -"% b`` is very close to *a*, if ``a % b`` is non-zero it has the same sign as " -"*b*, and ``0 <= abs(a % b) < abs(b)``." +"point numbers the result is ``(q, a % b)``, where *q* is usually ``math." +"floor(a / b)`` but may be 1 less than that. In any case ``q * b + a % b`` " +"is very close to *a*, if ``a % b`` is non-zero it has the same sign as *b*, " +"and ``0 <= abs(a % b) < abs(b)``." msgstr "" "它將兩個(非複數)數字作為引數,並在執行整數除法時回傳一對商和餘數。對於混合" "運算元型別,適用二進位算術運算子的規則。對於整數,運算結果和 ``(a // b, a % " -"b)`` 一致。對於浮點數,運算結果是 ``(q, a % b)``,*q* 通常是 " -"``math.floor(a / b)`` 但可能會比 1 小。在任何情況下,``q * b + a % b`` 和 " -"*a* 基本相等,如果 ``a % b`` 非零,則它的符號和 *b* 一樣,且 ``0 <= abs(a % " -"b) < abs(b)``。" +"b)`` 一致。對於浮點數,運算結果是 ``(q, a % b)``,*q* 通常是 ``math." +"floor(a / b)`` 但可能會比 1 小。在任何情況下,``q * b + a % b`` 和 *a* 基本相" +"等,如果 ``a % b`` 非零,則它的符號和 *b* 一樣,且 ``0 <= abs(a % b) < " +"abs(b)``。" #: ../../library/functions.rst:556 msgid "" -"Return an enumerate object. *iterable* must be a sequence, " -"an :term:`iterator`, or some other object which supports iteration. " -"The :meth:`~iterator.__next__` method of the iterator returned " -"by :func:`enumerate` returns a tuple containing a count (from *start* which " -"defaults to 0) and the values obtained from iterating over *iterable*." +"Return an enumerate object. *iterable* must be a sequence, an :term:" +"`iterator`, or some other object which supports iteration. The :meth:" +"`~iterator.__next__` method of the iterator returned by :func:`enumerate` " +"returns a tuple containing a count (from *start* which defaults to 0) and " +"the values obtained from iterating over *iterable*." msgstr "" "回傳一個列舉 (enumerate) 物件。*iterable* 必須是一個序列、:term:`iterator` 或" -"其他支援疊代的物件。:func:`enumerate` 回傳之 iterator " -"的 :meth:`~iterator.__next__` method 回傳一個 tuple(元組),裡面包含一個計數" -"值(從 *start* 開始,預設為 0)和透過疊代 *iterable* 獲得的值。" +"其他支援疊代的物件。:func:`enumerate` 回傳之 iterator 的 :meth:`~iterator." +"__next__` method 回傳一個 tuple(元組),裡面包含一個計數值(從 *start* 開" +"始,預設為 0)和透過疊代 *iterable* 獲得的值。" #: ../../library/functions.rst:568 msgid "Equivalent to::" @@ -1257,14 +1255,14 @@ msgid "" "reference to the dictionary of the built-in module :mod:`builtins` is " "inserted under that key before *expression* is parsed. That way you can " "control what builtins are available to the executed code by inserting your " -"own ``__builtins__`` dictionary into *globals* before passing it " -"to :func:`eval`. If the *locals* mapping is omitted it defaults to the " -"*globals* dictionary. If both mappings are omitted, the expression is " -"executed with the *globals* and *locals* in the environment " -"where :func:`eval` is called. Note, *eval()* will only have access to " -"the :term:`nested scopes ` (non-locals) in the enclosing " -"environment if they are already referenced in the scope that is " -"calling :func:`eval` (e.g. via a :keyword:`nonlocal` statement)." +"own ``__builtins__`` dictionary into *globals* before passing it to :func:" +"`eval`. If the *locals* mapping is omitted it defaults to the *globals* " +"dictionary. If both mappings are omitted, the expression is executed with " +"the *globals* and *locals* in the environment where :func:`eval` is called. " +"Note, *eval()* will only have access to the :term:`nested scopes ` (non-locals) in the enclosing environment if they are already " +"referenced in the scope that is calling :func:`eval` (e.g. via a :keyword:" +"`nonlocal` statement)." msgstr "" "*expression* 引數會被視為一條 Python 運算式(技術上而言,是條件列表)來剖析及" "求值,而 *globals* 和 *locals* 對映分別用作全域和區域命名空間。如果 " @@ -1272,11 +1270,11 @@ msgstr "" "析之前,將為該鍵插入對內建 :mod:`builtins` module dictionary 的引用。這麼一" "來,在將 ``__builtins__`` dictionary 傳入 :func:`eval` 之前,你可以透過將它插" "入 *globals* 來控制你需要哪些內建函式來執行程式碼。如果 *locals* 對映被省略," -"那它的預設值是 *globals* dictionary。如果兩個對映都被省略,則以" -"在 :func:`eval` 被呼叫的環境中的 *globals* 和 *locals* 執行運算式。請注意," -"*eval()* 在封閉 (enclosing) 環境中無法存取\\ :term:`巢狀作用域 ` (non-locals),除非呼叫 :func:`eval` 的作用域已經有參照它們(例如透" -"過 :keyword:`nonlocal` 陳述式)。" +"那它的預設值是 *globals* dictionary。如果兩個對映都被省略,則以在 :func:" +"`eval` 被呼叫的環境中的 *globals* 和 *locals* 執行運算式。請注意,*eval()* 在" +"封閉 (enclosing) 環境中無法存取\\ :term:`巢狀作用域 ` (non-" +"locals),除非呼叫 :func:`eval` 的作用域已經有參照它們(例如透過 :keyword:" +"`nonlocal` 陳述式)。" #: ../../library/functions.rst:616 msgid "Example:" @@ -1301,8 +1299,8 @@ msgid "" "pass around for use by :func:`eval` or :func:`exec`." msgstr "" "提示::func:`exec` 函式支援動態執行陳述式。:func:`globals` 和 :func:`locals` " -"函式分別回傳目前的全域性和局部性 dictionary,它們對於將引數傳遞" -"給 :func:`eval` 或 :func:`exec` 可能會方便許多。" +"函式分別回傳目前的全域性和局部性 dictionary,它們對於將引數傳遞給 :func:" +"`eval` 或 :func:`exec` 可能會方便許多。" #: ../../library/functions.rst:632 msgid "" @@ -1344,18 +1342,18 @@ msgid "" "as a suite of Python statements which is then executed (unless a syntax " "error occurs). [#]_ If it is a code object, it is simply executed. In all " "cases, the code that's executed is expected to be valid as file input (see " -"the section :ref:`file-input` in the Reference Manual). Be aware that " -"the :keyword:`nonlocal`, :keyword:`yield`, and :keyword:`return` statements " -"may not be used outside of function definitions even within the context of " -"code passed to the :func:`exec` function. The return value is ``None``." +"the section :ref:`file-input` in the Reference Manual). Be aware that the :" +"keyword:`nonlocal`, :keyword:`yield`, and :keyword:`return` statements may " +"not be used outside of function definitions even within the context of code " +"passed to the :func:`exec` function. The return value is ``None``." msgstr "" "這個函式支援動態執行 Python 程式碼。*source* 必須是字串或者程式碼物件。如果是" "字串,那麼該字串將被剖析為一系列 Python 陳述式並執行(除非發生語法錯誤)。" "[#]_ 如果是程式碼物件,它將被直接執行。無論哪種情況,被執行的程式碼都需要和檔" "案輸入一樣是有效的(可參閱語言參考手冊中關於\\ :ref:`file-input`\\ 的章節)。" -"請注意,即使在傳遞給 :func:`exec` 函式的程式碼的上下文" -"中,:keyword:`nonlocal`、:keyword:`yield` 和 :keyword:`return` 陳述式也不能在" -"函式之外使用。該函式回傳值是 ``None``。" +"請注意,即使在傳遞給 :func:`exec` 函式的程式碼的上下文中,:keyword:" +"`nonlocal`、:keyword:`yield` 和 :keyword:`return` 陳述式也不能在函式之外使" +"用。該函式回傳值是 ``None``。" #: ../../library/functions.rst:672 msgid "" @@ -1385,9 +1383,9 @@ msgstr "" #: ../../library/functions.rst:688 msgid "" "If the *globals* dictionary does not contain a value for the key " -"``__builtins__``, a reference to the dictionary of the built-in " -"module :mod:`builtins` is inserted under that key. That way you can control " -"what builtins are available to the executed code by inserting your own " +"``__builtins__``, a reference to the dictionary of the built-in module :mod:" +"`builtins` is inserted under that key. That way you can control what " +"builtins are available to the executed code by inserting your own " "``__builtins__`` dictionary into *globals* before passing it to :func:`exec`." msgstr "" "如果 *globals* dictionary 不包含 ``__builtins__`` 鍵值,則將為該鍵插入對內" @@ -1422,9 +1420,9 @@ msgid "" "Pass an explicit *locals* dictionary if you need to see effects of the code " "on *locals* after function :func:`exec` returns." msgstr "" -"預設情況下,*locals* 的行為如下面 :func:`locals` 函式描述的一樣。如果你想" -"在 :func:`exec` 函式回傳時知道程式碼對 *locals* 的變動,請明確地傳遞 " -"*locals* dictionary 。" +"預設情況下,*locals* 的行為如下面 :func:`locals` 函式描述的一樣。如果你想在 :" +"func:`exec` 函式回傳時知道程式碼對 *locals* 的變動,請明確地傳遞 *locals* " +"dictionary 。" #: ../../library/functions.rst:717 msgid "Added the *closure* parameter." @@ -1524,9 +1522,9 @@ msgstr "" #: ../../library/functions.rst:800 msgid "" -"For a general Python object ``x``, ``float(x)`` delegates to " -"``x.__float__()``. If :meth:`~object.__float__` is not defined then it " -"falls back to :meth:`~object.__index__`." +"For a general Python object ``x``, ``float(x)`` delegates to ``x." +"__float__()``. If :meth:`~object.__float__` is not defined then it falls " +"back to :meth:`~object.__index__`." msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 會委派給 ``x.__float__()``。如果未" "定義 :meth:`~object.__float__` 則會回退到 :meth:`~object.__index__`。" @@ -1559,8 +1557,8 @@ msgid "" "is used by most built-in types: :ref:`formatspec`." msgstr "" "將 *value* 轉換為 *format_spec* 控制的 \"格式化\" 表示。*format_spec* 的解釋" -"取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語" -"法::ref:`formatspec`。" +"取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" +"`formatspec`。" #: ../../library/functions.rst:831 msgid "" @@ -1572,12 +1570,12 @@ msgstr "" #: ../../library/functions.rst:834 msgid "" -"A call to ``format(value, format_spec)`` is translated to " -"``type(value).__format__(value, format_spec)`` which bypasses the instance " -"dictionary when searching for the value's :meth:`~object.__format__` method. " -"A :exc:`TypeError` exception is raised if the method search " -"reaches :mod:`object` and the *format_spec* is non-empty, or if either the " -"*format_spec* or the return value are not strings." +"A call to ``format(value, format_spec)`` is translated to ``type(value)." +"__format__(value, format_spec)`` which bypasses the instance dictionary when " +"searching for the value's :meth:`~object.__format__` method. A :exc:" +"`TypeError` exception is raised if the method search reaches :mod:`object` " +"and the *format_spec* is non-empty, or if either the *format_spec* or the " +"return value are not strings." msgstr "" "呼叫 ``format(value, format_spec)`` 會轉換成 ``type(value).__format__(value, " "format_spec)``,當搜尋 value 的 :meth:`~object.__format__` method 時,會忽略" @@ -1589,24 +1587,23 @@ msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." msgstr "" -"當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會引" -"發 :exc:`TypeError`。" +"當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會引發 :" +"exc:`TypeError`。" #: ../../library/functions.rst:850 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " -"*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` " -"and :ref:`types-set` for documentation about this class." +"*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" +"ref:`types-set` for documentation about this class." msgstr "" "回傳一個新的 :class:`frozenset` 物件,它包含選擇性引數 *iterable* 中的元素。" -"``frozenset`` 是一個內建的 class。有關此 class 的文件,請參" -"閱 :class:`frozenset` 和 :ref:`types-set`。" +"``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" +"`frozenset` 和 :ref:`types-set`。" #: ../../library/functions.rst:854 msgid "" -"For other containers see the built-" -"in :class:`set`, :class:`list`, :class:`tuple`, and :class:`dict` classes, " -"as well as the :mod:`collections` module." +"For other containers see the built-in :class:`set`, :class:`list`, :class:" +"`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "class,以及 :mod:`collections` module 來了解其它的容器。" @@ -1622,16 +1619,16 @@ msgid "" msgstr "" "回傳 *object* 之具名屬性的值。*name* 必須是字串。如果該字串是物件屬性之一的名" "稱,則回傳該屬性的值。例如,``getattr(x, 'foobar')`` 等同於 ``x.foobar``。如" -"果指定的屬性不存在,且提供了 *default* 值,則回傳其值,否則引" -"發 :exc:`AttributeError`。*name* 不必是個 Python 識別符 (identifier)(請" -"見 :func:`setattr`)。" +"果指定的屬性不存在,且提供了 *default* 值,則回傳其值,否則引發 :exc:" +"`AttributeError`。*name* 不必是個 Python 識別符 (identifier)(請見 :func:" +"`setattr`)。" #: ../../library/functions.rst:871 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " -"with two leading underscores) name in order to retrieve it " -"with :func:`getattr`." +"with two leading underscores) name in order to retrieve it with :func:" +"`getattr`." msgstr "" "由於\\ :ref:`私有名稱改編 (private name mangling) ` 是" "發生在編譯期,因此你必須手動改編私有屬性(有兩個前導底線的屬性)的名稱,才能" @@ -1670,9 +1667,8 @@ msgstr "" #: ../../library/functions.rst:901 msgid "" -"For objects with custom :meth:`~object.__hash__` methods, note " -"that :func:`hash` truncates the return value based on the bit width of the " -"host machine." +"For objects with custom :meth:`~object.__hash__` methods, note that :func:" +"`hash` truncates the return value based on the bit width of the host machine." msgstr "" "請注意,如果物件帶有自訂的 :meth:`~object.__hash__` 方法,:func:`hash` 將根據" "運行機器的位元長度來截斷回傳值。" @@ -1742,8 +1738,8 @@ msgstr "另請參閱 :func:`int` 將十六進位制字串轉換為以 16 為基 #: ../../library/functions.rst:955 msgid "" -"To obtain a hexadecimal string representation for a float, use " -"the :meth:`float.hex` method." +"To obtain a hexadecimal string representation for a float, use the :meth:" +"`float.hex` method." msgstr "" "如果要取得浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" @@ -1851,14 +1847,13 @@ msgstr "" #: ../../library/functions.rst:1021 msgid "" -"If the argument defines :meth:`~object.__int__`, ``int(x)`` returns " -"``x.__int__()``. If the argument defines :meth:`~object.__index__`, it " -"returns ``x.__index__()``. For floating-point numbers, this truncates " -"towards zero." +"If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x." +"__int__()``. If the argument defines :meth:`~object.__index__`, it returns " +"``x.__index__()``. For floating-point numbers, this truncates towards zero." msgstr "" -"如果引數定義了 :meth:`~object.__int__`,則 ``int(x)`` 會回傳 ``x.__int__()``。" -"如果引數定義了 :meth:`~object.__index__` 則回傳 ``x.__index__()``。對於浮點" -"數,則會向零的方向無條件捨去。" +"如果引數定義了 :meth:`~object.__int__`,則 ``int(x)`` 會回傳 ``x." +"__int__()``。如果引數定義了 :meth:`~object.__index__` 則回傳 ``x." +"__index__()``。對於浮點數,則會向零的方向無條件捨去。" #: ../../library/functions.rst:1026 msgid "" @@ -1868,10 +1863,10 @@ msgid "" "``-`` (with no space in between), have leading zeros, be surrounded by " "whitespace, and have single underscores interspersed between digits." msgstr "" -"如果引數不是數字或如果有給定 *base*,則它必須是個字串、:class:`bytes` " -"或 :class:`bytearray` 實例,表示基數 (radix) *base* 中的整數。可選地,字串之" -"前可以有 ``+`` 或 ``-``\\ (中間沒有空格)、可有個前導的零、也可被空格包圍、" -"或在數字間有單一底線。" +"如果引數不是數字或如果有給定 *base*,則它必須是個字串、:class:`bytes` 或 :" +"class:`bytearray` 實例,表示基數 (radix) *base* 中的整數。可選地,字串之前可" +"以有 ``+`` 或 ``-``\\ (中間沒有空格)、可有個前導的零、也可被空格包圍、或在" +"數字間有單一底線。" #: ../../library/functions.rst:1032 msgid "" @@ -1901,15 +1896,15 @@ msgstr "整數型別定義請參閱\\ :ref:`typesnumeric`。" #: ../../library/functions.rst:1045 msgid "" -"If *base* is not an instance of :class:`int` and the *base* object has " -"a :meth:`base.__index__ ` method, that method is called to " +"If *base* is not an instance of :class:`int` and the *base* object has a :" +"meth:`base.__index__ ` method, that method is called to " "obtain an integer for the base. Previous versions used :meth:`base.__int__ " "` instead of :meth:`base.__index__ `." msgstr "" "如果 *base* 不是 :class:`int` 的實例,但 *base* 物件有 :meth:`base.__index__ " "` method,則會呼叫該 method 來取得此進位制所需的整數。以前" -"的版本使用 :meth:`base.__int__ ` 而不" -"是 :meth:`base.__index__ `。" +"的版本使用 :meth:`base.__int__ ` 而不是 :meth:`base." +"__index__ `。" #: ../../library/functions.rst:1055 msgid "The first parameter is now positional-only." @@ -1927,14 +1922,14 @@ msgid "" ":class:`int` string inputs and string representations can be limited to help " "avoid denial of service attacks. A :exc:`ValueError` is raised when the " "limit is exceeded while converting a string to an :class:`int` or when " -"converting an :class:`int` into a string would exceed the limit. See " -"the :ref:`integer string conversion length limitation ` " +"converting an :class:`int` into a string would exceed the limit. See the :" +"ref:`integer string conversion length limitation ` " "documentation." msgstr "" ":class:`int` 的字串輸入和字串表示法可以被限制,以避免阻斷服務攻擊 (denial of " -"service attack)。在字串 *x* 轉換為 :class:`int` 時已超出限制,或是" -"在 :class:`int` 轉換為字串時將會超出限制時,會引發 :exc:`ValueError`。請參閱" -"\\ :ref:`整數字串轉換的長度限制 `\\ 說明文件。" +"service attack)。在字串 *x* 轉換為 :class:`int` 時已超出限制,或是在 :class:" +"`int` 轉換為字串時將會超出限制時,會引發 :exc:`ValueError`。請參閱\\ :ref:`整" +"數字串轉換的長度限制 `\\ 說明文件。" #: ../../library/functions.rst:1069 msgid "" @@ -1949,18 +1944,18 @@ msgid "" "the function always returns ``False``. If *classinfo* is a tuple of type " "objects (or recursively, other such tuples) or a :ref:`types-union` of " "multiple types, return ``True`` if *object* is an instance of any of the " -"types. If *classinfo* is not a type or tuple of types and such tuples, " -"a :exc:`TypeError` exception is raised. :exc:`TypeError` may not be raised " -"for an invalid type if an earlier check succeeds." -msgstr "" -"如果 *object* 引數是 *classinfo* 引數的實例,或者是(直接、間接" -"或 :term:`virtual `)subclass 的實例,則回傳 ``True``。" -"如果 *object* 不是給定型別的物件,函式始終回傳 ``False``。如果 *classinfo* 是" -"包含物件型別的 tuple(或多個遞迴 tuple)或一個包含多種型別的 :ref:`types-" -"union`,若 *object* 是其中的任何一個物件的實例則回傳 ``True``。如果 " -"*classinfo* 既不是型別,也不是型別 tuple 或型別的遞迴 tuple,那麼會引" -"發 :exc:`TypeError` 異常。若是先前檢查已經成功,:exc:`TypeError` 可能不會再因" -"為不合格的型別而被引發。" +"types. If *classinfo* is not a type or tuple of types and such tuples, a :" +"exc:`TypeError` exception is raised. :exc:`TypeError` may not be raised for " +"an invalid type if an earlier check succeeds." +msgstr "" +"如果 *object* 引數是 *classinfo* 引數的實例,或者是(直接、間接或 :term:" +"`virtual `)subclass 的實例,則回傳 ``True``。如果 " +"*object* 不是給定型別的物件,函式始終回傳 ``False``。如果 *classinfo* 是包含" +"物件型別的 tuple(或多個遞迴 tuple)或一個包含多種型別的 :ref:`types-union`," +"若 *object* 是其中的任何一個物件的實例則回傳 ``True``。如果 *classinfo* 既不" +"是型別,也不是型別 tuple 或型別的遞迴 tuple,那麼會引發 :exc:`TypeError` 異" +"常。若是先前檢查已經成功,:exc:`TypeError` 可能不會再因為不合格的型別而被引" +"發。" #: ../../library/functions.rst:1085 ../../library/functions.rst:1099 msgid "*classinfo* can be a :ref:`types-union`." @@ -1968,18 +1963,18 @@ msgstr "*classinfo* 可以是一個 :ref:`types-union`。" #: ../../library/functions.rst:1091 msgid "" -"Return ``True`` if *class* is a subclass (direct, indirect, " -"or :term:`virtual `) of *classinfo*. A class is " -"considered a subclass of itself. *classinfo* may be a tuple of class objects " -"(or recursively, other such tuples) or a :ref:`types-union`, in which case " +"Return ``True`` if *class* is a subclass (direct, indirect, or :term:" +"`virtual `) of *classinfo*. A class is considered a " +"subclass of itself. *classinfo* may be a tuple of class objects (or " +"recursively, other such tuples) or a :ref:`types-union`, in which case " "return ``True`` if *class* is a subclass of any entry in *classinfo*. In " "any other case, a :exc:`TypeError` exception is raised." msgstr "" "如果 *class* 是 *classinfo* 的 subclass(直接、間接或 :term:`virtual " "`),則回傳 ``True``。*classinfo* 可以是 class 物件的 " "tuple(或遞迴地其他類似 tuple)或是一個 :ref:`types-union`,此時若 *class* " -"是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會引" -"發 :exc:`TypeError`。" +"是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會引發 :" +"exc:`TypeError`。" #: ../../library/functions.rst:1106 msgid "" @@ -1987,24 +1982,23 @@ msgid "" "differently depending on the presence of the second argument. Without a " "second argument, the single argument must be a collection object which " "supports the :term:`iterable` protocol (the :meth:`~object.__iter__` " -"method), or it must support the sequence protocol " -"(the :meth:`~object.__getitem__` method with integer arguments starting at " -"``0``). If it does not support either of those protocols, :exc:`TypeError` " -"is raised. If the second argument, *sentinel*, is given, then the first " -"argument must be a callable object. The iterator created in this case will " -"call *callable* with no arguments for each call to " -"its :meth:`~iterator.__next__` method; if the value returned is equal to " -"*sentinel*, :exc:`StopIteration` will be raised, otherwise the value will be " -"returned." +"method), or it must support the sequence protocol (the :meth:`~object." +"__getitem__` method with integer arguments starting at ``0``). If it does " +"not support either of those protocols, :exc:`TypeError` is raised. If the " +"second argument, *sentinel*, is given, then the first argument must be a " +"callable object. The iterator created in this case will call *callable* " +"with no arguments for each call to its :meth:`~iterator.__next__` method; if " +"the value returned is equal to *sentinel*, :exc:`StopIteration` will be " +"raised, otherwise the value will be returned." msgstr "" "回傳一個 :term:`iterator` 物件。根據是否存在第二個引數,第一個引數的意義是非" "常不同的。如果沒有第二個引數,該單一引數必須是支援 :term:`iterable` 協定" -"(有 :meth:`~object.__iter__` method)的集合物件,或必須支援序列協定" -"(有 :meth:`~object.__getitem__` 方法,且數字引數從 ``0`` 開始)。如果它不支" -"援這些協定,會引發 :exc:`TypeError`。如果有第二個引數 *sentinel*,那麼第一引" -"數必須是可呼叫的物件,這種情況下生成的 iterator,每次疊代呼" -"叫 :meth:`~iterator.__next__` 時會不帶引數地呼叫 *callable*;如果回傳的結果" -"是 *sentinel* 則引發 :exc:`StopIteration`,否則回傳呼叫結果。" +"(有 :meth:`~object.__iter__` method)的集合物件,或必須支援序列協定(有 :" +"meth:`~object.__getitem__` 方法,且數字引數從 ``0`` 開始)。如果它不支援這些" +"協定,會引發 :exc:`TypeError`。如果有第二個引數 *sentinel*,那麼第一引數必須" +"是可呼叫的物件,這種情況下生成的 iterator,每次疊代呼叫 :meth:`~iterator." +"__next__` 時會不帶引數地呼叫 *callable*;如果回傳的結果是 *sentinel* 則引發 :" +"exc:`StopIteration`,否則回傳呼叫結果。" #: ../../library/functions.rst:1120 msgid "See also :ref:`typeiter`." @@ -2042,8 +2036,8 @@ msgstr "" #: ../../library/functions.rst:1140 msgid "" -"``len`` raises :exc:`OverflowError` on lengths larger " -"than :data:`sys.maxsize`, such as :class:`range(2 ** 100) `." +"``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." +"maxsize`, such as :class:`range(2 ** 100) `." msgstr "" "如果物件長度大於 :data:`sys.maxsize`,像是 :class:`range(2 ** 100) `," "則 ``len`` 會引發 :exc:`OverflowError`。" @@ -2066,8 +2060,8 @@ msgstr "" #: ../../library/functions.rst:1158 msgid "" "At module scope, as well as when using :func:`exec` or :func:`eval` with a " -"single namespace, this function returns the same namespace " -"as :func:`globals`." +"single namespace, this function returns the same namespace as :func:" +"`globals`." msgstr "" #: ../../library/functions.rst:1162 @@ -2128,10 +2122,10 @@ msgstr "" #: ../../library/functions.rst:1197 msgid "" "As part of :pep:`667`, the semantics of mutating the mapping objects " -"returned from this function are now defined. The behavior " -"in :term:`optimized scopes ` is now as described above. " -"Aside from being defined, the behaviour in other scopes remains unchanged " -"from previous versions." +"returned from this function are now defined. The behavior in :term:" +"`optimized scopes ` is now as described above. Aside from " +"being defined, the behaviour in other scopes remains unchanged from previous " +"versions." msgstr "" #: ../../library/functions.rst:1207 @@ -2145,12 +2139,12 @@ msgid "" "cases where the function inputs are already arranged into argument tuples, " "see :func:`itertools.starmap`." msgstr "" -"產生一個將 *function* 應用於 *iterable* 中所有項目並 yield 回傳結果的" -"疊代器。如果傳遞了額外的 *iterables* 引數,則 *function* 必須接受相同個數的" -"引數,且 *function* 會平行地被應用於所有可疊代物件的項目。當有多個可疊代物件時,項目最少的" -"可疊代物件耗盡時疊代器也會結束。如果 *strict* 為 ``True`` 且其中一個" -"可疊代物件在其他可疊代物件之前耗盡,則會拋出 :exc:`ValueError`。如果函式的輸入已經被編排為引數的元組," -"請參閱 :func:`itertools.starmap`。" +"產生一個將 *function* 應用於 *iterable* 中所有項目並 yield 回傳結果的疊代器。" +"如果傳遞了額外的 *iterables* 引數,則 *function* 必須接受相同個數的引數,且 " +"*function* 會平行地被應用於所有可疊代物件的項目。當有多個可疊代物件時,項目最" +"少的可疊代物件耗盡時疊代器也會結束。如果 *strict* 為 ``True`` 且其中一個可疊" +"代物件在其他可疊代物件之前耗盡,則會拋出 :exc:`ValueError`。如果函式的輸入已" +"經被編排為引數的元組,請參閱 :func:`itertools.starmap`。" #: ../../library/functions.rst:1216 msgid "Added the *strict* parameter." @@ -2176,20 +2170,20 @@ msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " "a one-argument ordering function like that used for :meth:`list.sort`. The " "*default* argument specifies an object to return if the provided iterable is " -"empty. If the iterable is empty and *default* is not provided, " -"a :exc:`ValueError` is raised." +"empty. If the iterable is empty and *default* is not provided, a :exc:" +"`ValueError` is raised." msgstr "" "這個函式有兩個選擇性的僅限關鍵字引數。*key* 引數能指定單一引數所使用的排序函" "式,如同 :meth:`list.sort` 的使用方式。*default* 引數是當 iterable 為空時回傳" -"的物件。如果 iterable 為空,並且沒有提供 *default*,則會引" -"發 :exc:`ValueError`。" +"的物件。如果 iterable 為空,並且沒有提供 *default*,則會引發 :exc:" +"`ValueError`。" #: ../../library/functions.rst:1238 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " -"such as ``sorted(iterable, key=keyfunc, reverse=True)[0]`` and " -"``heapq.nlargest(1, iterable, key=keyfunc)``." +"such as ``sorted(iterable, key=keyfunc, reverse=True)[0]`` and ``heapq." +"nlargest(1, iterable, key=keyfunc)``." msgstr "" "如果有多個最大元素,則此函式將回傳第一個找到的。這和其他穩定排序工具如 " "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " @@ -2205,8 +2199,8 @@ msgstr "*key* 可以為 ``None``。" #: ../../library/functions.rst:1254 msgid "" -"Return a \"memory view\" object created from the given argument. " -"See :ref:`typememoryview` for more information." +"Return a \"memory view\" object created from the given argument. See :ref:" +"`typememoryview` for more information." msgstr "" "回傳由給定的引數所建立之「memory view(記憶體檢視)」物件。有關詳細資訊,請參" "閱\\ :ref:`typememoryview`。" @@ -2239,14 +2233,13 @@ msgstr "" #: ../../library/functions.rst:1291 msgid "" -"Retrieve the next item from the :term:`iterator` by calling " -"its :meth:`~iterator.__next__` method. If *default* is given, it is " -"returned if the iterator is exhausted, otherwise :exc:`StopIteration` is " -"raised." +"Retrieve the next item from the :term:`iterator` by calling its :meth:" +"`~iterator.__next__` method. If *default* is given, it is returned if the " +"iterator is exhausted, otherwise :exc:`StopIteration` is raised." msgstr "" "透過呼叫 :term:`iterator` 的 :meth:`~iterator.__next__` method 取得下一個元" -"素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則引" -"發 :exc:`StopIteration`。" +"素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則引發 :" +"exc:`StopIteration`。" #: ../../library/functions.rst:1298 msgid "" @@ -2270,9 +2263,9 @@ msgstr "" #: ../../library/functions.rst:1312 msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " -"result is a valid Python expression. If *integer* is not a " -"Python :class:`int` object, it has to define an :meth:`~object.__index__` " -"method that returns an integer. For example:" +"result is a valid Python expression. If *integer* is not a Python :class:" +"`int` object, it has to define an :meth:`~object.__index__` method that " +"returns an integer. For example:" msgstr "" "將一個整數轉變為一個前綴為 \"0o\" 的八進位制字串。回傳結果是一個有效的 " "Python 運算式。如果 *integer* 不是 Python 的 :class:`int` 物件,那它需要定" @@ -2317,18 +2310,18 @@ msgid "" "already exists), ``'x'`` for exclusive creation, and ``'a'`` for appending " "(which on *some* Unix systems, means that *all* writes append to the end of " "the file regardless of the current seek position). In text mode, if " -"*encoding* is not specified the encoding used is platform-" -"dependent: :func:`locale.getencoding` is called to get the current locale " -"encoding. (For reading and writing raw bytes use binary mode and leave " -"*encoding* unspecified.) The available modes are:" +"*encoding* is not specified the encoding used is platform-dependent: :func:" +"`locale.getencoding` is called to get the current locale encoding. (For " +"reading and writing raw bytes use binary mode and leave *encoding* " +"unspecified.) The available modes are:" msgstr "" "*mode* 是一個選擇性字串,用於指定開啟檔案的模式。預設值是 ``'r'``,這意味著它" "以文字模式開啟並讀取。其他常見模式有:寫入 ``'w'``\\ (會捨去已經存在的檔" "案)、唯一性建立 ``'x'``、追加寫入 ``'a'``\\ (在\\ *一些* Unix 系統上,無論" "目前的檔案指標在什麼位置,*所有* 寫入都會追加到檔案末尾)。在文字模式,如果沒" -"有指定 *encoding*,則根據電腦平臺來決定使用的編碼:呼" -"叫 :func:`locale.getencoding` 來取得目前的本地編碼。(要讀取和寫入原始 " -"bytes,請使用二進位制模式且不要指定 *encoding*。)可用的模式有:" +"有指定 *encoding*,則根據電腦平臺來決定使用的編碼:呼叫 :func:`locale." +"getencoding` 來取得目前的本地編碼。(要讀取和寫入原始 bytes,請使用二進位制模" +"式且不要指定 *encoding*。)可用的模式有:" #: ../../library/functions.rst:1366 msgid "Character" @@ -2457,9 +2450,9 @@ msgid "" "size is available. On most systems, the buffer will typically be 128 " "kilobytes long." msgstr "" -"二進位檔案會以固定大小的區塊進行緩衝;緩衝區的大小為 " -"``max(min(blocksize, 8 MiB), DEFAULT_BUFFER_SIZE)``,當裝置區塊大小可用時。" -"在大多數系統上,緩衝區的長度通常為 128 KB。" +"二進位檔案會以固定大小的區塊進行緩衝;緩衝區的大小為 ``max(min(blocksize, 8 " +"MiB), DEFAULT_BUFFER_SIZE)``,當裝置區塊大小可用時。在大多數系統上,緩衝區的" +"長度通常為 128 KB。" #: ../../library/functions.rst:1410 msgid "" @@ -2488,9 +2481,8 @@ msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " "standard error handlers are available (listed under :ref:`error-handlers`), " -"though any error handling name that has been registered " -"with :func:`codecs.register_error` is also valid. The standard names " -"include:" +"though any error handling name that has been registered with :func:`codecs." +"register_error` is also valid. The standard names include:" msgstr "" "*errors* 是一個選擇性的字串,用於指定要如何處理編碼和解碼的錯誤——它不能在二進" "制模式下使用。有許多不同的標準錯誤處理程式(error handler,在\\ :ref:`error-" @@ -2584,10 +2576,10 @@ msgstr "" #: ../../library/functions.rst:1472 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " -"characters written are translated to the system default line " -"separator, :data:`os.linesep`. If *newline* is ``''`` or ``'\\n'``, no " -"translation takes place. If *newline* is any of the other legal values, any " -"``'\\n'`` characters written are translated to the given string." +"characters written are translated to the system default line separator, :" +"data:`os.linesep`. If *newline* is ``''`` or ``'\\n'``, no translation " +"takes place. If *newline* is any of the other legal values, any ``'\\n'`` " +"characters written are translated to the given string." msgstr "" "將輸出寫入資料串流時,如果 *newline* 是 ``None``,則被寫入的任何 ``'\\n'`` 字" "元都會轉換為系統預設的行分隔符號 :data:`os.linesep`。如果 *newline* 是 " @@ -2624,8 +2616,8 @@ msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" #: ../../library/functions.rst:1491 msgid "" -"The following example uses the :ref:`dir_fd ` parameter of " -"the :func:`os.open` function to open a file relative to a given directory::" +"The following example uses the :ref:`dir_fd ` parameter of the :func:" +"`os.open` function to open a file relative to a given directory::" msgstr "" "下面的範例使用 :func:`os.open` 函式回傳值當作 :ref:`dir_fd ` 的參數," "從給定的目錄中用相對路徑開啟檔案: ::" @@ -2647,35 +2639,35 @@ msgstr "" msgid "" "The type of :term:`file object` returned by the :func:`open` function " "depends on the mode. When :func:`open` is used to open a file in a text " -"mode (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass " -"of :class:`io.TextIOBase` (specifically :class:`io.TextIOWrapper`). When " -"used to open a file in a binary mode with buffering, the returned class is a " +"mode (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass of :" +"class:`io.TextIOBase` (specifically :class:`io.TextIOWrapper`). When used " +"to open a file in a binary mode with buffering, the returned class is a " "subclass of :class:`io.BufferedIOBase`. The exact class varies: in read " "binary mode, it returns an :class:`io.BufferedReader`; in write binary and " "append binary modes, it returns an :class:`io.BufferedWriter`, and in read/" "write mode, it returns an :class:`io.BufferedRandom`. When buffering is " -"disabled, the raw stream, a subclass " -"of :class:`io.RawIOBase`, :class:`io.FileIO`, is returned." +"disabled, the raw stream, a subclass of :class:`io.RawIOBase`, :class:`io." +"FileIO`, is returned." msgstr "" ":func:`open` 函式回傳的 :term:`file object` 型別取決於模式。當 :func:`open` " "是在文字模式中開啟檔案時(``'w'``、``'r'``、``'wt'``、``'rt'`` 等),它會回" -"傳 :class:`io.TextIOBase` 的一個 subclass(具體來說,就" -"是 :class:`io.TextIOWrapper`)。使用有緩衝的二進制模式開啟檔案時,回傳的 " -"class 則會是 :class:`io.BufferedIOBase` 的 subclass。確切的 class 各不相同:" -"在讀取的二進制模式,它會回傳 :class:`io.BufferedReader`;在寫入和附加的二進制" -"模式,它會回傳 :class:`io.BufferedWriter`,而在讀/寫模式,它會回" -"傳 :class:`io.BufferedRandom`。當緩衝被停用時,會回傳原始資料串" -"流 :class:`io.FileIO`,它是 :class:`io.RawIOBase` 的一個 subclass。" +"傳 :class:`io.TextIOBase` 的一個 subclass(具體來說,就是 :class:`io." +"TextIOWrapper`)。使用有緩衝的二進制模式開啟檔案時,回傳的 class 則會是 :" +"class:`io.BufferedIOBase` 的 subclass。確切的 class 各不相同:在讀取的二進制" +"模式,它會回傳 :class:`io.BufferedReader`;在寫入和附加的二進制模式,它會回" +"傳 :class:`io.BufferedWriter`,而在讀/寫模式,它會回傳 :class:`io." +"BufferedRandom`。當緩衝被停用時,會回傳原始資料串流 :class:`io.FileIO`,它" +"是 :class:`io.RawIOBase` 的一個 subclass。" #: ../../library/functions.rst:1525 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " -"(where :func:`open` is " -"declared), :mod:`os`, :mod:`os.path`, :mod:`tempfile`, and :mod:`shutil`." +"(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" +"`tempfile`, and :mod:`shutil`." msgstr "" -"另請參閱檔案操作模組,例如 :mod:`fileinput`、:mod:`io`\\ (定義" -"了 :func:`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以" -"及 :mod:`shutil`。" +"另請參閱檔案操作模組,例如 :mod:`fileinput`、:mod:`io`\\ (定義了 :func:" +"`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" +"`shutil`。" #: ../../library/functions.rst:1529 msgid "" @@ -2708,8 +2700,8 @@ msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." msgstr "" -"如果檔案已存在但使用了唯一性建立模式 (``'x'``),現在會引" -"發 :exc:`FileExistsError`。" +"如果檔案已存在但使用了唯一性建立模式 (``'x'``),現在會引發 :exc:" +"`FileExistsError`。" #: ../../library/functions.rst:1544 msgid "The file is now non-inheritable." @@ -2718,8 +2710,8 @@ msgstr "檔案在此版本開始是不可繼承的。" #: ../../library/functions.rst:1548 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)." +"exception, the function now retries the system call instead of raising an :" +"exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" "如果系統呼叫被中斷,但訊號處理程式沒有引發例外,此函式現在會重試系統呼叫,而" "不是引發 :exc:`InterruptedError` 例外(原因詳見 :pep:`475`)。" @@ -2734,8 +2726,8 @@ msgstr "增加對於實作 :class:`os.PathLike` 物件的支援。" #: ../../library/functions.rst:1556 msgid "" -"On Windows, opening a console buffer may return a subclass " -"of :class:`io.RawIOBase` other than :class:`io.FileIO`." +"On Windows, opening a console buffer may return a subclass of :class:`io." +"RawIOBase` other than :class:`io.FileIO`." msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" @@ -2752,8 +2744,8 @@ msgstr "" msgid "" "If the argument is a one-character string, return the Unicode code point of " "that character. For example, ``ord('a')`` returns the integer ``97`` and " -"``ord('€')`` (Euro sign) returns ``8364``. This is the inverse " -"of :func:`chr`." +"``ord('€')`` (Euro sign) returns ``8364``. This is the inverse of :func:" +"`chr`." msgstr "" "如果引數是單字元字串,則回傳該字元的 Unicode 編碼位置。例如 ``ord('a')`` 回傳" "整數 ``97``、``ord('€')``\\ (歐元符號)回傳 ``8364``。這是 :func:`chr` 的逆" @@ -2778,8 +2770,9 @@ msgstr "" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" #: ../../library/functions.rst:1583 +#, fuzzy msgid "" -"The arguments must have numeric types. With mixed operand types, the " +"When arguments are builtin numeric types with mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " "operands, the result has the same type as the operands (after coercion) " "unless the second argument is negative; in that case, all arguments are " @@ -2787,19 +2780,19 @@ msgid "" "2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``. For a negative " "base of type :class:`int` or :class:`float` and a non-integral exponent, a " "complex result is delivered. For example, ``pow(-9, 0.5)`` returns a value " -"close to ``3j``. Whereas, for a negative base of type :class:`int` " -"or :class:`float` with an integral exponent, a float result is delivered. " -"For example, ``pow(-9, 2.0)`` returns ``81.0``." +"close to ``3j``. Whereas, for a negative base of type :class:`int` or :class:" +"`float` with an integral exponent, a float result is delivered. For example, " +"``pow(-9, 2.0)`` returns ``81.0``." msgstr "" "引數必須為數值型別。當運算元型別為混合型別時,會套用二元算術運算子的強制轉型 " "(coercion) 規則。對於 :class:`int` 運算元,運算結果會(在強制轉型後)與運算元" "的型別相同,除非第二個引數是負數;在這種情況下,所有的引數都會被轉換為浮點數" "並得到浮點數的結果。例如,``pow(10, 2)`` 會回傳 ``100``,但 ``pow(10, -2)`` " "會回傳 ``0.01``。如果底數 (base) 是型別為 :class:`int` 或 :class:`float` 的負" -"數且指數 (exponent) 為非整數,則會傳回複數結果。例如 ``pow(-9, 0.5)`` " -"會回傳一個接近 ``3j`` 的值。然而,如果底數 (base) 是型別為 :class:`int` " -"或 :class:`float` 的負數且指數為整數,則會傳回浮點數結果。例如 " -"``pow(-9, 2.0)`` 會回傳 ``81.0``。" +"數且指數 (exponent) 為非整數,則會傳回複數結果。例如 ``pow(-9, 0.5)`` 會回傳" +"一個接近 ``3j`` 的值。然而,如果底數 (base) 是型別為 :class:`int` 或 :class:" +"`float` 的負數且指數為整數,則會傳回浮點數結果。例如 ``pow(-9, 2.0)`` 會回傳 " +"``81.0``。" #: ../../library/functions.rst:1595 msgid "" @@ -2950,12 +2943,12 @@ msgstr "" msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " -"possible to create read-only properties easily using :func:`property` as " -"a :term:`decorator`::" +"possible to create read-only properties easily using :func:`property` as a :" +"term:`decorator`::" msgstr "" "如果有給定 *doc*,它將會是 property 屬性的說明字串。否則,property 會複製 " -"*fget* 的說明字串(如果它存在的話)。這樣一來,就能夠輕鬆地使" -"用 :func:`property` 作為\\ :term:`裝飾器 `\\ 來建立唯讀屬性: ::" +"*fget* 的說明字串(如果它存在的話)。這樣一來,就能夠輕鬆地使用 :func:" +"`property` 作為\\ :term:`裝飾器 `\\ 來建立唯讀屬性: ::" #: ../../library/functions.rst:1675 msgid "" @@ -3112,8 +3105,8 @@ msgstr "" #: ../../library/functions.rst:1790 msgid "" -"For a general Python object ``number``, ``round`` delegates to " -"``number.__round__``." +"For a general Python object ``number``, ``round`` delegates to ``number." +"__round__``." msgstr "" #: ../../library/functions.rst:1795 @@ -3134,9 +3127,9 @@ msgstr "" #: ../../library/functions.rst:1810 msgid "" -"For other containers see the built-" -"in :class:`frozenset`, :class:`list`, :class:`tuple`, and :class:`dict` " -"classes, as well as the :mod:`collections` module." +"For other containers see the built-in :class:`frozenset`, :class:`list`, :" +"class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " +"module." msgstr "" #: ../../library/functions.rst:1817 @@ -3151,10 +3144,10 @@ msgstr "" #: ../../library/functions.rst:1823 msgid "" "*name* need not be a Python identifier as defined in :ref:`identifiers` " -"unless the object chooses to enforce that, for example in a " -"custom :meth:`~object.__getattribute__` or via :attr:`~object.__slots__`. An " -"attribute whose name is not an identifier will not be accessible using the " -"dot notation, but is accessible through :func:`getattr` etc.." +"unless the object chooses to enforce that, for example in a custom :meth:" +"`~object.__getattribute__` or via :attr:`~object.__slots__`. An attribute " +"whose name is not an identifier will not be accessible using the dot " +"notation, but is accessible through :func:`getattr` etc.." msgstr "" #: ../../library/functions.rst:1831 @@ -3182,16 +3175,14 @@ msgstr "" #: ../../library/functions.rst:1853 msgid "" "Slice objects are also generated when extended indexing syntax is used. For " -"example: ``a[start:stop:step]`` or ``a[start:stop, i]``. " -"See :func:`itertools.islice` for an alternate version that returns " -"an :term:`iterator`." +"example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:" +"`itertools.islice` for an alternate version that returns an :term:`iterator`." msgstr "" #: ../../library/functions.rst:1858 msgid "" -"Slice objects are now :term:`hashable` " -"(provided :attr:`~slice.start`, :attr:`~slice.stop`, and :attr:`~slice.step` " -"are hashable)." +"Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" +"`~slice.stop`, and :attr:`~slice.step` are hashable)." msgstr "" #: ../../library/functions.rst:1864 @@ -3206,9 +3197,8 @@ msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" #: ../../library/functions.rst:1868 msgid "" "*key* specifies a function of one argument that is used to extract a " -"comparison key from each element in *iterable* (for example, " -"``key=str.lower``). The default value is ``None`` (compare the elements " -"directly)." +"comparison key from each element in *iterable* (for example, ``key=str." +"lower``). The default value is ``None`` (compare the elements directly)." msgstr "" #: ../../library/functions.rst:1872 @@ -3270,8 +3260,8 @@ msgstr "" #: ../../library/functions.rst:1905 msgid "" -"The ``@staticmethod`` form is a function :term:`decorator` -- " -"see :ref:`function` for details." +"The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" +"`function` for details." msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" @@ -3279,9 +3269,9 @@ msgstr "" #: ../../library/functions.rst:1908 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " -"an instance (such as ``C().f()``). Moreover, the static " -"method :term:`descriptor` is also callable, so it can be used in the class " -"definition (such as ``f()``)." +"an instance (such as ``C().f()``). Moreover, the static method :term:" +"`descriptor` is also callable, so it can be used in the class definition " +"(such as ``f()``)." msgstr "" #: ../../library/functions.rst:1913 @@ -3320,15 +3310,15 @@ msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" #: ../../library/functions.rst:1931 msgid "" -"Static methods now inherit the method attributes " -"(:attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__` " -"and :attr:`~function.__annotations__`), have a new ``__wrapped__`` " -"attribute, and are now callable as regular functions." +"Static methods now inherit the method attributes (:attr:`~function." +"__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" +"attr:`~function.__doc__` and :attr:`~function.__annotations__`), have a new " +"``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" -"Static method 現在繼承了 method 屬性" -"(:attr:`~function.__module__`、:attr:`~function.__name__`、:attr:`~function.__qualname__`、:attr:`~function.__doc__` " -"和 :attr:`~function.__annotations__`),並擁有一個新的 ``__wrapped__`` 屬性," -"且為如一般函式的可呼叫物件。" +"Static method 現在繼承了 method 屬性(:attr:`~function.__module__`、:attr:" +"`~function.__name__`、:attr:`~function.__qualname__`、:attr:`~function." +"__doc__` 和 :attr:`~function.__annotations__`),並擁有一個新的 " +"``__wrapped__`` 屬性,且為如一般函式的可呼叫物件。" #: ../../library/functions.rst:1949 msgid "" @@ -3351,10 +3341,10 @@ msgstr "" #: ../../library/functions.rst:1961 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " -"preferred, fast way to concatenate a sequence of strings is by calling " -"``''.join(sequence)``. To add floating-point values with extended " -"precision, see :func:`math.fsum`\\. To concatenate a series of iterables, " -"consider using :func:`itertools.chain`." +"preferred, fast way to concatenate a sequence of strings is by calling ``''." +"join(sequence)``. To add floating-point values with extended precision, " +"see :func:`math.fsum`\\. To concatenate a series of iterables, consider " +"using :func:`itertools.chain`." msgstr "" #: ../../library/functions.rst:1967 @@ -3388,17 +3378,17 @@ msgstr "" #: ../../library/functions.rst:1989 msgid "" -"For example, if :attr:`~type.__mro__` of *object_or_type* is ``D -> B -> C " -"-> A -> object`` and the value of *type* is ``B``, then :func:`super` " +"For example, if :attr:`~type.__mro__` of *object_or_type* is ``D -> B -> C -" +"> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" #: ../../library/functions.rst:1993 msgid "" "The :attr:`~type.__mro__` attribute of the class corresponding to " -"*object_or_type* lists the method resolution search order used by " -"both :func:`getattr` and :func:`super`. The attribute is dynamic and can " -"change whenever the inheritance hierarchy is updated." +"*object_or_type* lists the method resolution search order used by both :func:" +"`getattr` and :func:`super`. The attribute is dynamic and can change " +"whenever the inheritance hierarchy is updated." msgstr "" #: ../../library/functions.rst:1998 @@ -3481,15 +3471,15 @@ msgstr "" #: ../../library/functions.rst:2051 msgid "" -"For practical suggestions on how to design cooperative classes " -"using :func:`super`, see `guide to using super() `_." +"For practical suggestions on how to design cooperative classes using :func:" +"`super`, see `guide to using super() `_." msgstr "" #: ../../library/functions.rst:2055 msgid "" -":class:`super` objects are now :mod:`pickleable ` " -"and :mod:`copyable `." +":class:`super` objects are now :mod:`pickleable ` and :mod:" +"`copyable `." msgstr "" #: ../../library/functions.rst:2064 @@ -3501,8 +3491,8 @@ msgstr "" #: ../../library/functions.rst:2073 msgid "" "With one argument, return the type of an *object*. The return value is a " -"type object and generally the same object as returned " -"by :attr:`object.__class__`." +"type object and generally the same object as returned by :attr:`object." +"__class__`." msgstr "" #: ../../library/functions.rst:2077 @@ -3519,9 +3509,9 @@ msgid "" "tuple contains the base classes and becomes the :attr:`~type.__bases__` " "attribute; if empty, :class:`object`, the ultimate base of all classes, is " "added. The *dict* dictionary contains attribute and method definitions for " -"the class body; it may be copied or wrapped before becoming " -"the :attr:`~type.__dict__` attribute. The following two statements create " -"identical :class:`!type` objects:" +"the class body; it may be copied or wrapped before becoming the :attr:`~type." +"__dict__` attribute. The following two statements create identical :class:`!" +"type` objects:" msgstr "" #: ../../library/functions.rst:2095 @@ -3564,11 +3554,10 @@ msgstr "" #: ../../library/functions.rst:2117 msgid "" -"Objects such as modules and instances have an " -"updateable :attr:`~object.__dict__` attribute; however, other objects may " -"have write restrictions on their :attr:`!__dict__` attributes (for example, " -"classes use a :class:`types.MappingProxyType` to prevent direct dictionary " -"updates)." +"Objects such as modules and instances have an updateable :attr:`~object." +"__dict__` attribute; however, other objects may have write restrictions on " +"their :attr:`!__dict__` attributes (for example, classes use a :class:`types." +"MappingProxyType` to prevent direct dictionary updates)." msgstr "" #: ../../library/functions.rst:2122 @@ -3623,15 +3612,15 @@ msgstr "" #: ../../library/functions.rst:2151 msgid "" "Another way to think of :func:`zip` is that it turns rows into columns, and " -"columns into rows. This is similar to `transposing a matrix `_." +"columns into rows. This is similar to `transposing a matrix `_." msgstr "" #: ../../library/functions.rst:2155 msgid "" ":func:`zip` is lazy: The elements won't be processed until the iterable is " -"iterated on, e.g. by a :keyword:`!for` loop or by wrapping in " -"a :class:`list`." +"iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" +"`list`." msgstr "" #: ../../library/functions.rst:2159 @@ -3688,8 +3677,8 @@ msgstr "" #: ../../library/functions.rst:2200 msgid "" "Shorter iterables can be padded with a constant value to make all the " -"iterables have the same length. This is done " -"by :func:`itertools.zip_longest`." +"iterables have the same length. This is done by :func:`itertools." +"zip_longest`." msgstr "" #: ../../library/functions.rst:2204 diff --git a/library/functools.po b/library/functools.po index b803598b20..67f9a1ecb0 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2024-05-11 16:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -147,9 +147,9 @@ msgstr "" #: ../../library/functools.rst:81 msgid "" -"The mechanics of :func:`cached_property` are somewhat different " -"from :func:`property`. A regular property blocks attribute writes unless a " -"setter is defined. In contrast, a *cached_property* allows writes." +"The mechanics of :func:`cached_property` are somewhat different from :func:" +"`property`. A regular property blocks attribute writes unless a setter is " +"defined. In contrast, a *cached_property* allows writes." msgstr "" ":func:`cached_property` 的機制與 :func:`property` 有所不同。除非定義了 " "setter,否則常規屬性會阻止屬性的寫入。相反地,*cached_property* 則允許寫入。" @@ -218,8 +218,8 @@ msgid "" "If a mutable mapping is not available or if space-efficient key sharing is " "desired, an effect similar to :func:`cached_property` can also be achieved " "by stacking :func:`property` on top of :func:`lru_cache`. See :ref:`faq-" -"cache-method-calls` for more details on how this differs " -"from :func:`cached_property`." +"cache-method-calls` for more details on how this differs from :func:" +"`cached_property`." msgstr "" "如果可變對映不可用或需要金鑰共享以節省空間,則也可以透過在 :func:`lru_cache` " "之上堆疊 :func:`property` 來實作類似於 :func:`cached_property` 的效果。請參閱" @@ -242,15 +242,16 @@ msgstr "" #: ../../library/functools.rst:130 msgid "" "Transform an old-style comparison function to a :term:`key function`. Used " -"with tools that accept key functions (such " -"as :func:`sorted`, :func:`min`, :func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`, :func:`itertools.groupby`). " -"This function is primarily used as a transition tool for programs being " -"converted from Python 2 which supported the use of comparison functions." +"with tools that accept key functions (such as :func:`sorted`, :func:`min`, :" +"func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`, :func:" +"`itertools.groupby`). This function is primarily used as a transition tool " +"for programs being converted from Python 2 which supported the use of " +"comparison functions." msgstr "" "將舊式比較函式轉換為\\ :term:`鍵函式 `,能與接受鍵函式的工具一" -"起使用(例" -"如 :func:`sorted`、:func:`min`、:func:`max`、:func:`heapq.nlargest`、:func:`heapq.nsmallest`、:func:`itertools.groupby`)。" -"此函式主要作為轉換工具,用於從有支援使用比較函式的 Python 2 轉換成的程式。" +"起使用(例如 :func:`sorted`、:func:`min`、:func:`max`、:func:`heapq." +"nlargest`、:func:`heapq.nsmallest`、:func:`itertools.groupby`)。此函式主要作" +"為轉換工具,用於從有支援使用比較函式的 Python 2 轉換成的程式。" #: ../../library/functools.rst:137 msgid "" @@ -380,9 +381,9 @@ msgstr "裝飾器還提供了一個 :func:`!cache_clear` 函式來清除或使 #: ../../library/functools.rst:216 msgid "" -"The original underlying function is accessible through " -"the :attr:`__wrapped__` attribute. This is useful for introspection, for " -"bypassing the cache, or for rewrapping the function with a different cache." +"The original underlying function is accessible through the :attr:" +"`__wrapped__` attribute. This is useful for introspection, for bypassing " +"the cache, or for rewrapping the function with a different cache." msgstr "" "原本的底層函式可以透過 :attr:`__wrapped__` 屬性存取。這對於要自我檢查 " "(introspection)、繞過快取或使用不同的快取重新包裝函式時非常有用。" @@ -412,11 +413,10 @@ msgid "" "long-running processes such as web servers." msgstr "" "當最近的呼叫是即將發生之呼叫的最佳預測因子時(例如新聞伺服器上最受歡迎的文章" -"往往每天都會發生變化),`LRU (least recently used) 快取 `_\\ 能發揮最好的效果。" -"快取的大小限制可確保快取不會在長時間運行的行程(例如 Web 伺服器)上無限制地成" -"長。" +"往往每天都會發生變化),`LRU (least recently used) 快取 `_\\ " +"能發揮最好的效果。快取的大小限制可確保快取不會在長時間運行的行程(例如 Web 伺" +"服器)上無限制地成長。" #: ../../library/functools.rst:233 msgid "" @@ -472,10 +472,9 @@ msgstr "" #: ../../library/functools.rst:258 msgid "" -"Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a " -"`dynamic programming `_ " -"technique::" +"Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " +"programming `_ technique::" msgstr "" "使用快取來實作\\ `動態規劃 (dynamic programming) `_ 技法以有效率地計算\\ `費波那契數 (Fibonacci " @@ -530,15 +529,13 @@ msgstr "" #: ../../library/functools.rst:293 msgid "" -"The class must define one " -"of :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__`, " -"or :meth:`~object.__ge__`. In addition, the class should supply " -"an :meth:`~object.__eq__` method." +"The class must define one of :meth:`~object.__lt__`, :meth:`~object." +"__le__`, :meth:`~object.__gt__`, or :meth:`~object.__ge__`. In addition, the " +"class should supply an :meth:`~object.__eq__` method." msgstr "" -"類別必須定" -"義 :meth:`~object.__lt__`、:meth:`~object.__le__`、:meth:`~object.__gt__` " -"或 :meth:`~object.__ge__` 其中之一。此外,該類別應該提" -"供 :meth:`~object.__eq__` 方法。" +"類別必須定義 :meth:`~object.__lt__`、:meth:`~object.__le__`、:meth:`~object." +"__gt__` 或 :meth:`~object.__ge__` 其中之一。此外,該類別應該提供 :meth:" +"`~object.__eq__` 方法。" #: ../../library/functools.rst:299 msgid "" @@ -692,11 +689,10 @@ msgstr "" #: ../../library/functools.rst:392 msgid "" -"If :func:`!partial` is applied to an existing :func:`!partial` " -"object, :data:`!Placeholder` sentinels of the input object are filled in " -"with new positional arguments. A placeholder can be retained by inserting a " -"new :data:`!Placeholder` sentinel to the place held by a previous :data:`!" -"Placeholder`:" +"If :func:`!partial` is applied to an existing :func:`!partial` object, :data:" +"`!Placeholder` sentinels of the input object are filled in with new " +"positional arguments. A placeholder can be retained by inserting a new :data:" +"`!Placeholder` sentinel to the place held by a previous :data:`!Placeholder`:" msgstr "" #: ../../library/functools.rst:398 @@ -726,12 +722,12 @@ msgstr "" #: ../../library/functools.rst:419 msgid "" -"Return a new :class:`partialmethod` descriptor which behaves " -"like :class:`partial` except that it is designed to be used as a method " -"definition rather than being directly callable." +"Return a new :class:`partialmethod` descriptor which behaves like :class:" +"`partial` except that it is designed to be used as a method definition " +"rather than being directly callable." msgstr "" -"回傳一個新的 :class:`partialmethod` 描述器 (descriptor),其行為類似" -"於 :class:`partial`,只不過它被設計為用於方法定義而不能直接呼叫。" +"回傳一個新的 :class:`partialmethod` 描述器 (descriptor),其行為類似於 :class:" +"`partial`,只不過它被設計為用於方法定義而不能直接呼叫。" #: ../../library/functools.rst:423 msgid "" @@ -743,25 +739,24 @@ msgstr "" #: ../../library/functools.rst:426 msgid "" -"When *func* is a descriptor (such as a normal Python " -"function, :func:`classmethod`, :func:`staticmethod`, :func:`~abc.abstractmethod` " -"or another instance of :class:`partialmethod`), calls to ``__get__`` are " -"delegated to the underlying descriptor, and an appropriate :ref:`partial " -"object` returned as the result." +"When *func* is a descriptor (such as a normal Python function, :func:" +"`classmethod`, :func:`staticmethod`, :func:`~abc.abstractmethod` or another " +"instance of :class:`partialmethod`), calls to ``__get__`` are delegated to " +"the underlying descriptor, and an appropriate :ref:`partial object` returned as the result." msgstr "" -"當 *func* 是描述器時(例如普通的 Python 函" -"式、:func:`classmethod`、:func:`staticmethod`、:func:`~abc.abstractmethod` " -"或 :class:`partialmethod` 的另一個實例),對 ``__get__`` 的呼叫將被委託 " -"(delegated) 給底層描述器,且一個適當的 :ref:`partial 物件 `\\ 會被作為結果回傳。" +"當 *func* 是描述器時(例如普通的 Python 函式、:func:`classmethod`、:func:" +"`staticmethod`、:func:`~abc.abstractmethod` 或 :class:`partialmethod` 的另一" +"個實例),對 ``__get__`` 的呼叫將被委託 (delegated) 給底層描述器,且一個適當" +"的 :ref:`partial 物件 `\\ 會被作為結果回傳。" #: ../../library/functools.rst:432 msgid "" "When *func* is a non-descriptor callable, an appropriate bound method is " "created dynamically. This behaves like a normal Python function when used as " "a method: the *self* argument will be inserted as the first positional " -"argument, even before the *args* and *keywords* supplied to " -"the :class:`partialmethod` constructor." +"argument, even before the *args* and *keywords* supplied to the :class:" +"`partialmethod` constructor." msgstr "" "當 *func* 是非描述器可呼叫物件 (non-descriptor callable) 時,會動態建立適當的" "繫結方法 (bound method)。當被作為方法使用時,其行為類似於普通的 Python 函式:" @@ -869,8 +864,8 @@ msgstr "" #: ../../library/functools.rst:494 msgid "" -"Transform a function into a :term:`single-dispatch ` :term:`generic function`." +"Transform a function into a :term:`single-dispatch ` :term:" +"`generic function`." msgstr "" "將函式轉換為\\ :term:`單一調度 `\\ :term:`泛型函式 `。" @@ -1036,8 +1031,8 @@ msgid "" "the :func:`~singledispatch.register` attribute can also be used in a " "functional form::" msgstr "" -"若要啟用註冊 :term:`lambdas` 和預先存在的函" -"式,:func:`~singledispatch.register` 屬性也能以函式形式使用: ::" +"若要啟用註冊 :term:`lambdas` 和預先存在的函式,:func:" +"`~singledispatch.register` 屬性也能以函式形式使用: ::" #: ../../library/functools.rst:579 msgid "" @@ -1129,13 +1124,13 @@ msgstr "" msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " -"function decorated with ``@singledispatch`` is registered for the " -"base :class:`object` type, which means it is used if no better " -"implementation is found." +"function decorated with ``@singledispatch`` is registered for the base :" +"class:`object` type, which means it is used if no better implementation is " +"found." msgstr "" "如果沒有為特定型別註冊實作,則使用其方法解析順序 (method resolution order) 來" -"尋找更通用的實作。用 ``@singledispatch`` 裝飾的原始函式是為基" -"底 :class:`object` 型別註冊的,這意味著如果沒有找到更好的實作就會使用它。" +"尋找更通用的實作。用 ``@singledispatch`` 裝飾的原始函式是為基底 :class:" +"`object` 型別註冊的,這意味著如果沒有找到更好的實作就會使用它。" #: ../../library/functools.rst:624 msgid "" @@ -1219,14 +1214,16 @@ msgstr ":func:`~singledispatch.register` 屬性現在支援使用型別註釋。 #: ../../library/functools.rst:664 msgid "" -"The :func:`~singledispatch.register` attribute now " -"supports :class:`typing.Union` as a type annotation." -msgstr ":func:`~singledispatch.register` 屬性現在支援使用 :class:`typing.Union` 型別註釋。" +"The :func:`~singledispatch.register` attribute now supports :class:`typing." +"Union` as a type annotation." +msgstr "" +":func:`~singledispatch.register` 屬性現在支援使用 :class:`typing.Union` 型別" +"註釋。" #: ../../library/functools.rst:671 msgid "" -"Transform a method into a :term:`single-dispatch ` :term:`generic function`." +"Transform a method into a :term:`single-dispatch ` :term:" +"`generic function`." msgstr "" "將方法轉換為\\ :term:`單一調度 `\\ :term:`泛型函式 `。" @@ -1271,16 +1268,17 @@ msgstr "" " return not arg" #: ../../library/functools.rst:692 +#, fuzzy msgid "" -"``@singledispatchmethod`` supports nesting with other decorators such " -"as :func:`@classmethod`. Note that to allow for " -"``dispatcher.register``, ``singledispatchmethod`` must be the *outer most* " -"decorator. Here is the ``Negator`` class with the ``neg`` methods bound to " -"the class, rather than an instance of the class::" +"``@singledispatchmethod`` supports nesting with other decorators such as :" +"deco:`classmethod`. Note that to allow for ``dispatcher.register``, " +"``singledispatchmethod`` must be the *outer most* decorator. Here is the " +"``Negator`` class with the ``neg`` methods bound to the class, rather than " +"an instance of the class::" msgstr "" -"``@singledispatchmethod`` 支援與其他裝飾器巢狀使用 (nesting),例" -"如 :func:`@classmethod`。請注意,為了使 ``dispatcher.register`` " -"可用,``singledispatchmethod`` 必須是\\ *最外面的*\\ 裝飾器。以下範例是 " +"``@singledispatchmethod`` 支援與其他裝飾器巢狀使用 (nesting),例如 :func:" +"`@classmethod`。請注意,為了使 ``dispatcher.register`` 可用," +"``singledispatchmethod`` 必須是\\ *最外面的*\\ 裝飾器。以下範例是 " "``Negator`` 類別,其 ``neg`` 方法繫結到該類別,而不是該類別的實例: ::" #: ../../library/functools.rst:698 @@ -1318,16 +1316,15 @@ msgstr "" " return not arg" #: ../../library/functools.rst:714 +#, fuzzy msgid "" -"The same pattern can be used for other similar " -"decorators: :func:`@staticmethod`, :func:`@abstractmethod`, " -"and others." +"The same pattern can be used for other similar decorators: :deco:" +"`staticmethod`, :deco:`~abc.abstractmethod`, and others." msgstr "" -"相同的模式可用於其他類似的裝飾" -"器::func:`@staticmethod`、:func:`@abstractmethod` " -"等。" +"相同的模式可用於其他類似的裝飾器::func:`@staticmethod`、:func:" +"`@abstractmethod` 等。" -#: ../../library/functools.rst:723 +#: ../../library/functools.rst:722 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -1335,21 +1332,23 @@ msgid "" "function and which attributes of the wrapper function are updated with the " "corresponding attributes from the original function. The default values for " "these arguments are the module level constants ``WRAPPER_ASSIGNMENTS`` " -"(which assigns to the wrapper " -"function's :attr:`~function.__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function.__annotations__`, :attr:`~function.__type_params__`, " -"and :attr:`~function.__doc__`, the documentation string) and " -"``WRAPPER_UPDATES`` (which updates the wrapper " -"function's :attr:`~function.__dict__`, i.e. the instance dictionary)." +"(which assigns to the wrapper function's :attr:`~function.__module__`, :attr:" +"`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function." +"__annotations__`, :attr:`~function.__type_params__`, and :attr:`~function." +"__doc__`, the documentation string) and ``WRAPPER_UPDATES`` (which updates " +"the wrapper function's :attr:`~function.__dict__`, i.e. the instance " +"dictionary)." msgstr "" "更新 *wrapper* 函式,使其看起來像 *wrapped* 函式。可選引數是元組,用於指定原" "始函式的哪些屬性直接賦值給包裝函式上的匹配屬性,以及包裝函式的哪些屬性使用原" "始函式中的對應屬性進行更新。這些引數的預設值是模組層級的常數 " -"``WRAPPER_ASSIGNMENTS``\\ (它賦值給包裝函式" -"的 :attr:`~function.__module__`、:attr:`~function.__name__`、:attr:`~function.__qualname__`、:attr:`~function.__annotations__`、:attr:`~function.__type_params__` " -"和 :attr:`~function.__doc__` 文件字串 (docstring))和 ``WRAPPER_UPDATES``\\ " -"(更新包裝器函式的 :attr:`~function.__dict__`,即實例字典)。" +"``WRAPPER_ASSIGNMENTS``\\ (它賦值給包裝函式的 :attr:`~function." +"__module__`、:attr:`~function.__name__`、:attr:`~function.__qualname__`、:" +"attr:`~function.__annotations__`、:attr:`~function.__type_params__` 和 :attr:" +"`~function.__doc__` 文件字串 (docstring))和 ``WRAPPER_UPDATES``\\ (更新包" +"裝器函式的 :attr:`~function.__dict__`,即實例字典)。" -#: ../../library/functools.rst:735 +#: ../../library/functools.rst:734 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -1360,7 +1359,7 @@ msgstr "" "飾器,如 :func:`lru_cache`),此函式會自動向包裝器新增 ``__wrapped__`` 屬性," "該包裝器參照被包裝的函式。" -#: ../../library/functools.rst:740 +#: ../../library/functools.rst:739 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -1372,7 +1371,7 @@ msgstr "" "裝器函式未更新,則回傳函式的元資料 (metadata) 將反映包裝器定義而非原始函式定" "義,這通常不太會有幫助。" -#: ../../library/functools.rst:746 +#: ../../library/functools.rst:745 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -1385,31 +1384,30 @@ msgstr "" "器函式上設定它們)。如果包裝函式本身缺少 *updated* 中指定的任何屬性,仍然會引" "發 :exc:`AttributeError`。" -#: ../../library/functools.rst:752 +#: ../../library/functools.rst:751 msgid "" -"The ``__wrapped__`` attribute is now automatically added. " -"The :attr:`~function.__annotations__` attribute is now copied by default. " -"Missing attributes no longer trigger an :exc:`AttributeError`." +"The ``__wrapped__`` attribute is now automatically added. The :attr:" +"`~function.__annotations__` attribute is now copied by default. Missing " +"attributes no longer trigger an :exc:`AttributeError`." msgstr "" -"現在會自動新增 ``__wrapped__`` 屬性。現在預設會複" -"製 :attr:`~function.__annotations__` 屬性。缺少的屬性不再觸" -"發 :exc:`AttributeError`。" +"現在會自動新增 ``__wrapped__`` 屬性。現在預設會複製 :attr:`~function." +"__annotations__` 屬性。缺少的屬性不再觸發 :exc:`AttributeError`。" -#: ../../library/functools.rst:757 +#: ../../library/functools.rst:756 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " -"even if that function defined a ``__wrapped__`` attribute. " -"(see :issue:`17482`)" +"even if that function defined a ``__wrapped__`` attribute. (see :issue:" +"`17482`)" msgstr "" "``__wrapped__`` 屬性現在都會參照包裝函式,即便函式有定義 ``__wrapped__`` 屬" "性。(參見 :issue:`17482`)" -#: ../../library/functools.rst:762 +#: ../../library/functools.rst:761 msgid "" "The :attr:`~function.__type_params__` attribute is now copied by default." msgstr "現在預設會複製 :attr:`~function.__type_params__` 屬性。" -#: ../../library/functools.rst:768 +#: ../../library/functools.rst:767 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -1420,7 +1418,7 @@ msgstr "" "式裝飾器。它相當於 ``partial(update_wrapper, wrapped=wrapped, " "assigned=assigned, updated=updated)``。例如: ::" -#: ../../library/functools.rst:773 +#: ../../library/functools.rst:772 msgid "" ">>> from functools import wraps\n" ">>> def my_decorator(f):\n" @@ -1444,7 +1442,7 @@ msgid "" "'Docstring'" msgstr "" -#: ../../library/functools.rst:794 +#: ../../library/functools.rst:793 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:`!" @@ -1453,11 +1451,11 @@ msgstr "" "如果不使用這個裝飾器工廠 (decorator factory),範例函式的名稱將會是 " "``'wrapper'``,並且原始 :func:`!example` 的文件字串將會遺失。" -#: ../../library/functools.rst:802 +#: ../../library/functools.rst:801 msgid ":class:`partial` Objects" msgstr ":class:`partial` 物件" -#: ../../library/functools.rst:804 +#: ../../library/functools.rst:803 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" @@ -1465,7 +1463,7 @@ msgstr "" ":class:`partial` 物件是由 :func:`partial` 所建立的可呼叫物件。它們有三個唯讀" "屬性:" -#: ../../library/functools.rst:810 +#: ../../library/functools.rst:809 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." @@ -1473,7 +1471,7 @@ msgstr "" "一個可呼叫的物件或函式。對 :class:`partial` 物件的呼叫將被轉送到帶有新引數和" "關鍵字的 :attr:`func`。" -#: ../../library/functools.rst:816 +#: ../../library/functools.rst:815 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." @@ -1481,21 +1479,21 @@ msgstr "" "最左邊的位置引數將會被加入到提供給 :class:`partial` 物件呼叫的位置引數的前" "面。" -#: ../../library/functools.rst:822 +#: ../../library/functools.rst:821 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "呼叫 :class:`partial` 物件時將提供的關鍵字引數。" -#: ../../library/functools.rst:825 +#: ../../library/functools.rst:824 msgid "" ":class:`partial` objects are like :ref:`function objects ` in that they are callable, weak referenceable, and can have " -"attributes. There are some important differences. For instance, " -"the :attr:`~definition.__name__` and :attr:`~definition.__doc__` attributes " -"are not created automatically." +"attributes. There are some important differences. For instance, the :attr:" +"`~definition.__name__` and :attr:`~definition.__doc__` attributes are not " +"created automatically." msgstr "" ":class:`partial` 物件與\\ :ref:`函式物件 `\\ 類似,因為它" -"們是可呼叫的、可弱參照的 (weak referencable) 且可以具有屬性的。但有一些重要的區" -"別,例如,:attr:`~definition.__name__` 和 :attr:`~definition.__doc__` 屬性不會自動" -"建立。" +"們是可呼叫的、可弱參照的 (weak referencable) 且可以具有屬性的。但有一些重要的" +"區別,例如,:attr:`~definition.__name__` 和 :attr:`~definition.__doc__` 屬性" +"不會自動建立。" diff --git a/library/gc.po b/library/gc.po index 9d53e9812a..a75ea55117 100644 --- a/library/gc.po +++ b/library/gc.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-29 00:15+0000\n" "PO-Revision-Date: 2023-04-24 21:25+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,9 +69,9 @@ msgid "" "is raised if the generation number is invalid. The sum of collected objects " "and uncollectable objects is returned." msgstr "" -"啟動垃圾回收。可選的引數 *generation* 可以是一個指" -"明需要回收哪一代垃圾的整數(從 0 到 2)。當 generation 數值無效時,會引" -"發 :exc:`ValueError` 例外。可回收物件與不可回收物件的總和會被回傳。" +"啟動垃圾回收。可選的引數 *generation* 可以是一個指明需要回收哪一代垃圾的整數" +"(從 0 到 2)。當 generation 數值無效時,會引發 :exc:`ValueError` 例外。可回" +"收物件與不可回收物件的總和會被回傳。" #: ../../library/gc.rst:48 msgid "" @@ -187,8 +187,8 @@ msgid "" "uncollectable (and were therefore moved to the :data:`garbage` list) inside " "this generation." msgstr "" -"``uncollectable`` 是在這一代中被發現無法回收的物件總數(因此被移" -"到 :data:`garbage` list 中)。" +"``uncollectable`` 是在這一代中被發現無法回收的物件總數(因此被移到 :data:" +"`garbage` list 中)。" #: ../../library/gc.rst:118 msgid "" @@ -234,8 +234,8 @@ msgstr "" #: ../../library/gc.rst:143 msgid "" -"See `Garbage collector design `_ for more information." +"See `Garbage collector design `_ for more information." msgstr "" #: ../../library/gc.rst:145 @@ -292,35 +292,34 @@ msgid "" "Raises an :ref:`auditing event ` ``gc.get_referrers`` with " "argument ``objs``." msgstr "" -"引發一個附帶引數 ``objs`` 的\\ :ref:`稽核事件 ` " -"``gc.get_referrers``。" +"引發一個附帶引數 ``objs`` 的\\ :ref:`稽核事件 ` ``gc." +"get_referrers``。" #: ../../library/gc.rst:184 msgid "" "Return a list of objects directly referred to by any of the arguments. The " -"referents returned are those objects visited by the arguments' C-" -"level :c:member:`~PyTypeObject.tp_traverse` methods (if any), and may not be " -"all objects actually directly " -"reachable. :c:member:`~PyTypeObject.tp_traverse` methods are supported only " -"by objects that support garbage collection, and are only required to visit " -"objects that may be involved in a cycle. So, for example, if an integer is " -"directly reachable from an argument, that integer object may or may not " -"appear in the result list." +"referents returned are those objects visited by the arguments' C-level :c:" +"member:`~PyTypeObject.tp_traverse` methods (if any), and may not be all " +"objects actually directly reachable. :c:member:`~PyTypeObject.tp_traverse` " +"methods are supported only by objects that support garbage collection, and " +"are only required to visit objects that may be involved in a cycle. So, for " +"example, if an integer is directly reachable from an argument, that integer " +"object may or may not appear in the result list." msgstr "" "回傳包含被任意一個引數直接參照之物件的 list。回傳的被參照物件是有被引數的 C " "語言級別 :c:member:`~PyTypeObject.tp_traverse` 方法(若存在)瀏覽到的物件,可" -"能不是所有的實際直接可達物件。只有支援垃圾回收的物件支" -"援 :c:member:`~PyTypeObject.tp_traverse` 方法,並且此方法只會瀏覽涉及參照迴圈" -"的物件。因此,可以有以下例子:一個整數對於一個引數是直接可達的,這個整數物件" -"有可能出現或不出現在結果的 list 當中。" +"能不是所有的實際直接可達物件。只有支援垃圾回收的物件支援 :c:member:" +"`~PyTypeObject.tp_traverse` 方法,並且此方法只會瀏覽涉及參照迴圈的物件。因" +"此,可以有以下例子:一個整數對於一個引數是直接可達的,這個整數物件有可能出現" +"或不出現在結果的 list 當中。" #: ../../library/gc.rst:192 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referents`` with " "argument ``objs``." msgstr "" -"引發一個附帶引數 ``objs`` 的\\ :ref:`稽核事件 ` " -"``gc.get_referents``。" +"引發一個附帶引數 ``objs`` 的\\ :ref:`稽核事件 ` ``gc." +"get_referents``。" #: ../../library/gc.rst:196 msgid "" @@ -417,9 +416,9 @@ msgstr "" "如果一個行程將在沒有 ``exec()`` 的情況下進行 ``fork()``,避免子行程中不必要的" "寫入時複製將最大化記憶體共享並減少整體記憶體使用。這需要避免在父行程的記憶體" "頁面中建立已釋放的「漏洞」,並確保子行程中的 GC 收集不會觸及源自父行程的長壽" -"命物件的 ``gc_refs`` 計數器。要實現這兩個目標,請在父行程的早期呼叫 " -"``gc.disable()``,在 ``fork()`` 之前呼叫 ``gc.freeze()``,並儘早在子行程中呼" -"叫 ``gc.enable()``。" +"命物件的 ``gc_refs`` 計數器。要實現這兩個目標,請在父行程的早期呼叫 ``gc." +"disable()``,在 ``fork()`` 之前呼叫 ``gc.freeze()``,並儘早在子行程中呼叫 " +"``gc.enable()``。" #: ../../library/gc.rst:257 msgid "" @@ -458,22 +457,22 @@ msgstr "" #: ../../library/gc.rst:283 msgid "" -"If this list is non-empty at :term:`interpreter shutdown`, " -"a :exc:`ResourceWarning` is emitted, which is silent by default. " -"If :const:`DEBUG_UNCOLLECTABLE` is set, in addition all uncollectable " -"objects are printed." +"If this list is non-empty at :term:`interpreter shutdown`, a :exc:" +"`ResourceWarning` is emitted, which is silent by default. If :const:" +"`DEBUG_UNCOLLECTABLE` is set, in addition all uncollectable objects are " +"printed." msgstr "" -"當 :term:`interpreter shutdown` 即直譯器關閉時,若此 list 非空,會產" -"生 :exc:`ResourceWarning`,在預設情況下此警告不會被提醒。如果設定" -"了 :const:`DEBUG_UNCOLLECTABLE`,所有無法被回收的物件會被印出。" +"當 :term:`interpreter shutdown` 即直譯器關閉時,若此 list 非空,會產生 :exc:" +"`ResourceWarning`,在預設情況下此警告不會被提醒。如果設定了 :const:" +"`DEBUG_UNCOLLECTABLE`,所有無法被回收的物件會被印出。" #: ../../library/gc.rst:289 msgid "" "Following :pep:`442`, objects with a :meth:`~object.__del__` method don't " "end up in :data:`gc.garbage` anymore." msgstr "" -"根據 :pep:`442`,帶有 :meth:`~object.__del__` method 的物件最終不會" -"在 :data:`gc.garbage` 內。" +"根據 :pep:`442`,帶有 :meth:`~object.__del__` method 的物件最終不會在 :data:" +"`gc.garbage` 內。" #: ../../library/gc.rst:295 msgid "" diff --git a/library/hashlib.po b/library/hashlib.po index 9c32394b8f..91b8e4ca77 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-24 05:58+0000\n" +"POT-Creation-Date: 2025-10-03 00:13+0000\n" "PO-Revision-Date: 2024-05-11 16:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,8 +43,8 @@ msgstr "" #: ../../library/hashlib.rst:31 msgid "" -"If you want the adler32 or crc32 hash functions, they are available in " -"the :mod:`zlib` module." +"If you want the adler32 or crc32 hash functions, they are available in the :" +"mod:`zlib` module." msgstr "" "如果你需要 adler32 或 crc32 雜湊函式,可以在 :mod:`zlib` 模組中找到它們。" @@ -55,13 +55,13 @@ msgstr "雜湊演算法" #: ../../library/hashlib.rst:40 msgid "" "There is one constructor method named for each type of :dfn:`hash`. All " -"return a hash object with the same simple interface. For example: " -"use :func:`sha256` to create a SHA-256 hash object. You can now feed this " -"object with :term:`bytes-like objects ` " -"(normally :class:`bytes`) using the :meth:`update` method. At " -"any point you can ask it for the :dfn:`digest` of the concatenation of the " -"data fed to it so far using the :meth:`digest()` " -"or :meth:`hexdigest()` methods." +"return a hash object with the same simple interface. For example: use :func:" +"`sha256` to create a SHA-256 hash object. You can now feed this object with :" +"term:`bytes-like objects ` (normally :class:`bytes`) " +"using the :meth:`update` method. At any point you can ask it " +"for the :dfn:`digest` of the concatenation of the data fed to it so far " +"using the :meth:`digest()` or :meth:`hexdigest()` methods." msgstr "" "每種種類的 :dfn:`hash` 都有一個以其命名的建構函式方法。全部都會回傳具有相同簡" "單介面的雜湊物件。例如:可使用 :func:`sha256` 來建立 SHA-256 雜湊物件。現在你" @@ -74,8 +74,8 @@ msgstr "" #: ../../library/hashlib.rst:48 msgid "" "To allow multithreading, the Python :term:`GIL` is released while computing " -"a hash supplied more than 2047 bytes of data at once in its constructor " -"or :meth:`.update` method." +"a hash supplied more than 2047 bytes of data at once in its constructor or :" +"meth:`.update` method." msgstr "" "為了允許多執行緒 (multithreading),Python :term:`GIL` 被釋放,同時在其建構函" "式或 :meth:`.update` 方法中計算一次提供超過 2047 位元組資料的雜" @@ -83,25 +83,27 @@ msgstr "" #: ../../library/hashlib.rst:55 msgid "" -"Constructors for hash algorithms that are always present in this module " -"are :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:`sha512`, :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256`, :func:`blake2b`, " -"and :func:`blake2s`. :func:`md5` is normally available as well, though it " -"may be missing or blocked if you are using a rare \"FIPS compliant\" build " -"of Python. These correspond to :data:`algorithms_guaranteed`." -msgstr "" -"此模組中始終存在的雜湊演算法之建構函式" -"有 :func:`sha1`、:func:`sha224`、:func:`sha256`、:func:`sha384`、:func:`sha512`、:func:`sha3_224`、:func:`sha3_256`、:func:`sha3_384`、:func:`sha3_512`、:func:`shake_128`、:func:`shake_256`、:func:`blake2b` " -"和 :func:`blake2s`。:func:`md5` 通常也可用,但如果你使用罕見的「符合 FIPS " -"(FIPS compliant)」的 Python 建置版本,它可能不存在或者不被允許使用。以上會對" -"應到 :data:`algorithms_guaranteed`。" +"Constructors for hash algorithms that are always present in this module are :" +"func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:" +"`sha512`, :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:" +"`sha3_512`, :func:`shake_128`, :func:`shake_256`, :func:`blake2b`, and :func:" +"`blake2s`. :func:`md5` is normally available as well, though it may be " +"missing or blocked if you are using a rare \"FIPS compliant\" build of " +"Python. These correspond to :data:`algorithms_guaranteed`." +msgstr "" +"此模組中始終存在的雜湊演算法之建構函式有 :func:`sha1`、:func:`sha224`、:func:" +"`sha256`、:func:`sha384`、:func:`sha512`、:func:`sha3_224`、:func:" +"`sha3_256`、:func:`sha3_384`、:func:`sha3_512`、:func:`shake_128`、:func:" +"`shake_256`、:func:`blake2b` 和 :func:`blake2s`。:func:`md5` 通常也可用,但如" +"果你使用罕見的「符合 FIPS (FIPS compliant)」的 Python 建置版本,它可能不存在" +"或者不被允許使用。以上會對應到 :data:`algorithms_guaranteed`。" #: ../../library/hashlib.rst:63 msgid "" -"Additional algorithms may also be available if your Python " -"distribution's :mod:`hashlib` was linked against a build of OpenSSL that " -"provides others. Others *are not guaranteed available* on all installations " -"and will only be accessible by name via :func:`new`. " -"See :data:`algorithms_available`." +"Additional algorithms may also be available if your Python distribution's :" +"mod:`hashlib` was linked against a build of OpenSSL that provides others. " +"Others *are not guaranteed available* on all installations and will only be " +"accessible by name via :func:`new`. See :data:`algorithms_available`." msgstr "" "如果你的 Python 發行版的 :mod:`hashlib` 與提供其他演算法的 OpenSSL 版本鏈結," "也可能有其他演算法可用。其他則\\ *不保證可用*\\ 於在所有安裝上,並且只能以名" @@ -119,13 +121,13 @@ msgstr "" #: ../../library/hashlib.rst:74 msgid "" -"SHA3 (Keccak) and SHAKE " -"constructors :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` " -"were added. :func:`blake2b` and :func:`blake2s` were added." +"SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`, :" +"func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` were " +"added. :func:`blake2b` and :func:`blake2s` were added." msgstr "" -"新增了 SHA3 (Keccak) 和 SHAKE 建構函" -"式 :func:`sha3_224`、:func:`sha3_256`、:func:`sha3_384`、:func:`sha3_512`、:func:`shake_128`、:func:`shake_256`。" -"也新增了 :func:`blake2b` 和 :func:`blake2s`。" +"新增了 SHA3 (Keccak) 和 SHAKE 建構函式 :func:`sha3_224`、:func:`sha3_256`、:" +"func:`sha3_384`、:func:`sha3_512`、:func:`shake_128`、:func:`shake_256`。也新" +"增了 :func:`blake2b` 和 :func:`blake2s`。" #: ../../library/hashlib.rst:82 msgid "" @@ -172,7 +174,8 @@ msgid "" ">>> m.update(b\" the spammish repetition\")\n" ">>> m.digest()\n" "b'\\x03\\x1e\\xdd}Ae\\x15\\x93\\xc5\\xfe\\\\" -"\\x00o\\xa5u+7\\xfd\\xdf\\xf7\\xbcN\\x84:\\xa6\\xaf\\x0c\\x95\\x0fK\\x94\\x06'\n" +"\\x00o\\xa5u+7\\xfd\\xdf\\xf7\\xbcN\\x84:" +"\\xa6\\xaf\\x0c\\x95\\x0fK\\x94\\x06'\n" ">>> m.hexdigest()\n" "'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'" msgstr "" @@ -182,7 +185,8 @@ msgstr "" ">>> m.update(b\" the spammish repetition\")\n" ">>> m.digest()\n" "b'\\x03\\x1e\\xdd}Ae\\x15\\x93\\xc5\\xfe\\\\" -"\\x00o\\xa5u+7\\xfd\\xdf\\xf7\\xbcN\\x84:\\xa6\\xaf\\x0c\\x95\\x0fK\\x94\\x06'\n" +"\\x00o\\xa5u+7\\xfd\\xdf\\xf7\\xbcN\\x84:" +"\\xa6\\xaf\\x0c\\x95\\x0fK\\x94\\x06'\n" ">>> m.hexdigest()\n" "'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'" @@ -236,14 +240,14 @@ msgstr "" #: ../../library/hashlib.rst:165 msgid "" "A set containing the names of the hash algorithms that are available in the " -"running Python interpreter. These names will be recognized when passed " -"to :func:`new`. :attr:`algorithms_guaranteed` will always be a subset. The " +"running Python interpreter. These names will be recognized when passed to :" +"func:`new`. :attr:`algorithms_guaranteed` will always be a subset. The " "same algorithm may appear multiple times in this set under different names " "(thanks to OpenSSL)." msgstr "" -"包含正在運行的 Python 直譯器中可用的雜湊演算法名稱的集合。這些名稱在傳遞" -"給 :func:`new` 時將被識別。:attr:`algorithms_guaranteed` 都會是它的一個子集。" -"相同的演算法可能會以不同的名稱多次出現在該集合中(多虧了 OpenSSL)。" +"包含正在運行的 Python 直譯器中可用的雜湊演算法名稱的集合。這些名稱在傳遞給 :" +"func:`new` 時將被識別。:attr:`algorithms_guaranteed` 都會是它的一個子集。相同" +"的演算法可能會以不同的名稱多次出現在該集合中(多虧了 OpenSSL)。" #: ../../library/hashlib.rst:174 msgid "Hash Objects" @@ -295,8 +299,8 @@ msgid "" "``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``." msgstr "" "使用\\ :term:`類位元組物件 `\\ 來更新雜湊物件。重複呼叫相" -"當於連接所有引數的單一呼叫:``m.update(a); m.update(b)`` 等價於 " -"``m.update(a+b)``。" +"當於連接所有引數的單一呼叫:``m.update(a); m.update(b)`` 等價於 ``m." +"update(a+b)``。" #: ../../library/hashlib.rst:212 msgid "" @@ -304,9 +308,8 @@ msgid "" "This is a bytes object of size :attr:`digest_size` which may contain bytes " "in the whole range from 0 to 255." msgstr "" -"回傳目前有傳遞給 :meth:`update` 方法的資料之摘要。這是一個大小" -"為 :attr:`digest_size` 的位元組物件,它可能包含從 0 到 255 的整個範圍內的位元" -"組。" +"回傳目前有傳遞給 :meth:`update` 方法的資料之摘要。這是一個大小為 :attr:" +"`digest_size` 的位元組物件,它可能包含從 0 到 255 的整個範圍內的位元組。" #: ../../library/hashlib.rst:219 msgid "" @@ -384,20 +387,20 @@ msgid "" "*fileobj* must be a file-like object opened for reading in binary mode. It " "accepts file objects from builtin :func:`open`, :class:`~io.BytesIO` " "instances, SocketIO objects from :meth:`socket.socket.makefile`, and " -"similar. *fileobj* must be opened in blocking mode, otherwise " -"a :exc:`BlockingIOError` may be raised." +"similar. *fileobj* must be opened in blocking mode, otherwise a :exc:" +"`BlockingIOError` may be raised." msgstr "" "*fileobj* 必須是以二進位模式讀取的類檔案物件。它接受來自內建 :func:`open` 的" "檔案物件、:class:`~io.BytesIO` 實例、來自 :meth:`socket.socket.makefile` 的 " -"SocketIO 物件等。*fileobj* 必須以阻塞模式開啟,否則可能會引" -"發 :exc:`BlockingIOError`。" +"SocketIO 物件等。*fileobj* 必須以阻塞模式開啟,否則可能會引發 :exc:" +"`BlockingIOError`。" #: ../../library/hashlib.rst:276 msgid "" -"The function may bypass Python's I/O and use the file descriptor " -"from :meth:`~io.IOBase.fileno` directly. *fileobj* must be assumed to be in " -"an unknown state after this function returns or raises. It is up to the " -"caller to close *fileobj*." +"The function may bypass Python's I/O and use the file descriptor from :meth:" +"`~io.IOBase.fileno` directly. *fileobj* must be assumed to be in an unknown " +"state after this function returns or raises. It is up to the caller to close " +"*fileobj*." msgstr "" "該函式可以繞過 Python 的 I/O 並直接使用 :meth:`~io.IOBase.fileno` 中的檔案描" "述器 (file descriptor)。在此函式回傳或引發後,必須假定 *fileobj* 處於未知狀" @@ -417,8 +420,8 @@ msgstr "範例:" #: ../../library/hashlib.rst:305 msgid "" -"Now raises a :exc:`BlockingIOError` if the file is opened in blocking mode. " -"Previously, spurious null bytes were added to the digest." +"Now raises a :exc:`BlockingIOError` if the file is opened in non-blocking " +"mode. Previously, spurious null bytes were added to the digest." msgstr "" #: ../../library/hashlib.rst:311 @@ -456,8 +459,8 @@ msgid "" msgstr "" "字串 *hash_name* 是 HMAC 的雜湊摘要演算法所需的名稱,例如 ``sha1`` 或 " "``sha256``。*password* 和 *salt* 被直譯為位元組緩衝區。應用程式和函式庫應為 " -"*password* 設下合理的長度限制(例如 1024)。*salt* 應該是來自適當來源(例" -"如 :func:`os.urandom`)且大約 16 或更多位元組。" +"*password* 設下合理的長度限制(例如 1024)。*salt* 應該是來自適當來源(例如 :" +"func:`os.urandom`)且大約 16 或更多位元組。" #: ../../library/hashlib.rst:330 msgid "" @@ -555,8 +558,8 @@ msgstr "" #: ../../library/hashlib.rst:392 msgid "" -"Hash objects from this module follow the API of standard " -"library's :mod:`hashlib` objects." +"Hash objects from this module follow the API of standard library's :mod:" +"`hashlib` objects." msgstr "該模組中的雜湊物件遵循標準函式庫的 :mod:`hashlib` 物件 API。" #: ../../library/hashlib.rst:397 @@ -770,17 +773,15 @@ msgstr "簡單雜湊" #: ../../library/hashlib.rst:513 msgid "" "To calculate hash of some data, you should first construct a hash object by " -"calling the appropriate constructor function (:func:`blake2b` " -"or :func:`blake2s`), then update it with the data by " -"calling :meth:`~hash.update` on the object, and, finally, get the digest out " -"of the object by calling :meth:`~hash.digest` (or :meth:`~hash.hexdigest` " -"for hex-encoded string)." +"calling the appropriate constructor function (:func:`blake2b` or :func:" +"`blake2s`), then update it with the data by calling :meth:`~hash.update` on " +"the object, and, finally, get the digest out of the object by calling :meth:" +"`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string)." msgstr "" "要計算某些資料的雜湊值,你應該首先透過呼叫適當的建構函式(:func:`blake2b` " -"或 :func:`blake2s`)以建構一個雜湊物件,然後透過於物件呼" -"叫 :meth:`~hash.update` 來以資料對它更新,最後透過呼" -"叫 :meth:`~hash.digest`\\ (或對於十六進位編碼字串則" -"為 :meth:`~hash.hexdigest`)從物件中獲得摘要。" +"或 :func:`blake2s`)以建構一個雜湊物件,然後透過於物件呼叫 :meth:`~hash." +"update` 來以資料對它更新,最後透過呼叫 :meth:`~hash.digest`\\ (或對於十六進" +"位編碼字串則為 :meth:`~hash.hexdigest`)從物件中獲得摘要。" #: ../../library/hashlib.rst:526 msgid "" @@ -826,9 +827,9 @@ msgstr "密鑰雜湊 (Keyed hashing)" #: ../../library/hashlib.rst:581 msgid "" "Keyed hashing can be used for authentication as a faster and simpler " -"replacement for `Hash-based message authentication code `_ (HMAC). BLAKE2 can be securely used in prefix-" -"MAC mode thanks to the indifferentiability property inherited from BLAKE." +"replacement for `Hash-based message authentication code `_ (HMAC). BLAKE2 can be securely used in prefix-MAC " +"mode thanks to the indifferentiability property inherited from BLAKE." msgstr "" "密鑰雜湊可用於身份驗證,作為\\ `基於雜湊的訊息驗證碼 (Hash-based message " "authentication code) `_ (HMAC) 的更快、" diff --git a/library/importlib.resources.po b/library/importlib.resources.po index dd268a9bdb..40d502c68f 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,18 +37,19 @@ msgid "" "\"Resources\" are file-like resources associated with a module or package in " "Python. The resources may be contained directly in a package, within a " "subdirectory contained in that package, or adjacent to modules outside a " -"package. Resources may be text or binary. As a result, Python module sources " -"(.py) of a package and compilation artifacts (pycache) are technically de-" -"facto resources of that package. In practice, however, resources are " -"primarily those non-Python artifacts exposed specifically by the package " -"author." +"package. Resources may be text or binary. As a result, a package's Python " +"module sources (.py), compilation artifacts (pycache), and installation " +"artifacts (like :func:`reserved filenames ` in " +"directories) are technically de-facto resources of that package. In " +"practice, however, resources are primarily those non-Python artifacts " +"exposed specifically by the package author." msgstr "" -#: ../../library/importlib.resources.rst:25 +#: ../../library/importlib.resources.rst:26 msgid "Resources can be opened or read in either binary or text mode." msgstr "" -#: ../../library/importlib.resources.rst:27 +#: ../../library/importlib.resources.rst:28 msgid "" "Resources are roughly akin to files inside directories, though it's " "important to keep in mind that this is just a metaphor. Resources and " @@ -57,7 +58,7 @@ msgid "" "zip file using :py:mod:`zipimport`." msgstr "" -#: ../../library/importlib.resources.rst:35 +#: ../../library/importlib.resources.rst:36 msgid "" "This module provides functionality similar to `pkg_resources `_ `Basic Resource " @@ -67,7 +68,7 @@ msgid "" "consistent semantics." msgstr "" -#: ../../library/importlib.resources.rst:43 +#: ../../library/importlib.resources.rst:44 msgid "" "The standalone backport of this module provides more information on `using " "importlib.resources `_." msgstr "" -#: ../../library/importlib.resources.rst:49 +#: ../../library/importlib.resources.rst:50 msgid "" ":class:`Loaders ` that wish to support resource " "reading should implement a ``get_resource_reader(fullname)`` method as " "specified by :class:`importlib.resources.abc.ResourceReader`." msgstr "" -#: ../../library/importlib.resources.rst:55 +#: ../../library/importlib.resources.rst:56 msgid "" -"Represents an anchor for resources, either a :class:`module object " -"` or a module name as a string. Defined as ``Union[str, " +"Represents an anchor for resources, either a :class:`module object ` or a module name as a string. Defined as ``Union[str, " "ModuleType]``." msgstr "" -#: ../../library/importlib.resources.rst:61 +#: ../../library/importlib.resources.rst:62 msgid "" "Returns a :class:`~importlib.resources.abc.Traversable` object representing " "the resource container (think directory) and its resources (think files). A " "Traversable may contain other containers (think subdirectories)." msgstr "" -#: ../../library/importlib.resources.rst:66 +#: ../../library/importlib.resources.rst:67 msgid "" "*anchor* is an optional :class:`Anchor`. If the anchor is a package, " "resources are resolved from that package. If a module, resources are " @@ -104,17 +105,16 @@ msgid "" "If the anchor is omitted, the caller's module is used." msgstr "" -#: ../../library/importlib.resources.rst:74 +#: ../../library/importlib.resources.rst:75 msgid "" "*package* parameter was renamed to *anchor*. *anchor* can now be a non-" "package module and if omitted will default to the caller's module. *package* " -"is still accepted for compatibility but will raise " -"a :exc:`DeprecationWarning`. Consider passing the anchor positionally or " -"using ``importlib_resources >= 5.10`` for a compatible interface on older " -"Pythons." +"is still accepted for compatibility but will raise a :exc:" +"`DeprecationWarning`. Consider passing the anchor positionally or using " +"``importlib_resources >= 5.10`` for a compatible interface on older Pythons." msgstr "" -#: ../../library/importlib.resources.rst:84 +#: ../../library/importlib.resources.rst:85 msgid "" "Given a :class:`~importlib.resources.abc.Traversable` object representing a " "file or directory, typically from :func:`importlib.resources.files`, return " @@ -122,61 +122,60 @@ msgid "" "manager provides a :class:`pathlib.Path` object." msgstr "" -#: ../../library/importlib.resources.rst:89 +#: ../../library/importlib.resources.rst:90 msgid "" "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 +#: ../../library/importlib.resources.rst:93 msgid "" "Use ``as_file`` when the Traversable methods (``read_text``, etc) are " "insufficient and an actual file or directory on the file system is required." msgstr "" -#: ../../library/importlib.resources.rst:98 +#: ../../library/importlib.resources.rst:99 msgid "Added support for *traversable* representing a directory." msgstr "" -#: ../../library/importlib.resources.rst:105 +#: ../../library/importlib.resources.rst:106 msgid "Functional API" msgstr "" -#: ../../library/importlib.resources.rst:107 +#: ../../library/importlib.resources.rst:108 msgid "" "A set of simplified, backwards-compatible helpers is available. These allow " "common operations in a single function call." msgstr "" -#: ../../library/importlib.resources.rst:110 +#: ../../library/importlib.resources.rst:111 msgid "For all the following functions:" msgstr "" -#: ../../library/importlib.resources.rst:112 +#: ../../library/importlib.resources.rst:113 msgid "" -"*anchor* is an :class:`~importlib.resources.Anchor`, as " -"in :func:`~importlib.resources.files`. Unlike in ``files``, it may not be " -"omitted." +"*anchor* is an :class:`~importlib.resources.Anchor`, as in :func:`~importlib." +"resources.files`. Unlike in ``files``, it may not be omitted." msgstr "" -#: ../../library/importlib.resources.rst:116 +#: ../../library/importlib.resources.rst:117 msgid "" "*path_names* are components of a resource's path name, relative to the " "anchor. For example, to get the text of resource named ``info.txt``, use::" msgstr "" -#: ../../library/importlib.resources.rst:120 +#: ../../library/importlib.resources.rst:121 msgid "importlib.resources.read_text(my_module, \"info.txt\")" msgstr "importlib.resources.read_text(my_module, \"info.txt\")" -#: ../../library/importlib.resources.rst:122 +#: ../../library/importlib.resources.rst:123 msgid "" "Like :meth:`Traversable.joinpath `, The " "individual components should use forward slashes (``/``) as path separators. " "For example, the following are equivalent::" msgstr "" -#: ../../library/importlib.resources.rst:127 +#: ../../library/importlib.resources.rst:128 msgid "" "importlib.resources.read_binary(my_module, \"pics/painting.png\")\n" "importlib.resources.read_binary(my_module, \"pics\", \"painting.png\")" @@ -184,14 +183,14 @@ msgstr "" "importlib.resources.read_binary(my_module, \"pics/painting.png\")\n" "importlib.resources.read_binary(my_module, \"pics\", \"painting.png\")" -#: ../../library/importlib.resources.rst:130 +#: ../../library/importlib.resources.rst:131 msgid "" "For backward compatibility reasons, functions that read text require an " "explicit *encoding* argument if multiple *path_names* are given. For " "example, to get the text of ``info/chapter1.txt``, use::" msgstr "" -#: ../../library/importlib.resources.rst:134 +#: ../../library/importlib.resources.rst:135 msgid "" "importlib.resources.read_text(my_module, \"info\", \"chapter1.txt\",\n" " encoding='utf-8')" @@ -199,124 +198,124 @@ msgstr "" "importlib.resources.read_text(my_module, \"info\", \"chapter1.txt\",\n" " encoding='utf-8')" -#: ../../library/importlib.resources.rst:139 +#: ../../library/importlib.resources.rst:140 msgid "Open the named resource for binary reading." msgstr "" -#: ../../library/importlib.resources.rst:141 -#: ../../library/importlib.resources.rst:184 -#: ../../library/importlib.resources.rst:232 -#: ../../library/importlib.resources.rst:249 -#: ../../library/importlib.resources.rst:267 +#: ../../library/importlib.resources.rst:142 +#: ../../library/importlib.resources.rst:185 +#: ../../library/importlib.resources.rst:233 +#: ../../library/importlib.resources.rst:250 +#: ../../library/importlib.resources.rst:268 msgid "" "See :ref:`the introduction ` for details on " "*anchor* and *path_names*." msgstr "" -#: ../../library/importlib.resources.rst:144 +#: ../../library/importlib.resources.rst:145 msgid "" "This function returns a :class:`~typing.BinaryIO` object, that is, a binary " "stream open for reading." msgstr "" -#: ../../library/importlib.resources.rst:147 -#: ../../library/importlib.resources.rst:171 -#: ../../library/importlib.resources.rst:187 -#: ../../library/importlib.resources.rst:208 -#: ../../library/importlib.resources.rst:235 -#: ../../library/importlib.resources.rst:252 -#: ../../library/importlib.resources.rst:270 +#: ../../library/importlib.resources.rst:148 +#: ../../library/importlib.resources.rst:172 +#: ../../library/importlib.resources.rst:188 +#: ../../library/importlib.resources.rst:209 +#: ../../library/importlib.resources.rst:236 +#: ../../library/importlib.resources.rst:253 +#: ../../library/importlib.resources.rst:271 msgid "This function is roughly equivalent to::" msgstr "這個函式大致等同於: ::" -#: ../../library/importlib.resources.rst:149 +#: ../../library/importlib.resources.rst:150 msgid "files(anchor).joinpath(*path_names).open('rb')" msgstr "files(anchor).joinpath(*path_names).open('rb')" -#: ../../library/importlib.resources.rst:151 -#: ../../library/importlib.resources.rst:191 -#: ../../library/importlib.resources.rst:256 +#: ../../library/importlib.resources.rst:152 +#: ../../library/importlib.resources.rst:192 +#: ../../library/importlib.resources.rst:257 msgid "Multiple *path_names* are accepted." msgstr "多個 *path_names* 是被接受的。" -#: ../../library/importlib.resources.rst:157 +#: ../../library/importlib.resources.rst:158 msgid "" "Open the named resource for text reading. By default, the contents are read " "as strict UTF-8." msgstr "" -#: ../../library/importlib.resources.rst:160 -#: ../../library/importlib.resources.rst:200 +#: ../../library/importlib.resources.rst:161 +#: ../../library/importlib.resources.rst:201 msgid "" "See :ref:`the introduction ` for details on " "*anchor* and *path_names*. *encoding* and *errors* have the same meaning as " "in built-in :func:`open`." msgstr "" -#: ../../library/importlib.resources.rst:164 -#: ../../library/importlib.resources.rst:204 +#: ../../library/importlib.resources.rst:165 +#: ../../library/importlib.resources.rst:205 msgid "" "For backward compatibility reasons, the *encoding* argument must be given " "explicitly if there are multiple *path_names*. This limitation is scheduled " "to be removed in Python 3.15." msgstr "" -#: ../../library/importlib.resources.rst:168 +#: ../../library/importlib.resources.rst:169 msgid "" "This function returns a :class:`~typing.TextIO` object, that is, a text " "stream open for reading." msgstr "" -#: ../../library/importlib.resources.rst:173 +#: ../../library/importlib.resources.rst:174 msgid "files(anchor).joinpath(*path_names).open('r', encoding=encoding)" msgstr "files(anchor).joinpath(*path_names).open('r', encoding=encoding)" -#: ../../library/importlib.resources.rst:175 -#: ../../library/importlib.resources.rst:212 -#: ../../library/importlib.resources.rst:239 +#: ../../library/importlib.resources.rst:176 +#: ../../library/importlib.resources.rst:213 +#: ../../library/importlib.resources.rst:240 msgid "" "Multiple *path_names* are accepted. *encoding* and *errors* must be given as " "keyword arguments." msgstr "" -#: ../../library/importlib.resources.rst:182 +#: ../../library/importlib.resources.rst:183 msgid "Read and return the contents of the named resource as :class:`bytes`." msgstr "以 :class:`bytes` 形式讀取並回傳指定資源的內容。" -#: ../../library/importlib.resources.rst:189 +#: ../../library/importlib.resources.rst:190 msgid "files(anchor).joinpath(*path_names).read_bytes()" msgstr "files(anchor).joinpath(*path_names).read_bytes()" -#: ../../library/importlib.resources.rst:197 +#: ../../library/importlib.resources.rst:198 msgid "" "Read and return the contents of the named resource as :class:`str`. By " "default, the contents are read as strict UTF-8." msgstr "" -#: ../../library/importlib.resources.rst:210 +#: ../../library/importlib.resources.rst:211 msgid "files(anchor).joinpath(*path_names).read_text(encoding=encoding)" msgstr "files(anchor).joinpath(*path_names).read_text(encoding=encoding)" -#: ../../library/importlib.resources.rst:219 +#: ../../library/importlib.resources.rst:220 msgid "" "Provides 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:223 +#: ../../library/importlib.resources.rst:224 msgid "" "Exiting the context manager cleans up any temporary files created, e.g. when " "the resource needs to be extracted from a zip file." msgstr "" -#: ../../library/importlib.resources.rst:226 +#: ../../library/importlib.resources.rst:227 msgid "" "For example, the :meth:`~pathlib.Path.stat` method requires an actual file " "system path; it can be used like this::" msgstr "" -#: ../../library/importlib.resources.rst:229 +#: ../../library/importlib.resources.rst:230 msgid "" "with importlib.resources.path(anchor, \"resource.txt\") as fspath:\n" " result = fspath.stat()" @@ -324,21 +323,21 @@ msgstr "" "with importlib.resources.path(anchor, \"resource.txt\") as fspath:\n" " result = fspath.stat()" -#: ../../library/importlib.resources.rst:237 +#: ../../library/importlib.resources.rst:238 msgid "as_file(files(anchor).joinpath(*path_names))" msgstr "as_file(files(anchor).joinpath(*path_names))" -#: ../../library/importlib.resources.rst:246 +#: ../../library/importlib.resources.rst:247 msgid "" "Return ``True`` if the named resource exists, otherwise ``False``. This " "function does not consider directories to be resources." msgstr "" -#: ../../library/importlib.resources.rst:254 +#: ../../library/importlib.resources.rst:255 msgid "files(anchor).joinpath(*path_names).is_file()" msgstr "files(anchor).joinpath(*path_names).is_file()" -#: ../../library/importlib.resources.rst:262 +#: ../../library/importlib.resources.rst:263 msgid "" "Return an iterable over the named items within the package or path. The " "iterable returns names of resources (e.g. files) and non-resources (e.g. " @@ -346,7 +345,7 @@ msgid "" "subdirectories." msgstr "" -#: ../../library/importlib.resources.rst:272 +#: ../../library/importlib.resources.rst:273 msgid "" "for resource in files(anchor).joinpath(*path_names).iterdir():\n" " yield resource.name" @@ -354,7 +353,7 @@ msgstr "" "for resource in files(anchor).joinpath(*path_names).iterdir():\n" " yield resource.name" -#: ../../library/importlib.resources.rst:275 +#: ../../library/importlib.resources.rst:276 msgid "" "Prefer ``iterdir()`` as above, which offers more control over the results " "and richer functionality." diff --git a/library/mmap.po b/library/mmap.po index be083b8ab9..c10da0be14 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-09-22 00:18+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-" @@ -299,12 +299,12 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/mmap.rst:199 ../../library/mmap.rst:291 -#: ../../library/mmap.rst:331 +#: ../../library/mmap.rst:199 ../../library/mmap.rst:292 +#: ../../library/mmap.rst:332 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" -#: ../../library/mmap.rst:205 +#: ../../library/mmap.rst:206 msgid "" "Flushes changes made to the in-memory copy of a file back to disk. Without " "use of this call there is no guarantee that changes are written back before " @@ -314,20 +314,20 @@ msgid "" "`PAGESIZE` or :const:`ALLOCATIONGRANULARITY`." msgstr "" -#: ../../library/mmap.rst:212 +#: ../../library/mmap.rst:213 msgid "" "``None`` is returned to indicate success. An exception is raised when the " "call failed." msgstr "" -#: ../../library/mmap.rst:215 +#: ../../library/mmap.rst:216 msgid "" "Previously, a nonzero value was returned on success; zero was returned on " "error under Windows. A zero value was returned on success; an exception was " "raised on error under Unix." msgstr "" -#: ../../library/mmap.rst:223 +#: ../../library/mmap.rst:224 msgid "" "Send advice *option* to the kernel about the memory region beginning at " "*start* and extending *length* bytes. *option* must be one of the :ref:" @@ -336,18 +336,18 @@ msgid "" "(including Linux), *start* must be a multiple of the :const:`PAGESIZE`." msgstr "" -#: ../../library/mmap.rst:230 +#: ../../library/mmap.rst:231 msgid "Availability: Systems with the ``madvise()`` system call." msgstr "" -#: ../../library/mmap.rst:237 +#: ../../library/mmap.rst:238 msgid "" "Copy the *count* bytes starting at offset *src* to the destination index " "*dest*. If the mmap was created with :const:`ACCESS_READ`, then calls to " "move will raise a :exc:`TypeError` exception." msgstr "" -#: ../../library/mmap.rst:244 +#: ../../library/mmap.rst:245 msgid "" "Return a :class:`bytes` containing up to *n* bytes starting from the current " "file position. If the argument is omitted, ``None`` or negative, return all " @@ -355,28 +355,28 @@ msgid "" "position is updated to point after the bytes that were returned." msgstr "" -#: ../../library/mmap.rst:250 +#: ../../library/mmap.rst:251 msgid "Argument can be omitted or ``None``." msgstr "" -#: ../../library/mmap.rst:255 +#: ../../library/mmap.rst:256 msgid "" "Returns a byte at the current file position as an integer, and advances the " "file position by 1." msgstr "" -#: ../../library/mmap.rst:261 +#: ../../library/mmap.rst:262 msgid "" "Returns a single line, starting at the current file position and up to the " "next newline. The file position is updated to point after the bytes that " "were returned." msgstr "" -#: ../../library/mmap.rst:268 +#: ../../library/mmap.rst:269 msgid "Resizes the map and the underlying file, if any." msgstr "" -#: ../../library/mmap.rst:270 +#: ../../library/mmap.rst:271 msgid "" "Resizing a map created with *access* of :const:`ACCESS_READ` or :const:" "`ACCESS_COPY`, will raise a :exc:`TypeError` exception. Resizing a map " @@ -384,7 +384,7 @@ msgid "" "exception." msgstr "" -#: ../../library/mmap.rst:275 +#: ../../library/mmap.rst:276 msgid "" "**On Windows**: Resizing the map will raise an :exc:`OSError` if there are " "other maps against the same named file. Resizing an anonymous map (ie " @@ -392,13 +392,13 @@ msgid "" "copied over up to the length of the new size." msgstr "" -#: ../../library/mmap.rst:280 +#: ../../library/mmap.rst:281 msgid "" "Correctly fails if attempting to resize when another map is held Allows " "resize against an anonymous map on Windows" msgstr "" -#: ../../library/mmap.rst:286 +#: ../../library/mmap.rst:287 msgid "" "Returns the highest index in the object where the subsequence *sub* is " "found, such that *sub* is contained in the range [*start*, *end*]. Optional " @@ -406,7 +406,7 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/mmap.rst:297 +#: ../../library/mmap.rst:298 msgid "" "Set the file's current position. *whence* argument is optional and defaults " "to ``os.SEEK_SET`` or ``0`` (absolute file positioning); other values are " @@ -414,27 +414,27 @@ msgid "" "SEEK_END`` or ``2`` (seek relative to the file's end)." msgstr "" -#: ../../library/mmap.rst:302 +#: ../../library/mmap.rst:303 msgid "Return the new absolute position instead of ``None``." msgstr "" -#: ../../library/mmap.rst:307 +#: ../../library/mmap.rst:308 msgid "" "Return whether the file supports seeking, and the return value is always " "``True``." msgstr "" -#: ../../library/mmap.rst:313 +#: ../../library/mmap.rst:314 msgid "" "Return the length of the file, which can be larger than the size of the " "memory-mapped area." msgstr "" -#: ../../library/mmap.rst:319 +#: ../../library/mmap.rst:320 msgid "Returns the current position of the file pointer." msgstr "" -#: ../../library/mmap.rst:324 +#: ../../library/mmap.rst:325 msgid "" "Write the bytes in *bytes* into memory at the current position of the file " "pointer and return the number of bytes written (never less than " @@ -444,11 +444,11 @@ msgid "" "it will raise a :exc:`TypeError` exception." msgstr "" -#: ../../library/mmap.rst:334 +#: ../../library/mmap.rst:335 msgid "The number of bytes written is now returned." msgstr "" -#: ../../library/mmap.rst:340 +#: ../../library/mmap.rst:341 msgid "" "Write the integer *byte* into memory at the current position of the file " "pointer; the file position is advanced by ``1``. If the mmap was created " @@ -456,25 +456,25 @@ msgid "" "exception." msgstr "" -#: ../../library/mmap.rst:348 +#: ../../library/mmap.rst:349 msgid "MADV_* Constants" msgstr "MADV_* 常數" -#: ../../library/mmap.rst:375 +#: ../../library/mmap.rst:376 msgid "" "These options can be passed to :meth:`mmap.madvise`. Not every option will " "be present on every system." msgstr "" -#: ../../library/mmap.rst:378 +#: ../../library/mmap.rst:379 msgid "Availability: Systems with the madvise() system call." msgstr "" -#: ../../library/mmap.rst:385 +#: ../../library/mmap.rst:386 msgid "MAP_* Constants" msgstr "MAP_* 常數" -#: ../../library/mmap.rst:409 +#: ../../library/mmap.rst:410 msgid "" "These are the various flags that can be passed to :meth:`mmap.mmap`. :data:" "`MAP_ALIGNED_SUPER` is only available at FreeBSD and :data:`MAP_CONCEAL` is " @@ -482,19 +482,19 @@ msgid "" "some systems." msgstr "" -#: ../../library/mmap.rst:413 +#: ../../library/mmap.rst:414 msgid "Added :data:`MAP_POPULATE` constant." msgstr "新增 :data:`MAP_POPULATE` 常數。" -#: ../../library/mmap.rst:416 +#: ../../library/mmap.rst:417 msgid "Added :data:`MAP_STACK` constant." msgstr "新增 :data:`MAP_STACK` 常數。" -#: ../../library/mmap.rst:419 +#: ../../library/mmap.rst:420 msgid "Added :data:`MAP_ALIGNED_SUPER` and :data:`MAP_CONCEAL` constants." msgstr "新增 :data:`MAP_ALIGNED_SUPER` 和 :data:`MAP_CONCEAL` 常數。" -#: ../../library/mmap.rst:422 +#: ../../library/mmap.rst:423 msgid "" "Added :data:`MAP_32BIT`, :data:`MAP_HASSEMAPHORE`, :data:`MAP_JIT`, :data:" "`MAP_NOCACHE`, :data:`MAP_NOEXTEND`, :data:`MAP_NORESERVE`, :data:" diff --git a/library/numbers.po b/library/numbers.po index 9715ceb1a0..ebe2bdf4a0 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2022-11-16 04:57+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,10 +30,10 @@ msgstr "**原始碼:**\\ :source:`Lib/numbers.py`" #: ../../library/numbers.rst:11 msgid "" -"The :mod:`!numbers` module (:pep:`3141`) defines a hierarchy of " -"numeric :term:`abstract base classes ` which " -"progressively define more operations. None of the types defined in this " -"module are intended to be instantiated." +"The :mod:`!numbers` module (:pep:`3141`) defines a hierarchy of numeric :" +"term:`abstract base classes ` which progressively " +"define more operations. None of the types defined in this module are " +"intended to be instantiated." msgstr "" ":mod:`!numbers` 模組 (:pep:`3141`) 定義了數值\\ :term:`抽象基底類別 " "` 的階層結構,其中逐一定義了更多操作。此模組中定義的型別" @@ -54,16 +54,15 @@ msgstr "數值的階層" #: ../../library/numbers.rst:27 msgid "" "Subclasses of this type describe complex numbers and include the operations " -"that work on the built-in :class:`complex` type. These are: conversions " -"to :class:`complex` and :class:`bool`, :attr:`.real`, :attr:`.imag`, ``+``, " -"``-``, ``*``, ``/``, ``**``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!" +"that work on the built-in :class:`complex` type. These are: conversions to :" +"class:`complex` and :class:`bool`, :attr:`.real`, :attr:`.imag`, ``+``, ``-" +"``, ``*``, ``/``, ``**``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!" "=``. All except ``-`` and ``!=`` are abstract." msgstr "" "這個型別的子類別描述了複數並包含適用於內建 :class:`complex` 型別的操作。這些" -"操作有::class:`complex` 和 :class:`bool` 的轉" -"換、:attr:`.real`、:attr:`.imag`、``+``、``-``、``*``、``/``、" -"``**``、:func:`abs`、:meth:`conjugate`、``==`` 以及 ``!=``。除 ``-`` 和 ``!" -"=`` 之外所有操作都是抽象的。" +"操作有::class:`complex` 和 :class:`bool` 的轉換、:attr:`.real`、:attr:`." +"imag`、``+``、``-``、``*``、``/``、``**``、:func:`abs`、:meth:`conjugate`、" +"``==`` 以及 ``!=``。除 ``-`` 和 ``!=`` 之外所有操作都是抽象的。" #: ../../library/numbers.rst:35 msgid "Abstract. Retrieves the real component of this number." @@ -87,59 +86,59 @@ msgstr "相對於 :class:`Complex`,:class:`!Real` 加入了只有實數才能 #: ../../library/numbers.rst:52 msgid "" -"In short, those are: a conversion " -"to :class:`float`, :func:`math.trunc`, :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, " -"``//``, ``%``, ``<``, ``<=``, ``>``, and ``>=``." +"In short, those are: a conversion to :class:`float`, :func:`math.trunc`, :" +"func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, " +"``%``, ``<``, ``<=``, ``>``, and ``>=``." msgstr "" -"簡單的說,有 :class:`float` 的轉" -"換、:func:`math.trunc`、:func:`round`、:func:`math.floor`、:func:`math.ceil`、:func:`divmod`、" -"``//``、``%``、 ``<``、``<=``、``>``、和 ``>=``。" +"簡單的說,有 :class:`float` 的轉換、:func:`math.trunc`、:func:`round`、:func:" +"`math.floor`、:func:`math.ceil`、:func:`divmod`、``//``、``%``、 ``<``、" +"``<=``、``>``、和 ``>=``。" #: ../../library/numbers.rst:56 msgid "" -"Real also provides defaults " -"for :func:`complex`, :attr:`~Complex.real`, :attr:`~Complex.imag`, " -"and :meth:`~Complex.conjugate`." +"Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, :" +"attr:`~Complex.imag`, and :meth:`~Complex.conjugate`." msgstr "" "實數同樣提供 :func:`complex`、:attr:`~Complex.real`、:attr:`~Complex.imag` " "和 :meth:`~Complex.conjugate` 的預設值。" #: ../../library/numbers.rst:62 msgid "" -"Subtypes :class:`Real` and adds :attr:`~Rational.numerator` " -"and :attr:`~Rational.denominator` properties. It also provides a default " -"for :func:`float`." +"Subtypes :class:`Real` and adds :attr:`~Rational.numerator` and :attr:" +"`~Rational.denominator` properties. It also provides a default for :func:" +"`float`." msgstr "" -":class:`Real` 的子型別,並增加了 :attr:`~Rational.numerator` " -"和 :attr:`~Rational.denominator` 這兩種特性。它也會提供 :func:`float` 的預設" -"值。" +":class:`Real` 的子型別,並增加了 :attr:`~Rational.numerator` 和 :attr:" +"`~Rational.denominator` 這兩種特性。它也會提供 :func:`float` 的預設值。" #: ../../library/numbers.rst:66 msgid "" "The :attr:`~Rational.numerator` and :attr:`~Rational.denominator` values " -"should be instances of :class:`Integral` and should be in lowest terms " -"with :attr:`~Rational.denominator` positive." +"should be instances of :class:`Integral` and should be in lowest terms with :" +"attr:`~Rational.denominator` positive." msgstr "" -":attr:`~Rational.numerator` 和 :attr:`~Rational.denominator` 的值必須" -"是 :class:`Integral` 的實例且 :attr:`~Rational.denominator` 要是正數。" +":attr:`~Rational.numerator` 和 :attr:`~Rational.denominator` 的值必須是 :" +"class:`Integral` 的實例且 :attr:`~Rational.denominator` 要是正數。" -#: ../../library/numbers.rst:72 ../../library/numbers.rst:76 -msgid "Abstract." -msgstr "為抽象的。" +#: ../../library/numbers.rst:72 +msgid "Abstract. The numerator of this rational number." +msgstr "為抽象的。該有理數的分子。" + +#: ../../library/numbers.rst:76 +msgid "Abstract. The denominator of this rational number." +msgstr "為抽象的。該有理數的分母。" #: ../../library/numbers.rst:81 msgid "" "Subtypes :class:`Rational` and adds a conversion to :class:`int`. Provides " -"defaults for :func:`float`, :attr:`~Rational.numerator`, " -"and :attr:`~Rational.denominator`. Adds abstract methods for :func:`pow` " -"with modulus and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, " -"``~``." +"defaults for :func:`float`, :attr:`~Rational.numerator`, and :attr:" +"`~Rational.denominator`. Adds abstract methods for :func:`pow` with modulus " +"and bit-string operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``." msgstr "" -":class:`Rational` 的子型別,並增加了 :class:`int` 的轉換操作。" -"為 :func:`float`、:attr:`~Rational.numerator` " -"和 :attr:`~Rational.denominator` 提供了預設值。為 :func:`pow` 方法增加了求餘 " -"(modulus) 和位元字串運算 (bit-string operations) 的抽象方法:``<<``、``>>``、" -"``&``、``^``、``|``、``~``。" +":class:`Rational` 的子型別,並增加了 :class:`int` 的轉換操作。為 :func:" +"`float`、:attr:`~Rational.numerator` 和 :attr:`~Rational.denominator` 提供了" +"預設值。為 :func:`pow` 方法增加了求餘 (modulus) 和位元字串運算 (bit-string " +"operations) 的抽象方法:``<<``、``>>``、``&``、``^``、``|``、``~``。" #: ../../library/numbers.rst:89 msgid "Notes for type implementers" @@ -149,12 +148,12 @@ msgstr "給型別實作者的註記" msgid "" "Implementers should be careful to make equal numbers equal and hash them to " "the same values. This may be subtle if there are two different extensions of " -"the real numbers. For example, :class:`fractions.Fraction` " -"implements :func:`hash` as follows::" +"the real numbers. For example, :class:`fractions.Fraction` implements :func:" +"`hash` as follows::" msgstr "" "實作者需注意,相等的數值除了大小相等外,還必須擁有同樣的雜湊值。當使用兩個不" -"同的實數擴充時,這可能是很微妙的。例如,:class:`fractions.Fraction` 底下" -"的 :func:`hash` 實作如下: ::" +"同的實數擴充時,這可能是很微妙的。例如,:class:`fractions.Fraction` 底下的 :" +"func:`hash` 實作如下: ::" #: ../../library/numbers.rst:96 msgid "" @@ -191,8 +190,8 @@ msgid "" "poor hierarchy if it precluded the possibility of adding those. You can add " "``MyFoo`` between :class:`Complex` and :class:`Real` with::" msgstr "" -"當然,還有更多用於數值的 ABC,如果不加入它們就不會有健全的階層。你可以" -"在 :class:`Complex` 和 :class:`Real` 中加入 ``MyFoo``,像是: ::" +"當然,還有更多用於數值的 ABC,如果不加入它們就不會有健全的階層。你可以在 :" +"class:`Complex` 和 :class:`Real` 中加入 ``MyFoo``,像是: ::" #: ../../library/numbers.rst:117 msgid "" @@ -211,9 +210,8 @@ msgid "" "We want to implement the arithmetic operations so that mixed-mode operations " "either call an implementation whose author knew about the types of both " "arguments, or convert both to the nearest built in type and do the operation " -"there. For subtypes of :class:`Integral`, this means " -"that :meth:`~object.__add__` and :meth:`~object.__radd__` should be defined " -"as::" +"there. For subtypes of :class:`Integral`, this means that :meth:`~object." +"__add__` and :meth:`~object.__radd__` should be defined as::" msgstr "" "我們想要實作算術操作,來使得混合模式操作要麼呼叫一個作者知道兩個引數之型別的" "實作,要麼將其轉換成最接近的內建型別並執行這個操作。對於 :class:`Integral` 的" @@ -272,10 +270,10 @@ msgstr "" #: ../../library/numbers.rst:158 msgid "" -"There are 5 different cases for a mixed-type operation on subclasses " -"of :class:`Complex`. I'll refer to all of the above code that doesn't refer " -"to ``MyIntegral`` and ``OtherTypeIKnowAbout`` as \"boilerplate\". ``a`` will " -"be an instance of ``A``, which is a subtype of :class:`Complex` (``a : A <: " +"There are 5 different cases for a mixed-type operation on subclasses of :" +"class:`Complex`. I'll refer to all of the above code that doesn't refer to " +"``MyIntegral`` and ``OtherTypeIKnowAbout`` as \"boilerplate\". ``a`` will be " +"an instance of ``A``, which is a subtype of :class:`Complex` (``a : A <: " "Complex``), and ``b : B <: Complex``. I'll consider ``a + b``:" msgstr "" ":class:`Complex` 的子類別有 5 種不同的混合型別操作。我將上面提到所有不涉及 " @@ -293,9 +291,9 @@ msgstr "" msgid "" "If ``A`` falls back to the boilerplate code, and it were to return a value " "from :meth:`~object.__add__`, we'd miss the possibility that ``B`` defines a " -"more intelligent :meth:`~object.__radd__`, so the boilerplate should " -"return :data:`NotImplemented` from :meth:`!__add__`. (Or ``A`` may not " -"implement :meth:`!__add__` at all.)" +"more intelligent :meth:`~object.__radd__`, so the boilerplate should return :" +"data:`NotImplemented` from :meth:`!__add__`. (Or ``A`` may not implement :" +"meth:`!__add__` at all.)" msgstr "" "如果 ``A`` 回退成模板程式碼,它將回傳一個來自 :meth:`~object.__add__` 的值," "並喪失讓 ``B`` 定義一個更完善的 :meth:`~object.__radd__` 的機會,因此模板需要" @@ -330,24 +328,24 @@ msgstr "" #: ../../library/numbers.rst:183 msgid "" "If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, " -"then the appropriate shared operation is the one involving the built " -"in :class:`complex`, and both :meth:`~object.__radd__` s land there, so " -"``a+b == b+a``." +"then the appropriate shared operation is the one involving the built in :" +"class:`complex`, and both :meth:`~object.__radd__` s land there, so ``a+b == " +"b+a``." msgstr "" "如果 ``A <: Complex`` 和 ``B <: Real`` 且沒有共享任何其他型別上的理解,那麼適" -"當的共享操作會涉及內建的 :class:`complex`,並且分別用" -"到 :meth:`~object.__radd__`,因此 ``a+b == b+a``。" +"當的共享操作會涉及內建的 :class:`complex`,並且分別用到 :meth:`~object." +"__radd__`,因此 ``a+b == b+a``。" #: ../../library/numbers.rst:188 msgid "" "Because most of the operations on any given type will be very similar, it " "can be useful to define a helper function which generates the forward and " -"reverse instances of any given operator. For " -"example, :class:`fractions.Fraction` uses::" +"reverse instances of any given operator. For example, :class:`fractions." +"Fraction` uses::" msgstr "" "由於大部分對任意給定類型的操作都十分相似的,定義一個為任意給定運算子生成向前 " -"(forward) 與向後 (reverse) 實例的輔助函式可能會非常有用。例" -"如,:class:`fractions.Fraction` 使用了: ::" +"(forward) 與向後 (reverse) 實例的輔助函式可能會非常有用。例如,:class:" +"`fractions.Fraction` 使用了: ::" #: ../../library/numbers.rst:193 msgid "" @@ -427,8 +425,5 @@ msgstr "" "\n" "# ..." -#~ msgid "Abstract. The numerator of this rational number." -#~ msgstr "為抽象的。該有理數的分子。" - -#~ msgid "Abstract. The denominator of this rational number." -#~ msgstr "為抽象的。該有理數的分母。" +#~ msgid "Abstract." +#~ msgstr "為抽象的。" diff --git a/library/os.po b/library/os.po index a882bc46b5..fe5b267db4 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-09-22 00:18+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2183,9 +2183,8 @@ msgid "" "functions in the :mod:`os` module must be a string specifying a file path. " "However, some functions now alternatively accept an open file descriptor for " "their *path* argument. The function will then operate on the file referred " -"to by the descriptor. (For POSIX systems, Python will call the variant of " -"the function prefixed with ``f`` (e.g. call ``fchdir`` instead of " -"``chdir``).)" +"to by the descriptor. For POSIX systems, Python will call the variant of the " +"function prefixed with ``f`` (e.g. call ``fchdir`` instead of ``chdir``)." msgstr "" #: ../../library/os.rst:2015 @@ -2207,7 +2206,7 @@ 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 " "operate on should be relative; path will then be relative to that " -"directory. If the path is absolute, *dir_fd* is ignored. (For POSIX " +"directory. If the path is absolute, *dir_fd* is ignored. For POSIX " "systems, Python will call the variant of the function with an ``at`` suffix " "and possibly prefixed with ``f`` (e.g. call ``faccessat`` instead of " "``access``)." @@ -2225,8 +2224,8 @@ 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 " "operate on the symbolic link itself rather than the file pointed to by the " -"link. (For POSIX systems, Python will call the ``l...`` variant of the " -"function.)" +"link. For POSIX systems, Python will call the ``l...`` variant of the " +"function." msgstr "" #: ../../library/os.rst:2044 diff --git a/library/platform.po b/library/platform.po index 7e2ed8e70b..77bb0004ca 100644 --- a/library/platform.po +++ b/library/platform.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-09 05:11+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2022-06-11 14:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -88,8 +88,8 @@ msgid "" "To get at the \"64-bitness\" of the current interpreter, it is more reliable " "to query the :data:`sys.maxsize` attribute::" msgstr "" -"要取得目前直譯器的 \"64 位元性 (64-bitness)\",更可靠的做法是查" -"詢 :data:`sys.maxsize` 屬性: ::" +"要取得目前直譯器的 \"64 位元性 (64-bitness)\",更可靠的做法是查詢 :data:`sys." +"maxsize` 屬性: ::" #: ../../library/platform.rst:51 msgid "is_64bits = sys.maxsize > 2**32" @@ -101,7 +101,13 @@ msgid "" "the value cannot be determined." msgstr "回傳機器種類,例如 ``'AMD64'``。如果該值無法確定則會回傳一個空字串。" -#: ../../library/platform.rst:62 +#: ../../library/platform.rst:59 +msgid "" +"The output is platform-dependent and may differ in casing and naming " +"conventions." +msgstr "" + +#: ../../library/platform.rst:64 msgid "" "Returns the computer's network name (may not be fully qualified!). An empty " "string is returned if the value cannot be determined." @@ -109,13 +115,13 @@ msgstr "" "回傳電腦的網路名稱(可能不是完整名稱!)。如果該值無法確定則會回傳一個空字" "串。" -#: ../../library/platform.rst:68 +#: ../../library/platform.rst:70 msgid "" "Returns a single string identifying the underlying platform with as much " "useful information as possible." msgstr "會儘可能附帶有用資訊地回傳一個標識底層平臺的字串。" -#: ../../library/platform.rst:71 +#: ../../library/platform.rst:73 msgid "" "The output is intended to be *human readable* rather than machine parseable. " "It may look different on different platforms and this is intended." @@ -123,7 +129,7 @@ msgstr "" "輸出應為\\ *人類易讀的 (human readable)*,而非機器易剖析的 (machine " "parseable)。它在不同平臺上看起來可能不一致,這是有意為之的。" -#: ../../library/platform.rst:74 +#: ../../library/platform.rst:76 msgid "" "If *aliased* is true, the function will use aliases for various platforms " "that report system names which differ from their common names, for example " @@ -134,13 +140,13 @@ msgstr "" "稱,例如 SunOS 將被回報為 Solaris。:func:`system_alias` 函式被用於實作此功" "能。" -#: ../../library/platform.rst:79 +#: ../../library/platform.rst:81 msgid "" "Setting *terse* to true causes the function to return only the absolute " "minimum information needed to identify the platform." msgstr "將 *terse* 設為真值將導致此函式只回傳標識平臺所需的最小量資訊。" -#: ../../library/platform.rst:82 +#: ../../library/platform.rst:84 msgid "" "On macOS, the function now uses :func:`mac_ver`, if it returns a non-empty " "release string, to get the macOS version rather than the darwin version." @@ -148,11 +154,11 @@ msgstr "" "在 macOS 上,如果 :func:`mac_ver` 回傳的釋出版字串非空字串,此函式現在會使用" "它以取得 macOS 版本而非 darwin 版本。" -#: ../../library/platform.rst:90 +#: ../../library/platform.rst:92 msgid "Returns the (real) processor name, e.g. ``'amdk6'``." msgstr "回傳(真實的)處理器名稱,例如 ``'amdk6'``。" -#: ../../library/platform.rst:92 +#: ../../library/platform.rst:94 msgid "" "An empty string is returned if the value cannot be determined. Note that " "many platforms do not provide this information or simply return the same " @@ -161,7 +167,7 @@ msgstr "" "如果該值無法確定則將回傳空字串。請注意,許多平臺都不提供此資訊或是簡單地回傳" "與 :func:`machine` 相同的值。NetBSD 則會提供此資訊。" -#: ../../library/platform.rst:99 +#: ../../library/platform.rst:101 msgid "" "Returns a tuple ``(buildno, builddate)`` stating the Python build number and " "date as strings." @@ -169,15 +175,15 @@ msgstr "" "回傳一個 tuple ``(buildno, builddate)``,表示字串形式的 Python 建置編號和日" "期。" -#: ../../library/platform.rst:105 +#: ../../library/platform.rst:107 msgid "Returns a string identifying the compiler used for compiling Python." msgstr "回傳一個標識用於編譯 Python 的編譯器的字串。" -#: ../../library/platform.rst:110 +#: ../../library/platform.rst:112 msgid "Returns a string identifying the Python implementation SCM branch." msgstr "回傳一個標識 Python 實作 SCM 分支的字串。" -#: ../../library/platform.rst:115 +#: ../../library/platform.rst:117 msgid "" "Returns a string identifying the Python implementation. Possible return " "values are: 'CPython', 'IronPython', 'Jython', 'PyPy'." @@ -185,15 +191,15 @@ msgstr "" "回傳一個標識 Python 實作的字串。可能的回傳值" "有:'CPython'、'IronPython'、'Jython'、'PyPy'。" -#: ../../library/platform.rst:121 +#: ../../library/platform.rst:123 msgid "Returns a string identifying the Python implementation SCM revision." msgstr "回傳一個標識 Python 實作 SCM 修訂版的字串。" -#: ../../library/platform.rst:126 +#: ../../library/platform.rst:128 msgid "Returns the Python version as string ``'major.minor.patchlevel'``." msgstr "將 Python 版本以字串 ``'major.minor.patchlevel'`` 形式回傳。" -#: ../../library/platform.rst:128 +#: ../../library/platform.rst:130 msgid "" "Note that unlike the Python ``sys.version``, the returned value will always " "include the patchlevel (it defaults to 0)." @@ -201,13 +207,13 @@ msgstr "" "請注意此回傳值不同於 Python ``sys.version``,它總是會包括 patchlevel(預設為 " "``'0'``\\ )。" -#: ../../library/platform.rst:134 +#: ../../library/platform.rst:136 msgid "" "Returns the Python version as tuple ``(major, minor, patchlevel)`` of " "strings." msgstr "將 Python 版本以字串 tuple ``(major, minor, patchlevel)`` 形式回傳。" -#: ../../library/platform.rst:136 +#: ../../library/platform.rst:138 msgid "" "Note that unlike the Python ``sys.version``, the returned value will always " "include the patchlevel (it defaults to ``'0'``)." @@ -215,7 +221,7 @@ msgstr "" "請注意此回傳值不同於 Python ``sys.version``,它總是會包括 patchlevel(預設為 " "``'0'``\\ )。" -#: ../../library/platform.rst:142 +#: ../../library/platform.rst:144 msgid "" "Returns the system's release, e.g. ``'2.2.0'`` or ``'NT'``. An empty string " "is returned if the value cannot be determined." @@ -223,7 +229,7 @@ msgstr "" "回傳系統的釋出版本,例如 ``'2.2.0'`` 或 ``'NT'``,如果該值無法確定則將回傳一" "個空字串。" -#: ../../library/platform.rst:148 +#: ../../library/platform.rst:150 msgid "" "Returns the system/OS name, such as ``'Linux'``, ``'Darwin'``, ``'Java'``, " "``'Windows'``. An empty string is returned if the value cannot be determined." @@ -231,14 +237,14 @@ msgstr "" "回傳系統/OS 的名稱,例如 ``'Linux'``、``'Darwin'``、``'Java'``、" "``'Windows'``。如果該值無法確定則回傳一個空字串。" -#: ../../library/platform.rst:151 +#: ../../library/platform.rst:153 msgid "" "On iOS and Android, this returns the user-facing OS name (i.e, ``'iOS``, " "``'iPadOS'`` or ``'Android'``). To obtain the kernel name (``'Darwin'`` or " "``'Linux'``), use :func:`os.uname`." msgstr "" -#: ../../library/platform.rst:157 +#: ../../library/platform.rst:159 msgid "" "Returns ``(system, release, version)`` aliased to common marketing names " "used for some systems. It also does some reordering of the information in " @@ -247,7 +253,7 @@ msgstr "" "回傳做為某些系統所使用的常見行銷名稱之別名的 ``(system, release, version)``。" "它還會在可能導致混淆的情況下對資訊進行一些重新排序。" -#: ../../library/platform.rst:164 +#: ../../library/platform.rst:166 msgid "" "Returns the system's release version, e.g. ``'#3 on degas'``. An empty " "string is returned if the value cannot be determined." @@ -255,64 +261,62 @@ msgstr "" "回傳系統的釋出版本資訊,例如 ``'#3 on degas'``。如果該值無法確定則將回傳一個" "空字串。" -#: ../../library/platform.rst:167 +#: ../../library/platform.rst:169 msgid "" "On iOS and Android, this is the user-facing OS version. To obtain the Darwin " "or Linux kernel version, use :func:`os.uname`." msgstr "" -#: ../../library/platform.rst:172 +#: ../../library/platform.rst:174 msgid "" "Fairly portable uname interface. Returns a :func:`~collections.namedtuple` " -"containing six " -"attributes: :attr:`system`, :attr:`node`, :attr:`release`, :attr:`version`, :attr:`machine`, " -"and :attr:`processor`." +"containing six attributes: :attr:`system`, :attr:`node`, :attr:`release`, :" +"attr:`version`, :attr:`machine`, and :attr:`processor`." msgstr "" -"具有高可攜性 (portable) 的 uname 介面。回傳包含六個屬性" -"的 :func:`~collections.namedtuple`::attr:`system`、:attr:`node`、:attr:`release`、:attr:`version`、:attr:`machine` " -"和 :attr:`processor`。" +"具有高可攜性 (portable) 的 uname 介面。回傳包含六個屬性的 :func:" +"`~collections.namedtuple`::attr:`system`、:attr:`node`、:attr:`release`、:" +"attr:`version`、:attr:`machine` 和 :attr:`processor`。" -#: ../../library/platform.rst:176 +#: ../../library/platform.rst:178 msgid ":attr:`processor` is resolved late, on demand." msgstr ":attr:`processor` 會延遲解析,有需求時才會解析" -#: ../../library/platform.rst:178 +#: ../../library/platform.rst:180 msgid "" -"Note: the first two attribute names differ from the names presented " -"by :func:`os.uname`, where they are named :attr:`!sysname` and :attr:`!" -"nodename`." +"Note: the first two attribute names differ from the names presented by :func:" +"`os.uname`, where they are named :attr:`!sysname` and :attr:`!nodename`." msgstr "" -"注意:前兩個屬性名稱與 :func:`os.uname` 提供的名稱不同,它們分別命名" -"為 :attr:`!sysname` 和 :attr:`!nodename`。" +"注意:前兩個屬性名稱與 :func:`os.uname` 提供的名稱不同,它們分別命名為 :attr:" +"`!sysname` 和 :attr:`!nodename`。" -#: ../../library/platform.rst:182 +#: ../../library/platform.rst:184 msgid "Entries which cannot be determined are set to ``''``." msgstr "無法確定的條目會被設為 ``''``。" -#: ../../library/platform.rst:184 +#: ../../library/platform.rst:186 msgid "Result changed from a tuple to a :func:`~collections.namedtuple`." msgstr "將結果從 tuple 改為 :func:`~collections.namedtuple`。" -#: ../../library/platform.rst:187 +#: ../../library/platform.rst:189 msgid ":attr:`processor` is resolved late instead of immediately." msgstr ":attr:`processor` 會延遲解析,並非立即解析。" -#: ../../library/platform.rst:192 +#: ../../library/platform.rst:194 msgid "" "Clear out the internal cache of information, such as the :func:`uname`. This " "is typically useful when the platform's :func:`node` is changed by an " "external process and one needs to retrieve the updated value." msgstr "" -#: ../../library/platform.rst:200 +#: ../../library/platform.rst:202 msgid "Java platform" msgstr "Java 平台" -#: ../../library/platform.rst:205 +#: ../../library/platform.rst:207 msgid "Version interface for Jython." msgstr "Jython 的版本介面。" -#: ../../library/platform.rst:207 +#: ../../library/platform.rst:209 msgid "" "Returns a tuple ``(release, vendor, vminfo, osinfo)`` with *vminfo* being a " "tuple ``(vm_name, vm_release, vm_vendor)`` and *osinfo* being a tuple " @@ -324,17 +328,17 @@ msgstr "" "os_version, os_arch)``。無法確定的值將被設為由參數所給定的預設值(預設均為 " "``''``\\ )。" -#: ../../library/platform.rst:212 +#: ../../library/platform.rst:214 msgid "" "It was largely untested, had a confusing API, and was only useful for Jython " "support." msgstr "" -#: ../../library/platform.rst:218 +#: ../../library/platform.rst:220 msgid "Windows platform" msgstr "Windows 平台" -#: ../../library/platform.rst:223 +#: ../../library/platform.rst:225 msgid "" "Get additional version information from the Windows Registry and return a " "tuple ``(release, version, csd, ptype)`` referring to OS release, version " @@ -346,20 +350,20 @@ msgstr "" "``(release, version, csd, ptype)``,它代表 OS 發行版、版本號、CSD 級別 " "(service pack) 和 OS 類型(多個/單個處理器)。" -#: ../../library/platform.rst:229 +#: ../../library/platform.rst:231 msgid "" "As a hint: *ptype* is ``'Uniprocessor Free'`` on single processor NT " "machines and ``'Multiprocessor Free'`` on multi processor machines. The " "``'Free'`` refers to the OS version being free of debugging code. It could " -"also state ``'Checked'`` which means the OS version uses debugging code, " -"i.e. code that checks arguments, ranges, etc." +"also state ``'Checked'`` which means the OS version uses debugging code, i." +"e. code that checks arguments, ranges, etc." msgstr "" "一點提示:*ptype* 在單個處理器的 NT 機器上為 ``'Uniprocessor Free'``,而在多" "個處理器的機器上為 ``'Multiprocessor Free'``。``'Free'`` 是指該 OS 版本沒有除" "錯程式。它也可能以 ``'Checked'`` 表示,代表該 OS 版本使用了除錯程式,即檢查引" "數、範圍等的程式。" -#: ../../library/platform.rst:237 +#: ../../library/platform.rst:239 msgid "" "Returns a string representing the current Windows edition, or ``None`` if " "the value cannot be determined. Possible values include but are not limited " @@ -369,7 +373,7 @@ msgstr "" "回傳一個代表目前 Windows 版本的字串。可能的值包括但不限於 ``'Enterprise'``、" "``'IoTUAP'``、``'ServerStandard'`` 和 ``'nanoserver'``。" -#: ../../library/platform.rst:245 +#: ../../library/platform.rst:247 msgid "" "Return ``True`` if the Windows edition returned by :func:`win32_edition` is " "recognized as an IoT edition." @@ -377,11 +381,11 @@ msgstr "" "如果 :func:`win32_edition` 回傳的 Windows 版本被識別為 IoT 版則回傳 " "``True``。" -#: ../../library/platform.rst:252 +#: ../../library/platform.rst:254 msgid "macOS platform" msgstr "macOS 平台" -#: ../../library/platform.rst:256 +#: ../../library/platform.rst:258 msgid "" "Get macOS version information and return it as tuple ``(release, " "versioninfo, machine)`` with *versioninfo* being a tuple ``(version, " @@ -391,53 +395,53 @@ msgstr "" "其中 *versioninfo* 是一個 tuple ``(version, dev_stage, " "non_release_version)``。" -#: ../../library/platform.rst:260 +#: ../../library/platform.rst:262 msgid "" "Entries which cannot be determined are set to ``''``. All tuple entries are " "strings." msgstr "無法確定的條目會被設為 ``''``。所有 tuple 條目均為字串。" -#: ../../library/platform.rst:264 +#: ../../library/platform.rst:266 msgid "iOS platform" msgstr "iOS 平台" -#: ../../library/platform.rst:268 +#: ../../library/platform.rst:270 msgid "" -"Get iOS version information and return it as " -"a :func:`~collections.namedtuple` with the following attributes:" +"Get iOS version information and return it as a :func:`~collections." +"namedtuple` with the following attributes:" msgstr "" -#: ../../library/platform.rst:271 +#: ../../library/platform.rst:273 msgid "``system`` is the OS name; either ``'iOS'`` or ``'iPadOS'``." msgstr "``system`` 是 OS 名稱;可能是 ``'iOS'`` 或 ``'iPadOS'``。" -#: ../../library/platform.rst:272 +#: ../../library/platform.rst:274 msgid "``release`` is the iOS version number as a string (e.g., ``'17.2'``)." msgstr "" -#: ../../library/platform.rst:273 +#: ../../library/platform.rst:275 msgid "" "``model`` is the device model identifier; this will be a string like " "``'iPhone13,2'`` for a physical device, or ``'iPhone'`` on a simulator." msgstr "" -#: ../../library/platform.rst:275 +#: ../../library/platform.rst:277 msgid "" "``is_simulator`` is a boolean describing if the app is running on a " "simulator or a physical device." msgstr "" -#: ../../library/platform.rst:278 +#: ../../library/platform.rst:280 msgid "" "Entries which cannot be determined are set to the defaults given as " "parameters." msgstr "無法確定的條目會被設定為以參數給定的預設值。" -#: ../../library/platform.rst:283 +#: ../../library/platform.rst:285 msgid "Unix platforms" msgstr "Unix 平台" -#: ../../library/platform.rst:287 +#: ../../library/platform.rst:289 msgid "" "Tries to determine the libc version against which the file executable " "(defaults to the Python interpreter) is linked. Returns a tuple of strings " @@ -447,7 +451,7 @@ msgstr "" "嘗試確認可執行檔案(預設為 Python 直譯器)所連結到的 libc 版本。回傳一個字串 " "tuple ``(lib, version)``,當查詢失敗時其預設值將被設為給定的參數值。" -#: ../../library/platform.rst:291 +#: ../../library/platform.rst:293 msgid "" "Note that this function has intimate knowledge of how different libc " "versions add symbols to the executable is probably only usable for " @@ -456,15 +460,15 @@ msgstr "" "請注意,此函式對於不同 libc 版本如何為可執行檔案新增符號的方式有深層的關聯," "可能僅適用於以 :program:`gcc` 編譯出來的可執行檔案。" -#: ../../library/platform.rst:295 +#: ../../library/platform.rst:297 msgid "The file is read and scanned in chunks of *chunksize* bytes." msgstr "檔案會以 *chunksize* 位元組大小的分塊 (chunk) 來讀取和掃描。" -#: ../../library/platform.rst:299 +#: ../../library/platform.rst:301 msgid "Linux platforms" msgstr "Linux 平台" -#: ../../library/platform.rst:303 +#: ../../library/platform.rst:305 msgid "" "Get operating system identification from ``os-release`` file and return it " "as a dict. The ``os-release`` file is a `freedesktop.org standard `_、並在大多數 Linux 發行版上可用。一個重要的例外" "是 Android 和基於 Android 的發行版。" -#: ../../library/platform.rst:309 +#: ../../library/platform.rst:311 msgid "" "Raises :exc:`OSError` or subclass when neither ``/etc/os-release`` nor ``/" "usr/lib/os-release`` can be read." msgstr "" -"當 ``/etc/os-release`` 與 ``/usr/lib/os-release`` 均無法被讀取時將引" -"發 :exc:`OSError` 或其子類別。" +"當 ``/etc/os-release`` 與 ``/usr/lib/os-release`` 均無法被讀取時將引發 :exc:" +"`OSError` 或其子類別。" -#: ../../library/platform.rst:312 +#: ../../library/platform.rst:314 msgid "" "On success, the function returns a dictionary where keys and values are " "strings. Values have their special characters like ``\"`` and ``$`` " @@ -498,7 +502,7 @@ msgstr "" "``PRETTY_NAME`` 總會按照標準來定義。所有其他欄位都是可選的。根據不同廠商可能" "會包括額外的欄位。" -#: ../../library/platform.rst:318 +#: ../../library/platform.rst:320 msgid "" "Note that fields like ``NAME``, ``VERSION``, and ``VARIANT`` are strings " "suitable for presentation to users. Programs should use fields like ``ID``, " @@ -509,11 +513,11 @@ msgstr "" "串。程式應當使用 ``ID``、``ID_LIKE``、``VERSION_ID`` 或 ``VARIANT_ID`` 等欄位" "來標識 Linux 發行版。" -#: ../../library/platform.rst:323 +#: ../../library/platform.rst:325 msgid "Example::" msgstr "範例: ::" -#: ../../library/platform.rst:325 +#: ../../library/platform.rst:327 msgid "" "def get_like_distro():\n" " info = platform.freedesktop_os_release()\n" @@ -524,90 +528,90 @@ msgid "" " return ids" msgstr "" -#: ../../library/platform.rst:337 +#: ../../library/platform.rst:339 msgid "Android platform" msgstr "Android 平台" -#: ../../library/platform.rst:342 +#: ../../library/platform.rst:344 msgid "" "Get Android device information. Returns a :func:`~collections.namedtuple` " "with the following attributes. Values which cannot be determined are set to " "the defaults given as parameters." msgstr "" -#: ../../library/platform.rst:346 +#: ../../library/platform.rst:348 msgid "``release`` - Android version, as a string (e.g. ``\"14\"``)." msgstr "" -#: ../../library/platform.rst:348 +#: ../../library/platform.rst:350 msgid "" "``api_level`` - API level of the running device, as an integer (e.g. ``34`` " -"for Android 14). To get the API level which Python was built against, " -"see :func:`sys.getandroidapilevel`." +"for Android 14). To get the API level which Python was built against, see :" +"func:`sys.getandroidapilevel`." msgstr "" -#: ../../library/platform.rst:352 +#: ../../library/platform.rst:354 msgid "" "``manufacturer`` - `Manufacturer name `__." msgstr "" -#: ../../library/platform.rst:355 +#: ../../library/platform.rst:357 msgid "" "``model`` - `Model name `__ – typically the marketing name or model number." msgstr "" -#: ../../library/platform.rst:359 +#: ../../library/platform.rst:361 msgid "" "``device`` - `Device name `__ – typically the model number or a codename." msgstr "" -#: ../../library/platform.rst:363 +#: ../../library/platform.rst:365 msgid "" "``is_emulator`` - ``True`` if the device is an emulator; ``False`` if it's a " "physical device." msgstr "" -#: ../../library/platform.rst:366 +#: ../../library/platform.rst:368 msgid "" -"Google maintains a `list of known model and device names `__." +"Google maintains a `list of known model and device names `__." msgstr "" -#: ../../library/platform.rst:374 +#: ../../library/platform.rst:376 msgid "Command-line usage" msgstr "命令列用法" -#: ../../library/platform.rst:376 +#: ../../library/platform.rst:378 msgid "" ":mod:`platform` can also be invoked directly using the :option:`-m` switch " "of the interpreter::" msgstr "" -#: ../../library/platform.rst:379 +#: ../../library/platform.rst:381 msgid "python -m platform [--terse] [--nonaliased] [{nonaliased,terse} ...]" msgstr "python -m platform [--terse] [--nonaliased] [{nonaliased,terse} ...]" -#: ../../library/platform.rst:381 +#: ../../library/platform.rst:383 msgid "The following options are accepted:" msgstr "可接受以下選項:" -#: ../../library/platform.rst:387 +#: ../../library/platform.rst:389 msgid "" -"Print terse information about the platform. This is equivalent to " -"calling :func:`platform.platform` with the *terse* argument set to ``True``." +"Print terse information about the platform. This is equivalent to calling :" +"func:`platform.platform` with the *terse* argument set to ``True``." msgstr "" -#: ../../library/platform.rst:392 +#: ../../library/platform.rst:394 msgid "" "Print platform information without system/OS name aliasing. This is " "equivalent to calling :func:`platform.platform` with the *aliased* argument " "set to ``True``." msgstr "" -#: ../../library/platform.rst:396 +#: ../../library/platform.rst:398 msgid "" "You can also pass one or more positional arguments (``terse``, " "``nonaliased``) to explicitly control the output format. These behave " diff --git a/library/pprint.po b/library/pprint.po index 7a0e5fc47a..324d72d73a 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-15 00:14+0000\n" +"POT-Creation-Date: 2025-10-13 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,22 +43,18 @@ msgid "" msgstr "" #: ../../library/pprint.rst:25 -msgid "Dictionaries are sorted by key before the display is computed." -msgstr "" - -#: ../../library/pprint.rst:27 msgid "Added support for pretty-printing :class:`types.SimpleNamespace`." msgstr "" -#: ../../library/pprint.rst:30 +#: ../../library/pprint.rst:28 msgid "Added support for pretty-printing :class:`dataclasses.dataclass`." msgstr "" -#: ../../library/pprint.rst:36 +#: ../../library/pprint.rst:34 msgid "Functions" msgstr "函式" -#: ../../library/pprint.rst:41 +#: ../../library/pprint.rst:39 msgid "" "Prints the formatted representation of *object*, followed by a newline. This " "function may be used in the interactive interpreter instead of the :func:" @@ -70,28 +66,28 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/pprint.rst:46 +#: ../../library/pprint.rst:44 msgid "The object to be printed." msgstr "將被印出的物件。" -#: ../../library/pprint.rst:49 +#: ../../library/pprint.rst:47 msgid "" "A file-like object to which the output will be written by calling its :meth:" "`!write` method. If ``None`` (the default), :data:`sys.stdout` is used." msgstr "" -#: ../../library/pprint.rst:55 +#: ../../library/pprint.rst:53 msgid "The amount of indentation added for each nesting level." msgstr "" -#: ../../library/pprint.rst:58 +#: ../../library/pprint.rst:56 msgid "" "The desired maximum number of characters per line in the output. If a " "structure cannot be formatted within the width constraint, a best effort " "will be made." msgstr "" -#: ../../library/pprint.rst:63 +#: ../../library/pprint.rst:61 msgid "" "The number of nesting levels which may be printed. If the data structure " "being printed is too deep, the next contained level is replaced by ``...``. " @@ -99,7 +95,7 @@ msgid "" "objects being formatted." msgstr "" -#: ../../library/pprint.rst:71 +#: ../../library/pprint.rst:69 msgid "" "Control the way long :term:`sequences ` are formatted. If " "``False`` (the default), each item of a sequence will be formatted on a " @@ -107,26 +103,26 @@ msgid "" "be formatted on each output line." msgstr "" -#: ../../library/pprint.rst:78 +#: ../../library/pprint.rst:76 msgid "" "If ``True``, dictionaries will be formatted with their keys sorted, " "otherwise they will be displayed in insertion order (the default)." msgstr "" -#: ../../library/pprint.rst:83 +#: ../../library/pprint.rst:81 msgid "" "If ``True``, integers will be formatted with the ``_`` character for a " "thousands separator, otherwise underscores are not displayed (the default)." msgstr "" -#: ../../library/pprint.rst:105 +#: ../../library/pprint.rst:103 msgid "" "Alias for :func:`~pprint.pp` with *sort_dicts* set to ``True`` by default, " "which would automatically sort the dictionaries' keys, you might want to " "use :func:`~pprint.pp` instead where it is ``False`` by default." msgstr "" -#: ../../library/pprint.rst:113 +#: ../../library/pprint.rst:111 msgid "" "Return the formatted representation of *object* as a string. *indent*, " "*width*, *depth*, *compact*, *sort_dicts* and *underscore_numbers* are " @@ -134,21 +130,21 @@ msgid "" "and their meanings are as described in the documentation above." msgstr "" -#: ../../library/pprint.rst:123 +#: ../../library/pprint.rst:121 msgid "" "Determine if the formatted representation of *object* is \"readable\", or " "can be used to reconstruct the value using :func:`eval`. This always " "returns ``False`` for recursive objects." msgstr "" -#: ../../library/pprint.rst:133 +#: ../../library/pprint.rst:131 msgid "" "Determine if *object* requires a recursive representation. This function is " "subject to the same limitations as noted in :func:`saferepr` below and may " "raise an :exc:`RecursionError` if it fails to detect a recursive object." msgstr "" -#: ../../library/pprint.rst:140 +#: ../../library/pprint.rst:138 msgid "" "Return a string representation of *object*, protected against recursion in " "some common data structures, namely instances of :class:`dict`, :class:" @@ -158,53 +154,53 @@ msgid "" "id=number>``. The representation is not otherwise formatted." msgstr "" -#: ../../library/pprint.rst:153 +#: ../../library/pprint.rst:151 msgid "PrettyPrinter Objects" msgstr "PrettyPrinter 物件" -#: ../../library/pprint.rst:160 +#: ../../library/pprint.rst:158 msgid "Construct a :class:`PrettyPrinter` instance." msgstr "建立一個 :class:`PrettyPrinter` 實例。" -#: ../../library/pprint.rst:162 +#: ../../library/pprint.rst:160 msgid "" "Arguments have the same meaning as for :func:`~pprint.pp`. Note that they " "are in a different order, and that *sort_dicts* defaults to ``True``." msgstr "" -#: ../../library/pprint.rst:189 +#: ../../library/pprint.rst:187 msgid "Added the *compact* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/pprint.rst:192 +#: ../../library/pprint.rst:190 msgid "Added the *sort_dicts* parameter." msgstr "新增 *sort_dicts* 參數。" -#: ../../library/pprint.rst:195 +#: ../../library/pprint.rst:193 msgid "Added the *underscore_numbers* parameter." msgstr "新增 *underscore_numbers* 參數。" -#: ../../library/pprint.rst:198 +#: ../../library/pprint.rst:196 msgid "No longer attempts to write to :data:`!sys.stdout` if it is ``None``." msgstr "" -#: ../../library/pprint.rst:202 +#: ../../library/pprint.rst:200 msgid ":class:`PrettyPrinter` instances have the following methods:" msgstr ":class:`PrettyPrinter` 實例有以下方法:" -#: ../../library/pprint.rst:207 +#: ../../library/pprint.rst:205 msgid "" "Return the formatted representation of *object*. This takes into account " "the options passed to the :class:`PrettyPrinter` constructor." msgstr "" -#: ../../library/pprint.rst:213 +#: ../../library/pprint.rst:211 msgid "" "Print the formatted representation of *object* on the configured stream, " "followed by a newline." msgstr "" -#: ../../library/pprint.rst:216 +#: ../../library/pprint.rst:214 msgid "" "The following methods provide the implementations for the corresponding " "functions of the same names. Using these methods on an instance is slightly " @@ -212,7 +208,7 @@ msgid "" "created." msgstr "" -#: ../../library/pprint.rst:226 +#: ../../library/pprint.rst:224 msgid "" "Determine if the formatted representation of the object is \"readable,\" or " "can be used to reconstruct the value using :func:`eval`. Note that this " @@ -221,18 +217,18 @@ msgid "" "returns ``False``." msgstr "" -#: ../../library/pprint.rst:235 +#: ../../library/pprint.rst:233 msgid "Determine if the object requires a recursive representation." msgstr "" -#: ../../library/pprint.rst:237 +#: ../../library/pprint.rst:235 msgid "" "This method is provided as a hook to allow subclasses to modify the way " "objects are converted to strings. The default implementation uses the " "internals of the :func:`saferepr` implementation." msgstr "" -#: ../../library/pprint.rst:244 +#: ../../library/pprint.rst:242 msgid "" "Returns three values: the formatted version of *object* as a string, a flag " "indicating whether the result is readable, and a flag indicating whether " @@ -250,18 +246,18 @@ msgid "" "of the current call." msgstr "" -#: ../../library/pprint.rst:262 +#: ../../library/pprint.rst:260 msgid "Example" msgstr "範例" -#: ../../library/pprint.rst:264 +#: ../../library/pprint.rst:262 msgid "" "To demonstrate several uses of the :func:`~pprint.pp` function and its " "parameters, let's fetch information about a project from `PyPI `_::" msgstr "" -#: ../../library/pprint.rst:267 +#: ../../library/pprint.rst:265 msgid "" ">>> import json\n" ">>> import pprint\n" @@ -275,11 +271,11 @@ msgstr "" ">>> with urlopen('https://pypi.org/pypi/sampleproject/1.2.0/json') as resp:\n" "... project_info = json.load(resp)['info']" -#: ../../library/pprint.rst:273 +#: ../../library/pprint.rst:271 msgid "In its basic form, :func:`~pprint.pp` shows the whole object::" msgstr "" -#: ../../library/pprint.rst:275 +#: ../../library/pprint.rst:273 msgid "" ">>> pprint.pp(project_info)\n" "{'author': 'The Python Packaging Authority',\n" @@ -395,13 +391,13 @@ msgstr "" " 'summary': 'A sample Python project',\n" " 'version': '1.2.0'}" -#: ../../library/pprint.rst:329 +#: ../../library/pprint.rst:327 msgid "" "The result can be limited to a certain *depth* (ellipsis is used for deeper " "contents)::" msgstr "" -#: ../../library/pprint.rst:332 +#: ../../library/pprint.rst:330 msgid "" ">>> pprint.pp(project_info, depth=1)\n" "{'author': 'The Python Packaging Authority',\n" @@ -495,13 +491,13 @@ msgstr "" " 'summary': 'A sample Python project',\n" " 'version': '1.2.0'}" -#: ../../library/pprint.rst:375 +#: ../../library/pprint.rst:373 msgid "" "Additionally, maximum character *width* can be suggested. If a long object " "cannot be split, the specified width will be exceeded::" msgstr "" -#: ../../library/pprint.rst:378 +#: ../../library/pprint.rst:376 msgid "" ">>> pprint.pp(project_info, depth=1, width=60)\n" "{'author': 'The Python Packaging Authority',\n" @@ -595,18 +591,18 @@ msgstr "" " 'summary': 'A sample Python project',\n" " 'version': '1.2.0'}" -#: ../../library/pprint.rst:121 ../../library/pprint.rst:224 +#: ../../library/pprint.rst:119 ../../library/pprint.rst:222 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/pprint.rst:121 ../../library/pprint.rst:224 +#: ../../library/pprint.rst:119 ../../library/pprint.rst:222 msgid "eval" msgstr "eval" -#: ../../library/pprint.rst:155 +#: ../../library/pprint.rst:153 msgid "..." msgstr "..." -#: ../../library/pprint.rst:155 +#: ../../library/pprint.rst:153 msgid "placeholder" msgstr "placeholder(佔位符號)" diff --git a/library/queue.po b/library/queue.po index 37d2064dea..434dd0f202 100644 --- a/library/queue.po +++ b/library/queue.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2022-09-27 00:12+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,11 +50,11 @@ msgid "" "kept sorted (using the :mod:`heapq` module) and the lowest valued entry is " "retrieved first." msgstr "" -"此 module 實作三種型別的佇列,它們僅在取出條目的順序上有所不同。" -"在 :abbr:`FIFO (first-in, first-out)` 佇列中,先加入的任務是第一個被取出的。" -"在 :abbr:`LIFO (last-in, first-out)` 佇列中,最近被加入的條目是第一個被取出的" -"(像堆疊 (stack) 一樣操作)。使用優先佇列 (priority queue) 時,條目將保持排序" -"狀態(使用 :mod:`heapq` module),並先取出最低值條目。" +"此 module 實作三種型別的佇列,它們僅在取出條目的順序上有所不同。在 :abbr:" +"`FIFO (first-in, first-out)` 佇列中,先加入的任務是第一個被取出的。在 :abbr:" +"`LIFO (last-in, first-out)` 佇列中,最近被加入的條目是第一個被取出的(像堆疊 " +"(stack) 一樣操作)。使用優先佇列 (priority queue) 時,條目將保持排序狀態(使" +"用 :mod:`heapq` module),並先取出最低值條目。" #: ../../library/queue.rst:24 msgid "" @@ -159,30 +159,27 @@ msgstr "" #: ../../library/queue.rst:84 msgid "" -"Exception raised when non-blocking :meth:`~Queue.get` " -"(or :meth:`~Queue.get_nowait`) is called on a :class:`Queue` object which is " -"empty." +"Exception raised when non-blocking :meth:`~Queue.get` (or :meth:`~Queue." +"get_nowait`) is called on a :class:`Queue` object which is empty." msgstr "" -"當對一個空的 :class:`Queue` 物件呼叫非阻塞的 (non-" -"blocking) :meth:`~Queue.get`\\ (或 :meth:`~Queue.get_nowait`\\ )將引發此例" -"外。" +"當對一個空的 :class:`Queue` 物件呼叫非阻塞的 (non-blocking) :meth:`~Queue." +"get`\\ (或 :meth:`~Queue.get_nowait`\\ )將引發此例外。" #: ../../library/queue.rst:91 msgid "" -"Exception raised when non-blocking :meth:`~Queue.put` " -"(or :meth:`~Queue.put_nowait`) is called on a :class:`Queue` object which is " -"full." +"Exception raised when non-blocking :meth:`~Queue.put` (or :meth:`~Queue." +"put_nowait`) is called on a :class:`Queue` object which is full." msgstr "" -"當對一個已滿的 :class:`Queue` 物件呼叫非阻塞的 :meth:`~Queue.put`\\ " -"(或 :meth:`~Queue.put_nowait`\\ )將引發此例外。" +"當對一個已滿的 :class:`Queue` 物件呼叫非阻塞的 :meth:`~Queue.put`\\ (或 :" +"meth:`~Queue.put_nowait`\\ )將引發此例外。" #: ../../library/queue.rst:98 msgid "" "Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is called on " "a :class:`Queue` object which has been shut down." msgstr "" -"當對一個已關閉的 :class:`Queue` 物件呼叫 :meth:`~Queue.put` " -"或 :meth:`~Queue.get` 時將引發此例外。" +"當對一個已關閉的 :class:`Queue` 物件呼叫 :meth:`~Queue.put` 或 :meth:`~Queue." +"get` 時將引發此例外。" #: ../../library/queue.rst:107 msgid "Queue Objects" @@ -190,8 +187,8 @@ msgstr "佇列物件" #: ../../library/queue.rst:109 msgid "" -"Queue objects (:class:`Queue`, :class:`LifoQueue`, " -"or :class:`PriorityQueue`) provide the public methods described below." +"Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:" +"`PriorityQueue`) provide the public methods described below." msgstr "" "佇列物件(:class:`Queue`、:class:`LifoQueue`、:class:`PriorityQueue`)提供下" "面描述的公用 method。" @@ -251,7 +248,7 @@ msgstr "如果佇列已被關閉,則引發 :exc:`ShutDown`。" msgid "Equivalent to ``put(item, block=False)``." msgstr "等效於 ``put(item, block=False)``。" -#: ../../library/queue.rst:156 ../../library/queue.rst:297 +#: ../../library/queue.rst:156 ../../library/queue.rst:313 msgid "" "Remove and return an item from the queue. If optional args *block* is true " "and *timeout* is ``None`` (the default), block if necessary until an item is " @@ -263,17 +260,17 @@ msgid "" msgstr "" "從佇列中移除並回傳一個項目。如果可選的 args *block* 為 true,且 *timeout* 為 " "``None``\\ (預設值),則在必要時阻塞,直到有可用的項目。如果 *timeout* 是正" -"數,則最多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引" -"發 :exc:`Empty` 例外。否則(*block* 為 false),如果立即可用,則回傳一個項" -"目,否則引發 :exc:`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" +"數,則最多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:" +"`Empty` 例外。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引" +"發 :exc:`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" #: ../../library/queue.rst:163 msgid "" "Prior to 3.0 on POSIX systems, and for all versions on Windows, if *block* " "is true and *timeout* is ``None``, this operation goes into an " "uninterruptible wait on an underlying lock. This means that no exceptions " -"can occur, and in particular a SIGINT will not trigger " -"a :exc:`KeyboardInterrupt`." +"can occur, and in particular a SIGINT will not trigger a :exc:" +"`KeyboardInterrupt`." msgstr "" "在 POSIX 系統的 3.0 版之前,以及 Windows 的所有版本,如果 *block* 為 true 且 " "*timeout* 為 ``None``,則此操作將在底層鎖上進入不間斷等待。這意味著不會發生例" @@ -285,7 +282,7 @@ msgid "" "the queue has been shut down immediately." msgstr "如果佇列已被關閉且為空,或佇列已立即關閉,則引發 :exc:`ShutDown`。" -#: ../../library/queue.rst:174 ../../library/queue.rst:307 +#: ../../library/queue.rst:174 ../../library/queue.rst:323 msgid "Equivalent to ``get(False)``." msgstr "等效於 ``get(False)``。" @@ -300,9 +297,8 @@ msgstr "" #: ../../library/queue.rst:182 msgid "" "Indicate that a formerly enqueued task is complete. Used by queue consumer " -"threads. For each :meth:`get` used to fetch a task, a subsequent call " -"to :meth:`task_done` tells the queue that the processing on the task is " -"complete." +"threads. For each :meth:`get` used to fetch a task, a subsequent call to :" +"meth:`task_done` tells the queue that the processing on the task is complete." msgstr "" "表示先前放入佇列的任務已完成。由佇列消費者執行緒使用。對於用來提取任務的每" "個 :meth:`get`,隨後呼叫 :meth:`task_done` 告訴佇列任務的處理已完成。" @@ -313,36 +309,34 @@ msgid "" "been processed (meaning that a :meth:`task_done` call was received for every " "item that had been :meth:`put` into the queue)." msgstr "" -"如果目前 :meth:`join` 阻塞,它將會在所有項目都已處理完畢後恢復(代表對於" -"以 :meth:`put` 放進佇列的每個項目,都要收到 :meth:`task_done` 的呼叫)。" +"如果目前 :meth:`join` 阻塞,它將會在所有項目都已處理完畢後恢復(代表對於以 :" +"meth:`put` 放進佇列的每個項目,都要收到 :meth:`task_done` 的呼叫)。" #: ../../library/queue.rst:190 msgid "" -"``shutdown(immediate=True)`` calls :meth:`task_done` for each remaining item " -"in the queue." -msgstr "" - -#: ../../library/queue.rst:193 -msgid "" "Raises a :exc:`ValueError` if called more times than there were items placed " "in the queue." msgstr "如果呼叫次數超過佇列中放置的項目數量,則引發 :exc:`ValueError`。" -#: ../../library/queue.rst:199 +#: ../../library/queue.rst:196 msgid "Blocks until all items in the queue have been gotten and processed." msgstr "持續阻塞直到佇列中的所有項目都已被取得並處理完畢。" -#: ../../library/queue.rst:201 +#: ../../library/queue.rst:198 msgid "" "The count of unfinished tasks goes up whenever an item is added to the " -"queue. The count goes down whenever a consumer thread " -"calls :meth:`task_done` to indicate that the item was retrieved and all work " -"on it is complete. When the count of unfinished tasks drops to " -"zero, :meth:`join` unblocks." +"queue. The count goes down whenever a consumer thread calls :meth:" +"`task_done` to indicate that the item was retrieved and all work on it is " +"complete. When the count of unfinished tasks drops to zero, :meth:`join` " +"unblocks." +msgstr "" +"每當項目被加到佇列中時,未完成任務的計數都會增加。每當消費者執行緒呼叫 :meth:" +"`task_done` 以指示該項目已被取出並且對其的所有工作都已完成時,計數就會下降。" +"當未完成任務的計數降至零時,:meth:`join` 將停止阻塞。" + +#: ../../library/queue.rst:205 +msgid "Waiting for task completion" msgstr "" -"每當項目被加到佇列中時,未完成任務的計數都會增加。每當消費者執行緒呼" -"叫 :meth:`task_done` 以指示該項目已被取出並且對其的所有工作都已完成時,計數就" -"會下降。當未完成任務的計數降至零時,:meth:`join` 將停止阻塞。" #: ../../library/queue.rst:207 msgid "Example of how to wait for enqueued tasks to be completed::" @@ -380,48 +374,72 @@ msgstr "" #: ../../library/queue.rst:236 msgid "" -":class:`Queue` objects can be made to prevent further interaction by " -"shutting them down." +"When no longer needed, :class:`Queue` objects can be wound down until empty " +"or terminated immediately with a hard shutdown." msgstr "" #: ../../library/queue.rst:241 -msgid "" -"Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` " -"raise :exc:`ShutDown`." +msgid "Put a :class:`Queue` instance into a shutdown mode." msgstr "" -#: ../../library/queue.rst:244 +#: ../../library/queue.rst:243 msgid "" -"By default, :meth:`~Queue.get` on a shut down queue will only raise once the " -"queue is empty. Set *immediate* to true to make :meth:`~Queue.get` raise " -"immediately instead." +"The queue can no longer grow. Future calls to :meth:`~Queue.put` raise :exc:" +"`ShutDown`. Currently blocked callers of :meth:`~Queue.put` will be " +"unblocked and will raise :exc:`ShutDown` in the formerly blocked thread." msgstr "" #: ../../library/queue.rst:248 msgid "" -"All blocked callers of :meth:`~Queue.put` and :meth:`~Queue.get` will be " -"unblocked. If *immediate* is true, a task will be marked as done for each " -"remaining item in the queue, which may unblock callers " -"of :meth:`~Queue.join`." +"If *immediate* is false (the default), the queue can be wound down normally " +"with :meth:`~Queue.get` calls to extract tasks that have already been loaded." +msgstr "" + +#: ../../library/queue.rst:252 +msgid "" +"And if :meth:`~Queue.task_done` is called for each remaining task, a " +"pending :meth:`~Queue.join` will be unblocked normally." +msgstr "" + +#: ../../library/queue.rst:255 +msgid "" +"Once the queue is empty, future calls to :meth:`~Queue.get` will raise :exc:" +"`ShutDown`." +msgstr "" + +#: ../../library/queue.rst:258 +msgid "" +"If *immediate* is true, the queue is terminated immediately. The queue is " +"drained to be completely empty. All callers of :meth:`~Queue.join` are " +"unblocked regardless of the number of unfinished tasks. Blocked callers of :" +"meth:`~Queue.get` are unblocked and will raise :exc:`ShutDown` because the " +"queue is empty." +msgstr "" + +#: ../../library/queue.rst:265 +msgid "" +"Use caution when using :meth:`~Queue.join` with *immediate* set to true. " +"This unblocks the join even when no work has been done on the tasks, " +"violating the usual invariant for joining a queue." msgstr "" -#: ../../library/queue.rst:257 +#: ../../library/queue.rst:273 msgid "SimpleQueue Objects" msgstr "SimpleQueue 物件" -#: ../../library/queue.rst:259 +#: ../../library/queue.rst:275 msgid "" ":class:`SimpleQueue` objects provide the public methods described below." msgstr ":class:`SimpleQueue` 物件提供下面描述的公用 method。" -#: ../../library/queue.rst:263 +#: ../../library/queue.rst:279 msgid "" "Return the approximate size of the queue. Note, qsize() > 0 doesn't " "guarantee that a subsequent get() will not block." msgstr "" "傳回佇列的近似大小。注意,qsize() > 0 並不能保證後續的 get() 不會阻塞。" -#: ../../library/queue.rst:269 +#: ../../library/queue.rst:285 msgid "" "Return ``True`` if the queue is empty, ``False`` otherwise. If empty() " "returns ``False`` it doesn't guarantee that a subsequent call to get() will " @@ -430,7 +448,7 @@ msgstr "" "如果佇列為空,則回傳 ``True``,否則回傳 ``False``。如果 empty() 回傳 " "``False``,則不保證後續呼叫 get() 不會阻塞。" -#: ../../library/queue.rst:276 +#: ../../library/queue.rst:292 msgid "" "Put *item* into the queue. The method never blocks and always succeeds " "(except for potential low-level errors such as failure to allocate memory). " @@ -441,7 +459,7 @@ msgstr "" "像是分配記憶體失敗)。可選的 args *block* 和 *timeout* 會被忽略,它們僅是為了" "與 :meth:`Queue.put` 相容才存在。" -#: ../../library/queue.rst:282 +#: ../../library/queue.rst:298 msgid "" "This method has a C implementation which is reentrant. That is, a ``put()`` " "or ``get()`` call can be interrupted by another ``put()`` call in the same " @@ -454,18 +472,18 @@ msgstr "" "鎖 (deadlock) 或損壞佇列中的內部狀態。這使得它適合在解構子 (destructor) 中使" "用,像是 ``__del__`` method 或 :mod:`weakref` 回呼函式 (callback)。" -#: ../../library/queue.rst:291 +#: ../../library/queue.rst:307 msgid "" -"Equivalent to ``put(item, block=False)``, provided for compatibility " -"with :meth:`Queue.put_nowait`." +"Equivalent to ``put(item, block=False)``, provided for compatibility with :" +"meth:`Queue.put_nowait`." msgstr "" "等效於 ``put(item, block=False)``,用於與 :meth:`Queue.put_nowait` 相容。" -#: ../../library/queue.rst:312 +#: ../../library/queue.rst:328 msgid "Class :class:`multiprocessing.Queue`" msgstr "Class :class:`multiprocessing.Queue`" -#: ../../library/queue.rst:313 +#: ../../library/queue.rst:329 msgid "" "A queue class for use in a multi-processing (rather than multi-threading) " "context." @@ -473,12 +491,12 @@ msgstr "" "用於多行程處理 (multi-processing)(而非多執行緒)情境 (context) 的佇列 " "class。" -#: ../../library/queue.rst:316 +#: ../../library/queue.rst:332 msgid "" ":class:`collections.deque` is an alternative implementation of unbounded " -"queues with fast atomic :meth:`~collections.deque.append` " -"and :meth:`~collections.deque.popleft` operations that do not require " -"locking and also support indexing." +"queues with fast atomic :meth:`~collections.deque.append` and :meth:" +"`~collections.deque.popleft` operations that do not require locking and also " +"support indexing." msgstr "" ":class:`collections.deque` 是無界佇列的替代實作,有快速且具原子性 (atomic) " "的 :meth:`~collections.deque.append` 和 :meth:`~collections.deque.popleft` 操" diff --git a/library/resource.po b/library/resource.po index 5dc559f788..8948ae221a 100644 --- a/library/resource.po +++ b/library/resource.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,11 +28,11 @@ msgid "" msgstr "" #: ../../library/resource.rst:16 ../../library/resource.rst:104 -#: ../../library/resource.rst:180 ../../library/resource.rst:192 -#: ../../library/resource.rst:201 ../../library/resource.rst:210 -#: ../../library/resource.rst:220 ../../library/resource.rst:229 -#: ../../library/resource.rst:239 ../../library/resource.rst:252 -#: ../../library/resource.rst:260 ../../library/resource.rst:268 +#: ../../library/resource.rst:181 ../../library/resource.rst:193 +#: ../../library/resource.rst:202 ../../library/resource.rst:211 +#: ../../library/resource.rst:221 ../../library/resource.rst:230 +#: ../../library/resource.rst:241 ../../library/resource.rst:255 +#: ../../library/resource.rst:264 ../../library/resource.rst:273 msgid "Availability" msgstr "可用性" @@ -93,7 +93,7 @@ msgstr "" msgid "" "Sets new limits of consumption of *resource*. The *limits* argument must be " "a tuple ``(soft, hard)`` of two integers describing the new limits. A value " -"of :data:`~resource.RLIM_INFINITY` can be used to request a limit that is " +"of :const:`~resource.RLIM_INFINITY` can be used to request a limit that is " "unlimited." msgstr "" @@ -101,7 +101,7 @@ msgstr "" msgid "" "Raises :exc:`ValueError` if an invalid resource is specified, if the new " "soft limit exceeds the hard limit, or if a process tries to raise its hard " -"limit. Specifying a limit of :data:`~resource.RLIM_INFINITY` when the hard " +"limit. Specifying a limit of :const:`~resource.RLIM_INFINITY` when the hard " "or system limit for that resource is not unlimited will result in a :exc:" "`ValueError`. A process with the effective UID of super-user can request " "any valid limit value, including unlimited, but :exc:`ValueError` will still " @@ -115,7 +115,7 @@ msgid "" msgstr "" #: ../../library/resource.rst:81 -msgid "VxWorks only supports setting :data:`RLIMIT_NOFILE`." +msgid "VxWorks only supports setting :const:`RLIMIT_NOFILE`." msgstr "" #: ../../library/resource.rst:83 @@ -224,45 +224,47 @@ msgid "The maximum address space which may be locked in memory." msgstr "" #: ../../library/resource.rst:178 -msgid "The largest area of mapped memory which the process may occupy." +msgid "" +"The largest area of mapped memory which the process may occupy. Usually an " +"alias of :const:`RLIMIT_AS`." msgstr "" -#: ../../library/resource.rst:185 +#: ../../library/resource.rst:186 msgid "" "The maximum area (in bytes) of address space which may be taken by the " "process." msgstr "" -#: ../../library/resource.rst:190 +#: ../../library/resource.rst:191 msgid "The number of bytes that can be allocated for POSIX message queues." msgstr "" -#: ../../library/resource.rst:199 +#: ../../library/resource.rst:200 msgid "The ceiling for the process's nice level (calculated as 20 - rlim_cur)." msgstr "" -#: ../../library/resource.rst:208 +#: ../../library/resource.rst:209 msgid "The ceiling of the real-time priority." msgstr "" -#: ../../library/resource.rst:217 +#: ../../library/resource.rst:218 msgid "" "The time limit (in microseconds) on CPU time that a process can spend under " "real-time scheduling without making a blocking syscall." msgstr "" -#: ../../library/resource.rst:227 +#: ../../library/resource.rst:228 msgid "The number of signals which the process may queue." msgstr "" -#: ../../library/resource.rst:235 +#: ../../library/resource.rst:237 msgid "" "The maximum size (in bytes) of socket buffer usage for this user. This " "limits the amount of network memory, and hence the amount of mbufs, that " "this user may hold at any time." msgstr "" -#: ../../library/resource.rst:245 +#: ../../library/resource.rst:248 msgid "" "The maximum size (in bytes) of the swap space that may be reserved or used " "by all of this user id's processes. This limit is enforced only if bit 1 of " @@ -271,23 +273,23 @@ msgid "" "this sysctl." msgstr "" -#: ../../library/resource.rst:258 +#: ../../library/resource.rst:262 msgid "The maximum number of pseudo-terminals created by this user id." msgstr "" -#: ../../library/resource.rst:266 +#: ../../library/resource.rst:271 msgid "The maximum number of kqueues this user id is allowed to create." msgstr "" -#: ../../library/resource.rst:273 +#: ../../library/resource.rst:279 msgid "Resource Usage" msgstr "" -#: ../../library/resource.rst:275 +#: ../../library/resource.rst:281 msgid "These functions are used to retrieve resource usage information:" msgstr "" -#: ../../library/resource.rst:280 +#: ../../library/resource.rst:286 msgid "" "This function returns an object that describes the resources consumed by " "either the current process or its children, as specified by the *who* " @@ -295,11 +297,11 @@ msgid "" "`!RUSAGE_\\*` constants described below." msgstr "" -#: ../../library/resource.rst:285 +#: ../../library/resource.rst:291 msgid "A simple example::" msgstr "一個簡單範例: ::" -#: ../../library/resource.rst:287 +#: ../../library/resource.rst:293 msgid "" "from resource import *\n" "import time\n" @@ -314,7 +316,7 @@ msgid "" "print(getrusage(RUSAGE_SELF))" msgstr "" -#: ../../library/resource.rst:299 +#: ../../library/resource.rst:305 msgid "" "The fields of the return value each describe how a particular system " "resource has been used, e.g. amount of time spent running is user mode or " @@ -323,13 +325,13 @@ msgid "" "is using." msgstr "" -#: ../../library/resource.rst:304 +#: ../../library/resource.rst:310 msgid "" "For backward compatibility, the return value is also accessible as a tuple " "of 16 elements." msgstr "" -#: ../../library/resource.rst:307 +#: ../../library/resource.rst:313 msgid "" "The fields :attr:`ru_utime` and :attr:`ru_stime` of the return value are " "floating-point values representing the amount of time spent executing in " @@ -339,249 +341,249 @@ msgid "" "summary is presented here:" msgstr "" -#: ../../library/resource.rst:314 +#: ../../library/resource.rst:320 msgid "Index" msgstr "" -#: ../../library/resource.rst:314 +#: ../../library/resource.rst:320 msgid "Field" msgstr "" -#: ../../library/resource.rst:314 +#: ../../library/resource.rst:320 msgid "Resource" msgstr "" -#: ../../library/resource.rst:316 +#: ../../library/resource.rst:322 msgid "``0``" msgstr "``0``" -#: ../../library/resource.rst:316 +#: ../../library/resource.rst:322 msgid ":attr:`ru_utime`" msgstr ":attr:`ru_utime`" -#: ../../library/resource.rst:316 +#: ../../library/resource.rst:322 msgid "time in user mode (float seconds)" msgstr "" -#: ../../library/resource.rst:318 +#: ../../library/resource.rst:324 msgid "``1``" msgstr "``1``" -#: ../../library/resource.rst:318 +#: ../../library/resource.rst:324 msgid ":attr:`ru_stime`" msgstr ":attr:`ru_stime`" -#: ../../library/resource.rst:318 +#: ../../library/resource.rst:324 msgid "time in system mode (float seconds)" msgstr "" -#: ../../library/resource.rst:320 +#: ../../library/resource.rst:326 msgid "``2``" msgstr "``2``" -#: ../../library/resource.rst:320 +#: ../../library/resource.rst:326 msgid ":attr:`ru_maxrss`" msgstr ":attr:`ru_maxrss`" -#: ../../library/resource.rst:320 +#: ../../library/resource.rst:326 msgid "maximum resident set size" msgstr "" -#: ../../library/resource.rst:322 +#: ../../library/resource.rst:328 msgid "``3``" msgstr "``3``" -#: ../../library/resource.rst:322 +#: ../../library/resource.rst:328 msgid ":attr:`ru_ixrss`" msgstr ":attr:`ru_ixrss`" -#: ../../library/resource.rst:322 +#: ../../library/resource.rst:328 msgid "shared memory size" msgstr "" -#: ../../library/resource.rst:324 +#: ../../library/resource.rst:330 msgid "``4``" msgstr "``4``" -#: ../../library/resource.rst:324 +#: ../../library/resource.rst:330 msgid ":attr:`ru_idrss`" msgstr ":attr:`ru_idrss`" -#: ../../library/resource.rst:324 +#: ../../library/resource.rst:330 msgid "unshared memory size" msgstr "" -#: ../../library/resource.rst:326 +#: ../../library/resource.rst:332 msgid "``5``" msgstr "``5``" -#: ../../library/resource.rst:326 +#: ../../library/resource.rst:332 msgid ":attr:`ru_isrss`" msgstr ":attr:`ru_isrss`" -#: ../../library/resource.rst:326 +#: ../../library/resource.rst:332 msgid "unshared stack size" msgstr "" -#: ../../library/resource.rst:328 +#: ../../library/resource.rst:334 msgid "``6``" msgstr "``6``" -#: ../../library/resource.rst:328 +#: ../../library/resource.rst:334 msgid ":attr:`ru_minflt`" msgstr ":attr:`ru_minflt`" -#: ../../library/resource.rst:328 +#: ../../library/resource.rst:334 msgid "page faults not requiring I/O" msgstr "" -#: ../../library/resource.rst:330 +#: ../../library/resource.rst:336 msgid "``7``" msgstr "``7``" -#: ../../library/resource.rst:330 +#: ../../library/resource.rst:336 msgid ":attr:`ru_majflt`" msgstr ":attr:`ru_majflt`" -#: ../../library/resource.rst:330 +#: ../../library/resource.rst:336 msgid "page faults requiring I/O" msgstr "" -#: ../../library/resource.rst:332 +#: ../../library/resource.rst:338 msgid "``8``" msgstr "``8``" -#: ../../library/resource.rst:332 +#: ../../library/resource.rst:338 msgid ":attr:`ru_nswap`" msgstr ":attr:`ru_nswap`" -#: ../../library/resource.rst:332 +#: ../../library/resource.rst:338 msgid "number of swap outs" msgstr "" -#: ../../library/resource.rst:334 +#: ../../library/resource.rst:340 msgid "``9``" msgstr "``9``" -#: ../../library/resource.rst:334 +#: ../../library/resource.rst:340 msgid ":attr:`ru_inblock`" msgstr ":attr:`ru_inblock`" -#: ../../library/resource.rst:334 +#: ../../library/resource.rst:340 msgid "block input operations" msgstr "" -#: ../../library/resource.rst:336 +#: ../../library/resource.rst:342 msgid "``10``" msgstr "``10``" -#: ../../library/resource.rst:336 +#: ../../library/resource.rst:342 msgid ":attr:`ru_oublock`" msgstr ":attr:`ru_oublock`" -#: ../../library/resource.rst:336 +#: ../../library/resource.rst:342 msgid "block output operations" msgstr "" -#: ../../library/resource.rst:338 +#: ../../library/resource.rst:344 msgid "``11``" msgstr "``11``" -#: ../../library/resource.rst:338 +#: ../../library/resource.rst:344 msgid ":attr:`ru_msgsnd`" msgstr ":attr:`ru_msgsnd`" -#: ../../library/resource.rst:338 +#: ../../library/resource.rst:344 msgid "messages sent" msgstr "" -#: ../../library/resource.rst:340 +#: ../../library/resource.rst:346 msgid "``12``" msgstr "``12``" -#: ../../library/resource.rst:340 +#: ../../library/resource.rst:346 msgid ":attr:`ru_msgrcv`" msgstr ":attr:`ru_msgrcv`" -#: ../../library/resource.rst:340 +#: ../../library/resource.rst:346 msgid "messages received" msgstr "" -#: ../../library/resource.rst:342 +#: ../../library/resource.rst:348 msgid "``13``" msgstr "``13``" -#: ../../library/resource.rst:342 +#: ../../library/resource.rst:348 msgid ":attr:`ru_nsignals`" msgstr ":attr:`ru_nsignals`" -#: ../../library/resource.rst:342 +#: ../../library/resource.rst:348 msgid "signals received" msgstr "" -#: ../../library/resource.rst:344 +#: ../../library/resource.rst:350 msgid "``14``" msgstr "``14``" -#: ../../library/resource.rst:344 +#: ../../library/resource.rst:350 msgid ":attr:`ru_nvcsw`" msgstr ":attr:`ru_nvcsw`" -#: ../../library/resource.rst:344 +#: ../../library/resource.rst:350 msgid "voluntary context switches" msgstr "" -#: ../../library/resource.rst:346 +#: ../../library/resource.rst:352 msgid "``15``" msgstr "``15``" -#: ../../library/resource.rst:346 +#: ../../library/resource.rst:352 msgid ":attr:`ru_nivcsw`" msgstr ":attr:`ru_nivcsw`" -#: ../../library/resource.rst:346 +#: ../../library/resource.rst:352 msgid "involuntary context switches" msgstr "" -#: ../../library/resource.rst:349 +#: ../../library/resource.rst:355 msgid "" "This function will raise a :exc:`ValueError` if an invalid *who* parameter " "is specified. It may also raise :exc:`error` exception in unusual " "circumstances." msgstr "" -#: ../../library/resource.rst:355 +#: ../../library/resource.rst:361 msgid "" "Returns the number of bytes in a system page. (This need not be the same as " "the hardware page size.)" msgstr "" -#: ../../library/resource.rst:358 +#: ../../library/resource.rst:364 msgid "" "The following :const:`!RUSAGE_\\*` symbols are passed to the :func:" "`getrusage` function to specify which processes information should be " "provided for." msgstr "" -#: ../../library/resource.rst:364 +#: ../../library/resource.rst:370 msgid "" "Pass to :func:`getrusage` to request resources consumed by the calling " "process, which is the sum of resources used by all threads in the process." msgstr "" -#: ../../library/resource.rst:370 +#: ../../library/resource.rst:376 msgid "" "Pass to :func:`getrusage` to request resources consumed by child processes " "of the calling process which have been terminated and waited for." msgstr "" -#: ../../library/resource.rst:376 +#: ../../library/resource.rst:382 msgid "" "Pass to :func:`getrusage` to request resources consumed by both the current " "process and child processes. May not be available on all systems." msgstr "" -#: ../../library/resource.rst:382 +#: ../../library/resource.rst:388 msgid "" "Pass to :func:`getrusage` to request resources consumed by the current " "thread. May not be available on all systems." diff --git a/library/signal.po b/library/signal.po index 1d05f6b606..00fa652b4e 100644 --- a/library/signal.po +++ b/library/signal.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-15 00:15+0000\n" +"POT-Creation-Date: 2025-10-12 00:15+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-" @@ -51,8 +51,8 @@ msgstr "" msgid "" "A handler for a particular signal, once set, remains installed until it is " "explicitly reset (Python emulates the BSD style interface regardless of the " -"underlying implementation), with the exception of the handler " -"for :const:`SIGCHLD`, which follows the underlying implementation." +"underlying implementation), with the exception of the handler for :const:" +"`SIGCHLD`, which follows the underlying implementation." msgstr "" "特定訊號的處理程式一旦被設定,就會一直被安裝,直到被明確地重設為止 (不管底層" "的實作為何,Python 皆模擬出 BSD 風格的介面),但 :const:`SIGCHLD` 的處理程式除" @@ -86,12 +86,12 @@ msgstr "" #: ../../library/signal.rst:42 msgid "" -"It makes little sense to catch synchronous errors like :const:`SIGFPE` " -"or :const:`SIGSEGV` that are caused by an invalid operation in C code. " -"Python will return from the signal handler to the C code, which is likely to " -"raise the same signal again, causing Python to apparently hang. From Python " -"3.3 onwards, you can use the :mod:`faulthandler` module to report on " -"synchronous errors." +"It makes little sense to catch synchronous errors like :const:`SIGFPE` or :" +"const:`SIGSEGV` that are caused by an invalid operation in C code. Python " +"will return from the signal handler to the C code, which is likely to raise " +"the same signal again, causing Python to apparently hang. From Python 3.3 " +"onwards, you can use the :mod:`faulthandler` module to report on synchronous " +"errors." msgstr "" "捕捉像 :const:`SIGFPE` 或 :const:`SIGSEGV` 這類由 C 程式碼中無效操作所引起的" "同步錯誤是沒有意義的。Python 將從訊號處理程式中回傳到 C 程式碼,而 C 程式碼很" @@ -131,8 +131,8 @@ msgid "" "instead." msgstr "" "Python 訊號處理程式總是在主直譯器的主 Python 執行緒中執行,即使訊號是在另一個" -"執行緒中接收到的。這意味著訊號不能用來做為執行緒間通訊的方式。你可以使" -"用 :mod:`threading` 模組的同步原語 (synchronization primitive) 來代替。" +"執行緒中接收到的。這意味著訊號不能用來做為執行緒間通訊的方式。你可以使用 :" +"mod:`threading` 模組的同步原語 (synchronization primitive) 來代替。" #: ../../library/signal.rst:69 msgid "" @@ -146,22 +146,20 @@ msgstr "模組內容" #: ../../library/signal.rst:75 msgid "" -"signal (SIG*), handler (:const:`SIG_DFL`, :const:`SIG_IGN`) and sigmask " -"(:const:`SIG_BLOCK`, :const:`SIG_UNBLOCK`, :const:`SIG_SETMASK`) related " -"constants listed below were turned into :class:`enums ` " -"(:class:`Signals`, :class:`Handlers` and :class:`Sigmasks` " -"respectively). :func:`getsignal`, :func:`pthread_sigmask`, :func:`sigpending` " -"and :func:`sigwait` functions return human-readable :class:`enums " -"` as :class:`Signals` objects." +"signal (SIG*), handler (:const:`SIG_DFL`, :const:`SIG_IGN`) and sigmask (:" +"const:`SIG_BLOCK`, :const:`SIG_UNBLOCK`, :const:`SIG_SETMASK`) related " +"constants listed below were turned into :class:`enums ` (:" +"class:`Signals`, :class:`Handlers` and :class:`Sigmasks` respectively). :" +"func:`getsignal`, :func:`pthread_sigmask`, :func:`sigpending` and :func:" +"`sigwait` functions return human-readable :class:`enums ` as :" +"class:`Signals` objects." msgstr "" "下面列出的訊號 (SIG*)、處理器(:const:`SIG_DFL`、:const:`SIG_IGN`)和訊號遮" -"罩 (sigmask)" -"(:const:`SIG_BLOCK`、:const:`SIG_UNBLOCK`、:const:`SIG_SETMASK`)的相關常數" -"被轉換成 :class:`enums `\\ " -"(:class:`Signals`、:class:`Handlers` " -"和 :class:`Sigmasks`)。:func:`getsignal`、:func:`pthread_sigmask`、:func:`sigpending` " -"和 :func:`sigwait` 函式會回傳可被人類閱讀的\\ :class:`枚舉 `\\ " -"作為 :class:`Signals` 物件。" +"罩 (sigmask)(:const:`SIG_BLOCK`、:const:`SIG_UNBLOCK`、:const:" +"`SIG_SETMASK`)的相關常數被轉換成 :class:`enums `\\ (:class:" +"`Signals`、:class:`Handlers` 和 :class:`Sigmasks`)。:func:`getsignal`、:" +"func:`pthread_sigmask`、:func:`sigpending` 和 :func:`sigwait` 函式會回傳可被" +"人類閱讀的\\ :class:`枚舉 `\\ 作為 :class:`Signals` 物件。" #: ../../library/signal.rst:85 msgid "The signal module defines three enums:" @@ -174,37 +172,39 @@ msgstr "SIG* 常數和 CTRL_* 常數的 :class:`enum.IntEnum` 集合。" #: ../../library/signal.rst:95 msgid "" -":class:`enum.IntEnum` collection the constants :const:`SIG_DFL` " -"and :const:`SIG_IGN`." +":class:`enum.IntEnum` collection the constants :const:`SIG_DFL` and :const:" +"`SIG_IGN`." msgstr "" ":const:`SIG_DFL` 和 :const:`SIG_IGN` 常數的 :class:`enum.IntEnum` 集合。" #: ../../library/signal.rst:101 msgid "" -":class:`enum.IntEnum` collection the " -"constants :const:`SIG_BLOCK`, :const:`SIG_UNBLOCK` and :const:`SIG_SETMASK`." +":class:`enum.IntEnum` collection the constants :const:`SIG_BLOCK`, :const:" +"`SIG_UNBLOCK` and :const:`SIG_SETMASK`." msgstr "" -":const:`SIG_BLOCK`、:const:`SIG_UNBLOCK` 和 :const:`SIG_SETMASK` 常數" -"的 :class:`enum.IntEnum` 集合。" +":const:`SIG_BLOCK`、:const:`SIG_UNBLOCK` 和 :const:`SIG_SETMASK` 常數的 :" +"class:`enum.IntEnum` 集合。" #: ../../library/signal.rst:103 ../../library/signal.rst:136 #: ../../library/signal.rst:142 ../../library/signal.rst:148 #: ../../library/signal.rst:154 ../../library/signal.rst:160 #: ../../library/signal.rst:166 ../../library/signal.rst:180 #: ../../library/signal.rst:198 ../../library/signal.rst:206 -#: ../../library/signal.rst:217 ../../library/signal.rst:232 -#: ../../library/signal.rst:238 ../../library/signal.rst:244 -#: ../../library/signal.rst:262 ../../library/signal.rst:272 -#: ../../library/signal.rst:351 ../../library/signal.rst:390 -#: ../../library/signal.rst:414 ../../library/signal.rst:437 -#: ../../library/signal.rst:471 ../../library/signal.rst:501 -#: ../../library/signal.rst:508 ../../library/signal.rst:563 -#: ../../library/signal.rst:605 ../../library/signal.rst:620 -#: ../../library/signal.rst:646 ../../library/signal.rst:666 +#: ../../library/signal.rst:212 ../../library/signal.rst:218 +#: ../../library/signal.rst:233 ../../library/signal.rst:248 +#: ../../library/signal.rst:254 ../../library/signal.rst:260 +#: ../../library/signal.rst:266 ../../library/signal.rst:284 +#: ../../library/signal.rst:294 ../../library/signal.rst:373 +#: ../../library/signal.rst:412 ../../library/signal.rst:436 +#: ../../library/signal.rst:459 ../../library/signal.rst:493 +#: ../../library/signal.rst:523 ../../library/signal.rst:530 +#: ../../library/signal.rst:585 ../../library/signal.rst:627 +#: ../../library/signal.rst:642 ../../library/signal.rst:667 +#: ../../library/signal.rst:687 msgid "Availability" msgstr "可用性" -#: ../../library/signal.rst:105 ../../library/signal.rst:473 +#: ../../library/signal.rst:105 ../../library/signal.rst:495 msgid "" "See the man page :manpage:`sigprocmask(2)` and :manpage:`pthread_sigmask(3)` " "for further information." @@ -224,8 +224,8 @@ msgid "" "default action for :const:`SIGCHLD` is to simply ignore it." msgstr "" "這是兩種標準訊號處理選項之一;它會簡單地執行訊號的預設功能。例如,在大多數系" -"統上,:const:`SIGQUIT` 的預設動作是轉儲 (dump) 核心並退出," -"而 :const:`SIGCHLD` 的預設動作是直接忽略。" +"統上,:const:`SIGQUIT` 的預設動作是轉儲 (dump) 核心並退出,而 :const:" +"`SIGCHLD` 的預設動作是直接忽略。" #: ../../library/signal.rst:124 msgid "" @@ -307,10 +307,24 @@ msgid "Default action is to ignore the signal." msgstr "預設動作是忽略訊號。" #: ../../library/signal.rst:210 +msgid "Profiling timer expired." +msgstr "" + +#: ../../library/signal.rst:216 +#, fuzzy +msgid "Terminal quit signal." +msgstr "終止訊號。" + +#: ../../library/signal.rst:222 msgid "Segmentation fault: invalid memory reference." msgstr "記憶體區段錯誤 (segmentation fault):無效記憶體參照。" -#: ../../library/signal.rst:214 +#: ../../library/signal.rst:226 +#, fuzzy +msgid "Stop executing (cannot be caught or ignored)." +msgstr "它無法被捕捉、阻擋或忽略。" + +#: ../../library/signal.rst:230 msgid "" "Stack fault on coprocessor. The Linux kernel does not raise this signal: it " "can only be raised in user space." @@ -318,56 +332,59 @@ msgstr "" "輔助處理器 (coprocessor) 上的堆疊錯誤 (stack fault)。Linux 核心不會引發此訊" "號:它只能在使用者空間 (user space) 中引發。" -#: ../../library/signal.rst:219 +#: ../../library/signal.rst:235 msgid "" -"On architectures where the signal is available. See the man " -"page :manpage:`signal(7)` for further information." +"On architectures where the signal is available. See the man page :manpage:" +"`signal(7)` for further information." msgstr "" "在訊號可用的架構上。請參閱 :manpage:`signal(7)` 線上手冊以取得更多資訊。" -#: ../../library/signal.rst:226 +#: ../../library/signal.rst:242 msgid "Termination signal." msgstr "終止訊號。" -#: ../../library/signal.rst:230 +#: ../../library/signal.rst:246 msgid "User-defined signal 1." msgstr "使用者定義訊號 1。" -#: ../../library/signal.rst:236 +#: ../../library/signal.rst:252 msgid "User-defined signal 2." msgstr "使用者定義訊號 2。" -#: ../../library/signal.rst:242 +#: ../../library/signal.rst:258 +msgid "Virtual timer expired." +msgstr "" + +#: ../../library/signal.rst:264 msgid "Window resize signal." msgstr "視窗調整大小訊號。" -#: ../../library/signal.rst:248 +#: ../../library/signal.rst:270 +#, fuzzy msgid "" "All the signal numbers are defined symbolically. For example, the hangup " "signal is defined as :const:`signal.SIGHUP`; the variable names are " "identical to the names used in C programs, as found in ````. The " -"Unix man page for ':c:func:`signal`' lists the existing signals (on some " -"systems this is :manpage:`signal(2)`, on others the list is " -"in :manpage:`signal(7)`). Note that not all systems define the same set of " -"signal names; only those names defined by the system are defined by this " -"module." +"Unix man page for '``signal``' lists the existing signals (on some systems " +"this is :manpage:`signal(2)`, on others the list is in :manpage:" +"`signal(7)`). Note that not all systems define the same set of signal names; " +"only those names defined by the system are defined by this module." msgstr "" -"所有的訊號編號都是以符號定義的。例如,掛斷訊號被定義" -"為 :const:`signal.SIGHUP`;變數名稱與 C 程式中使用的名稱相同,可在 " -"```` 中找到。Unix 線上手冊 ':c:func:`signal`' 列出了現有的訊號(在" -"某些系統上是 :manpage:`signal(2)`,在其他系統上是在 :manpage:`signal(7)` " -"中)。請注意,並非所有系統都會定義同一套訊號名稱;只有那些由系統所定義的名稱" -"才會由這個模組定義。" +"所有的訊號編號都是以符號定義的。例如,掛斷訊號被定義為 :const:`signal." +"SIGHUP`;變數名稱與 C 程式中使用的名稱相同,可在 ```` 中找到。Unix " +"線上手冊 ':c:func:`signal`' 列出了現有的訊號(在某些系統上是 :manpage:" +"`signal(2)`,在其他系統上是在 :manpage:`signal(7)` 中)。請注意,並非所有系統" +"都會定義同一套訊號名稱;只有那些由系統所定義的名稱才會由這個模組定義。" -#: ../../library/signal.rst:259 +#: ../../library/signal.rst:281 msgid "" "The signal corresponding to the :kbd:`Ctrl+C` keystroke event. This signal " "can only be used with :func:`os.kill`." msgstr "" -"與 :kbd:`Ctrl+C` 擊鍵 (keystroke) 事件相對應的訊號。此訊號只能" -"與 :func:`os.kill` 搭配使用。" +"與 :kbd:`Ctrl+C` 擊鍵 (keystroke) 事件相對應的訊號。此訊號只能與 :func:`os." +"kill` 搭配使用。" -#: ../../library/signal.rst:269 +#: ../../library/signal.rst:291 msgid "" "The signal corresponding to the :kbd:`Ctrl+Break` keystroke event. This " "signal can only be used with :func:`os.kill`." @@ -375,26 +392,26 @@ msgstr "" "與 :kbd:`Ctrl+Break` 擊鍵事件相對應的訊號。此訊號只能與 :func:`os.kill` 搭配" "使用。" -#: ../../library/signal.rst:279 +#: ../../library/signal.rst:301 msgid "" -"One more than the number of the highest signal number. " -"Use :func:`valid_signals` to get valid signal numbers." +"One more than the number of the highest signal number. Use :func:" +"`valid_signals` to get valid signal numbers." msgstr "" "比最高編號訊號的編號多一。使用 :func:`valid_signals` 來取得有效的訊號編號。" -#: ../../library/signal.rst:285 +#: ../../library/signal.rst:307 msgid "" "Decrements interval timer in real time, and delivers :const:`SIGALRM` upon " "expiration." msgstr "即時減少間隔計時器 (interval timer),並在到期時送出 :const:`SIGALRM`。" -#: ../../library/signal.rst:291 +#: ../../library/signal.rst:313 msgid "" "Decrements interval timer only when the process is executing, and delivers " "SIGVTALRM upon expiration." msgstr "僅在執行行程時遞減間隔計時器,並在到期時傳送 SIGVTALRM。" -#: ../../library/signal.rst:297 +#: ../../library/signal.rst:319 msgid "" "Decrements interval timer both when the process executes and when the system " "is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, this " @@ -405,19 +422,19 @@ msgstr "" "這個計時器通常用來分析 (profile) 應用程式在使用者空間與核心空間 (kernel " "space) 所花費的時間。SIGPROF 會在到期時傳送。" -#: ../../library/signal.rst:305 +#: ../../library/signal.rst:327 msgid "" "A possible value for the *how* parameter to :func:`pthread_sigmask` " "indicating that signals are to be blocked." msgstr ":func:`pthread_sigmask` 的 *how* 參數的可能值,表示訊號將被阻檔。" -#: ../../library/signal.rst:312 +#: ../../library/signal.rst:334 msgid "" "A possible value for the *how* parameter to :func:`pthread_sigmask` " "indicating that signals are to be unblocked." msgstr ":func:`pthread_sigmask` 的 *how* 參數的可能值,表示訊號將被解除阻檔。" -#: ../../library/signal.rst:319 +#: ../../library/signal.rst:341 msgid "" "A possible value for the *how* parameter to :func:`pthread_sigmask` " "indicating that the signal mask is to be replaced." @@ -425,32 +442,32 @@ msgstr "" ":func:`pthread_sigmask` 的 *how* 參數的可能值,表示訊號遮罩 (signal mask) 要" "被取代。" -#: ../../library/signal.rst:325 +#: ../../library/signal.rst:347 msgid "The :mod:`signal` module defines one exception:" msgstr ":mod:`signal` 模組定義了一個例外:" -#: ../../library/signal.rst:329 +#: ../../library/signal.rst:351 msgid "" -"Raised to signal an error from the underlying :func:`setitimer` " -"or :func:`getitimer` implementation. Expect this error if an invalid " -"interval timer or a negative time is passed to :func:`setitimer`. This error " -"is a subtype of :exc:`OSError`." +"Raised to signal an error from the underlying :func:`setitimer` or :func:" +"`getitimer` implementation. Expect this error if an invalid interval timer " +"or a negative time is passed to :func:`setitimer`. This error is a subtype " +"of :exc:`OSError`." msgstr "" "當 :func:`setitimer` 或 :func:`getitimer` 底層實作發生錯誤時引發訊號。如果傳" "給 :func:`setitimer` 的是無效的間隔計時器或負數時間,則預期會發生此錯誤。這個" "錯誤是 :exc:`OSError` 的子型別。" -#: ../../library/signal.rst:334 +#: ../../library/signal.rst:356 msgid "" -"This error used to be a subtype of :exc:`IOError`, which is now an alias " -"of :exc:`OSError`." +"This error used to be a subtype of :exc:`IOError`, which is now an alias of :" +"exc:`OSError`." msgstr "此錯誤過去是 :exc:`IOError` 的子型別,現在是 :exc:`OSError` 的別名。" -#: ../../library/signal.rst:339 +#: ../../library/signal.rst:361 msgid "The :mod:`signal` module defines the following functions:" msgstr ":mod:`signal` 模組定義了下列函式:" -#: ../../library/signal.rst:344 +#: ../../library/signal.rst:366 msgid "" "If *time* is non-zero, this function requests that a :const:`SIGALRM` signal " "be sent to the process in *time* seconds. Any previously scheduled alarm is " @@ -466,37 +483,37 @@ msgstr "" "則不會去排程任何警報,且已排程的警報會被取消。如果回傳值為零,則代表目前未排" "程任何警報。" -#: ../../library/signal.rst:353 +#: ../../library/signal.rst:375 msgid "See the man page :manpage:`alarm(2)` for further information." msgstr "更多資訊請見 :manpage:`alarm(2)` 線上手冊。" -#: ../../library/signal.rst:358 +#: ../../library/signal.rst:380 msgid "" "Return the current signal handler for the signal *signalnum*. The returned " -"value may be a callable Python object, or one of the special " -"values :const:`signal.SIG_IGN`, :const:`signal.SIG_DFL` or :const:`None`. " -"Here, :const:`signal.SIG_IGN` means that the signal was previously " -"ignored, :const:`signal.SIG_DFL` means that the default way of handling the " -"signal was previously in use, and ``None`` means that the previous signal " -"handler was not installed from Python." +"value may be a callable Python object, or one of the special values :const:" +"`signal.SIG_IGN`, :const:`signal.SIG_DFL` or :const:`None`. Here, :const:" +"`signal.SIG_IGN` means that the signal was previously ignored, :const:" +"`signal.SIG_DFL` means that the default way of handling the signal was " +"previously in use, and ``None`` means that the previous signal handler was " +"not installed from Python." msgstr "" "回傳訊號 *signalnum* 的目前訊號處理程式。回傳值可以是一個可呼叫的 Python 物" -"件,或是特殊值 :const:`signal.SIG_IGN`、:const:`signal.SIG_DFL` " -"或 :const:`None` 之一。這裡的 :const:`signal.SIG_IGN` 表示訊號先前被忽" -"略,:const:`signal.SIG_DFL` 表示訊號先前使用預設的處理方式,而 ``None`` 表示" -"先前的訊號處理程式並未從 Python 安裝。" +"件,或是特殊值 :const:`signal.SIG_IGN`、:const:`signal.SIG_DFL` 或 :const:" +"`None` 之一。這裡的 :const:`signal.SIG_IGN` 表示訊號先前被忽略,:const:" +"`signal.SIG_DFL` 表示訊號先前使用預設的處理方式,而 ``None`` 表示先前的訊號處" +"理程式並未從 Python 安裝。" -#: ../../library/signal.rst:369 +#: ../../library/signal.rst:391 msgid "" -"Returns the description of signal *signalnum*, such as \"Interrupt\" " -"for :const:`SIGINT`. Returns :const:`None` if *signalnum* has no " -"description. Raises :exc:`ValueError` if *signalnum* is invalid." +"Returns the description of signal *signalnum*, such as \"Interrupt\" for :" +"const:`SIGINT`. Returns :const:`None` if *signalnum* has no description. " +"Raises :exc:`ValueError` if *signalnum* is invalid." msgstr "" "回傳訊號 *signalnum* 的描述,例如 :const:`SIGINT` 的 \"Interrupt\"。如果 " -"*signalnum* 沒有描述,則回傳 :const:`None`。如果 *signalnum* 無效則會引" -"發 :exc:`ValueError`。" +"*signalnum* 沒有描述,則回傳 :const:`None`。如果 *signalnum* 無效則會引發 :" +"exc:`ValueError`。" -#: ../../library/signal.rst:378 +#: ../../library/signal.rst:400 msgid "" "Return the set of valid signal numbers on this platform. This can be less " "than ``range(1, NSIG)`` if some signals are reserved by the system for " @@ -505,29 +522,29 @@ msgstr "" "回傳此平台上的有效訊號編號集合。如果某些訊號被系統保留作為內部使用,則此值可" "能小於 ``range(1, NSIG)``。" -#: ../../library/signal.rst:387 +#: ../../library/signal.rst:409 msgid "" "Cause the process to sleep until a signal is received; the appropriate " "handler will then be called. Returns nothing." msgstr "使行程休眠,直到接收到訊號;然後呼叫適當的處理程式。不會回傳任何東西。" -#: ../../library/signal.rst:392 +#: ../../library/signal.rst:414 msgid "See the man page :manpage:`signal(2)` for further information." msgstr "更多資訊請見 :manpage:`signal(2)` 線上手冊。" -#: ../../library/signal.rst:394 +#: ../../library/signal.rst:416 msgid "" -"See also :func:`sigwait`, :func:`sigwaitinfo`, :func:`sigtimedwait` " -"and :func:`sigpending`." +"See also :func:`sigwait`, :func:`sigwaitinfo`, :func:`sigtimedwait` and :" +"func:`sigpending`." msgstr "" -"也請見 :func:`sigwait`、:func:`sigwaitinfo`、:func:`sigtimedwait` " -"和 :func:`sigpending`。" +"也請見 :func:`sigwait`、:func:`sigwaitinfo`、:func:`sigtimedwait` 和 :func:" +"`sigpending`。" -#: ../../library/signal.rst:400 +#: ../../library/signal.rst:422 msgid "Sends a signal to the calling process. Returns nothing." msgstr "傳送訊號至呼叫的行程。不會回傳任何東西。" -#: ../../library/signal.rst:407 +#: ../../library/signal.rst:429 msgid "" "Send signal *sig* to the process referred to by file descriptor *pidfd*. " "Python does not currently support the *siginfo* parameter; it must be " @@ -537,11 +554,11 @@ msgstr "" "傳送訊號 *sig* 到檔案描述器 *pidfd* 所指的行程。Python 目前不支援 *siginfo* " "參數;它必須是 ``None``。*flags* 引數是提供給未來的擴充;目前沒有定義旗標值。" -#: ../../library/signal.rst:412 +#: ../../library/signal.rst:434 msgid "See the :manpage:`pidfd_send_signal(2)` man page for more information." msgstr "更多資訊請見 :manpage:`pidfd_send_signal(2)` 線上手冊。" -#: ../../library/signal.rst:420 +#: ../../library/signal.rst:442 msgid "" "Send the signal *signalnum* to the thread *thread_id*, another thread in the " "same process as the caller. The target thread can be executing any code " @@ -557,16 +574,16 @@ msgstr "" "`。因此,向特定 Python 執行緒發送訊號的唯一意義是強制執" "行中的系統呼叫以 :exc:`InterruptedError` 方式失敗。" -#: ../../library/signal.rst:428 +#: ../../library/signal.rst:450 msgid "" "Use :func:`threading.get_ident` or the :attr:`~threading.Thread.ident` " "attribute of :class:`threading.Thread` objects to get a suitable value for " "*thread_id*." msgstr "" -"使用 :func:`threading.get_ident` 或 :class:`threading.Thread` 物件" -"的 :attr:`~threading.Thread.ident` 屬性來取得 *thread_id* 的適當值。" +"使用 :func:`threading.get_ident` 或 :class:`threading.Thread` 物件的 :attr:" +"`~threading.Thread.ident` 屬性來取得 *thread_id* 的適當值。" -#: ../../library/signal.rst:432 +#: ../../library/signal.rst:454 msgid "" "If *signalnum* is 0, then no signal is sent, but error checking is still " "performed; this can be used to check if the target thread is still running." @@ -574,7 +591,7 @@ msgstr "" "如果 *signalnum* 為 0,則不會傳送訊號,但仍會執行錯誤檢查;這可用來檢查目標執" "行緒是否仍在執行。" -#: ../../library/signal.rst:435 +#: ../../library/signal.rst:457 msgid "" "Raises an :ref:`auditing event ` ``signal.pthread_kill`` with " "arguments ``thread_id``, ``signalnum``." @@ -582,15 +599,15 @@ msgstr "" "引發一個附帶引數 ``thread_id``、``signalnum`` 的\\ :ref:`稽核事件 " "` ``signal.pthread_kill``。" -#: ../../library/signal.rst:439 +#: ../../library/signal.rst:461 msgid "See the man page :manpage:`pthread_kill(3)` for further information." msgstr "更多資訊請見 :manpage:`pthread_kill(3)` 線上手冊。" -#: ../../library/signal.rst:441 +#: ../../library/signal.rst:463 msgid "See also :func:`os.kill`." msgstr "另請參閱 :func:`os.kill`。" -#: ../../library/signal.rst:448 +#: ../../library/signal.rst:470 msgid "" "Fetch and/or change the signal mask of the calling thread. The signal mask " "is the set of signals whose delivery is currently blocked for the caller. " @@ -599,19 +616,19 @@ msgstr "" "擷取和/或變更呼叫執行緒的訊號遮罩。訊號遮罩是目前阻擋呼叫者傳送的訊號集合。將" "舊的訊號遮罩作為一組訊號集合回傳。" -#: ../../library/signal.rst:452 +#: ../../library/signal.rst:474 msgid "" "The behavior of the call is dependent on the value of *how*, as follows." msgstr "呼叫的行為取決於 *how* 的值,如下所示。" -#: ../../library/signal.rst:454 +#: ../../library/signal.rst:476 msgid "" ":data:`SIG_BLOCK`: The set of blocked signals is the union of the current " "set and the *mask* argument." msgstr "" ":data:`SIG_BLOCK`:被阻檔的訊號集合是目前訊號集合與 *mask* 引數的聯集。" -#: ../../library/signal.rst:456 +#: ../../library/signal.rst:478 msgid "" ":data:`SIG_UNBLOCK`: The signals in *mask* are removed from the current set " "of blocked signals. It is permissible to attempt to unblock a signal which " @@ -620,23 +637,23 @@ msgstr "" ":data:`SIG_UNBLOCK`:將 *mask* 中的訊號從目前阻檔的訊號集合中移除。嘗試為未被" "阻檔的訊號解除阻檔是允許的。" -#: ../../library/signal.rst:459 +#: ../../library/signal.rst:481 msgid "" ":data:`SIG_SETMASK`: The set of blocked signals is set to the *mask* " "argument." msgstr ":data:`SIG_SETMASK`:將被阻檔的訊號集合設定為 *mask* 引數。" -#: ../../library/signal.rst:462 +#: ../../library/signal.rst:484 msgid "" -"*mask* is a set of signal numbers (e.g. " -"{:const:`signal.SIGINT`, :const:`signal.SIGTERM`}). " -"Use :func:`~signal.valid_signals` for a full mask including all signals." +"*mask* is a set of signal numbers (e.g. {:const:`signal.SIGINT`, :const:" +"`signal.SIGTERM`}). Use :func:`~signal.valid_signals` for a full mask " +"including all signals." msgstr "" -"*mask* 是一組訊號編號(例如 " -"{:const:`signal.SIGINT`, :const:`signal.SIGTERM`})的集合。使" -"用 :func:`~signal.valid_signals` 來取得包含所有訊號的完整遮罩。" +"*mask* 是一組訊號編號(例如 {:const:`signal.SIGINT`, :const:`signal." +"SIGTERM`})的集合。使用 :func:`~signal.valid_signals` 來取得包含所有訊號的完" +"整遮罩。" -#: ../../library/signal.rst:466 +#: ../../library/signal.rst:488 msgid "" "For example, ``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` reads the " "signal mask of the calling thread." @@ -644,59 +661,56 @@ msgstr "" "例如,``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` 會讀取呼叫執行緒的訊號" "遮罩。" -#: ../../library/signal.rst:469 +#: ../../library/signal.rst:491 msgid ":data:`SIGKILL` and :data:`SIGSTOP` cannot be blocked." msgstr ":data:`SIGKILL` 和 :data:`SIGSTOP` 不能被阻檔。" -#: ../../library/signal.rst:476 +#: ../../library/signal.rst:498 msgid "See also :func:`pause`, :func:`sigpending` and :func:`sigwait`." msgstr "另請參閱 :func:`pause`、:func:`sigpending` 與 :func:`sigwait`。" -#: ../../library/signal.rst:483 +#: ../../library/signal.rst:505 msgid "" -"Sets given interval timer (one " -"of :const:`signal.ITIMER_REAL`, :const:`signal.ITIMER_VIRTUAL` " -"or :const:`signal.ITIMER_PROF`) specified by *which* to fire after *seconds* " -"(float is accepted, different from :func:`alarm`) and after that every " -"*interval* seconds (if *interval* is non-zero). The interval timer specified " -"by *which* can be cleared by setting *seconds* to zero." +"Sets given interval timer (one of :const:`signal.ITIMER_REAL`, :const:" +"`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified by *which* " +"to fire after *seconds* (float is accepted, different from :func:`alarm`) " +"and after that every *interval* seconds (if *interval* is non-zero). The " +"interval timer specified by *which* can be cleared by setting *seconds* to " +"zero." msgstr "" -"設定由 *which* 指定的間隔計時器" -"(:const:`signal.ITIMER_REAL`、:const:`signal.ITIMER_VIRTUAL` " -"或 :const:`signal.ITIMER_PROF` 之一)並在*seconds*\\ (接受浮點數," -"與 :func:`alarm` 不同)之後啟動,在之後的每 *interval* 秒啟動一次(如果 " -"*interval* 非零)。*which* 指定的間隔計時器可透過將 *seconds* 設定為零來清除" -"它。" +"設定由 *which* 指定的間隔計時器(:const:`signal.ITIMER_REAL`、:const:`signal." +"ITIMER_VIRTUAL` 或 :const:`signal.ITIMER_PROF` 之一)並在*seconds*\\ (接受浮" +"點數,與 :func:`alarm` 不同)之後啟動,在之後的每 *interval* 秒啟動一次(如" +"果 *interval* 非零)。*which* 指定的間隔計時器可透過將 *seconds* 設定為零來清" +"除它。" -#: ../../library/signal.rst:490 +#: ../../library/signal.rst:512 msgid "" "When an interval timer fires, a signal is sent to the process. The signal " "sent is dependent on the timer being used; :const:`signal.ITIMER_REAL` will " -"deliver :const:`SIGALRM`, :const:`signal.ITIMER_VIRTUAL` " -"sends :const:`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will " -"deliver :const:`SIGPROF`." +"deliver :const:`SIGALRM`, :const:`signal.ITIMER_VIRTUAL` sends :const:" +"`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`." msgstr "" -"當間隔計時器啟動時,一個訊號會被傳送給行程。傳送的訊號取決於使用的計時" -"器;:const:`signal.ITIMER_REAL` 會傳" -"送 :const:`SIGALRM`,:const:`signal.ITIMER_VIRTUAL` 會傳" -"送 :const:`SIGVTALRM`,而 :const:`signal.ITIMER_PROF` 會傳" -"送 :const:`SIGPROF`。" +"當間隔計時器啟動時,一個訊號會被傳送給行程。傳送的訊號取決於使用的計時器;:" +"const:`signal.ITIMER_REAL` 會傳送 :const:`SIGALRM`,:const:`signal." +"ITIMER_VIRTUAL` 會傳送 :const:`SIGVTALRM`,而 :const:`signal.ITIMER_PROF` 會" +"傳送 :const:`SIGPROF`。" -#: ../../library/signal.rst:496 +#: ../../library/signal.rst:518 msgid "The old values are returned as a tuple: (delay, interval)." msgstr "舊值會以一個元組回傳:(delay, interval)。" -#: ../../library/signal.rst:498 +#: ../../library/signal.rst:520 msgid "" -"Attempting to pass an invalid interval timer will cause " -"an :exc:`ItimerError`." +"Attempting to pass an invalid interval timer will cause an :exc:" +"`ItimerError`." msgstr "嘗試傳入無效的間隔計時器會導致 :exc:`ItimerError`。" -#: ../../library/signal.rst:506 +#: ../../library/signal.rst:528 msgid "Returns current value of a given interval timer specified by *which*." msgstr "回傳由 *which* 指定之間隔計時器的目前值。" -#: ../../library/signal.rst:513 +#: ../../library/signal.rst:535 msgid "" "Set the wakeup file descriptor to *fd*. When a signal your program has " "registered a signal handler for is received, the signal number is written as " @@ -710,7 +724,7 @@ msgstr "" "fd。這可被函式庫用來喚醒輪詢 (wakeup a poll) 或 select 呼叫,讓訊號得以完全處" "理。" -#: ../../library/signal.rst:520 +#: ../../library/signal.rst:542 msgid "" "The old wakeup fd is returned (or -1 if file descriptor wakeup was not " "enabled). If *fd* is -1, file descriptor wakeup is disabled. If not -1, " @@ -721,7 +735,7 @@ msgstr "" "停用檔案描述器喚醒。如果不是 -1,*fd* 必須是非阻塞的。在再次呼叫輪詢或 " "select 之前,由函式庫來決定是否移除 *fd* 中的任何位元組。" -#: ../../library/signal.rst:525 ../../library/signal.rst:580 +#: ../../library/signal.rst:547 ../../library/signal.rst:602 msgid "" "When threads are enabled, this function can only be called from :ref:`the " "main thread of the main interpreter `; attempting to " @@ -731,7 +745,7 @@ msgstr "" "當啟用執行緒時,這個函式只能從\\ :ref:`主直譯器 `\\ 的主" "執行緒來呼叫;嘗試從其他執行緒呼叫它將會引發 :exc:`ValueError` 例外。" -#: ../../library/signal.rst:530 +#: ../../library/signal.rst:552 msgid "" "There are two common ways to use this function. In both approaches, you use " "the fd to wake up when a signal arrives, but then they differ in how they " @@ -740,7 +754,7 @@ msgstr "" "使用這個函式有兩種常見的方式。在這兩種方法中,當訊號抵達時,你都要使用 fd 來" "喚醒,但它們的不同之處在於如何判斷\\ *哪個或哪些*\\ 訊號有抵達。" -#: ../../library/signal.rst:535 +#: ../../library/signal.rst:557 msgid "" "In the first approach, we read the data out of the fd's buffer, and the byte " "values give you the signal numbers. This is simple, but in rare cases it can " @@ -756,7 +770,7 @@ msgstr "" "法,那麼你應該設定 ``warn_on_full_buffer=True``,這至少會在訊號丟失時將警告印" "出到 stderr。" -#: ../../library/signal.rst:544 +#: ../../library/signal.rst:566 msgid "" "In the second approach, we use the wakeup fd *only* for wakeups, and ignore " "the actual byte values. In this case, all we care about is whether the fd's " @@ -770,15 +784,15 @@ msgstr "" "如果你使用這種方法,那麼你應該設定 ``warn_on_full_buffer=False``,這樣你的使" "用者就不會被虛假的警告訊息所混淆。" -#: ../../library/signal.rst:551 +#: ../../library/signal.rst:573 msgid "On Windows, the function now also supports socket handles." msgstr "在 Windows 上,此功能現在也支援 socket 處理程式。" -#: ../../library/signal.rst:554 +#: ../../library/signal.rst:576 msgid "Added ``warn_on_full_buffer`` parameter." msgstr "新增 ``warn_on_full_buffer`` 參數。" -#: ../../library/signal.rst:559 +#: ../../library/signal.rst:581 msgid "" "Change system call restart behaviour: if *flag* is :const:`False`, system " "calls will be restarted when interrupted by signal *signalnum*, otherwise " @@ -787,11 +801,11 @@ msgstr "" "改變系統呼叫重新啟動的行為:如果 *flag* 是 :const:`False`,系統呼叫會在被訊" "號 *signalnum* 中斷時重新啟動,否則系統呼叫會被中斷。不會回傳任何東西。" -#: ../../library/signal.rst:565 +#: ../../library/signal.rst:587 msgid "See the man page :manpage:`siginterrupt(3)` for further information." msgstr "更多資訊請見 :manpage:`siginterrupt(3)` 線上手冊。" -#: ../../library/signal.rst:567 +#: ../../library/signal.rst:589 msgid "" "Note that installing a signal handler with :func:`signal` will reset the " "restart behaviour to interruptible by implicitly calling :c:func:`!" @@ -800,22 +814,21 @@ msgstr "" "請注意,使用 :func:`signal` 安裝訊號處理程式,會透過隱式呼叫 :c:func:`!" "siginterrupt` 來將重新啟動的行為重設為可中斷,且指定訊號的 *flag* 值為 true。" -#: ../../library/signal.rst:574 +#: ../../library/signal.rst:596 msgid "" "Set the handler for signal *signalnum* to the function *handler*. *handler* " "can be a callable Python object taking two arguments (see below), or one of " "the special values :const:`signal.SIG_IGN` or :const:`signal.SIG_DFL`. The " -"previous signal handler will be returned (see the description " -"of :func:`getsignal` above). (See the Unix man page :manpage:`signal(2)` " -"for further information.)" +"previous signal handler will be returned (see the description of :func:" +"`getsignal` above). (See the Unix man page :manpage:`signal(2)` for further " +"information.)" msgstr "" "將訊號 *signalnum* 的處理程式設定為函式 *handler*。*handler* 可以是帶兩個引數" -"的可呼叫 Python 物件(見下面),或是特殊值 :const:`signal.SIG_IGN` " -"或 :const:`signal.SIG_DFL` 之一。先前的訊號處理程式將會被回傳(請參閱上" -"面 :func:`getsignal` 的說明)。(更多資訊請參閱 Unix 線上手" -"冊 :manpage:`signal(2)`)。" +"的可呼叫 Python 物件(見下面),或是特殊值 :const:`signal.SIG_IGN` 或 :const:" +"`signal.SIG_DFL` 之一。先前的訊號處理程式將會被回傳(請參閱上面 :func:" +"`getsignal` 的說明)。(更多資訊請參閱 Unix 線上手冊 :manpage:`signal(2)`)。" -#: ../../library/signal.rst:585 +#: ../../library/signal.rst:607 msgid "" "The *handler* is called with two arguments: the signal number and the " "current stack frame (``None`` or a frame object; for a description of frame " @@ -826,22 +839,22 @@ msgstr "" "frame 物件;關於 frame 物件的描述,請參閱\\ :ref:`型別階層中的描述 `\\ 或 :mod:`inspect` 模組中的屬性描述)。" -#: ../../library/signal.rst:590 +#: ../../library/signal.rst:612 msgid "" -"On Windows, :func:`signal` can only be called " -"with :const:`SIGABRT`, :const:`SIGFPE`, :const:`SIGILL`, :const:`SIGINT`, :const:`SIGSEGV`, :const:`SIGTERM`, " -"or :const:`SIGBREAK`. A :exc:`ValueError` will be raised in any other case. " -"Note that not all systems define the same set of signal names; " +"On Windows, :func:`signal` can only be called with :const:`SIGABRT`, :const:" +"`SIGFPE`, :const:`SIGILL`, :const:`SIGINT`, :const:`SIGSEGV`, :const:" +"`SIGTERM`, or :const:`SIGBREAK`. A :exc:`ValueError` will be raised in any " +"other case. Note that not all systems define the same set of signal names; " "an :exc:`AttributeError` will be raised if a signal name is not defined as " "``SIG*`` module level constant." msgstr "" -"在 Windows 上,:func:`signal` 只能在使" -"用 :const:`SIGABRT`、:const:`SIGFPE`、:const:`SIGILL`、:const:`SIGINT`、:const:`SIGSEGV`、:const:`SIGTERM` " -"或 :const:`SIGBREAK` 時呼叫。在其他情況下會引發 :exc:`ValueError`。請注意,並" -"非所有系統都定義相同的訊號名稱;如果訊號名稱沒有被定義為 ``SIG*`` 模組層級常" -"數,則會引發 :exc:`AttributeError` 錯誤。" +"在 Windows 上,:func:`signal` 只能在使用 :const:`SIGABRT`、:const:`SIGFPE`、:" +"const:`SIGILL`、:const:`SIGINT`、:const:`SIGSEGV`、:const:`SIGTERM` 或 :" +"const:`SIGBREAK` 時呼叫。在其他情況下會引發 :exc:`ValueError`。請注意,並非所" +"有系統都定義相同的訊號名稱;如果訊號名稱沒有被定義為 ``SIG*`` 模組層級常數," +"則會引發 :exc:`AttributeError` 錯誤。" -#: ../../library/signal.rst:601 +#: ../../library/signal.rst:623 msgid "" "Examine the set of signals that are pending for delivery to the calling " "thread (i.e., the signals which have been raised while blocked). Return the " @@ -850,15 +863,15 @@ msgstr "" "檢查待傳送至呼叫執行緒的訊號集合(即阻檔時已被提出的訊號)。回傳待定訊號的集" "合。" -#: ../../library/signal.rst:607 +#: ../../library/signal.rst:629 msgid "See the man page :manpage:`sigpending(2)` for further information." msgstr "更多資訊請見 :manpage:`sigpending(2)` 線上手冊。" -#: ../../library/signal.rst:609 +#: ../../library/signal.rst:631 msgid "See also :func:`pause`, :func:`pthread_sigmask` and :func:`sigwait`." msgstr "另請參閱 :func:`pause`、:func:`pthread_sigmask` 與 :func:`sigwait`。" -#: ../../library/signal.rst:616 +#: ../../library/signal.rst:638 msgid "" "Suspend execution of the calling thread until the delivery of one of the " "signals specified in the signal set *sigset*. The function accepts the " @@ -868,55 +881,54 @@ msgstr "" "暫停呼叫執行緒的執行,直到送出訊號集合 *sigset* 中指定的一個訊號。函式接受訊" "號(將其從待定訊號清單中移除),並回傳訊號編號。" -#: ../../library/signal.rst:622 +#: ../../library/signal.rst:644 msgid "See the man page :manpage:`sigwait(3)` for further information." msgstr "更多資訊請見 :manpage:`sigwait(3)` 線上手冊。" -#: ../../library/signal.rst:624 +#: ../../library/signal.rst:646 msgid "" -"See " -"also :func:`pause`, :func:`pthread_sigmask`, :func:`sigpending`, :func:`sigwaitinfo` " -"and :func:`sigtimedwait`." +"See also :func:`pause`, :func:`pthread_sigmask`, :func:`sigpending`, :func:" +"`sigwaitinfo` and :func:`sigtimedwait`." msgstr "" -"另也請" -"見 :func:`pause`、:func:`pthread_sigmask`、:func:`sigpending`、:func:`sigwaitinfo` " -"和 :func:`sigtimedwait`。" +"另也請見 :func:`pause`、:func:`pthread_sigmask`、:func:`sigpending`、:func:" +"`sigwaitinfo` 和 :func:`sigtimedwait`。" -#: ../../library/signal.rst:632 +#: ../../library/signal.rst:654 msgid "" "Suspend execution of the calling thread until the delivery of one of the " "signals specified in the signal set *sigset*. The function accepts the " "signal and removes it from the pending list of signals. If one of the " "signals in *sigset* is already pending for the calling thread, the function " "will return immediately with information about that signal. The signal " -"handler is not called for the delivered signal. The function raises " -"an :exc:`InterruptedError` if it is interrupted by a signal that is not in " -"*sigset*." +"handler is not called for the delivered signal. The function raises an :exc:" +"`InterruptedError` if it is interrupted by a signal that is not in *sigset*." msgstr "" "暫停呼叫執行緒的執行,直到送出訊號集合 *sigset* 中指定的一個訊號。該函式接受" "訊號,並將其從待定訊號清單中移除。如果 *sigset* 中的一個訊號已經是呼叫執行緒" "的待定訊號,函式會立即回傳該訊號的相關資訊。對於已傳送的訊號,訊號處理程式不" -"會被呼叫。如果被不在 *sigset* 中的訊號中斷,函式會引" -"發 :exc:`InterruptedError`。" +"會被呼叫。如果被不在 *sigset* 中的訊號中斷,函式會引發 :exc:" +"`InterruptedError`。" -#: ../../library/signal.rst:641 +#: ../../library/signal.rst:663 +#, fuzzy msgid "" -"The return value is an object representing the data contained in " -"the :c:type:`siginfo_t` structure, " -"namely: :attr:`si_signo`, :attr:`si_code`, :attr:`si_errno`, :attr:`si_pid`, :attr:`si_uid`, :attr:`si_status`, :attr:`si_band`." +"The return value is an object representing the data contained in the " +"``siginfo_t`` structure, namely: ``si_signo``, ``si_code``, ``si_errno``, " +"``si_pid``, ``si_uid``, ``si_status``, ``si_band``." msgstr "" -"回傳值是一個物件,代表 :c:type:`siginfo_t` 結構所包含的資料," -"即 :attr:`si_signo`、:attr:`si_code`、:attr:`si_errno`、:attr:`si_pid`、:attr:`si_uid`、:attr:`si_status`、:attr:`si_band`。" +"回傳值是一個物件,代表 :c:type:`siginfo_t` 結構所包含的資料,即 :attr:" +"`si_signo`、:attr:`si_code`、:attr:`si_errno`、:attr:`si_pid`、:attr:" +"`si_uid`、:attr:`si_status`、:attr:`si_band`。" -#: ../../library/signal.rst:648 +#: ../../library/signal.rst:669 msgid "See the man page :manpage:`sigwaitinfo(2)` for further information." msgstr "更多資訊請見 :manpage:`sigwaitinfo(2)` 線上手冊。" -#: ../../library/signal.rst:650 +#: ../../library/signal.rst:671 msgid "See also :func:`pause`, :func:`sigwait` and :func:`sigtimedwait`." msgstr "另請參閱 :func:`pause`、:func:`sigwait` 與 :func:`sigtimedwait`。" -#: ../../library/signal.rst:654 +#: ../../library/signal.rst:675 msgid "" "The function is now retried if interrupted by a signal not in *sigset* and " "the signal handler does not raise an exception (see :pep:`475` for the " @@ -925,7 +937,7 @@ msgstr "" "現在如果被不在 *sigset* 中的訊號中斷,且訊號處理程式沒有引發例外,則會重試函" "式(理由請參閱 :pep:`475`)。" -#: ../../library/signal.rst:662 +#: ../../library/signal.rst:683 msgid "" "Like :func:`sigwaitinfo`, but takes an additional *timeout* argument " "specifying a timeout. If *timeout* is specified as ``0``, a poll is " @@ -934,15 +946,15 @@ msgstr "" "類似 :func:`sigwaitinfo`,但需要額外的 *timeout* 引數指定逾時時間。如果 " "*timeout* 指定為 ``0``,會執行輪詢。如果發生逾時則會回傳 :const:`None`。" -#: ../../library/signal.rst:668 +#: ../../library/signal.rst:689 msgid "See the man page :manpage:`sigtimedwait(2)` for further information." msgstr "更多資訊請見 :manpage:`sigtimedwait(2)` 線上手冊。" -#: ../../library/signal.rst:670 +#: ../../library/signal.rst:691 msgid "See also :func:`pause`, :func:`sigwait` and :func:`sigwaitinfo`." msgstr "另請參閱 :func:`pause`、:func:`sigwait` 與 :func:`sigwaitinfo`。" -#: ../../library/signal.rst:674 +#: ../../library/signal.rst:695 msgid "" "The function is now retried with the recomputed *timeout* if interrupted by " "a signal not in *sigset* and the signal handler does not raise an exception " @@ -951,11 +963,11 @@ msgstr "" "現在如果被不在 *sigset* 中的訊號中斷,且訊號處理程式沒有引發例外,則會使用重" "新計算的 *timeout* 重試函式(理由請參閱 :pep:`475`)。" -#: ../../library/signal.rst:683 +#: ../../library/signal.rst:704 msgid "Examples" msgstr "範例" -#: ../../library/signal.rst:685 +#: ../../library/signal.rst:706 msgid "" "Here is a minimal example program. It uses the :func:`alarm` function to " "limit the time spent waiting to open a file; this is useful if the file is " @@ -969,7 +981,7 @@ msgstr "" "無限期地被擱置。解決方法是在開啟檔案前設定一個 5 秒的警報;如果操作時間過長," "警報訊號就會被送出,而處理程式會產生例外。 ::" -#: ../../library/signal.rst:692 +#: ../../library/signal.rst:713 msgid "" "import signal, os\n" "\n" @@ -1003,24 +1015,24 @@ msgstr "" "\n" "signal.alarm(0) # 停用警報" -#: ../../library/signal.rst:709 +#: ../../library/signal.rst:730 msgid "Note on SIGPIPE" msgstr "關於 SIGPIPE 的說明" -#: ../../library/signal.rst:711 +#: ../../library/signal.rst:732 msgid "" -"Piping output of your program to tools like :manpage:`head(1)` will cause " -"a :const:`SIGPIPE` signal to be sent to your process when the receiver of " -"its standard output closes early. This results in an exception " -"like :code:`BrokenPipeError: [Errno 32] Broken pipe`. To handle this case, " -"wrap your entry point to catch this exception as follows::" +"Piping output of your program to tools like :manpage:`head(1)` will cause a :" +"const:`SIGPIPE` signal to be sent to your process when the receiver of its " +"standard output closes early. This results in an exception like :code:" +"`BrokenPipeError: [Errno 32] Broken pipe`. To handle this case, wrap your " +"entry point to catch this exception as follows::" msgstr "" "將程式的輸出管道化到 :manpage:`head(1)` 之類的工具,會在你的行程的標準輸出接" -"收器提早關閉時,導致 :const:`SIGPIPE` 訊號傳送給你的行程。這會導致類" -"似 :code:`BrokenPipeError: [Errno 32] Broken pipe` 的例外。要處理這種情況,請" -"將你的進入點包裝成如下的樣子來捕捉這個例外: ::" +"收器提早關閉時,導致 :const:`SIGPIPE` 訊號傳送給你的行程。這會導致類似 :code:" +"`BrokenPipeError: [Errno 32] Broken pipe` 的例外。要處理這種情況,請將你的進" +"入點包裝成如下的樣子來捕捉這個例外: ::" -#: ../../library/signal.rst:717 +#: ../../library/signal.rst:738 msgid "" "import os\n" "import sys\n" @@ -1065,7 +1077,7 @@ msgstr "" "if __name__ == '__main__':\n" " main()" -#: ../../library/signal.rst:738 +#: ../../library/signal.rst:759 msgid "" "Do not set :const:`SIGPIPE`'s disposition to :const:`SIG_DFL` in order to " "avoid :exc:`BrokenPipeError`. Doing that would cause your program to exit " @@ -1076,11 +1088,11 @@ msgstr "" "(disposition) 設定為 :const:`SIG_DFL`。這樣做會導致你的程式在寫入任何 socket " "連線時被中斷而意外退出。" -#: ../../library/signal.rst:747 +#: ../../library/signal.rst:768 msgid "Note on Signal Handlers and Exceptions" msgstr "訊號處理程式與例外的說明" -#: ../../library/signal.rst:749 +#: ../../library/signal.rst:770 msgid "" "If a signal handler raises an exception, the exception will be propagated to " "the main thread and may be raised after any :term:`bytecode` instruction. " @@ -1092,15 +1104,15 @@ msgid "" msgstr "" "如果訊號處理程式產生例外,例外會傳送到主執行緒並可能在任何 :term:`bytecode` " "指令之後發生。最值得注意的是,:exc:`KeyboardInterrupt` 可能在執行過程中的任何" -"時候出現。大多數 Python 程式碼,包括標準函式庫,都無法避免這種情況,因" -"此 :exc:`KeyboardInterrupt`\\ (或任何其他由訊號處理程式產生的例外)可能會在" -"罕見的情況下使程式處於預期之外的狀態。" +"時候出現。大多數 Python 程式碼,包括標準函式庫,都無法避免這種情況,因此 :" +"exc:`KeyboardInterrupt`\\ (或任何其他由訊號處理程式產生的例外)可能會在罕見" +"的情況下使程式處於預期之外的狀態。" -#: ../../library/signal.rst:756 +#: ../../library/signal.rst:777 msgid "To illustrate this issue, consider the following code::" msgstr "為了說明這個問題,請參考以下程式碼: ::" -#: ../../library/signal.rst:758 +#: ../../library/signal.rst:779 msgid "" "class SpamContext:\n" " def __init__(self):\n" @@ -1132,11 +1144,11 @@ msgstr "" " ...\n" " self.lock.release()" -#: ../../library/signal.rst:773 +#: ../../library/signal.rst:794 msgid "" -"For many programs, especially those that merely want to exit " -"on :exc:`KeyboardInterrupt`, this is not a problem, but applications that " -"are complex or require high reliability should avoid raising exceptions from " +"For many programs, especially those that merely want to exit on :exc:" +"`KeyboardInterrupt`, this is not a problem, but applications that are " +"complex or require high reliability should avoid raising exceptions from " "signal handlers. They should also avoid catching :exc:`KeyboardInterrupt` as " "a means of gracefully shutting down. Instead, they should install their " "own :const:`SIGINT` handler. Below is an example of an HTTP server that " @@ -1145,11 +1157,11 @@ msgstr "" "對許多程式來說,尤其是那些只想在 :exc:`KeyboardInterrupt` 時退出的程式,這並" "不是問題,但是對於複雜或需要高可靠性的應用程式來說,應該避免從訊號處理程式產" "生例外。它們也應該避免將捕獲 :exc:`KeyboardInterrupt` 作為一種優雅關閉 " -"(gracefully shutting down) 的方式。相反地,它們應該安裝自己" -"的 :const:`SIGINT` 處理程式。以下是 HTTP 伺服器避免 :exc:`KeyboardInterrupt` " -"的範例: ::" +"(gracefully shutting down) 的方式。相反地,它們應該安裝自己的 :const:" +"`SIGINT` 處理程式。以下是 HTTP 伺服器避免 :exc:`KeyboardInterrupt` 的範" +"例: ::" -#: ../../library/signal.rst:781 +#: ../../library/signal.rst:802 msgid "" "import signal\n" "import socket\n" diff --git a/library/sqlite3.po b/library/sqlite3.po index 027f5d0432..784aa23f78 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+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-" @@ -38,8 +38,8 @@ msgstr "" #: ../../library/sqlite3.rst:32 msgid "" "The :mod:`!sqlite3` module was written by Gerhard Häring. It provides an " -"SQL interface compliant with the DB-API 2.0 specification described " -"by :pep:`249`, and requires SQLite 3.15.2 or newer." +"SQL interface compliant with the DB-API 2.0 specification described by :pep:" +"`249`, and requires SQLite 3.15.2 or newer." msgstr "" #: ../../library/sqlite3.rst:36 @@ -128,8 +128,8 @@ msgstr "" #: ../../library/sqlite3.rst:89 msgid "" "In order to execute SQL statements and fetch results from SQL queries, we " -"will need to use a database cursor. Call :meth:`con.cursor() " -"` to create the :class:`Cursor`:" +"will need to use a database cursor. Call :meth:`con.cursor() ` to create the :class:`Cursor`:" msgstr "" #: ../../library/sqlite3.rst:93 @@ -142,8 +142,8 @@ msgid "" "database table ``movie`` with columns for title, release year, and review " "score. For simplicity, we can just use column names in the table declaration " "-- thanks to the `flexible typing`_ feature of SQLite, specifying the data " -"types is optional. Execute the ``CREATE TABLE`` statement by " -"calling :meth:`cur.execute(...) `:" +"types is optional. Execute the ``CREATE TABLE`` statement by calling :meth:" +"`cur.execute(...) `:" msgstr "" #: ../../library/sqlite3.rst:106 @@ -155,9 +155,9 @@ msgid "" "We can verify that the new table has been created by querying the " "``sqlite_master`` table built-in to SQLite, which should now contain an " "entry for the ``movie`` table definition (see `The Schema Table`_ for " -"details). Execute that query by calling :meth:`cur.execute(...) " -"`, assign the result to ``res``, and " -"call :meth:`res.fetchone() ` to fetch the resulting row:" +"details). Execute that query by calling :meth:`cur.execute(...) `, assign the result to ``res``, and call :meth:`res.fetchone() " +"` to fetch the resulting row:" msgstr "" #: ../../library/sqlite3.rst:121 @@ -172,10 +172,9 @@ msgstr "" #: ../../library/sqlite3.rst:127 msgid "" -"We can see that the table has been created, as the query returns " -"a :class:`tuple` containing the table's name. If we query ``sqlite_master`` " -"for a non-existent table ``spam``, :meth:`!res.fetchone` will return " -"``None``:" +"We can see that the table has been created, as the query returns a :class:" +"`tuple` containing the table's name. If we query ``sqlite_master`` for a non-" +"existent table ``spam``, :meth:`!res.fetchone` will return ``None``:" msgstr "" #: ../../library/sqlite3.rst:132 @@ -191,8 +190,8 @@ msgstr "" #: ../../library/sqlite3.rst:138 msgid "" "Now, add two rows of data supplied as SQL literals by executing an " -"``INSERT`` statement, once again by calling :meth:`cur.execute(...) " -"`:" +"``INSERT`` statement, once again by calling :meth:`cur.execute(...) `:" msgstr "" #: ../../library/sqlite3.rst:142 @@ -213,8 +212,8 @@ msgstr "" msgid "" "The ``INSERT`` statement implicitly opens a transaction, which needs to be " "committed before changes are saved in the database (see :ref:`sqlite3-" -"controlling-transactions` for details). Call :meth:`con.commit() " -"` on the connection object to commit the transaction:" +"controlling-transactions` for details). Call :meth:`con.commit() ` on the connection object to commit the transaction:" msgstr "" #: ../../library/sqlite3.rst:156 @@ -225,8 +224,8 @@ msgstr "con.commit()" msgid "" "We can verify that the data was inserted correctly by executing a ``SELECT`` " "query. Use the now-familiar :meth:`cur.execute(...) ` to " -"assign the result to ``res``, and call :meth:`res.fetchall() " -"` to return all resulting rows:" +"assign the result to ``res``, and call :meth:`res.fetchall() ` to return all resulting rows:" msgstr "" #: ../../library/sqlite3.rst:166 @@ -247,8 +246,8 @@ msgstr "" #: ../../library/sqlite3.rst:175 msgid "" -"Now, insert three more rows by calling :meth:`cur.executemany(...) " -"`:" +"Now, insert three more rows by calling :meth:`cur.executemany(...) `:" msgstr "" #: ../../library/sqlite3.rst:178 @@ -304,10 +303,9 @@ msgstr "" #: ../../library/sqlite3.rst:211 msgid "" -"Finally, verify that the database has been written to disk by " -"calling :meth:`con.close() ` to close the existing " -"connection, opening a new one, creating a new cursor, then querying the " -"database:" +"Finally, verify that the database has been written to disk by calling :meth:" +"`con.close() ` to close the existing connection, opening a " +"new one, creating a new cursor, then querying the database:" msgstr "" #: ../../library/sqlite3.rst:216 @@ -396,9 +394,9 @@ msgstr "" #: ../../library/sqlite3.rst:277 msgid "" -"How many seconds the connection should wait before raising " -"an :exc:`OperationalError` when a table is locked. If another connection " -"opens a transaction to modify a table, that table will be locked until the " +"How many seconds the connection should wait before raising an :exc:" +"`OperationalError` when a table is locked. If another connection opens a " +"transaction to modify a table, that table will be locked until the " "transaction is committed. Default five seconds." msgstr "" @@ -407,20 +405,19 @@ msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " "converters registered with :func:`register_converter`. Set it to any " -"combination (using ``|``, bitwise or) of :const:`PARSE_DECLTYPES` " -"and :const:`PARSE_COLNAMES` to enable this. Column names takes precedence " -"over declared types if both flags are set. By default (``0``), type " -"detection is disabled." +"combination (using ``|``, bitwise or) of :const:`PARSE_DECLTYPES` and :const:" +"`PARSE_COLNAMES` to enable this. Column names takes precedence over declared " +"types if both flags are set. By default (``0``), type detection is disabled." msgstr "" #: ../../library/sqlite3.rst:295 msgid "" -"Control legacy transaction handling behaviour. " -"See :attr:`Connection.isolation_level` and :ref:`sqlite3-transaction-control-" -"isolation-level` for more information. Can be ``\"DEFERRED\"`` (default), " -"``\"EXCLUSIVE\"`` or ``\"IMMEDIATE\"``; or ``None`` to disable opening " -"transactions implicitly. Has no effect unless :attr:`Connection.autocommit` " -"is set to :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default)." +"Control legacy transaction handling behaviour. See :attr:`Connection." +"isolation_level` and :ref:`sqlite3-transaction-control-isolation-level` for " +"more information. Can be ``\"DEFERRED\"`` (default), ``\"EXCLUSIVE\"`` or " +"``\"IMMEDIATE\"``; or ``None`` to disable opening transactions implicitly. " +"Has no effect unless :attr:`Connection.autocommit` is set to :const:" +"`~sqlite3.LEGACY_TRANSACTION_CONTROL` (the default)." msgstr "" #: ../../library/sqlite3.rst:305 @@ -455,11 +452,11 @@ msgstr "" #: ../../library/sqlite3.rst:332 msgid "" -"Control :pep:`249` transaction handling behaviour. " -"See :attr:`Connection.autocommit` and :ref:`sqlite3-transaction-control-" -"autocommit` for more information. *autocommit* currently defaults " -"to :const:`~sqlite3.LEGACY_TRANSACTION_CONTROL`. The default will change to " -"``False`` in a future Python release." +"Control :pep:`249` transaction handling behaviour. See :attr:`Connection." +"autocommit` and :ref:`sqlite3-transaction-control-autocommit` for more " +"information. *autocommit* currently defaults to :const:`~sqlite3." +"LEGACY_TRANSACTION_CONTROL`. The default will change to ``False`` in a " +"future Python release." msgstr "" #: ../../library/sqlite3.rst:0 @@ -471,8 +468,8 @@ msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" -"引發一個附帶引數 ``database`` 的\\ :ref:`稽核事件 ` " -"``sqlite3.connect``。" +"引發一個附帶引數 ``database`` 的\\ :ref:`稽核事件 ` ``sqlite3." +"connect``。" #: ../../library/sqlite3.rst:344 msgid "" @@ -620,8 +617,8 @@ msgstr "" #: ../../library/sqlite3.rst:459 msgid "" -"Generated fields (for example ``MAX(p)``) are returned as :class:`str`. " -"Use :const:`!PARSE_COLNAMES` to enforce types for such queries." +"Generated fields (for example ``MAX(p)``) are returned as :class:`str`. Use :" +"const:`!PARSE_COLNAMES` to enforce types for such queries." msgstr "" #: ../../library/sqlite3.rst:464 @@ -688,8 +685,8 @@ msgstr "" #: ../../library/sqlite3.rst:510 msgid "" -"Version number of the runtime SQLite library as a :class:`tuple` " -"of :class:`integers `." +"Version number of the runtime SQLite library as a :class:`tuple` of :class:" +"`integers `." msgstr "" #: ../../library/sqlite3.rst:515 @@ -787,8 +784,8 @@ msgstr "" #: ../../library/sqlite3.rst:569 msgid "" -"These constants are used for the :meth:`Connection.setconfig` " -"and :meth:`~Connection.getconfig` methods." +"These constants are used for the :meth:`Connection.setconfig` and :meth:" +"`~Connection.getconfig` methods." msgstr "" #: ../../library/sqlite3.rst:572 @@ -816,9 +813,8 @@ msgstr "Connection 物件" #: ../../library/sqlite3.rst:592 msgid "" "Each open SQLite database is represented by a ``Connection`` object, which " -"is created using :func:`sqlite3.connect`. Their main purpose is " -"creating :class:`Cursor` objects, and :ref:`sqlite3-controlling-" -"transactions`." +"is created using :func:`sqlite3.connect`. Their main purpose is creating :" +"class:`Cursor` objects, and :ref:`sqlite3-controlling-transactions`." msgstr "" #: ../../library/sqlite3.rst:599 @@ -827,8 +823,8 @@ msgstr ":ref:`sqlite3-connection-shortcuts`" #: ../../library/sqlite3.rst:605 msgid "" -"A :exc:`ResourceWarning` is emitted if :meth:`close` is not called before " -"a :class:`!Connection` object is deleted." +"A :exc:`ResourceWarning` is emitted if :meth:`close` is not called before a :" +"class:`!Connection` object is deleted." msgstr "" #: ../../library/sqlite3.rst:608 @@ -838,9 +834,8 @@ msgstr "一個 SQLite 資料庫連線具有以下屬性和方法:" #: ../../library/sqlite3.rst:612 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " -"single optional parameter *factory*. If supplied, this must be " -"a :term:`callable` returning an instance of :class:`Cursor` or its " -"subclasses." +"single optional parameter *factory*. If supplied, this must be a :term:" +"`callable` returning an instance of :class:`Cursor` or its subclasses." msgstr "" #: ../../library/sqlite3.rst:619 @@ -858,7 +853,7 @@ msgid "The name of the column where the blob is located." msgstr "" #: ../../library/sqlite3.rst:628 -msgid "The name of the row where the blob is located." +msgid "The row id where the blob is located." msgstr "" #: ../../library/sqlite3.rst:631 @@ -889,17 +884,17 @@ msgstr "" #: ../../library/sqlite3.rst:654 msgid "" "Commit any pending transaction to the database. If :attr:`autocommit` is " -"``True``, or there is no open transaction, this method does nothing. " -"If :attr:`!autocommit` is ``False``, a new transaction is implicitly opened " -"if a pending transaction was committed by this method." +"``True``, or there is no open transaction, this method does nothing. If :" +"attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a " +"pending transaction was committed by this method." msgstr "" #: ../../library/sqlite3.rst:662 msgid "" "Roll back to the start of any pending transaction. If :attr:`autocommit` is " -"``True``, or there is no open transaction, this method does nothing. " -"If :attr:`!autocommit` is ``False``, a new transaction is implicitly opened " -"if a pending transaction was rolled back by this method." +"``True``, or there is no open transaction, this method does nothing. If :" +"attr:`!autocommit` is ``False``, a new transaction is implicitly opened if a " +"pending transaction was rolled back by this method." msgstr "" #: ../../library/sqlite3.rst:670 @@ -1270,17 +1265,17 @@ msgstr "" #: ../../library/sqlite3.rst:935 msgid "" "Call this method from a different thread to abort any queries that might be " -"executing on the connection. Aborted queries will raise " -"an :exc:`OperationalError`." +"executing on the connection. Aborted queries will raise an :exc:" +"`OperationalError`." msgstr "" #: ../../library/sqlite3.rst:942 msgid "" "Register :term:`callable` *authorizer_callback* to be invoked for each " "attempt to access a column of a table in the database. The callback should " -"return one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, " -"or :const:`SQLITE_IGNORE` to signal how access to the column should be " -"handled by the underlying SQLite library." +"return one of :const:`SQLITE_OK`, :const:`SQLITE_DENY`, or :const:" +"`SQLITE_IGNORE` to signal how access to the column should be handled by the " +"underlying SQLite library." msgstr "" #: ../../library/sqlite3.rst:949 @@ -1352,11 +1347,10 @@ msgstr "" msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " -"that the backend does not only run statements passed to " -"the :meth:`Cursor.execute` methods. Other sources include " -"the :ref:`transaction management ` of " -"the :mod:`!sqlite3` module and the execution of triggers defined in the " -"current database." +"that the backend does not only run statements passed to the :meth:`Cursor." +"execute` methods. Other sources include the :ref:`transaction management " +"` of the :mod:`!sqlite3` module and the " +"execution of triggers defined in the current database." msgstr "" #: ../../library/sqlite3.rst:1002 @@ -1390,8 +1384,8 @@ msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " "are compiled without this feature. To get loadable extension support, you " -"must pass the :option:`--enable-loadable-sqlite-extensions` option " -"to :program:`configure`." +"must pass the :option:`--enable-loadable-sqlite-extensions` option to :" +"program:`configure`." msgstr "" #: ../../library/sqlite3.rst:1035 @@ -1472,8 +1466,8 @@ msgstr "新增 *entrypoint* 參數。" #: ../../library/sqlite3.rst:1102 msgid "" "Return an :term:`iterator` to dump the database as SQL source code. Useful " -"when saving an in-memory database for later restoration. Similar to the " -"``.dump`` command in the :program:`sqlite3` shell." +"when saving an in-memory database for later restoration. Similar to the ``." +"dump`` command in the :program:`sqlite3` shell." msgstr "" #: ../../library/sqlite3.rst:1106 @@ -1600,8 +1594,8 @@ msgstr "" #: ../../library/sqlite3.rst:1214 msgid "" -"Example, query the maximum length of an SQL statement " -"for :class:`Connection` ``con`` (the default is 1000000000):" +"Example, query the maximum length of an SQL statement for :class:" +"`Connection` ``con`` (the default is 1000000000):" msgstr "" #: ../../library/sqlite3.rst:1224 @@ -1686,10 +1680,10 @@ msgstr "" #: ../../library/sqlite3.rst:1318 msgid "" -"Deserialize a :meth:`serialized ` database into " -"a :class:`Connection`. This method causes the database connection to " -"disconnect from database *name*, and reopen *name* as an in-memory database " -"based on the serialization contained in *data*." +"Deserialize a :meth:`serialized ` database into a :class:" +"`Connection`. This method causes the database connection to disconnect from " +"database *name*, and reopen *name* as an in-memory database based on the " +"serialization contained in *data*." msgstr "" #: ../../library/sqlite3.rst:1324 @@ -1728,9 +1722,9 @@ msgstr "" #: ../../library/sqlite3.rst:1353 msgid "" -"``False``: Select :pep:`249`-compliant transaction behaviour, implying " -"that :mod:`!sqlite3` ensures a transaction is always open. " -"Use :meth:`commit` and :meth:`rollback` to close transactions." +"``False``: Select :pep:`249`-compliant transaction behaviour, implying that :" +"mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :" +"meth:`rollback` to close transactions." msgstr "" #: ../../library/sqlite3.rst:1357 @@ -1739,8 +1733,8 @@ msgstr "" #: ../../library/sqlite3.rst:1359 msgid "" -"``True``: Use SQLite's `autocommit mode`_. :meth:`commit` " -"and :meth:`rollback` have no effect in this mode." +"``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:" +"`rollback` have no effect in this mode." msgstr "" #: ../../library/sqlite3.rst:1362 @@ -1765,8 +1759,8 @@ msgstr "更多詳情請見 :ref:`sqlite3-transaction-control-autocommit`。" #: ../../library/sqlite3.rst:1375 msgid "" -"The :attr:`isolation_level` attribute has no effect " -"unless :attr:`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." +"The :attr:`isolation_level` attribute has no effect unless :attr:" +"`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." msgstr "" #: ../../library/sqlite3.rst:1382 @@ -1808,14 +1802,14 @@ msgstr "" #: ../../library/sqlite3.rst:1412 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " -"from this connection. Assigning to this attribute does not affect " -"the :attr:`!row_factory` of existing cursors belonging to this connection, " -"only new ones. Is ``None`` by default, meaning each row is returned as " -"a :class:`tuple`." +"from this connection. Assigning to this attribute does not affect the :attr:" +"`!row_factory` of existing cursors belonging to this connection, only new " +"ones. Is ``None`` by default, meaning each row is returned as a :class:" +"`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1419 ../../library/sqlite3.rst:1705 -#: ../../library/sqlite3.rst:1728 +#: ../../library/sqlite3.rst:1419 ../../library/sqlite3.rst:1711 +#: ../../library/sqlite3.rst:1734 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "更多詳情請見 :ref:`sqlite3-howto-row-factory`。" @@ -1844,15 +1838,15 @@ msgstr "Cursor 物件" msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " -"created using :meth:`Connection.cursor`, or by using any of " -"the :ref:`connection shortcut methods `." +"created using :meth:`Connection.cursor`, or by using any of the :ref:" +"`connection shortcut methods `." msgstr "" #: ../../library/sqlite3.rst:1448 msgid "" -"Cursor objects are :term:`iterators `, meaning that if " -"you :meth:`~Cursor.execute` a ``SELECT`` query, you can simply iterate over " -"the cursor to fetch the resulting rows:" +"Cursor objects are :term:`iterators `, meaning that if you :meth:" +"`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " +"to fetch the resulting rows:" msgstr "" #: ../../library/sqlite3.rst:1459 @@ -1869,8 +1863,8 @@ msgstr ":class:`Cursor` 實例具有以下屬性和方法。" #: ../../library/sqlite3.rst:1480 msgid "" -"Execute a single SQL statement, optionally binding Python values " -"using :ref:`placeholders `." +"Execute a single SQL statement, optionally binding Python values using :ref:" +"`placeholders `." msgstr "" #: ../../library/sqlite3.rst:1484 @@ -1893,18 +1887,17 @@ msgstr "" #: ../../library/sqlite3.rst:1499 msgid "" -"If :attr:`~Connection.autocommit` " -"is :data:`LEGACY_TRANSACTION_CONTROL`, :attr:`~Connection.isolation_level` " -"is not ``None``, *sql* is an ``INSERT``, ``UPDATE``, ``DELETE``, or " -"``REPLACE`` statement, and there is no open transaction, a transaction is " -"implicitly opened before executing *sql*." +"If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, :" +"attr:`~Connection.isolation_level` is not ``None``, *sql* is an ``INSERT``, " +"``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is no open " +"transaction, a transaction is implicitly opened before executing *sql*." msgstr "" #: ../../library/sqlite3.rst:1508 msgid "" ":exc:`ProgrammingError` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of " -"a :class:`dict`." +"placeholders>` are used and *parameters* is a sequence instead of a :class:" +"`dict`." msgstr "" #: ../../library/sqlite3.rst:1512 @@ -1970,11 +1963,11 @@ msgstr "" #: ../../library/sqlite3.rst:1568 msgid "" -"Execute the SQL statements in *sql_script*. If " -"the :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and " -"there is a pending transaction, an implicit ``COMMIT`` statement is executed " -"first. No other implicit transaction control is performed; any transaction " -"control must be added to *sql_script*." +"Execute the SQL statements in *sql_script*. If the :attr:`~Connection." +"autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending " +"transaction, an implicit ``COMMIT`` statement is executed first. No other " +"implicit transaction control is performed; any transaction control must be " +"added to *sql_script*." msgstr "" #: ../../library/sqlite3.rst:1576 @@ -2030,44 +2023,52 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1617 +#: ../../library/sqlite3.rst:1615 +msgid "Negative *size* values are rejected by raising :exc:`ValueError`." +msgstr "" + +#: ../../library/sqlite3.rst:1620 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1624 +#: ../../library/sqlite3.rst:1627 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1626 +#: ../../library/sqlite3.rst:1629 msgid "" -"The cursor will be unusable from this point forward; " -"a :exc:`ProgrammingError` exception will be raised if any operation is " -"attempted with the cursor." +"The cursor will be unusable from this point forward; a :exc:" +"`ProgrammingError` exception will be raised if any operation is attempted " +"with the cursor." msgstr "" -#: ../../library/sqlite3.rst:1631 ../../library/sqlite3.rst:1635 +#: ../../library/sqlite3.rst:1634 ../../library/sqlite3.rst:1638 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1639 +#: ../../library/sqlite3.rst:1642 msgid "" -"Read/write attribute that controls the number of rows returned " -"by :meth:`fetchmany`. The default value is 1 which means a single row would " -"be fetched per call." +"Read/write attribute that controls the number of rows returned by :meth:" +"`fetchmany`. The default value is 1 which means a single row would be " +"fetched per call." +msgstr "" + +#: ../../library/sqlite3.rst:1645 +msgid "Negative values are rejected by raising :exc:`ValueError`." msgstr "" -#: ../../library/sqlite3.rst:1644 +#: ../../library/sqlite3.rst:1650 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " -"belonging to the cursor. A :class:`Cursor` object created by " -"calling :meth:`con.cursor() ` will have " -"a :attr:`connection` attribute that refers to *con*:" +"belonging to the cursor. A :class:`Cursor` object created by calling :meth:" +"`con.cursor() ` will have a :attr:`connection` attribute " +"that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1649 +#: ../../library/sqlite3.rst:1655 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> cur = con.cursor()\n" @@ -2081,18 +2082,18 @@ msgstr "" "True\n" ">>> con.close()" -#: ../../library/sqlite3.rst:1659 +#: ../../library/sqlite3.rst:1665 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1663 +#: ../../library/sqlite3.rst:1669 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1667 +#: ../../library/sqlite3.rst:1673 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -2102,15 +2103,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1675 +#: ../../library/sqlite3.rst:1681 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1677 +#: ../../library/sqlite3.rst:1683 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1682 +#: ../../library/sqlite3.rst:1688 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -2120,7 +2121,7 @@ msgid "" "resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: ../../library/sqlite3.rst:1693 +#: ../../library/sqlite3.rst:1699 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -2129,61 +2130,61 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1700 +#: ../../library/sqlite3.rst:1706 msgid "" "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" -"Cursor` was created. Assigning to this attribute does not " -"affect :attr:`Connection.row_factory` of the parent connection." +"Cursor` was created. Assigning to this attribute does not affect :attr:" +"`Connection.row_factory` of the parent connection." msgstr "" -#: ../../library/sqlite3.rst:1716 +#: ../../library/sqlite3.rst:1722 msgid "Row objects" msgstr "Row 物件" -#: ../../library/sqlite3.rst:1720 +#: ../../library/sqlite3.rst:1726 msgid "" -"A :class:`!Row` instance serves as a highly " -"optimized :attr:`~Connection.row_factory` for :class:`Connection` objects. " -"It supports iteration, equality testing, :func:`len`, and :term:`mapping` " -"access by column name and index." +"A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." +"row_factory` for :class:`Connection` objects. It supports iteration, " +"equality testing, :func:`len`, and :term:`mapping` access by column name and " +"index." msgstr "" -#: ../../library/sqlite3.rst:1725 +#: ../../library/sqlite3.rst:1731 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1732 +#: ../../library/sqlite3.rst:1738 msgid "" "Return a :class:`list` of column names as :class:`strings `. " -"Immediately after a query, it is the first member of each tuple " -"in :attr:`Cursor.description`." +"Immediately after a query, it is the first member of each tuple in :attr:" +"`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:1736 +#: ../../library/sqlite3.rst:1742 msgid "Added support of slicing." msgstr "新增對切片的支援。" -#: ../../library/sqlite3.rst:1743 +#: ../../library/sqlite3.rst:1749 msgid "Blob objects" msgstr "Blob 物件" -#: ../../library/sqlite3.rst:1749 +#: ../../library/sqlite3.rst:1755 msgid "" "A :class:`Blob` instance is a :term:`file-like object` that can read and " -"write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. " -"Call :func:`len(blob) ` to get the size (number of bytes) of the blob. " -"Use indices and :term:`slices ` for direct access to the blob data." +"write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:" +"`len(blob) ` to get the size (number of bytes) of the blob. Use indices " +"and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1754 +#: ../../library/sqlite3.rst:1760 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1757 +#: ../../library/sqlite3.rst:1763 msgid "" "con = sqlite3.connect(\":memory:\")\n" "con.execute(\"CREATE TABLE test(blob_col blob)\")\n" @@ -2205,37 +2206,37 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:1785 +#: ../../library/sqlite3.rst:1791 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1787 +#: ../../library/sqlite3.rst:1793 msgid "" -"The blob will be unusable from this point onward. " -"An :class:`~sqlite3.Error` (or subclass) exception will be raised if any " -"further operation is attempted with the blob." +"The blob will be unusable from this point onward. An :class:`~sqlite3." +"Error` (or subclass) exception will be raised if any further operation is " +"attempted with the blob." msgstr "" -#: ../../library/sqlite3.rst:1793 +#: ../../library/sqlite3.rst:1799 msgid "" "Read *length* bytes of data from the blob at the current offset position. If " "the end of the blob is reached, the data up to :abbr:`EOF (End of File)` " -"will be returned. When *length* is not specified, or is " -"negative, :meth:`~Blob.read` will read until the end of the blob." +"will be returned. When *length* is not specified, or is negative, :meth:" +"`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1801 +#: ../../library/sqlite3.rst:1807 msgid "" "Write *data* to the blob at the current offset. This function cannot change " -"the blob length. Writing beyond the end of the blob will " -"raise :exc:`ValueError`." +"the blob length. Writing beyond the end of the blob will raise :exc:" +"`ValueError`." msgstr "" -#: ../../library/sqlite3.rst:1807 +#: ../../library/sqlite3.rst:1813 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1811 +#: ../../library/sqlite3.rst:1817 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :const:`os.SEEK_SET` (absolute blob positioning). Other " @@ -2243,26 +2244,26 @@ msgid "" "position) and :const:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1819 +#: ../../library/sqlite3.rst:1825 msgid "PrepareProtocol objects" msgstr "PrepareProtocol 物件" -#: ../../library/sqlite3.rst:1823 +#: ../../library/sqlite3.rst:1829 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1831 +#: ../../library/sqlite3.rst:1837 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1833 +#: ../../library/sqlite3.rst:1839 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1837 +#: ../../library/sqlite3.rst:1843 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -2270,39 +2271,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1844 +#: ../../library/sqlite3.rst:1850 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1848 +#: ../../library/sqlite3.rst:1854 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1853 +#: ../../library/sqlite3.rst:1859 msgid "" -"The numeric error code from the `SQLite API `_" +"The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1860 +#: ../../library/sqlite3.rst:1866 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1867 +#: ../../library/sqlite3.rst:1873 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1874 +#: ../../library/sqlite3.rst:1880 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -2310,14 +2311,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1881 +#: ../../library/sqlite3.rst:1887 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1887 +#: ../../library/sqlite3.rst:1893 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -2325,28 +2326,28 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1895 +#: ../../library/sqlite3.rst:1901 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1900 +#: ../../library/sqlite3.rst:1906 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1907 +#: ../../library/sqlite3.rst:1913 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "supplying the wrong number of bindings to a query, or trying to operate on a " -"closed :class:`Connection`. ``ProgrammingError`` is a subclass " -"of :exc:`DatabaseError`." +"closed :class:`Connection`. ``ProgrammingError`` is a subclass of :exc:" +"`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1914 +#: ../../library/sqlite3.rst:1920 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -2355,78 +2356,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1924 +#: ../../library/sqlite3.rst:1930 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1926 +#: ../../library/sqlite3.rst:1932 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1929 +#: ../../library/sqlite3.rst:1935 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1932 ../../library/sqlite3.rst:1949 +#: ../../library/sqlite3.rst:1938 ../../library/sqlite3.rst:1955 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1932 ../../library/sqlite3.rst:1949 +#: ../../library/sqlite3.rst:1938 ../../library/sqlite3.rst:1955 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1934 ../../library/sqlite3.rst:1951 +#: ../../library/sqlite3.rst:1940 ../../library/sqlite3.rst:1957 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1934 ../../library/sqlite3.rst:1951 +#: ../../library/sqlite3.rst:1940 ../../library/sqlite3.rst:1957 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1936 ../../library/sqlite3.rst:1953 +#: ../../library/sqlite3.rst:1942 ../../library/sqlite3.rst:1959 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1936 ../../library/sqlite3.rst:1953 +#: ../../library/sqlite3.rst:1942 ../../library/sqlite3.rst:1959 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1938 ../../library/sqlite3.rst:1955 +#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1938 ../../library/sqlite3.rst:1955 +#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1940 +#: ../../library/sqlite3.rst:1946 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1940 ../../library/sqlite3.rst:1957 +#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1942 ../../library/sqlite3.rst:1960 +#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1966 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1942 ../../library/sqlite3.rst:1960 +#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1966 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1946 +#: ../../library/sqlite3.rst:1952 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1957 +#: ../../library/sqlite3.rst:1963 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1969 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -2435,47 +2436,47 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1973 +#: ../../library/sqlite3.rst:1979 msgid "Default adapters and converters (deprecated)" msgstr "" -#: ../../library/sqlite3.rst:1977 +#: ../../library/sqlite3.rst:1983 msgid "" "The default adapters and converters are deprecated as of Python 3.12. " "Instead, use the :ref:`sqlite3-adapter-converter-recipes` and tailor them to " "your needs." msgstr "" -#: ../../library/sqlite3.rst:1981 +#: ../../library/sqlite3.rst:1987 msgid "The deprecated default adapters and converters consist of:" msgstr "" -#: ../../library/sqlite3.rst:1983 +#: ../../library/sqlite3.rst:1989 msgid "" "An adapter for :class:`datetime.date` objects to :class:`strings ` in " "`ISO 8601`_ format." msgstr "" -#: ../../library/sqlite3.rst:1985 +#: ../../library/sqlite3.rst:1991 msgid "" "An adapter for :class:`datetime.datetime` objects to strings in ISO 8601 " "format." msgstr "" -#: ../../library/sqlite3.rst:1987 +#: ../../library/sqlite3.rst:1993 msgid "" -"A converter for :ref:`declared ` \"date\" types " -"to :class:`datetime.date` objects." +"A converter for :ref:`declared ` \"date\" types to :" +"class:`datetime.date` objects." msgstr "" -#: ../../library/sqlite3.rst:1989 +#: ../../library/sqlite3.rst:1995 msgid "" "A converter for declared \"timestamp\" types to :class:`datetime.datetime` " "objects. Fractional parts will be truncated to 6 digits (microsecond " "precision)." msgstr "" -#: ../../library/sqlite3.rst:1995 +#: ../../library/sqlite3.rst:2001 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -2483,42 +2484,42 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:2008 +#: ../../library/sqlite3.rst:2014 msgid "Command-line interface" msgstr "命令列介面" -#: ../../library/sqlite3.rst:2010 +#: ../../library/sqlite3.rst:2016 msgid "" "The :mod:`!sqlite3` module can be invoked as a script, using the " "interpreter's :option:`-m` switch, in order to provide a simple SQLite " "shell. The argument signature is as follows::" msgstr "" -#: ../../library/sqlite3.rst:2015 +#: ../../library/sqlite3.rst:2021 msgid "python -m sqlite3 [-h] [-v] [filename] [sql]" msgstr "python -m sqlite3 [-h] [-v] [filename] [sql]" -#: ../../library/sqlite3.rst:2017 +#: ../../library/sqlite3.rst:2023 msgid "Type ``.quit`` or CTRL-D to exit the shell." msgstr "" -#: ../../library/sqlite3.rst:2023 +#: ../../library/sqlite3.rst:2029 msgid "Print CLI help." msgstr "" -#: ../../library/sqlite3.rst:2027 +#: ../../library/sqlite3.rst:2033 msgid "Print underlying SQLite library version." msgstr "" -#: ../../library/sqlite3.rst:2035 +#: ../../library/sqlite3.rst:2041 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:2040 +#: ../../library/sqlite3.rst:2046 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:2042 +#: ../../library/sqlite3.rst:2048 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -2526,7 +2527,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:2047 +#: ../../library/sqlite3.rst:2053 msgid "" ">>> # Never do this -- insecure!\n" ">>> symbol = input()\n" @@ -2537,7 +2538,7 @@ msgid "" ">>> cur.execute(sql)" msgstr "" -#: ../../library/sqlite3.rst:2055 +#: ../../library/sqlite3.rst:2061 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -2545,7 +2546,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:2060 +#: ../../library/sqlite3.rst:2066 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -2556,7 +2557,7 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:2071 +#: ../../library/sqlite3.rst:2077 msgid "" "con = sqlite3.connect(\":memory:\")\n" "cur = con.execute(\"CREATE TABLE lang(name, first_appeared)\")\n" @@ -2577,24 +2578,24 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2098 +#: ../../library/sqlite3.rst:2104 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:2105 +#: ../../library/sqlite3.rst:2111 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:2107 +#: ../../library/sqlite3.rst:2113 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:2111 +#: ../../library/sqlite3.rst:2117 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -2604,11 +2605,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:2123 +#: ../../library/sqlite3.rst:2129 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:2125 +#: ../../library/sqlite3.rst:2131 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -2618,7 +2619,7 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:2133 +#: ../../library/sqlite3.rst:2139 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2650,18 +2651,18 @@ msgstr "" "print(cur.fetchone()[0])\n" "con.close()" -#: ../../library/sqlite3.rst:2157 +#: ../../library/sqlite3.rst:2163 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:2159 +#: ../../library/sqlite3.rst:2165 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:2163 +#: ../../library/sqlite3.rst:2169 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2695,36 +2696,36 @@ msgstr "" "print(cur.fetchone()[0])\n" "con.close()" -#: ../../library/sqlite3.rst:2190 +#: ../../library/sqlite3.rst:2196 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:2192 +#: ../../library/sqlite3.rst:2198 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:2197 +#: ../../library/sqlite3.rst:2203 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:2200 +#: ../../library/sqlite3.rst:2206 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:2205 +#: ../../library/sqlite3.rst:2211 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2208 +#: ../../library/sqlite3.rst:2214 msgid "" "def convert_point(s):\n" " x, y = map(float, s.split(b\";\"))\n" @@ -2734,32 +2735,32 @@ msgstr "" " x, y = map(float, s.split(b\";\"))\n" " return Point(x, y)" -#: ../../library/sqlite3.rst:2214 +#: ../../library/sqlite3.rst:2220 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:2218 +#: ../../library/sqlite3.rst:2224 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2219 +#: ../../library/sqlite3.rst:2225 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2220 +#: ../../library/sqlite3.rst:2226 msgid "" -"Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | " -"sqlite3.PARSE_COLNAMES``. Column names take precedence over declared types." +"Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." +"PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2224 +#: ../../library/sqlite3.rst:2230 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2226 +#: ../../library/sqlite3.rst:2232 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2801,15 +2802,15 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2277 +#: ../../library/sqlite3.rst:2283 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2279 +#: ../../library/sqlite3.rst:2285 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2281 +#: ../../library/sqlite3.rst:2287 msgid "" "import datetime\n" "import sqlite3\n" @@ -2847,23 +2848,23 @@ msgid "" "sqlite3.register_converter(\"timestamp\", convert_timestamp)" msgstr "" -#: ../../library/sqlite3.rst:2341 +#: ../../library/sqlite3.rst:2347 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2343 +#: ../../library/sqlite3.rst:2349 msgid "" -"Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, " -"and :meth:`~Connection.executescript` methods of the :class:`Connection` " -"class, your code can be written more concisely because you don't have to " -"create the (often superfluous) :class:`Cursor` objects explicitly. Instead, " -"the :class:`Cursor` objects are created implicitly and these shortcut " -"methods return the cursor objects. This way, you can execute a ``SELECT`` " -"statement and iterate over it directly using only a single call on " -"the :class:`Connection` object." +"Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" +"meth:`~Connection.executescript` methods of the :class:`Connection` class, " +"your code can be written more concisely because you don't have to create the " +"(often superfluous) :class:`Cursor` objects explicitly. Instead, the :class:" +"`Cursor` objects are created implicitly and these shortcut methods return " +"the cursor objects. This way, you can execute a ``SELECT`` statement and " +"iterate over it directly using only a single call on the :class:`Connection` " +"object." msgstr "" -#: ../../library/sqlite3.rst:2352 +#: ../../library/sqlite3.rst:2358 msgid "" "# Create and fill the table.\n" "con = sqlite3.connect(\":memory:\")\n" @@ -2887,11 +2888,11 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2384 +#: ../../library/sqlite3.rst:2390 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2386 +#: ../../library/sqlite3.rst:2392 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -2903,25 +2904,25 @@ msgid "" "rolling back." msgstr "" -#: ../../library/sqlite3.rst:2397 +#: ../../library/sqlite3.rst:2403 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, or if :attr:`~Connection.autocommit` is ``True``, the context " "manager does nothing." msgstr "" -#: ../../library/sqlite3.rst:2402 +#: ../../library/sqlite3.rst:2408 msgid "" "The context manager neither implicitly opens a new transaction nor closes " -"the connection. If you need a closing context manager, consider " -"using :meth:`contextlib.closing`." +"the connection. If you need a closing context manager, consider using :meth:" +"`contextlib.closing`." msgstr "" -#: ../../library/sqlite3.rst:2406 +#: ../../library/sqlite3.rst:2412 msgid "" "con = sqlite3.connect(\":memory:\")\n" -"con.execute(\"CREATE TABLE lang(id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)" -"\")\n" +"con.execute(\"CREATE TABLE lang(id INTEGER PRIMARY KEY, name VARCHAR " +"UNIQUE)\")\n" "\n" "# Successful, con.commit() is called automatically afterwards\n" "with con:\n" @@ -2941,19 +2942,19 @@ msgid "" "con.close()" msgstr "" -#: ../../library/sqlite3.rst:2436 +#: ../../library/sqlite3.rst:2442 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2438 +#: ../../library/sqlite3.rst:2444 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2440 +#: ../../library/sqlite3.rst:2446 msgid "Open a database in read-only mode:" msgstr "以唯讀模式開啟資料庫:" -#: ../../library/sqlite3.rst:2442 +#: ../../library/sqlite3.rst:2448 msgid "" ">>> con = sqlite3.connect(\"file:tutorial.db?mode=ro\", uri=True)\n" ">>> con.execute(\"CREATE TABLE readonly(data)\")\n" @@ -2967,13 +2968,13 @@ msgstr "" "OperationalError: attempt to write a readonly database\n" ">>> con.close()" -#: ../../library/sqlite3.rst:2450 +#: ../../library/sqlite3.rst:2456 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2453 +#: ../../library/sqlite3.rst:2459 msgid "" ">>> con = sqlite3.connect(\"file:nosuchdb.db?mode=rw\", uri=True)\n" "Traceback (most recent call last):\n" @@ -2983,11 +2984,11 @@ msgstr "" "Traceback (most recent call last):\n" "OperationalError: unable to open database file" -#: ../../library/sqlite3.rst:2460 +#: ../../library/sqlite3.rst:2466 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2462 +#: ../../library/sqlite3.rst:2468 msgid "" "db = \"file:mem1?mode=memory&cache=shared\"\n" "con1 = sqlite3.connect(db, uri=True)\n" @@ -3013,32 +3014,32 @@ msgstr "" "con1.close()\n" "con2.close()" -#: ../../library/sqlite3.rst:2476 +#: ../../library/sqlite3.rst:2482 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2485 +#: ../../library/sqlite3.rst:2491 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2487 +#: ../../library/sqlite3.rst:2493 msgid "" -"By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If " -"a :class:`!tuple` does not suit your needs, you can use " -"the :class:`sqlite3.Row` class or a custom :attr:`~Cursor.row_factory`." +"By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" +"class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." +"Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" -#: ../../library/sqlite3.rst:2492 +#: ../../library/sqlite3.rst:2498 msgid "" -"While :attr:`!row_factory` exists as an attribute both on " -"the :class:`Cursor` and the :class:`Connection`, it is recommended to " -"set :class:`Connection.row_factory`, so all cursors created from the " -"connection will use the same row factory." +"While :attr:`!row_factory` exists as an attribute both on the :class:" +"`Cursor` and the :class:`Connection`, it is recommended to set :class:" +"`Connection.row_factory`, so all cursors created from the connection will " +"use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2497 +#: ../../library/sqlite3.rst:2503 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -3046,7 +3047,7 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2502 +#: ../../library/sqlite3.rst:2508 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = sqlite3.Row" @@ -3054,11 +3055,11 @@ msgstr "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = sqlite3.Row" -#: ../../library/sqlite3.rst:2507 +#: ../../library/sqlite3.rst:2513 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2509 +#: ../../library/sqlite3.rst:2515 msgid "" ">>> res = con.execute(\"SELECT 'Earth' AS name, 6378 AS radius\")\n" ">>> row = res.fetchone()\n" @@ -3073,7 +3074,7 @@ msgid "" ">>> con.close()" msgstr "" -#: ../../library/sqlite3.rst:2525 +#: ../../library/sqlite3.rst:2531 msgid "" "The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the " "above example. In such cases, SQLite returns a single row with columns " @@ -3081,13 +3082,13 @@ msgid "" "alias``." msgstr "" -#: ../../library/sqlite3.rst:2530 +#: ../../library/sqlite3.rst:2536 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2533 +#: ../../library/sqlite3.rst:2539 msgid "" "def dict_factory(cursor, row):\n" " fields = [column[0] for column in cursor.description]\n" @@ -3097,12 +3098,12 @@ msgstr "" " fields = [column[0] for column in cursor.description]\n" " return {key: value for key, value in zip(fields, row)}" -#: ../../library/sqlite3.rst:2539 +#: ../../library/sqlite3.rst:2545 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2541 +#: ../../library/sqlite3.rst:2547 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = dict_factory\n" @@ -3118,11 +3119,11 @@ msgstr "" "{'a': 1, 'b': 2}\n" ">>> con.close()" -#: ../../library/sqlite3.rst:2550 +#: ../../library/sqlite3.rst:2556 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2552 +#: ../../library/sqlite3.rst:2558 msgid "" "from collections import namedtuple\n" "\n" @@ -3138,11 +3139,11 @@ msgstr "" " cls = namedtuple(\"Row\", fields)\n" " return cls._make(row)" -#: ../../library/sqlite3.rst:2561 +#: ../../library/sqlite3.rst:2567 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2563 +#: ../../library/sqlite3.rst:2569 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = namedtuple_factory\n" @@ -3168,69 +3169,69 @@ msgstr "" "2\n" ">>> con.close()" -#: ../../library/sqlite3.rst:2577 +#: ../../library/sqlite3.rst:2583 msgid "" -"With some adjustments, the above recipe can be adapted to use " -"a :class:`~dataclasses.dataclass`, or any other custom class, instead of " -"a :class:`~collections.namedtuple`." +"With some adjustments, the above recipe can be adapted to use a :class:" +"`~dataclasses.dataclass`, or any other custom class, instead of a :class:" +"`~collections.namedtuple`." msgstr "" -#: ../../library/sqlite3.rst:2585 +#: ../../library/sqlite3.rst:2591 msgid "How to handle non-UTF-8 text encodings" msgstr "如何處理非 UTF-8 的文字編碼" -#: ../../library/sqlite3.rst:2587 +#: ../../library/sqlite3.rst:2593 msgid "" "By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with " "the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might " -"fail for other encodings and invalid UTF-8. You can use a " -"custom :attr:`~Connection.text_factory` to handle such cases." +"fail for other encodings and invalid UTF-8. You can use a custom :attr:" +"`~Connection.text_factory` to handle such cases." msgstr "" -#: ../../library/sqlite3.rst:2593 +#: ../../library/sqlite3.rst:2599 msgid "" "Because of SQLite's `flexible typing`_, it is not uncommon to encounter " "table columns with the ``TEXT`` data type containing non-UTF-8 encodings, or " "even arbitrary data. To demonstrate, let's assume we have a database with " "ISO-8859-2 (Latin-2) encoded text, for example a table of Czech-English " -"dictionary entries. Assuming we now have a :class:`Connection` " -"instance :py:data:`!con` connected to this database, we can decode the " -"Latin-2 encoded text using this :attr:`~Connection.text_factory`:" +"dictionary entries. Assuming we now have a :class:`Connection` instance :py:" +"data:`!con` connected to this database, we can decode the Latin-2 encoded " +"text using this :attr:`~Connection.text_factory`:" msgstr "" -#: ../../library/sqlite3.rst:2602 +#: ../../library/sqlite3.rst:2608 msgid "con.text_factory = lambda data: str(data, encoding=\"latin2\")" msgstr "con.text_factory = lambda data: str(data, encoding=\"latin2\")" -#: ../../library/sqlite3.rst:2606 +#: ../../library/sqlite3.rst:2612 msgid "" "For invalid UTF-8 or arbitrary data in stored in ``TEXT`` table columns, you " "can use the following technique, borrowed from the :ref:`unicode-howto`:" msgstr "" -#: ../../library/sqlite3.rst:2609 +#: ../../library/sqlite3.rst:2615 msgid "con.text_factory = lambda data: str(data, errors=\"surrogateescape\")" msgstr "con.text_factory = lambda data: str(data, errors=\"surrogateescape\")" -#: ../../library/sqlite3.rst:2615 +#: ../../library/sqlite3.rst:2621 msgid "" "The :mod:`!sqlite3` module API does not support strings containing " "surrogates." msgstr "" -#: ../../library/sqlite3.rst:2620 +#: ../../library/sqlite3.rst:2626 msgid ":ref:`unicode-howto`" msgstr ":ref:`unicode-howto`" -#: ../../library/sqlite3.rst:2626 +#: ../../library/sqlite3.rst:2632 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2632 +#: ../../library/sqlite3.rst:2638 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2634 +#: ../../library/sqlite3.rst:2640 msgid "" ":mod:`!sqlite3` offers multiple methods of controlling whether, when and how " "database transactions are opened and closed. :ref:`sqlite3-transaction-" @@ -3238,123 +3239,122 @@ msgid "" "isolation-level` retains the pre-Python 3.12 behaviour." msgstr "" -#: ../../library/sqlite3.rst:2643 +#: ../../library/sqlite3.rst:2649 msgid "Transaction control via the ``autocommit`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2645 +#: ../../library/sqlite3.rst:2651 msgid "" -"The recommended way of controlling transaction behaviour is through " -"the :attr:`Connection.autocommit` attribute, which should preferably be set " -"using the *autocommit* parameter of :func:`connect`." +"The recommended way of controlling transaction behaviour is through the :" +"attr:`Connection.autocommit` attribute, which should preferably be set using " +"the *autocommit* parameter of :func:`connect`." msgstr "" -#: ../../library/sqlite3.rst:2650 +#: ../../library/sqlite3.rst:2656 msgid "" "It is suggested to set *autocommit* to ``False``, which implies :pep:`249`-" "compliant transaction control. This means:" msgstr "" -#: ../../library/sqlite3.rst:2654 +#: ../../library/sqlite3.rst:2660 msgid "" -":mod:`!sqlite3` ensures that a transaction is always open, " -"so :func:`connect`, :meth:`Connection.commit`, " -"and :meth:`Connection.rollback` will implicitly open a new transaction " -"(immediately after closing the pending one, for the latter two). :mod:`!" -"sqlite3` uses ``BEGIN DEFERRED`` statements when opening transactions." +":mod:`!sqlite3` ensures that a transaction is always open, so :func:" +"`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " +"implicitly open a new transaction (immediately after closing the pending " +"one, for the latter two). :mod:`!sqlite3` uses ``BEGIN DEFERRED`` statements " +"when opening transactions." msgstr "" -#: ../../library/sqlite3.rst:2659 +#: ../../library/sqlite3.rst:2665 msgid "Transactions should be committed explicitly using :meth:`!commit`." msgstr "" -#: ../../library/sqlite3.rst:2660 +#: ../../library/sqlite3.rst:2666 msgid "Transactions should be rolled back explicitly using :meth:`!rollback`." msgstr "" -#: ../../library/sqlite3.rst:2661 +#: ../../library/sqlite3.rst:2667 msgid "" -"An implicit rollback is performed if the database " -"is :meth:`~Connection.close`-ed with pending changes." +"An implicit rollback is performed if the database is :meth:`~Connection." +"close`-ed with pending changes." msgstr "" -#: ../../library/sqlite3.rst:2664 +#: ../../library/sqlite3.rst:2670 msgid "" "Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " "mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no " "effect. Note that SQLite's autocommit mode is distinct from the :pep:`249`-" -"compliant :attr:`Connection.autocommit` attribute; " -"use :attr:`Connection.in_transaction` to query the low-level SQLite " -"autocommit mode." +"compliant :attr:`Connection.autocommit` attribute; use :attr:`Connection." +"in_transaction` to query the low-level SQLite autocommit mode." msgstr "" -#: ../../library/sqlite3.rst:2672 +#: ../../library/sqlite3.rst:2678 msgid "" "Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " -"control behaviour to the :attr:`Connection.isolation_level` attribute. " -"See :ref:`sqlite3-transaction-control-isolation-level` for more information." +"control behaviour to the :attr:`Connection.isolation_level` attribute. See :" +"ref:`sqlite3-transaction-control-isolation-level` for more information." msgstr "" -#: ../../library/sqlite3.rst:2681 +#: ../../library/sqlite3.rst:2687 msgid "Transaction control via the ``isolation_level`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2685 +#: ../../library/sqlite3.rst:2691 msgid "" -"The recommended way of controlling transactions is via " -"the :attr:`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-" -"control-autocommit`." +"The recommended way of controlling transactions is via the :attr:" +"`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-" +"autocommit`." msgstr "" -#: ../../library/sqlite3.rst:2689 +#: ../../library/sqlite3.rst:2695 msgid "" -"If :attr:`Connection.autocommit` is set " -"to :data:`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour " -"is controlled using the :attr:`Connection.isolation_level` attribute. " +"If :attr:`Connection.autocommit` is set to :data:" +"`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is " +"controlled using the :attr:`Connection.isolation_level` attribute. " "Otherwise, :attr:`!isolation_level` has no effect." msgstr "" -#: ../../library/sqlite3.rst:2695 +#: ../../library/sqlite3.rst:2701 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " -"``None``, new transactions are implicitly opened " -"before :meth:`~Cursor.execute` and :meth:`~Cursor.executemany` executes " -"``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statements; for other " -"statements, no implicit transaction handling is performed. Use " -"the :meth:`~Connection.commit` and :meth:`~Connection.rollback` methods to " -"respectively commit and roll back pending transactions. You can choose the " -"underlying `SQLite transaction behaviour`_ — that is, whether and what type " -"of ``BEGIN`` statements :mod:`!sqlite3` implicitly executes – via " -"the :attr:`~Connection.isolation_level` attribute." +"``None``, new transactions are implicitly opened before :meth:`~Cursor." +"execute` and :meth:`~Cursor.executemany` executes ``INSERT``, ``UPDATE``, " +"``DELETE``, or ``REPLACE`` statements; for other statements, no implicit " +"transaction handling is performed. Use the :meth:`~Connection.commit` and :" +"meth:`~Connection.rollback` methods to respectively commit and roll back " +"pending transactions. You can choose the underlying `SQLite transaction " +"behaviour`_ — that is, whether and what type of ``BEGIN`` statements :mod:`!" +"sqlite3` implicitly executes – via the :attr:`~Connection.isolation_level` " +"attribute." msgstr "" -#: ../../library/sqlite3.rst:2708 +#: ../../library/sqlite3.rst:2714 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " "`autocommit mode`_, but also allows the user to perform their own " "transaction handling using explicit SQL statements. The underlying SQLite " -"library autocommit mode can be queried using " -"the :attr:`~Connection.in_transaction` attribute." +"library autocommit mode can be queried using the :attr:`~Connection." +"in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2716 +#: ../../library/sqlite3.rst:2722 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2720 +#: ../../library/sqlite3.rst:2726 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:2724 +#: ../../library/sqlite3.rst:2730 msgid "" -"The recommended way of controlling transactions is now via " -"the :attr:`~Connection.autocommit` attribute." +"The recommended way of controlling transactions is now via the :attr:" +"`~Connection.autocommit` attribute." msgstr "" #: ../../library/sqlite3.rst:1475 diff --git a/library/ssl.po b/library/ssl.po index 5939b968db..9a36f36598 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-09-28 00:15+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -59,7 +59,7 @@ msgstr "" "在使用此模組之前,請閱讀 :ref:`ssl-security`。如果不這樣做,可能會產生錯誤的" "安全性認知,因為 ssl 模組的預設設定未必適合你的應用程式。" -#: ../../library/ssl.rst:454 ../../library/ssl.rst:469 +#: ../../library/ssl.rst:455 ../../library/ssl.rst:470 #: ../../includes/wasm-notavail.rst:3 msgid "Availability" msgstr "可用性" @@ -228,7 +228,7 @@ msgid "" "purposes." msgstr "一個可以幫忙建立出 :class:`SSLContext` 物件以用於一般目的的方便函式。" -#: ../../library/ssl.rst:130 +#: ../../library/ssl.rst:131 msgid "" "Return a new :class:`SSLContext` object with default settings for the given " "*purpose*. The settings are chosen by the :mod:`ssl` module, and usually " @@ -238,7 +238,7 @@ msgstr "" "回傳一個新的 :class:`SSLContext` 物件,使用給定 *purpose* 的預設值。這些設定" "是由 :mod:`ssl` 選擇,通常比直接呼叫 :class:`SSLContext` 有更高的安全性。" -#: ../../library/ssl.rst:135 +#: ../../library/ssl.rst:136 msgid "" "*cafile*, *capath*, *cadata* represent optional CA certificates to trust for " "certificate verification, as in :meth:`SSLContext.load_verify_locations`. " @@ -252,7 +252,7 @@ msgstr "" # Skylull: `high encryption cipher` 可能是指 https://superuser.com/questions/1751902/how-to-check-which-ciphers-are-included-in-high-ciphers-constant # 其文中表示可能是指 128bit 以上 key length 的加密算法,需要其他來源佐證。 # 或是 https://help.fortinet.com/fweb/582/Content/FortiWeb/fortiweb-admin/supported_cipher_suites.htm#ssl_414712646_1189301 -#: ../../library/ssl.rst:141 +#: ../../library/ssl.rst:142 msgid "" "The settings are: :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER`, :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` with " @@ -271,7 +271,7 @@ msgstr "" "個值有被設定時) 或使用預設的 CA 憑證 :meth:`SSLContext." "load_default_certs` 。" -#: ../../library/ssl.rst:150 +#: ../../library/ssl.rst:151 msgid "" "When :attr:`~SSLContext.keylog_filename` is supported and the environment " "variable :envvar:`SSLKEYLOGFILE` is set, :func:`create_default_context` " @@ -281,7 +281,7 @@ msgstr "" "`SSLKEYLOGFILE` 時 :func:`create_default_context` 會啟用密鑰日誌記錄 " "(logging)。" -#: ../../library/ssl.rst:154 +#: ../../library/ssl.rst:155 msgid "" "The default settings for this context include :data:" "`VERIFY_X509_PARTIAL_CHAIN` and :data:`VERIFY_X509_STRICT`. These make the " @@ -290,7 +290,7 @@ msgid "" "incompatibility with older X.509 certificates." msgstr "" -#: ../../library/ssl.rst:161 +#: ../../library/ssl.rst:162 msgid "" "The protocol, options, cipher and other settings may change to more " "restrictive values anytime without prior deprecation. The values represent " @@ -299,7 +299,7 @@ msgstr "" "協定、選項、加密方式和其它設定可以在不捨棄舊值的情況下直接更改成新的值,這些" "值代表了在相容性和安全性之間取得的合理平衡。" -#: ../../library/ssl.rst:165 +#: ../../library/ssl.rst:166 msgid "" "If your application needs specific settings, you should create a :class:" "`SSLContext` and apply the settings yourself." @@ -307,7 +307,7 @@ msgstr "" "如果你的應用程式需要特殊的設定,你應該要自行建立一個 :class:`SSLContext` 並自" "行調整設定。" -#: ../../library/ssl.rst:169 +#: ../../library/ssl.rst:170 msgid "" "If you find that when certain older clients or servers attempt to connect " "with a :class:`SSLContext` created by this function that they get an error " @@ -323,7 +323,7 @@ msgstr "" "SSL3.0 已經\\ `被完全破解 `_。如果你仍" "然希望在允許 SSL3.0 連線的情況下使用此函式,可以使用下面的方法: ::" -#: ../../library/ssl.rst:178 +#: ../../library/ssl.rst:179 msgid "" "ctx = ssl.create_default_context(Purpose.CLIENT_AUTH)\n" "ctx.options &= ~ssl.OP_NO_SSLv3" @@ -331,7 +331,7 @@ msgstr "" "ctx = ssl.create_default_context(Purpose.CLIENT_AUTH)\n" "ctx.options &= ~ssl.OP_NO_SSLv3" -#: ../../library/ssl.rst:182 +#: ../../library/ssl.rst:183 msgid "" "This context enables :data:`VERIFY_X509_STRICT` by default, which may reject " "pre-:rfc:`5280` or malformed certificates that the underlying OpenSSL " @@ -339,7 +339,7 @@ msgid "" "recommended, you can do so using::" msgstr "" -#: ../../library/ssl.rst:187 +#: ../../library/ssl.rst:188 msgid "" "ctx = ssl.create_default_context()\n" "ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" @@ -347,23 +347,23 @@ msgstr "" "ctx = ssl.create_default_context()\n" "ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" -#: ../../library/ssl.rst:194 +#: ../../library/ssl.rst:195 msgid "RC4 was dropped from the default cipher string." msgstr "把 RC4 從預設加密方法字串中捨棄。" -#: ../../library/ssl.rst:198 +#: ../../library/ssl.rst:199 msgid "ChaCha20/Poly1305 was added to the default cipher string." msgstr "把 ChaCha20/Poly1305 加入預設加密方法字串。" -#: ../../library/ssl.rst:200 +#: ../../library/ssl.rst:201 msgid "3DES was dropped from the default cipher string." msgstr "把 3DES 從預設加密方法字串中捨棄。" -#: ../../library/ssl.rst:204 +#: ../../library/ssl.rst:205 msgid "Support for key logging to :envvar:`SSLKEYLOGFILE` was added." msgstr "增加了 :envvar:`SSLKEYLOGFILE` 對密鑰日誌記錄 (logging) 的支援。" -#: ../../library/ssl.rst:208 +#: ../../library/ssl.rst:209 msgid "" "The context now uses :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER` protocol instead of generic :data:`PROTOCOL_TLS`." @@ -371,17 +371,17 @@ msgstr "" "目前語境使用 :data:`PROTOCOL_TLS_CLIENT` 協定或 :data:`PROTOCOL_TLS_SERVER` " "協定而非通用的 :data:`PROTOCOL_TLS`。" -#: ../../library/ssl.rst:214 +#: ../../library/ssl.rst:215 msgid "" "The context now uses :data:`VERIFY_X509_PARTIAL_CHAIN` and :data:" "`VERIFY_X509_STRICT` in its default verify flags." msgstr "" -#: ../../library/ssl.rst:219 +#: ../../library/ssl.rst:220 msgid "Exceptions" msgstr "例外" -#: ../../library/ssl.rst:223 +#: ../../library/ssl.rst:224 msgid "" "Raised to signal an error from the underlying SSL implementation (currently " "provided by the OpenSSL library). This signifies some problem in the higher-" @@ -395,11 +395,11 @@ msgstr "" "`OSError` 的一個子型別。:exc:`SSLError` 實例的錯誤程式代碼和訊息是由 OpenSSL " "函式庫提供。" -#: ../../library/ssl.rst:230 +#: ../../library/ssl.rst:231 msgid ":exc:`SSLError` used to be a subtype of :exc:`socket.error`." msgstr ":exc:`SSLError` 曾經是 :exc:`socket.error` 的一個子型別。" -#: ../../library/ssl.rst:235 +#: ../../library/ssl.rst:236 msgid "" "A string mnemonic designating the OpenSSL submodule in which the error " "occurred, such as ``SSL``, ``PEM`` or ``X509``. The range of possible " @@ -408,7 +408,7 @@ msgstr "" "一個字串符號 (string mnemonic),用來指定發生錯誤的 OpenSSL 子模組,如:" "``SSL``、``PEM`` 或 ``X509``。可能值的範圍取決於 OpenSSL 的版本。" -#: ../../library/ssl.rst:243 +#: ../../library/ssl.rst:244 msgid "" "A string mnemonic designating the reason this error occurred, for example " "``CERTIFICATE_VERIFY_FAILED``. The range of possible values depends on the " @@ -417,7 +417,7 @@ msgstr "" "一個字串符號,用來指定發生錯誤的原因,如:``CERTIFICATE_VERIFY_FAILED``。可能" "值的範圍取決於 OpenSSL 的版本。" -#: ../../library/ssl.rst:251 +#: ../../library/ssl.rst:252 msgid "" "A subclass of :exc:`SSLError` raised when trying to read or write and the " "SSL connection has been closed cleanly. Note that this doesn't mean that " @@ -426,7 +426,7 @@ msgstr "" "一個 :exc:`SSLError` 的子類別,當嘗試去讀寫已經被完全關閉的 SSL 連線時會被引" "發。請注意,這並不表示底層傳輸(例如 TCP)已經被關閉。" -#: ../../library/ssl.rst:259 +#: ../../library/ssl.rst:260 msgid "" "A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket ` when trying to read or write data, but more data needs to be " @@ -435,7 +435,7 @@ msgstr "" "一個 :exc:`SSLError` 的子類別,當嘗試去讀寫資料前,底層 TCP 傳輸需要先接收更" "多資料時會由\\ :ref:`非阻塞的 SSL socket ` 引發該錯誤。" -#: ../../library/ssl.rst:268 +#: ../../library/ssl.rst:269 msgid "" "A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket ` when trying to read or write data, but more data needs to be " @@ -444,7 +444,7 @@ msgstr "" "一個 :exc:`SSLError` 的子類別,當嘗試去讀寫資料前,底層 TCP 傳輸需要先發送更" "多資料時會由\\ :ref:`非阻塞的 SSL socket ` 引發該錯誤。" -#: ../../library/ssl.rst:277 +#: ../../library/ssl.rst:278 msgid "" "A subclass of :exc:`SSLError` raised when a system error was encountered " "while trying to fulfill an operation on a SSL socket. Unfortunately, there " @@ -453,7 +453,7 @@ msgstr "" "一個 :exc:`SSLError` 的子類別,當嘗試去操作 SSL socket 時有系統錯誤產生會引發" "此錯誤。不幸的是,目前沒有任何簡單的方法可以去檢查原本的的 errno 編號。" -#: ../../library/ssl.rst:285 +#: ../../library/ssl.rst:286 msgid "" "A subclass of :exc:`SSLError` raised when the SSL connection has been " "terminated abruptly. Generally, you shouldn't try to reuse the underlying " @@ -462,32 +462,32 @@ msgstr "" "一個 :exc:`SSLError` 的子類別,當 SSL 連線被突然終止時會引發此錯誤。通常,當" "此錯誤發生時,你不該再去重新使用底層傳輸。" -#: ../../library/ssl.rst:293 +#: ../../library/ssl.rst:294 msgid "" "A subclass of :exc:`SSLError` raised when certificate validation has failed." msgstr "當憑證驗證失敗時會引發的一個 :exc:`SSLError` 子類別。" -#: ../../library/ssl.rst:300 +#: ../../library/ssl.rst:301 msgid "A numeric error number that denotes the verification error." msgstr "一個表示驗證錯誤的錯誤數值編號。" -#: ../../library/ssl.rst:304 +#: ../../library/ssl.rst:305 msgid "A human readable string of the verification error." msgstr "一個人類可讀的驗證錯誤字串。" -#: ../../library/ssl.rst:308 +#: ../../library/ssl.rst:309 msgid "An alias for :exc:`SSLCertVerificationError`." msgstr ":exc:`SSLCertVerificationError` 的別名。" -#: ../../library/ssl.rst:310 +#: ../../library/ssl.rst:311 msgid "The exception is now an alias for :exc:`SSLCertVerificationError`." msgstr "此例外現在是 :exc:`SSLCertVerificationError` 的別名。" -#: ../../library/ssl.rst:315 +#: ../../library/ssl.rst:316 msgid "Random generation" msgstr "隨機產生" -#: ../../library/ssl.rst:319 +#: ../../library/ssl.rst:320 msgid "" "Return *num* cryptographically strong pseudo-random bytes. Raises an :class:" "`SSLError` if the PRNG has not been seeded with enough data or if the " @@ -500,11 +500,11 @@ msgstr "" "func:`RAND_status` 函式可以用來檢查 PRNG 函式,而 :func:`RAND_add` 則可以用來" "為 PRNG 設定隨機種子。" -#: ../../library/ssl.rst:325 +#: ../../library/ssl.rst:326 msgid "For almost all applications :func:`os.urandom` is preferable." msgstr "在幾乎所有的應用程式中,:func:`os.urandom` 會是較好的選擇。" -#: ../../library/ssl.rst:327 +#: ../../library/ssl.rst:328 msgid "" "Read the Wikipedia article, `Cryptographically secure pseudorandom number " "generator (CSPRNG) `_\\ 文章來了" "解密碼學安全偽隨機數產生器的需求。" -#: ../../library/ssl.rst:336 +#: ../../library/ssl.rst:337 msgid "" "Return ``True`` if the SSL pseudo-random number generator has been seeded " "with 'enough' randomness, and ``False`` otherwise. You can use :func:`ssl." @@ -526,7 +526,7 @@ msgstr "" "``True`` ,否則回傳 ``False``。你可以使用 :func:`ssl.RAND_egd` 函式和 :func:" "`ssl.RAND_add` 函式來增加偽隨機數產生器的隨機性。" -#: ../../library/ssl.rst:343 +#: ../../library/ssl.rst:344 msgid "" "Mix the given *bytes* into the SSL pseudo-random number generator. The " "parameter *entropy* (a float) is a lower bound on the entropy contained in " @@ -537,15 +537,15 @@ msgstr "" "指字串中包含熵值的下限(因此你可以將其設為 ``0.0``\\ )。請參閱 :rfc:`1750` " "了解有關熵源的更多資訊。" -#: ../../library/ssl.rst:348 +#: ../../library/ssl.rst:349 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "可寫入的\\ :term:`類位元組物件 `\\ 現在可被接受。" -#: ../../library/ssl.rst:352 +#: ../../library/ssl.rst:353 msgid "Certificate handling" msgstr "認證處理" -#: ../../library/ssl.rst:360 +#: ../../library/ssl.rst:361 msgid "" "Return the time in seconds since the Epoch, given the ``cert_time`` string " "representing the \"notBefore\" or \"notAfter\" date from a certificate in " @@ -555,11 +555,11 @@ msgstr "" "\"notAfter\" 日期,字串採用 ``\"%b %d %H:%M:%S %Y %Z\"`` 格式(C 語言區域設" "定)。" -#: ../../library/ssl.rst:365 +#: ../../library/ssl.rst:366 msgid "Here's an example:" msgstr "以下是一個範例:" -#: ../../library/ssl.rst:367 +#: ../../library/ssl.rst:368 msgid "" ">>> import ssl\n" ">>> timestamp = ssl.cert_time_to_seconds(\"Jan 5 09:34:43 2018 GMT\")\n" @@ -577,11 +577,11 @@ msgstr "" ">>> print(datetime.utcfromtimestamp(timestamp))\n" "2018-01-05 09:34:43" -#: ../../library/ssl.rst:377 +#: ../../library/ssl.rst:378 msgid "\"notBefore\" or \"notAfter\" dates must use GMT (:rfc:`5280`)." msgstr "\"notBefore\" 或 \"notAfter\" 日期必須使用 GMT (:rfc:`5280`)。" -#: ../../library/ssl.rst:379 +#: ../../library/ssl.rst:380 msgid "" "Interpret the input time as a time in UTC as specified by 'GMT' timezone in " "the input string. Local timezone was used previously. Return an integer (no " @@ -590,7 +590,7 @@ msgstr "" "將輸入的時間直譯為 UTC 時間,如輸入字串中指定的 'GMT' 時區。在之前是使用本地" "的時區。回傳一個整數(在輸入格式中不包括秒的小數部分)。" -#: ../../library/ssl.rst:388 +#: ../../library/ssl.rst:389 msgid "" "Given the address ``addr`` of an SSL-protected server, as a (*hostname*, " "*port-number*) pair, fetches the server's certificate, and returns it as a " @@ -611,11 +611,11 @@ msgstr "" "組根憑證對伺服器憑證進行驗證,如果驗證失敗,呼叫將失敗。可以使用 ``timeout`` " "參數指定超時時間。" -#: ../../library/ssl.rst:399 +#: ../../library/ssl.rst:400 msgid "This function is now IPv6-compatible." msgstr "此函式現在是與 IPv6 相容的。" -#: ../../library/ssl.rst:402 +#: ../../library/ssl.rst:403 msgid "" "The default *ssl_version* is changed from :data:`PROTOCOL_SSLv3` to :data:" "`PROTOCOL_TLS` for maximum compatibility with modern servers." @@ -623,11 +623,11 @@ msgstr "" "預設的 *ssl_version* 已經從 :data:`PROTOCOL_SSLv3` 改為 :data:" "`PROTOCOL_TLS`,已確保與現今的伺服器有最大的相容性。" -#: ../../library/ssl.rst:406 +#: ../../library/ssl.rst:407 msgid "The *timeout* parameter was added." msgstr "新增 *timeout* 參數。" -#: ../../library/ssl.rst:411 +#: ../../library/ssl.rst:412 msgid "" "Given a certificate as a DER-encoded blob of bytes, returns a PEM-encoded " "string version of the same certificate." @@ -635,14 +635,14 @@ msgstr "" "給定一個以 DER 編碼的位元組 blob 作為憑證,回傳以 PEM 編碼字串版本的相同憑" "證。" -#: ../../library/ssl.rst:416 +#: ../../library/ssl.rst:417 msgid "" "Given a certificate as an ASCII PEM string, returns a DER-encoded sequence " "of bytes for that same certificate." msgstr "" "給定一個以 ASCII PEM 的字串作為憑證,回傳以 DER 編碼的位元組序列的相同憑證。" -#: ../../library/ssl.rst:421 +#: ../../library/ssl.rst:422 msgid "" "Returns a named tuple with paths to OpenSSL's default cafile and capath. The " "paths are the same as used by :meth:`SSLContext.set_default_verify_paths`. " @@ -652,39 +652,39 @@ msgstr "" "meth:`SSLContext.set_default_verify_paths` 使用的相同。回傳值是一個 :term:" "`named tuple` ``DefaultVerifyPaths``:" -#: ../../library/ssl.rst:426 +#: ../../library/ssl.rst:427 msgid "" ":attr:`cafile` - resolved path to cafile or ``None`` if the file doesn't " "exist," msgstr ":attr:`cafile` - 解析後的 cafile 路徑,如果檔案不存在則為 ``None``," -#: ../../library/ssl.rst:427 +#: ../../library/ssl.rst:428 msgid "" ":attr:`capath` - resolved path to capath or ``None`` if the directory " "doesn't exist," msgstr ":attr:`capath` - 解析後的 capath 路徑,如果目錄不存在則為 ``None``," -#: ../../library/ssl.rst:428 +#: ../../library/ssl.rst:429 msgid "" ":attr:`openssl_cafile_env` - OpenSSL's environment key that points to a " "cafile," msgstr ":attr:`openssl_cafile_env` - 指向 cafile 的 OpenSSL 環境密鑰," -#: ../../library/ssl.rst:429 +#: ../../library/ssl.rst:430 msgid ":attr:`openssl_cafile` - hard coded path to a cafile," msgstr ":attr:`openssl_cafile` - hard coded 的 cafile 路徑," -#: ../../library/ssl.rst:430 +#: ../../library/ssl.rst:431 msgid "" ":attr:`openssl_capath_env` - OpenSSL's environment key that points to a " "capath," msgstr ":attr:`openssl_capath_env` - 指向 capath 的 OpenSSL 環境密鑰," -#: ../../library/ssl.rst:431 +#: ../../library/ssl.rst:432 msgid ":attr:`openssl_capath` - hard coded path to a capath directory" msgstr ":attr:`openssl_capath` - hard coded 的 capath 目錄路徑" -#: ../../library/ssl.rst:437 +#: ../../library/ssl.rst:438 msgid "" "Retrieve certificates from Windows' system cert store. *store_name* may be " "one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert " @@ -693,7 +693,7 @@ msgstr "" "從 Windows 的系統憑證儲存庫中搜尋憑證。*store_name* 可以是 ``CA``、``ROOT`` " "或 ``MY`` 的其中一個。Windows 也可能會提供額外的憑證儲存庫。" -#: ../../library/ssl.rst:441 +#: ../../library/ssl.rst:442 msgid "" "The function returns a list of (cert_bytes, encoding_type, trust) tuples. " "The encoding_type specifies the encoding of cert_bytes. It is either :const:" @@ -706,12 +706,12 @@ msgstr "" "`x509_asn` 或是用來表示 PKCS#7 ASN.1 資料的 :const:`pkcs_7_asn`。Trust 通過一" "組 OIDS 來指定憑證的用途,或是如果憑證對所有用途都可以使用則回傳 ``True``。" -#: ../../library/ssl.rst:448 ../../library/ssl.rst:1605 -#: ../../library/ssl.rst:1905 +#: ../../library/ssl.rst:449 ../../library/ssl.rst:1609 +#: ../../library/ssl.rst:1909 msgid "Example::" msgstr "範例: ::" -#: ../../library/ssl.rst:450 +#: ../../library/ssl.rst:451 msgid "" ">>> ssl.enum_certificates(\"CA\")\n" "[(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}),\n" @@ -721,7 +721,7 @@ msgstr "" "[(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}),\n" " (b'data...', 'x509_asn', True)]" -#: ../../library/ssl.rst:460 +#: ../../library/ssl.rst:461 msgid "" "Retrieve CRLs from Windows' system cert store. *store_name* may be one of " "``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert stores, too." @@ -729,7 +729,7 @@ msgstr "" "從 Windows 的系統憑證儲存庫中搜尋 CRLs。*store_name* 可以是 ``CA``、``ROOT`` " "或 ``MY`` 的其中一個。Windows 也可能會提供額外的憑證儲存庫。" -#: ../../library/ssl.rst:464 +#: ../../library/ssl.rst:465 msgid "" "The function returns a list of (cert_bytes, encoding_type, trust) tuples. " "The encoding_type specifies the encoding of cert_bytes. It is either :const:" @@ -739,18 +739,18 @@ msgstr "" "指定了 cert_bytes 的編碼格式。它可以是用來表示 X.509 ASN.1 資料的 :const:" "`x509_asn` 或是用來表示 PKCS#7 ASN.1 資料的 :const:`pkcs_7_asn`。" -#: ../../library/ssl.rst:475 +#: ../../library/ssl.rst:476 msgid "Constants" msgstr "常數" -#: ../../library/ssl.rst:477 +#: ../../library/ssl.rst:478 msgid "" "All constants are now :class:`enum.IntEnum` or :class:`enum.IntFlag` " "collections." msgstr "" "所有的常數現在都是 :class:`enum.IntEnum` 或 :class:`enum.IntFlag` 的集合。" -#: ../../library/ssl.rst:483 +#: ../../library/ssl.rst:484 msgid "" "Possible value for :attr:`SSLContext.verify_mode`. Except for :const:" "`PROTOCOL_TLS_CLIENT`, it is the default mode. With client-side sockets, " @@ -761,7 +761,7 @@ msgstr "" "外,這是預設的模式。對於用戶端的 sockets,幾乎任何憑證都能被允許。驗證錯誤," "像是不被信任或是過期的憑證,會被忽略並不會中止 TLS/SSL 握手。" -#: ../../library/ssl.rst:489 +#: ../../library/ssl.rst:490 msgid "" "In server mode, no certificate is requested from the client, so the client " "does not send any for client cert authentication." @@ -769,11 +769,11 @@ msgstr "" "在伺服器模式下,不會從用戶端請求任何憑證,所以用戶端不用發送任何用於用戶端憑" "證身分驗證的憑證。" -#: ../../library/ssl.rst:492 ../../library/ssl.rst:2407 +#: ../../library/ssl.rst:493 ../../library/ssl.rst:2411 msgid "See the discussion of :ref:`ssl-security` below." msgstr "參閱下方 :ref:`ssl-security` 的討論。" -#: ../../library/ssl.rst:496 +#: ../../library/ssl.rst:497 msgid "" "Possible value for :attr:`SSLContext.verify_mode`. In client mode, :const:" "`CERT_OPTIONAL` has the same meaning as :const:`CERT_REQUIRED`. It is " @@ -783,7 +783,7 @@ msgstr "" "`CERT_OPTIONAL` 具有與 :const:`CERT_REQUIRED` 相同的含意。對於客戶端 sockets " "推薦改用 :const:`CERT_REQUIRED`。" -#: ../../library/ssl.rst:501 +#: ../../library/ssl.rst:502 msgid "" "In server mode, a client certificate request is sent to the client. The " "client may either ignore the request or send a certificate in order perform " @@ -795,7 +795,7 @@ msgstr "" "發送憑證來執行 TLS 用戶端憑證身分驗證。如果用戶端選擇發送憑證,則會對其進行驗" "證。任何驗證錯誤都會立刻終止 TLS 握手。" -#: ../../library/ssl.rst:507 ../../library/ssl.rst:526 +#: ../../library/ssl.rst:508 ../../library/ssl.rst:527 msgid "" "Use of this setting requires a valid set of CA certificates to be passed to :" "meth:`SSLContext.load_verify_locations`." @@ -803,7 +803,7 @@ msgstr "" "使用此設定需要將一組有效的 CA 憑證傳送給 :meth:`SSLContext." "load_verify_locations`。" -#: ../../library/ssl.rst:512 +#: ../../library/ssl.rst:513 msgid "" "Possible value for :attr:`SSLContext.verify_mode`. In this mode, " "certificates are required from the other side of the socket connection; an :" @@ -821,7 +821,7 @@ msgstr "" "`PROTOCOL_TLS_CLIENT` 會使用 :const:`CERT_REQUIRED` 並預設開啟 :attr:" "`~SSLContext.check_hostname`。" -#: ../../library/ssl.rst:522 +#: ../../library/ssl.rst:523 msgid "" "With server socket, this mode provides mandatory TLS client cert " "authentication. A client certificate request is sent to the client and the " @@ -830,11 +830,11 @@ msgstr "" "對於 socket 伺服器,此模式會提供強制的 TLS 用戶端憑證驗證。用戶端憑證請求會被" "發送給用戶端並且用戶端必須提供有效且被信任的憑證。" -#: ../../library/ssl.rst:531 +#: ../../library/ssl.rst:532 msgid ":class:`enum.IntEnum` collection of CERT_* constants." msgstr ":class:`enum.IntEnum` 為 CERT_* 常數的一個集合。" -#: ../../library/ssl.rst:537 +#: ../../library/ssl.rst:538 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, " "certificate revocation lists (CRLs) are not checked. By default OpenSSL does " @@ -843,7 +843,7 @@ msgstr "" ":attr:`SSLContext.verify_flags` 可能的值。在此模式下,不會檢查憑證吊銷列表 " "(CRLs)。預設的 OpenSSL 並不會請求及驗證 CRLs。" -#: ../../library/ssl.rst:545 +#: ../../library/ssl.rst:546 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the " "peer cert is checked but none of the intermediate CA certificates. The mode " @@ -856,7 +856,7 @@ msgstr "" "效的 CRL 簽名。如果沒有用 :attr:`SSLContext.load_verify_locations` 載入適當" "的 CRL,則會驗證失敗。" -#: ../../library/ssl.rst:555 +#: ../../library/ssl.rst:556 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, CRLs of " "all certificates in the peer cert chain are checked." @@ -864,7 +864,7 @@ msgstr "" ":attr:`SSLContext.verify_flags` 可能的值。在此模式下,會檢查對等憑證鍊中所有" "憑證的 CRLs。" -#: ../../library/ssl.rst:562 +#: ../../library/ssl.rst:563 msgid "" "Possible value for :attr:`SSLContext.verify_flags` to disable workarounds " "for broken X.509 certificates." @@ -872,13 +872,13 @@ msgstr "" ":attr:`SSLContext.verify_flags` 可能的值,用來禁用已損壞的 X.509 憑證的解決方" "法。" -#: ../../library/ssl.rst:569 +#: ../../library/ssl.rst:570 msgid "" "Possible value for :attr:`SSLContext.verify_flags` to enables proxy " "certificate verification." msgstr ":attr:`SSLContext.verify_flags` 可能的值,用來啟用憑證代理驗證。" -#: ../../library/ssl.rst:576 +#: ../../library/ssl.rst:577 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to " "prefer trusted certificates when building the trust chain to validate a " @@ -887,7 +887,7 @@ msgstr "" ":attr:`SSLContext.verify_flags` 可能的值。它指示 OpenSSL 在構建信任鍊來驗證憑" "證時會優先使用被信任的憑證。此旗標預設開啟。" -#: ../../library/ssl.rst:584 +#: ../../library/ssl.rst:585 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to " "accept intermediate CAs in the trust store to be treated as trust-anchors, " @@ -899,11 +899,11 @@ msgstr "" "間 CAs 作為信任錨,就像自簽名的根 CA 憑證。這樣就能去信任中間 CA 所頒發的憑" "證,而不一定非要去信任其祖先的根 CA。" -#: ../../library/ssl.rst:595 +#: ../../library/ssl.rst:596 msgid ":class:`enum.IntFlag` collection of VERIFY_* constants." msgstr ":class:`enum.IntFlag` 為 VERIFY_* 常數的其中一個集合。" -#: ../../library/ssl.rst:601 +#: ../../library/ssl.rst:602 msgid "" "Selects the highest protocol version that both the client and server " "support. Despite the name, this option can select both \"SSL\" and \"TLS\" " @@ -912,7 +912,7 @@ msgstr "" "選擇用戶端及伺服器均可以支援最高協定版本。儘管名稱只有 「TLS」,但實際上" "「SSL」和「TLS」均可以選擇。" -#: ../../library/ssl.rst:608 +#: ../../library/ssl.rst:609 msgid "" "TLS clients and servers require different default settings for secure " "communication. The generic TLS protocol constant is deprecated in favor of :" @@ -921,7 +921,7 @@ msgstr "" "TLS 的用戶端及伺服器端需要不同的預設值來實現安全通訊。通用的 TLS 協定常數已被" "廢除,並改用 :data:`PROTOCOL_TLS_CLIENT` 和 :data:`PROTOCOL_TLS_SERVER`。" -#: ../../library/ssl.rst:614 +#: ../../library/ssl.rst:615 msgid "" "Auto-negotiate the highest protocol version that both the client and server " "support, and configure the context client-side connections. The protocol " @@ -931,35 +931,35 @@ msgstr "" "自動協商用戶端和伺服器服務器都支援的最高協定版本,並配置用戶端語境連線。該協" "定預設啟用 :data:`CERT_REQUIRED` 和 :attr:`~SSLContext.check_hostname`。" -#: ../../library/ssl.rst:623 +#: ../../library/ssl.rst:624 msgid "" "Auto-negotiate the highest protocol version that both the client and server " "support, and configure the context server-side connections." msgstr "自動協商用戶端和伺服器都支援的最高協定版本,並配置用戶端語境連線。" -#: ../../library/ssl.rst:630 +#: ../../library/ssl.rst:631 msgid "Alias for :data:`PROTOCOL_TLS`." msgstr ":data:`PROTOCOL_TLS` 的別名。" -#: ../../library/ssl.rst:634 +#: ../../library/ssl.rst:635 msgid "Use :data:`PROTOCOL_TLS` instead." msgstr "請改用 :data:`PROTOCOL_TLS`。" -#: ../../library/ssl.rst:638 +#: ../../library/ssl.rst:639 msgid "Selects SSL version 3 as the channel encryption protocol." msgstr "選擇第三版的 SSL 做為通道加密協定。" -#: ../../library/ssl.rst:640 +#: ../../library/ssl.rst:641 msgid "" "This protocol is not available if OpenSSL is compiled with the ``no-ssl3`` " "option." msgstr "如果 OpenSSL 是用 ``no-ssl3`` 編譯的,則此項協定無法使用。" -#: ../../library/ssl.rst:645 +#: ../../library/ssl.rst:646 msgid "SSL version 3 is insecure. Its use is highly discouraged." msgstr "第三版的 SSL 是不安全的,強烈建議不要使用。" -#: ../../library/ssl.rst:649 +#: ../../library/ssl.rst:650 msgid "" "OpenSSL has deprecated all version specific protocols. Use the default " "protocol :data:`PROTOCOL_TLS_SERVER` or :data:`PROTOCOL_TLS_CLIENT` with :" @@ -970,16 +970,16 @@ msgstr "" "`PROTOCOL_TLS_SERVER` 協定或帶有 :attr:`SSLContext.minimum_version` 和 :attr:" "`SSLContext.maximum_version` 的 :data:`PROTOCOL_TLS_CLIENT`。" -#: ../../library/ssl.rst:657 +#: ../../library/ssl.rst:658 msgid "Selects TLS version 1.0 as the channel encryption protocol." msgstr "選擇 1.0 版的 TLS 做為通道加密協定。" -#: ../../library/ssl.rst:661 ../../library/ssl.rst:672 -#: ../../library/ssl.rst:683 +#: ../../library/ssl.rst:662 ../../library/ssl.rst:673 +#: ../../library/ssl.rst:684 msgid "OpenSSL has deprecated all version specific protocols." msgstr "OpenSSL 已經將所有版本特定的協定棄用。" -#: ../../library/ssl.rst:665 +#: ../../library/ssl.rst:666 msgid "" "Selects TLS version 1.1 as the channel encryption protocol. Available only " "with openssl version 1.0.1+." @@ -987,7 +987,7 @@ msgstr "" "選擇 1.1 版的 TLS 做為通道加密協定。只有在 1.0.1 版本以上的 OpenSSL 才可以選" "用。" -#: ../../library/ssl.rst:676 +#: ../../library/ssl.rst:677 msgid "" "Selects TLS version 1.2 as the channel encryption protocol. Available only " "with openssl version 1.0.1+." @@ -995,7 +995,7 @@ msgstr "" "選擇 1.2 版的 TLS 做為通道加密協定。只有在 1.0.1 版本以上的 OpenSSL 才可以選" "用。" -#: ../../library/ssl.rst:687 +#: ../../library/ssl.rst:688 msgid "" "Enables workarounds for various bugs present in other SSL implementations. " "This option is set by default. It does not necessarily set the same flags " @@ -1004,7 +1004,7 @@ msgstr "" "啟用對 SSL 實作時所產生的各種錯誤的緩解措施。此選項預設被設定。它不一定設定" "與 OpenSSL 的 ``SSL_OP_ALL`` 常數相同的旗標。" -#: ../../library/ssl.rst:695 +#: ../../library/ssl.rst:696 msgid "" "Prevents an SSLv2 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing SSLv2 as " @@ -1013,11 +1013,11 @@ msgstr "" "防止 SSLv2 連線。此選項只可以跟 :const:`PROTOCOL_TLS` 一起使用。它會防止同級 " "(peer)選用 SSLv2 做為協定版本。" -#: ../../library/ssl.rst:703 +#: ../../library/ssl.rst:704 msgid "SSLv2 is deprecated" msgstr "SSLv2 已被棄用" -#: ../../library/ssl.rst:707 +#: ../../library/ssl.rst:708 msgid "" "Prevents an SSLv3 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing SSLv3 as " @@ -1026,11 +1026,11 @@ msgstr "" "防止 SSLv3 連線。此選項只可以跟 :const:`PROTOCOL_TLS` 一起使用。它會防止同級" "選用 SSLv3 做為協定版本。" -#: ../../library/ssl.rst:715 +#: ../../library/ssl.rst:716 msgid "SSLv3 is deprecated" msgstr "SSLv3 已被棄用" -#: ../../library/ssl.rst:719 +#: ../../library/ssl.rst:720 msgid "" "Prevents a TLSv1 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1 as " @@ -1039,7 +1039,7 @@ msgstr "" "防止 TLSv1 連線。此選項只可以跟 :const:`PROTOCOL_TLS` 一起使用。它會防止同級" "選用 TLSv1 做為協定版本。" -#: ../../library/ssl.rst:725 +#: ../../library/ssl.rst:726 msgid "" "The option is deprecated since OpenSSL 1.1.0, use the new :attr:`SSLContext." "minimum_version` and :attr:`SSLContext.maximum_version` instead." @@ -1047,7 +1047,7 @@ msgstr "" "該選項自從 OpenSSL 1.1.0 以後已被棄用,請改用新的 :attr:`SSLContext." "minimum_version` 及 :attr:`SSLContext.maximum_version` 代替。" -#: ../../library/ssl.rst:732 +#: ../../library/ssl.rst:733 msgid "" "Prevents a TLSv1.1 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.1 as " @@ -1056,11 +1056,11 @@ msgstr "" "防止 TLSv1.1 連線。此選項只可以跟 :const:`PROTOCOL_TLS` 一起使用。它會防止同" "級選用 TLSv1.1 做為協定版本。只有 1.0.1 版後的 OpenSSL 版本才能使用。" -#: ../../library/ssl.rst:738 ../../library/ssl.rst:749 +#: ../../library/ssl.rst:739 ../../library/ssl.rst:750 msgid "The option is deprecated since OpenSSL 1.1.0." msgstr "此選項自 OpenSSL 1.1.0 版已被棄用。" -#: ../../library/ssl.rst:743 +#: ../../library/ssl.rst:744 msgid "" "Prevents a TLSv1.2 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.2 as " @@ -1069,7 +1069,7 @@ msgstr "" "防止 TLSv1.2 連線。此選項只可以跟 :const:`PROTOCOL_TLS` 一起使用。它會防止同" "級選用 TLSv1.2 做為協定版本。只有 1.0.1 版後的 OpenSSL 版本才能使用。" -#: ../../library/ssl.rst:754 +#: ../../library/ssl.rst:755 msgid "" "Prevents a TLSv1.3 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.3 as " @@ -1081,7 +1081,7 @@ msgstr "" "級選用 TLSv1.3 做為協定版本。TSL1.3 只適用於 1.1.1 版以後的 OpenSSL。當使用 " "Python 編譯舊版的 OpenSSL 時,該標志預設為 *0*。" -#: ../../library/ssl.rst:762 +#: ../../library/ssl.rst:763 msgid "" "The option is deprecated since OpenSSL 1.1.0. It was added to 2.7.15 and " "3.6.3 for backwards compatibility with OpenSSL 1.0.2." @@ -1089,7 +1089,7 @@ msgstr "" "此選項自 OpenSSL 1.1.0 以後已被棄用。它被添加到 2.7.15 和 3.6.3 中,以向後相" "容 OpenSSL 1.0.2。" -#: ../../library/ssl.rst:768 +#: ../../library/ssl.rst:769 msgid "" "Disable all renegotiation in TLSv1.2 and earlier. Do not send HelloRequest " "messages, and ignore renegotiation requests via ClientHello." @@ -1097,11 +1097,11 @@ msgstr "" "停用所有在 TLSv1.2 及更早版本的重協商 (renegotiation)。不發送 HelloRequest 訊" "息,並忽略通過 ClientHello 的重協商請求。" -#: ../../library/ssl.rst:771 +#: ../../library/ssl.rst:772 msgid "This option is only available with OpenSSL 1.1.0h and later." msgstr "此選項僅適用於 OpenSSL 1.1.0h 及更新版本。" -#: ../../library/ssl.rst:777 +#: ../../library/ssl.rst:778 msgid "" "Use the server's cipher ordering preference, rather than the client's. This " "option has no effect on client sockets and SSLv2 server sockets." @@ -1109,7 +1109,7 @@ msgstr "" "使用伺服器的加密方法名稱字串排序優先順序,而不是用戶端的。此選項並不會影響到" "用戶端及 SSLv2 伺服器的 sockets。" -#: ../../library/ssl.rst:784 +#: ../../library/ssl.rst:785 msgid "" "Prevents reuse of the same DH key for distinct SSL sessions. This improves " "forward secrecy but requires more computational resources. This option only " @@ -1118,7 +1118,7 @@ msgstr "" "防止對不同的 SSL 會談重複使用相同的 DH 密鑰。這會加強向前保密但需要更多的運算" "資源。此選項只適用於伺服器 sockets。" -#: ../../library/ssl.rst:792 +#: ../../library/ssl.rst:793 msgid "" "Prevents reuse of the same ECDH key for distinct SSL sessions. This " "improves forward secrecy but requires more computational resources. This " @@ -1127,7 +1127,7 @@ msgstr "" "防止對不同的 SSL 會談重複使用相同的 ECDH 密鑰。這會加強向前保密但需要更多的運" "算資源。此選項只適用於伺服器 sockets。" -#: ../../library/ssl.rst:800 +#: ../../library/ssl.rst:801 msgid "" "Send dummy Change Cipher Spec (CCS) messages in TLS 1.3 handshake to make a " "TLS 1.3 connection look more like a TLS 1.2 connection." @@ -1135,34 +1135,34 @@ msgstr "" "在 TLS 1.3 握手中發送虛擬的變更加密方法規範 (CCS) 消息,以使 TLS 1.3 連接看起" "來更像 TLS 1.2 連線。" -#: ../../library/ssl.rst:803 +#: ../../library/ssl.rst:804 msgid "This option is only available with OpenSSL 1.1.1 and later." msgstr "此選項僅適用於 OpenSSL 1.1.1 及更新版本。" -#: ../../library/ssl.rst:809 +#: ../../library/ssl.rst:810 msgid "" "Disable compression on the SSL channel. This is useful if the application " "protocol supports its own compression scheme." msgstr "" "在 SSL 通道上禁用壓縮。如果應用程序協定支援自己的壓縮方案,這會很有用。" -#: ../../library/ssl.rst:816 +#: ../../library/ssl.rst:817 msgid ":class:`enum.IntFlag` collection of OP_* constants." msgstr ":class:`enum.IntFlag` 為 OP_* 常數中的一個集合。" -#: ../../library/ssl.rst:820 +#: ../../library/ssl.rst:821 msgid "Prevent client side from requesting a session ticket." msgstr "防止用戶端請求會談票據。" -#: ../../library/ssl.rst:826 +#: ../../library/ssl.rst:827 msgid "Ignore unexpected shutdown of TLS connections." msgstr "忽略意外關閉的 TLS 連線。" -#: ../../library/ssl.rst:828 ../../library/ssl.rst:844 +#: ../../library/ssl.rst:829 ../../library/ssl.rst:845 msgid "This option is only available with OpenSSL 3.0.0 and later." msgstr "此選項僅適用於 OpenSSL 3.0.0 及更新版本。" -#: ../../library/ssl.rst:834 +#: ../../library/ssl.rst:835 msgid "" "Enable the use of the kernel TLS. To benefit from the feature, OpenSSL must " "have been compiled with support for it, and the negotiated cipher suites and " @@ -1173,7 +1173,7 @@ msgstr "" "的加密套件及擴充套件也必須被該功能支援 (該功能所支援的列表可能會因平台及核心" "而有所差異)。" -#: ../../library/ssl.rst:839 +#: ../../library/ssl.rst:840 msgid "" "Note that with enabled kernel TLS some cryptographic operations are " "performed by the kernel directly and not via any available OpenSSL " @@ -1184,13 +1184,13 @@ msgstr "" "的 OpenSSL 所提供的程序,而這可能並非你所想使用的,例如:當應用程式要求所有的" "加密操作由 FIPS 提供執行。" -#: ../../library/ssl.rst:850 +#: ../../library/ssl.rst:851 msgid "" "Allow legacy insecure renegotiation between OpenSSL and unpatched servers " "only." msgstr "只允許 OpenSSL 與未修補的伺服器進行遺留 (legacy) 不安全重協商。" -#: ../../library/ssl.rst:857 +#: ../../library/ssl.rst:858 msgid "" "Whether the OpenSSL library has built-in support for the *Application-Layer " "Protocol Negotiation* TLS extension as described in :rfc:`7301`." @@ -1198,7 +1198,7 @@ msgstr "" "OpenSSL 函式庫是否內建支援 *應用層協定協商* TLS 擴充套件,該擴充套件描述在 :" "rfc:`7301` 中。" -#: ../../library/ssl.rst:864 +#: ../../library/ssl.rst:865 msgid "" "Whether the OpenSSL library has built-in support not checking subject common " "name and :attr:`SSLContext.hostname_checks_common_name` is writeable." @@ -1206,7 +1206,7 @@ msgstr "" "OpenSSL 函式庫是否內建支援不檢查主題通用名稱及 :attr:`SSLContext." "hostname_checks_common_name` 是否可寫。" -#: ../../library/ssl.rst:872 +#: ../../library/ssl.rst:873 msgid "" "Whether the OpenSSL library has built-in support for the Elliptic Curve-" "based Diffie-Hellman key exchange. This should be true unless the feature " @@ -1215,7 +1215,7 @@ msgstr "" "OpenSSL 函式庫是否內建支援基於橢圓曲線的 (Elliptic Curve-based) Diffie-" "Hellman 金鑰交換。此回傳值應該要為 true 除非發布者明確禁用此功能。" -#: ../../library/ssl.rst:880 +#: ../../library/ssl.rst:881 msgid "" "Whether the OpenSSL library has built-in support for the *Server Name " "Indication* extension (as defined in :rfc:`6066`)." @@ -1223,7 +1223,7 @@ msgstr "" "OpenSSL 函式庫是否內建支援 *伺服器名稱提示* 擴充套件 (在 :rfc:`6066` 中定" "義)。" -#: ../../library/ssl.rst:887 +#: ../../library/ssl.rst:888 msgid "" "Whether the OpenSSL library has built-in support for the *Next Protocol " "Negotiation* as described in the `Application Layer Protocol Negotiation " @@ -1236,45 +1236,45 @@ msgstr "" "描述。當此值為 true 時,你可以使用 :meth:`SSLContext.set_npn_protocols` 方法" "來公告你想支援的協定。" -#: ../../library/ssl.rst:897 +#: ../../library/ssl.rst:898 msgid "" "Whether the OpenSSL library has built-in support for the SSL 2.0 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 SSL 2.0 協定。" -#: ../../library/ssl.rst:903 +#: ../../library/ssl.rst:904 msgid "" "Whether the OpenSSL library has built-in support for the SSL 3.0 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 SSL 3.0 協定。" -#: ../../library/ssl.rst:909 +#: ../../library/ssl.rst:910 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.0 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 TLS 1.0 協定。" -#: ../../library/ssl.rst:915 +#: ../../library/ssl.rst:916 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.1 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 TLS 1.1 協定。" -#: ../../library/ssl.rst:921 +#: ../../library/ssl.rst:922 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.2 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 TLS 1.2 協定。" -#: ../../library/ssl.rst:927 +#: ../../library/ssl.rst:928 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.3 protocol." msgstr "此 OpenSSL 函式庫是否內建支援 TLS 1.3 協定。" -#: ../../library/ssl.rst:933 +#: ../../library/ssl.rst:934 msgid "Whether the OpenSSL library has built-in support for TLS-PSK." msgstr "此 OpenSSL 函式庫是否內建支援 TLS-PSK。" -#: ../../library/ssl.rst:939 +#: ../../library/ssl.rst:940 msgid "Whether the OpenSSL library has built-in support for TLS-PHA." msgstr "此 OpenSSL 函式庫是否內建支援 TLS-PHA。" -#: ../../library/ssl.rst:945 +#: ../../library/ssl.rst:946 msgid "" "List of supported TLS channel binding types. Strings in this list can be " "used as arguments to :meth:`SSLSocket.get_channel_binding`." @@ -1282,11 +1282,11 @@ msgstr "" "支援的 TLS 通道綁定類型列表。列表中的字串可以作為 :meth:`SSLSocket." "get_channel_binding` 的參數。" -#: ../../library/ssl.rst:952 +#: ../../library/ssl.rst:953 msgid "The version string of the OpenSSL library loaded by the interpreter::" msgstr "直譯器所加載的 OpenSSL 函式庫的版本字串::" -#: ../../library/ssl.rst:954 +#: ../../library/ssl.rst:955 msgid "" ">>> ssl.OPENSSL_VERSION\n" "'OpenSSL 1.0.2k 26 Jan 2017'" @@ -1294,13 +1294,13 @@ msgstr "" ">>> ssl.OPENSSL_VERSION\n" "'OpenSSL 1.0.2k 26 Jan 2017'" -#: ../../library/ssl.rst:961 +#: ../../library/ssl.rst:962 msgid "" "A tuple of five integers representing version information about the OpenSSL " "library::" msgstr "代表 OpenSSL 函式庫版本資訊的五個整數的元組: ::" -#: ../../library/ssl.rst:964 +#: ../../library/ssl.rst:965 msgid "" ">>> ssl.OPENSSL_VERSION_INFO\n" "(1, 0, 2, 11, 15)" @@ -1308,11 +1308,11 @@ msgstr "" ">>> ssl.OPENSSL_VERSION_INFO\n" "(1, 0, 2, 11, 15)" -#: ../../library/ssl.rst:971 +#: ../../library/ssl.rst:972 msgid "The raw version number of the OpenSSL library, as a single integer::" msgstr "OpenSSL 函式庫的初始版本,以單一整數表示::" -#: ../../library/ssl.rst:973 +#: ../../library/ssl.rst:974 msgid "" ">>> ssl.OPENSSL_VERSION_NUMBER\n" "268443839\n" @@ -1324,7 +1324,7 @@ msgstr "" ">>> hex(ssl.OPENSSL_VERSION_NUMBER)\n" "'0x100020bf'" -#: ../../library/ssl.rst:984 +#: ../../library/ssl.rst:985 msgid "" "Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry " "`_ 包" "含了此列表以及其含義定義所在的 RFC 的引用。" -#: ../../library/ssl.rst:988 +#: ../../library/ssl.rst:989 msgid "" "Used as the return value of the callback function in :meth:`SSLContext." "set_servername_callback`." msgstr "" "被用來做為 :meth:`SSLContext.set_servername_callback` 中回呼函式的回傳值。" -#: ../../library/ssl.rst:995 +#: ../../library/ssl.rst:996 msgid ":class:`enum.IntEnum` collection of ALERT_DESCRIPTION_* constants." msgstr ":class:`enum.IntEnum` 為 ALERT_DESCRIPTION_* 常數中的一個集合。" -#: ../../library/ssl.rst:1001 +#: ../../library/ssl.rst:1002 msgid "" "Option for :func:`create_default_context` and :meth:`SSLContext." "load_default_certs`. This value indicates that the context may be used to " @@ -1356,7 +1356,7 @@ msgstr "" ":func:`create_default_context` 和 :meth:`SSLContext.load_default_certs` 的選" "項。此值表示該語境可能會用於驗證網頁伺服器 (因此它將用於建立用戶端 socket)。" -#: ../../library/ssl.rst:1010 +#: ../../library/ssl.rst:1011 msgid "" "Option for :func:`create_default_context` and :meth:`SSLContext." "load_default_certs`. This value indicates that the context may be used to " @@ -1367,11 +1367,11 @@ msgstr "" "項。此值表示該語境可能會用於驗證網頁用戶端 (因此,它將用於建立伺服器端的 " "socket)。" -#: ../../library/ssl.rst:1019 +#: ../../library/ssl.rst:1020 msgid ":class:`enum.IntEnum` collection of SSL_ERROR_* constants." msgstr ":class:`enum.IntEnum` 為 SSL_ERROR_* 常數中的一個集合。" -#: ../../library/ssl.rst:1025 +#: ../../library/ssl.rst:1026 msgid "" ":class:`enum.IntEnum` collection of SSL and TLS versions for :attr:" "`SSLContext.maximum_version` and :attr:`SSLContext.minimum_version`." @@ -1379,7 +1379,7 @@ msgstr "" "用於 :attr:`SSLContext.maximum_version` 和 :attr:`SSLContext." "minimum_version` 的 SSL 和 TLS 版本 :class:`enum.IntEnum` 集合。" -#: ../../library/ssl.rst:1033 +#: ../../library/ssl.rst:1034 msgid "" "The minimum or maximum supported SSL or TLS version. These are magic " "constants. Their values don't reflect the lowest and highest available TLS/" @@ -1388,11 +1388,11 @@ msgstr "" "最低或最高支援的 SSL 或 TLS 版本。這些是特殊常數。它們的值並不反映可用的最低" "和最高 TLS/SSL 版本。" -#: ../../library/ssl.rst:1043 +#: ../../library/ssl.rst:1044 msgid "SSL 3.0 to TLS 1.3." msgstr "SSL 3.0 到 TLS 1.3。" -#: ../../library/ssl.rst:1047 +#: ../../library/ssl.rst:1048 msgid "" "All :class:`TLSVersion` members except :attr:`TLSVersion.TLSv1_2` and :attr:" "`TLSVersion.TLSv1_3` are deprecated." @@ -1400,47 +1400,47 @@ msgstr "" "除了 :attr:`TLSVersion.TLSv1_2` 和 :attr:`TLSVersion.TLSv1_3` 之外,所有的 :" "class:`TLSVersion` 成員都已被棄用。" -#: ../../library/ssl.rst:1052 +#: ../../library/ssl.rst:1053 msgid "SSL Sockets" msgstr "SSL Sockets" -#: ../../library/ssl.rst:1056 +#: ../../library/ssl.rst:1057 msgid "SSL sockets provide the following methods of :ref:`socket-objects`:" msgstr "SSL sockets 提供以下 :ref:`socket-objects` 方法:" -#: ../../library/ssl.rst:1058 +#: ../../library/ssl.rst:1059 msgid ":meth:`~socket.socket.accept`" msgstr ":meth:`~socket.socket.accept`" -#: ../../library/ssl.rst:1059 +#: ../../library/ssl.rst:1060 msgid ":meth:`~socket.socket.bind`" msgstr ":meth:`~socket.socket.bind`" -#: ../../library/ssl.rst:1060 +#: ../../library/ssl.rst:1061 msgid ":meth:`~socket.socket.close`" msgstr ":meth:`~socket.socket.close`" -#: ../../library/ssl.rst:1061 +#: ../../library/ssl.rst:1062 msgid ":meth:`~socket.socket.connect`" msgstr ":meth:`~socket.socket.connect`" -#: ../../library/ssl.rst:1062 +#: ../../library/ssl.rst:1063 msgid ":meth:`~socket.socket.detach`" msgstr ":meth:`~socket.socket.detach`" -#: ../../library/ssl.rst:1063 +#: ../../library/ssl.rst:1064 msgid ":meth:`~socket.socket.fileno`" msgstr ":meth:`~socket.socket.fileno`" -#: ../../library/ssl.rst:1064 +#: ../../library/ssl.rst:1065 msgid ":meth:`~socket.socket.getpeername`, :meth:`~socket.socket.getsockname`" msgstr ":meth:`~socket.socket.getpeername`、:meth:`~socket.socket.getsockname`" -#: ../../library/ssl.rst:1065 +#: ../../library/ssl.rst:1066 msgid ":meth:`~socket.socket.getsockopt`, :meth:`~socket.socket.setsockopt`" msgstr ":meth:`~socket.socket.getsockopt`、:meth:`~socket.socket.setsockopt`" -#: ../../library/ssl.rst:1066 +#: ../../library/ssl.rst:1067 msgid "" ":meth:`~socket.socket.gettimeout`, :meth:`~socket.socket.settimeout`, :meth:" "`~socket.socket.setblocking`" @@ -1448,15 +1448,15 @@ msgstr "" ":meth:`~socket.socket.gettimeout`、:meth:`~socket.socket.settimeout`、:meth:" "`~socket.socket.setblocking`" -#: ../../library/ssl.rst:1068 +#: ../../library/ssl.rst:1069 msgid ":meth:`~socket.socket.listen`" msgstr ":meth:`~socket.socket.listen`" -#: ../../library/ssl.rst:1069 +#: ../../library/ssl.rst:1070 msgid ":meth:`~socket.socket.makefile`" msgstr ":meth:`~socket.socket.makefile`" -#: ../../library/ssl.rst:1070 +#: ../../library/ssl.rst:1071 msgid "" ":meth:`~socket.socket.recv`, :meth:`~socket.socket.recv_into` (but passing a " "non-zero ``flags`` argument is not allowed)" @@ -1464,7 +1464,7 @@ msgstr "" ":meth:`~socket.socket.recv`、:meth:`~socket.socket.recv_into` (但不允許傳遞" "非零的 ``flags`` 引數)" -#: ../../library/ssl.rst:1072 +#: ../../library/ssl.rst:1073 msgid "" ":meth:`~socket.socket.send`, :meth:`~socket.socket.sendall` (with the same " "limitation)" @@ -1472,7 +1472,7 @@ msgstr "" ":meth:`~socket.socket.send`、:meth:`~socket.socket.sendall` (同樣不允許傳遞" "非零的 ``flags`` 引數)" -#: ../../library/ssl.rst:1074 +#: ../../library/ssl.rst:1075 msgid "" ":meth:`~socket.socket.sendfile` (but :mod:`os.sendfile` will be used for " "plain-text sockets only, else :meth:`~socket.socket.send` will be used)" @@ -1480,11 +1480,11 @@ msgstr "" ":meth:`~socket.socket.sendfile` (但 :mod:`os.sendfile` 只能用於純文本 " "sockets,其餘則會使用 :meth:`~socket.socket.send`)" -#: ../../library/ssl.rst:1076 +#: ../../library/ssl.rst:1077 msgid ":meth:`~socket.socket.shutdown`" msgstr ":meth:`~socket.socket.shutdown`" -#: ../../library/ssl.rst:1078 +#: ../../library/ssl.rst:1079 msgid "" "However, since the SSL (and TLS) protocol has its own framing atop of TCP, " "the SSL sockets abstraction can, in certain respects, diverge from the " @@ -1495,18 +1495,18 @@ msgstr "" "sockets 的抽象可能會與普通作業系統級別的 sockets 規範有所不同。特別是請參閱" "\\ :ref:`關於 non-blocking sockets 的說明 `。" -#: ../../library/ssl.rst:1083 +#: ../../library/ssl.rst:1084 msgid "" "Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext." "wrap_socket` method." msgstr "" ":class:`SSLSocket` 的實例必須使用 :meth:`SSLContext.wrap_socket` 方法建立。" -#: ../../library/ssl.rst:1086 +#: ../../library/ssl.rst:1087 msgid "The :meth:`sendfile` method was added." msgstr "新增 :meth:`sendfile` 方法。" -#: ../../library/ssl.rst:1089 +#: ../../library/ssl.rst:1090 msgid "" "The :meth:`shutdown` does not reset the socket timeout each time bytes are " "received or sent. The socket timeout is now the maximum total duration of " @@ -1515,7 +1515,7 @@ msgstr "" ":meth:`shutdown` 不會在每次接收或發送位元組時重置 socket 超時時間。現在," "socket 超時時間是關閉操作的最大總持續時間。" -#: ../../library/ssl.rst:1094 +#: ../../library/ssl.rst:1095 msgid "" "It is deprecated to create a :class:`SSLSocket` instance directly, use :meth:" "`SSLContext.wrap_socket` to wrap a socket." @@ -1523,7 +1523,7 @@ msgstr "" "直接建立 :class:`SSLSocket` 實例的方式已被棄用,請使用 :meth:`SSLContext." "wrap_socket` 來包裝 socket。" -#: ../../library/ssl.rst:1098 +#: ../../library/ssl.rst:1099 msgid "" ":class:`SSLSocket` instances must to created with :meth:`~SSLContext." "wrap_socket`. In earlier versions, it was possible to create instances " @@ -1532,7 +1532,7 @@ msgstr "" ":class:`SSLSocket` 實例必須使用 :meth:`~SSLContext.wrap_socket` 建立。在較早" "的版本中可以直接建立實例,但這從未被記錄或正式支援。" -#: ../../library/ssl.rst:1104 +#: ../../library/ssl.rst:1105 msgid "" "Python now uses ``SSL_read_ex`` and ``SSL_write_ex`` internally. The " "functions support reading and writing of data larger than 2 GB. Writing zero-" @@ -1541,11 +1541,11 @@ msgstr "" "Python 現在內部使用了 ``SSL_read_ex`` 和 ``SSL_write_ex`` 函式。這些函式支援" "讀取和寫入大於 2 GB 的資料。寫入零長度的資料不再會導致協定違規錯誤。" -#: ../../library/ssl.rst:1109 +#: ../../library/ssl.rst:1110 msgid "SSL sockets also have the following additional methods and attributes:" msgstr "SSL sockets 還具有以下附加方法和屬性:" -#: ../../library/ssl.rst:1113 +#: ../../library/ssl.rst:1114 msgid "" "Read up to *len* bytes of data from the SSL socket and return the result as " "a ``bytes`` instance. If *buffer* is specified, then read into the buffer " @@ -1554,7 +1554,7 @@ msgstr "" "從 SSL socket 讀取 *len* 位元組的資料,並將結果以 ``bytes`` 實例的形式回傳。" "如果指定了 *buffer*,則將資料讀入緩衝區,並回傳讀取的位元組。" -#: ../../library/ssl.rst:1117 +#: ../../library/ssl.rst:1118 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the read would block." @@ -1562,14 +1562,14 @@ msgstr "" "如果 socket 是\\ :ref:`非阻塞的 `\\ 則會引發 :exc:" "`SSLWantReadError` 或 :exc:`SSLWantWriteError` 並且讀取操作將會被阻塞。" -#: ../../library/ssl.rst:1120 +#: ../../library/ssl.rst:1121 msgid "" "As at any time a re-negotiation is possible, a call to :meth:`read` can also " "cause write operations." msgstr "" "由於在任何時刻都可能發生重新協商,呼叫 :meth:`read` 也可能觸發寫入操作。" -#: ../../library/ssl.rst:1123 +#: ../../library/ssl.rst:1124 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration to read up to *len* " @@ -1578,19 +1578,20 @@ msgstr "" "當接收或發送位元組時,socket 的超時時間將不再重置。現在,socket 超時時間是讀" "取最多 *len* 位元組的總最大持續時間。" -#: ../../library/ssl.rst:1128 +#: ../../library/ssl.rst:1129 msgid "Use :meth:`~SSLSocket.recv` instead of :meth:`~SSLSocket.read`." msgstr "請改用 :meth:`~SSLSocket.recv` 來替換掉 :meth:`~SSLSocket.read`。" -#: ../../library/ssl.rst:1133 +#: ../../library/ssl.rst:1134 +#, fuzzy msgid "" -"Write *buf* to the SSL socket and return the number of bytes written. The " -"*buf* argument must be an object supporting the buffer interface." +"Write *data* to the SSL socket and return the number of bytes written. The " +"*data* argument must be an object supporting the buffer interface." msgstr "" "將 *buf* 寫入 SSL socket 並回傳寫入的位元組數量。*buf* 引數必須是支援緩衝區介" "面的物件。" -#: ../../library/ssl.rst:1136 +#: ../../library/ssl.rst:1137 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the write would block." @@ -1598,26 +1599,27 @@ msgstr "" "如果 socket 是\\ :ref:`非阻塞的 `\\ 則會引發 :exc:" "`SSLWantReadError` 或 :exc:`SSLWantWriteError` 並且寫入操作將會被阻塞。" -#: ../../library/ssl.rst:1139 +#: ../../library/ssl.rst:1140 msgid "" "As at any time a re-negotiation is possible, a call to :meth:`write` can " "also cause read operations." msgstr "" "由於在任何時刻都可能發生重新協商,呼叫 :meth:`write` 也可能觸發讀取操作。" -#: ../../library/ssl.rst:1142 +#: ../../library/ssl.rst:1143 +#, fuzzy msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " -"The socket timeout is now the maximum total duration to write *buf*." +"The socket timeout is now the maximum total duration to write *data*." msgstr "" "當接收或發送位元組時,socket 的超時時間將不再重置。現在,socket 超時時間是寫" "入 *buf* 的總最大持續時間。" -#: ../../library/ssl.rst:1146 +#: ../../library/ssl.rst:1147 msgid "Use :meth:`~SSLSocket.send` instead of :meth:`~SSLSocket.write`." msgstr "請改用 :meth:`~SSLSocket.send` 來替換掉 :meth:`~SSLSocket.write`。" -#: ../../library/ssl.rst:1151 +#: ../../library/ssl.rst:1152 msgid "" "The :meth:`~SSLSocket.read` and :meth:`~SSLSocket.write` methods are the low-" "level methods that read and write unencrypted, application-level data and " @@ -1629,7 +1631,7 @@ msgstr "" "讀取和寫入未加密的應用層資料,並將其加密/解密為加密的寫入層資料。這些方法需要" "一個已建立的 SSL 連接,即握手已完成,且未呼叫 :meth:`SSLSocket.unwrap`。" -#: ../../library/ssl.rst:1157 +#: ../../library/ssl.rst:1158 msgid "" "Normally you should use the socket API methods like :meth:`~socket.socket." "recv` and :meth:`~socket.socket.send` instead of these methods." @@ -1637,20 +1639,28 @@ msgstr "" "通常你應該使用像 :meth:`~socket.socket.recv` 和 :meth:`~socket.socket.send` " "這樣的 socket API 方法,而不是直接使用這些方法。" -#: ../../library/ssl.rst:1163 +#: ../../library/ssl.rst:1164 msgid "Perform the SSL setup handshake." msgstr "執行 SSL 設定握手。" -#: ../../library/ssl.rst:1165 +#: ../../library/ssl.rst:1166 +msgid "" +"If *block* is true and the timeout obtained by :meth:`~socket.socket." +"gettimeout` is zero, the socket is set in blocking mode until the handshake " +"is performed." +msgstr "" + +#: ../../library/ssl.rst:1169 +#, fuzzy msgid "" -"The handshake method also performs :func:`match_hostname` when the :attr:" +"The handshake method also performs :func:`!match_hostname` when the :attr:" "`~SSLContext.check_hostname` attribute of the socket's :attr:`~SSLSocket." "context` is true." msgstr "" "當 socket 的 :attr:`~SSLSocket.context` 的 :attr:`~SSLContext." "check_hostname` 屬性質為 true 時,握手方法也會執行 :func:`match_hostname`。" -#: ../../library/ssl.rst:1170 +#: ../../library/ssl.rst:1174 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration of the handshake." @@ -1658,10 +1668,11 @@ msgstr "" "Socket 超時時間已經不會在每次接收或傳送位元組時重置。現在,超時時間是握手過程" "的最大總持續時間。" -#: ../../library/ssl.rst:1174 +#: ../../library/ssl.rst:1178 +#, fuzzy msgid "" "Hostname or IP address is matched by OpenSSL during handshake. The function :" -"func:`match_hostname` is no longer used. In case OpenSSL refuses a hostname " +"func:`!match_hostname` is no longer used. In case OpenSSL refuses a hostname " "or IP address, the handshake is aborted early and a TLS alert message is " "sent to the peer." msgstr "" @@ -1669,7 +1680,7 @@ msgstr "" "`match_hostname` 函式。如果 OpenSSL 拒絕某個主機名稱或 IP 地址,握手將會提前" "中止,並向對方發送 TLS 警報訊息。" -#: ../../library/ssl.rst:1182 +#: ../../library/ssl.rst:1186 msgid "" "If there is no certificate for the peer on the other end of the connection, " "return ``None``. If the SSL handshake hasn't been done yet, raise :exc:" @@ -1678,7 +1689,7 @@ msgstr "" "如果連線端沒有證書,則回傳 ``None``。如果 SSL 握手尚未完成,則引發 :exc:" "`ValueError`。" -#: ../../library/ssl.rst:1186 +#: ../../library/ssl.rst:1190 msgid "" "If the ``binary_form`` parameter is :const:`False`, and a certificate was " "received from the peer, this method returns a :class:`dict` instance. If " @@ -1695,7 +1706,7 @@ msgstr "" "``issuer`` (簽發證書的主體)。如果證書中包含 *Subject Alternative Name* 擴充 " "(參考\\ :rfc:`3280`\\ ),字典中還會有一個 ``subjectAltName`` 鍵。" -#: ../../library/ssl.rst:1195 +#: ../../library/ssl.rst:1199 msgid "" "The ``subject`` and ``issuer`` fields are tuples containing the sequence of " "relative distinguished names (RDNs) given in the certificate's data " @@ -1706,7 +1717,7 @@ msgstr "" "names, RDNs) 序列的元組,這些 RDN 來自證書資料結構中的相應欄位。每個 RDN 都是" "一組名稱與值的對。以下是現實中的範例: ::" -#: ../../library/ssl.rst:1200 +#: ../../library/ssl.rst:1204 msgid "" "{'issuer': ((('countryName', 'IL'),),\n" " (('organizationName', 'StartCom Ltd.'),),\n" @@ -1748,7 +1759,7 @@ msgstr "" " 'subjectAltName': (('DNS', '*.eff.org'), ('DNS', 'eff.org')),\n" " 'version': 3}" -#: ../../library/ssl.rst:1219 +#: ../../library/ssl.rst:1223 msgid "" "If the ``binary_form`` parameter is :const:`True`, and a certificate was " "provided, this method returns the DER-encoded form of the entire certificate " @@ -1760,13 +1771,13 @@ msgstr "" "以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對等未提供證書,則回傳 :" "const:`None`。對等是否提供證書取決於 SSL socket 的腳色:" -#: ../../library/ssl.rst:1225 +#: ../../library/ssl.rst:1229 msgid "" "for a client SSL socket, the server will always provide a certificate, " "regardless of whether validation was required;" msgstr "對於用戶端 SSL socket,伺服器將永遠提供證書,無論是否需要進行驗證;" -#: ../../library/ssl.rst:1228 +#: ../../library/ssl.rst:1232 msgid "" "for a server SSL socket, the client will only provide a certificate when " "requested by the server; therefore :meth:`getpeercert` will return :const:" @@ -1777,41 +1788,41 @@ msgstr "" "是 :const:`CERT_NONE` (而非 :const:`CERT_OPTIONAL` 或 :const:" "`CERT_REQUIRED`),則 :meth:`getpeercert` 會回傳 :const:`None`。" -#: ../../library/ssl.rst:1233 +#: ../../library/ssl.rst:1237 msgid "See also :attr:`SSLContext.check_hostname`." msgstr "請見 :attr:`SSLContext.check_hostname`。" -#: ../../library/ssl.rst:1235 +#: ../../library/ssl.rst:1239 msgid "" "The returned dictionary includes additional items such as ``issuer`` and " "``notBefore``." msgstr "" -#: ../../library/ssl.rst:1239 +#: ../../library/ssl.rst:1243 msgid "" ":exc:`ValueError` is raised when the handshake isn't done. The returned " "dictionary includes additional X509v3 extension items such as " "``crlDistributionPoints``, ``caIssuers`` and ``OCSP`` URIs." msgstr "" -#: ../../library/ssl.rst:1244 +#: ../../library/ssl.rst:1248 msgid "IPv6 address strings no longer have a trailing new line." msgstr "" -#: ../../library/ssl.rst:1249 +#: ../../library/ssl.rst:1253 msgid "" "Returns verified certificate chain provided by the other end of the SSL " "channel as a list of DER-encoded bytes. If certificate verification was " "disabled method acts the same as :meth:`~SSLSocket.get_unverified_chain`." msgstr "" -#: ../../library/ssl.rst:1258 +#: ../../library/ssl.rst:1262 msgid "" "Returns raw certificate chain provided by the other end of the SSL channel " "as a list of DER-encoded bytes." msgstr "" -#: ../../library/ssl.rst:1265 +#: ../../library/ssl.rst:1269 msgid "" "Returns a three-value tuple containing the name of the cipher being used, " "the version of the SSL protocol that defines its use, and the number of " @@ -1819,7 +1830,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/ssl.rst:1271 +#: ../../library/ssl.rst:1275 msgid "" "Return the list of ciphers available in both the client and server. Each " "entry of the returned list is a three-value tuple containing the name of the " @@ -1829,25 +1840,25 @@ msgid "" "socket." msgstr "" -#: ../../library/ssl.rst:1282 +#: ../../library/ssl.rst:1286 msgid "" "Return the compression algorithm being used as a string, or ``None`` if the " "connection isn't compressed." msgstr "" -#: ../../library/ssl.rst:1285 +#: ../../library/ssl.rst:1289 msgid "" "If the higher-level protocol supports its own compression mechanism, you can " "use :data:`OP_NO_COMPRESSION` to disable SSL-level compression." msgstr "" -#: ../../library/ssl.rst:1292 +#: ../../library/ssl.rst:1296 msgid "" "Get channel binding data for current connection, as a bytes object. Returns " "``None`` if not connected or the handshake has not been completed." msgstr "" -#: ../../library/ssl.rst:1295 +#: ../../library/ssl.rst:1299 msgid "" "The *cb_type* parameter allow selection of the desired channel binding type. " "Valid channel binding types are listed in the :data:`CHANNEL_BINDING_TYPES` " @@ -1856,7 +1867,7 @@ msgid "" "channel binding type is requested." msgstr "" -#: ../../library/ssl.rst:1305 +#: ../../library/ssl.rst:1309 msgid "" "Return the protocol that was selected during the TLS handshake. If :meth:" "`SSLContext.set_alpn_protocols` was not called, if the other party does not " @@ -1864,7 +1875,7 @@ msgid "" "protocols, or if the handshake has not happened yet, ``None`` is returned." msgstr "" -#: ../../library/ssl.rst:1315 +#: ../../library/ssl.rst:1319 msgid "" "Return the higher-level protocol that was selected during the TLS/SSL " "handshake. If :meth:`SSLContext.set_npn_protocols` was not called, or if the " @@ -1872,11 +1883,11 @@ msgid "" "this will return ``None``." msgstr "" -#: ../../library/ssl.rst:1324 ../../library/ssl.rst:1693 +#: ../../library/ssl.rst:1328 ../../library/ssl.rst:1697 msgid "NPN has been superseded by ALPN" msgstr "" -#: ../../library/ssl.rst:1328 +#: ../../library/ssl.rst:1332 msgid "" "Performs the SSL shutdown handshake, which removes the TLS layer from the " "underlying socket, and returns the underlying socket object. This can be " @@ -1885,7 +1896,7 @@ msgid "" "other side of the connection, rather than the original socket." msgstr "" -#: ../../library/ssl.rst:1336 +#: ../../library/ssl.rst:1340 msgid "" "Requests post-handshake authentication (PHA) from a TLS 1.3 client. PHA can " "only be initiated for a TLS 1.3 connection from a server-side socket, after " @@ -1893,26 +1904,26 @@ msgid "" "`SSLContext.post_handshake_auth`." msgstr "" -#: ../../library/ssl.rst:1341 +#: ../../library/ssl.rst:1345 msgid "" "The method does not perform a cert exchange immediately. The server-side " "sends a CertificateRequest during the next write event and expects the " "client to respond with a certificate on the next read event." msgstr "" -#: ../../library/ssl.rst:1345 +#: ../../library/ssl.rst:1349 msgid "" "If any precondition isn't met (e.g. not TLS 1.3, PHA not enabled), an :exc:" "`SSLError` is raised." msgstr "" -#: ../../library/ssl.rst:1349 +#: ../../library/ssl.rst:1353 msgid "" "Only available with OpenSSL 1.1.1 and TLS 1.3 enabled. Without TLS 1.3 " "support, the method raises :exc:`NotImplementedError`." msgstr "" -#: ../../library/ssl.rst:1356 +#: ../../library/ssl.rst:1360 msgid "" "Return the actual SSL protocol version negotiated by the connection as a " "string, or ``None`` if no secure connection is established. As of this " @@ -1921,29 +1932,29 @@ msgid "" "may define more return values." msgstr "" -#: ../../library/ssl.rst:1366 +#: ../../library/ssl.rst:1370 msgid "" "Returns the number of already decrypted bytes available for read, pending on " "the connection." msgstr "" -#: ../../library/ssl.rst:1371 +#: ../../library/ssl.rst:1375 msgid "The :class:`SSLContext` object this SSL socket is tied to." msgstr "" -#: ../../library/ssl.rst:1377 +#: ../../library/ssl.rst:1381 msgid "" "A boolean which is ``True`` for server-side sockets and ``False`` for client-" "side sockets." msgstr "" -#: ../../library/ssl.rst:1384 +#: ../../library/ssl.rst:1388 msgid "" "Hostname of the server: :class:`str` type, or ``None`` for server-side " "socket or if the hostname was not specified in the constructor." msgstr "" -#: ../../library/ssl.rst:1389 +#: ../../library/ssl.rst:1393 msgid "" "The attribute is now always ASCII text. When ``server_hostname`` is an " "internationalized domain name (IDN), this attribute now stores the A-label " @@ -1951,7 +1962,7 @@ msgid "" "org\"``)." msgstr "" -#: ../../library/ssl.rst:1397 +#: ../../library/ssl.rst:1401 msgid "" "The :class:`SSLSession` for this SSL connection. The session is available " "for client and server side sockets after the TLS handshake has been " @@ -1959,11 +1970,11 @@ msgid "" "`~SSLSocket.do_handshake` has been called to reuse a session." msgstr "" -#: ../../library/ssl.rst:1410 +#: ../../library/ssl.rst:1414 msgid "SSL Contexts" msgstr "" -#: ../../library/ssl.rst:1414 +#: ../../library/ssl.rst:1418 msgid "" "An SSL context holds various data longer-lived than single SSL connections, " "such as SSL configuration options, certificate(s) and private key(s). It " @@ -1971,7 +1982,7 @@ msgid "" "speed up repeated connections from the same clients." msgstr "" -#: ../../library/ssl.rst:1421 +#: ../../library/ssl.rst:1425 msgid "" "Create a new SSL context. You may pass *protocol* which must be one of the " "``PROTOCOL_*`` constants defined in this module. The parameter specifies " @@ -1982,109 +1993,109 @@ msgid "" "provides the most compatibility with other versions." msgstr "" -#: ../../library/ssl.rst:1430 +#: ../../library/ssl.rst:1434 msgid "" "Here's a table showing which versions in a client (down the side) can " "connect to which versions in a server (along the top):" msgstr "" -#: ../../library/ssl.rst:1436 +#: ../../library/ssl.rst:1440 msgid "*client* / **server**" msgstr "*client* / **server**" -#: ../../library/ssl.rst:1436 +#: ../../library/ssl.rst:1440 msgid "**SSLv2**" msgstr "**SSLv2**" -#: ../../library/ssl.rst:1436 +#: ../../library/ssl.rst:1440 msgid "**SSLv3**" msgstr "**SSLv3**" -#: ../../library/ssl.rst:1436 +#: ../../library/ssl.rst:1440 msgid "**TLS** [3]_" msgstr "**TLS** [3]_" -#: ../../library/ssl.rst:1436 +#: ../../library/ssl.rst:1440 msgid "**TLSv1**" msgstr "**TLSv1**" -#: ../../library/ssl.rst:1436 +#: ../../library/ssl.rst:1440 msgid "**TLSv1.1**" msgstr "**TLSv1.1**" -#: ../../library/ssl.rst:1436 +#: ../../library/ssl.rst:1440 msgid "**TLSv1.2**" msgstr "**TLSv1.2**" -#: ../../library/ssl.rst:1438 +#: ../../library/ssl.rst:1442 msgid "*SSLv2*" msgstr "*SSLv2*" -#: ../../library/ssl.rst:1438 ../../library/ssl.rst:1439 -#: ../../library/ssl.rst:1440 ../../library/ssl.rst:1441 #: ../../library/ssl.rst:1442 ../../library/ssl.rst:1443 +#: ../../library/ssl.rst:1444 ../../library/ssl.rst:1445 +#: ../../library/ssl.rst:1446 ../../library/ssl.rst:1447 msgid "yes" msgstr "" -#: ../../library/ssl.rst:1438 ../../library/ssl.rst:1439 -#: ../../library/ssl.rst:1441 ../../library/ssl.rst:1442 -#: ../../library/ssl.rst:1443 +#: ../../library/ssl.rst:1442 ../../library/ssl.rst:1443 +#: ../../library/ssl.rst:1445 ../../library/ssl.rst:1446 +#: ../../library/ssl.rst:1447 msgid "no" msgstr "" -#: ../../library/ssl.rst:1438 ../../library/ssl.rst:1440 +#: ../../library/ssl.rst:1442 ../../library/ssl.rst:1444 msgid "no [1]_" msgstr "" -#: ../../library/ssl.rst:1439 +#: ../../library/ssl.rst:1443 msgid "*SSLv3*" msgstr "*SSLv3*" -#: ../../library/ssl.rst:1439 ../../library/ssl.rst:1440 +#: ../../library/ssl.rst:1443 ../../library/ssl.rst:1444 msgid "no [2]_" msgstr "" -#: ../../library/ssl.rst:1440 +#: ../../library/ssl.rst:1444 msgid "*TLS* (*SSLv23*) [3]_" msgstr "*TLS* (*SSLv23*) [3]_" -#: ../../library/ssl.rst:1441 +#: ../../library/ssl.rst:1445 msgid "*TLSv1*" msgstr "*TLSv1*" -#: ../../library/ssl.rst:1442 +#: ../../library/ssl.rst:1446 msgid "*TLSv1.1*" msgstr "*TLSv1.1*" -#: ../../library/ssl.rst:1443 +#: ../../library/ssl.rst:1447 msgid "*TLSv1.2*" msgstr "*TLSv1.2*" -#: ../../library/ssl.rst:1446 +#: ../../library/ssl.rst:1450 msgid "Footnotes" msgstr "註腳" -#: ../../library/ssl.rst:1447 +#: ../../library/ssl.rst:1451 msgid ":class:`SSLContext` disables SSLv2 with :data:`OP_NO_SSLv2` by default." msgstr ":class:`SSLContext` 預設會關閉 SSLv2 的 :data:`OP_NO_SSLv2`。" -#: ../../library/ssl.rst:1448 +#: ../../library/ssl.rst:1452 msgid ":class:`SSLContext` disables SSLv3 with :data:`OP_NO_SSLv3` by default." msgstr ":class:`SSLContext` 預設會關閉 SSLv3 的 :data:`OP_NO_SSLv3`。" -#: ../../library/ssl.rst:1449 +#: ../../library/ssl.rst:1453 msgid "" "TLS 1.3 protocol will be available with :data:`PROTOCOL_TLS` in OpenSSL >= " "1.1.1. There is no dedicated PROTOCOL constant for just TLS 1.3." msgstr "" -#: ../../library/ssl.rst:1454 +#: ../../library/ssl.rst:1458 msgid "" ":func:`create_default_context` lets the :mod:`ssl` module choose security " "settings for a given purpose." msgstr "" -#: ../../library/ssl.rst:1459 +#: ../../library/ssl.rst:1463 msgid "" "The context is created with secure default values. The options :data:" "`OP_NO_COMPRESSION`, :data:`OP_CIPHER_SERVER_PREFERENCE`, :data:" @@ -2094,14 +2105,14 @@ msgid "" "ciphers and no ``MD5`` ciphers." msgstr "" -#: ../../library/ssl.rst:1469 +#: ../../library/ssl.rst:1473 msgid "" ":class:`SSLContext` without protocol argument is deprecated. The context " "class will either require :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER` protocol in the future." msgstr "" -#: ../../library/ssl.rst:1475 +#: ../../library/ssl.rst:1479 msgid "" "The default cipher suites now include only secure AES and ChaCha20 ciphers " "with forward secrecy and security level 2. RSA and DH keys with less than " @@ -2110,7 +2121,7 @@ msgid "" "use TLS 1.2 as minimum TLS version." msgstr "" -#: ../../library/ssl.rst:1483 +#: ../../library/ssl.rst:1487 msgid "" ":class:`SSLContext` only supports limited mutation once it has been used by " "a connection. Adding new certificates to the internal trust store is " @@ -2118,29 +2129,29 @@ msgid "" "may result in surprising behavior." msgstr "" -#: ../../library/ssl.rst:1490 +#: ../../library/ssl.rst:1494 msgid "" ":class:`SSLContext` is designed to be shared and used by multiple " "connections. Thus, it is thread-safe as long as it is not reconfigured after " "being used by a connection." msgstr "" -#: ../../library/ssl.rst:1495 +#: ../../library/ssl.rst:1499 msgid ":class:`SSLContext` objects have the following methods and attributes:" msgstr ":class:`SSLContext` 物件具有以下方法和屬性:" -#: ../../library/ssl.rst:1499 +#: ../../library/ssl.rst:1503 msgid "" "Get statistics about quantities of loaded X.509 certificates, count of X.509 " "certificates flagged as CA certificates and certificate revocation lists as " "dictionary." msgstr "" -#: ../../library/ssl.rst:1503 +#: ../../library/ssl.rst:1507 msgid "Example for a context with one CA cert and one other cert::" msgstr "" -#: ../../library/ssl.rst:1505 +#: ../../library/ssl.rst:1509 msgid "" ">>> context.cert_store_stats()\n" "{'crl': 0, 'x509_ca': 1, 'x509': 2}" @@ -2148,7 +2159,7 @@ msgstr "" ">>> context.cert_store_stats()\n" "{'crl': 0, 'x509_ca': 1, 'x509': 2}" -#: ../../library/ssl.rst:1513 +#: ../../library/ssl.rst:1517 msgid "" "Load a private key and the corresponding certificate. The *certfile* string " "must be the path to a single file in PEM format containing the certificate " @@ -2159,7 +2170,7 @@ msgid "" "more information on how the certificate is stored in the *certfile*." msgstr "" -#: ../../library/ssl.rst:1522 +#: ../../library/ssl.rst:1526 msgid "" "The *password* argument may be a function to call to get the password for " "decrypting the private key. It will only be called if the private key is " @@ -2171,24 +2182,24 @@ msgid "" "encrypted and no password is needed." msgstr "" -#: ../../library/ssl.rst:1531 +#: ../../library/ssl.rst:1535 msgid "" "If the *password* argument is not specified and a password is required, " "OpenSSL's built-in password prompting mechanism will be used to " "interactively prompt the user for a password." msgstr "" -#: ../../library/ssl.rst:1535 +#: ../../library/ssl.rst:1539 msgid "" "An :class:`SSLError` is raised if the private key doesn't match with the " "certificate." msgstr "" -#: ../../library/ssl.rst:1538 +#: ../../library/ssl.rst:1542 msgid "New optional argument *password*." msgstr "新增可選引數 *password*。" -#: ../../library/ssl.rst:1543 +#: ../../library/ssl.rst:1547 msgid "" "Load a set of default \"certification authority\" (CA) certificates from " "default locations. On Windows it loads CA certs from the ``CA`` and ``ROOT`` " @@ -2197,7 +2208,7 @@ msgid "" "from other locations, too." msgstr "" -#: ../../library/ssl.rst:1549 +#: ../../library/ssl.rst:1553 msgid "" "The *purpose* flag specifies what kind of CA certificates are loaded. The " "default settings :const:`Purpose.SERVER_AUTH` loads certificates, that are " @@ -2206,35 +2217,35 @@ msgid "" "certificate verification on the server side." msgstr "" -#: ../../library/ssl.rst:1559 +#: ../../library/ssl.rst:1563 msgid "" "Load a set of \"certification authority\" (CA) certificates used to validate " "other peers' certificates when :data:`verify_mode` is other than :data:" "`CERT_NONE`. At least one of *cafile* or *capath* must be specified." msgstr "" -#: ../../library/ssl.rst:1563 +#: ../../library/ssl.rst:1567 msgid "" "This method can also load certification revocation lists (CRLs) in PEM or " "DER format. In order to make use of CRLs, :attr:`SSLContext.verify_flags` " "must be configured properly." msgstr "" -#: ../../library/ssl.rst:1567 +#: ../../library/ssl.rst:1571 msgid "" "The *cafile* string, if present, is the path to a file of concatenated CA " "certificates in PEM format. See the discussion of :ref:`ssl-certificates` " "for more information about how to arrange the certificates in this file." msgstr "" -#: ../../library/ssl.rst:1572 +#: ../../library/ssl.rst:1576 msgid "" "The *capath* string, if present, is the path to a directory containing " "several CA certificates in PEM format, following an `OpenSSL specific layout " "`_." msgstr "" -#: ../../library/ssl.rst:1577 +#: ../../library/ssl.rst:1581 msgid "" "The *cadata* object, if present, is either an ASCII string of one or more " "PEM-encoded certificates or a :term:`bytes-like object` of DER-encoded " @@ -2242,11 +2253,11 @@ msgid "" "are ignored but at least one certificate must be present." msgstr "" -#: ../../library/ssl.rst:1582 +#: ../../library/ssl.rst:1586 msgid "New optional argument *cadata*" msgstr "新增可選引數 *cadata*" -#: ../../library/ssl.rst:1587 +#: ../../library/ssl.rst:1591 msgid "" "Get a list of loaded \"certification authority\" (CA) certificates. If the " "``binary_form`` parameter is :const:`False` each list entry is a dict like " @@ -2256,19 +2267,19 @@ msgid "" "a SSL connection." msgstr "" -#: ../../library/ssl.rst:1595 +#: ../../library/ssl.rst:1599 msgid "" "Certificates in a capath directory aren't loaded unless they have been used " "at least once." msgstr "" -#: ../../library/ssl.rst:1602 +#: ../../library/ssl.rst:1606 msgid "" "Get a list of enabled ciphers. The list is in order of cipher priority. See :" "meth:`SSLContext.set_ciphers`." msgstr "" -#: ../../library/ssl.rst:1607 +#: ../../library/ssl.rst:1611 msgid "" ">>> ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)\n" ">>> ctx.set_ciphers('ECDHE+AESGCM:!ECDSA')\n" @@ -2326,7 +2337,7 @@ msgstr "" " 'strength_bits': 128,\n" " 'symmetric': 'aes-128-gcm'}]" -#: ../../library/ssl.rst:1639 +#: ../../library/ssl.rst:1643 msgid "" "Load a set of default \"certification authority\" (CA) certificates from a " "filesystem path defined when building the OpenSSL library. Unfortunately, " @@ -2336,7 +2347,7 @@ msgid "" "configured properly." msgstr "" -#: ../../library/ssl.rst:1648 +#: ../../library/ssl.rst:1652 msgid "" "Set the available ciphers for sockets created with this context. It should " "be a string in the `OpenSSL cipher list format `_" msgstr "" -#: ../../library/ssl.rst:1787 +#: ../../library/ssl.rst:1791 msgid "Vincent Bernat." msgstr "" -#: ../../library/ssl.rst:1793 +#: ../../library/ssl.rst:1797 msgid "" "Wrap an existing Python socket *sock* and return an instance of :attr:" "`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The returned SSL " @@ -2526,13 +2539,13 @@ msgid "" "a :const:`~socket.SOCK_STREAM` socket; other socket types are unsupported." msgstr "" -#: ../../library/ssl.rst:1799 +#: ../../library/ssl.rst:1803 msgid "" "The parameter ``server_side`` is a boolean which identifies whether server-" "side or client-side behavior is desired from this socket." msgstr "" -#: ../../library/ssl.rst:1802 +#: ../../library/ssl.rst:1806 msgid "" "For client-side sockets, the context construction is lazy; if the underlying " "socket isn't connected yet, the context construction will be performed " @@ -2543,7 +2556,7 @@ msgid "" "exc:`SSLError`." msgstr "" -#: ../../library/ssl.rst:1810 +#: ../../library/ssl.rst:1814 msgid "" "On client connections, the optional parameter *server_hostname* specifies " "the hostname of the service which we are connecting to. This allows a " @@ -2552,7 +2565,7 @@ msgid "" "*server_hostname* will raise a :exc:`ValueError` if *server_side* is true." msgstr "" -#: ../../library/ssl.rst:1816 +#: ../../library/ssl.rst:1820 msgid "" "The parameter ``do_handshake_on_connect`` specifies whether to do the SSL " "handshake automatically after doing a :meth:`socket.connect`, or whether the " @@ -2562,7 +2575,7 @@ msgid "" "socket I/O involved in the handshake." msgstr "" -#: ../../library/ssl.rst:1823 +#: ../../library/ssl.rst:1827 msgid "" "The parameter ``suppress_ragged_eofs`` specifies how the :meth:`SSLSocket." "recv` method should signal unexpected EOF from the other end of the " @@ -2572,40 +2585,40 @@ msgid "" "exceptions back to the caller." msgstr "" -#: ../../library/ssl.rst:1830 +#: ../../library/ssl.rst:1834 msgid "*session*, see :attr:`~SSLSocket.session`." msgstr "" -#: ../../library/ssl.rst:1832 +#: ../../library/ssl.rst:1836 msgid "" "To wrap an :class:`SSLSocket` in another :class:`SSLSocket`, use :meth:" "`SSLContext.wrap_bio`." msgstr "" -#: ../../library/ssl.rst:1835 +#: ../../library/ssl.rst:1839 msgid "" "Always allow a server_hostname to be passed, even if OpenSSL does not have " "SNI." msgstr "" -#: ../../library/ssl.rst:1839 ../../library/ssl.rst:1866 +#: ../../library/ssl.rst:1843 ../../library/ssl.rst:1870 msgid "*session* argument was added." msgstr "新增 *session* 引數。" -#: ../../library/ssl.rst:1842 +#: ../../library/ssl.rst:1846 msgid "" "The method returns an instance of :attr:`SSLContext.sslsocket_class` instead " "of hard-coded :class:`SSLSocket`." msgstr "" -#: ../../library/ssl.rst:1848 +#: ../../library/ssl.rst:1852 msgid "" "The return type of :meth:`SSLContext.wrap_socket`, defaults to :class:" "`SSLSocket`. The attribute can be assigned to on instances of :class:" "`SSLContext` in order to return a custom subclass of :class:`SSLSocket`." msgstr "" -#: ../../library/ssl.rst:1858 +#: ../../library/ssl.rst:1862 msgid "" "Wrap the BIO objects *incoming* and *outgoing* and return an instance of :" "attr:`SSLContext.sslobject_class` (default :class:`SSLObject`). The SSL " @@ -2613,26 +2626,26 @@ msgid "" "outgoing BIO." msgstr "" -#: ../../library/ssl.rst:1863 +#: ../../library/ssl.rst:1867 msgid "" "The *server_side*, *server_hostname* and *session* parameters have the same " "meaning as in :meth:`SSLContext.wrap_socket`." msgstr "" -#: ../../library/ssl.rst:1869 +#: ../../library/ssl.rst:1873 msgid "" "The method returns an instance of :attr:`SSLContext.sslobject_class` instead " "of hard-coded :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1875 +#: ../../library/ssl.rst:1879 msgid "" "The return type of :meth:`SSLContext.wrap_bio`, defaults to :class:" "`SSLObject`. The attribute can be overridden on instance of class in order " "to return a custom subclass of :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1883 +#: ../../library/ssl.rst:1887 msgid "" "Get statistics about the SSL sessions created or managed by this context. A " "dictionary is returned which maps the names of each `piece of information " @@ -2641,7 +2654,7 @@ msgid "" "the session cache since the context was created::" msgstr "" -#: ../../library/ssl.rst:1888 +#: ../../library/ssl.rst:1892 msgid "" ">>> stats = context.session_stats()\n" ">>> stats['hits'], stats['misses']\n" @@ -2651,7 +2664,7 @@ msgstr "" ">>> stats['hits'], stats['misses']\n" "(0, 0)" -#: ../../library/ssl.rst:1894 +#: ../../library/ssl.rst:1898 msgid "" "Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. " "The context's :attr:`~SSLContext.verify_mode` must be set to :data:" @@ -2664,7 +2677,7 @@ msgid "" "With other protocols, hostname checking must be enabled explicitly." msgstr "" -#: ../../library/ssl.rst:1907 +#: ../../library/ssl.rst:1911 msgid "" "import socket, ssl\n" "\n" @@ -2688,7 +2701,7 @@ msgstr "" "ssl_sock = context.wrap_socket(s, server_hostname='www.verisign.com')\n" "ssl_sock.connect(('www.verisign.com', 443))" -#: ../../library/ssl.rst:1922 +#: ../../library/ssl.rst:1926 msgid "" ":attr:`~SSLContext.verify_mode` is now automatically changed to :data:" "`CERT_REQUIRED` when hostname checking is enabled and :attr:`~SSLContext." @@ -2696,7 +2709,7 @@ msgid "" "failed with a :exc:`ValueError`." msgstr "" -#: ../../library/ssl.rst:1929 +#: ../../library/ssl.rst:1933 msgid "" "Write TLS keys to a keylog file, whenever key material is generated or " "received. The keylog file is designed for debugging purposes only. The file " @@ -2705,7 +2718,7 @@ msgid "" "synchronized between threads, but not between processes." msgstr "" -#: ../../library/ssl.rst:1939 +#: ../../library/ssl.rst:1943 msgid "" "A :class:`TLSVersion` enum member representing the highest supported TLS " "version. The value defaults to :attr:`TLSVersion.MAXIMUM_SUPPORTED`. The " @@ -2713,7 +2726,7 @@ msgid "" "const:`PROTOCOL_TLS_CLIENT`, and :const:`PROTOCOL_TLS_SERVER`." msgstr "" -#: ../../library/ssl.rst:1944 +#: ../../library/ssl.rst:1948 msgid "" "The attributes :attr:`~SSLContext.maximum_version`, :attr:`~SSLContext." "minimum_version` and :attr:`SSLContext.options` all affect the supported SSL " @@ -2723,38 +2736,38 @@ msgid "" "`TLSVersion.TLSv1_2` will not be able to establish a TLS 1.2 connection." msgstr "" -#: ../../library/ssl.rst:1957 +#: ../../library/ssl.rst:1961 msgid "" "Like :attr:`SSLContext.maximum_version` except it is the lowest supported " "version or :attr:`TLSVersion.MINIMUM_SUPPORTED`." msgstr "" -#: ../../library/ssl.rst:1964 +#: ../../library/ssl.rst:1968 msgid "" "Control the number of TLS 1.3 session tickets of a :const:" "`PROTOCOL_TLS_SERVER` context. The setting has no impact on TLS 1.0 to 1.2 " "connections." msgstr "" -#: ../../library/ssl.rst:1972 +#: ../../library/ssl.rst:1976 msgid "" "An integer representing the set of SSL options enabled on this context. The " "default value is :data:`OP_ALL`, but you can specify other options such as :" "data:`OP_NO_SSLv2` by ORing them together." msgstr "" -#: ../../library/ssl.rst:1976 +#: ../../library/ssl.rst:1980 msgid ":attr:`SSLContext.options` returns :class:`Options` flags:" msgstr ":attr:`SSLContext.options` 會回傳 :class:`Options` 旗標:" -#: ../../library/ssl.rst:1984 +#: ../../library/ssl.rst:1988 msgid "" "All ``OP_NO_SSL*`` and ``OP_NO_TLS*`` options have been deprecated since " "Python 3.7. Use :attr:`SSLContext.minimum_version` and :attr:`SSLContext." "maximum_version` instead." msgstr "" -#: ../../library/ssl.rst:1990 +#: ../../library/ssl.rst:1994 msgid "" "Enable TLS 1.3 post-handshake client authentication. Post-handshake auth is " "disabled by default and a server can only request a TLS client certificate " @@ -2762,13 +2775,13 @@ msgid "" "client certificate at any time after the handshake." msgstr "" -#: ../../library/ssl.rst:1995 +#: ../../library/ssl.rst:1999 msgid "" "When enabled on client-side sockets, the client signals the server that it " "supports post-handshake authentication." msgstr "" -#: ../../library/ssl.rst:1998 +#: ../../library/ssl.rst:2002 msgid "" "When enabled on server-side sockets, :attr:`SSLContext.verify_mode` must be " "set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, too. The actual " @@ -2776,66 +2789,66 @@ msgid "" "verify_client_post_handshake` is called and some I/O is performed." msgstr "" -#: ../../library/ssl.rst:2008 +#: ../../library/ssl.rst:2012 msgid "" "The protocol version chosen when constructing the context. This attribute " "is read-only." msgstr "" -#: ../../library/ssl.rst:2013 +#: ../../library/ssl.rst:2017 msgid "" "Whether :attr:`~SSLContext.check_hostname` falls back to verify the cert's " "subject common name in the absence of a subject alternative name extension " "(default: true)." msgstr "" -#: ../../library/ssl.rst:2021 +#: ../../library/ssl.rst:2025 msgid "" "The flag had no effect with OpenSSL before version 1.1.1l. Python 3.8.9, " "3.9.3, and 3.10 include workarounds for previous versions." msgstr "" -#: ../../library/ssl.rst:2026 +#: ../../library/ssl.rst:2030 msgid "" "An integer representing the `security level `_ for the context. This attribute is read-" "only." msgstr "" -#: ../../library/ssl.rst:2034 +#: ../../library/ssl.rst:2038 msgid "" "The flags for certificate verification operations. You can set flags like :" "data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL does " "neither require nor verify certificate revocation lists (CRLs)." msgstr "" -#: ../../library/ssl.rst:2040 +#: ../../library/ssl.rst:2044 msgid ":attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags:" msgstr ":attr:`SSLContext.verify_flags` 會回傳 :class:`VerifyFlags` 旗標:" -#: ../../library/ssl.rst:2048 +#: ../../library/ssl.rst:2052 msgid "" "Whether to try to verify other peers' certificates and how to behave if " "verification fails. This attribute must be one of :data:`CERT_NONE`, :data:" "`CERT_OPTIONAL` or :data:`CERT_REQUIRED`." msgstr "" -#: ../../library/ssl.rst:2052 +#: ../../library/ssl.rst:2056 msgid ":attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum:" msgstr ":attr:`SSLContext.verify_mode` 會回傳 :class:`VerifyMode` 列舉:" -#: ../../library/ssl.rst:2060 +#: ../../library/ssl.rst:2064 msgid "" "Enables TLS-PSK (pre-shared key) authentication on a client-side connection." msgstr "" -#: ../../library/ssl.rst:2062 ../../library/ssl.rst:2111 +#: ../../library/ssl.rst:2066 ../../library/ssl.rst:2115 msgid "" "In general, certificate based authentication should be preferred over this " "method." msgstr "" -#: ../../library/ssl.rst:2064 +#: ../../library/ssl.rst:2068 msgid "" "The parameter ``callback`` is a callable object with the signature: ``def " "callback(hint: str | None) -> tuple[str | None, bytes]``. The ``hint`` " @@ -2847,27 +2860,27 @@ msgid "" "shared key. Return a zero length PSK to reject the connection." msgstr "" -#: ../../library/ssl.rst:2074 ../../library/ssl.rst:2120 +#: ../../library/ssl.rst:2078 ../../library/ssl.rst:2124 msgid "Setting ``callback`` to :const:`None` removes any existing callback." msgstr "" -#: ../../library/ssl.rst:2077 +#: ../../library/ssl.rst:2081 msgid "When using TLS 1.3:" msgstr "使用 TLS 1.3 時:" -#: ../../library/ssl.rst:2079 +#: ../../library/ssl.rst:2083 msgid "the ``hint`` parameter is always :const:`None`." msgstr "``hint`` 參數始終為 :const:`None`。" -#: ../../library/ssl.rst:2080 +#: ../../library/ssl.rst:2084 msgid "client-identity must be a non-empty string." msgstr "" -#: ../../library/ssl.rst:2082 ../../library/ssl.rst:2129 +#: ../../library/ssl.rst:2086 ../../library/ssl.rst:2133 msgid "Example usage::" msgstr "範例用法: ::" -#: ../../library/ssl.rst:2084 +#: ../../library/ssl.rst:2088 msgid "" "context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" "context.check_hostname = False\n" @@ -2888,18 +2901,18 @@ msgid "" "context.set_psk_client_callback(callback)" msgstr "" -#: ../../library/ssl.rst:2102 ../../library/ssl.rst:2147 +#: ../../library/ssl.rst:2106 ../../library/ssl.rst:2151 msgid "" "This method will raise :exc:`NotImplementedError` if :data:`HAS_PSK` is " "``False``." msgstr "" -#: ../../library/ssl.rst:2109 +#: ../../library/ssl.rst:2113 msgid "" "Enables TLS-PSK (pre-shared key) authentication on a server-side connection." msgstr "" -#: ../../library/ssl.rst:2113 +#: ../../library/ssl.rst:2117 msgid "" "The parameter ``callback`` is a callable object with the signature: ``def " "callback(identity: str | None) -> bytes``. The ``identity`` parameter is an " @@ -2909,19 +2922,19 @@ msgid "" "connection." msgstr "" -#: ../../library/ssl.rst:2122 +#: ../../library/ssl.rst:2126 msgid "" "The parameter ``identity_hint`` is an optional identity hint string sent to " "the client. The string must be less than or equal to ``256`` octets when " "UTF-8 encoded." msgstr "" -#: ../../library/ssl.rst:2127 +#: ../../library/ssl.rst:2131 msgid "" "When using TLS 1.3 the ``identity_hint`` parameter is not sent to the client." msgstr "" -#: ../../library/ssl.rst:2131 +#: ../../library/ssl.rst:2135 msgid "" "context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)\n" "context.maximum_version = ssl.TLSVersion.TLSv1_2\n" @@ -2940,11 +2953,11 @@ msgid "" "context.set_psk_server_callback(callback, 'ServerId_1')" msgstr "" -#: ../../library/ssl.rst:2159 +#: ../../library/ssl.rst:2163 msgid "Certificates" msgstr "" -#: ../../library/ssl.rst:2161 +#: ../../library/ssl.rst:2165 msgid "" "Certificates in general are part of a public-key / private-key system. In " "this system, each *principal*, (which may be a machine, or a person, or an " @@ -2955,7 +2968,7 @@ msgid "" "other part, and **only** with the other part." msgstr "" -#: ../../library/ssl.rst:2169 +#: ../../library/ssl.rst:2173 msgid "" "A certificate contains information about two principals. It contains the " "name of a *subject*, and the subject's public key. It also contains a " @@ -2969,7 +2982,7 @@ msgid "" "as two fields, called \"notBefore\" and \"notAfter\"." msgstr "" -#: ../../library/ssl.rst:2179 +#: ../../library/ssl.rst:2183 msgid "" "In the Python use of certificates, a client or server can use a certificate " "to prove who they are. The other side of a network connection can also be " @@ -2982,14 +2995,14 @@ msgid "" "take place." msgstr "" -#: ../../library/ssl.rst:2189 +#: ../../library/ssl.rst:2193 msgid "" "Python uses files to contain certificates. They should be formatted as " "\"PEM\" (see :rfc:`1422`), which is a base-64 encoded form wrapped with a " "header line and a footer line::" msgstr "" -#: ../../library/ssl.rst:2193 +#: ../../library/ssl.rst:2197 msgid "" "-----BEGIN CERTIFICATE-----\n" "... (certificate in base64 PEM encoding) ...\n" @@ -2999,11 +3012,11 @@ msgstr "" "... (certificate in base64 PEM encoding) ...\n" "-----END CERTIFICATE-----" -#: ../../library/ssl.rst:2198 +#: ../../library/ssl.rst:2202 msgid "Certificate chains" msgstr "" -#: ../../library/ssl.rst:2200 +#: ../../library/ssl.rst:2204 msgid "" "The Python files which contain certificates can contain a sequence of " "certificates, sometimes called a *certificate chain*. This chain should " @@ -3019,7 +3032,7 @@ msgid "" "agency which issued the certification authority's certificate::" msgstr "" -#: ../../library/ssl.rst:2213 +#: ../../library/ssl.rst:2217 msgid "" "-----BEGIN CERTIFICATE-----\n" "... (certificate for your server)...\n" @@ -3041,11 +3054,11 @@ msgstr "" "... (the root certificate for the CA's issuer)...\n" "-----END CERTIFICATE-----" -#: ../../library/ssl.rst:2224 +#: ../../library/ssl.rst:2228 msgid "CA certificates" msgstr "" -#: ../../library/ssl.rst:2226 +#: ../../library/ssl.rst:2230 msgid "" "If you are going to require validation of the other side of the connection's " "certificate, you need to provide a \"CA certs\" file, filled with the " @@ -3057,11 +3070,11 @@ msgid "" "create_default_context`." msgstr "" -#: ../../library/ssl.rst:2235 +#: ../../library/ssl.rst:2239 msgid "Combined key and certificate" msgstr "" -#: ../../library/ssl.rst:2237 +#: ../../library/ssl.rst:2241 msgid "" "Often the private key is stored in the same file as the certificate; in this " "case, only the ``certfile`` parameter to :meth:`SSLContext.load_cert_chain` " @@ -3069,7 +3082,7 @@ msgid "" "should come before the first certificate in the certificate chain::" msgstr "" -#: ../../library/ssl.rst:2243 +#: ../../library/ssl.rst:2247 msgid "" "-----BEGIN RSA PRIVATE KEY-----\n" "... (private key in base64 encoding) ...\n" @@ -3085,11 +3098,11 @@ msgstr "" "... (certificate in base64 PEM encoding) ...\n" "-----END CERTIFICATE-----" -#: ../../library/ssl.rst:2251 +#: ../../library/ssl.rst:2255 msgid "Self-signed certificates" msgstr "" -#: ../../library/ssl.rst:2253 +#: ../../library/ssl.rst:2257 msgid "" "If you are going to create a server that provides SSL-encrypted connection " "services, you will need to acquire a certificate for that service. There " @@ -3099,7 +3112,7 @@ msgid "" "package, using something like the following::" msgstr "" -#: ../../library/ssl.rst:2260 +#: ../../library/ssl.rst:2264 msgid "" "% openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout cert.pem\n" "Generating a 1024 bit RSA private key\n" @@ -3125,28 +3138,28 @@ msgid "" "%" msgstr "" -#: ../../library/ssl.rst:2282 +#: ../../library/ssl.rst:2286 msgid "" "The disadvantage of a self-signed certificate is that it is its own root " "certificate, and no one else will have it in their cache of known (and " "trusted) root certificates." msgstr "" -#: ../../library/ssl.rst:2288 +#: ../../library/ssl.rst:2292 msgid "Examples" msgstr "範例" -#: ../../library/ssl.rst:2291 +#: ../../library/ssl.rst:2295 msgid "Testing for SSL support" msgstr "" -#: ../../library/ssl.rst:2293 +#: ../../library/ssl.rst:2297 msgid "" "To test for the presence of SSL support in a Python installation, user code " "should use the following idiom::" msgstr "" -#: ../../library/ssl.rst:2296 +#: ../../library/ssl.rst:2300 msgid "" "try:\n" " import ssl\n" @@ -3156,27 +3169,27 @@ msgid "" " ... # do something that requires SSL support" msgstr "" -#: ../../library/ssl.rst:2304 +#: ../../library/ssl.rst:2308 msgid "Client-side operation" msgstr "" -#: ../../library/ssl.rst:2306 +#: ../../library/ssl.rst:2310 msgid "" "This example creates a SSL context with the recommended security settings " "for client sockets, including automatic certificate verification::" msgstr "" -#: ../../library/ssl.rst:2309 +#: ../../library/ssl.rst:2313 msgid ">>> context = ssl.create_default_context()" msgstr ">>> context = ssl.create_default_context()" -#: ../../library/ssl.rst:2311 +#: ../../library/ssl.rst:2315 msgid "" "If you prefer to tune security settings yourself, you might create a context " "from scratch (but beware that you might not get the settings right)::" msgstr "" -#: ../../library/ssl.rst:2315 +#: ../../library/ssl.rst:2319 msgid "" ">>> context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> context.load_verify_locations(\"/etc/ssl/certs/ca-bundle.crt\")" @@ -3184,14 +3197,14 @@ msgstr "" ">>> context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> context.load_verify_locations(\"/etc/ssl/certs/ca-bundle.crt\")" -#: ../../library/ssl.rst:2318 +#: ../../library/ssl.rst:2322 msgid "" "(this snippet assumes your operating system places a bundle of all CA " "certificates in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an " "error and have to adjust the location)" msgstr "" -#: ../../library/ssl.rst:2322 +#: ../../library/ssl.rst:2326 msgid "" "The :data:`PROTOCOL_TLS_CLIENT` protocol configures the context for cert " "validation and hostname verification. :attr:`~SSLContext.verify_mode` is set " @@ -3199,7 +3212,7 @@ msgid "" "``True``. All other protocols create SSL contexts with insecure defaults." msgstr "" -#: ../../library/ssl.rst:2327 +#: ../../library/ssl.rst:2331 msgid "" "When you use the context to connect to a server, :const:`CERT_REQUIRED` and :" "attr:`~SSLContext.check_hostname` validate the server certificate: it " @@ -3208,7 +3221,7 @@ msgid "" "properties like validity and identity of the hostname::" msgstr "" -#: ../../library/ssl.rst:2333 +#: ../../library/ssl.rst:2337 msgid "" ">>> conn = context.wrap_socket(socket.socket(socket.AF_INET),\n" "... server_hostname=\"www.python.org\")\n" @@ -3218,21 +3231,21 @@ msgstr "" "... server_hostname=\"www.python.org\")\n" ">>> conn.connect((\"www.python.org\", 443))" -#: ../../library/ssl.rst:2337 +#: ../../library/ssl.rst:2341 msgid "You may then fetch the certificate::" msgstr "" -#: ../../library/ssl.rst:2339 +#: ../../library/ssl.rst:2343 msgid ">>> cert = conn.getpeercert()" msgstr ">>> cert = conn.getpeercert()" -#: ../../library/ssl.rst:2341 +#: ../../library/ssl.rst:2345 msgid "" "Visual inspection shows that the certificate does identify the desired " "service (that is, the HTTPS host ``www.python.org``)::" msgstr "" -#: ../../library/ssl.rst:2344 +#: ../../library/ssl.rst:2348 msgid "" ">>> pprint.pprint(cert)\n" "{'OCSP': ('http://ocsp.digicert.com',),\n" @@ -3322,13 +3335,13 @@ msgstr "" " ('DNS', 'id.python.org')),\n" " 'version': 3}" -#: ../../library/ssl.rst:2384 +#: ../../library/ssl.rst:2388 msgid "" "Now the SSL channel is established and the certificate verified, you can " "proceed to talk with the server::" msgstr "" -#: ../../library/ssl.rst:2387 +#: ../../library/ssl.rst:2391 msgid "" ">>> conn.sendall(b\"HEAD / HTTP/1.0\\r\\nHost: linuxfr.org\\r\\n\\r\\n\")\n" ">>> pprint.pprint(conn.recv(1024).split(b\"\\r\\n\"))\n" @@ -3370,11 +3383,11 @@ msgstr "" " b'',\n" " b'']" -#: ../../library/ssl.rst:2411 +#: ../../library/ssl.rst:2415 msgid "Server-side operation" msgstr "伺服器端操作" -#: ../../library/ssl.rst:2413 +#: ../../library/ssl.rst:2417 msgid "" "For server operation, typically you'll need to have a server certificate, " "and private key, each in a file. You'll first create a context holding the " @@ -3383,7 +3396,7 @@ msgid "" "start waiting for clients to connect::" msgstr "" -#: ../../library/ssl.rst:2419 +#: ../../library/ssl.rst:2423 msgid "" "import socket, ssl\n" "\n" @@ -3403,14 +3416,14 @@ msgstr "" "bindsocket.bind(('myaddr.example.com', 10023))\n" "bindsocket.listen(5)" -#: ../../library/ssl.rst:2428 +#: ../../library/ssl.rst:2432 msgid "" "When a client connects, you'll call :meth:`accept` on the socket to get the " "new socket from the other end, and use the context's :meth:`SSLContext." "wrap_socket` method to create a server-side SSL socket for the connection::" msgstr "" -#: ../../library/ssl.rst:2432 +#: ../../library/ssl.rst:2436 msgid "" "while True:\n" " newsocket, fromaddr = bindsocket.accept()\n" @@ -3430,13 +3443,13 @@ msgstr "" " connstream.shutdown(socket.SHUT_RDWR)\n" " connstream.close()" -#: ../../library/ssl.rst:2441 +#: ../../library/ssl.rst:2445 msgid "" "Then you'll read data from the ``connstream`` and do something with it till " "you are finished with the client (or the client is finished with you)::" msgstr "" -#: ../../library/ssl.rst:2444 +#: ../../library/ssl.rst:2448 msgid "" "def deal_with_client(connstream):\n" " data = connstream.recv(1024)\n" @@ -3450,7 +3463,7 @@ msgid "" " # finished with client" msgstr "" -#: ../../library/ssl.rst:2455 +#: ../../library/ssl.rst:2459 msgid "" "And go back to listening for new client connections (of course, a real " "server would probably handle each client connection in a separate thread, or " @@ -3458,18 +3471,18 @@ msgid "" "event loop)." msgstr "" -#: ../../library/ssl.rst:2463 +#: ../../library/ssl.rst:2467 msgid "Notes on non-blocking sockets" msgstr "" -#: ../../library/ssl.rst:2465 +#: ../../library/ssl.rst:2469 msgid "" "SSL sockets behave slightly different than regular sockets in non-blocking " "mode. When working with non-blocking sockets, there are thus several things " "you need to be aware of:" msgstr "" -#: ../../library/ssl.rst:2469 +#: ../../library/ssl.rst:2473 msgid "" "Most :class:`SSLSocket` methods will raise either :exc:`SSLWantWriteError` " "or :exc:`SSLWantReadError` instead of :exc:`BlockingIOError` if an I/O " @@ -3481,13 +3494,13 @@ msgid "" "require a prior *write* to the underlying socket." msgstr "" -#: ../../library/ssl.rst:2481 +#: ../../library/ssl.rst:2485 msgid "" "In earlier Python versions, the :meth:`!SSLSocket.send` method returned zero " "instead of raising :exc:`SSLWantWriteError` or :exc:`SSLWantReadError`." msgstr "" -#: ../../library/ssl.rst:2485 +#: ../../library/ssl.rst:2489 msgid "" "Calling :func:`~select.select` tells you that the OS-level socket can be " "read from (or written to), but it does not imply that there is sufficient " @@ -3497,7 +3510,7 @@ msgid "" "`~select.select`." msgstr "" -#: ../../library/ssl.rst:2492 +#: ../../library/ssl.rst:2496 msgid "" "Conversely, since the SSL layer has its own framing, a SSL socket may still " "have data available for reading without :func:`~select.select` being aware " @@ -3506,13 +3519,13 @@ msgid "" "call if still necessary." msgstr "" -#: ../../library/ssl.rst:2498 +#: ../../library/ssl.rst:2502 msgid "" "(of course, similar provisions apply when using other primitives such as :" "func:`~select.poll`, or those in the :mod:`selectors` module)" msgstr "" -#: ../../library/ssl.rst:2501 +#: ../../library/ssl.rst:2505 msgid "" "The SSL handshake itself will be non-blocking: the :meth:`SSLSocket." "do_handshake` method has to be retried until it returns successfully. Here " @@ -3520,7 +3533,7 @@ msgid "" "readiness::" msgstr "" -#: ../../library/ssl.rst:2506 +#: ../../library/ssl.rst:2510 msgid "" "while True:\n" " try:\n" @@ -3540,7 +3553,7 @@ msgstr "" " except ssl.SSLWantWriteError:\n" " select.select([], [sock], [])" -#: ../../library/ssl.rst:2517 +#: ../../library/ssl.rst:2521 msgid "" "The :mod:`asyncio` module supports :ref:`non-blocking SSL sockets ` and provides a higher level :ref:`Streams API `. " "This means that for example :meth:`~SSLSocket.read` will raise an :exc:" "`SSLWantReadError` if it needs more data than the incoming BIO has available." msgstr "" -#: ../../library/ssl.rst:2620 +#: ../../library/ssl.rst:2624 msgid "" ":class:`SSLObject` instances must be created with :meth:`~SSLContext." "wrap_bio`. In earlier versions, it was possible to create instances " "directly. This was never documented or officially supported." msgstr "" -#: ../../library/ssl.rst:2626 +#: ../../library/ssl.rst:2630 msgid "" "An SSLObject communicates with the outside world using memory buffers. The " "class :class:`MemoryBIO` provides a memory buffer that can be used for this " "purpose. It wraps an OpenSSL memory BIO (Basic IO) object:" msgstr "" -#: ../../library/ssl.rst:2632 +#: ../../library/ssl.rst:2636 msgid "" "A memory buffer that can be used to pass data between Python and an SSL " "protocol instance." msgstr "" -#: ../../library/ssl.rst:2637 +#: ../../library/ssl.rst:2641 msgid "Return the number of bytes currently in the memory buffer." msgstr "" -#: ../../library/ssl.rst:2641 +#: ../../library/ssl.rst:2645 msgid "" "A boolean indicating whether the memory BIO is current at the end-of-file " "position." msgstr "" -#: ../../library/ssl.rst:2646 +#: ../../library/ssl.rst:2650 msgid "" "Read up to *n* bytes from the memory buffer. If *n* is not specified or " "negative, all bytes are returned." msgstr "" -#: ../../library/ssl.rst:2651 +#: ../../library/ssl.rst:2655 msgid "" "Write the bytes from *buf* to the memory BIO. The *buf* argument must be an " "object supporting the buffer protocol." msgstr "" -#: ../../library/ssl.rst:2654 +#: ../../library/ssl.rst:2658 msgid "" "The return value is the number of bytes written, which is always equal to " "the length of *buf*." msgstr "" -#: ../../library/ssl.rst:2659 +#: ../../library/ssl.rst:2663 msgid "" "Write an EOF marker to the memory BIO. After this method has been called, it " "is illegal to call :meth:`~MemoryBIO.write`. The attribute :attr:`eof` will " "become true after all data currently in the buffer has been read." msgstr "" -#: ../../library/ssl.rst:2665 +#: ../../library/ssl.rst:2669 msgid "SSL session" msgstr "" -#: ../../library/ssl.rst:2671 +#: ../../library/ssl.rst:2675 msgid "Session object used by :attr:`~SSLSocket.session`." msgstr "" -#: ../../library/ssl.rst:2683 +#: ../../library/ssl.rst:2687 msgid "Security considerations" msgstr "" -#: ../../library/ssl.rst:2686 +#: ../../library/ssl.rst:2690 msgid "Best defaults" msgstr "" -#: ../../library/ssl.rst:2688 +#: ../../library/ssl.rst:2692 msgid "" "For **client use**, if you don't have any special requirements for your " "security policy, it is highly recommended that you use the :func:" @@ -3832,13 +3845,13 @@ msgid "" "settings." msgstr "" -#: ../../library/ssl.rst:2695 +#: ../../library/ssl.rst:2699 msgid "" "For example, here is how you would use the :class:`smtplib.SMTP` class to " "create a trusted, secure connection to a SMTP server::" msgstr "" -#: ../../library/ssl.rst:2698 +#: ../../library/ssl.rst:2702 msgid "" ">>> import ssl, smtplib\n" ">>> smtp = smtplib.SMTP(\"mail.python.org\", port=587)\n" @@ -3852,13 +3865,13 @@ msgstr "" ">>> smtp.starttls(context=context)\n" "(220, b'2.0.0 Ready to start TLS')" -#: ../../library/ssl.rst:2704 +#: ../../library/ssl.rst:2708 msgid "" "If a client certificate is needed for the connection, it can be added with :" "meth:`SSLContext.load_cert_chain`." msgstr "" -#: ../../library/ssl.rst:2707 +#: ../../library/ssl.rst:2711 msgid "" "By contrast, if you create the SSL context by calling the :class:" "`SSLContext` constructor yourself, it will not have certificate validation " @@ -3866,15 +3879,15 @@ msgid "" "paragraphs below to achieve a good security level." msgstr "" -#: ../../library/ssl.rst:2713 +#: ../../library/ssl.rst:2717 msgid "Manual settings" msgstr "手動設定" -#: ../../library/ssl.rst:2716 +#: ../../library/ssl.rst:2720 msgid "Verifying certificates" msgstr "驗證憑證" -#: ../../library/ssl.rst:2718 +#: ../../library/ssl.rst:2722 msgid "" "When calling the :class:`SSLContext` constructor directly, :const:" "`CERT_NONE` is the default. Since it does not authenticate the other peer, " @@ -3889,13 +3902,13 @@ msgid "" "enabled." msgstr "" -#: ../../library/ssl.rst:2730 +#: ../../library/ssl.rst:2734 msgid "" "Hostname matchings is now performed by OpenSSL. Python no longer uses :func:" -"`match_hostname`." +"`!match_hostname`." msgstr "" -#: ../../library/ssl.rst:2734 +#: ../../library/ssl.rst:2738 msgid "" "In server mode, if you want to authenticate your clients using the SSL layer " "(rather than using a higher-level authentication mechanism), you'll also " @@ -3903,11 +3916,11 @@ msgid "" "certificate." msgstr "" -#: ../../library/ssl.rst:2740 +#: ../../library/ssl.rst:2744 msgid "Protocol versions" msgstr "協定版本" -#: ../../library/ssl.rst:2742 +#: ../../library/ssl.rst:2746 msgid "" "SSL versions 2 and 3 are considered insecure and are therefore dangerous to " "use. If you want maximum compatibility between clients and servers, it is " @@ -3916,7 +3929,7 @@ msgid "" "by default." msgstr "" -#: ../../library/ssl.rst:2750 +#: ../../library/ssl.rst:2754 msgid "" ">>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_3\n" @@ -3926,7 +3939,7 @@ msgstr "" ">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_3\n" ">>> client_context.maximum_version = ssl.TLSVersion.TLSv1_3" -#: ../../library/ssl.rst:2755 +#: ../../library/ssl.rst:2759 msgid "" "The SSL context created above will only allow TLSv1.3 and later (if " "supported by your system) connections to a server. :const:" @@ -3934,11 +3947,11 @@ msgid "" "default. You have to load certificates into the context." msgstr "" -#: ../../library/ssl.rst:2762 +#: ../../library/ssl.rst:2766 msgid "Cipher selection" msgstr "" -#: ../../library/ssl.rst:2764 +#: ../../library/ssl.rst:2768 msgid "" "If you have advanced security requirements, fine-tuning of the ciphers " "enabled when negotiating a SSL session is possible through the :meth:" @@ -3951,11 +3964,11 @@ msgid "" "command on your system." msgstr "" -#: ../../library/ssl.rst:2775 +#: ../../library/ssl.rst:2779 msgid "Multi-processing" msgstr "" -#: ../../library/ssl.rst:2777 +#: ../../library/ssl.rst:2781 msgid "" "If using this module as part of a multi-processed application (using, for " "example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules), be " @@ -3966,17 +3979,17 @@ msgid "" "sufficient." msgstr "" -#: ../../library/ssl.rst:2789 +#: ../../library/ssl.rst:2793 msgid "TLS 1.3" msgstr "TLS 1.3" -#: ../../library/ssl.rst:2793 +#: ../../library/ssl.rst:2797 msgid "" "The TLS 1.3 protocol behaves slightly differently than previous version of " "TLS/SSL. Some new TLS 1.3 features are not yet available." msgstr "" -#: ../../library/ssl.rst:2796 +#: ../../library/ssl.rst:2800 msgid "" "TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 " "cipher suites are enabled by default. The method :meth:`SSLContext." @@ -3984,14 +3997,14 @@ msgid "" "`SSLContext.get_ciphers` returns them." msgstr "" -#: ../../library/ssl.rst:2800 +#: ../../library/ssl.rst:2804 msgid "" "Session tickets are no longer sent as part of the initial handshake and are " "handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are " "not compatible with TLS 1.3." msgstr "" -#: ../../library/ssl.rst:2803 +#: ../../library/ssl.rst:2807 msgid "" "Client-side certificates are also no longer verified during the initial " "handshake. A server can request a certificate at any time. Clients process " @@ -3999,21 +4012,21 @@ msgid "" "server." msgstr "" -#: ../../library/ssl.rst:2807 +#: ../../library/ssl.rst:2811 msgid "" "TLS 1.3 features like early data, deferred TLS client cert request, " "signature algorithm configuration, and rekeying are not supported yet." msgstr "" -#: ../../library/ssl.rst:2813 +#: ../../library/ssl.rst:2817 msgid "Class :class:`socket.socket`" msgstr ":class:`socket.socket` 類別" -#: ../../library/ssl.rst:2814 +#: ../../library/ssl.rst:2818 msgid "Documentation of underlying :mod:`socket` class" msgstr "底層 :mod:`socket` 類別的文件" -#: ../../library/ssl.rst:2816 +#: ../../library/ssl.rst:2820 msgid "" "`SSL/TLS Strong Encryption: An Introduction `_" @@ -4021,11 +4034,11 @@ msgstr "" "`SSL/TLS Strong Encryption: An Introduction `_" -#: ../../library/ssl.rst:2817 +#: ../../library/ssl.rst:2821 msgid "Intro from the Apache HTTP Server documentation" msgstr "Apache HTTP Server 文件的介紹" -#: ../../library/ssl.rst:2819 +#: ../../library/ssl.rst:2823 msgid "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" @@ -4033,19 +4046,19 @@ msgstr "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" -#: ../../library/ssl.rst:2820 +#: ../../library/ssl.rst:2824 msgid "Steve Kent" msgstr "Steve Kent" -#: ../../library/ssl.rst:2822 +#: ../../library/ssl.rst:2826 msgid ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" msgstr ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" -#: ../../library/ssl.rst:2823 +#: ../../library/ssl.rst:2827 msgid "Donald E., Jeffrey I. Schiller" msgstr "Donald E., Jeffrey I. Schiller" -#: ../../library/ssl.rst:2825 +#: ../../library/ssl.rst:2829 msgid "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" @@ -4053,11 +4066,11 @@ msgstr "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" -#: ../../library/ssl.rst:2826 +#: ../../library/ssl.rst:2830 msgid "D. Cooper" msgstr "D. Cooper" -#: ../../library/ssl.rst:2828 +#: ../../library/ssl.rst:2832 msgid "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" @@ -4065,19 +4078,19 @@ msgstr "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" -#: ../../library/ssl.rst:2829 +#: ../../library/ssl.rst:2833 msgid "T. Dierks et. al." msgstr "T. Dierks et. al." -#: ../../library/ssl.rst:2831 +#: ../../library/ssl.rst:2835 msgid ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" msgstr ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" -#: ../../library/ssl.rst:2832 +#: ../../library/ssl.rst:2836 msgid "D. Eastlake" msgstr "D. Eastlake" -#: ../../library/ssl.rst:2834 +#: ../../library/ssl.rst:2838 msgid "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" @@ -4085,11 +4098,11 @@ msgstr "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" -#: ../../library/ssl.rst:2835 +#: ../../library/ssl.rst:2839 msgid "IANA" msgstr "IANA" -#: ../../library/ssl.rst:2837 +#: ../../library/ssl.rst:2841 msgid "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" @@ -4097,11 +4110,11 @@ msgstr "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" -#: ../../library/ssl.rst:2838 +#: ../../library/ssl.rst:2842 msgid "IETF" msgstr "IETF" -#: ../../library/ssl.rst:2840 +#: ../../library/ssl.rst:2844 msgid "" "`Mozilla's Server Side TLS recommendations `_" @@ -4109,7 +4122,7 @@ msgstr "" "`Mozilla's Server Side TLS recommendations `_" -#: ../../library/ssl.rst:2841 +#: ../../library/ssl.rst:2845 msgid "Mozilla" msgstr "Mozilla" @@ -4137,10 +4150,10 @@ msgstr "Transport Layer Security(傳輸層安全)" msgid "Secure Sockets Layer" msgstr "Secure Sockets Layer(安全 socket 層)" -#: ../../library/ssl.rst:2152 +#: ../../library/ssl.rst:2156 msgid "certificates" msgstr "certificates(憑證)" -#: ../../library/ssl.rst:2154 +#: ../../library/ssl.rst:2158 msgid "X509 certificate" msgstr "X509 certificate(X509 憑證)" diff --git a/library/string.templatelib.po b/library/string.templatelib.po index 6986f76fb4..bca8d449ad 100644 --- a/library/string.templatelib.po +++ b/library/string.templatelib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-06 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -43,9 +43,9 @@ msgstr "模板字串" #: ../../library/string.templatelib.rst:24 msgid "" "Template strings are a mechanism for custom string processing. They have the " -"full flexibility of Python's :ref:`f-strings`, but return " -"a :class:`Template` instance that gives access to the static and " -"interpolated (in curly braces) parts of a string *before* they are combined." +"full flexibility of Python's :ref:`f-strings`, but return a :class:" +"`Template` instance that gives access to the static and interpolated (in " +"curly brackets) parts of a string *before* they are combined." msgstr "" #: ../../library/string.templatelib.rst:30 @@ -81,10 +81,10 @@ msgstr "" #: ../../library/string.templatelib.rst:49 msgid "" -"The most common way to create a :class:`!Template` instance is to use " -"the :ref:`template string literal syntax `. This syntax is " -"identical to that of :ref:`f-strings `, except that it uses a " -"``t`` prefix in place of an ``f``:" +"The most common way to create a :class:`!Template` instance is to use the :" +"ref:`template string literal syntax `. This syntax is identical " +"to that of :ref:`f-strings `, except that it uses a ``t`` prefix " +"in place of an ``f``:" msgstr "" #: ../../library/string.templatelib.rst:59 @@ -145,12 +145,12 @@ msgstr "" #: ../../library/string.templatelib.rst:139 msgid "" "The ``values`` tuple always has the same length as the ``interpolations`` " -"tuple. It is always equivalent to ``tuple(i.value for i in " -"template.interpolations)``." +"tuple. It is always equivalent to ``tuple(i.value for i in template." +"interpolations)``." msgstr "" #: ../../library/string.templatelib.rst:144 -#: ../../library/string.templatelib.rst:314 +#: ../../library/string.templatelib.rst:317 msgid "Methods" msgstr "方法" @@ -177,8 +177,8 @@ msgstr "" #: ../../library/string.templatelib.rst:182 msgid "" -"Iterate over the template, yielding each non-empty string " -"and :class:`Interpolation` in the correct order:" +"Iterate over the template, yielding each non-empty string and :class:" +"`Interpolation` in the correct order:" msgstr "" #: ../../library/string.templatelib.rst:191 @@ -219,28 +219,32 @@ msgid "The evaluated value of the interpolation." msgstr "" #: ../../library/string.templatelib.rst:261 -#: ../../library/string.templatelib.rst:323 -msgid "The text of a valid Python expression, or an empty string." +msgid "" +"For interpolations created by t-string literals, :attr:`!expression` is the " +"expression text found inside the curly brackets (``{`` & ``}``), including " +"any whitespace, excluding the curly brackets themselves, and ending before " +"the first ``!``, ``:``, or ``=`` if any is present. For manually created " +"interpolations, :attr:`!expression` is the arbitrary string provided when " +"constructing the interpolation instance." msgstr "" -#: ../../library/string.templatelib.rst:263 +#: ../../library/string.templatelib.rst:268 msgid "" -"The :attr:`.expression` is the original text of the interpolation's Python " -"expression, if the interpolation was created from a t-string literal. " -"Developers creating interpolations manually should either set this to an " -"empty string or choose a suitable valid Python expression." +"We recommend using valid Python expressions or the empty string for the " +"``expression`` field of manually created :class:`!Interpolation` instances, " +"although this is not enforced at runtime." msgstr "" -#: ../../library/string.templatelib.rst:275 +#: ../../library/string.templatelib.rst:278 msgid "The conversion to apply to the value, or ``None``." msgstr "" -#: ../../library/string.templatelib.rst:277 +#: ../../library/string.templatelib.rst:280 msgid "" "The :attr:`!conversion` is the optional conversion to apply to the value:" msgstr "" -#: ../../library/string.templatelib.rst:285 +#: ../../library/string.templatelib.rst:288 msgid "" "Unlike f-strings, where conversions are applied automatically, the expected " "behavior with t-strings is that code that *processes* the :class:`!Template` " @@ -249,17 +253,17 @@ msgid "" "conversion semantics." msgstr "" -#: ../../library/string.templatelib.rst:295 +#: ../../library/string.templatelib.rst:298 msgid "The format specification to apply to the value." msgstr "" -#: ../../library/string.templatelib.rst:297 +#: ../../library/string.templatelib.rst:300 msgid "" "The :attr:`!format_spec` is an optional, arbitrary string used as the format " "specification to present the value:" msgstr "" -#: ../../library/string.templatelib.rst:305 +#: ../../library/string.templatelib.rst:308 msgid "" "Unlike f-strings, where format specifications are applied automatically via " "the :func:`format` protocol, the expected behavior with t-strings is that " @@ -269,7 +273,7 @@ msgid "" "not conform to the :func:`format` protocol." msgstr "" -#: ../../library/string.templatelib.rst:320 +#: ../../library/string.templatelib.rst:323 msgid "Create a new :class:`!Interpolation` object from component parts." msgstr "" @@ -277,49 +281,53 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/string.templatelib.rst:322 +#: ../../library/string.templatelib.rst:325 msgid "The evaluated, in-scope result of the interpolation." msgstr "" -#: ../../library/string.templatelib.rst:325 +#: ../../library/string.templatelib.rst:326 +msgid "The text of a valid Python expression, or an empty string." +msgstr "" + +#: ../../library/string.templatelib.rst:328 msgid "" "The :ref:`conversion ` to be used, one of ``None``, ``'a'``, " "``'r'``, or ``'s'``." msgstr "" -#: ../../library/string.templatelib.rst:327 +#: ../../library/string.templatelib.rst:330 msgid "" "An optional, arbitrary string used as the :ref:`format specification " "` to present the value." msgstr "" -#: ../../library/string.templatelib.rst:332 +#: ../../library/string.templatelib.rst:335 msgid "Helper functions" msgstr "" -#: ../../library/string.templatelib.rst:336 +#: ../../library/string.templatelib.rst:339 msgid "" "Applies formatted string literal :ref:`conversion ` semantics to the given object *obj*. This is frequently useful " "for custom template string processing logic." msgstr "" -#: ../../library/string.templatelib.rst:340 +#: ../../library/string.templatelib.rst:343 msgid "Three conversion flags are currently supported:" msgstr "" -#: ../../library/string.templatelib.rst:342 +#: ../../library/string.templatelib.rst:345 msgid "``'s'`` which calls :func:`str` on the value (like ``!s``)," msgstr "" -#: ../../library/string.templatelib.rst:343 +#: ../../library/string.templatelib.rst:346 msgid "``'r'`` which calls :func:`repr` (like ``!r``), and" msgstr "" -#: ../../library/string.templatelib.rst:344 +#: ../../library/string.templatelib.rst:347 msgid "``'a'`` which calls :func:`ascii` (like ``!a``)." msgstr "" -#: ../../library/string.templatelib.rst:346 +#: ../../library/string.templatelib.rst:349 msgid "If the conversion flag is ``None``, *obj* is returned unchanged." msgstr "" diff --git a/library/subprocess.po b/library/subprocess.po index 3103546226..68ed5a8c6d 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,20 +99,19 @@ msgid "" "the internal :class:`Popen` object is automatically created with *stdout* " "and *stderr* both set to :data:`~subprocess.PIPE`. The *stdout* and *stderr* " "arguments may not be supplied at the same time as *capture_output*. If you " -"wish to capture and combine both streams into one, set *stdout* " -"to :data:`~subprocess.PIPE` and *stderr* to :data:`~subprocess.STDOUT`, " -"instead of using *capture_output*." +"wish to capture and combine both streams into one, set *stdout* to :data:" +"`~subprocess.PIPE` and *stderr* to :data:`~subprocess.STDOUT`, instead of " +"using *capture_output*." msgstr "" #: ../../library/subprocess.rst:62 msgid "" -"A *timeout* may be specified in seconds, it is internally passed on " -"to :meth:`Popen.communicate`. If the timeout expires, the child process will " -"be killed and waited for. The :exc:`TimeoutExpired` exception will be re-" -"raised after the child process has terminated. The initial process creation " -"itself cannot be interrupted on many platform APIs so you are not guaranteed " -"to see a timeout exception until at least after however long process " -"creation takes." +"A *timeout* may be specified in seconds, it is internally passed on to :meth:" +"`Popen.communicate`. If the timeout expires, the child process will be " +"killed and waited for. The :exc:`TimeoutExpired` exception will be re-raised " +"after the child process has terminated. The initial process creation itself " +"cannot be interrupted on many platform APIs so you are not guaranteed to see " +"a timeout exception until at least after however long process creation takes." msgstr "" #: ../../library/subprocess.rst:70 @@ -120,17 +119,16 @@ msgid "" "The *input* argument is passed to :meth:`Popen.communicate` and thus to the " "subprocess's stdin. If used it must be a byte sequence, or a string if " "*encoding* or *errors* is specified or *text* is true. When used, the " -"internal :class:`Popen` object is automatically created with *stdin* set " -"to :data:`~subprocess.PIPE`, and the *stdin* argument may not be used as " -"well." +"internal :class:`Popen` object is automatically created with *stdin* set to :" +"data:`~subprocess.PIPE`, and the *stdin* argument may not be used as well." msgstr "" #: ../../library/subprocess.rst:77 msgid "" -"If *check* is true, and the process exits with a non-zero exit code, " -"a :exc:`CalledProcessError` exception will be raised. Attributes of that " -"exception hold the arguments, the exit code, and stdout and stderr if they " -"were captured." +"If *check* is true, and the process exits with a non-zero exit code, a :exc:" +"`CalledProcessError` exception will be raised. Attributes of that exception " +"hold the arguments, the exit code, and stdout and stderr if they were " +"captured." msgstr "" #: ../../library/subprocess.rst:82 @@ -148,8 +146,8 @@ msgid "" "variables for the new process; these are used instead of the default " "behavior of inheriting the current process' environment. It is passed " "directly to :class:`Popen`. This mapping can be str to str on any platform " -"or bytes to bytes on POSIX platforms much like :data:`os.environ` " -"or :data:`os.environb`." +"or bytes to bytes on POSIX platforms much like :data:`os.environ` or :data:" +"`os.environb`." msgstr "" #: ../../library/subprocess.rst:95 @@ -200,8 +198,8 @@ msgstr "" msgid "" "Changed Windows shell search order for ``shell=True``. The current directory " "and ``%PATH%`` are replaced with ``%COMSPEC%`` and ``%SystemRoot%" -"\\System32\\cmd.exe``. As a result, dropping a malicious program named " -"``cmd.exe`` into a current directory no longer works." +"\\System32\\cmd.exe``. As a result, dropping a malicious program named ``cmd." +"exe`` into a current directory no longer works." msgstr "" #: ../../library/subprocess.rst:130 @@ -228,9 +226,9 @@ msgstr "" #: ../../library/subprocess.rst:146 msgid "" -"Captured stdout from the child process. A bytes sequence, or a string " -"if :func:`run` was called with an encoding, errors, or text=True. ``None`` " -"if stdout was not captured." +"Captured stdout from the child process. A bytes sequence, or a string if :" +"func:`run` was called with an encoding, errors, or text=True. ``None`` if " +"stdout was not captured." msgstr "" #: ../../library/subprocess.rst:150 @@ -241,9 +239,9 @@ msgstr "" #: ../../library/subprocess.rst:156 msgid "" -"Captured stderr from the child process. A bytes sequence, or a string " -"if :func:`run` was called with an encoding, errors, or text=True. ``None`` " -"if stderr was not captured." +"Captured stderr from the child process. A bytes sequence, or a string if :" +"func:`run` was called with an encoding, errors, or text=True. ``None`` if " +"stderr was not captured." msgstr "" #: ../../library/subprocess.rst:162 @@ -291,11 +289,10 @@ msgstr "" #: ../../library/subprocess.rst:211 msgid "" -"Output of the child process if it was captured by :func:`run` " -"or :func:`check_output`. Otherwise, ``None``. This is " -"always :class:`bytes` when any output was captured regardless of the " -"``text=True`` setting. It may remain ``None`` instead of ``b''`` when no " -"output was observed." +"Output of the child process if it was captured by :func:`run` or :func:" +"`check_output`. Otherwise, ``None``. This is always :class:`bytes` when " +"any output was captured regardless of the ``text=True`` setting. It may " +"remain ``None`` instead of ``b''`` when no output was observed." msgstr "" #: ../../library/subprocess.rst:219 ../../library/subprocess.rst:256 @@ -316,9 +313,9 @@ msgstr "" #: ../../library/subprocess.rst:235 msgid "" -"Subclass of :exc:`SubprocessError`, raised when a process run " -"by :func:`check_call`, :func:`check_output`, or :func:`run` (with " -"``check=True``) returns a non-zero exit status." +"Subclass of :exc:`SubprocessError`, raised when a process run by :func:" +"`check_call`, :func:`check_output`, or :func:`run` (with ``check=True``) " +"returns a non-zero exit status." msgstr "" #: ../../library/subprocess.rst:242 @@ -329,8 +326,8 @@ msgstr "" #: ../../library/subprocess.rst:251 msgid "" -"Output of the child process if it was captured by :func:`run` " -"or :func:`check_output`. Otherwise, ``None``." +"Output of the child process if it was captured by :func:`run` or :func:" +"`check_output`. Otherwise, ``None``." msgstr "" #: ../../library/subprocess.rst:260 @@ -369,10 +366,10 @@ msgid "" "descriptor (a positive integer), and an existing :term:`file object` with a " "valid file descriptor. With the default settings of ``None``, no " "redirection will occur. :data:`PIPE` indicates that a new pipe to the child " -"should be created. :data:`DEVNULL` indicates that the special " -"file :data:`os.devnull` will be used. Additionally, *stderr* can " -"be :data:`STDOUT`, which indicates that the stderr data from the child " -"process should be captured into the same file handle as for *stdout*." +"should be created. :data:`DEVNULL` indicates that the special file :data:" +"`os.devnull` will be used. Additionally, *stderr* can be :data:`STDOUT`, " +"which indicates that the stderr data from the child process should be " +"captured into the same file handle as for *stdout*." msgstr "" #: ../../library/subprocess.rst:299 @@ -409,9 +406,9 @@ msgstr "" #: ../../library/subprocess.rst:322 msgid "" -"The newlines attribute of the file " -"objects :attr:`Popen.stdin`, :attr:`Popen.stdout` and :attr:`Popen.stderr` " -"are not updated by the :meth:`Popen.communicate` method." +"The newlines attribute of the file objects :attr:`Popen.stdin`, :attr:`Popen." +"stdout` and :attr:`Popen.stderr` are not updated by the :meth:`Popen." +"communicate` method." msgstr "" #: ../../library/subprocess.rst:326 @@ -422,18 +419,17 @@ msgid "" "convenient access to other shell features such as shell pipes, filename " "wildcards, environment variable expansion, and expansion of ``~`` to a " "user's home directory. However, note that Python itself offers " -"implementations of many shell-like features (in " -"particular, :mod:`glob`, :mod:`fnmatch`, :func:`os.walk`, :func:`os.path.expandvars`, :func:`os.path.expanduser`, " -"and :mod:`shutil`)." +"implementations of many shell-like features (in particular, :mod:`glob`, :" +"mod:`fnmatch`, :func:`os.walk`, :func:`os.path.expandvars`, :func:`os.path." +"expanduser`, and :mod:`shutil`)." msgstr "" #: ../../library/subprocess.rst:336 msgid "" -"When *universal_newlines* is ``True``, the class uses the " -"encoding :func:`locale.getpreferredencoding(False) " -"` instead of " -"``locale.getpreferredencoding()``. See the :class:`io.TextIOWrapper` class " -"for more information on this change." +"When *universal_newlines* is ``True``, the class uses the encoding :func:" +"`locale.getpreferredencoding(False) ` instead " +"of ``locale.getpreferredencoding()``. See the :class:`io.TextIOWrapper` " +"class for more information on this change." msgstr "" #: ../../library/subprocess.rst:344 ../../library/subprocess.rst:465 @@ -461,16 +457,16 @@ msgstr "" #: ../../library/subprocess.rst:368 msgid "" -"Execute a child program in a new process. On POSIX, the class " -"uses :meth:`os.execvpe`-like behavior to execute the child program. On " -"Windows, the class uses the Windows ``CreateProcess()`` function. The " -"arguments to :class:`Popen` are as follows." +"Execute a child program in a new process. On POSIX, the class uses :meth:" +"`os.execvpe`-like behavior to execute the child program. On Windows, the " +"class uses the Windows ``CreateProcess()`` function. The arguments to :" +"class:`Popen` are as follows." msgstr "" #: ../../library/subprocess.rst:373 msgid "" -"*args* should be a sequence of program arguments or else a single string " -"or :term:`path-like object`. By default, the program to execute is the first " +"*args* should be a sequence of program arguments or else a single string or :" +"term:`path-like object`. By default, the program to execute is the first " "item in *args* if *args* is a sequence. If *args* is a string, the " "interpretation is platform-dependent and described below. See the *shell* " "and *executable* arguments for additional differences from the default " @@ -590,8 +586,8 @@ msgid "" "when typed at the shell prompt. This includes, for example, quoting or " "backslash escaping filenames with spaces in them. If *args* is a sequence, " "the first item specifies the command string, and any additional items will " -"be treated as additional arguments to the shell itself. That is to " -"say, :class:`Popen` does the equivalent of::" +"be treated as additional arguments to the shell itself. That is to say, :" +"class:`Popen` does the equivalent of::" msgstr "" #: ../../library/subprocess.rst:455 @@ -631,8 +627,8 @@ msgstr "" #: ../../library/subprocess.rst:477 msgid "" -"negative bufsize (the default) means the system default of " -"io.DEFAULT_BUFFER_SIZE will be used." +"negative bufsize (the default) means the system default of io." +"DEFAULT_BUFFER_SIZE will be used." msgstr "" #: ../../library/subprocess.rst:480 @@ -675,10 +671,10 @@ msgid "" "descriptor (a positive integer), and an existing :term:`file object` with a " "valid file descriptor. With the default settings of ``None``, no " "redirection will occur. :data:`PIPE` indicates that a new pipe to the child " -"should be created. :data:`DEVNULL` indicates that the special " -"file :data:`os.devnull` will be used. Additionally, *stderr* can " -"be :data:`STDOUT`, which indicates that the stderr data from the " -"applications should be captured into the same file handle as for *stdout*." +"should be created. :data:`DEVNULL` indicates that the special file :data:" +"`os.devnull` will be used. Additionally, *stderr* can be :data:`STDOUT`, " +"which indicates that the stderr data from the applications should be " +"captured into the same file handle as for *stdout*." msgstr "" #: ../../library/subprocess.rst:523 @@ -720,8 +716,8 @@ msgstr "" #: ../../library/subprocess.rst:552 msgid "" "On Windows, if *close_fds* is true then no handles will be inherited by the " -"child process unless explicitly passed in the ``handle_list`` element " -"of :attr:`STARTUPINFO.lpAttributeList`, or by standard handle redirection." +"child process unless explicitly passed in the ``handle_list`` element of :" +"attr:`STARTUPINFO.lpAttributeList`, or by standard handle redirection." msgstr "" #: ../../library/subprocess.rst:556 @@ -732,16 +728,16 @@ msgstr "" #: ../../library/subprocess.rst:560 msgid "" -"On Windows the default for *close_fds* was changed from :const:`False` " -"to :const:`True` when redirecting the standard handles. It's now possible to " -"set *close_fds* to :const:`True` when redirecting the standard handles." +"On Windows the default for *close_fds* was changed from :const:`False` to :" +"const:`True` when redirecting the standard handles. It's now possible to set " +"*close_fds* to :const:`True` when redirecting the standard handles." msgstr "" #: ../../library/subprocess.rst:565 msgid "" "*pass_fds* is an optional sequence of file descriptors to keep open between " -"the parent and child. Providing any *pass_fds* forces *close_fds* to " -"be :const:`True`. (POSIX only)" +"the parent and child. Providing any *pass_fds* forces *close_fds* to be :" +"const:`True`. (POSIX only)" msgstr "" #: ../../library/subprocess.rst:569 @@ -751,10 +747,10 @@ msgstr "新增 *pass_fds* 參數。" #: ../../library/subprocess.rst:572 msgid "" "If *cwd* is not ``None``, the function changes the working directory to " -"*cwd* before executing the child. *cwd* can be a string, bytes " -"or :term:`path-like ` object. On POSIX, the function " -"looks for *executable* (or for the first item in *args*) relative to *cwd* " -"if the executable path is a relative path." +"*cwd* before executing the child. *cwd* can be a string, bytes or :term:" +"`path-like ` object. On POSIX, the function looks for " +"*executable* (or for the first item in *args*) relative to *cwd* if the " +"executable path is a relative path." msgstr "" #: ../../library/subprocess.rst:578 @@ -839,15 +835,15 @@ msgid "" "If *env* is not ``None``, it must be a mapping that defines the environment " "variables for the new process; these are used instead of the default " "behavior of inheriting the current process' environment. This mapping can be " -"str to str on any platform or bytes to bytes on POSIX platforms much " -"like :data:`os.environ` or :data:`os.environb`." +"str to str on any platform or bytes to bytes on POSIX platforms much like :" +"data:`os.environ` or :data:`os.environb`." msgstr "" #: ../../library/subprocess.rst:650 msgid "" "If specified, *env* must provide any variables required for the program to " "execute. On Windows, in order to run a `side-by-side assembly`_ the " -"specified *env* **must** include a valid :envvar:`SystemRoot`." +"specified *env* **must** include a valid ``%SystemRoot%``." msgstr "" #: ../../library/subprocess.rst:656 @@ -955,8 +951,8 @@ msgstr "" #: ../../library/subprocess.rst:701 ../../library/subprocess.rst:703 msgid "" -"Popen and the other functions in this module that use it raise " -"an :ref:`auditing event ` ``subprocess.Popen`` with arguments " +"Popen and the other functions in this module that use it raise an :ref:" +"`auditing event ` ``subprocess.Popen`` with arguments " "``executable``, ``args``, ``cwd``, and ``env``. The value for ``args`` may " "be a single string or a list of strings, depending on platform." msgstr "" @@ -976,8 +972,8 @@ msgid "" "Popen can use :func:`os.posix_spawn` in some cases for better performance. " "On Windows Subsystem for Linux and QEMU User Emulation, Popen constructor " "using :func:`os.posix_spawn` no longer raise an exception on errors like " -"missing program, but the child process fails with a non-" -"zero :attr:`~Popen.returncode`." +"missing program, but the child process fails with a non-zero :attr:`~Popen." +"returncode`." msgstr "" #: ../../library/subprocess.rst:724 @@ -994,11 +990,11 @@ msgstr "" msgid "" "The most common exception raised is :exc:`OSError`. This occurs, for " "example, when trying to execute a non-existent file. Applications should " -"prepare for :exc:`OSError` exceptions. Note that, when " -"``shell=True``, :exc:`OSError` will be raised by the child only if the " -"selected shell itself was not found. To determine if the shell failed to " -"find the requested application, it is necessary to check the return code or " -"output from the subprocess." +"prepare for :exc:`OSError` exceptions. Note that, when ``shell=True``, :exc:" +"`OSError` will be raised by the child only if the selected shell itself was " +"not found. To determine if the shell failed to find the requested " +"application, it is necessary to check the return code or output from the " +"subprocess." msgstr "" #: ../../library/subprocess.rst:736 @@ -1009,16 +1005,15 @@ msgstr "" #: ../../library/subprocess.rst:739 msgid "" -":func:`check_call` and :func:`check_output` will " -"raise :exc:`CalledProcessError` if the called process returns a non-zero " -"return code." +":func:`check_call` and :func:`check_output` will raise :exc:" +"`CalledProcessError` if the called process returns a non-zero return code." msgstr "" #: ../../library/subprocess.rst:743 msgid "" -"All of the functions and methods that accept a *timeout* parameter, such " -"as :func:`run` and :meth:`Popen.communicate` will " -"raise :exc:`TimeoutExpired` if the timeout expires before the process exits." +"All of the functions and methods that accept a *timeout* parameter, such as :" +"func:`run` and :meth:`Popen.communicate` will raise :exc:`TimeoutExpired` if " +"the timeout expires before the process exits." msgstr "" #: ../../library/subprocess.rst:747 @@ -1054,8 +1049,8 @@ msgid "" "this library. This could result in arguments being parsed according to shell " "rules, but without any escaping added by Python. If you are intentionally " "launching a batch file with arguments from untrusted sources, consider " -"passing ``shell=True`` to allow Python to escape special characters. " -"See :gh:`114539` for additional discussion." +"passing ``shell=True`` to allow Python to escape special characters. See :gh:" +"`114539` for additional discussion." msgstr "" #: ../../library/subprocess.rst:777 @@ -1068,21 +1063,21 @@ msgstr "" #: ../../library/subprocess.rst:784 msgid "" -"Check if child process has terminated. Set and " -"return :attr:`~Popen.returncode` attribute. Otherwise, returns ``None``." +"Check if child process has terminated. Set and return :attr:`~Popen." +"returncode` attribute. Otherwise, returns ``None``." msgstr "" #: ../../library/subprocess.rst:790 msgid "" -"Wait for child process to terminate. Set and " -"return :attr:`~Popen.returncode` attribute." +"Wait for child process to terminate. Set and return :attr:`~Popen." +"returncode` attribute." msgstr "" #: ../../library/subprocess.rst:793 msgid "" -"If the process does not terminate after *timeout* seconds, raise " -"a :exc:`TimeoutExpired` exception. It is safe to catch this exception and " -"retry the wait." +"If the process does not terminate after *timeout* seconds, raise a :exc:" +"`TimeoutExpired` exception. It is safe to catch this exception and retry " +"the wait." msgstr "" #: ../../library/subprocess.rst:799 @@ -1097,8 +1092,8 @@ msgstr "" msgid "" "When the ``timeout`` parameter is not ``None``, then (on POSIX) the function " "is implemented using a busy loop (non-blocking call and short sleeps). Use " -"the :mod:`asyncio` module for an asynchronous wait: " -"see :class:`asyncio.create_subprocess_exec`." +"the :mod:`asyncio` module for an asynchronous wait: see :class:`asyncio." +"create_subprocess_exec`." msgstr "" #: ../../library/subprocess.rst:811 ../../library/subprocess.rst:852 @@ -1133,9 +1128,9 @@ msgstr "" #: ../../library/subprocess.rst:832 msgid "" -"If the process does not terminate after *timeout* seconds, " -"a :exc:`TimeoutExpired` exception will be raised. Catching this exception " -"and retrying communication will not lose any output." +"If the process does not terminate after *timeout* seconds, a :exc:" +"`TimeoutExpired` exception will be raised. Catching this exception and " +"retrying communication will not lose any output." msgstr "" #: ../../library/subprocess.rst:836 @@ -1238,10 +1233,10 @@ msgstr "" #: ../../library/subprocess.rst:922 msgid "" -"Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write " -"`, :attr:`.stdout.read ` or :attr:`.stderr.read " -"` to avoid deadlocks due to any of the other OS pipe buffers " -"filling up and blocking the child process." +"Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write `, :attr:`.stdout.read ` or :attr:`.stderr.read ` to avoid deadlocks due to any of the other OS pipe buffers filling " +"up and blocking the child process." msgstr "" #: ../../library/subprocess.rst:930 @@ -1298,12 +1293,12 @@ msgstr "" #: ../../library/subprocess.rst:971 msgid "" "si = subprocess.STARTUPINFO()\n" -"si.dwFlags = subprocess.STARTF_USESTDHANDLES | " -"subprocess.STARTF_USESHOWWINDOW" +"si.dwFlags = subprocess.STARTF_USESTDHANDLES | subprocess." +"STARTF_USESHOWWINDOW" msgstr "" "si = subprocess.STARTUPINFO()\n" -"si.dwFlags = subprocess.STARTF_USESTDHANDLES | " -"subprocess.STARTF_USESHOWWINDOW" +"si.dwFlags = subprocess.STARTF_USESTDHANDLES | subprocess." +"STARTF_USESHOWWINDOW" #: ../../library/subprocess.rst:976 msgid "" @@ -1337,15 +1332,15 @@ msgstr "" #: ../../library/subprocess.rst:1003 msgid "" -":data:`SW_HIDE` is provided for this attribute. It is used " -"when :class:`Popen` is called with ``shell=True``." +":data:`SW_HIDE` is provided for this attribute. It is used when :class:" +"`Popen` is called with ``shell=True``." msgstr "" #: ../../library/subprocess.rst:1008 msgid "" "A dictionary of additional attributes for process creation as given in " -"``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." +"``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." msgstr "" #: ../../library/subprocess.rst:1012 @@ -1364,9 +1359,9 @@ msgstr "" #: ../../library/subprocess.rst:1018 msgid "" -"The handles must be temporarily made inheritable " -"by :func:`os.set_handle_inheritable` when passed to the :class:`Popen` " -"constructor, else :class:`OSError` will be raised with Windows error " +"The handles must be temporarily made inheritable by :func:`os." +"set_handle_inheritable` when passed to the :class:`Popen` constructor, else :" +"class:`OSError` will be raised with Windows error " "``ERROR_INVALID_PARAMETER`` (87)." msgstr "" @@ -1374,9 +1369,9 @@ msgstr "" msgid "" "In a multithreaded process, use caution to avoid leaking handles that are " "marked inheritable when combining this feature with concurrent calls to " -"other process creation functions that inherit all handles such " -"as :func:`os.system`. This also applies to standard handle redirection, " -"which temporarily creates inheritable handles." +"other process creation functions that inherit all handles such as :func:`os." +"system`. This also applies to standard handle redirection, which " +"temporarily creates inheritable handles." msgstr "" #: ../../library/subprocess.rst:1035 @@ -1411,9 +1406,9 @@ msgstr "" #: ../../library/subprocess.rst:1060 msgid "" -"Specifies that " -"the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO.hStdOutput`, " -"and :attr:`STARTUPINFO.hStdError` attributes contain additional information." +"Specifies that the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO." +"hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes contain additional " +"information." msgstr "" #: ../../library/subprocess.rst:1066 @@ -1567,11 +1562,10 @@ msgstr "" #: ../../library/subprocess.rst:1224 msgid "" "Run command with arguments. Wait for command to complete. If the return " -"code was zero then return, otherwise raise :exc:`CalledProcessError`. " -"The :exc:`CalledProcessError` object will have the return code in " -"the :attr:`~CalledProcessError.returncode` attribute. If :func:`check_call` " -"was unable to start the process it will propagate the exception that was " -"raised." +"code was zero then return, otherwise raise :exc:`CalledProcessError`. The :" +"exc:`CalledProcessError` object will have the return code in the :attr:" +"`~CalledProcessError.returncode` attribute. If :func:`check_call` was unable " +"to start the process it will propagate the exception that was raised." msgstr "" #: ../../library/subprocess.rst:1233 @@ -1584,10 +1578,10 @@ msgstr "" #: ../../library/subprocess.rst:1268 msgid "" -"If the return code was non-zero it raises a :exc:`CalledProcessError`. " -"The :exc:`CalledProcessError` object will have the return code in " -"the :attr:`~CalledProcessError.returncode` attribute and any output in " -"the :attr:`~CalledProcessError.output` attribute." +"If the return code was non-zero it raises a :exc:`CalledProcessError`. The :" +"exc:`CalledProcessError` object will have the return code in the :attr:" +"`~CalledProcessError.returncode` attribute and any output in the :attr:" +"`~CalledProcessError.output` attribute." msgstr "" #: ../../library/subprocess.rst:1273 @@ -1602,10 +1596,10 @@ msgstr "run(..., check=True, stdout=PIPE).stdout" msgid "" "The arguments shown above are merely some common ones. The full function " "signature is largely the same as that of :func:`run` - most arguments are " -"passed directly through to that interface. One API deviation " -"from :func:`run` behavior exists: passing ``input=None`` will behave the " -"same as ``input=b''`` (or ``input=''``, depending on other arguments) rather " -"than using the parent's standard input file handle." +"passed directly through to that interface. One API deviation from :func:" +"`run` behavior exists: passing ``input=None`` will behave the same as " +"``input=b''`` (or ``input=''``, depending on other arguments) rather than " +"using the parent's standard input file handle." msgstr "" #: ../../library/subprocess.rst:1284 @@ -1624,8 +1618,8 @@ msgstr "" #: ../../library/subprocess.rst:1292 msgid "" -"To also capture standard error in the result, use " -"``stderr=subprocess.STDOUT``::" +"To also capture standard error in the result, use ``stderr=subprocess." +"STDOUT``::" msgstr "" #: ../../library/subprocess.rst:1295 @@ -1663,16 +1657,16 @@ msgstr "" #: ../../library/subprocess.rst:1333 msgid "" "All \"a\" functions in this section fail (more or less) silently if the " -"executed program cannot be found; the \"b\" replacements " -"raise :exc:`OSError` instead." +"executed program cannot be found; the \"b\" replacements raise :exc:" +"`OSError` instead." msgstr "" #: ../../library/subprocess.rst:1337 msgid "" -"In addition, the replacements using :func:`check_output` will fail with " -"a :exc:`CalledProcessError` if the requested operation produces a non-zero " -"return code. The output is still available as " -"the :attr:`~CalledProcessError.output` attribute of the raised exception." +"In addition, the replacements using :func:`check_output` will fail with a :" +"exc:`CalledProcessError` if the requested operation produces a non-zero " +"return code. The output is still available as the :attr:`~CalledProcessError." +"output` attribute of the raised exception." msgstr "" #: ../../library/subprocess.rst:1342 @@ -1754,15 +1748,15 @@ msgstr "" #: ../../library/subprocess.rst:1398 msgid "" -"The :func:`call` return value is encoded differently to that " -"of :func:`os.system`." +"The :func:`call` return value is encoded differently to that of :func:`os." +"system`." msgstr "" #: ../../library/subprocess.rst:1401 msgid "" "The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the " -"command is running, but the caller must do this separately when using " -"the :mod:`subprocess` module." +"command is running, but the caller must do this separately when using the :" +"mod:`subprocess` module." msgstr "" #: ../../library/subprocess.rst:1405 @@ -1774,8 +1768,8 @@ msgid "" "try:\n" " retcode = call(\"mycmd\" + \" myarg\", shell=True)\n" " if retcode < 0:\n" -" print(\"Child was terminated by signal\", -retcode, " -"file=sys.stderr)\n" +" print(\"Child was terminated by signal\", -retcode, file=sys." +"stderr)\n" " else:\n" " print(\"Child returned\", retcode, file=sys.stderr)\n" "except OSError as e:\n" @@ -1784,8 +1778,8 @@ msgstr "" "try:\n" " retcode = call(\"mycmd\" + \" myarg\", shell=True)\n" " if retcode < 0:\n" -" print(\"Child was terminated by signal\", -retcode, " -"file=sys.stderr)\n" +" print(\"Child was terminated by signal\", -retcode, file=sys." +"stderr)\n" " else:\n" " print(\"Child returned\", retcode, file=sys.stderr)\n" "except OSError as e:\n" @@ -1903,10 +1897,9 @@ msgstr "" #: ../../library/subprocess.rst:1476 msgid "" -"Execute the string *cmd* in a shell with :meth:`Popen.check_output` and " -"return a 2-tuple ``(exitcode, output)``. *encoding* and *errors* are used to " -"decode output; see the notes on :ref:`frequently-used-arguments` for more " -"details." +"Execute the string *cmd* in a shell with :func:`check_output` and return a 2-" +"tuple ``(exitcode, output)``. *encoding* and *errors* are used to decode " +"output; see the notes on :ref:`frequently-used-arguments` for more details." msgstr "" #: ../../library/subprocess.rst:1481 @@ -1942,8 +1935,8 @@ msgstr "新增對 Windows 的支援。" #: ../../library/subprocess.rst:1499 msgid "" "The function now returns (exitcode, output) instead of (status, output) as " -"it did in Python 3.3.3 and earlier. exitcode has the same value " -"as :attr:`~Popen.returncode`." +"it did in Python 3.3.3 and earlier. exitcode has the same value as :attr:" +"`~Popen.returncode`." msgstr "" #: ../../library/subprocess.rst:1508 @@ -1978,9 +1971,9 @@ msgstr "" #: ../../library/subprocess.rst:1533 msgid "" -"When using the ``timeout`` parameter in functions " -"like :func:`run`, :meth:`Popen.wait`, or :meth:`Popen.communicate`, users " -"should be aware of the following behaviors:" +"When using the ``timeout`` parameter in functions like :func:`run`, :meth:" +"`Popen.wait`, or :meth:`Popen.communicate`, users should be aware of the " +"following behaviors:" msgstr "" #: ../../library/subprocess.rst:1537 @@ -2074,9 +2067,9 @@ msgid "" "attribute is available to read. Despite the name, a true value does not " "indicate the corresponding function will be used, only that it may be." msgstr "" -"在任何 Python 版本上將這個設定為 false 都是安全的。當不受支援時,它對舊版本或沒有支援的新版本" -"沒有影響。不要假設屬性可供讀取。儘管它的名稱是這樣,真實值並不表示將使用相應的" -"函式,而只是表示可能會使用。" +"在任何 Python 版本上將這個設定為 false 都是安全的。當不受支援時,它對舊版本或" +"沒有支援的新版本沒有影響。不要假設屬性可供讀取。儘管它的名稱是這樣,真實值並" +"不表示將使用相應的函式,而只是表示可能會使用。" #: ../../library/subprocess.rst:1600 msgid "" diff --git a/library/sysconfig.po b/library/sysconfig.po index e529b88de4..3b9073c20b 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-29 00:15+0000\n" +"POT-Creation-Date: 2025-10-05 00:16+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-" @@ -109,10 +109,10 @@ msgstr "" #: ../../library/sysconfig.rst:70 msgid "" "Python uses an installation scheme that differs depending on the platform " -"and on the installation options. These schemes are stored " -"in :mod:`sysconfig` under unique identifiers based on the value returned " -"by :const:`os.name`. The schemes are used by package installers to determine " -"where to copy files to." +"and on the installation options. These schemes are stored in :mod:" +"`sysconfig` under unique identifiers based on the value returned by :const:" +"`os.name`. The schemes are used by package installers to determine where to " +"copy files to." msgstr "" #: ../../library/sysconfig.rst:75 @@ -134,8 +134,8 @@ msgstr "" #: ../../library/sysconfig.rst:81 msgid "" "*posix_user*: scheme for POSIX platforms, when the *user* option is used. " -"This scheme defines paths located under the user's home directory " -"(:const:`site.USER_BASE`)." +"This scheme defines paths located under the user's home directory (:const:" +"`site.USER_BASE`)." msgstr "" #: ../../library/sysconfig.rst:84 @@ -233,8 +233,8 @@ msgstr "" msgid "" "Files will be installed into subdirectories of :const:`site.USER_BASE` " "(written as :file:`{userbase}` hereafter). This scheme installs pure Python " -"modules and extension modules in the same location (also known " -"as :const:`site.USER_SITE`)." +"modules and extension modules in the same location (also known as :const:" +"`site.USER_SITE`)." msgstr "" #: ../../library/sysconfig.rst:126 @@ -357,8 +357,8 @@ msgid "" "The idea behind the \"home scheme\" is that you build and maintain a " "personal stash of Python modules. This scheme's name is derived from the " "idea of a \"home\" directory on Unix, since it's not unusual for a Unix user " -"to make their home directory have a layout similar to :file:`/usr/` " -"or :file:`/usr/local/`. This scheme can be used by anyone, regardless of the " +"to make their home directory have a layout similar to :file:`/usr/` or :file:" +"`/usr/local/`. This scheme can be used by anyone, regardless of the " "operating system they are installing for." msgstr "" @@ -479,8 +479,8 @@ msgstr "" #: ../../library/sysconfig.rst:265 msgid "" -"Return a tuple containing all schemes currently supported " -"in :mod:`sysconfig`." +"Return a tuple containing all schemes currently supported in :mod:" +"`sysconfig`." msgstr "" #: ../../library/sysconfig.rst:271 @@ -532,14 +532,14 @@ msgstr "" #: ../../library/sysconfig.rst:307 msgid "" -"End users should not use this function, but :func:`get_default_scheme` " -"and :func:`get_preferred_scheme` instead." +"End users should not use this function, but :func:`get_default_scheme` and :" +"func:`get_preferred_scheme` instead." msgstr "" #: ../../library/sysconfig.rst:315 msgid "" -"Return a tuple containing all path names currently supported " -"in :mod:`sysconfig`." +"Return a tuple containing all path names currently supported in :mod:" +"`sysconfig`." msgstr "" #: ../../library/sysconfig.rst:321 @@ -569,9 +569,9 @@ msgstr "" #: ../../library/sysconfig.rst:334 msgid "" -"If *scheme* is provided, it must be a value from the list returned " -"by :func:`get_scheme_names`. Otherwise, the default scheme for the current " -"platform is used." +"If *scheme* is provided, it must be a value from the list returned by :func:" +"`get_scheme_names`. Otherwise, the default scheme for the current platform " +"is used." msgstr "" #: ../../library/sysconfig.rst:338 @@ -614,8 +614,8 @@ msgstr "" #: ../../library/sysconfig.rst:360 msgid "" -"If *scheme* is not an existing scheme, :func:`get_paths` will raise " -"a :exc:`KeyError`." +"If *scheme* is not an existing scheme, :func:`get_paths` will raise a :exc:" +"`KeyError`." msgstr "" #: ../../library/sysconfig.rst:365 @@ -627,8 +627,8 @@ msgid "" "Return the ``MAJOR.MINOR`` Python version number as a string. Similar to " "``'%d.%d' % sys.version_info[:2]``." msgstr "" -"回傳 ``MAJOR.MINOR`` Python 版本號碼字串。類似於 ``'%d.%d' % " -"sys.version_info[:2]``。" +"回傳 ``MAJOR.MINOR`` Python 版本號碼字串。類似於 ``'%d.%d' % sys." +"version_info[:2]``。" #: ../../library/sysconfig.rst:375 msgid "Return a string that identifies the current platform." @@ -647,99 +647,89 @@ msgstr "" msgid "Examples of returned values:" msgstr "" -#: ../../library/sysconfig.rst:385 -msgid "linux-i586" -msgstr "linux-i586" - #: ../../library/sysconfig.rst:386 -msgid "linux-alpha (?)" -msgstr "linux-alpha (?)" - -#: ../../library/sysconfig.rst:387 -msgid "solaris-2.6-sun4u" -msgstr "solaris-2.6-sun4u" - -#: ../../library/sysconfig.rst:389 -msgid "Windows will return one of:" +msgid "Windows:" msgstr "" -#: ../../library/sysconfig.rst:391 +#: ../../library/sysconfig.rst:388 msgid "win-amd64 (64-bit Windows on AMD64, aka x86_64, Intel64, and EM64T)" msgstr "" -#: ../../library/sysconfig.rst:392 +#: ../../library/sysconfig.rst:389 msgid "win-arm64 (64-bit Windows on ARM64, aka AArch64)" msgstr "" -#: ../../library/sysconfig.rst:393 +#: ../../library/sysconfig.rst:390 msgid "win32 (all others - specifically, sys.platform is returned)" msgstr "" -#: ../../library/sysconfig.rst:395 -msgid "macOS can return:" +#: ../../library/sysconfig.rst:392 +msgid "POSIX based OS:" msgstr "" -#: ../../library/sysconfig.rst:397 -msgid "macosx-10.6-ppc" -msgstr "macosx-10.6-ppc" +#: ../../library/sysconfig.rst:394 +#, fuzzy +msgid "linux-x86_64" +msgstr "linux-i586" -#: ../../library/sysconfig.rst:398 -msgid "macosx-10.4-ppc64" +#: ../../library/sysconfig.rst:395 +#, fuzzy +msgid "macosx-15.5-arm64" msgstr "macosx-10.4-ppc64" -#: ../../library/sysconfig.rst:399 -msgid "macosx-10.3-i386" -msgstr "macosx-10.3-i386" +#: ../../library/sysconfig.rst:396 +msgid "macosx-26.0-universal2 (macOS on Apple Silicon or Intel)" +msgstr "" -#: ../../library/sysconfig.rst:400 -msgid "macosx-10.4-fat" -msgstr "macosx-10.4-fat" +#: ../../library/sysconfig.rst:397 +msgid "android-24-arm64_v8a" +msgstr "" -#: ../../library/sysconfig.rst:402 +#: ../../library/sysconfig.rst:399 msgid "" "For other non-POSIX platforms, currently just returns :data:`sys.platform`." msgstr "" -#: ../../library/sysconfig.rst:407 +#: ../../library/sysconfig.rst:404 msgid "" "Return ``True`` if the running Python interpreter was built from source and " "is being run from its built location, and not from a location resulting from " "e.g. running ``make install`` or installing via a binary installer." msgstr "" -#: ../../library/sysconfig.rst:414 +#: ../../library/sysconfig.rst:411 msgid "Parse a :file:`config.h`\\-style file." msgstr "" -#: ../../library/sysconfig.rst:416 +#: ../../library/sysconfig.rst:413 msgid "" "*fp* is a file-like object pointing to the :file:`config.h`\\-like file." msgstr "" -#: ../../library/sysconfig.rst:418 +#: ../../library/sysconfig.rst:415 msgid "" "A dictionary containing name/value pairs is returned. If an optional " "dictionary is passed in as the second argument, it is used instead of a new " "dictionary, and updated with the values read in the file." msgstr "" -#: ../../library/sysconfig.rst:425 +#: ../../library/sysconfig.rst:422 msgid "Return the path of :file:`pyconfig.h`." msgstr "回傳 :file:`pyconfig.h` 的路徑。" -#: ../../library/sysconfig.rst:429 +#: ../../library/sysconfig.rst:426 msgid "Return the path of :file:`Makefile`." msgstr "回傳 :file:`Makefile` 的路徑。" -#: ../../library/sysconfig.rst:435 +#: ../../library/sysconfig.rst:432 msgid "Command-line usage" msgstr "命令列用法" -#: ../../library/sysconfig.rst:437 +#: ../../library/sysconfig.rst:434 msgid "You can use :mod:`sysconfig` as a script with Python's *-m* option:" msgstr "" -#: ../../library/sysconfig.rst:439 +#: ../../library/sysconfig.rst:436 msgid "" "$ python -m sysconfig\n" "Platform: \"macosx-10.4-i386\"\n" @@ -785,16 +775,31 @@ msgstr "" " ARFLAGS = \"rc\"\n" " ..." -#: ../../library/sysconfig.rst:463 +#: ../../library/sysconfig.rst:460 msgid "" -"This call will print in the standard output the information returned " -"by :func:`get_platform`, :func:`get_python_version`, :func:`get_path` " -"and :func:`get_config_vars`." +"This call will print in the standard output the information returned by :" +"func:`get_platform`, :func:`get_python_version`, :func:`get_path` and :func:" +"`get_config_vars`." msgstr "" #: ../../library/sysconfig.rst:14 msgid "configuration information" msgstr "configuration information(設定資訊)" +#~ msgid "linux-alpha (?)" +#~ msgstr "linux-alpha (?)" + +#~ msgid "solaris-2.6-sun4u" +#~ msgstr "solaris-2.6-sun4u" + +#~ msgid "macosx-10.6-ppc" +#~ msgstr "macosx-10.6-ppc" + +#~ msgid "macosx-10.3-i386" +#~ msgstr "macosx-10.3-i386" + +#~ msgid "macosx-10.4-fat" +#~ msgstr "macosx-10.4-fat" + #~ msgid "Using :mod:`sysconfig` as a script" #~ msgstr "將 :mod:`sysconfig` 作為腳本使用" diff --git a/library/typing.po b/library/typing.po index 1bd99ff57d..e77aa9c051 100644 --- a/library/typing.po +++ b/library/typing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-18 00:15+0000\n" +"POT-Creation-Date: 2025-10-10 00:15+0000\n" "PO-Revision-Date: 2024-07-11 11:12+0800\n" "Last-Translator: Li-Hung Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -513,7 +513,7 @@ msgstr "" "``Callable[Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable], " "ReturnType]`` 的形式。" -#: ../../library/typing.rst:287 ../../library/typing.rst:3990 +#: ../../library/typing.rst:287 ../../library/typing.rst:4004 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -668,9 +668,9 @@ msgid "" "``tuple`` as an annotation is equivalent to using ``tuple[Any, ...]``::" msgstr "" "為了標示一個元組可以為\\ *任意*\\ 長度,且所有元素皆是相同型別 ``T``,請使用 " -"刪節號字面值 (literal ellipsis) ``...``:``tuple[T, ...]``。為了標示" -"一個空元組,請使用 ``tuple[()]``。單純使用 ``tuple`` 作為註釋會與使用 ``tuple[Any, ...]`` " -"相等: ::" +"刪節號字面值 (literal ellipsis) ``...``:``tuple[T, ...]``。為了標示一個空元" +"組,請使用 ``tuple[()]``。單純使用 ``tuple`` 作為註釋會與使用 " +"``tuple[Any, ...]`` 相等: ::" #: ../../library/typing.rst:388 msgid "" @@ -2404,10 +2404,10 @@ msgstr "" msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " -"``x``. In this way, ``Annotated`` differs from the :func:`@no_type_check " -"` decorator, which can also be used for adding annotations " -"outside the scope of the typing system, but completely disables typechecking " -"for a function or class." +"``x``. In this way, ``Annotated`` differs from the :deco:`no_type_check` " +"decorator, which can also be used for adding annotations outside the scope " +"of the typing system, but completely disables typechecking for a function or " +"class." msgstr "" #: ../../library/typing.rst:1397 @@ -3670,7 +3670,7 @@ msgstr "" "'Alias'" #: ../../library/typing.rst:2272 -msgid "The module in which the type alias was defined::" +msgid "The name of the module in which the type alias was defined::" msgstr "" #: ../../library/typing.rst:2274 @@ -3965,7 +3965,7 @@ msgid "" msgstr "" #: ../../library/typing.rst:2465 -msgid "The module in which the new type is defined." +msgid "The name of the module in which the new type is defined." msgstr "" #: ../../library/typing.rst:2469 @@ -4559,7 +4559,7 @@ msgstr "協定" #: ../../library/typing.rst:2837 msgid "" "The following protocols are provided by the :mod:`!typing` module. All are " -"decorated with :func:`@runtime_checkable `." +"decorated with :deco:`runtime_checkable`." msgstr "" #: ../../library/typing.rst:2842 @@ -4809,7 +4809,7 @@ msgid "" "function that is itself a decorator. The presence of " "``@dataclass_transform()`` tells a static type checker that the decorated " "object performs runtime \"magic\" that transforms a class in a similar way " -"to :func:`@dataclasses.dataclass `." +"to :deco:`dataclasses.dataclass`." msgstr "" #: ../../library/typing.rst:3021 @@ -4885,19 +4885,19 @@ msgstr "" #: ../../library/typing.rst:3055 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " -"similarly to classes created with :func:`@dataclasses.dataclass `. For example, type checkers will assume these classes have " -"``__init__`` methods that accept ``id`` and ``name``." +"similarly to classes created with :deco:`dataclasses.dataclass`. For " +"example, type checkers will assume these classes have ``__init__`` methods " +"that accept ``id`` and ``name``." msgstr "" #: ../../library/typing.rst:3061 msgid "" "The decorated class, metaclass, or function may accept the following bool " "arguments which type checkers will assume have the same effect as they would " -"have on the :func:`@dataclasses.dataclass` decorator: " -"``init``, ``eq``, ``order``, ``unsafe_hash``, ``frozen``, ``match_args``, " -"``kw_only``, and ``slots``. It must be possible for the value of these " -"arguments (``True`` or ``False``) to be statically evaluated." +"have on the :deco:`dataclasses.dataclass` decorator: ``init``, ``eq``, " +"``order``, ``unsafe_hash``, ``frozen``, ``match_args``, ``kw_only``, and " +"``slots``. It must be possible for the value of these arguments (``True`` or " +"``False``) to be statically evaluated." msgstr "" #: ../../library/typing.rst:3069 @@ -5111,19 +5111,17 @@ msgid "" msgstr "" #: ../../library/typing.rst:3192 -msgid "" -"Return a sequence of :func:`@overload `-decorated definitions for " -"*func*." +msgid "Return a sequence of :deco:`overload`-decorated definitions for *func*." msgstr "" #: ../../library/typing.rst:3195 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " -"documentation for :func:`@overload `, ``get_overloads(process)`` " -"will return a sequence of three function objects for the three defined " -"overloads. If called on a function with no overloads, ``get_overloads()`` " -"returns an empty sequence." +"documentation for :deco:`overload`, ``get_overloads(process)`` will return a " +"sequence of three function objects for the three defined overloads. If " +"called on a function with no overloads, ``get_overloads()`` returns an empty " +"sequence." msgstr "" #: ../../library/typing.rst:3202 @@ -5328,8 +5326,8 @@ msgstr "" #: ../../library/typing.rst:3354 msgid "" -"If :func:`@no_type_check ` has been applied to *obj*, an " -"empty dictionary is returned." +"If :deco:`no_type_check` has been applied to *obj*, an empty dictionary is " +"returned." msgstr "" #: ../../library/typing.rst:3356 @@ -5875,293 +5873,311 @@ msgid "" msgstr "" #: ../../library/typing.rst:3793 +#, fuzzy +msgid "Deprecated alias to :class:`collections.abc.ByteString`." +msgstr "棄用 :class:`collections.abc.Set` 的別名。" + +#: ../../library/typing.rst:3795 msgid "" -"This type represents the types :class:`bytes`, :class:`bytearray`, and :" -"class:`memoryview` of byte sequences." +"Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " +"implements the :ref:`buffer protocol ` at runtime. For use in " +"type annotations, either use :class:`~collections.abc.Buffer` or a union " +"that explicitly specifies the types your code supports (e.g., ``bytes | " +"bytearray | memoryview``)." msgstr "" -#: ../../library/typing.rst:3796 +#: ../../library/typing.rst:3801 msgid "" -"Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " -"| memoryview``." +":class:`!ByteString` was originally intended to be an abstract class that " +"would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " +"However, since the ABC never had any methods, knowing that an object was an " +"instance of :class:`!ByteString` never actually told you anything useful " +"about the object. Other common buffer types such as :class:`memoryview` were " +"also never understood as subtypes of :class:`!ByteString` (either at runtime " +"or by static type checkers)." msgstr "" -#: ../../library/typing.rst:3801 +#: ../../library/typing.rst:3809 +#, fuzzy +msgid "See :pep:`PEP 688 <688#current-options>` for more details." +msgstr "更多細節請見 :pep:`681`。" + +#: ../../library/typing.rst:3815 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:3805 +#: ../../library/typing.rst:3819 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3811 +#: ../../library/typing.rst:3825 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:3813 +#: ../../library/typing.rst:3827 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3819 +#: ../../library/typing.rst:3833 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:3821 +#: ../../library/typing.rst:3835 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3827 +#: ../../library/typing.rst:3841 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3829 +#: ../../library/typing.rst:3843 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3835 +#: ../../library/typing.rst:3849 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3837 +#: ../../library/typing.rst:3851 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3843 +#: ../../library/typing.rst:3857 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3845 +#: ../../library/typing.rst:3859 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3851 +#: ../../library/typing.rst:3865 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3853 +#: ../../library/typing.rst:3867 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3860 +#: ../../library/typing.rst:3874 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3862 +#: ../../library/typing.rst:3876 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3869 +#: ../../library/typing.rst:3883 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3871 +#: ../../library/typing.rst:3885 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3877 +#: ../../library/typing.rst:3891 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3879 +#: ../../library/typing.rst:3893 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3885 +#: ../../library/typing.rst:3899 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3887 +#: ../../library/typing.rst:3901 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3894 +#: ../../library/typing.rst:3908 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中非同步 ABC 的別名" -#: ../../library/typing.rst:3898 +#: ../../library/typing.rst:3912 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3900 +#: ../../library/typing.rst:3914 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`collections.abc.Coroutine` and ``typing.Coroutine`` in type annotations." msgstr "" -#: ../../library/typing.rst:3906 +#: ../../library/typing.rst:3920 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3912 +#: ../../library/typing.rst:3926 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3914 +#: ../../library/typing.rst:3928 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`collections.abc.AsyncGenerator` and ``typing.AsyncGenerator`` in type " "annotations." msgstr "" -#: ../../library/typing.rst:3920 +#: ../../library/typing.rst:3934 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3925 +#: ../../library/typing.rst:3939 msgid "The ``SendType`` parameter now has a default." msgstr "``SendType`` 參數現在有預設值。" -#: ../../library/typing.rst:3930 +#: ../../library/typing.rst:3944 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3934 +#: ../../library/typing.rst:3948 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3940 +#: ../../library/typing.rst:3954 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3944 +#: ../../library/typing.rst:3958 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3950 +#: ../../library/typing.rst:3964 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3954 +#: ../../library/typing.rst:3968 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3961 +#: ../../library/typing.rst:3975 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3965 +#: ../../library/typing.rst:3979 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3967 +#: ../../library/typing.rst:3981 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3973 +#: ../../library/typing.rst:3987 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3975 +#: ../../library/typing.rst:3989 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3981 +#: ../../library/typing.rst:3995 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "棄用 :class:`collections.abc.Callable` 的別名。" -#: ../../library/typing.rst:3983 +#: ../../library/typing.rst:3997 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:3986 +#: ../../library/typing.rst:4000 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3996 +#: ../../library/typing.rst:4010 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "棄用 :class:`collections.abc.Generator` 的別名。" -#: ../../library/typing.rst:3998 +#: ../../library/typing.rst:4012 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`collections.abc.Generator` and ``typing.Generator`` in type annotations." msgstr "" -#: ../../library/typing.rst:4002 +#: ../../library/typing.rst:4016 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:4006 +#: ../../library/typing.rst:4020 msgid "Default values for the send and return types were added." msgstr "" -#: ../../library/typing.rst:4011 +#: ../../library/typing.rst:4025 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" -#: ../../library/typing.rst:4013 +#: ../../library/typing.rst:4027 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:4018 +#: ../../library/typing.rst:4032 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:4020 +#: ../../library/typing.rst:4034 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:4026 +#: ../../library/typing.rst:4040 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:4028 +#: ../../library/typing.rst:4042 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "改為直接使用 :class:`collections.abc.Sized`。" -#: ../../library/typing.rst:4034 +#: ../../library/typing.rst:4048 msgid "Aliases to :mod:`contextlib` ABCs" msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:4038 +#: ../../library/typing.rst:4052 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:4040 +#: ../../library/typing.rst:4054 msgid "" "The first type parameter, ``T_co``, represents the type returned by the :" "meth:`~object.__enter__` method. The optional second type parameter, " @@ -6169,21 +6185,21 @@ msgid "" "returned by the :meth:`~object.__exit__` method." msgstr "" -#: ../../library/typing.rst:4047 +#: ../../library/typing.rst:4061 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:4052 +#: ../../library/typing.rst:4066 msgid "Added the optional second type parameter, ``ExitT_co``." msgstr "" -#: ../../library/typing.rst:4057 +#: ../../library/typing.rst:4071 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:4059 +#: ../../library/typing.rst:4073 msgid "" "The first type parameter, ``T_co``, represents the type returned by the :" "meth:`~object.__aenter__` method. The optional second type parameter, " @@ -6191,21 +6207,21 @@ msgid "" "returned by the :meth:`~object.__aexit__` method." msgstr "" -#: ../../library/typing.rst:4066 +#: ../../library/typing.rst:4080 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:4071 +#: ../../library/typing.rst:4085 msgid "Added the optional second type parameter, ``AExitT_co``." msgstr "" -#: ../../library/typing.rst:4075 +#: ../../library/typing.rst:4089 msgid "Deprecation Timeline of Major Features" msgstr "主要功能的棄用時程表" -#: ../../library/typing.rst:4077 +#: ../../library/typing.rst:4091 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -6213,112 +6229,112 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:4084 +#: ../../library/typing.rst:4098 msgid "Feature" msgstr "" -#: ../../library/typing.rst:4085 +#: ../../library/typing.rst:4099 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:4086 +#: ../../library/typing.rst:4100 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:4087 +#: ../../library/typing.rst:4101 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:4088 +#: ../../library/typing.rst:4102 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:4089 ../../library/typing.rst:4093 +#: ../../library/typing.rst:4103 ../../library/typing.rst:4107 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:4090 +#: ../../library/typing.rst:4104 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:4091 +#: ../../library/typing.rst:4105 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:4092 +#: ../../library/typing.rst:4106 msgid ":class:`typing.ByteString`" msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:4094 +#: ../../library/typing.rst:4108 msgid "3.17" msgstr "" -#: ../../library/typing.rst:4095 +#: ../../library/typing.rst:4109 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:4096 +#: ../../library/typing.rst:4110 msgid ":data:`typing.Text`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:4097 +#: ../../library/typing.rst:4111 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:4098 ../../library/typing.rst:4102 -#: ../../library/typing.rst:4106 +#: ../../library/typing.rst:4112 ../../library/typing.rst:4116 +#: ../../library/typing.rst:4120 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:4099 +#: ../../library/typing.rst:4113 msgid ":gh:`92332`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:4100 +#: ../../library/typing.rst:4114 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`" -#: ../../library/typing.rst:4101 ../../library/typing.rst:4105 +#: ../../library/typing.rst:4115 ../../library/typing.rst:4119 msgid "3.12" msgstr "3.12" -#: ../../library/typing.rst:4103 +#: ../../library/typing.rst:4117 msgid ":gh:`94309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:4104 +#: ../../library/typing.rst:4118 msgid ":data:`typing.TypeAlias`" msgstr ":data:`typing.TypeAlias`" -#: ../../library/typing.rst:4107 +#: ../../library/typing.rst:4121 msgid ":pep:`695`" msgstr ":pep:`695`" -#: ../../library/typing.rst:4108 +#: ../../library/typing.rst:4122 msgid ":func:`@typing.no_type_check_decorator `" msgstr ":func:`@typing.no_type_check_decorator `" -#: ../../library/typing.rst:4109 ../../library/typing.rst:4113 +#: ../../library/typing.rst:4123 ../../library/typing.rst:4127 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:4110 +#: ../../library/typing.rst:4124 msgid "3.15" msgstr "3.15" -#: ../../library/typing.rst:4111 +#: ../../library/typing.rst:4125 msgid ":gh:`106309`" msgstr ":gh:`106309`" -#: ../../library/typing.rst:4112 +#: ../../library/typing.rst:4126 msgid ":data:`typing.AnyStr`" msgstr ":data:`typing.AnyStr`" -#: ../../library/typing.rst:4114 +#: ../../library/typing.rst:4128 msgid "3.18" msgstr "3.18" -#: ../../library/typing.rst:4115 +#: ../../library/typing.rst:4129 msgid ":gh:`105578`" msgstr ":gh:`105578`" diff --git a/library/unicodedata.po b/library/unicodedata.po index f4adfb8c54..0d514f6140 100644 --- a/library/unicodedata.po +++ b/library/unicodedata.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-17 00:13+0000\n" +"POT-Creation-Date: 2025-09-25 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -178,9 +178,9 @@ msgstr "" msgid "" "Returns the canonical combining class assigned to the character *chr* as " "integer. Returns ``0`` if no combining class is defined. See the `Canonical " -"Combining Class Values section of the Unicode Character Database `_ " -"for more information." +"Combining Class Values section of the Unicode Character Database `_ for more information." msgstr "" #: ../../library/unicodedata.rst:132 diff --git a/library/warnings.po b/library/warnings.po index cc91874e97..73fc65b0fa 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2025-07-14 13:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1140,12 +1140,13 @@ msgstr "" "響。" #: ../../library/warnings.rst:586 +#, fuzzy msgid "" "The deprecation message passed to the decorator is saved in the " "``__deprecated__`` attribute on the decorated object. If applied to an " -"overload, the decorator must be after the :func:`@overload ` decorator for the attribute to exist on the overload as returned " -"by :func:`typing.get_overloads`." +"overload, the decorator must be after the :deco:`~typing.overload` decorator " +"for the attribute to exist on the overload as returned by :func:`typing." +"get_overloads`." msgstr "" "傳遞給裝飾器的棄用訊息會儲存在被裝飾物件的 ``__deprecated__`` 屬性中。如果應" "用於重載,裝飾器必須在 :func:`@overload ` 裝飾器之後,這樣屬" diff --git a/library/xml.po b/library/xml.po index c108ce336b..955410eb6a 100644 --- a/library/xml.po +++ b/library/xml.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-07-07 10:49+0000\n" +"POT-Creation-Date: 2025-09-27 00:13+0000\n" "PO-Revision-Date: 2023-08-21 02:16+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -98,18 +98,19 @@ msgid "" "access local files, generate network connections to other machines, or " "circumvent firewalls." msgstr "" -"攻擊者可以濫用 XML 功能來執行阻斷服務攻擊 (denial of service attack)、存取本地檔案" -"、生成與其他機器的網路連接或繞過防火牆。" +"攻擊者可以濫用 XML 功能來執行阻斷服務攻擊 (denial of service attack)、存取本" +"地檔案、生成與其他機器的網路連接或繞過防火牆。" #: ../../library/xml.rst:58 +#, fuzzy msgid "" -"Expat versions lower that 2.6.0 may be vulnerable to \"billion laughs\", " +"Expat versions lower than 2.6.0 may be vulnerable to \"billion laughs\", " "\"quadratic blowup\" and \"large tokens\". Python may be vulnerable if it " "uses such older versions of Expat as a system-provided library. Check :const:" "`!pyexpat.EXPAT_VERSION`." msgstr "" -"Expat 低於 2.6.0 的版本容易受到「十億笑聲」、「二次爆炸」與「大型 token」的影響。" -"Python 也可能因為使用這些系統提供的舊版 Expat 而易受攻擊。請檢查 :const:" +"Expat 低於 2.6.0 的版本容易受到「十億笑聲」、「二次爆炸」與「大型 token」的影" +"響。Python 也可能因為使用這些系統提供的舊版 Expat 而易受攻擊。請檢查 :const:" "`!pyexpat.EXPAT_VERSION`。" #: ../../library/xml.rst:63 diff --git a/library/zlib.po b/library/zlib.po index 0429d60bb1..fd1e295d7c 100644 --- a/library/zlib.po +++ b/library/zlib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-11 00:14+0000\n" "PO-Revision-Date: 2022-12-28 20:58+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,15 +33,16 @@ msgid "" msgstr "" "對於需要資料壓縮的應用程式,此模組提供了能夠使用 zlib 函式庫進行壓縮和解壓縮" "的函式。zlib 函式庫有自己的主頁 https://www.zlib.net。已知 Python 模組與早於 " -"1.1.3 的 zlib 函式庫版本之間並不相容;1.1.3 存在\\ `安全漏洞 `_,因此我們建議使用 1.1.4 或更新的版本。" +"1.1.3 的 zlib 函式庫版本之間並不相容;1.1.3 存在\\ `安全漏洞 `_,因此我們建議使用 1.1.4 或更新的版本。" #: ../../library/zlib.rst:17 +#, fuzzy msgid "" "zlib's functions have many options and often need to be used in a particular " "order. This documentation doesn't attempt to cover all of the permutations; " -"consult the zlib manual at http://www.zlib.net/manual.html for authoritative " -"information." +"consult the `zlib manual `_ for " +"authoritative information." msgstr "" "zlib 的函式有很多選項,且通常需要按特定順序使用。本文件並不打算解說所有選項排" "列組合的效果;相關官方資訊,請參閱 http://www.zlib.net/manual.html 上的 zlib " @@ -200,13 +201,13 @@ msgstr "" #: ../../library/zlib.rst:108 msgid "" -"*strategy* is used to tune the compression algorithm. Possible values " -"are :const:`Z_DEFAULT_STRATEGY`, :const:`Z_FILTERED`, :const:`Z_HUFFMAN_ONLY`, :const:`Z_RLE` " -"(zlib 1.2.0.1) and :const:`Z_FIXED` (zlib 1.2.2.2)." +"*strategy* is used to tune the compression algorithm. Possible values are :" +"const:`Z_DEFAULT_STRATEGY`, :const:`Z_FILTERED`, :const:`Z_HUFFMAN_ONLY`, :" +"const:`Z_RLE` (zlib 1.2.0.1) and :const:`Z_FIXED` (zlib 1.2.2.2)." msgstr "" -"*strategy* 被用於調整壓縮演算法。可用的值" -"為 :const:`Z_DEFAULT_STRATEGY`、:const:`Z_FILTERED`、:const:`Z_HUFFMAN_ONLY`、:const:`Z_RLE` " -"(zlib 1.2.0.1) 和 :const:`Z_FIXED` (zlib 1.2.2.2)。" +"*strategy* 被用於調整壓縮演算法。可用的值為 :const:`Z_DEFAULT_STRATEGY`、:" +"const:`Z_FILTERED`、:const:`Z_HUFFMAN_ONLY`、:const:`Z_RLE` (zlib 1.2.0.1) " +"和 :const:`Z_FIXED` (zlib 1.2.2.2)。" #: ../../library/zlib.rst:112 msgid "" @@ -215,9 +216,9 @@ msgid "" "to occur frequently in the data that is to be compressed. Those subsequences " "that are expected to be most common should come at the end of the dictionary." msgstr "" -"*zdict* 是事先定義好的的壓縮字典。這是一個位元組序列(例如一" -"個 :class:`bytes` 物件),其中包含預期在要壓縮的資料中頻繁出現的子序列。那些" -"預期會最常見的子序列應該出現在字典的尾末。" +"*zdict* 是事先定義好的的壓縮字典。這是一個位元組序列(例如一個 :class:" +"`bytes` 物件),其中包含預期在要壓縮的資料中頻繁出現的子序列。那些預期會最常" +"見的子序列應該出現在字典的尾末。" #: ../../library/zlib.rst:117 msgid "Added the *zdict* parameter and keyword argument support." @@ -319,8 +320,8 @@ msgid "" "few calls to :c:func:`malloc`." msgstr "" "*bufsize* 是用於保存解壓縮資料的緩衝區的初始大小。如果需要更多空間,緩衝區大" -"小將根據需求來增加,因此你不需要讓該值完全剛好;調整它只會節省幾次" -"對 :c:func:`malloc` 的呼叫。" +"小將根據需求來增加,因此你不需要讓該值完全剛好;調整它只會節省幾次對 :c:func:" +"`malloc` 的呼叫。" #: ../../library/zlib.rst:182 msgid "*wbits* and *bufsize* can be used as keyword arguments." @@ -382,23 +383,23 @@ msgstr "" #: ../../library/zlib.rst:221 msgid "" "All pending input is processed, and a bytes object containing the remaining " -"compressed output is returned. *mode* can be selected from the " -"constants :const:`Z_NO_FLUSH`, :const:`Z_PARTIAL_FLUSH`, :const:`Z_SYNC_FLUSH`, :const:`Z_FULL_FLUSH`, :const:`Z_BLOCK` " -"(zlib 1.2.3.4), or :const:`Z_FINISH`, defaulting to :const:`Z_FINISH`. " -"Except :const:`Z_FINISH`, all constants allow compressing further " -"bytestrings of data, while :const:`Z_FINISH` finishes the compressed stream " -"and prevents compressing any more data. After calling :meth:`flush` with " -"*mode* set to :const:`Z_FINISH`, the :meth:`compress` method cannot be " -"called again; the only realistic action is to delete the object." +"compressed output is returned. *mode* can be selected from the constants :" +"const:`Z_NO_FLUSH`, :const:`Z_PARTIAL_FLUSH`, :const:`Z_SYNC_FLUSH`, :const:" +"`Z_FULL_FLUSH`, :const:`Z_BLOCK` (zlib 1.2.3.4), or :const:`Z_FINISH`, " +"defaulting to :const:`Z_FINISH`. Except :const:`Z_FINISH`, all constants " +"allow compressing further bytestrings of data, while :const:`Z_FINISH` " +"finishes the compressed stream and prevents compressing any more data. " +"After calling :meth:`flush` with *mode* set to :const:`Z_FINISH`, the :meth:" +"`compress` method cannot be called again; the only realistic action is to " +"delete the object." msgstr "" "處理所有待處理的輸入,並回傳包含剩餘壓縮輸出的位元組物件。*mode* 可以從以下常" -"數中選" -"擇::const:`Z_NO_FLUSH`、:const:`Z_PARTIAL_FLUSH`、:const:`Z_SYNC_FLUSH`、:const:`Z_FULL_FLUSH`、:const:`Z_BLOCK` " -"(zlib 1.2.3.4) 或 :const:`Z_FINISH`,預設為 :const:`Z_FINISH`。除" -"了 :const:`Z_FINISH` 之外,所有常數都允許壓縮更多的資料位元組字串," -"而 :const:`Z_FINISH` 會完成壓縮串流並同時防止壓縮更多資料。在 *mode* 設定" -"為 :const:`Z_FINISH` 的情況下呼叫 :meth:`flush` 後,無法再次呼" -"叫 :meth:`compress` 方法;唯一可行的作法是刪除物件。" +"數中選擇::const:`Z_NO_FLUSH`、:const:`Z_PARTIAL_FLUSH`、:const:" +"`Z_SYNC_FLUSH`、:const:`Z_FULL_FLUSH`、:const:`Z_BLOCK` (zlib 1.2.3.4) 或 :" +"const:`Z_FINISH`,預設為 :const:`Z_FINISH`。除了 :const:`Z_FINISH` 之外,所有" +"常數都允許壓縮更多的資料位元組字串,而 :const:`Z_FINISH` 會完成壓縮串流並同時" +"防止壓縮更多資料。在 *mode* 設定為 :const:`Z_FINISH` 的情況下呼叫 :meth:" +"`flush` 後,無法再次呼叫 :meth:`compress` 方法;唯一可行的作法是刪除物件。" #: ../../library/zlib.rst:234 msgid "" @@ -429,12 +430,11 @@ msgstr "" #: ../../library/zlib.rst:256 msgid "" -"A bytes object that contains any data that was not consumed by the " -"last :meth:`decompress` call because it exceeded the limit for the " -"uncompressed data buffer. This data has not yet been seen by the zlib " -"machinery, so you must feed it (possibly with further data concatenated to " -"it) back to a subsequent :meth:`decompress` method call in order to get " -"correct output." +"A bytes object that contains any data that was not consumed by the last :" +"meth:`decompress` call because it exceeded the limit for the uncompressed " +"data buffer. This data has not yet been seen by the zlib machinery, so you " +"must feed it (possibly with further data concatenated to it) back to a " +"subsequent :meth:`decompress` method call in order to get correct output." msgstr "" "一個位元組物件,包含前一次 :meth:`decompress` 的呼叫因超出了未壓縮資料緩衝區" "的限制而沒消耗掉的任何資料。 zlib 機制尚未看到此資料,因此你必須將其(和可能" @@ -457,9 +457,9 @@ msgstr "這使其能夠區分有正確建構的壓縮串流和不完整或被截 msgid "" "Decompress *data*, returning a bytes object containing the uncompressed data " "corresponding to at least part of the data in *string*. This data should be " -"concatenated to the output produced by any preceding calls to " -"the :meth:`decompress` method. Some of the input data may be preserved in " -"internal buffers for later processing." +"concatenated to the output produced by any preceding calls to the :meth:" +"`decompress` method. Some of the input data may be preserved in internal " +"buffers for later processing." msgstr "" "解壓縮 *data* 並回傳一個位元組物件,其包含與 *string* 中至少與部分資料相對應" "的未壓縮資料。此資料應串聯到任何先前呼叫 :meth:`decompress` 方法所產生的輸" @@ -472,14 +472,14 @@ msgid "" "compressed input can be processed; and unconsumed data will be stored in the " "attribute :attr:`unconsumed_tail`. This bytestring must be passed to a " "subsequent call to :meth:`decompress` if decompression is to continue. If " -"*max_length* is zero then the whole input is decompressed, " -"and :attr:`unconsumed_tail` is empty." +"*max_length* is zero then the whole input is decompressed, and :attr:" +"`unconsumed_tail` is empty." msgstr "" "如果可選參數 *max_length* 不是零,則回傳值長度將不超過 *max_length*。這代表著" -"並不是所有的已壓縮輸入都可以被處理;未使用的資料將被儲存在屬" -"性 :attr:`unconsumed_tail` 中。如果要繼續解壓縮,則必須將此位元組字串傳遞給後" -"續對 :meth:`decompress` 的呼叫。如果 *max_length* 為零,則整個輸入會被解壓" -"縮,並且 :attr:`unconsumed_tail` 為空。" +"並不是所有的已壓縮輸入都可以被處理;未使用的資料將被儲存在屬性 :attr:" +"`unconsumed_tail` 中。如果要繼續解壓縮,則必須將此位元組字串傳遞給後續對 :" +"meth:`decompress` 的呼叫。如果 *max_length* 為零,則整個輸入會被解壓縮,並" +"且 :attr:`unconsumed_tail` 為空。" #: ../../library/zlib.rst:289 msgid "*max_length* can be used as a keyword argument." @@ -488,13 +488,13 @@ msgstr "*max_length* 可以用作關鍵字引數。" #: ../../library/zlib.rst:295 msgid "" "All pending input is processed, and a bytes object containing the remaining " -"uncompressed output is returned. After calling :meth:`flush`, " -"the :meth:`decompress` method cannot be called again; the only realistic " -"action is to delete the object." +"uncompressed output is returned. After calling :meth:`flush`, the :meth:" +"`decompress` method cannot be called again; the only realistic action is to " +"delete the object." msgstr "" -"處理所有待處理的輸入,並回傳包含剩餘未壓縮輸出的位元組物件。呼" -"叫 :meth:`flush` 後,無法再次呼叫 :meth:`decompress` 方法;唯一可行的方法是刪" -"除該物件。" +"處理所有待處理的輸入,並回傳包含剩餘未壓縮輸出的位元組物件。呼叫 :meth:" +"`flush` 後,無法再次呼叫 :meth:`decompress` 方法;唯一可行的方法是刪除該物" +"件。" #: ../../library/zlib.rst:300 msgid "" @@ -517,12 +517,127 @@ msgid "" msgstr "於解壓縮物件新增對 :func:`copy.copy` 和 :func:`copy.deepcopy` 支援。" #: ../../library/zlib.rst:315 +#, fuzzy +msgid "" +"The following constants are available to configure compression and " +"decompression behavior:" +msgstr "當壓縮和解壓縮發生錯誤時引發的例外。" + +#: ../../library/zlib.rst:320 +msgid "The deflate compression method." +msgstr "" + +#: ../../library/zlib.rst:325 +msgid "" +"The maximum window size, expressed as a power of 2. For example, if :const:`!" +"MAX_WBITS` is ``15`` it results in a window size of ``32 KiB``." +msgstr "" + +#: ../../library/zlib.rst:332 +msgid "The default memory level for compression objects." +msgstr "" + +#: ../../library/zlib.rst:337 +msgid "The default buffer size for decompression operations." +msgstr "" + +#: ../../library/zlib.rst:342 +msgid "Compression level ``0``." +msgstr "" + +#: ../../library/zlib.rst:349 +msgid "Compression level ``1``." +msgstr "" + +#: ../../library/zlib.rst:354 +msgid "Compression level ``9``." +msgstr "" + +#: ../../library/zlib.rst:359 +msgid "Default compression level (``-1``)." +msgstr "" + +#: ../../library/zlib.rst:364 +msgid "Default compression strategy, for normal data." +msgstr "" + +#: ../../library/zlib.rst:369 +msgid "Compression strategy for data produced by a filter (or predictor)." +msgstr "" + +#: ../../library/zlib.rst:374 +msgid "Compression strategy that forces Huffman coding only." +msgstr "" + +#: ../../library/zlib.rst:379 +msgid "" +"Compression strategy that limits match distances to one (run-length " +"encoding)." +msgstr "" + +#: ../../library/zlib.rst:381 +msgid "" +"This constant is only available if Python was compiled with zlib 1.2.0.1 or " +"greater." +msgstr "" + +#: ../../library/zlib.rst:389 +msgid "Compression strategy that prevents the use of dynamic Huffman codes." +msgstr "" + +#: ../../library/zlib.rst:391 ../../library/zlib.rst:428 +msgid "" +"This constant is only available if Python was compiled with zlib 1.2.2.2 or " +"greater." +msgstr "" + +#: ../../library/zlib.rst:399 +msgid "Flush mode ``0``. No special flushing behavior." +msgstr "" + +#: ../../library/zlib.rst:406 +msgid "Flush mode ``1``. Flush as much output as possible." +msgstr "" + +#: ../../library/zlib.rst:411 +msgid "" +"Flush mode ``2``. All output is flushed and the output is aligned to a byte " +"boundary." +msgstr "" + +#: ../../library/zlib.rst:416 +msgid "" +"Flush mode ``3``. All output is flushed and the compression state is reset." +msgstr "" + +#: ../../library/zlib.rst:421 +msgid "" +"Flush mode ``4``. All pending input is processed, no more input is expected." +msgstr "" + +#: ../../library/zlib.rst:426 +msgid "Flush mode ``5``. A deflate block is completed and emitted." +msgstr "" + +#: ../../library/zlib.rst:436 +msgid "" +"Flush mode ``6``, for inflate operations. Instructs inflate to return when " +"it gets to the next deflate block boundary." +msgstr "" + +#: ../../library/zlib.rst:439 +msgid "" +"This constant is only available if Python was compiled with zlib 1.2.3.4 or " +"greater." +msgstr "" + +#: ../../library/zlib.rst:445 msgid "" "Information about the version of the zlib library in use is available " "through the following constants:" msgstr "有關正在使用的 zlib 函式庫版本資訊可通過以下常數獲得:" -#: ../../library/zlib.rst:321 +#: ../../library/zlib.rst:451 msgid "" "The version string of the zlib library that was used for building the " "module. This may be different from the zlib library actually used at " @@ -531,51 +646,53 @@ msgstr "" "用於建置模組的 zlib 函式庫版本字串。這可能與實際在執行環境 (runtime) 使用的 " "zlib 函式庫不同,後者以 :const:`ZLIB_RUNTIME_VERSION` 提供。" -#: ../../library/zlib.rst:328 +#: ../../library/zlib.rst:458 msgid "" "The version string of the zlib library actually loaded by the interpreter." msgstr "直譯器實際載入的 zlib 函式庫版本字串。" -#: ../../library/zlib.rst:335 +#: ../../library/zlib.rst:465 msgid "" "The version string of the zlib-ng library that was used for building the " -"module if zlib-ng was used. When present, the :data:`ZLIB_VERSION` " -"and :data:`ZLIB_RUNTIME_VERSION` constants reflect the version of the zlib " -"API provided by zlib-ng." +"module if zlib-ng was used. When present, the :data:`ZLIB_VERSION` and :data:" +"`ZLIB_RUNTIME_VERSION` constants reflect the version of the zlib API " +"provided by zlib-ng." msgstr "" -#: ../../library/zlib.rst:340 +#: ../../library/zlib.rst:470 msgid "" "If zlib-ng was not used to build the module, this constant will be absent." msgstr "" -#: ../../library/zlib.rst:347 +#: ../../library/zlib.rst:477 msgid "Module :mod:`gzip`" msgstr ":mod:`gzip` 模組" -#: ../../library/zlib.rst:348 +#: ../../library/zlib.rst:478 msgid "Reading and writing :program:`gzip`\\ -format files." msgstr "讀寫 :program:`gzip` 格式的檔案。" -#: ../../library/zlib.rst:350 -msgid "http://www.zlib.net" +#: ../../library/zlib.rst:480 +#, fuzzy +msgid "https://www.zlib.net" msgstr "http://www.zlib.net" -#: ../../library/zlib.rst:351 +#: ../../library/zlib.rst:481 msgid "The zlib library home page." msgstr "zlib 函式庫首頁。" -#: ../../library/zlib.rst:353 -msgid "http://www.zlib.net/manual.html" +#: ../../library/zlib.rst:483 +#, fuzzy +msgid "https://www.zlib.net/manual.html" msgstr "http://www.zlib.net/manual.html" -#: ../../library/zlib.rst:354 +#: ../../library/zlib.rst:484 msgid "" "The zlib manual explains the semantics and usage of the library's many " "functions." msgstr "zlib 手冊解釋了函式庫中許多函式的語義和用法。" -#: ../../library/zlib.rst:357 +#: ../../library/zlib.rst:487 msgid "" "In case gzip (de)compression is a bottleneck, the `python-isal`_ package " "speeds up (de)compression with a mostly compatible API." diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 1639615084..b2c36591f3 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2025-06-21 20:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -563,14 +563,14 @@ msgid "The behavior of a ``ZoneInfo`` file depends on how it was constructed:" msgstr "``ZoneInfo`` 檔案的行為取決於它的建構方式:" #: ../../library/zoneinfo.rst:299 +#, fuzzy msgid "" "``ZoneInfo(key)``: When constructed with the primary constructor, a " "``ZoneInfo`` object is serialized by key, and when deserialized, the " "deserializing process uses the primary and thus it is expected that these " -"are expected to be the same object as other references to the same time " -"zone. For example, if ``europe_berlin_pkl`` is a string containing a pickle " -"constructed from ``ZoneInfo(\"Europe/Berlin\")``, one would expect the " -"following behavior:" +"are the same object as other references to the same time zone. For example, " +"if ``europe_berlin_pkl`` is a string containing a pickle constructed from " +"``ZoneInfo(\"Europe/Berlin\")``, one would expect the following behavior:" msgstr "" "``ZoneInfo(key)``:當使用主要建構函式建構時,``ZoneInfo`` 物件會按鍵序列化," "而在去序列化時,去序列化過程會使用主要建構函式,因此預期這些物件會與指向相同" @@ -624,10 +624,10 @@ msgid "" "serializing by key or storing the contents of the file object and " "serializing that." msgstr "" -"``ZoneInfo.from_file(file_obj, /, key=None)``:當從檔案建構時,``ZoneInfo`` 物件" -"在封裝時會引發例外。如果終端使用者想要封裝一個從檔案建構的 ``ZoneInfo``,建議" -"他們使用包裝器型別或自訂序列化函式:可以按鍵序列化,或儲存檔案物件的內容並將" -"其序列化。" +"``ZoneInfo.from_file(file_obj, /, key=None)``:當從檔案建構時,``ZoneInfo`` " +"物件在封裝時會引發例外。如果終端使用者想要封裝一個從檔案建構的 ``ZoneInfo``," +"建議他們使用包裝器型別或自訂序列化函式:可以按鍵序列化,或儲存檔案物件的內容" +"並將其序列化。" #: ../../library/zoneinfo.rst:334 msgid "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 1d7fd59b4b..883b72c05d 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+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-" @@ -363,19 +363,40 @@ msgstr ":keyword:`!except*` 子句" #: ../../reference/compound_stmts.rst:338 msgid "" -"The :keyword:`!except*` clause(s) are used for handling :exc:" -"`ExceptionGroup`\\s. The exception type for matching is interpreted as in " -"the case of :keyword:`except`, but in the case of exception groups we can " -"have partial matches when the type matches some of the exceptions in the " -"group. This means that multiple :keyword:`!except*` clauses can execute, " -"each handling part of the exception group. Each clause executes at most once " -"and handles an exception group of all matching exceptions. Each exception " -"in the group is handled by at most one :keyword:`!except*` clause, the first " -"that matches it. ::" +"The :keyword:`!except*` clause(s) specify one or more handlers for groups of " +"exceptions (:exc:`BaseExceptionGroup` instances). A :keyword:`try` statement " +"can have either :keyword:`except` or :keyword:`!except*` clauses, but not " +"both. The exception type for matching is mandatory in the case of :keyword:`!" +"except*`, so ``except*:`` is a syntax error. The type is interpreted as in " +"the case of :keyword:`!except`, but matching is performed on the exceptions " +"contained in the group that is being handled. An :exc:`TypeError` is raised " +"if a matching type is a subclass of :exc:`!BaseExceptionGroup`, because that " +"would have ambiguous semantics." msgstr "" #: ../../reference/compound_stmts.rst:348 msgid "" +"When an exception group is raised in the try block, each :keyword:`!except*` " +"clause splits (see :meth:`~BaseExceptionGroup.split`) it into the subgroups " +"of matching and non-matching exceptions. If the matching subgroup is not " +"empty, it becomes the handled exception (the value returned from :func:`sys." +"exception`) and assigned to the target of the :keyword:`!except*` clause (if " +"there is one). Then, the body of the :keyword:`!except*` clause executes. If " +"the non-matching subgroup is not empty, it is processed by the next :keyword:" +"`!except*` in the same manner. This continues until all exceptions in the " +"group have been matched, or the last :keyword:`!except*` clause has run." +msgstr "" + +#: ../../reference/compound_stmts.rst:358 +msgid "" +"After all :keyword:`!except*` clauses execute, the group of unhandled " +"exceptions is merged with any exceptions that were raised or re-raised from " +"within :keyword:`!except*` clauses. This merged exception group propagates " +"on.::" +msgstr "" + +#: ../../reference/compound_stmts.rst:362 +msgid "" ">>> try:\n" "... raise ExceptionGroup(\"eg\",\n" "... [ValueError(1), TypeError(2), OSError(3), OSError(4)])\n" @@ -387,29 +408,25 @@ msgid "" "caught with nested (TypeError(2),)\n" "caught with nested (OSError(3), OSError(4))\n" " + Exception Group Traceback (most recent call last):\n" -" | File \"\", line 2, in \n" -" | ExceptionGroup: eg\n" +" | File \"\", line 2, in \n" +" | raise ExceptionGroup(\"eg\",\n" +" | [ValueError(1), TypeError(2), OSError(3), OSError(4)])\n" +" | ExceptionGroup: eg (1 sub-exception)\n" " +-+---------------- 1 ----------------\n" " | ValueError: 1\n" " +------------------------------------" msgstr "" -#: ../../reference/compound_stmts.rst:366 -msgid "" -"Any remaining exceptions that were not handled by any :keyword:`!except*` " -"clause are re-raised at the end, along with all exceptions that were raised " -"from within the :keyword:`!except*` clauses. If this list contains more than " -"one exception to reraise, they are combined into an exception group." -msgstr "" - -#: ../../reference/compound_stmts.rst:372 +#: ../../reference/compound_stmts.rst:381 msgid "" -"If the raised exception is not an exception group and its type matches one " -"of the :keyword:`!except*` clauses, it is caught and wrapped by an exception " -"group with an empty message string. ::" +"If the exception raised from the :keyword:`try` block is not an exception " +"group and its type matches one of the :keyword:`!except*` clauses, it is " +"caught and wrapped by an exception group with an empty message string. This " +"ensures that the type of the target ``e`` is consistently :exc:" +"`BaseExceptionGroup`::" msgstr "" -#: ../../reference/compound_stmts.rst:376 +#: ../../reference/compound_stmts.rst:386 msgid "" ">>> try:\n" "... raise BlockingIOError\n" @@ -425,25 +442,17 @@ msgstr "" "...\n" "ExceptionGroup('', (BlockingIOError()))" -#: ../../reference/compound_stmts.rst:383 -msgid "" -"An :keyword:`!except*` clause must have a matching expression; it cannot be " -"``except*:``. Furthermore, this expression cannot contain exception group " -"types, because that would have ambiguous semantics." -msgstr "" - -#: ../../reference/compound_stmts.rst:387 +#: ../../reference/compound_stmts.rst:393 msgid "" -"It is not possible to mix :keyword:`except` and :keyword:`!except*` in the " -"same :keyword:`try`. The :keyword:`break`, :keyword:`continue`, and :keyword:" -"`return` statements cannot appear in an :keyword:`!except*` clause." +":keyword:`break`, :keyword:`continue` and :keyword:`return` cannot appear in " +"an :keyword:`!except*` clause." msgstr "" -#: ../../reference/compound_stmts.rst:402 +#: ../../reference/compound_stmts.rst:406 msgid ":keyword:`!else` clause" msgstr ":keyword:`!else` 子句" -#: ../../reference/compound_stmts.rst:404 +#: ../../reference/compound_stmts.rst:408 msgid "" "The optional :keyword:`!else` clause is executed if the control flow leaves " "the :keyword:`try` suite, no exception was raised, and no :keyword:" @@ -452,11 +461,11 @@ msgid "" "keyword:`except` clauses." msgstr "" -#: ../../reference/compound_stmts.rst:416 +#: ../../reference/compound_stmts.rst:420 msgid ":keyword:`!finally` clause" msgstr ":keyword:`!finally` 子句" -#: ../../reference/compound_stmts.rst:418 +#: ../../reference/compound_stmts.rst:422 msgid "" "If :keyword:`!finally` is present, it specifies a 'cleanup' handler. The :" "keyword:`try` clause is executed, including any :keyword:`except` and :" @@ -470,7 +479,7 @@ msgid "" "saved exception is discarded. For example, this function returns 42." msgstr "" -#: ../../reference/compound_stmts.rst:431 +#: ../../reference/compound_stmts.rst:435 msgid "" "def f():\n" " try:\n" @@ -484,13 +493,13 @@ msgstr "" " finally:\n" " return 42" -#: ../../reference/compound_stmts.rst:439 +#: ../../reference/compound_stmts.rst:443 msgid "" "The exception information is not available to the program during execution " "of the :keyword:`!finally` clause." msgstr "" -#: ../../reference/compound_stmts.rst:447 +#: ../../reference/compound_stmts.rst:451 msgid "" "When a :keyword:`return`, :keyword:`break` or :keyword:`continue` statement " "is executed in the :keyword:`try` suite of a :keyword:`!try`...\\ :keyword:`!" @@ -498,7 +507,7 @@ msgid "" "way out.'" msgstr "" -#: ../../reference/compound_stmts.rst:451 +#: ../../reference/compound_stmts.rst:455 msgid "" "The return value of a function is determined by the last :keyword:`return` " "statement executed. Since the :keyword:`!finally` clause always executes, " @@ -507,7 +516,7 @@ msgid "" "'finally'." msgstr "" -#: ../../reference/compound_stmts.rst:456 +#: ../../reference/compound_stmts.rst:460 msgid "" "def foo():\n" " try:\n" @@ -521,24 +530,24 @@ msgstr "" " finally:\n" " return 'finally'" -#: ../../reference/compound_stmts.rst:464 +#: ../../reference/compound_stmts.rst:468 msgid "" "Prior to Python 3.8, a :keyword:`continue` statement was illegal in the :" "keyword:`!finally` clause due to a problem with the implementation." msgstr "" -#: ../../reference/compound_stmts.rst:468 +#: ../../reference/compound_stmts.rst:472 msgid "" "The compiler emits a :exc:`SyntaxWarning` when a :keyword:`return`, :keyword:" "`break` or :keyword:`continue` appears in a :keyword:`!finally` block (see :" "pep:`765`)." msgstr "" -#: ../../reference/compound_stmts.rst:478 +#: ../../reference/compound_stmts.rst:482 msgid "The :keyword:`!with` statement" msgstr ":keyword:`!with` 陳述式" -#: ../../reference/compound_stmts.rst:487 +#: ../../reference/compound_stmts.rst:491 msgid "" "The :keyword:`with` statement is used to wrap the execution of a block with " "methods defined by a context manager (see section :ref:`context-managers`). " @@ -546,38 +555,38 @@ msgid "" "`finally` usage patterns to be encapsulated for convenient reuse." msgstr "" -#: ../../reference/compound_stmts.rst:497 +#: ../../reference/compound_stmts.rst:501 msgid "" "The execution of the :keyword:`with` statement with one \"item\" proceeds as " "follows:" msgstr "" -#: ../../reference/compound_stmts.rst:499 +#: ../../reference/compound_stmts.rst:503 msgid "" "The context expression (the expression given in the :token:`~python-grammar:" "with_item`) is evaluated to obtain a context manager." msgstr "" -#: ../../reference/compound_stmts.rst:502 +#: ../../reference/compound_stmts.rst:506 msgid "" "The context manager's :meth:`~object.__enter__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:504 +#: ../../reference/compound_stmts.rst:508 msgid "The context manager's :meth:`~object.__exit__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:506 +#: ../../reference/compound_stmts.rst:510 msgid "The context manager's :meth:`~object.__enter__` method is invoked." msgstr "" -#: ../../reference/compound_stmts.rst:508 +#: ../../reference/compound_stmts.rst:512 msgid "" "If a target was included in the :keyword:`with` statement, the return value " "from :meth:`~object.__enter__` is assigned to it." msgstr "" -#: ../../reference/compound_stmts.rst:513 +#: ../../reference/compound_stmts.rst:517 msgid "" "The :keyword:`with` statement guarantees that if the :meth:`~object." "__enter__` method returns without an error, then :meth:`~object.__exit__` " @@ -586,11 +595,11 @@ msgid "" "suite would be. See step 7 below." msgstr "" -#: ../../reference/compound_stmts.rst:519 +#: ../../reference/compound_stmts.rst:523 msgid "The suite is executed." msgstr "" -#: ../../reference/compound_stmts.rst:521 +#: ../../reference/compound_stmts.rst:525 msgid "" "The context manager's :meth:`~object.__exit__` method is invoked. If an " "exception caused the suite to be exited, its type, value, and traceback are " @@ -598,7 +607,7 @@ msgid "" "`None` arguments are supplied." msgstr "" -#: ../../reference/compound_stmts.rst:526 +#: ../../reference/compound_stmts.rst:530 msgid "" "If the suite was exited due to an exception, and the return value from the :" "meth:`~object.__exit__` method was false, the exception is reraised. If the " @@ -606,20 +615,20 @@ msgid "" "with the statement following the :keyword:`with` statement." msgstr "" -#: ../../reference/compound_stmts.rst:531 +#: ../../reference/compound_stmts.rst:535 msgid "" "If the suite was exited for any reason other than an exception, the return " "value from :meth:`~object.__exit__` is ignored, and execution proceeds at " "the normal location for the kind of exit that was taken." msgstr "" -#: ../../reference/compound_stmts.rst:535 -#: ../../reference/compound_stmts.rst:1552 -#: ../../reference/compound_stmts.rst:1593 +#: ../../reference/compound_stmts.rst:539 +#: ../../reference/compound_stmts.rst:1557 +#: ../../reference/compound_stmts.rst:1598 msgid "The following code::" msgstr "以下程式碼: ::" -#: ../../reference/compound_stmts.rst:537 +#: ../../reference/compound_stmts.rst:541 msgid "" "with EXPRESSION as TARGET:\n" " SUITE" @@ -627,13 +636,13 @@ msgstr "" "with EXPRESSION as TARGET:\n" " SUITE" -#: ../../reference/compound_stmts.rst:540 -#: ../../reference/compound_stmts.rst:565 -#: ../../reference/compound_stmts.rst:1598 +#: ../../reference/compound_stmts.rst:544 +#: ../../reference/compound_stmts.rst:569 +#: ../../reference/compound_stmts.rst:1603 msgid "is semantically equivalent to::" msgstr "在語義上等同於: ::" -#: ../../reference/compound_stmts.rst:542 +#: ../../reference/compound_stmts.rst:546 msgid "" "manager = (EXPRESSION)\n" "enter = type(manager).__enter__\n" @@ -669,13 +678,13 @@ msgstr "" " if not hit_except:\n" " exit(manager, None, None, None)" -#: ../../reference/compound_stmts.rst:559 +#: ../../reference/compound_stmts.rst:563 msgid "" "With more than one item, the context managers are processed as if multiple :" "keyword:`with` statements were nested::" msgstr "" -#: ../../reference/compound_stmts.rst:562 +#: ../../reference/compound_stmts.rst:566 msgid "" "with A() as a, B() as b:\n" " SUITE" @@ -683,7 +692,7 @@ msgstr "" "with A() as a, B() as b:\n" " SUITE" -#: ../../reference/compound_stmts.rst:567 +#: ../../reference/compound_stmts.rst:571 msgid "" "with A() as a:\n" " with B() as b:\n" @@ -693,13 +702,13 @@ msgstr "" " with B() as b:\n" " SUITE" -#: ../../reference/compound_stmts.rst:571 +#: ../../reference/compound_stmts.rst:575 msgid "" "You can also write multi-item context managers in multiple lines if the " "items are surrounded by parentheses. For example::" msgstr "" -#: ../../reference/compound_stmts.rst:574 +#: ../../reference/compound_stmts.rst:578 msgid "" "with (\n" " A() as a,\n" @@ -713,88 +722,88 @@ msgstr "" "):\n" " SUITE" -#: ../../reference/compound_stmts.rst:580 +#: ../../reference/compound_stmts.rst:584 msgid "Support for multiple context expressions." msgstr "" -#: ../../reference/compound_stmts.rst:583 +#: ../../reference/compound_stmts.rst:587 msgid "" "Support for using grouping parentheses to break the statement in multiple " "lines." msgstr "" -#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:592 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/compound_stmts.rst:589 +#: ../../reference/compound_stmts.rst:593 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/compound_stmts.rst:595 +#: ../../reference/compound_stmts.rst:600 msgid "The :keyword:`!match` statement" msgstr ":keyword:`!match` 陳述式" -#: ../../reference/compound_stmts.rst:609 +#: ../../reference/compound_stmts.rst:614 msgid "The match statement is used for pattern matching. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:618 +#: ../../reference/compound_stmts.rst:623 msgid "" "This section uses single quotes to denote :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:621 +#: ../../reference/compound_stmts.rst:626 msgid "" "Pattern matching takes a pattern as input (following ``case``) and a subject " "value (following ``match``). The pattern (which may contain subpatterns) is " "matched against the subject value. The outcomes are:" msgstr "" -#: ../../reference/compound_stmts.rst:625 +#: ../../reference/compound_stmts.rst:630 msgid "A match success or failure (also termed a pattern success or failure)." msgstr "" -#: ../../reference/compound_stmts.rst:627 +#: ../../reference/compound_stmts.rst:632 msgid "" "Possible binding of matched values to a name. The prerequisites for this " "are further discussed below." msgstr "" -#: ../../reference/compound_stmts.rst:630 +#: ../../reference/compound_stmts.rst:635 msgid "" "The ``match`` and ``case`` keywords are :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:634 -#: ../../reference/compound_stmts.rst:1191 +#: ../../reference/compound_stmts.rst:639 +#: ../../reference/compound_stmts.rst:1196 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../reference/compound_stmts.rst:635 -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:640 +#: ../../reference/compound_stmts.rst:1197 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" msgstr "" -#: ../../reference/compound_stmts.rst:639 +#: ../../reference/compound_stmts.rst:644 msgid "Overview" msgstr "" -#: ../../reference/compound_stmts.rst:641 +#: ../../reference/compound_stmts.rst:646 msgid "Here's an overview of the logical flow of a match statement:" msgstr "" -#: ../../reference/compound_stmts.rst:644 +#: ../../reference/compound_stmts.rst:649 msgid "" "The subject expression ``subject_expr`` is evaluated and a resulting subject " "value obtained. If the subject expression contains a comma, a tuple is " "constructed using :ref:`the standard rules `." msgstr "" -#: ../../reference/compound_stmts.rst:648 +#: ../../reference/compound_stmts.rst:653 msgid "" "Each pattern in a ``case_block`` is attempted to match with the subject " "value. The specific rules for success or failure are described below. The " @@ -804,7 +813,7 @@ msgid "" "outlive the executed block and can be used after the match statement**." msgstr "" -#: ../../reference/compound_stmts.rst:657 +#: ../../reference/compound_stmts.rst:662 msgid "" "During failed pattern matches, some subpatterns may succeed. Do not rely on " "bindings being made for a failed match. Conversely, do not rely on " @@ -813,38 +822,38 @@ msgid "" "made to allow different implementations to add optimizations." msgstr "" -#: ../../reference/compound_stmts.rst:664 +#: ../../reference/compound_stmts.rst:669 msgid "" "If the pattern succeeds, the corresponding guard (if present) is evaluated. " "In this case all name bindings are guaranteed to have happened." msgstr "" -#: ../../reference/compound_stmts.rst:667 +#: ../../reference/compound_stmts.rst:672 msgid "" "If the guard evaluates as true or is missing, the ``block`` inside " "``case_block`` is executed." msgstr "" -#: ../../reference/compound_stmts.rst:670 +#: ../../reference/compound_stmts.rst:675 msgid "Otherwise, the next ``case_block`` is attempted as described above." msgstr "" -#: ../../reference/compound_stmts.rst:672 +#: ../../reference/compound_stmts.rst:677 msgid "If there are no further case blocks, the match statement is completed." msgstr "" -#: ../../reference/compound_stmts.rst:676 +#: ../../reference/compound_stmts.rst:681 msgid "" "Users should generally never rely on a pattern being evaluated. Depending " "on implementation, the interpreter may cache values or use other " "optimizations which skip repeated evaluations." msgstr "" -#: ../../reference/compound_stmts.rst:680 +#: ../../reference/compound_stmts.rst:685 msgid "A sample match statement::" msgstr "" -#: ../../reference/compound_stmts.rst:682 +#: ../../reference/compound_stmts.rst:687 msgid "" ">>> flag = False\n" ">>> match (100, 200):\n" @@ -860,56 +869,56 @@ msgid "" "Case 3, y: 200" msgstr "" -#: ../../reference/compound_stmts.rst:696 +#: ../../reference/compound_stmts.rst:701 msgid "" "In this case, ``if flag`` is a guard. Read more about that in the next " "section." msgstr "" -#: ../../reference/compound_stmts.rst:699 +#: ../../reference/compound_stmts.rst:704 msgid "Guards" msgstr "" -#: ../../reference/compound_stmts.rst:706 +#: ../../reference/compound_stmts.rst:711 msgid "" "A ``guard`` (which is part of the ``case``) must succeed for code inside the " "``case`` block to execute. It takes the form: :keyword:`if` followed by an " "expression." msgstr "" -#: ../../reference/compound_stmts.rst:711 +#: ../../reference/compound_stmts.rst:716 msgid "The logical flow of a ``case`` block with a ``guard`` follows:" msgstr "" -#: ../../reference/compound_stmts.rst:713 +#: ../../reference/compound_stmts.rst:718 msgid "" "Check that the pattern in the ``case`` block succeeded. If the pattern " "failed, the ``guard`` is not evaluated and the next ``case`` block is " "checked." msgstr "" -#: ../../reference/compound_stmts.rst:717 +#: ../../reference/compound_stmts.rst:722 msgid "If the pattern succeeded, evaluate the ``guard``." msgstr "" -#: ../../reference/compound_stmts.rst:719 +#: ../../reference/compound_stmts.rst:724 msgid "" "If the ``guard`` condition evaluates as true, the case block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:722 +#: ../../reference/compound_stmts.rst:727 msgid "" "If the ``guard`` condition evaluates as false, the case block is not " "selected." msgstr "" -#: ../../reference/compound_stmts.rst:725 +#: ../../reference/compound_stmts.rst:730 msgid "" "If the ``guard`` raises an exception during evaluation, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:728 +#: ../../reference/compound_stmts.rst:733 msgid "" "Guards are allowed to have side effects as they are expressions. Guard " "evaluation must proceed from the first to the last case block, one at a " @@ -918,17 +927,17 @@ msgid "" "block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:738 +#: ../../reference/compound_stmts.rst:743 msgid "Irrefutable Case Blocks" msgstr "" -#: ../../reference/compound_stmts.rst:742 +#: ../../reference/compound_stmts.rst:747 msgid "" "An irrefutable case block is a match-all case block. A match statement may " "have at most one irrefutable case block, and it must be last." msgstr "" -#: ../../reference/compound_stmts.rst:745 +#: ../../reference/compound_stmts.rst:750 msgid "" "A case block is considered irrefutable if it has no guard and its pattern is " "irrefutable. A pattern is considered irrefutable if we can prove from its " @@ -936,47 +945,47 @@ msgid "" "irrefutable:" msgstr "" -#: ../../reference/compound_stmts.rst:750 +#: ../../reference/compound_stmts.rst:755 msgid ":ref:`as-patterns` whose left-hand side is irrefutable" msgstr "" -#: ../../reference/compound_stmts.rst:752 +#: ../../reference/compound_stmts.rst:757 msgid ":ref:`or-patterns` containing at least one irrefutable pattern" msgstr "" -#: ../../reference/compound_stmts.rst:754 +#: ../../reference/compound_stmts.rst:759 msgid ":ref:`capture-patterns`" msgstr ":ref:`capture-patterns`" -#: ../../reference/compound_stmts.rst:756 +#: ../../reference/compound_stmts.rst:761 msgid ":ref:`wildcard-patterns`" msgstr ":ref:`wildcard-patterns`" -#: ../../reference/compound_stmts.rst:758 +#: ../../reference/compound_stmts.rst:763 msgid "parenthesized irrefutable patterns" msgstr "" -#: ../../reference/compound_stmts.rst:762 +#: ../../reference/compound_stmts.rst:767 msgid "Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:769 +#: ../../reference/compound_stmts.rst:774 msgid "This section uses grammar notations beyond standard EBNF:" msgstr "" -#: ../../reference/compound_stmts.rst:771 +#: ../../reference/compound_stmts.rst:776 msgid "the notation ``SEP.RULE+`` is shorthand for ``RULE (SEP RULE)*``" msgstr "" -#: ../../reference/compound_stmts.rst:773 +#: ../../reference/compound_stmts.rst:778 msgid "the notation ``!RULE`` is shorthand for a negative lookahead assertion" msgstr "" -#: ../../reference/compound_stmts.rst:776 +#: ../../reference/compound_stmts.rst:781 msgid "The top-level syntax for ``patterns`` is:" msgstr "" -#: ../../reference/compound_stmts.rst:790 +#: ../../reference/compound_stmts.rst:795 msgid "" "The descriptions below will include a description \"in simple terms\" of " "what a pattern does for illustration purposes (credits to Raymond Hettinger " @@ -986,70 +995,70 @@ msgid "" "forms." msgstr "" -#: ../../reference/compound_stmts.rst:800 +#: ../../reference/compound_stmts.rst:805 msgid "OR Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:802 +#: ../../reference/compound_stmts.rst:807 msgid "" "An OR pattern is two or more patterns separated by vertical bars ``|``. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:808 +#: ../../reference/compound_stmts.rst:813 msgid "" "Only the final subpattern may be :ref:`irrefutable `, and " "each subpattern must bind the same set of names to avoid ambiguity." msgstr "" -#: ../../reference/compound_stmts.rst:811 +#: ../../reference/compound_stmts.rst:816 msgid "" "An OR pattern matches each of its subpatterns in turn to the subject value, " "until one succeeds. The OR pattern is then considered successful. " "Otherwise, if none of the subpatterns succeed, the OR pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:815 +#: ../../reference/compound_stmts.rst:820 msgid "" "In simple terms, ``P1 | P2 | ...`` will try to match ``P1``, if it fails it " "will try to match ``P2``, succeeding immediately if any succeeds, failing " "otherwise." msgstr "" -#: ../../reference/compound_stmts.rst:821 +#: ../../reference/compound_stmts.rst:826 msgid "AS Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:823 +#: ../../reference/compound_stmts.rst:828 msgid "" "An AS pattern matches an OR pattern on the left of the :keyword:`as` keyword " "against a subject. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:829 +#: ../../reference/compound_stmts.rst:834 msgid "" "If the OR pattern fails, the AS pattern fails. Otherwise, the AS pattern " "binds the subject to the name on the right of the as keyword and succeeds. " "``capture_pattern`` cannot be a ``_``." msgstr "" -#: ../../reference/compound_stmts.rst:833 +#: ../../reference/compound_stmts.rst:838 msgid "" "In simple terms ``P as NAME`` will match with ``P``, and on success it will " "set ``NAME = ``." msgstr "" -#: ../../reference/compound_stmts.rst:840 +#: ../../reference/compound_stmts.rst:845 msgid "Literal Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:842 +#: ../../reference/compound_stmts.rst:847 msgid "" "A literal pattern corresponds to most :ref:`literals ` in Python. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:855 +#: ../../reference/compound_stmts.rst:860 msgid "" "The rule ``strings`` and the token ``NUMBER`` are defined in the :doc:" "`standard Python grammar <./grammar>`. Triple-quoted strings are " @@ -1057,42 +1066,42 @@ msgid "" "and :ref:`t-strings` are not supported." msgstr "" -#: ../../reference/compound_stmts.rst:860 +#: ../../reference/compound_stmts.rst:865 msgid "" "The forms ``signed_number '+' NUMBER`` and ``signed_number '-' NUMBER`` are " "for expressing :ref:`complex numbers `; they require a real " "number on the left and an imaginary number on the right. E.g. ``3 + 4j``." msgstr "" -#: ../../reference/compound_stmts.rst:864 +#: ../../reference/compound_stmts.rst:869 msgid "" "In simple terms, ``LITERAL`` will succeed only if `` == LITERAL``. " "For the singletons ``None``, ``True`` and ``False``, the :keyword:`is` " "operator is used." msgstr "" -#: ../../reference/compound_stmts.rst:870 +#: ../../reference/compound_stmts.rst:875 msgid "Capture Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:872 +#: ../../reference/compound_stmts.rst:877 msgid "A capture pattern binds the subject value to a name. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:878 +#: ../../reference/compound_stmts.rst:883 msgid "" "A single underscore ``_`` is not a capture pattern (this is what ``!'_'`` " "expresses). It is instead treated as a :token:`~python-grammar:" "wildcard_pattern`." msgstr "" -#: ../../reference/compound_stmts.rst:882 +#: ../../reference/compound_stmts.rst:887 msgid "" "In a given pattern, a given name can only be bound once. E.g. ``case x, " "x: ...`` is invalid while ``case [x] | x: ...`` is allowed." msgstr "" -#: ../../reference/compound_stmts.rst:885 +#: ../../reference/compound_stmts.rst:890 msgid "" "Capture patterns always succeed. The binding follows scoping rules " "established by the assignment expression operator in :pep:`572`; the name " @@ -1100,55 +1109,55 @@ msgid "" "there's an applicable :keyword:`global` or :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/compound_stmts.rst:890 +#: ../../reference/compound_stmts.rst:895 msgid "" "In simple terms ``NAME`` will always succeed and it will set ``NAME = " "``." msgstr "" -#: ../../reference/compound_stmts.rst:895 +#: ../../reference/compound_stmts.rst:900 msgid "Wildcard Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:897 +#: ../../reference/compound_stmts.rst:902 msgid "" "A wildcard pattern always succeeds (matches anything) and binds no name. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:903 +#: ../../reference/compound_stmts.rst:908 msgid "" "``_`` is a :ref:`soft keyword ` within any pattern, but only " "within patterns. It is an identifier, as usual, even within ``match`` " "subject expressions, ``guard``\\ s, and ``case`` blocks." msgstr "" -#: ../../reference/compound_stmts.rst:907 +#: ../../reference/compound_stmts.rst:912 msgid "In simple terms, ``_`` will always succeed." msgstr "" -#: ../../reference/compound_stmts.rst:912 +#: ../../reference/compound_stmts.rst:917 msgid "Value Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:914 +#: ../../reference/compound_stmts.rst:919 msgid "A value pattern represents a named value in Python. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:922 +#: ../../reference/compound_stmts.rst:927 msgid "" "The dotted name in the pattern is looked up using standard Python :ref:`name " "resolution rules `. The pattern succeeds if the value found " "compares equal to the subject value (using the ``==`` equality operator)." msgstr "" -#: ../../reference/compound_stmts.rst:927 +#: ../../reference/compound_stmts.rst:932 msgid "" "In simple terms ``NAME1.NAME2`` will succeed only if `` == NAME1." "NAME2``" msgstr "" -#: ../../reference/compound_stmts.rst:931 +#: ../../reference/compound_stmts.rst:936 msgid "" "If the same value occurs multiple times in the same match statement, the " "interpreter may cache the first value found and reuse it rather than repeat " @@ -1156,44 +1165,44 @@ msgid "" "given match statement." msgstr "" -#: ../../reference/compound_stmts.rst:939 +#: ../../reference/compound_stmts.rst:944 msgid "Group Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:941 +#: ../../reference/compound_stmts.rst:946 msgid "" "A group pattern allows users to add parentheses around patterns to emphasize " "the intended grouping. Otherwise, it has no additional syntax. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:948 +#: ../../reference/compound_stmts.rst:953 msgid "In simple terms ``(P)`` has the same effect as ``P``." msgstr "" -#: ../../reference/compound_stmts.rst:953 +#: ../../reference/compound_stmts.rst:958 msgid "Sequence Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:955 +#: ../../reference/compound_stmts.rst:960 msgid "" "A sequence pattern contains several subpatterns to be matched against " "sequence elements. The syntax is similar to the unpacking of a list or tuple." msgstr "" -#: ../../reference/compound_stmts.rst:966 +#: ../../reference/compound_stmts.rst:971 msgid "" "There is no difference if parentheses or square brackets are used for " "sequence patterns (i.e. ``(...)`` vs ``[...]`` )." msgstr "" -#: ../../reference/compound_stmts.rst:970 +#: ../../reference/compound_stmts.rst:975 msgid "" "A single pattern enclosed in parentheses without a trailing comma (e.g. ``(3 " "| 4)``) is a :ref:`group pattern `. While a single pattern " "enclosed in square brackets (e.g. ``[3 | 4]``) is still a sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:975 +#: ../../reference/compound_stmts.rst:980 msgid "" "At most one star subpattern may be in a sequence pattern. The star " "subpattern may occur in any position. If no star subpattern is present, the " @@ -1201,40 +1210,40 @@ msgid "" "variable-length sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:980 +#: ../../reference/compound_stmts.rst:985 msgid "" "The following is the logical flow for matching a sequence pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:983 +#: ../../reference/compound_stmts.rst:988 msgid "" "If the subject value is not a sequence [#]_, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:986 +#: ../../reference/compound_stmts.rst:991 msgid "" "If the subject value is an instance of ``str``, ``bytes`` or ``bytearray`` " "the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:989 +#: ../../reference/compound_stmts.rst:994 msgid "" "The subsequent steps depend on whether the sequence pattern is fixed or " "variable-length." msgstr "" -#: ../../reference/compound_stmts.rst:992 +#: ../../reference/compound_stmts.rst:997 msgid "If the sequence pattern is fixed-length:" msgstr "" -#: ../../reference/compound_stmts.rst:994 +#: ../../reference/compound_stmts.rst:999 msgid "" "If the length of the subject sequence is not equal to the number of " "subpatterns, the sequence pattern fails" msgstr "" -#: ../../reference/compound_stmts.rst:997 +#: ../../reference/compound_stmts.rst:1002 msgid "" "Subpatterns in the sequence pattern are matched to their corresponding items " "in the subject sequence from left to right. Matching stops as soon as a " @@ -1242,118 +1251,118 @@ msgid "" "corresponding item, the sequence pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1002 +#: ../../reference/compound_stmts.rst:1007 msgid "Otherwise, if the sequence pattern is variable-length:" msgstr "" -#: ../../reference/compound_stmts.rst:1004 +#: ../../reference/compound_stmts.rst:1009 msgid "" "If the length of the subject sequence is less than the number of non-star " "subpatterns, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1007 +#: ../../reference/compound_stmts.rst:1012 msgid "" "The leading non-star subpatterns are matched to their corresponding items as " "for fixed-length sequences." msgstr "" -#: ../../reference/compound_stmts.rst:1010 +#: ../../reference/compound_stmts.rst:1015 msgid "" "If the previous step succeeds, the star subpattern matches a list formed of " "the remaining subject items, excluding the remaining items corresponding to " "non-star subpatterns following the star subpattern." msgstr "" -#: ../../reference/compound_stmts.rst:1014 +#: ../../reference/compound_stmts.rst:1019 msgid "" "Remaining non-star subpatterns are matched to their corresponding subject " "items, as for a fixed-length sequence." msgstr "" -#: ../../reference/compound_stmts.rst:1017 +#: ../../reference/compound_stmts.rst:1022 msgid "" "The length of the subject sequence is obtained via :func:`len` (i.e. via " "the :meth:`~object.__len__` protocol). This length may be cached by the " "interpreter in a similar manner as :ref:`value patterns `." msgstr "" -#: ../../reference/compound_stmts.rst:1023 +#: ../../reference/compound_stmts.rst:1028 msgid "" "In simple terms ``[P1, P2, P3,`` ... ``, P]`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1026 +#: ../../reference/compound_stmts.rst:1031 msgid "check ```` is a sequence" msgstr "" -#: ../../reference/compound_stmts.rst:1027 +#: ../../reference/compound_stmts.rst:1032 msgid "``len(subject) == ``" msgstr "``len(subject) == ``" -#: ../../reference/compound_stmts.rst:1028 +#: ../../reference/compound_stmts.rst:1033 msgid "" "``P1`` matches ``[0]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1029 +#: ../../reference/compound_stmts.rst:1034 msgid "" "``P2`` matches ``[1]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1030 +#: ../../reference/compound_stmts.rst:1035 msgid "... and so on for the corresponding pattern/element." msgstr "" -#: ../../reference/compound_stmts.rst:1035 +#: ../../reference/compound_stmts.rst:1040 msgid "Mapping Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1037 +#: ../../reference/compound_stmts.rst:1042 msgid "" "A mapping pattern contains one or more key-value patterns. The syntax is " "similar to the construction of a dictionary. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1048 +#: ../../reference/compound_stmts.rst:1053 msgid "" "At most one double star pattern may be in a mapping pattern. The double " "star pattern must be the last subpattern in the mapping pattern." msgstr "" -#: ../../reference/compound_stmts.rst:1051 +#: ../../reference/compound_stmts.rst:1056 msgid "" "Duplicate keys in mapping patterns are disallowed. Duplicate literal keys " "will raise a :exc:`SyntaxError`. Two keys that otherwise have the same value " "will raise a :exc:`ValueError` at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1055 +#: ../../reference/compound_stmts.rst:1060 msgid "" "The following is the logical flow for matching a mapping pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1058 +#: ../../reference/compound_stmts.rst:1063 msgid "If the subject value is not a mapping [#]_,the mapping pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1060 +#: ../../reference/compound_stmts.rst:1065 msgid "" "If every key given in the mapping pattern is present in the subject mapping, " "and the pattern for each key matches the corresponding item of the subject " "mapping, the mapping pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1064 +#: ../../reference/compound_stmts.rst:1069 msgid "" "If duplicate keys are detected in the mapping pattern, the pattern is " "considered invalid. A :exc:`SyntaxError` is raised for duplicate literal " "values; or a :exc:`ValueError` for named keys of the same value." msgstr "" -#: ../../reference/compound_stmts.rst:1068 +#: ../../reference/compound_stmts.rst:1073 msgid "" "Key-value pairs are matched using the two-argument form of the mapping " "subject's ``get()`` method. Matched key-value pairs must already be present " @@ -1361,256 +1370,256 @@ msgid "" "or :meth:`~object.__getitem__`." msgstr "" -#: ../../reference/compound_stmts.rst:1073 +#: ../../reference/compound_stmts.rst:1078 msgid "" "In simple terms ``{KEY1: P1, KEY2: P2, ... }`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1076 +#: ../../reference/compound_stmts.rst:1081 msgid "check ```` is a mapping" msgstr "" -#: ../../reference/compound_stmts.rst:1077 +#: ../../reference/compound_stmts.rst:1082 msgid "``KEY1 in ``" msgstr "``KEY1 in ``" -#: ../../reference/compound_stmts.rst:1078 +#: ../../reference/compound_stmts.rst:1083 msgid "``P1`` matches ``[KEY1]``" msgstr "" -#: ../../reference/compound_stmts.rst:1079 +#: ../../reference/compound_stmts.rst:1084 msgid "... and so on for the corresponding KEY/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1085 +#: ../../reference/compound_stmts.rst:1090 msgid "Class Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1087 +#: ../../reference/compound_stmts.rst:1092 msgid "" "A class pattern represents a class and its positional and keyword arguments " "(if any). Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1098 +#: ../../reference/compound_stmts.rst:1103 msgid "The same keyword should not be repeated in class patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1100 +#: ../../reference/compound_stmts.rst:1105 msgid "" "The following is the logical flow for matching a class pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1103 +#: ../../reference/compound_stmts.rst:1108 msgid "" "If ``name_or_attr`` is not an instance of the builtin :class:`type` , raise :" "exc:`TypeError`." msgstr "" -#: ../../reference/compound_stmts.rst:1106 +#: ../../reference/compound_stmts.rst:1111 msgid "" "If the subject value is not an instance of ``name_or_attr`` (tested via :" "func:`isinstance`), the class pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1109 +#: ../../reference/compound_stmts.rst:1114 msgid "" "If no pattern arguments are present, the pattern succeeds. Otherwise, the " "subsequent steps depend on whether keyword or positional argument patterns " "are present." msgstr "" -#: ../../reference/compound_stmts.rst:1113 +#: ../../reference/compound_stmts.rst:1118 msgid "" "For a number of built-in types (specified below), a single positional " "subpattern is accepted which will match the entire subject; for these types " "keyword patterns also work as for other types." msgstr "" -#: ../../reference/compound_stmts.rst:1117 +#: ../../reference/compound_stmts.rst:1122 msgid "" "If only keyword patterns are present, they are processed as follows, one by " "one:" msgstr "" -#: ../../reference/compound_stmts.rst:1120 +#: ../../reference/compound_stmts.rst:1125 msgid "I. The keyword is looked up as an attribute on the subject." msgstr "" -#: ../../reference/compound_stmts.rst:1122 +#: ../../reference/compound_stmts.rst:1127 msgid "" "If this raises an exception other than :exc:`AttributeError`, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1125 +#: ../../reference/compound_stmts.rst:1130 msgid "If this raises :exc:`AttributeError`, the class pattern has failed." msgstr "" -#: ../../reference/compound_stmts.rst:1127 +#: ../../reference/compound_stmts.rst:1132 msgid "" "Else, the subpattern associated with the keyword pattern is matched against " "the subject's attribute value. If this fails, the class pattern fails; if " "this succeeds, the match proceeds to the next keyword." msgstr "" -#: ../../reference/compound_stmts.rst:1132 +#: ../../reference/compound_stmts.rst:1137 msgid "II. If all keyword patterns succeed, the class pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1134 +#: ../../reference/compound_stmts.rst:1139 msgid "" "If any positional patterns are present, they are converted to keyword " "patterns using the :data:`~object.__match_args__` attribute on the class " "``name_or_attr`` before matching:" msgstr "" -#: ../../reference/compound_stmts.rst:1138 +#: ../../reference/compound_stmts.rst:1143 msgid "" "I. The equivalent of ``getattr(cls, \"__match_args__\", ())`` is called." msgstr "" -#: ../../reference/compound_stmts.rst:1140 +#: ../../reference/compound_stmts.rst:1145 msgid "If this raises an exception, the exception bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1142 +#: ../../reference/compound_stmts.rst:1147 msgid "" "If the returned value is not a tuple, the conversion fails and :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1145 +#: ../../reference/compound_stmts.rst:1150 msgid "" "If there are more positional patterns than ``len(cls.__match_args__)``, :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1148 +#: ../../reference/compound_stmts.rst:1153 msgid "" "Otherwise, positional pattern ``i`` is converted to a keyword pattern using " "``__match_args__[i]`` as the keyword. ``__match_args__[i]`` must be a " "string; if not :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1152 +#: ../../reference/compound_stmts.rst:1157 msgid "If there are duplicate keywords, :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1154 +#: ../../reference/compound_stmts.rst:1159 msgid ":ref:`class-pattern-matching`" msgstr ":ref:`class-pattern-matching`" -#: ../../reference/compound_stmts.rst:1156 +#: ../../reference/compound_stmts.rst:1161 msgid "" "II. Once all positional patterns have been converted to keyword patterns," msgstr "" -#: ../../reference/compound_stmts.rst:1157 +#: ../../reference/compound_stmts.rst:1162 msgid "the match proceeds as if there were only keyword patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1159 +#: ../../reference/compound_stmts.rst:1164 msgid "" "For the following built-in types the handling of positional subpatterns is " "different:" msgstr "" -#: ../../reference/compound_stmts.rst:1162 +#: ../../reference/compound_stmts.rst:1167 msgid ":class:`bool`" msgstr ":class:`bool`" -#: ../../reference/compound_stmts.rst:1163 +#: ../../reference/compound_stmts.rst:1168 msgid ":class:`bytearray`" msgstr ":class:`bytearray`" -#: ../../reference/compound_stmts.rst:1164 +#: ../../reference/compound_stmts.rst:1169 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../reference/compound_stmts.rst:1165 +#: ../../reference/compound_stmts.rst:1170 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../reference/compound_stmts.rst:1166 +#: ../../reference/compound_stmts.rst:1171 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../reference/compound_stmts.rst:1167 +#: ../../reference/compound_stmts.rst:1172 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../reference/compound_stmts.rst:1168 +#: ../../reference/compound_stmts.rst:1173 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../reference/compound_stmts.rst:1169 -#: ../../reference/compound_stmts.rst:1927 +#: ../../reference/compound_stmts.rst:1174 +#: ../../reference/compound_stmts.rst:1932 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../reference/compound_stmts.rst:1170 +#: ../../reference/compound_stmts.rst:1175 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../reference/compound_stmts.rst:1171 +#: ../../reference/compound_stmts.rst:1176 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../reference/compound_stmts.rst:1172 -#: ../../reference/compound_stmts.rst:1930 +#: ../../reference/compound_stmts.rst:1177 +#: ../../reference/compound_stmts.rst:1935 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../reference/compound_stmts.rst:1174 +#: ../../reference/compound_stmts.rst:1179 msgid "" "These classes accept a single positional argument, and the pattern there is " "matched against the whole object rather than an attribute. For example " "``int(0|1)`` matches the value ``0``, but not the value ``0.0``." msgstr "" -#: ../../reference/compound_stmts.rst:1178 +#: ../../reference/compound_stmts.rst:1183 msgid "" "In simple terms ``CLS(P1, attr=P2)`` matches only if the following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1180 +#: ../../reference/compound_stmts.rst:1185 msgid "``isinstance(, CLS)``" msgstr "``isinstance(, CLS)``" -#: ../../reference/compound_stmts.rst:1181 +#: ../../reference/compound_stmts.rst:1186 msgid "convert ``P1`` to a keyword pattern using ``CLS.__match_args__``" msgstr "" -#: ../../reference/compound_stmts.rst:1182 +#: ../../reference/compound_stmts.rst:1187 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1184 +#: ../../reference/compound_stmts.rst:1189 msgid "``hasattr(, \"attr\")``" msgstr "``hasattr(, \"attr\")``" -#: ../../reference/compound_stmts.rst:1185 +#: ../../reference/compound_stmts.rst:1190 msgid "``P2`` matches ``.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1187 +#: ../../reference/compound_stmts.rst:1192 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1202 +#: ../../reference/compound_stmts.rst:1207 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1217 +#: ../../reference/compound_stmts.rst:1222 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1239 +#: ../../reference/compound_stmts.rst:1244 msgid "" "A function definition is an executable statement. Its execution binds the " "function name in the current local namespace to a function object (a wrapper " @@ -1619,13 +1628,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1245 +#: ../../reference/compound_stmts.rst:1250 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1251 +#: ../../reference/compound_stmts.rst:1256 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1636,7 +1645,7 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1258 +#: ../../reference/compound_stmts.rst:1263 msgid "" "@f1(arg)\n" "@f2\n" @@ -1646,12 +1655,12 @@ msgstr "" "@f2\n" "def func(): pass" -#: ../../reference/compound_stmts.rst:1262 -#: ../../reference/compound_stmts.rst:1451 +#: ../../reference/compound_stmts.rst:1267 +#: ../../reference/compound_stmts.rst:1456 msgid "is roughly equivalent to ::" msgstr "大致等價於: ::" -#: ../../reference/compound_stmts.rst:1264 +#: ../../reference/compound_stmts.rst:1269 msgid "" "def func(): pass\n" "func = f1(arg)(f2(func))" @@ -1659,20 +1668,20 @@ msgstr "" "def func(): pass\n" "func = f1(arg)(f2(func))" -#: ../../reference/compound_stmts.rst:1267 +#: ../../reference/compound_stmts.rst:1272 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1269 +#: ../../reference/compound_stmts.rst:1274 msgid "" "Functions may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1274 +#: ../../reference/compound_stmts.rst:1279 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets between the function's name and the opening parenthesis for its " @@ -1682,12 +1691,12 @@ msgid "" "functions` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1281 -#: ../../reference/compound_stmts.rst:1470 +#: ../../reference/compound_stmts.rst:1286 +#: ../../reference/compound_stmts.rst:1475 msgid "Type parameter lists are new in Python 3.12." msgstr "" -#: ../../reference/compound_stmts.rst:1289 +#: ../../reference/compound_stmts.rst:1294 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1698,7 +1707,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1302 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1711,7 +1720,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1307 +#: ../../reference/compound_stmts.rst:1312 msgid "" "def whats_on_the_telly(penguin=None):\n" " if penguin is None:\n" @@ -1725,7 +1734,7 @@ msgstr "" " penguin.append(\"property of the zoo\")\n" " return penguin" -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1323 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1741,13 +1750,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1330 +#: ../../reference/compound_stmts.rst:1335 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1339 +#: ../../reference/compound_stmts.rst:1344 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1760,13 +1769,13 @@ msgid "" "information on annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1347 +#: ../../reference/compound_stmts.rst:1352 msgid "" "Parameters of the form \"``*identifier``\" may have an annotation \"``: " "*expression``\". See :pep:`646`." msgstr "" -#: ../../reference/compound_stmts.rst:1353 +#: ../../reference/compound_stmts.rst:1358 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1778,7 +1787,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1361 +#: ../../reference/compound_stmts.rst:1366 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1787,61 +1796,61 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1369 +#: ../../reference/compound_stmts.rst:1374 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1370 +#: ../../reference/compound_stmts.rst:1375 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1372 +#: ../../reference/compound_stmts.rst:1377 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../reference/compound_stmts.rst:1373 +#: ../../reference/compound_stmts.rst:1378 msgid "Definition of a standard meaning for annotations: type hints." msgstr "定義註釋的標準意義:型別提示。" -#: ../../reference/compound_stmts.rst:1375 +#: ../../reference/compound_stmts.rst:1380 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr ":pep:`526` - 變數註釋的語法" -#: ../../reference/compound_stmts.rst:1376 +#: ../../reference/compound_stmts.rst:1381 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables." msgstr "" -#: ../../reference/compound_stmts.rst:1379 +#: ../../reference/compound_stmts.rst:1384 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1380 +#: ../../reference/compound_stmts.rst:1385 msgid "" "Support for forward references within annotations by preserving annotations " "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:1383 +#: ../../reference/compound_stmts.rst:1388 msgid ":pep:`318` - Decorators for Functions and Methods" msgstr "" -#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1389 msgid "" "Function and method decorators were introduced. Class decorators were " "introduced in :pep:`3129`." msgstr "" -#: ../../reference/compound_stmts.rst:1390 +#: ../../reference/compound_stmts.rst:1395 msgid "Class definitions" msgstr "類別定義" -#: ../../reference/compound_stmts.rst:1405 +#: ../../reference/compound_stmts.rst:1410 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1412 +#: ../../reference/compound_stmts.rst:1417 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1850,7 +1859,7 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1418 +#: ../../reference/compound_stmts.rst:1423 msgid "" "class Foo:\n" " pass" @@ -1858,11 +1867,11 @@ msgstr "" "class Foo:\n" " pass" -#: ../../reference/compound_stmts.rst:1421 +#: ../../reference/compound_stmts.rst:1426 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1423 +#: ../../reference/compound_stmts.rst:1428 msgid "" "class Foo(object):\n" " pass" @@ -1870,7 +1879,7 @@ msgstr "" "class Foo(object):\n" " pass" -#: ../../reference/compound_stmts.rst:1426 +#: ../../reference/compound_stmts.rst:1431 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -1882,7 +1891,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1435 +#: ../../reference/compound_stmts.rst:1440 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's :attr:`~type.__dict__`. Note that this is reliable only " @@ -1890,17 +1899,17 @@ msgid "" "using the definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1440 +#: ../../reference/compound_stmts.rst:1445 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1445 +#: ../../reference/compound_stmts.rst:1450 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1447 +#: ../../reference/compound_stmts.rst:1452 msgid "" "@f1(arg)\n" "@f2\n" @@ -1910,7 +1919,7 @@ msgstr "" "@f2\n" "class Foo: pass" -#: ../../reference/compound_stmts.rst:1453 +#: ../../reference/compound_stmts.rst:1458 msgid "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" @@ -1918,20 +1927,20 @@ msgstr "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" -#: ../../reference/compound_stmts.rst:1456 +#: ../../reference/compound_stmts.rst:1461 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:1459 +#: ../../reference/compound_stmts.rst:1464 msgid "" "Classes may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1464 +#: ../../reference/compound_stmts.rst:1469 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets immediately after the class's name. This indicates to static type " @@ -1940,7 +1949,7 @@ msgid "" "`generic-classes` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1473 +#: ../../reference/compound_stmts.rst:1478 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1953,35 +1962,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1485 +#: ../../reference/compound_stmts.rst:1490 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1486 +#: ../../reference/compound_stmts.rst:1491 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:1490 +#: ../../reference/compound_stmts.rst:1495 msgid ":pep:`3129` - Class Decorators" msgstr ":pep:`3129` - 類別裝飾器" -#: ../../reference/compound_stmts.rst:1491 +#: ../../reference/compound_stmts.rst:1496 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1498 +#: ../../reference/compound_stmts.rst:1503 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1506 +#: ../../reference/compound_stmts.rst:1511 msgid "Coroutine function definition" msgstr "協程函式定義" -#: ../../reference/compound_stmts.rst:1516 +#: ../../reference/compound_stmts.rst:1521 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1989,23 +1998,23 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1520 +#: ../../reference/compound_stmts.rst:1525 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:1523 +#: ../../reference/compound_stmts.rst:1528 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1526 +#: ../../reference/compound_stmts.rst:1531 msgid "An example of a coroutine function::" msgstr "一個協程函式範例: ::" -#: ../../reference/compound_stmts.rst:1528 +#: ../../reference/compound_stmts.rst:1533 msgid "" "async def func(param1, param2):\n" " do_stuff()\n" @@ -2015,30 +2024,30 @@ msgstr "" " do_stuff()\n" " await some_coroutine()" -#: ../../reference/compound_stmts.rst:1532 +#: ../../reference/compound_stmts.rst:1537 msgid "" "``await`` and ``async`` are now keywords; previously they were only treated " "as such inside the body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1540 +#: ../../reference/compound_stmts.rst:1545 msgid "The :keyword:`!async for` statement" msgstr ":keyword:`!async for` 陳述式" -#: ../../reference/compound_stmts.rst:1545 +#: ../../reference/compound_stmts.rst:1550 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:1549 +#: ../../reference/compound_stmts.rst:1554 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1554 +#: ../../reference/compound_stmts.rst:1559 msgid "" "async for TARGET in ITER:\n" " SUITE\n" @@ -2050,11 +2059,11 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1559 +#: ../../reference/compound_stmts.rst:1564 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1561 +#: ../../reference/compound_stmts.rst:1566 msgid "" "iter = (ITER)\n" "iter = type(iter).__aiter__(iter)\n" @@ -2084,28 +2093,28 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1575 +#: ../../reference/compound_stmts.rst:1580 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`。" -#: ../../reference/compound_stmts.rst:1577 +#: ../../reference/compound_stmts.rst:1582 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1585 +#: ../../reference/compound_stmts.rst:1590 msgid "The :keyword:`!async with` statement" msgstr ":keyword:`!async with` 陳述式" -#: ../../reference/compound_stmts.rst:1590 +#: ../../reference/compound_stmts.rst:1595 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:1595 +#: ../../reference/compound_stmts.rst:1600 msgid "" "async with EXPRESSION as TARGET:\n" " SUITE" @@ -2113,7 +2122,7 @@ msgstr "" "async with EXPRESSION as TARGET:\n" " SUITE" -#: ../../reference/compound_stmts.rst:1600 +#: ../../reference/compound_stmts.rst:1605 msgid "" "manager = (EXPRESSION)\n" "aenter = type(manager).__aenter__\n" @@ -2149,44 +2158,44 @@ msgstr "" " if not hit_except:\n" " await aexit(manager, None, None, None)" -#: ../../reference/compound_stmts.rst:1617 +#: ../../reference/compound_stmts.rst:1622 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`。" -#: ../../reference/compound_stmts.rst:1619 +#: ../../reference/compound_stmts.rst:1624 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1624 +#: ../../reference/compound_stmts.rst:1629 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1625 +#: ../../reference/compound_stmts.rst:1630 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1631 +#: ../../reference/compound_stmts.rst:1636 msgid "Type parameter lists" msgstr "" -#: ../../reference/compound_stmts.rst:1635 +#: ../../reference/compound_stmts.rst:1640 msgid "Support for default values was added (see :pep:`696`)." msgstr "" -#: ../../reference/compound_stmts.rst:1648 +#: ../../reference/compound_stmts.rst:1653 msgid "" ":ref:`Functions ` (including :ref:`coroutines `), :ref:" "`classes ` and :ref:`type aliases ` may contain a type " "parameter list::" msgstr "" -#: ../../reference/compound_stmts.rst:1652 +#: ../../reference/compound_stmts.rst:1657 msgid "" "def max[T](args: list[T]) -> T:\n" " ...\n" @@ -2218,7 +2227,7 @@ msgstr "" "\n" "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1667 +#: ../../reference/compound_stmts.rst:1672 msgid "" "Semantically, this indicates that the function, class, or type alias is " "generic over a type variable. This information is primarily used by static " @@ -2226,7 +2235,7 @@ msgid "" "generic counterparts." msgstr "" -#: ../../reference/compound_stmts.rst:1672 +#: ../../reference/compound_stmts.rst:1677 msgid "" "Type parameters are declared in square brackets (``[]``) immediately after " "the name of the function, class, or type alias. The type parameters are " @@ -2238,36 +2247,36 @@ msgid "" "wraps the creation of the generic object." msgstr "" -#: ../../reference/compound_stmts.rst:1681 +#: ../../reference/compound_stmts.rst:1686 msgid "" "Generic functions, classes, and type aliases have a :attr:`~definition." "__type_params__` attribute listing their type parameters." msgstr "" -#: ../../reference/compound_stmts.rst:1684 +#: ../../reference/compound_stmts.rst:1689 msgid "Type parameters come in three kinds:" msgstr "" -#: ../../reference/compound_stmts.rst:1686 +#: ../../reference/compound_stmts.rst:1691 msgid "" ":data:`typing.TypeVar`, introduced by a plain name (e.g., ``T``). " "Semantically, this represents a single type to a type checker." msgstr "" -#: ../../reference/compound_stmts.rst:1688 +#: ../../reference/compound_stmts.rst:1693 msgid "" ":data:`typing.TypeVarTuple`, introduced by a name prefixed with a single " "asterisk (e.g., ``*Ts``). Semantically, this stands for a tuple of any " "number of types." msgstr "" -#: ../../reference/compound_stmts.rst:1691 +#: ../../reference/compound_stmts.rst:1696 msgid "" ":data:`typing.ParamSpec`, introduced by a name prefixed with two asterisks " "(e.g., ``**P``). Semantically, this stands for the parameters of a callable." msgstr "" -#: ../../reference/compound_stmts.rst:1694 +#: ../../reference/compound_stmts.rst:1699 msgid "" ":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " "with a colon (``:``) followed by an expression. A single expression after " @@ -2279,7 +2288,7 @@ msgid "" "variables can only take on one of the types in the list of constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1703 +#: ../../reference/compound_stmts.rst:1708 msgid "" "For :data:`!typing.TypeVar`\\ s declared using the type parameter list " "syntax, the bound and constraints are not evaluated when the generic object " @@ -2289,13 +2298,13 @@ msgid "" "`." msgstr "" -#: ../../reference/compound_stmts.rst:1709 +#: ../../reference/compound_stmts.rst:1714 msgid "" ":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " "bounds or constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1712 +#: ../../reference/compound_stmts.rst:1717 msgid "" "All three flavors of type parameters can also have a *default value*, which " "is used when the type parameter is not explicitly provided. This is added by " @@ -2308,13 +2317,13 @@ msgid "" "attribute is set to the special sentinel object :data:`typing.NoDefault`." msgstr "" -#: ../../reference/compound_stmts.rst:1722 +#: ../../reference/compound_stmts.rst:1727 msgid "" "The following example indicates the full set of allowed type parameter " "declarations::" msgstr "" -#: ../../reference/compound_stmts.rst:1724 +#: ../../reference/compound_stmts.rst:1729 msgid "" "def overly_generic[\n" " SimpleTypeVar,\n" @@ -2346,24 +2355,24 @@ msgstr "" " *e: SimpleTypeVarTuple,\n" "): ..." -#: ../../reference/compound_stmts.rst:1742 +#: ../../reference/compound_stmts.rst:1747 msgid "Generic functions" msgstr "" -#: ../../reference/compound_stmts.rst:1744 +#: ../../reference/compound_stmts.rst:1749 msgid "Generic functions are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1746 +#: ../../reference/compound_stmts.rst:1751 msgid "def func[T](arg: T): ..." msgstr "def func[T](arg: T): ..." -#: ../../reference/compound_stmts.rst:1748 -#: ../../reference/compound_stmts.rst:1808 +#: ../../reference/compound_stmts.rst:1753 +#: ../../reference/compound_stmts.rst:1813 msgid "This syntax is equivalent to::" msgstr "語法大致等價於: ::" -#: ../../reference/compound_stmts.rst:1750 +#: ../../reference/compound_stmts.rst:1755 msgid "" "annotation-def TYPE_PARAMS_OF_func():\n" " T = typing.TypeVar(\"T\")\n" @@ -2379,7 +2388,7 @@ msgstr "" " return func\n" "func = TYPE_PARAMS_OF_func()" -#: ../../reference/compound_stmts.rst:1757 +#: ../../reference/compound_stmts.rst:1762 msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope `, which is not actually bound to any name at runtime. (One other " @@ -2388,20 +2397,20 @@ msgid "" "data:`typing.TypeVar` directly.)" msgstr "" -#: ../../reference/compound_stmts.rst:1763 +#: ../../reference/compound_stmts.rst:1768 msgid "" "The annotations of generic functions are evaluated within the annotation " "scope used for declaring the type parameters, but the function's defaults " "and decorators are not." msgstr "" -#: ../../reference/compound_stmts.rst:1767 +#: ../../reference/compound_stmts.rst:1772 msgid "" "The following example illustrates the scoping rules for these cases, as well " "as for additional flavors of type parameters::" msgstr "" -#: ../../reference/compound_stmts.rst:1770 +#: ../../reference/compound_stmts.rst:1775 msgid "" "@decorator\n" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" @@ -2411,13 +2420,13 @@ msgstr "" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" " ..." -#: ../../reference/compound_stmts.rst:1774 +#: ../../reference/compound_stmts.rst:1779 msgid "" "Except for the :ref:`lazy evaluation ` of the :class:" "`~typing.TypeVar` bound, this is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1777 +#: ../../reference/compound_stmts.rst:1782 msgid "" "DEFAULT_OF_arg = some_default\n" "\n" @@ -2439,25 +2448,25 @@ msgid "" "func = decorator(TYPE_PARAMS_OF_func())" msgstr "" -#: ../../reference/compound_stmts.rst:1796 +#: ../../reference/compound_stmts.rst:1801 msgid "" "The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " "runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1802 +#: ../../reference/compound_stmts.rst:1807 msgid "Generic classes" msgstr "" -#: ../../reference/compound_stmts.rst:1804 +#: ../../reference/compound_stmts.rst:1809 msgid "Generic classes are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1806 +#: ../../reference/compound_stmts.rst:1811 msgid "class Bag[T]: ..." msgstr "class Bag[T]: ..." -#: ../../reference/compound_stmts.rst:1810 +#: ../../reference/compound_stmts.rst:1815 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2475,14 +2484,14 @@ msgstr "" " return Bag\n" "Bag = TYPE_PARAMS_OF_Bag()" -#: ../../reference/compound_stmts.rst:1818 +#: ../../reference/compound_stmts.rst:1823 msgid "" "Here again ``annotation-def`` (not a real keyword) indicates an :ref:" "`annotation scope `, and the name ``TYPE_PARAMS_OF_Bag`` " "is not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1822 +#: ../../reference/compound_stmts.rst:1827 msgid "" "Generic classes implicitly inherit from :data:`typing.Generic`. The base " "classes and keyword arguments of generic classes are evaluated within the " @@ -2490,7 +2499,7 @@ msgid "" "that scope. This is illustrated by this example::" msgstr "" -#: ../../reference/compound_stmts.rst:1828 +#: ../../reference/compound_stmts.rst:1833 msgid "" "@decorator\n" "class Bag(Base[T], arg=T): ..." @@ -2498,11 +2507,11 @@ msgstr "" "@decorator\n" "class Bag(Base[T], arg=T): ..." -#: ../../reference/compound_stmts.rst:1831 +#: ../../reference/compound_stmts.rst:1836 msgid "This is equivalent to::" msgstr "這等價於: ::" -#: ../../reference/compound_stmts.rst:1833 +#: ../../reference/compound_stmts.rst:1838 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2520,27 +2529,27 @@ msgstr "" " return Bag\n" "Bag = decorator(TYPE_PARAMS_OF_Bag())" -#: ../../reference/compound_stmts.rst:1844 +#: ../../reference/compound_stmts.rst:1849 msgid "Generic type aliases" msgstr "" -#: ../../reference/compound_stmts.rst:1846 +#: ../../reference/compound_stmts.rst:1851 msgid "" "The :keyword:`type` statement can also be used to create a generic type " "alias::" msgstr "" -#: ../../reference/compound_stmts.rst:1848 +#: ../../reference/compound_stmts.rst:1853 msgid "type ListOrSet[T] = list[T] | set[T]" msgstr "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1850 +#: ../../reference/compound_stmts.rst:1855 msgid "" "Except for the :ref:`lazy evaluation ` of the value, this " "is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1853 +#: ../../reference/compound_stmts.rst:1858 msgid "" "annotation-def TYPE_PARAMS_OF_ListOrSet():\n" " T = typing.TypeVar(\"T\")\n" @@ -2553,29 +2562,29 @@ msgid "" "ListOrSet = TYPE_PARAMS_OF_ListOrSet()" msgstr "" -#: ../../reference/compound_stmts.rst:1862 +#: ../../reference/compound_stmts.rst:1867 msgid "" "Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " "scope `. The capitalized names like " "``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1869 +#: ../../reference/compound_stmts.rst:1874 msgid "Annotations" msgstr "註釋" -#: ../../reference/compound_stmts.rst:1871 +#: ../../reference/compound_stmts.rst:1876 msgid "Annotations are now lazily evaluated by default." msgstr "" -#: ../../reference/compound_stmts.rst:1874 +#: ../../reference/compound_stmts.rst:1879 msgid "" "Variables and function parameters may carry :term:`annotations " "`, created by adding a colon after the name, followed by an " "expression::" msgstr "" -#: ../../reference/compound_stmts.rst:1877 +#: ../../reference/compound_stmts.rst:1882 msgid "" "x: annotation = 1\n" "def f(param: annotation): ..." @@ -2583,15 +2592,15 @@ msgstr "" "x: annotation = 1\n" "def f(param: annotation): ..." -#: ../../reference/compound_stmts.rst:1880 +#: ../../reference/compound_stmts.rst:1885 msgid "Functions may also carry a return annotation following an arrow::" msgstr "" -#: ../../reference/compound_stmts.rst:1882 +#: ../../reference/compound_stmts.rst:1887 msgid "def f() -> annotation: ..." msgstr "def f() -> annotation: ..." -#: ../../reference/compound_stmts.rst:1884 +#: ../../reference/compound_stmts.rst:1889 msgid "" "Annotations are conventionally used for :term:`type hints `, but " "this is not enforced by the language, and in general annotations may contain " @@ -2601,7 +2610,7 @@ msgid "" "`functools.singledispatch`)." msgstr "" -#: ../../reference/compound_stmts.rst:1890 +#: ../../reference/compound_stmts.rst:1895 msgid "" "By default, annotations are lazily evaluated in an :ref:`annotation scope " "`. This means that they are not evaluated when the code " @@ -2610,13 +2619,13 @@ msgid "" "The :mod:`annotationlib` module provides tools for evaluating annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1895 +#: ../../reference/compound_stmts.rst:1900 msgid "" "If the :ref:`future statement ` ``from __future__ import " "annotations`` is present, all annotations are instead stored as strings::" msgstr "" -#: ../../reference/compound_stmts.rst:1898 +#: ../../reference/compound_stmts.rst:1903 msgid "" ">>> from __future__ import annotations\n" ">>> def f(param: annotation): ...\n" @@ -2628,7 +2637,7 @@ msgstr "" ">>> f.__annotations__\n" "{'param': 'annotation'}" -#: ../../reference/compound_stmts.rst:1903 +#: ../../reference/compound_stmts.rst:1908 msgid "" "This future statement will be deprecated and removed in a future version of " "Python, but not before Python 3.13 reaches its end of life (see :pep:`749`). " @@ -2637,98 +2646,98 @@ msgid "" "able to resolve annotations at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1911 +#: ../../reference/compound_stmts.rst:1916 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1912 +#: ../../reference/compound_stmts.rst:1917 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:1916 +#: ../../reference/compound_stmts.rst:1921 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1918 +#: ../../reference/compound_stmts.rst:1923 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1919 +#: ../../reference/compound_stmts.rst:1924 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1920 +#: ../../reference/compound_stmts.rst:1925 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1921 -#: ../../reference/compound_stmts.rst:1940 +#: ../../reference/compound_stmts.rst:1926 +#: ../../reference/compound_stmts.rst:1945 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1923 +#: ../../reference/compound_stmts.rst:1928 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1925 +#: ../../reference/compound_stmts.rst:1930 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1926 +#: ../../reference/compound_stmts.rst:1931 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1928 +#: ../../reference/compound_stmts.rst:1933 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1929 +#: ../../reference/compound_stmts.rst:1934 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1932 +#: ../../reference/compound_stmts.rst:1937 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1935 +#: ../../reference/compound_stmts.rst:1940 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1937 +#: ../../reference/compound_stmts.rst:1942 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1938 +#: ../../reference/compound_stmts.rst:1943 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1939 +#: ../../reference/compound_stmts.rst:1944 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1942 +#: ../../reference/compound_stmts.rst:1947 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1945 +#: ../../reference/compound_stmts.rst:1950 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's :attr:`~function.__doc__` attribute and " "therefore the function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1949 +#: ../../reference/compound_stmts.rst:1954 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's :attr:`~type.__doc__` item and therefore " @@ -2745,15 +2754,15 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:169 #: ../../reference/compound_stmts.rst:207 -#: ../../reference/compound_stmts.rst:393 -#: ../../reference/compound_stmts.rst:442 -#: ../../reference/compound_stmts.rst:480 -#: ../../reference/compound_stmts.rst:597 -#: ../../reference/compound_stmts.rst:1204 -#: ../../reference/compound_stmts.rst:1392 -#: ../../reference/compound_stmts.rst:1502 -#: ../../reference/compound_stmts.rst:1536 -#: ../../reference/compound_stmts.rst:1581 +#: ../../reference/compound_stmts.rst:397 +#: ../../reference/compound_stmts.rst:446 +#: ../../reference/compound_stmts.rst:484 +#: ../../reference/compound_stmts.rst:602 +#: ../../reference/compound_stmts.rst:1209 +#: ../../reference/compound_stmts.rst:1397 +#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1541 +#: ../../reference/compound_stmts.rst:1586 msgid "statement" msgstr "statement(陳述式)" @@ -2785,11 +2794,11 @@ msgstr "" #: ../../reference/compound_stmts.rst:111 #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 -#: ../../reference/compound_stmts.rst:393 +#: ../../reference/compound_stmts.rst:397 msgid "else" msgstr "else" -#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:597 +#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:602 msgid "if" msgstr "if" @@ -2797,11 +2806,11 @@ msgstr "if" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:330 -#: ../../reference/compound_stmts.rst:393 -#: ../../reference/compound_stmts.rst:411 -#: ../../reference/compound_stmts.rst:480 -#: ../../reference/compound_stmts.rst:597 -#: ../../reference/compound_stmts.rst:1512 +#: ../../reference/compound_stmts.rst:397 +#: ../../reference/compound_stmts.rst:415 +#: ../../reference/compound_stmts.rst:484 +#: ../../reference/compound_stmts.rst:602 +#: ../../reference/compound_stmts.rst:1517 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2812,21 +2821,21 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:111 #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 -#: ../../reference/compound_stmts.rst:480 -#: ../../reference/compound_stmts.rst:597 -#: ../../reference/compound_stmts.rst:1204 -#: ../../reference/compound_stmts.rst:1334 -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:484 +#: ../../reference/compound_stmts.rst:602 +#: ../../reference/compound_stmts.rst:1209 +#: ../../reference/compound_stmts.rst:1339 +#: ../../reference/compound_stmts.rst:1397 msgid ": (colon)" msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:111 #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 -#: ../../reference/compound_stmts.rst:480 -#: ../../reference/compound_stmts.rst:597 -#: ../../reference/compound_stmts.rst:1204 -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:484 +#: ../../reference/compound_stmts.rst:602 +#: ../../reference/compound_stmts.rst:1209 +#: ../../reference/compound_stmts.rst:1397 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -2841,15 +2850,15 @@ msgstr "loop(迴圈)" #: ../../reference/compound_stmts.rst:129 #: ../../reference/compound_stmts.rst:169 -#: ../../reference/compound_stmts.rst:393 -#: ../../reference/compound_stmts.rst:442 +#: ../../reference/compound_stmts.rst:397 +#: ../../reference/compound_stmts.rst:446 msgid "break" msgstr "break" #: ../../reference/compound_stmts.rst:129 #: ../../reference/compound_stmts.rst:169 -#: ../../reference/compound_stmts.rst:393 -#: ../../reference/compound_stmts.rst:442 +#: ../../reference/compound_stmts.rst:397 +#: ../../reference/compound_stmts.rst:446 msgid "continue" msgstr "continue" @@ -2871,8 +2880,8 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:301 -#: ../../reference/compound_stmts.rst:1204 -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1209 +#: ../../reference/compound_stmts.rst:1397 msgid "object" msgstr "object(物件)" @@ -2897,14 +2906,14 @@ msgid "except" msgstr "except" #: ../../reference/compound_stmts.rst:207 -#: ../../reference/compound_stmts.rst:411 +#: ../../reference/compound_stmts.rst:415 msgid "finally" msgstr "finally" #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:268 -#: ../../reference/compound_stmts.rst:480 -#: ../../reference/compound_stmts.rst:597 +#: ../../reference/compound_stmts.rst:484 +#: ../../reference/compound_stmts.rst:602 msgid "as" msgstr "as" @@ -2928,213 +2937,213 @@ msgstr "traceback" msgid "except_star" msgstr "except_star" -#: ../../reference/compound_stmts.rst:393 -#: ../../reference/compound_stmts.rst:442 +#: ../../reference/compound_stmts.rst:397 +#: ../../reference/compound_stmts.rst:446 msgid "return" msgstr "return (回傳)" -#: ../../reference/compound_stmts.rst:480 +#: ../../reference/compound_stmts.rst:484 msgid "with" msgstr "with" -#: ../../reference/compound_stmts.rst:480 +#: ../../reference/compound_stmts.rst:484 msgid "with statement" msgstr "with statement(with 陳述式)" -#: ../../reference/compound_stmts.rst:480 -#: ../../reference/compound_stmts.rst:1204 -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:484 +#: ../../reference/compound_stmts.rst:1209 +#: ../../reference/compound_stmts.rst:1397 msgid ", (comma)" msgstr ", (逗號)" -#: ../../reference/compound_stmts.rst:597 +#: ../../reference/compound_stmts.rst:602 msgid "match" msgstr "match" -#: ../../reference/compound_stmts.rst:597 +#: ../../reference/compound_stmts.rst:602 msgid "case" msgstr "case" -#: ../../reference/compound_stmts.rst:597 +#: ../../reference/compound_stmts.rst:602 msgid "pattern matching" msgstr "pattern matching(模式匹配)" -#: ../../reference/compound_stmts.rst:597 +#: ../../reference/compound_stmts.rst:602 msgid "match statement" msgstr "match statement(匹配陳述式)" -#: ../../reference/compound_stmts.rst:701 +#: ../../reference/compound_stmts.rst:706 msgid "guard" msgstr "guard" -#: ../../reference/compound_stmts.rst:740 +#: ../../reference/compound_stmts.rst:745 msgid "irrefutable case block" msgstr "" -#: ../../reference/compound_stmts.rst:740 +#: ../../reference/compound_stmts.rst:745 msgid "case block" msgstr "" -#: ../../reference/compound_stmts.rst:764 +#: ../../reference/compound_stmts.rst:769 msgid "! patterns" msgstr "" -#: ../../reference/compound_stmts.rst:764 +#: ../../reference/compound_stmts.rst:769 msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" msgstr "" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1284 +#: ../../reference/compound_stmts.rst:1200 +#: ../../reference/compound_stmts.rst:1289 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1204 -#: ../../reference/compound_stmts.rst:1248 -#: ../../reference/compound_stmts.rst:1284 -#: ../../reference/compound_stmts.rst:1313 +#: ../../reference/compound_stmts.rst:1200 +#: ../../reference/compound_stmts.rst:1209 +#: ../../reference/compound_stmts.rst:1253 +#: ../../reference/compound_stmts.rst:1289 +#: ../../reference/compound_stmts.rst:1318 msgid "function definition" msgstr "function definition(函式定義)" -#: ../../reference/compound_stmts.rst:1204 +#: ../../reference/compound_stmts.rst:1209 msgid "def" msgstr "def" -#: ../../reference/compound_stmts.rst:1204 -#: ../../reference/compound_stmts.rst:1334 +#: ../../reference/compound_stmts.rst:1209 +#: ../../reference/compound_stmts.rst:1339 msgid "function" msgstr "function (函式)" -#: ../../reference/compound_stmts.rst:1204 -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1209 +#: ../../reference/compound_stmts.rst:1397 msgid "definition" msgstr "definition(定義)" -#: ../../reference/compound_stmts.rst:1204 -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1209 +#: ../../reference/compound_stmts.rst:1397 msgid "name" msgstr "name(名稱)" -#: ../../reference/compound_stmts.rst:1204 -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1209 +#: ../../reference/compound_stmts.rst:1397 msgid "binding" msgstr "binding(綁定)" -#: ../../reference/compound_stmts.rst:1204 +#: ../../reference/compound_stmts.rst:1209 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/compound_stmts.rst:1204 -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1209 +#: ../../reference/compound_stmts.rst:1397 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../reference/compound_stmts.rst:1204 +#: ../../reference/compound_stmts.rst:1209 msgid "parameter list" msgstr "parameter list(參數列表)" -#: ../../reference/compound_stmts.rst:1248 -#: ../../reference/compound_stmts.rst:1442 +#: ../../reference/compound_stmts.rst:1253 +#: ../../reference/compound_stmts.rst:1447 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/compound_stmts.rst:1284 +#: ../../reference/compound_stmts.rst:1289 msgid "default" msgstr "default(預設)" -#: ../../reference/compound_stmts.rst:1284 +#: ../../reference/compound_stmts.rst:1289 msgid "value" msgstr "value(值)" -#: ../../reference/compound_stmts.rst:1284 +#: ../../reference/compound_stmts.rst:1289 msgid "argument" msgstr "argument(引數)" -#: ../../reference/compound_stmts.rst:1284 +#: ../../reference/compound_stmts.rst:1289 msgid "= (equals)" msgstr "= (等號)" -#: ../../reference/compound_stmts.rst:1313 +#: ../../reference/compound_stmts.rst:1318 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/compound_stmts.rst:1313 +#: ../../reference/compound_stmts.rst:1318 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/compound_stmts.rst:1313 +#: ../../reference/compound_stmts.rst:1318 msgid "**" msgstr "**" -#: ../../reference/compound_stmts.rst:1334 +#: ../../reference/compound_stmts.rst:1339 msgid "annotations" msgstr "annotations(註釋)" -#: ../../reference/compound_stmts.rst:1334 +#: ../../reference/compound_stmts.rst:1339 msgid "->" msgstr "->" -#: ../../reference/compound_stmts.rst:1334 +#: ../../reference/compound_stmts.rst:1339 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../reference/compound_stmts.rst:1351 +#: ../../reference/compound_stmts.rst:1356 msgid "lambda" msgstr "lambda" -#: ../../reference/compound_stmts.rst:1351 +#: ../../reference/compound_stmts.rst:1356 msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1397 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1397 msgid "execution" msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1397 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1397 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1397 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1392 -#: ../../reference/compound_stmts.rst:1442 +#: ../../reference/compound_stmts.rst:1397 +#: ../../reference/compound_stmts.rst:1447 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1392 +#: ../../reference/compound_stmts.rst:1397 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1502 +#: ../../reference/compound_stmts.rst:1507 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1512 +#: ../../reference/compound_stmts.rst:1517 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1512 +#: ../../reference/compound_stmts.rst:1517 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1536 +#: ../../reference/compound_stmts.rst:1541 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1581 +#: ../../reference/compound_stmts.rst:1586 msgid "async with" msgstr "async with" -#: ../../reference/compound_stmts.rst:1638 +#: ../../reference/compound_stmts.rst:1643 msgid "type parameters" msgstr "type parameter(型別參數)" diff --git a/reference/datamodel.po b/reference/datamodel.po index 2d2bbd0293..e0cbe8d2df 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2024-09-24 19:03+0900\n" "Last-Translator: Kisaragi Hiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2967,11 +2967,11 @@ msgstr "" #: ../../reference/datamodel.rst:2560 msgid "" -"Python methods (including those decorated with :func:`@staticmethod " -"` and :func:`@classmethod `) are implemented as " -"non-data descriptors. Accordingly, instances can redefine and override " -"methods. This allows individual instances to acquire behaviors that differ " -"from other instances of the same class." +"Python methods (including those decorated with :deco:`staticmethod` and :" +"deco:`classmethod`) are implemented as non-data descriptors. Accordingly, " +"instances can redefine and override methods. This allows individual " +"instances to acquire behaviors that differ from other instances of the same " +"class." msgstr "" #: ../../reference/datamodel.rst:2566 @@ -3600,8 +3600,8 @@ msgstr "" #: ../../reference/datamodel.rst:2992 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." +"method. As such, there is no need for it to be decorated with :deco:" +"`classmethod` when it is defined." msgstr "" #: ../../reference/datamodel.rst:2998 diff --git a/reference/executionmodel.po b/reference/executionmodel.po index a1c3731f11..d09914b954 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+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-" @@ -34,9 +34,9 @@ msgid "" "the interpreter or specified as a command line argument to the interpreter) " "is a code block. A script command (a command specified on the interpreter " "command line with the :option:`-c` option) is a code block. A module run as " -"a top level script (as module ``__main__``) from the command line using " -"a :option:`-m` argument is also a code block. The string argument passed to " -"the built-in functions :func:`eval` and :func:`exec` is a code block." +"a top level script (as module ``__main__``) from the command line using a :" +"option:`-m` argument is also a code block. The string argument passed to the " +"built-in functions :func:`eval` and :func:`exec` is a code block." msgstr "" #: ../../reference/executionmodel.rst:33 @@ -172,8 +172,8 @@ msgid "" "When a name is not found at all, a :exc:`NameError` exception is raised. If " "the current scope is a function scope, and the name refers to a local " "variable that has not yet been bound to a value at the point where the name " -"is used, an :exc:`UnboundLocalError` exception is " -"raised. :exc:`UnboundLocalError` is a subclass of :exc:`NameError`." +"is used, an :exc:`UnboundLocalError` exception is raised. :exc:" +"`UnboundLocalError` is a subclass of :exc:`NameError`." msgstr "" #: ../../reference/executionmodel.rst:127 @@ -194,12 +194,11 @@ msgid "" "names specified in the statement refer to the bindings of those names in the " "top-level namespace. Names are resolved in the top-level namespace by " "searching the global namespace, i.e. the namespace of the module containing " -"the code block, and the builtins namespace, the namespace of the " -"module :mod:`builtins`. The global namespace is searched first. If the " -"names are not found there, the builtins namespace is searched next. If the " -"names are also not found in the builtins namespace, new variables are " -"created in the global namespace. The global statement must precede all uses " -"of the listed names." +"the code block, and the builtins namespace, the namespace of the module :mod:" +"`builtins`. The global namespace is searched first. If the names are not " +"found there, the builtins namespace is searched next. If the names are also " +"not found in the builtins namespace, new variables are created in the global " +"namespace. The global statement must precede all uses of the listed names." msgstr "" #: ../../reference/executionmodel.rst:146 @@ -213,10 +212,10 @@ msgstr "" #: ../../reference/executionmodel.rst:152 msgid "" "The :keyword:`nonlocal` statement causes corresponding names to refer to " -"previously bound variables in the nearest enclosing function " -"scope. :exc:`SyntaxError` is raised at compile time if the given name does " -"not exist in any enclosing function scope. :ref:`Type parameters ` cannot be rebound with the :keyword:`!nonlocal` statement." +"previously bound variables in the nearest enclosing function scope. :exc:" +"`SyntaxError` is raised at compile time if the given name does not exist in " +"any enclosing function scope. :ref:`Type parameters ` cannot be " +"rebound with the :keyword:`!nonlocal` statement." msgstr "" #: ../../reference/executionmodel.rst:160 @@ -312,8 +311,8 @@ msgstr "" #: ../../reference/executionmodel.rst:209 msgid "" -"The bounds, constraints, and default values for type parameters " -"(:ref:`lazily evaluated `)." +"The bounds, constraints, and default values for type parameters (:ref:" +"`lazily evaluated `)." msgstr "" #: ../../reference/executionmodel.rst:211 @@ -338,17 +337,17 @@ msgstr "" #: ../../reference/executionmodel.rst:221 msgid "" "Expressions in annotation scopes cannot contain :keyword:`yield`, ``yield " -"from``, :keyword:`await`, or :token:`:= ` expressions. (These expressions are allowed " -"in other scopes contained within the annotation scope.)" +"from``, :keyword:`await`, or :token:`:= ` expressions. (These expressions are allowed in other " +"scopes contained within the annotation scope.)" msgstr "" #: ../../reference/executionmodel.rst:225 msgid "" -"Names defined in annotation scopes cannot be rebound " -"with :keyword:`nonlocal` statements in inner scopes. This includes only type " -"parameters, as no other syntactic elements that can appear within annotation " -"scopes can introduce new names." +"Names defined in annotation scopes cannot be rebound with :keyword:" +"`nonlocal` statements in inner scopes. This includes only type parameters, " +"as no other syntactic elements that can appear within annotation scopes can " +"introduce new names." msgstr "" #: ../../reference/executionmodel.rst:228 @@ -371,8 +370,8 @@ msgstr "" #: ../../reference/executionmodel.rst:240 msgid "" -"Annotation scopes are now also used for annotations, as specified " -"in :pep:`649` and :pep:`749`." +"Annotation scopes are now also used for annotations, as specified in :pep:" +"`649` and :pep:`749`." msgstr "" #: ../../reference/executionmodel.rst:247 @@ -462,9 +461,9 @@ msgstr "" #: ../../reference/executionmodel.rst:303 msgid "" "Users should not touch ``__builtins__``; it is strictly an implementation " -"detail. Users wanting to override values in the builtins namespace " -"should :keyword:`import` the :mod:`builtins` module and modify its " -"attributes appropriately." +"detail. Users wanting to override values in the builtins namespace should :" +"keyword:`import` the :mod:`builtins` module and modify its attributes " +"appropriately." msgstr "" #: ../../reference/executionmodel.rst:308 @@ -474,8 +473,8 @@ msgid "" "namespace; this should be a dictionary or a module (in the latter case the " "module's dictionary is used). By default, when in the :mod:`__main__` " "module, ``__builtins__`` is the built-in module :mod:`builtins`; when in any " -"other module, ``__builtins__`` is an alias for the dictionary of " -"the :mod:`builtins` module itself." +"other module, ``__builtins__`` is an alias for the dictionary of the :mod:" +"`builtins` module itself." msgstr "" #: ../../reference/executionmodel.rst:320 @@ -507,10 +506,10 @@ msgid "" "The :func:`eval` and :func:`exec` functions do not have access to the full " "environment for resolving names. Names may be resolved in the local and " "global namespaces of the caller. Free variables are not resolved in the " -"nearest enclosing namespace, but in the global namespace. [#]_ " -"The :func:`exec` and :func:`eval` functions have optional arguments to " -"override the global and local namespace. If only one namespace is " -"specified, it is used for both." +"nearest enclosing namespace, but in the global namespace. [#]_ The :func:" +"`exec` and :func:`eval` functions have optional arguments to override the " +"global and local namespace. If only one namespace is specified, it is used " +"for both." msgstr "" #: ../../reference/executionmodel.rst:347 @@ -531,9 +530,9 @@ msgid "" "The Python interpreter raises an exception when it detects a run-time error " "(such as division by zero). A Python program can also explicitly raise an " "exception with the :keyword:`raise` statement. Exception handlers are " -"specified with the :keyword:`try` ... :keyword:`except` statement. " -"The :keyword:`finally` clause of such a statement can be used to specify " -"cleanup code which does not handle the exception, but is executed whether an " +"specified with the :keyword:`try` ... :keyword:`except` statement. The :" +"keyword:`finally` clause of such a statement can be used to specify cleanup " +"code which does not handle the exception, but is executed whether an " "exception occurred or not in the preceding code." msgstr "" @@ -549,8 +548,8 @@ msgstr "" msgid "" "When an exception is not handled at all, the interpreter terminates " "execution of the program, or returns to its interactive main loop. In " -"either case, it prints a stack traceback, except when the exception " -"is :exc:`SystemExit`." +"either case, it prints a stack traceback, except when the exception is :exc:" +"`SystemExit`." msgstr "" #: ../../reference/executionmodel.rst:385 @@ -572,15 +571,283 @@ msgstr "" #: ../../reference/executionmodel.rst:397 msgid "" -"See also the description of the :keyword:`try` statement in " -"section :ref:`try` and :keyword:`raise` statement in section :ref:`raise`." +"See also the description of the :keyword:`try` statement in section :ref:" +"`try` and :keyword:`raise` statement in section :ref:`raise`." msgstr "" -#: ../../reference/executionmodel.rst:402 +#: ../../reference/executionmodel.rst:404 +msgid "Runtime Components" +msgstr "" + +#: ../../reference/executionmodel.rst:407 +msgid "General Computing Model" +msgstr "" + +#: ../../reference/executionmodel.rst:409 +msgid "" +"Python's execution model does not operate in a vacuum. It runs on a host " +"machine and through that host's runtime environment, including its operating " +"system (OS), if there is one. When a program runs, the conceptual layers of " +"how it runs on the host look something like this:" +msgstr "" + +#: ../../reference/executionmodel.rst:0 +msgid "**host machine**" +msgstr "" + +#: ../../reference/executionmodel.rst:0 +msgid "**process** (global resources)" +msgstr "" + +#: ../../reference/executionmodel.rst:0 +msgid "**thread** (runs machine code)" +msgstr "" + +#: ../../reference/executionmodel.rst:419 +msgid "" +"Each process represents a program running on the host. Think of each " +"process itself as the data part of its program. Think of the process' " +"threads as the execution part of the program. This distinction will be " +"important to understand the conceptual Python runtime." +msgstr "" + +#: ../../reference/executionmodel.rst:424 +msgid "" +"The process, as the data part, is the execution context in which the program " +"runs. It mostly consists of the set of resources assigned to the program by " +"the host, including memory, signals, file handles, sockets, and environment " +"variables." +msgstr "" + +#: ../../reference/executionmodel.rst:429 +msgid "" +"Processes are isolated and independent from one another. (The same is true " +"for hosts.) The host manages the process' access to its assigned resources, " +"in addition to coordinating between processes." +msgstr "" + +#: ../../reference/executionmodel.rst:433 +msgid "" +"Each thread represents the actual execution of the program's machine code, " +"running relative to the resources assigned to the program's process. It's " +"strictly up to the host how and when that execution takes place." +msgstr "" + +#: ../../reference/executionmodel.rst:438 +msgid "" +"From the point of view of Python, a program always starts with exactly one " +"thread. However, the program may grow to run in multiple simultaneous " +"threads. Not all hosts support multiple threads per process, but most do. " +"Unlike processes, threads in a process are not isolated and independent from " +"one another. Specifically, all threads in a process share all of the " +"process' resources." +msgstr "" + +#: ../../reference/executionmodel.rst:445 +msgid "" +"The fundamental point of threads is that each one does *run* independently, " +"at the same time as the others. That may be only conceptually at the same " +"time (\"concurrently\") or physically (\"in parallel\"). Either way, the " +"threads effectively run at a non-synchronized rate." +msgstr "" + +#: ../../reference/executionmodel.rst:453 +msgid "" +"That non-synchronized rate means none of the process' memory is guaranteed " +"to stay consistent for the code running in any given thread. Thus multi-" +"threaded programs must take care to coordinate access to intentionally " +"shared resources. Likewise, they must take care to be absolutely diligent " +"about not accessing any *other* resources in multiple threads; otherwise two " +"threads running at the same time might accidentally interfere with each " +"other's use of some shared data. All this is true for both Python programs " +"and the Python runtime." +msgstr "" + +#: ../../reference/executionmodel.rst:463 +msgid "" +"The cost of this broad, unstructured requirement is the tradeoff for the " +"kind of raw concurrency that threads provide. The alternative to the " +"required discipline generally means dealing with non-deterministic bugs and " +"data corruption." +msgstr "" + +#: ../../reference/executionmodel.rst:469 +msgid "Python Runtime Model" +msgstr "" + +#: ../../reference/executionmodel.rst:471 +msgid "" +"The same conceptual layers apply to each Python program, with some extra " +"data layers specific to Python:" +msgstr "" + +#: ../../reference/executionmodel.rst:0 +msgid "Python global runtime (*state*)" +msgstr "" + +#: ../../reference/executionmodel.rst:0 +msgid "Python interpreter (*state*)" +msgstr "" + +#: ../../reference/executionmodel.rst:0 +msgid "**thread** (runs Python bytecode and \"C-API\")" +msgstr "" + +#: ../../reference/executionmodel.rst:0 +msgid "Python thread *state*" +msgstr "" + +#: ../../reference/executionmodel.rst:481 +msgid "" +"At the conceptual level: when a Python program starts, it looks exactly like " +"that diagram, with one of each. The runtime may grow to include multiple " +"interpreters, and each interpreter may grow to include multiple thread " +"states." +msgstr "" + +#: ../../reference/executionmodel.rst:488 +msgid "" +"A Python implementation won't necessarily implement the runtime layers " +"distinctly or even concretely. The only exception is places where distinct " +"layers are directly specified or exposed to users, like through the :mod:" +"`threading` module." +msgstr "" + +#: ../../reference/executionmodel.rst:495 +msgid "" +"The initial interpreter is typically called the \"main\" interpreter. Some " +"Python implementations, like CPython, assign special roles to the main " +"interpreter." +msgstr "" + +#: ../../reference/executionmodel.rst:499 +msgid "" +"Likewise, the host thread where the runtime was initialized is known as the " +"\"main\" thread. It may be different from the process' initial thread, " +"though they are often the same. In some cases \"main thread\" may be even " +"more specific and refer to the initial thread state. A Python runtime might " +"assign specific responsibilities to the main thread, such as handling " +"signals." +msgstr "" + +#: ../../reference/executionmodel.rst:506 +msgid "" +"As a whole, the Python runtime consists of the global runtime state, " +"interpreters, and thread states. The runtime ensures all that state stays " +"consistent over its lifetime, particularly when used with multiple host " +"threads." +msgstr "" + +#: ../../reference/executionmodel.rst:511 +msgid "" +"The global runtime, at the conceptual level, is just a set of interpreters. " +"While those interpreters are otherwise isolated and independent from one " +"another, they may share some data or other resources. The runtime is " +"responsible for managing these global resources safely. The actual nature " +"and management of these resources is implementation-specific. Ultimately, " +"the external utility of the global runtime is limited to managing " +"interpreters." +msgstr "" + +#: ../../reference/executionmodel.rst:519 +msgid "" +"In contrast, an \"interpreter\" is conceptually what we would normally think " +"of as the (full-featured) \"Python runtime\". When machine code executing " +"in a host thread interacts with the Python runtime, it calls into Python in " +"the context of a specific interpreter." +msgstr "" + +#: ../../reference/executionmodel.rst:526 +msgid "" +"The term \"interpreter\" here is not the same as the \"bytecode " +"interpreter\", which is what regularly runs in threads, executing compiled " +"Python code." +msgstr "" + +#: ../../reference/executionmodel.rst:530 +msgid "" +"In an ideal world, \"Python runtime\" would refer to what we currently call " +"\"interpreter\". However, it's been called \"interpreter\" at least since " +"introduced in 1997 (`CPython:a027efa5b`_)." +msgstr "" + +#: ../../reference/executionmodel.rst:536 +msgid "" +"Each interpreter completely encapsulates all of the non-process-global, non-" +"thread-specific state needed for the Python runtime to work. Notably, the " +"interpreter's state persists between uses. It includes fundamental data " +"like :data:`sys.modules`. The runtime ensures multiple threads using the " +"same interpreter will safely share it between them." +msgstr "" + +#: ../../reference/executionmodel.rst:543 +msgid "" +"A Python implementation may support using multiple interpreters at the same " +"time in the same process. They are independent and isolated from one " +"another. For example, each interpreter has its own :data:`sys.modules`." +msgstr "" + +#: ../../reference/executionmodel.rst:548 +msgid "" +"For thread-specific runtime state, each interpreter has a set of thread " +"states, which it manages, in the same way the global runtime contains a set " +"of interpreters. It can have thread states for as many host threads as it " +"needs. It may even have multiple thread states for the same host thread, " +"though that isn't as common." +msgstr "" + +#: ../../reference/executionmodel.rst:554 +msgid "" +"Each thread state, conceptually, has all the thread-specific runtime data an " +"interpreter needs to operate in one host thread. The thread state includes " +"the current raised exception and the thread's Python call stack. It may " +"include other thread-specific resources." +msgstr "" + +#: ../../reference/executionmodel.rst:561 +msgid "" +"The term \"Python thread\" can sometimes refer to a thread state, but " +"normally it means a thread created using the :mod:`threading` module." +msgstr "" + +#: ../../reference/executionmodel.rst:564 +msgid "" +"Each thread state, over its lifetime, is always tied to exactly one " +"interpreter and exactly one host thread. It will only ever be used in that " +"thread and with that interpreter." +msgstr "" + +#: ../../reference/executionmodel.rst:568 +msgid "" +"Multiple thread states may be tied to the same host thread, whether for " +"different interpreters or even the same interpreter. However, for any given " +"host thread, only one of the thread states tied to it can be used by the " +"thread at a time." +msgstr "" + +#: ../../reference/executionmodel.rst:573 +msgid "" +"Thread states are isolated and independent from one another and don't share " +"any data, except for possibly sharing an interpreter and objects or other " +"resources belonging to that interpreter." +msgstr "" + +#: ../../reference/executionmodel.rst:577 +msgid "" +"Once a program is running, new Python threads can be created using the :mod:" +"`threading` module (on platforms and Python implementations that support " +"threads). Additional processes can be created using the :mod:`os`, :mod:" +"`subprocess`, and :mod:`multiprocessing` modules. Interpreters can be " +"created and used with the :mod:`~concurrent.interpreters` module. " +"Coroutines (async) can be run using :mod:`asyncio` in each interpreter, " +"typically only in a single thread (often the main thread)." +msgstr "" + +#: ../../reference/executionmodel.rst:588 msgid "Footnotes" msgstr "註解" -#: ../../reference/executionmodel.rst:403 +#: ../../reference/executionmodel.rst:589 msgid "" "This limitation occurs because the code that is executed by these operations " "is not available at the time the module is compiled." diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 77097686ef..195f1e49e0 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-10-09 00:15+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-" @@ -25,31 +25,192 @@ msgstr "詞法分析" msgid "" "A Python program is read by a *parser*. Input to the parser is a stream of :" "term:`tokens `, generated by the *lexical analyzer* (also known as " -"the *tokenizer*). This chapter describes how the lexical analyzer breaks a " -"file into tokens." +"the *tokenizer*). This chapter describes how the lexical analyzer produces " +"these tokens." msgstr "" #: ../../reference/lexical_analysis.rst:15 msgid "" -"Python reads program text as Unicode code points; the encoding of a source " -"file can be given by an encoding declaration and defaults to UTF-8, see :pep:" -"`3120` for details. If the source file cannot be decoded, a :exc:" -"`SyntaxError` is raised." +"The lexical analyzer determines the program text's :ref:`encoding " +"` (UTF-8 by default), and decodes the text into :ref:`source " +"characters `. If the text cannot be decoded, a :" +"exc:`SyntaxError` is raised." msgstr "" -#: ../../reference/lexical_analysis.rst:24 +#: ../../reference/lexical_analysis.rst:20 +msgid "" +"Next, the lexical analyzer uses the source characters to generate a stream " +"of tokens. The type of a generated token generally depends on the next " +"source character to be processed. Similarly, other special behavior of the " +"analyzer depends on the first source character that hasn't yet been " +"processed. The following table gives a quick summary of these source " +"characters, with links to sections that contain more information." +msgstr "" + +#: ../../reference/lexical_analysis.rst:30 +#, fuzzy +msgid "Character" +msgstr "hash character(井字號)" + +#: ../../reference/lexical_analysis.rst:31 +msgid "Next token (or other relevant documentation)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:33 +#: ../../reference/lexical_analysis.rst:266 +msgid "space" +msgstr "space(空白)" + +#: ../../reference/lexical_analysis.rst:34 +#: ../../reference/lexical_analysis.rst:266 +msgid "tab" +msgstr "tab(定位字元)" + +#: ../../reference/lexical_analysis.rst:35 +msgid "formfeed" +msgstr "" + +#: ../../reference/lexical_analysis.rst:36 +msgid ":ref:`Whitespace `" +msgstr "" + +#: ../../reference/lexical_analysis.rst:38 +msgid "CR, LF" +msgstr "" + +#: ../../reference/lexical_analysis.rst:39 +#, fuzzy +msgid ":ref:`New line `" +msgstr "line structure(列結構)" + +#: ../../reference/lexical_analysis.rst:40 +msgid ":ref:`Indentation `" +msgstr "" + +#: ../../reference/lexical_analysis.rst:42 +#, fuzzy +msgid "backslash (``\\``)" +msgstr "\\ (反斜線)" + +#: ../../reference/lexical_analysis.rst:43 +msgid ":ref:`Explicit line joining `" +msgstr "" + +#: ../../reference/lexical_analysis.rst:44 +msgid "(Also significant in :ref:`string escape sequences `)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:46 +msgid "hash (``#``)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:47 +msgid ":ref:`Comment `" +msgstr "" + +#: ../../reference/lexical_analysis.rst:49 +msgid "quote (``'``, ``\"``)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:50 +msgid ":ref:`String literal `" +msgstr "" + +#: ../../reference/lexical_analysis.rst:52 +msgid "ASCII letter (``a``-``z``, ``A``-``Z``)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:53 +#, fuzzy +msgid "non-ASCII character" +msgstr "hash character(井字號)" + +#: ../../reference/lexical_analysis.rst:54 +#: ../../reference/lexical_analysis.rst:58 +#, fuzzy +msgid ":ref:`Name `" +msgstr "_, identifiers(識別器)" + +#: ../../reference/lexical_analysis.rst:55 +msgid "Prefixed :ref:`string or bytes literal `" +msgstr "" + +#: ../../reference/lexical_analysis.rst:57 +#, fuzzy +msgid "underscore (``_``)" +msgstr "_ (底線)" + +#: ../../reference/lexical_analysis.rst:59 +msgid "(Can also be part of :ref:`numeric literals `)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:61 +msgid "number (``0``-``9``)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:62 +#: ../../reference/lexical_analysis.rst:65 +msgid ":ref:`Numeric literal `" +msgstr "" + +#: ../../reference/lexical_analysis.rst:64 +msgid "dot (``.``)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:66 +msgid ":ref:`Operator `" +msgstr "" + +#: ../../reference/lexical_analysis.rst:68 +msgid "question mark (``?``)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:69 +msgid "dollar (``$``)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:74 +msgid "backquote (``​`​``)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:75 +#, fuzzy +msgid "control character" +msgstr "八進位字元" + +#: ../../reference/lexical_analysis.rst:76 +msgid "Error (outside string literals and comments)" +msgstr "" + +#: ../../reference/lexical_analysis.rst:78 +msgid "other printing character" +msgstr "" + +#: ../../reference/lexical_analysis.rst:79 +msgid ":ref:`Operator or delimiter `" +msgstr "" + +#: ../../reference/lexical_analysis.rst:81 +msgid "end of file" +msgstr "" + +#: ../../reference/lexical_analysis.rst:82 +msgid ":ref:`End marker `" +msgstr "" + +#: ../../reference/lexical_analysis.rst:88 msgid "Line structure" msgstr "" -#: ../../reference/lexical_analysis.rst:28 +#: ../../reference/lexical_analysis.rst:92 msgid "A Python program is divided into a number of *logical lines*." msgstr "" -#: ../../reference/lexical_analysis.rst:34 +#: ../../reference/lexical_analysis.rst:98 msgid "Logical lines" msgstr "" -#: ../../reference/lexical_analysis.rst:38 +#: ../../reference/lexical_analysis.rst:102 msgid "" "The end of a logical line is represented by the token :data:`~token." "NEWLINE`. Statements cannot cross logical line boundaries except where :data:" @@ -59,31 +220,31 @@ msgid "" "` *line joining* rules." msgstr "" -#: ../../reference/lexical_analysis.rst:49 +#: ../../reference/lexical_analysis.rst:113 msgid "Physical lines" msgstr "" -#: ../../reference/lexical_analysis.rst:51 +#: ../../reference/lexical_analysis.rst:115 msgid "" "A physical line is a sequence of characters terminated by one the following " "end-of-line sequences:" msgstr "" -#: ../../reference/lexical_analysis.rst:54 +#: ../../reference/lexical_analysis.rst:118 msgid "the Unix form using ASCII LF (linefeed)," msgstr "" -#: ../../reference/lexical_analysis.rst:55 +#: ../../reference/lexical_analysis.rst:119 msgid "" "the Windows form using the ASCII sequence CR LF (return followed by " "linefeed)," msgstr "" -#: ../../reference/lexical_analysis.rst:56 +#: ../../reference/lexical_analysis.rst:120 msgid "the '`Classic Mac OS`__' form using the ASCII CR (return) character." msgstr "" -#: ../../reference/lexical_analysis.rst:60 +#: ../../reference/lexical_analysis.rst:124 msgid "" "Regardless of platform, each of these sequences is replaced by a single " "ASCII LF (linefeed) character. (This is done even inside :ref:`string " @@ -91,21 +252,21 @@ msgid "" "need to be consistent within a file." msgstr "" -#: ../../reference/lexical_analysis.rst:66 +#: ../../reference/lexical_analysis.rst:130 msgid "" "The end of input also serves as an implicit terminator for the final " "physical line." msgstr "" -#: ../../reference/lexical_analysis.rst:69 +#: ../../reference/lexical_analysis.rst:133 msgid "Formally:" msgstr "" -#: ../../reference/lexical_analysis.rst:80 +#: ../../reference/lexical_analysis.rst:144 msgid "Comments" msgstr "" -#: ../../reference/lexical_analysis.rst:85 +#: ../../reference/lexical_analysis.rst:149 msgid "" "A comment starts with a hash character (``#``) that is not part of a string " "literal, and ends at the end of the physical line. A comment signifies the " @@ -113,11 +274,11 @@ msgid "" "Comments are ignored by the syntax." msgstr "" -#: ../../reference/lexical_analysis.rst:94 +#: ../../reference/lexical_analysis.rst:158 msgid "Encoding declarations" msgstr "" -#: ../../reference/lexical_analysis.rst:99 +#: ../../reference/lexical_analysis.rst:163 msgid "" "If a comment in the first or second line of the Python script matches the " "regular expression ``coding[=:]\\s*([-\\w.]+)``, this comment is processed " @@ -127,23 +288,23 @@ msgid "" "comment-only line. The recommended forms of an encoding expression are ::" msgstr "" -#: ../../reference/lexical_analysis.rst:106 +#: ../../reference/lexical_analysis.rst:170 msgid "# -*- coding: -*-" msgstr "# -*- coding: -*-" -#: ../../reference/lexical_analysis.rst:108 +#: ../../reference/lexical_analysis.rst:172 msgid "which is recognized also by GNU Emacs, and ::" msgstr "" -#: ../../reference/lexical_analysis.rst:110 +#: ../../reference/lexical_analysis.rst:174 msgid "# vim:fileencoding=" msgstr "# vim:fileencoding=" -#: ../../reference/lexical_analysis.rst:112 +#: ../../reference/lexical_analysis.rst:176 msgid "which is recognized by Bram Moolenaar's VIM." msgstr "" -#: ../../reference/lexical_analysis.rst:114 +#: ../../reference/lexical_analysis.rst:178 msgid "" "If no encoding declaration is found, the default encoding is UTF-8. If the " "implicit or explicit encoding of a file is UTF-8, an initial UTF-8 byte-" @@ -151,25 +312,25 @@ msgid "" "error." msgstr "" -#: ../../reference/lexical_analysis.rst:118 +#: ../../reference/lexical_analysis.rst:182 msgid "" "If an encoding is declared, the encoding name must be recognized by Python " "(see :ref:`standard-encodings`). The encoding is used for all lexical " "analysis, including string literals, comments and identifiers." msgstr "" -#: ../../reference/lexical_analysis.rst:123 +#: ../../reference/lexical_analysis.rst:189 msgid "" "All lexical analysis, including string literals, comments and identifiers, " "works on Unicode text decoded using the source encoding. Any Unicode code " "point, except the NUL control character, can appear in Python source." msgstr "" -#: ../../reference/lexical_analysis.rst:137 +#: ../../reference/lexical_analysis.rst:203 msgid "Explicit line joining" msgstr "" -#: ../../reference/lexical_analysis.rst:141 +#: ../../reference/lexical_analysis.rst:207 msgid "" "Two or more physical lines may be joined into logical lines using backslash " "characters (``\\``), as follows: when a physical line ends in a backslash " @@ -178,7 +339,7 @@ msgid "" "following end-of-line character. For example::" msgstr "" -#: ../../reference/lexical_analysis.rst:147 +#: ../../reference/lexical_analysis.rst:213 msgid "" "if 1900 < year < 2100 and 1 <= month <= 12 \\\n" " and 1 <= day <= 31 and 0 <= hour < 24 \\\n" @@ -190,7 +351,7 @@ msgstr "" " and 0 <= minute < 60 and 0 <= second < 60: # 看起來像個有效日期\n" " return 1" -#: ../../reference/lexical_analysis.rst:152 +#: ../../reference/lexical_analysis.rst:218 msgid "" "A line ending in a backslash cannot carry a comment. A backslash does not " "continue a comment. A backslash does not continue a token except for string " @@ -199,17 +360,17 @@ msgid "" "line outside a string literal." msgstr "" -#: ../../reference/lexical_analysis.rst:162 +#: ../../reference/lexical_analysis.rst:228 msgid "Implicit line joining" msgstr "" -#: ../../reference/lexical_analysis.rst:164 +#: ../../reference/lexical_analysis.rst:230 msgid "" "Expressions in parentheses, square brackets or curly braces can be split " "over more than one physical line without using backslashes. For example::" msgstr "" -#: ../../reference/lexical_analysis.rst:167 +#: ../../reference/lexical_analysis.rst:233 msgid "" "month_names = ['Januari', 'Februari', 'Maart', # These are the\n" " 'April', 'Mei', 'Juni', # Dutch names\n" @@ -221,7 +382,7 @@ msgstr "" " 'Juli', 'Augustus', 'September', # 一年之中\n" " 'Oktober', 'November', 'December'] # 月份名稱" -#: ../../reference/lexical_analysis.rst:172 +#: ../../reference/lexical_analysis.rst:238 msgid "" "Implicitly continued lines can carry comments. The indentation of the " "continuation lines is not important. Blank continuation lines are allowed. " @@ -230,11 +391,11 @@ msgid "" "that case they cannot carry comments." msgstr "" -#: ../../reference/lexical_analysis.rst:182 +#: ../../reference/lexical_analysis.rst:248 msgid "Blank lines" msgstr "" -#: ../../reference/lexical_analysis.rst:186 +#: ../../reference/lexical_analysis.rst:252 msgid "" "A logical line that contains only spaces, tabs, formfeeds and possibly a " "comment, is ignored (i.e., no :data:`~token.NEWLINE` token is generated). " @@ -245,18 +406,18 @@ msgid "" "statement." msgstr "" -#: ../../reference/lexical_analysis.rst:198 +#: ../../reference/lexical_analysis.rst:264 msgid "Indentation" msgstr "" -#: ../../reference/lexical_analysis.rst:202 +#: ../../reference/lexical_analysis.rst:268 msgid "" "Leading whitespace (spaces and tabs) at the beginning of a logical line is " "used to compute the indentation level of the line, which in turn is used to " "determine the grouping of statements." msgstr "" -#: ../../reference/lexical_analysis.rst:206 +#: ../../reference/lexical_analysis.rst:272 msgid "" "Tabs are replaced (from left to right) by one to eight spaces such that the " "total number of characters up to and including the replacement is a multiple " @@ -267,14 +428,14 @@ msgid "" "the indentation." msgstr "" -#: ../../reference/lexical_analysis.rst:214 +#: ../../reference/lexical_analysis.rst:280 msgid "" "Indentation is rejected as inconsistent if a source file mixes tabs and " "spaces in a way that makes the meaning dependent on the worth of a tab in " "spaces; a :exc:`TabError` is raised in that case." msgstr "" -#: ../../reference/lexical_analysis.rst:218 +#: ../../reference/lexical_analysis.rst:284 msgid "" "**Cross-platform compatibility note:** because of the nature of text editors " "on non-UNIX platforms, it is unwise to use a mixture of spaces and tabs for " @@ -282,7 +443,7 @@ msgid "" "different platforms may explicitly limit the maximum indentation level." msgstr "" -#: ../../reference/lexical_analysis.rst:223 +#: ../../reference/lexical_analysis.rst:289 msgid "" "A formfeed character may be present at the start of the line; it will be " "ignored for the indentation calculations above. Formfeed characters " @@ -290,13 +451,13 @@ msgid "" "instance, they may reset the space count to zero)." msgstr "" -#: ../../reference/lexical_analysis.rst:230 +#: ../../reference/lexical_analysis.rst:296 msgid "" "The indentation levels of consecutive lines are used to generate :data:" "`~token.INDENT` and :data:`~token.DEDENT` tokens, using a stack, as follows." msgstr "" -#: ../../reference/lexical_analysis.rst:234 +#: ../../reference/lexical_analysis.rst:300 msgid "" "Before the first line of the file is read, a single zero is pushed on the " "stack; this will never be popped off again. The numbers pushed on the stack " @@ -311,13 +472,13 @@ msgid "" "than zero." msgstr "" -#: ../../reference/lexical_analysis.rst:245 +#: ../../reference/lexical_analysis.rst:311 msgid "" "Here is an example of a correctly (though confusingly) indented piece of " "Python code::" msgstr "" -#: ../../reference/lexical_analysis.rst:248 +#: ../../reference/lexical_analysis.rst:314 msgid "" "def perm(l):\n" " # Compute the list of all permutations of l\n" @@ -332,11 +493,11 @@ msgid "" " return r" msgstr "" -#: ../../reference/lexical_analysis.rst:260 +#: ../../reference/lexical_analysis.rst:326 msgid "The following example shows various indentation errors::" msgstr "" -#: ../../reference/lexical_analysis.rst:262 +#: ../../reference/lexical_analysis.rst:328 msgid "" " def perm(l): # error: first line indented\n" "for i in range(len(l)): # error: not indented\n" @@ -347,18 +508,18 @@ msgid "" " return r # error: inconsistent dedent" msgstr "" -#: ../../reference/lexical_analysis.rst:270 +#: ../../reference/lexical_analysis.rst:336 msgid "" "(Actually, the first three errors are detected by the parser; only the last " "error is found by the lexical analyzer --- the indentation of ``return r`` " "does not match a level popped off the stack.)" msgstr "" -#: ../../reference/lexical_analysis.rst:278 +#: ../../reference/lexical_analysis.rst:344 msgid "Whitespace between tokens" msgstr "" -#: ../../reference/lexical_analysis.rst:280 +#: ../../reference/lexical_analysis.rst:346 msgid "" "Except at the beginning of a logical line or in string literals, the " "whitespace characters space, tab and formfeed can be used interchangeably to " @@ -369,21 +530,21 @@ msgid "" "token." msgstr "" -#: ../../reference/lexical_analysis.rst:291 +#: ../../reference/lexical_analysis.rst:357 msgid "End marker" msgstr "" -#: ../../reference/lexical_analysis.rst:293 +#: ../../reference/lexical_analysis.rst:359 msgid "" "At the end of non-interactive input, the lexical analyzer generates an :data:" "`~token.ENDMARKER` token." msgstr "" -#: ../../reference/lexical_analysis.rst:300 +#: ../../reference/lexical_analysis.rst:366 msgid "Other tokens" msgstr "" -#: ../../reference/lexical_analysis.rst:302 +#: ../../reference/lexical_analysis.rst:368 msgid "" "Besides :data:`~token.NEWLINE`, :data:`~token.INDENT` and :data:`~token." "DEDENT`, the following categories of tokens exist: *identifiers* and " @@ -395,17 +556,17 @@ msgid "" "string that forms a legal token, when read from left to right." msgstr "" -#: ../../reference/lexical_analysis.rst:316 +#: ../../reference/lexical_analysis.rst:382 msgid "Names (identifiers and keywords)" msgstr "" -#: ../../reference/lexical_analysis.rst:320 +#: ../../reference/lexical_analysis.rst:386 msgid "" ":data:`~token.NAME` tokens represent *identifiers*, *keywords*, and *soft " "keywords*." msgstr "" -#: ../../reference/lexical_analysis.rst:323 +#: ../../reference/lexical_analysis.rst:389 msgid "" "Within the ASCII range (U+0001..U+007F), the valid characters for names " "include the uppercase and lowercase letters (``A-Z`` and ``a-z``), the " @@ -413,133 +574,133 @@ msgid "" "through ``9``." msgstr "" -#: ../../reference/lexical_analysis.rst:328 +#: ../../reference/lexical_analysis.rst:394 msgid "" "Names must contain at least one character, but have no upper length limit. " "Case is significant." msgstr "" -#: ../../reference/lexical_analysis.rst:331 +#: ../../reference/lexical_analysis.rst:397 msgid "" "Besides ``A-Z``, ``a-z``, ``_`` and ``0-9``, names can also use \"letter-" "like\" and \"number-like\" characters from outside the ASCII range, as " "detailed below." msgstr "" -#: ../../reference/lexical_analysis.rst:334 +#: ../../reference/lexical_analysis.rst:400 msgid "" "All identifiers are converted into the `normalization form`_ NFKC while " "parsing; comparison of identifiers is based on NFKC." msgstr "" -#: ../../reference/lexical_analysis.rst:337 +#: ../../reference/lexical_analysis.rst:403 msgid "" "Formally, the first character of a normalized identifier must belong to the " "set ``id_start``, which is the union of:" msgstr "" -#: ../../reference/lexical_analysis.rst:340 +#: ../../reference/lexical_analysis.rst:406 msgid "Unicode category ```` - uppercase letters (includes ``A`` to ``Z``)" msgstr "" -#: ../../reference/lexical_analysis.rst:341 +#: ../../reference/lexical_analysis.rst:407 msgid "Unicode category ```` - lowercase letters (includes ``a`` to ``z``)" msgstr "" -#: ../../reference/lexical_analysis.rst:342 +#: ../../reference/lexical_analysis.rst:408 msgid "Unicode category ```` - titlecase letters" msgstr "" -#: ../../reference/lexical_analysis.rst:343 +#: ../../reference/lexical_analysis.rst:409 msgid "Unicode category ```` - modifier letters" msgstr "" -#: ../../reference/lexical_analysis.rst:344 +#: ../../reference/lexical_analysis.rst:410 msgid "Unicode category ```` - other letters" msgstr "" -#: ../../reference/lexical_analysis.rst:345 +#: ../../reference/lexical_analysis.rst:411 msgid "Unicode category ```` - letter numbers" msgstr "" -#: ../../reference/lexical_analysis.rst:346 +#: ../../reference/lexical_analysis.rst:412 msgid "{``\"_\"``} - the underscore" msgstr "{``\"_\"``} - 底線" -#: ../../reference/lexical_analysis.rst:347 +#: ../../reference/lexical_analysis.rst:413 msgid "" "```` - an explicit set of characters in `PropList.txt`_ to " "support backwards compatibility" msgstr "" -#: ../../reference/lexical_analysis.rst:350 +#: ../../reference/lexical_analysis.rst:416 msgid "" "The remaining characters must belong to the set ``id_continue``, which is " "the union of:" msgstr "" -#: ../../reference/lexical_analysis.rst:353 +#: ../../reference/lexical_analysis.rst:419 msgid "all characters in ``id_start``" msgstr "" -#: ../../reference/lexical_analysis.rst:354 +#: ../../reference/lexical_analysis.rst:420 msgid "Unicode category ```` - decimal numbers (includes ``0`` to ``9``)" msgstr "" -#: ../../reference/lexical_analysis.rst:355 +#: ../../reference/lexical_analysis.rst:421 msgid "Unicode category ```` - connector punctuations" msgstr "" -#: ../../reference/lexical_analysis.rst:356 +#: ../../reference/lexical_analysis.rst:422 msgid "Unicode category ```` - nonspacing marks" msgstr "" -#: ../../reference/lexical_analysis.rst:357 +#: ../../reference/lexical_analysis.rst:423 msgid "Unicode category ```` - spacing combining marks" msgstr "" -#: ../../reference/lexical_analysis.rst:358 +#: ../../reference/lexical_analysis.rst:424 msgid "" "```` - another explicit set of characters in `PropList." "txt`_ to support backwards compatibility" msgstr "" -#: ../../reference/lexical_analysis.rst:361 +#: ../../reference/lexical_analysis.rst:427 msgid "" "Unicode categories use the version of the Unicode Character Database as " "included in the :mod:`unicodedata` module." msgstr "" -#: ../../reference/lexical_analysis.rst:364 +#: ../../reference/lexical_analysis.rst:430 msgid "" "These sets are based on the Unicode standard annex `UAX-31`_. See also :pep:" "`3131` for further details." msgstr "" -#: ../../reference/lexical_analysis.rst:367 +#: ../../reference/lexical_analysis.rst:433 msgid "" "Even more formally, names are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:381 +#: ../../reference/lexical_analysis.rst:447 msgid "" "A non-normative listing of all valid identifier characters as defined by " "Unicode is available in the `DerivedCoreProperties.txt`_ file in the Unicode " "Character Database." msgstr "" -#: ../../reference/lexical_analysis.rst:395 +#: ../../reference/lexical_analysis.rst:461 msgid "Keywords" msgstr "關鍵字" -#: ../../reference/lexical_analysis.rst:401 +#: ../../reference/lexical_analysis.rst:467 msgid "" "The following names are used as reserved words, or *keywords* of the " "language, and cannot be used as ordinary identifiers. They must be spelled " "exactly as written here:" msgstr "" -#: ../../reference/lexical_analysis.rst:405 +#: ../../reference/lexical_analysis.rst:471 msgid "" "False await else import pass\n" "None break except in raise\n" @@ -557,101 +718,101 @@ msgstr "" "assert del global not with\n" "async elif if or yield" -#: ../../reference/lexical_analysis.rst:419 +#: ../../reference/lexical_analysis.rst:485 msgid "Soft Keywords" msgstr "軟關鍵字" -#: ../../reference/lexical_analysis.rst:425 +#: ../../reference/lexical_analysis.rst:491 msgid "" "Some names are only reserved under specific contexts. These are known as " "*soft keywords*:" msgstr "" -#: ../../reference/lexical_analysis.rst:428 +#: ../../reference/lexical_analysis.rst:494 msgid "" "``match``, ``case``, and ``_``, when used in the :keyword:`match` statement." msgstr "" -#: ../../reference/lexical_analysis.rst:429 +#: ../../reference/lexical_analysis.rst:495 msgid "``type``, when used in the :keyword:`type` statement." msgstr "" -#: ../../reference/lexical_analysis.rst:431 +#: ../../reference/lexical_analysis.rst:497 msgid "" "These syntactically act as keywords in their specific contexts, but this " "distinction is done at the parser level, not when tokenizing." msgstr "" -#: ../../reference/lexical_analysis.rst:434 +#: ../../reference/lexical_analysis.rst:500 msgid "" "As soft keywords, their use in the grammar is possible while still " "preserving compatibility with existing code that uses these names as " "identifier names." msgstr "" -#: ../../reference/lexical_analysis.rst:438 +#: ../../reference/lexical_analysis.rst:504 msgid "``type`` is now a soft keyword." msgstr "``type`` 現在是軟關鍵字。" -#: ../../reference/lexical_analysis.rst:447 +#: ../../reference/lexical_analysis.rst:513 msgid "Reserved classes of identifiers" msgstr "" -#: ../../reference/lexical_analysis.rst:449 +#: ../../reference/lexical_analysis.rst:515 msgid "" "Certain classes of identifiers (besides keywords) have special meanings. " "These classes are identified by the patterns of leading and trailing " "underscore characters:" msgstr "" -#: ../../reference/lexical_analysis.rst:453 +#: ../../reference/lexical_analysis.rst:519 msgid "``_*``" msgstr "``_*``" -#: ../../reference/lexical_analysis.rst:454 +#: ../../reference/lexical_analysis.rst:520 msgid "Not imported by ``from module import *``." msgstr "" -#: ../../reference/lexical_analysis.rst:456 +#: ../../reference/lexical_analysis.rst:522 msgid "``_``" msgstr "``_``" -#: ../../reference/lexical_analysis.rst:457 +#: ../../reference/lexical_analysis.rst:523 msgid "" "In a ``case`` pattern within a :keyword:`match` statement, ``_`` is a :ref:" "`soft keyword ` that denotes a :ref:`wildcard `." msgstr "" -#: ../../reference/lexical_analysis.rst:461 +#: ../../reference/lexical_analysis.rst:527 msgid "" "Separately, the interactive interpreter makes the result of the last " "evaluation available in the variable ``_``. (It is stored in the :mod:" "`builtins` module, alongside built-in functions like ``print``.)" msgstr "" -#: ../../reference/lexical_analysis.rst:466 +#: ../../reference/lexical_analysis.rst:532 msgid "" "Elsewhere, ``_`` is a regular identifier. It is often used to name " "\"special\" items, but it is not special to Python itself." msgstr "" -#: ../../reference/lexical_analysis.rst:471 +#: ../../reference/lexical_analysis.rst:537 msgid "" "The name ``_`` is often used in conjunction with internationalization; refer " "to the documentation for the :mod:`gettext` module for more information on " "this convention." msgstr "" -#: ../../reference/lexical_analysis.rst:475 +#: ../../reference/lexical_analysis.rst:541 msgid "It is also commonly used for unused variables." msgstr "" -#: ../../reference/lexical_analysis.rst:477 +#: ../../reference/lexical_analysis.rst:543 msgid "``__*__``" msgstr "``__*__``" -#: ../../reference/lexical_analysis.rst:478 +#: ../../reference/lexical_analysis.rst:544 msgid "" "System-defined names, informally known as \"dunder\" names. These names are " "defined by the interpreter and its implementation (including the standard " @@ -661,11 +822,11 @@ msgid "" "explicitly documented use, is subject to breakage without warning." msgstr "" -#: ../../reference/lexical_analysis.rst:485 +#: ../../reference/lexical_analysis.rst:551 msgid "``__*``" msgstr "``__*``" -#: ../../reference/lexical_analysis.rst:486 +#: ../../reference/lexical_analysis.rst:552 msgid "" "Class-private names. Names in this category, when used within the context " "of a class definition, are re-written to use a mangled form to help avoid " @@ -673,38 +834,38 @@ msgid "" "section :ref:`atom-identifiers`." msgstr "" -#: ../../reference/lexical_analysis.rst:495 +#: ../../reference/lexical_analysis.rst:561 msgid "Literals" msgstr "" -#: ../../reference/lexical_analysis.rst:499 +#: ../../reference/lexical_analysis.rst:565 msgid "Literals are notations for constant values of some built-in types." msgstr "" -#: ../../reference/lexical_analysis.rst:501 +#: ../../reference/lexical_analysis.rst:567 msgid "" "In terms of lexical analysis, Python has :ref:`string, bytes ` and :" "ref:`numeric ` literals." msgstr "" -#: ../../reference/lexical_analysis.rst:504 +#: ../../reference/lexical_analysis.rst:570 msgid "" "Other \"literals\" are lexically denoted using :ref:`keywords ` " "(``None``, ``True``, ``False``) and the special :ref:`ellipsis token " "` (``...``)." msgstr "" -#: ../../reference/lexical_analysis.rst:515 +#: ../../reference/lexical_analysis.rst:581 msgid "String and Bytes literals" msgstr "" -#: ../../reference/lexical_analysis.rst:517 +#: ../../reference/lexical_analysis.rst:583 msgid "" "String literals are text enclosed in single quotes (``'``) or double quotes " "(``\"``). For example:" msgstr "" -#: ../../reference/lexical_analysis.rst:520 +#: ../../reference/lexical_analysis.rst:586 msgid "" "\"spam\"\n" "'eggs'" @@ -712,14 +873,14 @@ msgstr "" "\"spam\"\n" "'eggs'" -#: ../../reference/lexical_analysis.rst:525 +#: ../../reference/lexical_analysis.rst:591 msgid "" "The quote used to start the literal also terminates it, so a string literal " "can only contain the other quote (except with escape sequences, see below). " "For example:" msgstr "" -#: ../../reference/lexical_analysis.rst:529 +#: ../../reference/lexical_analysis.rst:595 msgid "" "'Say \"Hello\", please.'\n" "\"Don't do that!\"" @@ -727,13 +888,13 @@ msgstr "" "'Say \"Hello\", please.'\n" "\"Don't do that!\"" -#: ../../reference/lexical_analysis.rst:534 +#: ../../reference/lexical_analysis.rst:600 msgid "" "Except for this limitation, the choice of quote character (``'`` or ``\"``) " "does not affect how the literal is parsed." msgstr "" -#: ../../reference/lexical_analysis.rst:537 +#: ../../reference/lexical_analysis.rst:603 msgid "" "Inside a string literal, the backslash (``\\``) character introduces an :dfn:" "`escape sequence`, which has special meaning depending on the character " @@ -741,64 +902,64 @@ msgid "" "character, and does *not* end the string:" msgstr "" -#: ../../reference/lexical_analysis.rst:543 +#: ../../reference/lexical_analysis.rst:609 msgid "" ">>> print(\"Say \\\"Hello\\\" to everyone!\")\n" "Say \"Hello\" to everyone!" msgstr "" -#: ../../reference/lexical_analysis.rst:548 +#: ../../reference/lexical_analysis.rst:614 msgid "" "See :ref:`escape sequences ` below for a full list of such " "sequences, and more details." msgstr "" -#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:623 msgid "Triple-quoted strings" msgstr "三引號字串" -#: ../../reference/lexical_analysis.rst:559 +#: ../../reference/lexical_analysis.rst:625 msgid "" "Strings can also be enclosed in matching groups of three single or double " "quotes. These are generally referred to as :dfn:`triple-quoted strings`::" msgstr "" -#: ../../reference/lexical_analysis.rst:563 +#: ../../reference/lexical_analysis.rst:629 msgid "\"\"\"This is a triple-quoted string.\"\"\"" msgstr "\"\"\"這是一個三引號字串。\"\"\"" -#: ../../reference/lexical_analysis.rst:565 +#: ../../reference/lexical_analysis.rst:631 msgid "" "In triple-quoted literals, unescaped quotes are allowed (and are retained), " "except that three unescaped quotes in a row terminate the literal, if they " "are of the same kind (``'`` or ``\"``) used at the start::" msgstr "" -#: ../../reference/lexical_analysis.rst:569 +#: ../../reference/lexical_analysis.rst:635 msgid "\"\"\"This string has \"quotes\" inside.\"\"\"" msgstr "\"\"\"這個字串裡面有 \"引號\"。\"\"\"" -#: ../../reference/lexical_analysis.rst:571 +#: ../../reference/lexical_analysis.rst:637 msgid "Unescaped newlines are also allowed and retained::" msgstr "" -#: ../../reference/lexical_analysis.rst:573 +#: ../../reference/lexical_analysis.rst:639 msgid "" "'''This triple-quoted string\n" "continues on the next line.'''" msgstr "" -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:648 msgid "String prefixes" msgstr "" -#: ../../reference/lexical_analysis.rst:584 +#: ../../reference/lexical_analysis.rst:650 msgid "" "String literals can have an optional :dfn:`prefix` that influences how the " "content of the literal is parsed, for example:" msgstr "" -#: ../../reference/lexical_analysis.rst:587 +#: ../../reference/lexical_analysis.rst:653 msgid "" "b\"data\"\n" "f'{result=}'" @@ -806,35 +967,35 @@ msgstr "" "b\"data\"\n" "f'{result=}'" -#: ../../reference/lexical_analysis.rst:592 +#: ../../reference/lexical_analysis.rst:658 msgid "The allowed prefixes are:" msgstr "" -#: ../../reference/lexical_analysis.rst:594 +#: ../../reference/lexical_analysis.rst:660 msgid "``b``: :ref:`Bytes literal `" msgstr "" -#: ../../reference/lexical_analysis.rst:595 +#: ../../reference/lexical_analysis.rst:661 msgid "``r``: :ref:`Raw string `" msgstr "" -#: ../../reference/lexical_analysis.rst:596 +#: ../../reference/lexical_analysis.rst:662 msgid "``f``: :ref:`Formatted string literal ` (\"f-string\")" msgstr "" -#: ../../reference/lexical_analysis.rst:597 +#: ../../reference/lexical_analysis.rst:663 msgid "``t``: :ref:`Template string literal ` (\"t-string\")" msgstr "" -#: ../../reference/lexical_analysis.rst:598 +#: ../../reference/lexical_analysis.rst:664 msgid "``u``: No effect (allowed for backwards compatibility)" msgstr "" -#: ../../reference/lexical_analysis.rst:600 +#: ../../reference/lexical_analysis.rst:666 msgid "See the linked sections for details on each type." msgstr "" -#: ../../reference/lexical_analysis.rst:602 +#: ../../reference/lexical_analysis.rst:668 msgid "" "Prefixes are case-insensitive (for example, '``B``' works the same as " "'``b``'). The '``r``' prefix can be combined with '``f``', '``t``' or " @@ -842,220 +1003,220 @@ msgid "" "are also valid prefixes." msgstr "" -#: ../../reference/lexical_analysis.rst:606 +#: ../../reference/lexical_analysis.rst:672 msgid "" "The ``'rb'`` prefix of raw bytes literals has been added as a synonym of " "``'br'``." msgstr "" -#: ../../reference/lexical_analysis.rst:610 +#: ../../reference/lexical_analysis.rst:676 msgid "" "Support for the unicode legacy literal (``u'value'``) was reintroduced to " "simplify the maintenance of dual Python 2.x and 3.x codebases. See :pep:" "`414` for more information." msgstr "" -#: ../../reference/lexical_analysis.rst:616 +#: ../../reference/lexical_analysis.rst:682 msgid "Formal grammar" msgstr "" -#: ../../reference/lexical_analysis.rst:618 +#: ../../reference/lexical_analysis.rst:684 msgid "" "String literals, except :ref:`\"f-strings\" ` and :ref:`\"t-" "strings\" `, are described by the following lexical definitions." msgstr "" -#: ../../reference/lexical_analysis.rst:622 +#: ../../reference/lexical_analysis.rst:688 msgid "" "These definitions use :ref:`negative lookaheads ` (``!" "``) to indicate that an ending quote ends the literal." msgstr "" -#: ../../reference/lexical_analysis.rst:640 +#: ../../reference/lexical_analysis.rst:706 msgid "" "Note that as in all lexical definitions, whitespace is significant. In " "particular, the prefix (if any) must be immediately followed by the starting " "quote." msgstr "" -#: ../../reference/lexical_analysis.rst:662 +#: ../../reference/lexical_analysis.rst:728 msgid "Escape sequences" msgstr "跳脫序列" -#: ../../reference/lexical_analysis.rst:664 +#: ../../reference/lexical_analysis.rst:730 msgid "" "Unless an '``r``' or '``R``' prefix is present, escape sequences in string " "and bytes literals are interpreted according to rules similar to those used " "by Standard C. The recognized escape sequences are:" msgstr "" -#: ../../reference/lexical_analysis.rst:672 +#: ../../reference/lexical_analysis.rst:738 msgid "Escape Sequence" msgstr "" -#: ../../reference/lexical_analysis.rst:673 +#: ../../reference/lexical_analysis.rst:739 msgid "Meaning" msgstr "含義" -#: ../../reference/lexical_analysis.rst:674 +#: ../../reference/lexical_analysis.rst:740 msgid "``\\``\\ " msgstr "``\\``\\ " -#: ../../reference/lexical_analysis.rst:675 +#: ../../reference/lexical_analysis.rst:741 msgid ":ref:`string-escape-ignore`" msgstr ":ref:`string-escape-ignore`" -#: ../../reference/lexical_analysis.rst:676 +#: ../../reference/lexical_analysis.rst:742 msgid "``\\\\``" msgstr "``\\\\``" -#: ../../reference/lexical_analysis.rst:677 +#: ../../reference/lexical_analysis.rst:743 msgid ":ref:`Backslash `" msgstr "" -#: ../../reference/lexical_analysis.rst:678 +#: ../../reference/lexical_analysis.rst:744 msgid "``\\'``" msgstr "``\\'``" -#: ../../reference/lexical_analysis.rst:679 +#: ../../reference/lexical_analysis.rst:745 msgid ":ref:`Single quote `" msgstr "" -#: ../../reference/lexical_analysis.rst:680 +#: ../../reference/lexical_analysis.rst:746 msgid "``\\\"``" msgstr "``\\\"``" -#: ../../reference/lexical_analysis.rst:681 +#: ../../reference/lexical_analysis.rst:747 msgid ":ref:`Double quote `" msgstr "" -#: ../../reference/lexical_analysis.rst:682 +#: ../../reference/lexical_analysis.rst:748 msgid "``\\a``" msgstr "``\\a``" -#: ../../reference/lexical_analysis.rst:683 +#: ../../reference/lexical_analysis.rst:749 msgid "ASCII Bell (BEL)" msgstr "" -#: ../../reference/lexical_analysis.rst:684 +#: ../../reference/lexical_analysis.rst:750 msgid "``\\b``" msgstr "``\\b``" -#: ../../reference/lexical_analysis.rst:685 +#: ../../reference/lexical_analysis.rst:751 msgid "ASCII Backspace (BS)" msgstr "" -#: ../../reference/lexical_analysis.rst:686 +#: ../../reference/lexical_analysis.rst:752 msgid "``\\f``" msgstr "``\\f``" -#: ../../reference/lexical_analysis.rst:687 +#: ../../reference/lexical_analysis.rst:753 msgid "ASCII Formfeed (FF)" msgstr "" -#: ../../reference/lexical_analysis.rst:688 +#: ../../reference/lexical_analysis.rst:754 msgid "``\\n``" msgstr "``\\n``" -#: ../../reference/lexical_analysis.rst:689 +#: ../../reference/lexical_analysis.rst:755 msgid "ASCII Linefeed (LF)" msgstr "" -#: ../../reference/lexical_analysis.rst:690 +#: ../../reference/lexical_analysis.rst:756 msgid "``\\r``" msgstr "``\\r``" -#: ../../reference/lexical_analysis.rst:691 +#: ../../reference/lexical_analysis.rst:757 msgid "ASCII Carriage Return (CR)" msgstr "" -#: ../../reference/lexical_analysis.rst:692 +#: ../../reference/lexical_analysis.rst:758 msgid "``\\t``" msgstr "``\\t``" -#: ../../reference/lexical_analysis.rst:693 +#: ../../reference/lexical_analysis.rst:759 msgid "ASCII Horizontal Tab (TAB)" msgstr "" -#: ../../reference/lexical_analysis.rst:694 +#: ../../reference/lexical_analysis.rst:760 msgid "``\\v``" msgstr "``\\v``" -#: ../../reference/lexical_analysis.rst:695 +#: ../../reference/lexical_analysis.rst:761 msgid "ASCII Vertical Tab (VT)" msgstr "" -#: ../../reference/lexical_analysis.rst:696 +#: ../../reference/lexical_analysis.rst:762 msgid ":samp:`\\\\\\\\{ooo}`" msgstr ":samp:`\\\\\\\\{ooo}`" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:763 msgid ":ref:`string-escape-oct`" msgstr ":ref:`string-escape-oct`" -#: ../../reference/lexical_analysis.rst:698 +#: ../../reference/lexical_analysis.rst:764 msgid ":samp:`\\\\x{hh}`" msgstr ":samp:`\\\\x{hh}`" -#: ../../reference/lexical_analysis.rst:699 +#: ../../reference/lexical_analysis.rst:765 msgid ":ref:`string-escape-hex`" msgstr ":ref:`string-escape-hex`" -#: ../../reference/lexical_analysis.rst:700 +#: ../../reference/lexical_analysis.rst:766 msgid ":samp:`\\\\N\\\\{{name}\\\\}`" msgstr ":samp:`\\\\N\\\\{{name}\\\\}`" -#: ../../reference/lexical_analysis.rst:701 +#: ../../reference/lexical_analysis.rst:767 msgid ":ref:`string-escape-named`" msgstr ":ref:`string-escape-named`" -#: ../../reference/lexical_analysis.rst:702 +#: ../../reference/lexical_analysis.rst:768 msgid ":samp:`\\\\u{xxxx}`" msgstr ":samp:`\\\\u{xxxx}`" -#: ../../reference/lexical_analysis.rst:703 -#: ../../reference/lexical_analysis.rst:705 +#: ../../reference/lexical_analysis.rst:769 +#: ../../reference/lexical_analysis.rst:771 msgid ":ref:`Hexadecimal Unicode character `" msgstr "" -#: ../../reference/lexical_analysis.rst:704 +#: ../../reference/lexical_analysis.rst:770 msgid ":samp:`\\\\U{xxxxxxxx}`" msgstr ":samp:`\\\\U{xxxxxxxx}`" -#: ../../reference/lexical_analysis.rst:710 +#: ../../reference/lexical_analysis.rst:776 msgid "Ignored end of line" msgstr "" -#: ../../reference/lexical_analysis.rst:712 +#: ../../reference/lexical_analysis.rst:778 msgid "A backslash can be added at the end of a line to ignore the newline::" msgstr "" -#: ../../reference/lexical_analysis.rst:714 +#: ../../reference/lexical_analysis.rst:780 msgid "" ">>> 'This string will not include \\\n" "... backslashes or newline characters.'\n" "'This string will not include backslashes or newline characters.'" msgstr "" -#: ../../reference/lexical_analysis.rst:718 +#: ../../reference/lexical_analysis.rst:784 msgid "" "The same result can be achieved using :ref:`triple-quoted strings " "`, or parentheses and :ref:`string literal concatenation `." msgstr "" -#: ../../reference/lexical_analysis.rst:724 +#: ../../reference/lexical_analysis.rst:790 msgid "Escaped characters" msgstr "跳脫字元" -#: ../../reference/lexical_analysis.rst:726 +#: ../../reference/lexical_analysis.rst:792 msgid "" "To include a backslash in a non-:ref:`raw ` Python string " "literal, it must be doubled. The ``\\\\`` escape sequence denotes a single " "backslash character::" msgstr "" -#: ../../reference/lexical_analysis.rst:730 +#: ../../reference/lexical_analysis.rst:796 msgid "" ">>> print('C:\\\\Program Files')\n" "C:\\Program Files" @@ -1063,13 +1224,13 @@ msgstr "" ">>> print('C:\\\\Program Files')\n" "C:\\Program Files" -#: ../../reference/lexical_analysis.rst:733 +#: ../../reference/lexical_analysis.rst:799 msgid "" "Similarly, the ``\\'`` and ``\\\"`` sequences denote the single and double " "quote character, respectively::" msgstr "" -#: ../../reference/lexical_analysis.rst:736 +#: ../../reference/lexical_analysis.rst:802 msgid "" ">>> print('\\' and \\\"')\n" "' and \"" @@ -1077,17 +1238,17 @@ msgstr "" ">>> print('\\' and \\\"')\n" "' and \"" -#: ../../reference/lexical_analysis.rst:742 +#: ../../reference/lexical_analysis.rst:808 msgid "Octal character" msgstr "八進位字元" -#: ../../reference/lexical_analysis.rst:744 +#: ../../reference/lexical_analysis.rst:810 msgid "" "The sequence :samp:`\\\\\\\\{ooo}` denotes a *character* with the octal " "(base 8) value *ooo*::" msgstr "" -#: ../../reference/lexical_analysis.rst:747 +#: ../../reference/lexical_analysis.rst:813 msgid "" ">>> '\\120'\n" "'P'" @@ -1095,41 +1256,41 @@ msgstr "" ">>> '\\120'\n" "'P'" -#: ../../reference/lexical_analysis.rst:750 +#: ../../reference/lexical_analysis.rst:816 msgid "Up to three octal digits (0 through 7) are accepted." msgstr "" -#: ../../reference/lexical_analysis.rst:752 -#: ../../reference/lexical_analysis.rst:777 +#: ../../reference/lexical_analysis.rst:818 +#: ../../reference/lexical_analysis.rst:843 msgid "" "In a bytes literal, *character* means a *byte* with the given value. In a " "string literal, it means a Unicode character with the given value." msgstr "" -#: ../../reference/lexical_analysis.rst:755 +#: ../../reference/lexical_analysis.rst:821 msgid "" "Octal escapes with value larger than ``0o377`` (255) produce a :exc:" "`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:759 +#: ../../reference/lexical_analysis.rst:825 msgid "" "Octal escapes with value larger than ``0o377`` (255) produce a :exc:" "`SyntaxWarning`. In a future Python version they will raise a :exc:" "`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:767 +#: ../../reference/lexical_analysis.rst:833 msgid "Hexadecimal character" msgstr "十六進位字元" -#: ../../reference/lexical_analysis.rst:769 +#: ../../reference/lexical_analysis.rst:835 msgid "" "The sequence :samp:`\\\\x{hh}` denotes a *character* with the hex (base 16) " "value *hh*::" msgstr "" -#: ../../reference/lexical_analysis.rst:772 +#: ../../reference/lexical_analysis.rst:838 msgid "" ">>> '\\x50'\n" "'P'" @@ -1137,21 +1298,21 @@ msgstr "" ">>> '\\x50'\n" "'P'" -#: ../../reference/lexical_analysis.rst:775 +#: ../../reference/lexical_analysis.rst:841 msgid "Unlike in Standard C, exactly two hex digits are required." msgstr "與標準 C 不同,這裡需要剛好兩個十六進位數字。" -#: ../../reference/lexical_analysis.rst:783 +#: ../../reference/lexical_analysis.rst:849 msgid "Named Unicode character" msgstr "" -#: ../../reference/lexical_analysis.rst:785 +#: ../../reference/lexical_analysis.rst:851 msgid "" "The sequence :samp:`\\\\N\\\\{{name}\\\\}` denotes a Unicode character with " "the given *name*::" msgstr "" -#: ../../reference/lexical_analysis.rst:788 +#: ../../reference/lexical_analysis.rst:854 msgid "" ">>> '\\N{LATIN CAPITAL LETTER P}'\n" "'P'\n" @@ -1163,11 +1324,11 @@ msgstr "" ">>> '\\N{SNAKE}'\n" "'🐍'" -#: ../../reference/lexical_analysis.rst:793 +#: ../../reference/lexical_analysis.rst:859 msgid "This sequence cannot appear in :ref:`bytes literals `." msgstr "" -#: ../../reference/lexical_analysis.rst:795 +#: ../../reference/lexical_analysis.rst:861 msgid "" "Support for `name aliases `__ has been added." @@ -1175,11 +1336,11 @@ msgstr "" "已新增對\\ `名稱別名 (name alias) `__\\ 的支援。" -#: ../../reference/lexical_analysis.rst:802 +#: ../../reference/lexical_analysis.rst:868 msgid "Hexadecimal Unicode characters" msgstr "十六進位 Unicode 字元" -#: ../../reference/lexical_analysis.rst:804 +#: ../../reference/lexical_analysis.rst:870 msgid "" "These sequences :samp:`\\\\u{xxxx}` and :samp:`\\\\U{xxxxxxxx}` denote the " "Unicode character with the given hex (base 16) value. Exactly four digits " @@ -1187,7 +1348,7 @@ msgid "" "latter can encode any Unicode character." msgstr "" -#: ../../reference/lexical_analysis.rst:810 +#: ../../reference/lexical_analysis.rst:876 msgid "" ">>> '\\u1234'\n" "'ሴ'\n" @@ -1199,21 +1360,21 @@ msgstr "" ">>> '\\U0001f40d'\n" "'🐍'" -#: ../../reference/lexical_analysis.rst:817 +#: ../../reference/lexical_analysis.rst:883 msgid "These sequences cannot appear in :ref:`bytes literals `." msgstr "" -#: ../../reference/lexical_analysis.rst:823 +#: ../../reference/lexical_analysis.rst:889 msgid "Unrecognized escape sequences" msgstr "無法辨識的跳脫序列" -#: ../../reference/lexical_analysis.rst:825 +#: ../../reference/lexical_analysis.rst:891 msgid "" "Unlike in Standard C, all unrecognized escape sequences are left in the " "string unchanged, that is, *the backslash is left in the result*::" msgstr "" -#: ../../reference/lexical_analysis.rst:828 +#: ../../reference/lexical_analysis.rst:894 msgid "" ">>> print('\\q')\n" "\\q\n" @@ -1225,28 +1386,28 @@ msgstr "" ">>> list('\\q')\n" "['\\\\', 'q']" -#: ../../reference/lexical_analysis.rst:833 +#: ../../reference/lexical_analysis.rst:899 msgid "" "Note that for bytes literals, the escape sequences only recognized in string " "literals (``\\N...``, ``\\u...``, ``\\U...``) fall into the category of " "unrecognized escapes." msgstr "" -#: ../../reference/lexical_analysis.rst:837 +#: ../../reference/lexical_analysis.rst:903 msgid "Unrecognized escape sequences produce a :exc:`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:840 +#: ../../reference/lexical_analysis.rst:906 msgid "" "Unrecognized escape sequences produce a :exc:`SyntaxWarning`. In a future " "Python version they will raise a :exc:`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:853 +#: ../../reference/lexical_analysis.rst:919 msgid "Bytes literals" msgstr "位元組常數" -#: ../../reference/lexical_analysis.rst:855 +#: ../../reference/lexical_analysis.rst:921 msgid "" ":dfn:`Bytes literals` are always prefixed with '``b``' or '``B``'; they " "produce an instance of the :class:`bytes` type instead of the :class:`str` " @@ -1255,7 +1416,7 @@ msgid "" "`string-escape-hex` or :ref:`string-escape-oct`):" msgstr "" -#: ../../reference/lexical_analysis.rst:861 +#: ../../reference/lexical_analysis.rst:927 msgid "" ">>> b'\\x89PNG\\r\\n\\x1a\\n'\n" "b'\\x89PNG\\r\\n\\x1a\\n'\n" @@ -1267,17 +1428,17 @@ msgstr "" ">>> list(b'\\x89PNG\\r\\n\\x1a\\n')\n" "[137, 80, 78, 71, 13, 10, 26, 10]" -#: ../../reference/lexical_analysis.rst:868 +#: ../../reference/lexical_analysis.rst:934 msgid "" "Similarly, a zero byte must be expressed using an escape sequence (typically " "``\\0`` or ``\\x00``)." msgstr "" -#: ../../reference/lexical_analysis.rst:879 +#: ../../reference/lexical_analysis.rst:945 msgid "Raw string literals" msgstr "原始字串常數" -#: ../../reference/lexical_analysis.rst:881 +#: ../../reference/lexical_analysis.rst:947 msgid "" "Both string and bytes literals may optionally be prefixed with a letter " "'``r``' or '``R``'; such constructs are called :dfn:`raw string literals` " @@ -1286,7 +1447,7 @@ msgid "" "` are not treated specially:" msgstr "" -#: ../../reference/lexical_analysis.rst:888 +#: ../../reference/lexical_analysis.rst:954 msgid "" ">>> r'\\d{4}-\\d{2}-\\d{2}'\n" "'\\\\d{4}-\\\\d{2}-\\\\d{2}'" @@ -1294,7 +1455,7 @@ msgstr "" ">>> r'\\d{4}-\\d{2}-\\d{2}'\n" "'\\\\d{4}-\\\\d{2}-\\\\d{2}'" -#: ../../reference/lexical_analysis.rst:893 +#: ../../reference/lexical_analysis.rst:959 msgid "" "Even in a raw literal, quotes can be escaped with a backslash, but the " "backslash remains in the result; for example, ``r\"\\\"\"`` is a valid " @@ -1307,11 +1468,11 @@ msgid "" "continuation." msgstr "" -#: ../../reference/lexical_analysis.rst:921 +#: ../../reference/lexical_analysis.rst:987 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:925 +#: ../../reference/lexical_analysis.rst:991 msgid "" "A :dfn:`formatted string literal` or :dfn:`f-string` is a string literal " "that is prefixed with '``f``' or '``F``'. These strings may contain " @@ -1320,14 +1481,14 @@ msgid "" "are really expressions evaluated at run time." msgstr "" -#: ../../reference/lexical_analysis.rst:931 +#: ../../reference/lexical_analysis.rst:997 msgid "" "Escape sequences are decoded like in ordinary string literals (except when a " "literal is also marked as a raw string). After decoding, the grammar for " "the contents of the string is:" msgstr "" -#: ../../reference/lexical_analysis.rst:945 +#: ../../reference/lexical_analysis.rst:1011 msgid "" "The parts of the string outside curly braces are treated literally, except " "that any doubled curly braces ``'{{'`` or ``'}}'`` are replaced with the " @@ -1340,7 +1501,7 @@ msgid "" "replacement field ends with a closing curly bracket ``'}'``." msgstr "" -#: ../../reference/lexical_analysis.rst:955 +#: ../../reference/lexical_analysis.rst:1021 msgid "" "Expressions in formatted string literals are treated like regular Python " "expressions surrounded by parentheses, with a few exceptions. An empty " @@ -1354,7 +1515,7 @@ msgid "" "replacement fields must be closed in a different line." msgstr "" -#: ../../reference/lexical_analysis.rst:966 +#: ../../reference/lexical_analysis.rst:1032 msgid "" ">>> f\"abc{a # This is a comment }\"\n" "... + 3}\"\n" @@ -1364,20 +1525,20 @@ msgstr "" "... + 3}\"\n" "'abc5'" -#: ../../reference/lexical_analysis.rst:972 +#: ../../reference/lexical_analysis.rst:1038 msgid "" "Prior to Python 3.7, an :keyword:`await` expression and comprehensions " "containing an :keyword:`async for` clause were illegal in the expressions in " "formatted string literals due to a problem with the implementation." msgstr "" -#: ../../reference/lexical_analysis.rst:977 +#: ../../reference/lexical_analysis.rst:1043 msgid "" "Prior to Python 3.12, comments were not allowed inside f-string replacement " "fields." msgstr "" -#: ../../reference/lexical_analysis.rst:981 +#: ../../reference/lexical_analysis.rst:1047 msgid "" "When the equal sign ``'='`` is provided, the output will have the expression " "text, the ``'='`` and the evaluated value. Spaces after the opening brace " @@ -1388,18 +1549,18 @@ msgid "" "r'`` is declared." msgstr "" -#: ../../reference/lexical_analysis.rst:989 +#: ../../reference/lexical_analysis.rst:1055 msgid "The equal sign ``'='``." msgstr "等號 ``'='``。" -#: ../../reference/lexical_analysis.rst:992 +#: ../../reference/lexical_analysis.rst:1058 msgid "" "If a conversion is specified, the result of evaluating the expression is " "converted before formatting. Conversion ``'!s'`` calls :func:`str` on the " "result, ``'!r'`` calls :func:`repr`, and ``'!a'`` calls :func:`ascii`." msgstr "" -#: ../../reference/lexical_analysis.rst:996 +#: ../../reference/lexical_analysis.rst:1062 msgid "" "The result is then formatted using the :func:`format` protocol. The format " "specifier is passed to the :meth:`~object.__format__` method of the " @@ -1408,7 +1569,7 @@ msgid "" "value of the whole string." msgstr "" -#: ../../reference/lexical_analysis.rst:1002 +#: ../../reference/lexical_analysis.rst:1068 msgid "" "Top-level format specifiers may include nested replacement fields. These " "nested fields may include their own conversion fields and :ref:`format " @@ -1417,17 +1578,17 @@ msgid "" "as that used by the :meth:`str.format` method." msgstr "" -#: ../../reference/lexical_analysis.rst:1008 +#: ../../reference/lexical_analysis.rst:1074 msgid "" "Formatted string literals may be concatenated, but replacement fields cannot " "be split across literals." msgstr "" -#: ../../reference/lexical_analysis.rst:1011 +#: ../../reference/lexical_analysis.rst:1077 msgid "Some examples of formatted string literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:1013 +#: ../../reference/lexical_analysis.rst:1079 msgid "" ">>> name = \"Fred\"\n" ">>> f\"He said his name is {name!r}.\"\n" @@ -1459,13 +1620,13 @@ msgid "" "'line = \"The mill\\'s closed\" '" msgstr "" -#: ../../reference/lexical_analysis.rst:1043 +#: ../../reference/lexical_analysis.rst:1109 msgid "" "Reusing the outer f-string quoting type inside a replacement field is " "permitted::" msgstr "" -#: ../../reference/lexical_analysis.rst:1046 +#: ../../reference/lexical_analysis.rst:1112 msgid "" ">>> a = dict(x=2)\n" ">>> f\"abc {a[\"x\"]} def\"\n" @@ -1475,19 +1636,19 @@ msgstr "" ">>> f\"abc {a[\"x\"]} def\"\n" "'abc 2 def'" -#: ../../reference/lexical_analysis.rst:1050 +#: ../../reference/lexical_analysis.rst:1116 msgid "" "Prior to Python 3.12, reuse of the same quoting type of the outer f-string " "inside a replacement field was not possible." msgstr "" -#: ../../reference/lexical_analysis.rst:1054 +#: ../../reference/lexical_analysis.rst:1120 msgid "" "Backslashes are also allowed in replacement fields and are evaluated the " "same way as in any other context::" msgstr "" -#: ../../reference/lexical_analysis.rst:1057 +#: ../../reference/lexical_analysis.rst:1123 msgid "" ">>> a = [\"a\", \"b\", \"c\"]\n" ">>> print(f\"List a contains:\\n{\"\\n\".join(a)}\")\n" @@ -1503,19 +1664,19 @@ msgstr "" "b\n" "c" -#: ../../reference/lexical_analysis.rst:1064 +#: ../../reference/lexical_analysis.rst:1130 msgid "" "Prior to Python 3.12, backslashes were not permitted inside an f-string " "replacement field." msgstr "" -#: ../../reference/lexical_analysis.rst:1068 +#: ../../reference/lexical_analysis.rst:1134 msgid "" "Formatted string literals cannot be used as docstrings, even if they do not " "include expressions." msgstr "" -#: ../../reference/lexical_analysis.rst:1073 +#: ../../reference/lexical_analysis.rst:1139 msgid "" ">>> def foo():\n" "... f\"Not a docstring\"\n" @@ -1529,17 +1690,17 @@ msgstr "" ">>> foo.__doc__ is None\n" "True" -#: ../../reference/lexical_analysis.rst:1079 +#: ../../reference/lexical_analysis.rst:1145 msgid "" "See also :pep:`498` for the proposal that added formatted string literals, " "and :meth:`str.format`, which uses a related format string mechanism." msgstr "" -#: ../../reference/lexical_analysis.rst:1087 +#: ../../reference/lexical_analysis.rst:1153 msgid "t-strings" msgstr "t-string(t 字串)" -#: ../../reference/lexical_analysis.rst:1091 +#: ../../reference/lexical_analysis.rst:1157 msgid "" "A :dfn:`template string literal` or :dfn:`t-string` is a string literal that " "is prefixed with '``t``' or '``T``'. These strings follow the same syntax " @@ -1547,13 +1708,13 @@ msgid "" "the following differences:" msgstr "" -#: ../../reference/lexical_analysis.rst:1096 +#: ../../reference/lexical_analysis.rst:1162 msgid "" "Rather than evaluating to a ``str`` object, template string literals " "evaluate to a :class:`string.templatelib.Template` object." msgstr "" -#: ../../reference/lexical_analysis.rst:1099 +#: ../../reference/lexical_analysis.rst:1165 msgid "" "The :func:`format` protocol is not used. Instead, the format specifier and " "conversions (if any) are passed to a new :class:`~string.templatelib." @@ -1562,7 +1723,7 @@ msgid "" "Template` object to decide how to handle format specifiers and conversions." msgstr "" -#: ../../reference/lexical_analysis.rst:1106 +#: ../../reference/lexical_analysis.rst:1172 msgid "" "Format specifiers containing nested replacement fields are evaluated " "eagerly, prior to being passed to the :class:`~string.templatelib." @@ -1572,7 +1733,7 @@ msgid "" "to be ``2``, the resulting format specifier would be ``'.2f'``." msgstr "" -#: ../../reference/lexical_analysis.rst:1114 +#: ../../reference/lexical_analysis.rst:1180 msgid "" "When the equals sign ``'='`` is provided in an interpolation expression, the " "text of the expression is appended to the literal string that precedes the " @@ -1584,17 +1745,17 @@ msgid "" "behaviour." msgstr "" -#: ../../reference/lexical_analysis.rst:1128 +#: ../../reference/lexical_analysis.rst:1194 msgid "Numeric literals" msgstr "" -#: ../../reference/lexical_analysis.rst:1134 +#: ../../reference/lexical_analysis.rst:1200 msgid "" ":data:`~token.NUMBER` tokens represent numeric literals, of which there are " "three types: integers, floating-point numbers, and imaginary numbers." msgstr "" -#: ../../reference/lexical_analysis.rst:1142 +#: ../../reference/lexical_analysis.rst:1208 msgid "" "The numeric value of a numeric literal is the same as if it were passed as a " "string to the :class:`int`, :class:`float` or :class:`complex` class " @@ -1602,21 +1763,21 @@ msgid "" "constructors are also valid literals." msgstr "" -#: ../../reference/lexical_analysis.rst:1147 +#: ../../reference/lexical_analysis.rst:1213 msgid "" "Numeric literals do not include a sign; a phrase like ``-1`` is actually an " "expression composed of the unary operator '``-``' and the literal ``1``." msgstr "" -#: ../../reference/lexical_analysis.rst:1161 +#: ../../reference/lexical_analysis.rst:1227 msgid "Integer literals" msgstr "" -#: ../../reference/lexical_analysis.rst:1163 +#: ../../reference/lexical_analysis.rst:1229 msgid "Integer literals denote whole numbers. For example::" msgstr "" -#: ../../reference/lexical_analysis.rst:1165 +#: ../../reference/lexical_analysis.rst:1231 msgid "" "7\n" "3\n" @@ -1626,24 +1787,24 @@ msgstr "" "3\n" "2147483647" -#: ../../reference/lexical_analysis.rst:1169 +#: ../../reference/lexical_analysis.rst:1235 msgid "" "There is no limit for the length of integer literals apart from what can be " "stored in available memory::" msgstr "" -#: ../../reference/lexical_analysis.rst:1172 +#: ../../reference/lexical_analysis.rst:1238 msgid "7922816251426433759354395033679228162514264337593543950336" msgstr "7922816251426433759354395033679228162514264337593543950336" -#: ../../reference/lexical_analysis.rst:1174 +#: ../../reference/lexical_analysis.rst:1240 msgid "" "Underscores can be used to group digits for enhanced readability, and are " "ignored for determining the numeric value of the literal. For example, the " "following literals are equivalent::" msgstr "" -#: ../../reference/lexical_analysis.rst:1178 +#: ../../reference/lexical_analysis.rst:1244 msgid "" "100_000_000_000\n" "100000000000\n" @@ -1653,13 +1814,13 @@ msgstr "" "100000000000\n" "1_00_00_00_00_000" -#: ../../reference/lexical_analysis.rst:1182 +#: ../../reference/lexical_analysis.rst:1248 msgid "" "Underscores can only occur between digits. For example, ``_123``, ``321_``, " "and ``123__321`` are *not* valid literals." msgstr "" -#: ../../reference/lexical_analysis.rst:1185 +#: ../../reference/lexical_analysis.rst:1251 msgid "" "Integers can be specified in binary (base 2), octal (base 8), or hexadecimal " "(base 16) using the prefixes ``0b``, ``0o`` and ``0x``, respectively. " @@ -1667,7 +1828,7 @@ msgid "" "case-insensitive. For example::" msgstr "" -#: ../../reference/lexical_analysis.rst:1190 +#: ../../reference/lexical_analysis.rst:1256 msgid "" "0b100110111\n" "0b_1110_0101\n" @@ -1683,47 +1844,47 @@ msgstr "" "0xdeadbeef\n" "0xDead_Beef" -#: ../../reference/lexical_analysis.rst:1197 +#: ../../reference/lexical_analysis.rst:1263 msgid "" "An underscore can follow the base specifier. For example, ``0x_1f`` is a " "valid literal, but ``0_x1f`` and ``0x__1f`` are not." msgstr "" -#: ../../reference/lexical_analysis.rst:1201 +#: ../../reference/lexical_analysis.rst:1267 msgid "" "Leading zeros in a non-zero decimal number are not allowed. For example, " "``0123`` is not a valid literal. This is for disambiguation with C-style " "octal literals, which Python used before version 3.0." msgstr "" -#: ../../reference/lexical_analysis.rst:1206 +#: ../../reference/lexical_analysis.rst:1272 msgid "" "Formally, integer literals are described by the following lexical " "definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:1223 -#: ../../reference/lexical_analysis.rst:1287 +#: ../../reference/lexical_analysis.rst:1289 +#: ../../reference/lexical_analysis.rst:1353 msgid "Underscores are now allowed for grouping purposes in literals." msgstr "" -#: ../../reference/lexical_analysis.rst:1234 +#: ../../reference/lexical_analysis.rst:1300 msgid "Floating-point literals" msgstr "浮點數常數 (Floating-point literals)" -#: ../../reference/lexical_analysis.rst:1236 +#: ../../reference/lexical_analysis.rst:1302 msgid "" "Floating-point (float) literals, such as ``3.14`` or ``1.5``, denote :ref:" "`approximations of real numbers `." msgstr "" -#: ../../reference/lexical_analysis.rst:1239 +#: ../../reference/lexical_analysis.rst:1305 msgid "" "They consist of *integer* and *fraction* parts, each composed of decimal " "digits. The parts are separated by a decimal point, ``.``::" msgstr "" -#: ../../reference/lexical_analysis.rst:1242 +#: ../../reference/lexical_analysis.rst:1308 msgid "" "2.71828\n" "4.0" @@ -1731,19 +1892,19 @@ msgstr "" "2.71828\n" "4.0" -#: ../../reference/lexical_analysis.rst:1245 +#: ../../reference/lexical_analysis.rst:1311 msgid "" "Unlike in integer literals, leading zeros are allowed in the numeric parts. " "For example, ``077.010`` is legal, and denotes the same number as ``77.10``." msgstr "" -#: ../../reference/lexical_analysis.rst:1248 +#: ../../reference/lexical_analysis.rst:1314 msgid "" "As in integer literals, single underscores may occur between digits to help " "readability::" msgstr "" -#: ../../reference/lexical_analysis.rst:1251 +#: ../../reference/lexical_analysis.rst:1317 msgid "" "96_485.332_123\n" "3.14_15_93" @@ -1751,11 +1912,11 @@ msgstr "" "96_485.332_123\n" "3.14_15_93" -#: ../../reference/lexical_analysis.rst:1254 +#: ../../reference/lexical_analysis.rst:1320 msgid "Either of these parts, but not both, can be empty. For example::" msgstr "" -#: ../../reference/lexical_analysis.rst:1256 +#: ../../reference/lexical_analysis.rst:1322 msgid "" "10. # (equivalent to 10.0)\n" ".001 # (equivalent to 0.001)" @@ -1763,7 +1924,7 @@ msgstr "" "10. # (相當於 10.0)\n" ".001 # (相當於 0.001)" -#: ../../reference/lexical_analysis.rst:1259 +#: ../../reference/lexical_analysis.rst:1325 msgid "" "Optionally, the integer and fraction may be followed by an *exponent*: the " "letter ``e`` or ``E``, followed by an optional sign, ``+`` or ``-``, and a " @@ -1771,20 +1932,20 @@ msgid "" "``E`` represents \"times ten raised to the power of\"::" msgstr "" -#: ../../reference/lexical_analysis.rst:1264 +#: ../../reference/lexical_analysis.rst:1330 msgid "" "1.0e3 # (represents 1.0×10³, or 1000.0)\n" "1.166e-5 # (represents 1.166×10⁻⁵, or 0.00001166)\n" "6.02214076e+23 # (represents 6.02214076×10²³, or 602214076000000000000000.)" msgstr "" -#: ../../reference/lexical_analysis.rst:1268 +#: ../../reference/lexical_analysis.rst:1334 msgid "" "In floats with only integer and exponent parts, the decimal point may be " "omitted::" msgstr "" -#: ../../reference/lexical_analysis.rst:1271 +#: ../../reference/lexical_analysis.rst:1337 msgid "" "1e3 # (equivalent to 1.e3 and 1.0e3)\n" "0e0 # (equivalent to 0.)" @@ -1792,35 +1953,35 @@ msgstr "" "1e3 # (相當於 1.e3 和 1.0e3)\n" "0e0 # (相當於 0.)" -#: ../../reference/lexical_analysis.rst:1274 +#: ../../reference/lexical_analysis.rst:1340 msgid "" "Formally, floating-point literals are described by the following lexical " "definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:1296 +#: ../../reference/lexical_analysis.rst:1362 msgid "Imaginary literals" msgstr "" -#: ../../reference/lexical_analysis.rst:1298 +#: ../../reference/lexical_analysis.rst:1364 msgid "" "Python has :ref:`complex number ` objects, but no complex " "literals. Instead, *imaginary literals* denote complex numbers with a zero " "real part." msgstr "" -#: ../../reference/lexical_analysis.rst:1303 +#: ../../reference/lexical_analysis.rst:1369 msgid "" "For example, in math, the complex number 3+4.2\\ *i* is written as the real " "number 3 added to the imaginary number 4.2\\ *i*. Python uses a similar " "syntax, except the imaginary unit is written as ``j`` rather than *i*::" msgstr "" -#: ../../reference/lexical_analysis.rst:1308 +#: ../../reference/lexical_analysis.rst:1374 msgid "3+4.2j" msgstr "3+4.2j" -#: ../../reference/lexical_analysis.rst:1310 +#: ../../reference/lexical_analysis.rst:1376 msgid "" "This is an expression composed of the :ref:`integer literal ` " "``3``, the :ref:`operator ` '``+``', and the :ref:`imaginary " @@ -1828,23 +1989,23 @@ msgid "" "whitespace is allowed between them::" msgstr "" -#: ../../reference/lexical_analysis.rst:1316 +#: ../../reference/lexical_analysis.rst:1382 msgid "3 + 4.2j" msgstr "3 + 4.2j" -#: ../../reference/lexical_analysis.rst:1318 +#: ../../reference/lexical_analysis.rst:1384 msgid "" "No whitespace is allowed *within* each token. In particular, the ``j`` " "suffix, may not be separated from the number before it." msgstr "" -#: ../../reference/lexical_analysis.rst:1322 +#: ../../reference/lexical_analysis.rst:1388 msgid "" "The number before the ``j`` has the same syntax as a floating-point literal. " "Thus, the following are valid imaginary literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:1325 +#: ../../reference/lexical_analysis.rst:1391 msgid "" "4.2j\n" "3.14j\n" @@ -1862,14 +2023,14 @@ msgstr "" "3.14e-10j\n" "3.14_15_93j" -#: ../../reference/lexical_analysis.rst:1333 +#: ../../reference/lexical_analysis.rst:1399 msgid "" "Unlike in a floating-point literal the decimal point can be omitted if the " "imaginary number only has an integer part. The number is still evaluated as " "a floating-point number, not an integer::" msgstr "" -#: ../../reference/lexical_analysis.rst:1337 +#: ../../reference/lexical_analysis.rst:1403 msgid "" "10j\n" "0j\n" @@ -1879,26 +2040,26 @@ msgstr "" "0j\n" "1000000000000000000000000j # 相當於 1e+24j" -#: ../../reference/lexical_analysis.rst:1341 +#: ../../reference/lexical_analysis.rst:1407 msgid "" "The ``j`` suffix is case-insensitive. That means you can use ``J`` instead::" msgstr "" -#: ../../reference/lexical_analysis.rst:1344 +#: ../../reference/lexical_analysis.rst:1410 msgid "3.14J # equivalent to 3.14j" msgstr "" -#: ../../reference/lexical_analysis.rst:1346 +#: ../../reference/lexical_analysis.rst:1412 msgid "" "Formally, imaginary literals are described by the following lexical " "definition:" msgstr "" -#: ../../reference/lexical_analysis.rst:1359 +#: ../../reference/lexical_analysis.rst:1425 msgid "Operators and delimiters" msgstr "" -#: ../../reference/lexical_analysis.rst:1365 +#: ../../reference/lexical_analysis.rst:1431 msgid "" "The following grammar defines :dfn:`operator` and :dfn:`delimiter` tokens, " "that is, the generic :data:`~token.OP` token type. A :ref:`list of these " @@ -1906,14 +2067,14 @@ msgid "" "the :mod:`!token` module documentation." msgstr "" -#: ../../reference/lexical_analysis.rst:1394 +#: ../../reference/lexical_analysis.rst:1460 msgid "" "Generally, *operators* are used to combine :ref:`expressions `, " "while *delimiters* serve other purposes. However, there is no clear, formal " "distinction between the two categories." msgstr "" -#: ../../reference/lexical_analysis.rst:1398 +#: ../../reference/lexical_analysis.rst:1464 msgid "" "Some tokens can serve as either operators or delimiters, depending on usage. " "For example, ``*`` is both the multiplication operator and a delimiter used " @@ -1921,20 +2082,20 @@ msgid "" "delimiter that introduces decorators." msgstr "" -#: ../../reference/lexical_analysis.rst:1403 +#: ../../reference/lexical_analysis.rst:1469 msgid "" "For some tokens, the distinction is unclear. For example, some people " "consider ``.``, ``(``, and ``)`` to be delimiters, while others see the :py:" "func:`getattr` operator and the function call operator(s)." msgstr "" -#: ../../reference/lexical_analysis.rst:1407 +#: ../../reference/lexical_analysis.rst:1473 msgid "" "Some of Python's operators, like ``and``, ``or``, and ``not in``, use :ref:" "`keyword ` tokens rather than \"symbols\" (operator tokens)." msgstr "" -#: ../../reference/lexical_analysis.rst:1410 +#: ../../reference/lexical_analysis.rst:1476 msgid "" "A sequence of three consecutive periods (``...``) has a special meaning as " "an :py:data:`Ellipsis` literal." @@ -1952,406 +2113,398 @@ msgstr "parser(剖析器)" msgid "token" msgstr "token" -#: ../../reference/lexical_analysis.rst:26 +#: ../../reference/lexical_analysis.rst:90 msgid "line structure" msgstr "line structure(列結構)" -#: ../../reference/lexical_analysis.rst:36 +#: ../../reference/lexical_analysis.rst:100 msgid "logical line" msgstr "logical line(邏輯列)" -#: ../../reference/lexical_analysis.rst:36 -#: ../../reference/lexical_analysis.rst:139 -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:100 +#: ../../reference/lexical_analysis.rst:205 +#: ../../reference/lexical_analysis.rst:710 msgid "physical line" msgstr "physical line(物理列)" -#: ../../reference/lexical_analysis.rst:36 -#: ../../reference/lexical_analysis.rst:139 +#: ../../reference/lexical_analysis.rst:100 +#: ../../reference/lexical_analysis.rst:205 msgid "line joining" msgstr "line joining(列連接)" -#: ../../reference/lexical_analysis.rst:36 +#: ../../reference/lexical_analysis.rst:100 msgid "NEWLINE token" msgstr "NEWLINE token(換行標誌)" -#: ../../reference/lexical_analysis.rst:82 +#: ../../reference/lexical_analysis.rst:146 msgid "comment" msgstr "comment(註解)" -#: ../../reference/lexical_analysis.rst:82 +#: ../../reference/lexical_analysis.rst:146 msgid "hash character" msgstr "hash character(井字號)" -#: ../../reference/lexical_analysis.rst:82 -#: ../../reference/lexical_analysis.rst:96 +#: ../../reference/lexical_analysis.rst:146 +#: ../../reference/lexical_analysis.rst:160 msgid "# (hash)" msgstr "# (井字號)" -#: ../../reference/lexical_analysis.rst:96 +#: ../../reference/lexical_analysis.rst:160 msgid "source character set" msgstr "source character set(原始字元集合)" -#: ../../reference/lexical_analysis.rst:96 +#: ../../reference/lexical_analysis.rst:160 msgid "encoding declarations (source file)" msgstr "encoding declarations (source file)(編碼宣告(原始檔案))" -#: ../../reference/lexical_analysis.rst:96 +#: ../../reference/lexical_analysis.rst:160 msgid "source encoding declaration" msgstr "source encoding declaration(原始編碼宣告)" -#: ../../reference/lexical_analysis.rst:139 +#: ../../reference/lexical_analysis.rst:205 msgid "line continuation" msgstr "line continuation(列延續)" -#: ../../reference/lexical_analysis.rst:139 +#: ../../reference/lexical_analysis.rst:205 msgid "backslash character" msgstr "backslash character(反斜線字元)" -#: ../../reference/lexical_analysis.rst:184 +#: ../../reference/lexical_analysis.rst:250 msgid "blank line" msgstr "blank line(空白列)" -#: ../../reference/lexical_analysis.rst:200 +#: ../../reference/lexical_analysis.rst:266 msgid "indentation" msgstr "indentation(縮排)" -#: ../../reference/lexical_analysis.rst:200 +#: ../../reference/lexical_analysis.rst:266 msgid "leading whitespace" msgstr "leading whitespace(前置空白)" -#: ../../reference/lexical_analysis.rst:200 -msgid "space" -msgstr "space(空白)" - -#: ../../reference/lexical_analysis.rst:200 -msgid "tab" -msgstr "tab(定位字元)" - -#: ../../reference/lexical_analysis.rst:200 +#: ../../reference/lexical_analysis.rst:266 msgid "grouping" msgstr "grouping(群組)" -#: ../../reference/lexical_analysis.rst:200 +#: ../../reference/lexical_analysis.rst:266 msgid "statement grouping" msgstr "statement grouping(陳述式群組)" -#: ../../reference/lexical_analysis.rst:228 +#: ../../reference/lexical_analysis.rst:294 msgid "INDENT token" msgstr "INDENT token(縮排標誌)" -#: ../../reference/lexical_analysis.rst:228 +#: ../../reference/lexical_analysis.rst:294 msgid "DEDENT token" msgstr "DEDENT token(縮排標誌)" -#: ../../reference/lexical_analysis.rst:318 +#: ../../reference/lexical_analysis.rst:384 msgid "identifier" msgstr "identifier(識別器)" -#: ../../reference/lexical_analysis.rst:318 +#: ../../reference/lexical_analysis.rst:384 msgid "name" msgstr "name(名稱)" -#: ../../reference/lexical_analysis.rst:397 -#: ../../reference/lexical_analysis.rst:421 +#: ../../reference/lexical_analysis.rst:463 +#: ../../reference/lexical_analysis.rst:487 msgid "keyword" msgstr "keyword(關鍵字)" -#: ../../reference/lexical_analysis.rst:397 +#: ../../reference/lexical_analysis.rst:463 msgid "reserved word" msgstr "reserved word(保留字)" -#: ../../reference/lexical_analysis.rst:421 +#: ../../reference/lexical_analysis.rst:487 msgid "soft keyword" msgstr "soft keyword(軟關鍵字)" -#: ../../reference/lexical_analysis.rst:441 +#: ../../reference/lexical_analysis.rst:507 msgid "_, identifiers" msgstr "_, identifiers(識別器)" -#: ../../reference/lexical_analysis.rst:441 +#: ../../reference/lexical_analysis.rst:507 msgid "__, identifiers" msgstr "__, identifiers(識別器)" -#: ../../reference/lexical_analysis.rst:497 +#: ../../reference/lexical_analysis.rst:563 msgid "literal" msgstr "literal(常數)" -#: ../../reference/lexical_analysis.rst:497 +#: ../../reference/lexical_analysis.rst:563 msgid "constant" msgstr "constant(常數)" -#: ../../reference/lexical_analysis.rst:509 -#: ../../reference/lexical_analysis.rst:552 -#: ../../reference/lexical_analysis.rst:577 +#: ../../reference/lexical_analysis.rst:575 +#: ../../reference/lexical_analysis.rst:618 +#: ../../reference/lexical_analysis.rst:643 msgid "string literal" msgstr "string literal(字串常數)" -#: ../../reference/lexical_analysis.rst:509 -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:575 +#: ../../reference/lexical_analysis.rst:911 msgid "bytes literal" msgstr "bytes literal(位元組常數)" -#: ../../reference/lexical_analysis.rst:509 +#: ../../reference/lexical_analysis.rst:575 msgid "ASCII" msgstr "ASCII" -#: ../../reference/lexical_analysis.rst:509 +#: ../../reference/lexical_analysis.rst:575 msgid "' (single quote)" msgstr "' (單引號)" -#: ../../reference/lexical_analysis.rst:509 +#: ../../reference/lexical_analysis.rst:575 msgid "\" (double quote)" msgstr "\" (雙引號)" -#: ../../reference/lexical_analysis.rst:552 +#: ../../reference/lexical_analysis.rst:618 msgid "triple-quoted string" msgstr "triple-quoted string(三引號字串)" -#: ../../reference/lexical_analysis.rst:552 +#: ../../reference/lexical_analysis.rst:618 msgid "\"\"\"" msgstr "\"\"\"" -#: ../../reference/lexical_analysis.rst:552 +#: ../../reference/lexical_analysis.rst:618 msgid "'''" msgstr "'''" -#: ../../reference/lexical_analysis.rst:577 +#: ../../reference/lexical_analysis.rst:643 msgid "u'" msgstr "u'" -#: ../../reference/lexical_analysis.rst:577 +#: ../../reference/lexical_analysis.rst:643 msgid "u\"" msgstr "u\"" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "escape sequence" msgstr "escape sequence(跳脫序列)" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "Standard C" msgstr "Standard C(標準 C)" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "C" msgstr "C" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\\\" msgstr "\\\\" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\a" msgstr "\\a" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\b" msgstr "\\b" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\f" msgstr "\\f" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\n" msgstr "\\n" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\r" msgstr "\\r" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\t" msgstr "\\t" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\v" msgstr "\\v" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\x" msgstr "\\x" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\N" msgstr "\\N" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\u" msgstr "\\u" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:710 msgid "\\U" msgstr "\\U" -#: ../../reference/lexical_analysis.rst:820 +#: ../../reference/lexical_analysis.rst:886 msgid "unrecognized escape sequence" msgstr "unrecognized escape sequence(無法辨識的跳脫序列)" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:911 msgid "b'" msgstr "b'" -#: ../../reference/lexical_analysis.rst:845 +#: ../../reference/lexical_analysis.rst:911 msgid "b\"" msgstr "b\"" -#: ../../reference/lexical_analysis.rst:872 +#: ../../reference/lexical_analysis.rst:938 msgid "r'" msgstr "r'" -#: ../../reference/lexical_analysis.rst:872 +#: ../../reference/lexical_analysis.rst:938 msgid "raw string literal" msgstr "raw string literal(原始字串常數)" -#: ../../reference/lexical_analysis.rst:872 +#: ../../reference/lexical_analysis.rst:938 msgid "r\"" msgstr "r\"" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "formatted string literal" msgstr "formatted string literal(格式化字串常數)" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "string" msgstr "string(字串)" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "f'" msgstr "f'" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "f\"" msgstr "f\"" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "! (exclamation)" msgstr "! (驚嘆號)" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid ": (colon)" msgstr ": (冒號)" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "= (equals)" msgstr "= (等號)" -#: ../../reference/lexical_analysis.rst:903 +#: ../../reference/lexical_analysis.rst:969 msgid "for help in debugging using string literals" msgstr "for help in debugging using string literals(使用字串常數進行除錯)" -#: ../../reference/lexical_analysis.rst:1130 +#: ../../reference/lexical_analysis.rst:1196 msgid "number" msgstr "number(數字)" -#: ../../reference/lexical_analysis.rst:1130 +#: ../../reference/lexical_analysis.rst:1196 msgid "numeric literal" msgstr "numeric literal(數值常數)" -#: ../../reference/lexical_analysis.rst:1130 -#: ../../reference/lexical_analysis.rst:1152 +#: ../../reference/lexical_analysis.rst:1196 +#: ../../reference/lexical_analysis.rst:1218 msgid "integer literal" msgstr "integer literal(整數常數)" -#: ../../reference/lexical_analysis.rst:1130 +#: ../../reference/lexical_analysis.rst:1196 msgid "floating-point literal" msgstr "floating-point literal(浮點數常數)" -#: ../../reference/lexical_analysis.rst:1130 +#: ../../reference/lexical_analysis.rst:1196 msgid "hexadecimal literal" msgstr "hexadecimal literal(十六進位常數)" -#: ../../reference/lexical_analysis.rst:1130 +#: ../../reference/lexical_analysis.rst:1196 msgid "octal literal" msgstr "octal literal(八進位常數)" -#: ../../reference/lexical_analysis.rst:1130 +#: ../../reference/lexical_analysis.rst:1196 msgid "binary literal" msgstr "binary literal(二進位常數)" -#: ../../reference/lexical_analysis.rst:1130 +#: ../../reference/lexical_analysis.rst:1196 msgid "decimal literal" msgstr "decimal literal(十進位常數)" -#: ../../reference/lexical_analysis.rst:1130 +#: ../../reference/lexical_analysis.rst:1196 msgid "imaginary literal" msgstr "imaginary literal(虛數常數)" -#: ../../reference/lexical_analysis.rst:1130 +#: ../../reference/lexical_analysis.rst:1196 msgid "complex literal" msgstr "complex literal(複數常數)" -#: ../../reference/lexical_analysis.rst:1152 +#: ../../reference/lexical_analysis.rst:1218 msgid "0b" msgstr "0b" -#: ../../reference/lexical_analysis.rst:1152 +#: ../../reference/lexical_analysis.rst:1218 msgid "0o" msgstr "0o" -#: ../../reference/lexical_analysis.rst:1152 +#: ../../reference/lexical_analysis.rst:1218 msgid "0x" msgstr "0x" -#: ../../reference/lexical_analysis.rst:1152 -#: ../../reference/lexical_analysis.rst:1227 +#: ../../reference/lexical_analysis.rst:1218 +#: ../../reference/lexical_analysis.rst:1293 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../reference/lexical_analysis.rst:1152 -#: ../../reference/lexical_analysis.rst:1227 -#: ../../reference/lexical_analysis.rst:1291 +#: ../../reference/lexical_analysis.rst:1218 +#: ../../reference/lexical_analysis.rst:1293 +#: ../../reference/lexical_analysis.rst:1357 msgid "in numeric literal" msgstr "於數值常數中" -#: ../../reference/lexical_analysis.rst:1227 +#: ../../reference/lexical_analysis.rst:1293 msgid ". (dot)" msgstr ". (點)" -#: ../../reference/lexical_analysis.rst:1227 +#: ../../reference/lexical_analysis.rst:1293 msgid "e" msgstr "e" -#: ../../reference/lexical_analysis.rst:1291 +#: ../../reference/lexical_analysis.rst:1357 msgid "j" msgstr "j" -#: ../../reference/lexical_analysis.rst:1361 +#: ../../reference/lexical_analysis.rst:1427 msgid "operators" msgstr "operators(運算子)" -#: ../../reference/lexical_analysis.rst:1361 +#: ../../reference/lexical_analysis.rst:1427 msgid "delimiters" msgstr "delimiters(分隔符號)" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index c06e84e396..f6cbb211b1 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-17 00:13+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+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-" @@ -1174,12 +1174,21 @@ msgstr "" #: ../../reference/simple_stmts.rst:977 msgid "" -"The :keyword:`global` statement applies to the entire scope of a function or " -"class body. A :exc:`SyntaxError` is raised if a variable is used or assigned " -"to prior to its global declaration in the scope." +"The :keyword:`!global` statement applies to the entire current scope " +"(module, function body or class definition). A :exc:`SyntaxError` is raised " +"if a variable is used or assigned to prior to its global declaration in the " +"scope." msgstr "" -#: ../../reference/simple_stmts.rst:986 +#: ../../reference/simple_stmts.rst:982 +msgid "" +"At the module level, all variables are global, so a :keyword:`!global` " +"statement has no effect. However, variables must still not be used or " +"assigned to prior to their :keyword:`!global` declaration. This requirement " +"is relaxed in the interactive prompt (:term:`REPL`)." +msgstr "" + +#: ../../reference/simple_stmts.rst:993 msgid "" "**Programmer's note:** :keyword:`global` is a directive to the parser. It " "applies only to code parsed at the same time as the :keyword:`!global` " @@ -1191,11 +1200,11 @@ msgid "" "func:`compile` functions." msgstr "" -#: ../../reference/simple_stmts.rst:998 +#: ../../reference/simple_stmts.rst:1005 msgid "The :keyword:`!nonlocal` statement" msgstr ":keyword:`!nonlocal` 陳述式" -#: ../../reference/simple_stmts.rst:1006 +#: ../../reference/simple_stmts.rst:1013 msgid "" "When the definition of a function or class is nested (enclosed) within the " "definitions of other functions, its nonlocal scopes are the local scopes of " @@ -1207,64 +1216,64 @@ msgid "" "`SyntaxError` is raised." msgstr "" -#: ../../reference/simple_stmts.rst:1015 +#: ../../reference/simple_stmts.rst:1022 msgid "" "The :keyword:`nonlocal` statement applies to the entire scope of a function " "or class body. A :exc:`SyntaxError` is raised if a variable is used or " "assigned to prior to its nonlocal declaration in the scope." msgstr "" -#: ../../reference/simple_stmts.rst:1021 +#: ../../reference/simple_stmts.rst:1028 msgid ":pep:`3104` - Access to Names in Outer Scopes" msgstr "" -#: ../../reference/simple_stmts.rst:1022 +#: ../../reference/simple_stmts.rst:1029 msgid "The specification for the :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/simple_stmts.rst:1024 +#: ../../reference/simple_stmts.rst:1031 msgid "" "**Programmer's note:** :keyword:`nonlocal` is a directive to the parser and " "applies only to code parsed along with it. See the note for the :keyword:" "`global` statement." msgstr "" -#: ../../reference/simple_stmts.rst:1032 +#: ../../reference/simple_stmts.rst:1039 msgid "The :keyword:`!type` statement" msgstr ":keyword:`!type` 陳述式" -#: ../../reference/simple_stmts.rst:1039 +#: ../../reference/simple_stmts.rst:1046 msgid "" "The :keyword:`!type` statement declares a type alias, which is an instance " "of :class:`typing.TypeAliasType`." msgstr "" -#: ../../reference/simple_stmts.rst:1042 +#: ../../reference/simple_stmts.rst:1049 msgid "For example, the following statement creates a type alias::" msgstr "" -#: ../../reference/simple_stmts.rst:1044 +#: ../../reference/simple_stmts.rst:1051 msgid "type Point = tuple[float, float]" msgstr "" -#: ../../reference/simple_stmts.rst:1046 +#: ../../reference/simple_stmts.rst:1053 msgid "This code is roughly equivalent to::" msgstr "" -#: ../../reference/simple_stmts.rst:1048 +#: ../../reference/simple_stmts.rst:1055 msgid "" "annotation-def VALUE_OF_Point():\n" " return tuple[float, float]\n" "Point = typing.TypeAliasType(\"Point\", VALUE_OF_Point())" msgstr "" -#: ../../reference/simple_stmts.rst:1052 +#: ../../reference/simple_stmts.rst:1059 msgid "" "``annotation-def`` indicates an :ref:`annotation scope `, " "which behaves mostly like a function, but with several small differences." msgstr "" -#: ../../reference/simple_stmts.rst:1055 +#: ../../reference/simple_stmts.rst:1062 msgid "" "The value of the type alias is evaluated in the annotation scope. It is not " "evaluated when the type alias is created, but only when the value is " @@ -1273,21 +1282,21 @@ msgid "" "not yet defined." msgstr "" -#: ../../reference/simple_stmts.rst:1061 +#: ../../reference/simple_stmts.rst:1068 msgid "" "Type aliases may be made generic by adding a :ref:`type parameter list ` after the name. See :ref:`generic-type-aliases` for more." msgstr "" -#: ../../reference/simple_stmts.rst:1064 +#: ../../reference/simple_stmts.rst:1071 msgid ":keyword:`!type` is a :ref:`soft keyword `." msgstr "" -#: ../../reference/simple_stmts.rst:1070 +#: ../../reference/simple_stmts.rst:1077 msgid ":pep:`695` - Type Parameter Syntax" msgstr "" -#: ../../reference/simple_stmts.rst:1071 +#: ../../reference/simple_stmts.rst:1078 msgid "" "Introduced the :keyword:`!type` statement and syntax for generic classes and " "functions." @@ -1305,8 +1314,8 @@ msgstr "" #: ../../reference/simple_stmts.rst:525 ../../reference/simple_stmts.rst:561 #: ../../reference/simple_stmts.rst:686 ../../reference/simple_stmts.rst:720 #: ../../reference/simple_stmts.rst:745 ../../reference/simple_stmts.rst:878 -#: ../../reference/simple_stmts.rst:964 ../../reference/simple_stmts.rst:1000 -#: ../../reference/simple_stmts.rst:1034 +#: ../../reference/simple_stmts.rst:964 ../../reference/simple_stmts.rst:1007 +#: ../../reference/simple_stmts.rst:1041 msgid "statement" msgstr "statement(陳述式)" @@ -1320,7 +1329,7 @@ msgstr "" msgid "list" msgstr "list(串列)" -#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:981 +#: ../../reference/simple_stmts.rst:56 ../../reference/simple_stmts.rst:988 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -1416,7 +1425,7 @@ msgstr "target" #: ../../reference/simple_stmts.rst:116 ../../reference/simple_stmts.rst:384 #: ../../reference/simple_stmts.rst:745 ../../reference/simple_stmts.rst:964 -#: ../../reference/simple_stmts.rst:1000 +#: ../../reference/simple_stmts.rst:1007 msgid ", (comma)" msgstr ", (逗號)" @@ -1746,26 +1755,26 @@ msgstr "__future__" msgid "future statement" msgstr "future statement(future 陳述式)" -#: ../../reference/simple_stmts.rst:964 ../../reference/simple_stmts.rst:1000 +#: ../../reference/simple_stmts.rst:964 ../../reference/simple_stmts.rst:1007 msgid "identifier list" msgstr "identifier list(識別符號清單)" -#: ../../reference/simple_stmts.rst:981 +#: ../../reference/simple_stmts.rst:988 msgid "exec" msgstr "exec" -#: ../../reference/simple_stmts.rst:981 +#: ../../reference/simple_stmts.rst:988 msgid "eval" msgstr "eval" -#: ../../reference/simple_stmts.rst:981 +#: ../../reference/simple_stmts.rst:988 msgid "compile" msgstr "compile(編譯)" -#: ../../reference/simple_stmts.rst:1000 +#: ../../reference/simple_stmts.rst:1007 msgid "nonlocal" msgstr "nonlocal" -#: ../../reference/simple_stmts.rst:1034 +#: ../../reference/simple_stmts.rst:1041 msgid "type" msgstr "" diff --git a/sphinx.po b/sphinx.po index 48878694c5..7a497d9dd2 100644 --- a/sphinx.po +++ b/sphinx.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-10-11 00:14+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-" @@ -74,140 +74,109 @@ msgid "Packed as .tar.bz2" msgstr "打包成 .tar.bz2" #: ../../tools/templates/download.html:44 -msgid "PDF" -msgstr "PDF" - -#: ../../tools/templates/download.html:45 -msgid "" -"Download " -"(ca. %(download_size)s MiB)" -msgstr "" -"下載 (ca. " -"%(download_size)s MiB)" - -#: ../../tools/templates/download.html:46 -msgid "" -"Download (ca. %(download_size)s MiB)" -msgstr "" -"下載 " -"(ca. %(download_size)s MiB)" - -#: ../../tools/templates/download.html:49 msgid "HTML" msgstr "HTML" -#: ../../tools/templates/download.html:50 +#: ../../tools/templates/download.html:45 +#, fuzzy msgid "" -"Download " -"(ca. %(download_size)s MiB)" +"Download" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:51 +#: ../../tools/templates/download.html:46 +#, fuzzy msgid "" -"Download " -"(ca. %(download_size)s MiB)" +"Download" msgstr "" "下載 " "(ca. %(download_size)s MiB)" -#: ../../tools/templates/download.html:54 +#: ../../tools/templates/download.html:49 msgid "Plain text" msgstr "純文字" -#: ../../tools/templates/download.html:55 +#: ../../tools/templates/download.html:50 +#, fuzzy msgid "" -"Download " -"(ca. %(download_size)s MiB)" +"Download" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:56 +#: ../../tools/templates/download.html:51 +#, fuzzy msgid "" -"Download " -"(ca. %(download_size)s MiB)" +"Download" msgstr "" "下載 " "(ca. %(download_size)s MiB)" -#: ../../tools/templates/download.html:59 +#: ../../tools/templates/download.html:54 msgid "Texinfo" msgstr "Texinfo" -#: ../../tools/templates/download.html:60 +#: ../../tools/templates/download.html:55 +#, fuzzy msgid "" -"Download " -"(ca. %(download_size)s MiB)" +"Download" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:61 +#: ../../tools/templates/download.html:56 +#, fuzzy msgid "" "Download (ca. %(download_size)s MiB)" +"a>" msgstr "" "下載 " "(ca. %(download_size)s MiB)" -#: ../../tools/templates/download.html:64 +#: ../../tools/templates/download.html:59 msgid "EPUB" msgstr "EPUB" -#: ../../tools/templates/download.html:65 -msgid "" -"Download (ca. " -"%(download_size)s MiB)" +#: ../../tools/templates/download.html:60 +#, fuzzy +msgid "Download" msgstr "" "下載 (ca. " "%(download_size)s MiB)" -#: ../../tools/templates/download.html:70 +#: ../../tools/templates/download.html:65 msgid "These archives contain all the content in the documentation." msgstr "這些歸檔包含了說明文件中的所有內容。" -#: ../../tools/templates/download.html:73 -msgid "Unpacking" -msgstr "解壓縮" - -#: ../../tools/templates/download.html:75 +#: ../../tools/templates/download.html:67 msgid "" -"Unix users should download the .tar.bz2 archives; these are bzipped tar\n" -"archives and can be handled in the usual way using tar and the bzip2\n" -"program. The Info-ZIP unzip " -"program can be\n" -"used to handle the ZIP archives if desired. The .tar.bz2 archives provide " -"the\n" -"best compression and fastest download times." +"\n" +"We no longer provide pre-built PDFs of the documentation.\n" +"To build a PDF archive, follow the instructions in the\n" +"Developer's Guide\n" +"and run make dist-pdf in the Doc/ directory of a " +"copy of the CPython repository.\n" msgstr "" -"Unix 使用者應該下載 .tar.bz2 歸檔;這些是 bzipped tar 歸檔,可以使用 tar 和 " -"bzip2 來處理。如果需要的話,可以使用 Info-ZIP 解壓縮程式來處理 ZIP 歸檔。.tar.bz2 歸檔提供最佳壓縮率和最" -"快的下載時間。" -#: ../../tools/templates/download.html:81 +#: ../../tools/templates/download.html:74 msgid "" -"Windows users can use the ZIP archives since those are customary on that\n" -"platform. These are created on Unix using the Info-ZIP zip program." +"\n" +"See the directory " +"listing\n" +"for file sizes." msgstr "" -"Windows 使用者可以使用 ZIP 歸檔,因為這在該平台上是常見的。這些是在 Unix 上使" -"用 Info-ZIP zip 程式建立的。" -#: ../../tools/templates/download.html:85 +#: ../../tools/templates/download.html:79 msgid "Problems" msgstr "問題" -#: ../../tools/templates/download.html:87 +#: ../../tools/templates/download.html:81 msgid "" -"If you have comments or suggestions for the Python documentation, please " -"send\n" -"email to docs@python.org." +"Open an issue\n" +"if you have comments or suggestions for the Python documentation." msgstr "" -"如果你對 Python 說明文件有任何意見或建議,請寄電子郵件至 docs@python.org。" #: ../../tools/templates/dummy.html:6 msgid "Availability" @@ -536,3 +505,52 @@ msgstr "" #: ../../tools/templates/layout.html:16 msgid "the current stable release" msgstr "目前的穩定發行版" + +#~ msgid "Unpacking" +#~ msgstr "解壓縮" + +#~ msgid "" +#~ "Unix users should download the .tar.bz2 archives; these are bzipped tar\n" +#~ "archives and can be handled in the usual way using tar and the bzip2\n" +#~ "program. The Info-ZIP " +#~ "unzip program can be\n" +#~ "used to handle the ZIP archives if desired. The .tar.bz2 archives provide " +#~ "the\n" +#~ "best compression and fastest download times." +#~ msgstr "" +#~ "Unix 使用者應該下載 .tar.bz2 歸檔;這些是 bzipped tar 歸檔,可以使用 tar " +#~ "和 bzip2 來處理。如果需要的話,可以使用 Info-ZIP 解壓縮程式來處理 ZIP 歸檔。.tar.bz2 歸檔提" +#~ "供最佳壓縮率和最快的下載時間。" + +#~ msgid "" +#~ "Windows users can use the ZIP archives since those are customary on that\n" +#~ "platform. These are created on Unix using the Info-ZIP zip program." +#~ msgstr "" +#~ "Windows 使用者可以使用 ZIP 歸檔,因為這在該平台上是常見的。這些是在 Unix " +#~ "上使用 Info-ZIP zip 程式建立的。" + +#~ msgid "" +#~ "If you have comments or suggestions for the Python documentation, please " +#~ "send\n" +#~ "email to docs@python.org." +#~ msgstr "" +#~ "如果你對 Python 說明文件有任何意見或建議,請寄電子郵件至 docs@python.org。" + +#~ msgid "PDF" +#~ msgstr "PDF" + +#~ msgid "" +#~ "Download (ca. %(download_size)s MiB)" +#~ msgstr "" +#~ "下載 " +#~ "(ca. %(download_size)s MiB)" + +#~ msgid "" +#~ "Download (ca. %(download_size)s MiB)" +#~ msgstr "" +#~ "下載 (ca. %(download_size)s MiB)" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index fe3bb8c4e8..094d81b45e 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-07 00:15+0000\n" "PO-Revision-Date: 2024-01-22 21:43+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -75,8 +75,8 @@ msgid "" "Remove the first item from the list whose value is equal to *x*. It raises " "a :exc:`ValueError` if there is no such item." msgstr "" -"刪除 list 中第一個值等於 *x* 的元素。若 list 中無此元素則會觸" -"發 :exc:`ValueError`。" +"刪除 list 中第一個值等於 *x* 的元素。若 list 中無此元素則會觸發 :exc:" +"`ValueError`。" #: ../../tutorial/datastructures.rst:50 msgid "" @@ -86,8 +86,8 @@ msgid "" "outside the list range." msgstr "" "移除 list 中給定位置的項目,並回傳它。如果沒有指定位置, ``a.pop()`` 將會移" -"除 list 中最後的項目並回傳它。若 list 是空的或是索引值超出範圍,則會引" -"發 :exc:`IndexError` 例外。" +"除 list 中最後的項目並回傳它。若 list 是空的或是索引值超出範圍,則會引發 :" +"exc:`IndexError` 例外。" #: ../../tutorial/datastructures.rst:59 msgid "Remove all items from the list. Similar to ``del a[:]``." @@ -98,8 +98,8 @@ msgid "" "Return zero-based index of the first occurrence of *x* in the list. Raises " "a :exc:`ValueError` if there is no such item." msgstr "" -"回傳 list 中第一個出現 *x* 的(從零開始的)索引值。若 list 中無此" -"項目,則丟出 :exc:`ValueError` 錯誤。" +"回傳 list 中第一個出現 *x* 的(從零開始的)索引值。若 list 中無此項目,則丟" +"出 :exc:`ValueError` 錯誤。" #: ../../tutorial/datastructures.rst:68 msgid "" @@ -220,8 +220,8 @@ msgid "" msgstr "" "List 的操作方法使得它非常簡單可以用來實作 stack(堆疊)。Stack 為一個遵守最後" "加入元素最先被取回(後進先出,\"last-in, first-out\")規則的資料結構。你可以" -"使用方法 :meth:`~list.append` 將一個項目放到堆疊的頂層。而使用方法 :meth:`~list.pop` 且" -"不給定索引值去取得堆疊最上面的項目。舉例而言: ::" +"使用方法 :meth:`~list.append` 將一個項目放到堆疊的頂層。而使用方法 :meth:" +"`~list.pop` 且不給定索引值去取得堆疊最上面的項目。舉例而言: ::" #: ../../tutorial/datastructures.rst:148 msgid "" @@ -376,9 +376,9 @@ msgid "" "lists if they are not equal::" msgstr "" "一個 list comprehension 的組成,是在一對方括號內,放入一個 expression(運算" -"式)、一個 :keyword:`!for` 子句、再接著零個或多個 :keyword:`!for` " -"或 :keyword:`!if` 子句。結果會是一個新的 list,內容是在後面的 :keyword:`!" -"for` 和 :keyword:`!if` 子句情境下,對前面運算式求值的結果。例如,這個 list " +"式)、一個 :keyword:`!for` 子句、再接著零個或多個 :keyword:`!for` 或 :" +"keyword:`!if` 子句。結果會是一個新的 list,內容是在後面的 :keyword:`!for` " +"和 :keyword:`!if` 子句情境下,對前面運算式求值的結果。例如,這個 list " "comprehension 組合了兩個 list 中彼此相異的元素: ::" #: ../../tutorial/datastructures.rst:231 @@ -550,8 +550,8 @@ msgid "" "in the context of the :keyword:`for` that follows it, so this example is " "equivalent to::" msgstr "" -"如同我們在上一節看到的,內部的 list comprehension 會依據後面" -"的 :keyword:`for` 環境被求值,所以這個例子就等於: ::" +"如同我們在上一節看到的,內部的 list comprehension 會依據後面的 :keyword:" +"`for` 環境被求值,所以這個例子就等於: ::" #: ../../tutorial/datastructures.rst:309 msgid "" @@ -625,16 +625,15 @@ msgstr ":keyword:`!del` 陳述式" #: ../../tutorial/datastructures.rst:342 msgid "" "There is a way to remove an item from a list given its index instead of its " -"value: the :keyword:`del` statement. This differs from " -"the :meth:`~list.pop` method which returns a value. The :keyword:`!del` " -"statement can also be used to remove slices from a list or clear the entire " -"list (which we did earlier by assignment of an empty list to the slice). " -"For example::" +"value: the :keyword:`del` statement. This differs from the :meth:`~list." +"pop` method which returns a value. The :keyword:`!del` statement can also " +"be used to remove slices from a list or clear the entire list (which we did " +"earlier by assignment of an empty list to the slice). For example::" msgstr "" "有一個方法可以藉由索引而不是值來刪除 list 中的項目::keyword:`del` 陳述式。這" -"和 :meth:`~list.pop` method 傳回一個值不同,:keyword:`!del` 陳述式可以用來刪除 " -"list 中的片段或者清空整個 list(我們之前藉由指派一個空的 list 給想刪除的片段" -"來完成這件事)。例如: ::" +"和 :meth:`~list.pop` method 傳回一個值不同,:keyword:`!del` 陳述式可以用來刪" +"除 list 中的片段或者清空整個 list(我們之前藉由指派一個空的 list 給想刪除的片" +"段來完成這件事)。例如: ::" #: ../../tutorial/datastructures.rst:348 msgid "" @@ -689,9 +688,9 @@ msgid "" "the *tuple*." msgstr "" "我們看到 list 和字串 (string) 有許多共同的特性,像是索引操作 (indexing) 以及" -"切片操作 (slicing) 。他們是\\ *序列*\\ 資料類型中的兩個例子(請參考" -"\\ :ref:`typesseq`\\ )。由於 Python 是個持續發展中的語言,未來可能還會有其他" -"的序列資料類型加入。接著要介紹是下一個標準序列資料類型:*tuple*。" +"切片操作 (slicing) 。他們是\\ *序列*\\ 資料類型中的兩個例子(請參考\\ :ref:" +"`typesseq`\\ )。由於 Python 是個持續發展中的語言,未來可能還會有其他的序列資" +"料類型加入。接著要介紹是下一個標準序列資料類型:*tuple*。" #: ../../tutorial/datastructures.rst:378 msgid "" @@ -758,16 +757,16 @@ msgid "" "situations and for different purposes. Tuples are :term:`immutable`, and " "usually contain a heterogeneous sequence of elements that are accessed via " "unpacking (see later in this section) or indexing (or even by attribute in " -"the case of :func:`namedtuples `). Lists " -"are :term:`mutable`, and their elements are usually homogeneous and are " -"accessed by iterating over the list." +"the case of :func:`namedtuples `). Lists are :term:" +"`mutable`, and their elements are usually homogeneous and are accessed by " +"iterating over the list." msgstr "" "雖然 tuple 和 list 看起來很類似,但是他們通常用在不同的情況與不同目的。 " "tuple 是 :term:`immutable`\\ (不可變的),通常儲存異質的元素序列,並可經由拆" -"解 (unpacking)(請參考本節後段)或索引 (indexing) 來存取(或者在使" -"用 :func:`namedtuples ` 的時候藉由屬性 (attribute) 來" -"存取)。List 是 :term:`mutable`\\ (可變的),其元素通常是同質的且可藉由疊代" -"整個 list 來存取。" +"解 (unpacking)(請參考本節後段)或索引 (indexing) 來存取(或者在使用 :func:" +"`namedtuples ` 的時候藉由屬性 (attribute) 來存取)。" +"List 是 :term:`mutable`\\ (可變的),其元素通常是同質的且可藉由疊代整個 " +"list 來存取。" #: ../../tutorial/datastructures.rst:415 msgid "" @@ -931,26 +930,26 @@ msgstr "字典(Dictionary)" #: ../../tutorial/datastructures.rst:495 msgid "" -"Another useful data type built into Python is the *dictionary* " -"(see :ref:`typesmapping`). Dictionaries are sometimes found in other " -"languages as \"associative memories\" or \"associative arrays\". Unlike " -"sequences, which are indexed by a range of numbers, dictionaries are indexed " -"by *keys*, which can be any immutable type; strings and numbers can always " -"be keys. Tuples can be used as keys if they contain only strings, numbers, " -"or tuples; if a tuple contains any mutable object either directly or " -"indirectly, it cannot be used as a key. You can't use lists as keys, since " -"lists can be modified in place using index assignments, slice assignments, " -"or methods like :meth:`~list.append` and :meth:`~list.extend`." -msgstr "" -"下一個常用的 Python 內建資料類型為 *dictionary*\\ (請參考" -"\\ :ref:`typesmapping`\\ )。 Dictionary 有時被稱為「關聯記憶體」" -"(associative memories) 或「關聯陣列」(associative arrays)。不像序列是由一個範" -"圍內的數字當作索引,dictionary 是由\\ *鍵* (key) 來當索引,鍵可以是任何不可變" -"的類型;字串和數字都可以當作鍵。Tuple 也可以當作鍵,如果他們只含有字串、數字" -"或 tuple;若一個 tuple 直接或間接地含有任何可變的物件,它就不能當作鍵。你無法" -"使用 list 當作鍵,因為 list 可以經由索引指派 (index assignment)、切片指派 " -"(slice assignment) 或是像 :meth:`~list.append` 和 :meth:`~list.extend` 等" -"方法被修改。" +"Another useful data type built into Python is the *dictionary* (see :ref:" +"`typesmapping`). Dictionaries are sometimes found in other languages as " +"\"associative memories\" or \"associative arrays\". Unlike sequences, which " +"are indexed by a range of numbers, dictionaries are indexed by *keys*, which " +"can be any immutable type; strings and numbers can always be keys. Tuples " +"can be used as keys if they contain only strings, numbers, or tuples; if a " +"tuple contains any mutable object either directly or indirectly, it cannot " +"be used as a key. You can't use lists as keys, since lists can be modified " +"in place using index assignments, slice assignments, or methods like :meth:" +"`~list.append` and :meth:`~list.extend`." +msgstr "" +"下一個常用的 Python 內建資料類型為 *dictionary*\\ (請參考\\ :ref:" +"`typesmapping`\\ )。 Dictionary 有時被稱為「關聯記憶體」(associative " +"memories) 或「關聯陣列」(associative arrays)。不像序列是由一個範圍內的數字當" +"作索引,dictionary 是由\\ *鍵* (key) 來當索引,鍵可以是任何不可變的類型;字串" +"和數字都可以當作鍵。Tuple 也可以當作鍵,如果他們只含有字串、數字或 tuple;若" +"一個 tuple 直接或間接地含有任何可變的物件,它就不能當作鍵。你無法使用 list 當" +"作鍵,因為 list 可以經由索引指派 (index assignment)、切片指派 (slice " +"assignment) 或是像 :meth:`~list.append` 和 :meth:`~list.extend` 等方法被修" +"改。" #: ../../tutorial/datastructures.rst:506 msgid "" @@ -966,18 +965,27 @@ msgstr "" "鍵值對。這同樣也是字典輸出時的格式。" #: ../../tutorial/datastructures.rst:512 +#, fuzzy msgid "" "The main operations on a dictionary are storing a value with some key and " -"extracting the value given the key. It is also possible to delete a " -"key:value pair with ``del``. If you store using a key that is already in " -"use, the old value associated with that key is forgotten. It is an error to " -"extract a value using a non-existent key." +"extracting the value given the key. It is also possible to delete a key:" +"value pair with ``del``. If you store using a key that is already in use, " +"the old value associated with that key is forgotten." msgstr "" "Dictionary 主要的操作為藉由鍵來儲存一個值並且可藉由該鍵來取出該值。也可以使" "用 ``del`` 來刪除鍵值對。如果我們使用用過的鍵來儲存,該鍵所對應的較舊的值會被" "覆蓋。使用不存在的鍵來取出值會造成錯誤。" -#: ../../tutorial/datastructures.rst:518 +#: ../../tutorial/datastructures.rst:517 +msgid "" +"Extracting a value for a non-existent key by subscripting (``d[key]``) " +"raises a :exc:`KeyError`. To avoid getting this error when trying to access " +"a possibly non-existent key, use the :meth:`~dict.get` method instead, which " +"returns ``None`` (or a specified default value) if the key is not in the " +"dictionary." +msgstr "" + +#: ../../tutorial/datastructures.rst:522 msgid "" "Performing ``list(d)`` on a dictionary returns a list of all the keys used " "in the dictionary, in insertion order (if you want it sorted, just use " @@ -988,11 +996,12 @@ msgstr "" "為插入時的順序。(若想要排序,則使用 ``sorted(d)`` 代替即可)。如果想確認一個" "鍵是否已存在於字典中,可使用關鍵字 :keyword:`in`。" -#: ../../tutorial/datastructures.rst:523 +#: ../../tutorial/datastructures.rst:527 msgid "Here is a small example using a dictionary::" msgstr "這是個使用一個 dictionary 的簡單範例: ::" -#: ../../tutorial/datastructures.rst:525 +#: ../../tutorial/datastructures.rst:529 +#, fuzzy msgid "" ">>> tel = {'jack': 4098, 'sape': 4139}\n" ">>> tel['guido'] = 4127\n" @@ -1000,6 +1009,12 @@ msgid "" "{'jack': 4098, 'sape': 4139, 'guido': 4127}\n" ">>> tel['jack']\n" "4098\n" +">>> tel['irv']\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"KeyError: 'irv'\n" +">>> print(tel.get('irv'))\n" +"None\n" ">>> del tel['sape']\n" ">>> tel['irv'] = 4127\n" ">>> tel\n" @@ -1032,13 +1047,13 @@ msgstr "" ">>> 'jack' not in tel\n" "False" -#: ../../tutorial/datastructures.rst:544 +#: ../../tutorial/datastructures.rst:554 msgid "" "The :func:`dict` constructor builds dictionaries directly from sequences of " "key-value pairs::" msgstr "函式 :func:`dict` 可直接透過一串鍵值對序列來建立 dictionary: ::" -#: ../../tutorial/datastructures.rst:547 +#: ../../tutorial/datastructures.rst:557 msgid "" ">>> dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])\n" "{'sape': 4139, 'guido': 4127, 'jack': 4098}" @@ -1046,14 +1061,14 @@ msgstr "" ">>> dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])\n" "{'sape': 4139, 'guido': 4127, 'jack': 4098}" -#: ../../tutorial/datastructures.rst:550 +#: ../../tutorial/datastructures.rst:560 msgid "" "In addition, dict comprehensions can be used to create dictionaries from " "arbitrary key and value expressions::" msgstr "" "此外,dict comprehensions 也可以透過任意鍵與值的運算式來建立 dictionary : ::" -#: ../../tutorial/datastructures.rst:553 +#: ../../tutorial/datastructures.rst:563 msgid "" ">>> {x: x**2 for x in (2, 4, 6)}\n" "{2: 4, 4: 16, 6: 36}" @@ -1061,14 +1076,14 @@ msgstr "" ">>> {x: x**2 for x in (2, 4, 6)}\n" "{2: 4, 4: 16, 6: 36}" -#: ../../tutorial/datastructures.rst:556 +#: ../../tutorial/datastructures.rst:566 msgid "" "When the keys are simple strings, it is sometimes easier to specify pairs " "using keyword arguments::" msgstr "" "當鍵是簡單的字串時,使用關鍵字引數 (keyword arguments) 有時會較為簡潔: ::" -#: ../../tutorial/datastructures.rst:559 +#: ../../tutorial/datastructures.rst:569 msgid "" ">>> dict(sape=4139, guido=4127, jack=4098)\n" "{'sape': 4139, 'guido': 4127, 'jack': 4098}" @@ -1076,11 +1091,11 @@ msgstr "" ">>> dict(sape=4139, guido=4127, jack=4098)\n" "{'sape': 4139, 'guido': 4127, 'jack': 4098}" -#: ../../tutorial/datastructures.rst:566 +#: ../../tutorial/datastructures.rst:576 msgid "Looping Techniques" msgstr "迴圈技巧" -#: ../../tutorial/datastructures.rst:568 +#: ../../tutorial/datastructures.rst:578 msgid "" "When looping through dictionaries, the key and corresponding value can be " "retrieved at the same time using the :meth:`~dict.items` method. ::" @@ -1088,7 +1103,7 @@ msgstr "" "當對 dictionary 作迴圈時,鍵以及其對應的值可以藉由使用 :meth:`~dict.items` " "method 來同時取得: ::" -#: ../../tutorial/datastructures.rst:571 +#: ../../tutorial/datastructures.rst:581 msgid "" ">>> knights = {'gallahad': 'the pure', 'robin': 'the brave'}\n" ">>> for k, v in knights.items():\n" @@ -1104,7 +1119,7 @@ msgstr "" "gallahad the pure\n" "robin the brave" -#: ../../tutorial/datastructures.rst:578 +#: ../../tutorial/datastructures.rst:588 msgid "" "When looping through a sequence, the position index and corresponding value " "can be retrieved at the same time using the :func:`enumerate` function. ::" @@ -1112,7 +1127,7 @@ msgstr "" "當對序列作迴圈時,位置索引及其對應的值可以藉由使用 :func:`enumerate` 函式來同" "時取得: ::" -#: ../../tutorial/datastructures.rst:581 +#: ../../tutorial/datastructures.rst:591 msgid "" ">>> for i, v in enumerate(['tic', 'tac', 'toe']):\n" "... print(i, v)\n" @@ -1128,14 +1143,14 @@ msgstr "" "1 tac\n" "2 toe" -#: ../../tutorial/datastructures.rst:588 +#: ../../tutorial/datastructures.rst:598 msgid "" "To loop over two or more sequences at the same time, the entries can be " "paired with the :func:`zip` function. ::" msgstr "" "要同時對兩個以上的序列作迴圈,可以將其以成對的方式放入 :func:`zip` 函式: ::" -#: ../../tutorial/datastructures.rst:591 +#: ../../tutorial/datastructures.rst:601 msgid "" ">>> questions = ['name', 'quest', 'favorite color']\n" ">>> answers = ['lancelot', 'the holy grail', 'blue']\n" @@ -1155,7 +1170,7 @@ msgstr "" "What is your quest? It is the holy grail.\n" "What is your favorite color? It is blue." -#: ../../tutorial/datastructures.rst:600 +#: ../../tutorial/datastructures.rst:610 msgid "" "To loop over a sequence in reverse, first specify the sequence in a forward " "direction and then call the :func:`reversed` function. ::" @@ -1163,7 +1178,7 @@ msgstr "" "要對序列作反向的迴圈,首先先寫出正向的序列,再對其使用 :func:`reversed` 函" "式: ::" -#: ../../tutorial/datastructures.rst:603 +#: ../../tutorial/datastructures.rst:613 msgid "" ">>> for i in reversed(range(1, 10, 2)):\n" "... print(i)\n" @@ -1183,7 +1198,7 @@ msgstr "" "3\n" "1" -#: ../../tutorial/datastructures.rst:612 +#: ../../tutorial/datastructures.rst:622 msgid "" "To loop over a sequence in sorted order, use the :func:`sorted` function " "which returns a new sorted list while leaving the source unaltered. ::" @@ -1191,7 +1206,7 @@ msgstr "" "要以迴圈對序列作排序,使用 :func:`sorted` 函式會得到一個新的經排序過的 " "list ,但不會改變原本的序列: ::" -#: ../../tutorial/datastructures.rst:615 +#: ../../tutorial/datastructures.rst:625 msgid "" ">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n" ">>> for i in sorted(basket):\n" @@ -1215,17 +1230,17 @@ msgstr "" "orange\n" "pear" -#: ../../tutorial/datastructures.rst:626 +#: ../../tutorial/datastructures.rst:636 msgid "" -"Using :func:`set` on a sequence eliminates duplicate elements. The use " -"of :func:`sorted` in combination with :func:`set` over a sequence is an " +"Using :func:`set` on a sequence eliminates duplicate elements. The use of :" +"func:`sorted` in combination with :func:`set` over a sequence is an " "idiomatic way to loop over unique elements of the sequence in sorted " "order. ::" msgstr "" -"對序列使用 :func:`set` 可去除重複元素。對序列使用 :func:`sorted` 加" -"上 :func:`set`,則是對經過排序後的非重複元素跑迴圈的慣用方法: ::" +"對序列使用 :func:`set` 可去除重複元素。對序列使用 :func:`sorted` 加上 :func:" +"`set`,則是對經過排序後的非重複元素跑迴圈的慣用方法: ::" -#: ../../tutorial/datastructures.rst:630 +#: ../../tutorial/datastructures.rst:640 msgid "" ">>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']\n" ">>> for f in sorted(set(basket)):\n" @@ -1245,7 +1260,7 @@ msgstr "" "orange\n" "pear" -#: ../../tutorial/datastructures.rst:639 +#: ../../tutorial/datastructures.rst:649 msgid "" "It is sometimes tempting to change a list while you are looping over it; " "however, it is often simpler and safer to create a new list instead. ::" @@ -1253,7 +1268,7 @@ msgstr "" "有時我們會想要以迴圈來改變的一個 list,但是,通常建立一個新的 list 會更簡單且" "安全: ::" -#: ../../tutorial/datastructures.rst:642 +#: ../../tutorial/datastructures.rst:652 msgid "" ">>> import math\n" ">>> raw_data = [56.2, float('NaN'), 51.7, 55.3, 52.5, float('NaN'), 47.8]\n" @@ -1275,11 +1290,11 @@ msgstr "" ">>> filtered_data\n" "[56.2, 51.7, 55.3, 52.5, 47.8]" -#: ../../tutorial/datastructures.rst:656 +#: ../../tutorial/datastructures.rst:666 msgid "More on Conditions" msgstr "深入了解條件 (Condition)" -#: ../../tutorial/datastructures.rst:658 +#: ../../tutorial/datastructures.rst:668 msgid "" "The conditions used in ``while`` and ``if`` statements can contain any " "operators, not just comparisons." @@ -1287,7 +1302,7 @@ msgstr "" "使用在 ``while`` 和 ``if`` 陳述式的條件句可以包含任何運算子,而不是只有比較運" "算子 (comparisons) 。" -#: ../../tutorial/datastructures.rst:662 +#: ../../tutorial/datastructures.rst:672 msgid "" "The comparison operators ``in`` and ``not in`` are membership tests that " "determine whether a value is in (or not in) a container. The operators " @@ -1299,7 +1314,7 @@ msgstr "" "(或不存在)。運算子 ``is`` 和 ``is not`` 比較兩個物件是否真的是相同的物件。" "所有比較運算子的優先度都相同且都低於數值運算子。" -#: ../../tutorial/datastructures.rst:668 +#: ../../tutorial/datastructures.rst:678 msgid "" "Comparisons can be chained. For example, ``a < b == c`` tests whether ``a`` " "is less than ``b`` and moreover ``b`` equals ``c``." @@ -1307,7 +1322,7 @@ msgstr "" "比較運算是可以串連在一起的。例如, ``a < b == c`` 就是在測試 ``a`` 是否小於 " "``b`` 和 ``b`` 是否等於 ``c``。" -#: ../../tutorial/datastructures.rst:671 +#: ../../tutorial/datastructures.rst:681 msgid "" "Comparisons may be combined using the Boolean operators ``and`` and ``or``, " "and the outcome of a comparison (or of any other Boolean expression) may be " @@ -1321,7 +1336,7 @@ msgstr "" "其中,``not`` 的優先度最高,``or`` 的優先度最低,因此 ``A and not B or C`` 等" "同於 ``(A and (not B)) or C``。一如往常,括號可以用來表示任何想要的組合。" -#: ../../tutorial/datastructures.rst:678 +#: ../../tutorial/datastructures.rst:688 msgid "" "The Boolean operators ``and`` and ``or`` are so-called *short-circuit* " "operators: their arguments are evaluated from left to right, and evaluation " @@ -1335,13 +1350,13 @@ msgstr "" "``B`` 為假,則 ``A and B and C`` 的運算並不會執行到 ``C``。當運算結果被當成一" "般值而非布林值時,短路運算子的回傳值為最後被求值的引數。" -#: ../../tutorial/datastructures.rst:685 +#: ../../tutorial/datastructures.rst:695 msgid "" "It is possible to assign the result of a comparison or other Boolean " "expression to a variable. For example, ::" msgstr "將一個比較運算或其他布林運算式的結果指派給一個變數是可以的。例如: ::" -#: ../../tutorial/datastructures.rst:688 +#: ../../tutorial/datastructures.rst:698 msgid "" ">>> string1, string2, string3 = '', 'Trondheim', 'Hammer Dance'\n" ">>> non_null = string1 or string2 or string3\n" @@ -1353,7 +1368,7 @@ msgstr "" ">>> non_null\n" "'Trondheim'" -#: ../../tutorial/datastructures.rst:693 +#: ../../tutorial/datastructures.rst:703 msgid "" "Note that in Python, unlike C, assignment inside expressions must be done " "explicitly with the :ref:`walrus operator ` ``:=``。 這樣做避免了" "在 C 語言裡常見的一種問題:想要打 ``==`` 卻在運算式裡輸入 ``=``。" -#: ../../tutorial/datastructures.rst:703 +#: ../../tutorial/datastructures.rst:713 msgid "Comparing Sequences and Other Types" msgstr "序列和其他資料類型之比較" -#: ../../tutorial/datastructures.rst:704 +#: ../../tutorial/datastructures.rst:714 msgid "" "Sequence objects typically may be compared to other objects with the same " "sequence type. The comparison uses *lexicographical* ordering: first the " @@ -1388,10 +1403,10 @@ msgstr "" "相同,則比較下一項,以此類推,直到其中一個序列完全用完。如果被拿出來比較的兩" "項本身又是相同的序列類型,則詞典式比較會遞迴地執行。如果兩個序列所有的項目都" "相等,則此兩個序列被認為是相等的。如果其中一個序列是另一個的子序列,則較短的" -"那個序列為較小的序列。字串的詞典式順序使用 Unicode 的編碼位置 (code point) 編號來" -"排序個別字元。以下是一些相同序列類型的比較: ::" +"那個序列為較小的序列。字串的詞典式順序使用 Unicode 的編碼位置 (code point) 編" +"號來排序個別字元。以下是一些相同序列類型的比較: ::" -#: ../../tutorial/datastructures.rst:716 +#: ../../tutorial/datastructures.rst:726 msgid "" "(1, 2, 3) < (1, 2, 4)\n" "[1, 2, 3] < [1, 2, 4]\n" @@ -1409,7 +1424,7 @@ msgstr "" "(1, 2, 3) == (1.0, 2.0, 3.0)\n" "(1, 2, ('aa', 'ab')) < (1, 2, ('abc', 'a'), 4)" -#: ../../tutorial/datastructures.rst:724 +#: ../../tutorial/datastructures.rst:734 msgid "" "Note that comparing objects of different types with ``<`` or ``>`` is legal " "provided that the objects have appropriate comparison methods. For example, " @@ -1421,11 +1436,11 @@ msgstr "" "比較方法。例如,混合的數值類型是根據它們數值來做比較,所以 0 等於 0.0,等等。" "否則直譯器會選擇丟出一個 :exc:`TypeError` 錯誤而不是提供一個任意的排序。" -#: ../../tutorial/datastructures.rst:732 +#: ../../tutorial/datastructures.rst:742 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/datastructures.rst:733 +#: ../../tutorial/datastructures.rst:743 msgid "" "Other languages may return the mutated object, which allows method chaining, " "such as ``d->insert(\"a\")->remove(\"b\")->sort();``." diff --git a/using/android.po b/using/android.po index 15bf987a45..28bc67e7c5 100644 --- a/using/android.po +++ b/using/android.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-27 07:36+0000\n" +"POT-Creation-Date: 2025-09-19 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -95,60 +95,72 @@ msgid "" msgstr "" #: ../../using/android.rst:43 +msgid "First, acquire a build of Python for Android:" +msgstr "" + +#: ../../using/android.rst:45 msgid "" -"Build Python by following the instructions in :source:`Android/README.md`. " -"This will create the directory ``cross-build/HOST/prefix``." +"The easiest way is to download an Android release from `python.org `__. The ``prefix`` directory mentioned " +"below is at the top level of the package." msgstr "" -#: ../../using/android.rst:46 +#: ../../using/android.rst:49 +msgid "" +"Or if you want to build it yourself, follow the instructions in :source:" +"`Android/README.md`. The ``prefix`` directory will be created under :samp:" +"`cross-build/{HOST}`." +msgstr "" + +#: ../../using/android.rst:53 msgid "" "Add code to your :source:`build.gradle ` file to copy the following items into your project. All except your " "own Python code can be copied from ``prefix/lib``:" msgstr "" -#: ../../using/android.rst:50 +#: ../../using/android.rst:57 msgid "In your JNI libraries:" msgstr "" -#: ../../using/android.rst:52 +#: ../../using/android.rst:59 msgid "``libpython*.*.so``" msgstr "``libpython*.*.so``" -#: ../../using/android.rst:53 +#: ../../using/android.rst:60 msgid "``lib*_python.so`` (external libraries such as OpenSSL)" msgstr "``lib*_python.so``\\ (外部函式庫,例如 OpenSSL)" -#: ../../using/android.rst:55 +#: ../../using/android.rst:62 msgid "In your assets:" msgstr "" -#: ../../using/android.rst:57 +#: ../../using/android.rst:64 msgid "``python*.*`` (the Python standard library)" msgstr "``python*.*``\\ (Python 標準函式庫)" -#: ../../using/android.rst:58 +#: ../../using/android.rst:65 msgid "``python*.*/site-packages`` (your own Python code)" msgstr "``python*.*/site-packages``\\ (你自己的 Python 程式碼)" -#: ../../using/android.rst:60 +#: ../../using/android.rst:67 msgid "" "Add code to your app to :source:`extract the assets to the filesystem " "`." msgstr "" -#: ../../using/android.rst:63 +#: ../../using/android.rst:70 msgid "" "Add code to your app to :source:`start Python in embedded mode `. This will need to be C code called " "via JNI." msgstr "" -#: ../../using/android.rst:68 +#: ../../using/android.rst:75 msgid "Building a Python package for Android" msgstr "建置用於 Android 的 Python 套件" -#: ../../using/android.rst:70 +#: ../../using/android.rst:77 msgid "" "Python packages can be built for Android as wheels and released on PyPI. The " "recommended tool for doing this is `cibuildwheel \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,8 +44,8 @@ msgstr "在 Windows 上需要 Microsoft Visual Studio 2017 或更新版本。" #: ../../using/configure.rst:19 msgid "" "Support for `IEEE 754 `_ floating-" -"point numbers and `floating-point Not-a-Number (NaN) `_." +"point numbers and `floating-point Not-a-Number (NaN) `_." msgstr "" "支援 `IEEE 754 `_ 浮點數與\\ `浮點數" "非數值 (NaN) `_。" @@ -55,38 +55,108 @@ msgid "Support for threads." msgstr "thread 的支援。" #: ../../using/configure.rst:25 +#, fuzzy +msgid "To build optional modules:" +msgstr "內建雜湊模組:" + +#: ../../using/configure.rst:27 +msgid "`libbz2 `_ for the :mod:`bz2` module." +msgstr "" + +#: ../../using/configure.rst:29 msgid "" -"OpenSSL 1.1.1 is the minimum version and OpenSSL 3.0.16 is the recommended " -"minimum version for the :mod:`ssl` and :mod:`hashlib` extension modules." +"`libb2 `_ (:ref:`BLAKE2 `), " +"used by :mod:`hashlib` module." +msgstr "" + +#: ../../using/configure.rst:32 +msgid "" +"`libffi `_ 3.3.0 is the recommended minimum " +"version for the :mod:`ctypes` module." +msgstr "" + +#: ../../using/configure.rst:35 +#, fuzzy +msgid "``liblzma``, for the :mod:`lzma` module." +msgstr "請見 :mod:`ssl` 模組。" + +#: ../../using/configure.rst:37 +msgid "" +"`libmpdec `_ 2.5.0 for " +"the :mod:`decimal` module." +msgstr "" + +#: ../../using/configure.rst:40 +msgid "``libncurses`` or ``libncursesw``, for the :mod:`curses` module." +msgstr "" + +#: ../../using/configure.rst:43 +msgid "``libpanel`` or ``libpanelw``, for the :mod:`curses.panel` module." +msgstr "" + +#: ../../using/configure.rst:46 +msgid "" +"`libreadline `_ or " +"`libedit `_ for the :mod:`readline` " +"module." +msgstr "" + +#: ../../using/configure.rst:50 +msgid "" +"`libuuid `_, for the :mod:`uuid` module." +msgstr "" + +#: ../../using/configure.rst:52 +#, fuzzy +msgid "" +"`OpenSSL `_ 1.1.1 is the minimum version and " +"OpenSSL 3.0.18 is the recommended minimum version for the :mod:`ssl` and :" +"mod:`hashlib` extension modules." msgstr "" "OpenSSL 1.1.1 是最低版本,OpenSSL 3.0.16 是 :mod:`ssl` 與 :mod:`hashlib` 擴充" "模組的建議最低版本。" -#: ../../using/configure.rst:28 -msgid "SQLite 3.15.2 for the :mod:`sqlite3` extension module." +#: ../../using/configure.rst:56 +msgid "" +"`SQLite `_ 3.15.2 for the :mod:`sqlite3` extension " +"module." +msgstr "" + +#: ../../using/configure.rst:58 +msgid "" +"`Tcl/Tk `_ 8.5.12 for the :mod:`tkinter` module." msgstr "" -#: ../../using/configure.rst:30 -msgid "Tcl/Tk 8.5.12 for the :mod:`tkinter` module." +#: ../../using/configure.rst:60 +msgid "" +"`zlib `_ 1.1.4 is the reccomended minimum version for " +"the :mod:`zlib` module." msgstr "" -#: ../../using/configure.rst:32 +#: ../../using/configure.rst:63 msgid "" -"`libmpdec `_ 2.5.0 for " -"the :mod:`decimal` module." +"`zstd `_ 1.4.5 is the minimum version for " +"the :mod:`compression.zstd` module." msgstr "" -#: ../../using/configure.rst:35 +#: ../../using/configure.rst:66 msgid "" -"Autoconf 2.72 and aclocal 1.16.5 are required to regenerate " -"the :file:`configure` script." +"For a full list of dependencies required to build all modules and how to " +"install them, see the `devguide `_." msgstr "" -#: ../../using/configure.rst:38 +#: ../../using/configure.rst:70 +msgid "" +"Autoconf 2.72 and aclocal 1.16.5 are required to regenerate the :file:" +"`configure` script." +msgstr "" + +#: ../../using/configure.rst:73 msgid "Tcl/Tk version 8.3.1 is now required." msgstr "Tcl/Tk version 8.3.1 現在是必要的。" -#: ../../using/configure.rst:41 +#: ../../using/configure.rst:76 msgid "" "On Windows, Visual Studio 2015 or later is now required. Tcl/Tk version 8.4 " "is now required." @@ -94,52 +164,52 @@ msgstr "" "在 Windows 上,Visual Studio 2015 或更新版本與 Tcl/Tk version 8.4 現在是必要" "的。" -#: ../../using/configure.rst:45 +#: ../../using/configure.rst:80 msgid "" "Selected C99 features are now required, like ```` and ``static " "inline`` functions." msgstr "" -#: ../../using/configure.rst:49 +#: ../../using/configure.rst:84 msgid "Thread support and OpenSSL 1.0.2 are now required." msgstr "對執行緒與 OpenSSL 1.0.2 的支援現在是必要的。" -#: ../../using/configure.rst:52 +#: ../../using/configure.rst:87 msgid "OpenSSL 1.1.1 is now required. Require SQLite 3.7.15." msgstr "OpenSSL 1.1.1 現在是必要的。需要 SQLite 3.7.15。" -#: ../../using/configure.rst:56 +#: ../../using/configure.rst:91 msgid "" "C11 compiler, IEEE 754 and NaN support are now required. On Windows, Visual " "Studio 2017 or later is required. Tcl/Tk version 8.5.12 is now required for " "the :mod:`tkinter` module." msgstr "" -#: ../../using/configure.rst:61 +#: ../../using/configure.rst:96 msgid "Autoconf 2.71, aclocal 1.16.5 and SQLite 3.15.2 are now required." msgstr "" -#: ../../using/configure.rst:64 +#: ../../using/configure.rst:99 msgid "Autoconf 2.72 is now required." msgstr "Autoconf 2.72 現在是必要的。" -#: ../../using/configure.rst:67 +#: ../../using/configure.rst:102 msgid "" "See also :pep:`7` \"Style Guide for C Code\" and :pep:`11` \"CPython " "platform support\"." msgstr "" -#: ../../using/configure.rst:72 +#: ../../using/configure.rst:107 msgid "Generated files" msgstr "產生的檔案" -#: ../../using/configure.rst:74 +#: ../../using/configure.rst:109 msgid "" "To reduce build dependencies, Python source code contains multiple generated " "files. Commands to regenerate all generated files::" msgstr "" -#: ../../using/configure.rst:77 +#: ../../using/configure.rst:112 msgid "" "make regen-all\n" "make regen-stdlib-module-names\n" @@ -151,17 +221,17 @@ msgstr "" "make regen-limited-abi\n" "make regen-configure" -#: ../../using/configure.rst:82 +#: ../../using/configure.rst:117 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:86 +#: ../../using/configure.rst:121 msgid "configure script" msgstr "設定腳本" -#: ../../using/configure.rst:88 +#: ../../using/configure.rst:123 msgid "" "The ``make regen-configure`` command regenerates the ``aclocal.m4`` file and " "the ``configure`` script using the ``Tools/build/regen-configure.sh`` shell " @@ -169,107 +239,107 @@ msgid "" "have a reproducible output." msgstr "" -#: ../../using/configure.rst:93 +#: ../../using/configure.rst:128 msgid "The container is optional, the following command can be run locally::" msgstr "" -#: ../../using/configure.rst:95 +#: ../../using/configure.rst:130 msgid "autoreconf -ivf -Werror" msgstr "autoreconf -ivf -Werror" -#: ../../using/configure.rst:97 +#: ../../using/configure.rst:132 msgid "" "The generated files can change depending on the exact ``autoconf-archive``, " "``aclocal`` and ``pkg-config`` versions." msgstr "" -#: ../../using/configure.rst:104 +#: ../../using/configure.rst:139 msgid "Configure Options" msgstr "設定選項" -#: ../../using/configure.rst:106 +#: ../../using/configure.rst:141 msgid "List all :file:`configure` script options using::" msgstr "使用以下命令列出所有 :file:`configure` 腳本選項: ::" -#: ../../using/configure.rst:108 +#: ../../using/configure.rst:143 msgid "./configure --help" msgstr "./configure --help" -#: ../../using/configure.rst:110 +#: ../../using/configure.rst:145 msgid "" "See also the :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution." msgstr "請見 Python 原始碼發行版中的 :file:`Misc/SpecialBuilds.txt`。" -#: ../../using/configure.rst:113 +#: ../../using/configure.rst:148 msgid "General Options" msgstr "一般選項" -#: ../../using/configure.rst:117 +#: ../../using/configure.rst:152 msgid "" "Support loadable extensions in the :mod:`!_sqlite` extension module (default " "is no) of the :mod:`sqlite3` module." msgstr "" -#: ../../using/configure.rst:120 +#: ../../using/configure.rst:155 msgid "" -"See the :meth:`sqlite3.Connection.enable_load_extension` method of " -"the :mod:`sqlite3` module." +"See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" +"`sqlite3` module." msgstr "" "請見 :mod:`sqlite3` 模組的 :meth:`sqlite3.Connection.enable_load_extension` " "方法。" -#: ../../using/configure.rst:127 +#: ../../using/configure.rst:162 msgid "" -"Disable IPv6 support (enabled by default if supported), see " -"the :mod:`socket` module." +"Disable IPv6 support (enabled by default if supported), see the :mod:" +"`socket` module." msgstr "停用 IPv6 支援(如果支援的話預設是啟用的),請見 :mod:`socket` 模組。" -#: ../../using/configure.rst:132 +#: ../../using/configure.rst:167 msgid "Define the size in bits of Python :class:`int` digits: 15 or 30 bits." msgstr "" -#: ../../using/configure.rst:134 +#: ../../using/configure.rst:169 msgid "By default, the digit size is 30." msgstr "" -#: ../../using/configure.rst:136 +#: ../../using/configure.rst:171 msgid "Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``." msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``。" -#: ../../using/configure.rst:138 +#: ../../using/configure.rst:173 msgid "See :data:`sys.int_info.bits_per_digit `." msgstr "參閱 :data:`sys.int_info.bits_per_digit `。" -#: ../../using/configure.rst:142 +#: ../../using/configure.rst:177 msgid "Set the Python executable suffix to *SUFFIX*." msgstr "將 Python 執行檔的後綴設定為 *SUFFIX*。" -#: ../../using/configure.rst:144 +#: ../../using/configure.rst:179 msgid "" "The default suffix is ``.exe`` on Windows and macOS (``python.exe`` " -"executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser, " -"``.wasm`` on WASI, and an empty string on other platforms (``python`` " +"executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser, ``." +"wasm`` on WASI, and an empty string on other platforms (``python`` " "executable)." msgstr "" "在 Windows 和 macOS 上預設的後綴是 ``.exe`` (``python.exe`` 執行檔)、在 " "Emscripten node 上為 ``.js``、在 Emscripten 瀏覽器為 ``.html``、在 WASI 上為 " "``.wasm``,以及在其他平台為空字串(``python`` 執行檔)。" -#: ../../using/configure.rst:149 +#: ../../using/configure.rst:184 msgid "" -"The default suffix on WASM platform is one of ``.js``, ``.html`` or " -"``.wasm``." +"The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." +"wasm``." msgstr "在 WASM 平台上預設的後綴是 ``.js``、``.html`` 或 ``.wasm`` 中的一個。" -#: ../../using/configure.rst:155 +#: ../../using/configure.rst:190 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:159 +#: ../../using/configure.rst:194 msgid "" "Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/" "etc/zoneinfo``." @@ -277,152 +347,152 @@ msgstr "" "預設值:``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/" "zoneinfo``。" -#: ../../using/configure.rst:161 +#: ../../using/configure.rst:196 msgid "See :data:`os.pathsep` path separator." msgstr "請見 :data:`os.pathsep` 路徑分隔符號。" -#: ../../using/configure.rst:167 +#: ../../using/configure.rst:202 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:170 +#: ../../using/configure.rst:205 msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." msgstr "請見 :const:`decimal.HAVE_CONTEXTVAR` 與 :mod:`contextvars` 模組。" -#: ../../using/configure.rst:176 +#: ../../using/configure.rst:211 msgid "Override order to check db backends for the :mod:`dbm` module" msgstr "" -#: ../../using/configure.rst:178 +#: ../../using/configure.rst:213 msgid "" "A valid value is a colon (``:``) separated string with the backend names:" msgstr "" -#: ../../using/configure.rst:180 +#: ../../using/configure.rst:215 msgid "``ndbm``;" msgstr "``ndbm``;" -#: ../../using/configure.rst:181 +#: ../../using/configure.rst:216 msgid "``gdbm``;" msgstr "``gdbm``;" -#: ../../using/configure.rst:182 +#: ../../using/configure.rst:217 msgid "``bdb``." msgstr "``bdb``." -#: ../../using/configure.rst:186 +#: ../../using/configure.rst:221 msgid "Disable C locale coercion to a UTF-8 based locale (enabled by default)." msgstr "" -#: ../../using/configure.rst:188 +#: ../../using/configure.rst:223 msgid "Don't define the ``PY_COERCE_C_LOCALE`` macro." msgstr "不要定義 ``PY_COERCE_C_LOCALE`` 巨集。" -#: ../../using/configure.rst:190 +#: ../../using/configure.rst:225 msgid "See :envvar:`PYTHONCOERCECLOCALE` and the :pep:`538`." msgstr "請見 :envvar:`PYTHONCOERCECLOCALE` 與 :pep:`538`。" -#: ../../using/configure.rst:194 +#: ../../using/configure.rst:229 msgid "Python library directory name (default is ``lib``)." msgstr "Python 函式庫目錄名稱(預設為 ``lib`` )。" -#: ../../using/configure.rst:196 +#: ../../using/configure.rst:231 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." msgstr "Fedora 和 SuSE 在 64 位元平台上使用 ``lib64``。" -#: ../../using/configure.rst:198 +#: ../../using/configure.rst:233 msgid "See :data:`sys.platlibdir`." msgstr "參閱 :data:`sys.platlibdir`。" -#: ../../using/configure.rst:204 +#: ../../using/configure.rst:239 msgid "" "Directory of wheel packages used by the :mod:`ensurepip` module (none by " "default)." msgstr "" -#: ../../using/configure.rst:207 +#: ../../using/configure.rst:242 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" -"share/python-wheels/`` directory and don't install the :mod:`!" -"ensurepip._bundled` package." +"share/python-wheels/`` directory and don't install the :mod:`!ensurepip." +"_bundled` package." msgstr "" -#: ../../using/configure.rst:216 +#: ../../using/configure.rst:251 msgid "" "Whether configure should use :program:`pkg-config` to detect build " "dependencies." msgstr "" -#: ../../using/configure.rst:219 +#: ../../using/configure.rst:254 msgid "``check`` (default): :program:`pkg-config` is optional" msgstr "``check``\\ (預設)::program:`pkg-config` 是可選的" -#: ../../using/configure.rst:220 +#: ../../using/configure.rst:255 msgid "``yes``: :program:`pkg-config` is mandatory" msgstr "``yes``::program:`pkg-config` 是必要的" -#: ../../using/configure.rst:221 +#: ../../using/configure.rst:256 msgid "``no``: configure does not use :program:`pkg-config` even when present" msgstr "``no``:即使存在也不使用 :program:`pkg-config` 來配置" -#: ../../using/configure.rst:227 +#: ../../using/configure.rst:262 msgid "Turn on internal Python performance statistics gathering." msgstr "" -#: ../../using/configure.rst:229 +#: ../../using/configure.rst:264 msgid "" "By default, statistics gathering is off. Use ``python3 -X pystats`` command " "or set ``PYTHONSTATS=1`` environment variable to turn on statistics " "gathering at Python startup." msgstr "" -#: ../../using/configure.rst:233 +#: ../../using/configure.rst:268 msgid "" "At Python exit, dump statistics if statistics gathering was on and not " "cleared." msgstr "" -#: ../../using/configure.rst:236 ../../using/configure.rst:759 +#: ../../using/configure.rst:271 ../../using/configure.rst:794 msgid "Effects:" msgstr "效果:" -#: ../../using/configure.rst:238 +#: ../../using/configure.rst:273 msgid "Add :option:`-X pystats <-X>` command line option." msgstr "新增 :option:`-X pystats <-X>` 命令列選項。" -#: ../../using/configure.rst:239 +#: ../../using/configure.rst:274 msgid "Add :envvar:`!PYTHONSTATS` environment variable." msgstr "新增 :envvar:`!PYTHONSTATS` 環境變數。" -#: ../../using/configure.rst:240 +#: ../../using/configure.rst:275 msgid "Define the ``Py_STATS`` macro." msgstr "定義 ``Py_STATS`` 巨集。" -#: ../../using/configure.rst:241 +#: ../../using/configure.rst:276 msgid "Add functions to the :mod:`sys` module:" msgstr "新增函式到 :mod:`sys` 模組。" -#: ../../using/configure.rst:243 +#: ../../using/configure.rst:278 msgid ":func:`!sys._stats_on`: Turns on statistics gathering." msgstr ":func:`!sys._stats_on`:啟用統計資料收集。" -#: ../../using/configure.rst:244 +#: ../../using/configure.rst:279 msgid ":func:`!sys._stats_off`: Turns off statistics gathering." msgstr ":func:`!sys._stats_off`:關閉統計資料收集。" -#: ../../using/configure.rst:245 +#: ../../using/configure.rst:280 msgid ":func:`!sys._stats_clear`: Clears the statistics." msgstr ":func:`!sys._stats_clear`:清除統計資料。" -#: ../../using/configure.rst:246 +#: ../../using/configure.rst:281 msgid "" ":func:`!sys._stats_dump`: Dump statistics to file, and clears the statistics." msgstr ":func:`!sys._stats_dump`:將統計資料轉儲到檔案,並清除統計資料。" -#: ../../using/configure.rst:248 +#: ../../using/configure.rst:283 msgid "" "The statistics will be dumped to a arbitrary (probably unique) file in ``/" "tmp/py_stats/`` (Unix) or ``C:\\temp\\py_stats\\`` (Windows). If that " @@ -432,162 +502,162 @@ msgstr "" "(Windows) 中的任意(可能是唯一的)檔案。如果該目錄不存在,結果將被列印到 " "stderr。" -#: ../../using/configure.rst:252 +#: ../../using/configure.rst:287 msgid "Use ``Tools/scripts/summarize_stats.py`` to read the stats." msgstr "使用 ``Tools/scripts/summarize_stats.py`` 來讀取統計資料。" -#: ../../using/configure.rst:254 +#: ../../using/configure.rst:289 msgid "Statistics:" msgstr "" -#: ../../using/configure.rst:256 +#: ../../using/configure.rst:291 msgid "Opcode:" msgstr "" -#: ../../using/configure.rst:258 +#: ../../using/configure.rst:293 msgid "Specialization: success, failure, hit, deferred, miss, deopt, failures;" msgstr "" -#: ../../using/configure.rst:259 +#: ../../using/configure.rst:294 msgid "Execution count;" msgstr "" -#: ../../using/configure.rst:260 +#: ../../using/configure.rst:295 msgid "Pair count." msgstr "" -#: ../../using/configure.rst:262 +#: ../../using/configure.rst:297 msgid "Call:" msgstr "" -#: ../../using/configure.rst:264 +#: ../../using/configure.rst:299 msgid "Inlined Python calls;" msgstr "" -#: ../../using/configure.rst:265 +#: ../../using/configure.rst:300 msgid "PyEval calls;" msgstr "" -#: ../../using/configure.rst:266 +#: ../../using/configure.rst:301 msgid "Frames pushed;" msgstr "" -#: ../../using/configure.rst:267 +#: ../../using/configure.rst:302 msgid "Frame object created;" msgstr "" -#: ../../using/configure.rst:268 +#: ../../using/configure.rst:303 msgid "" "Eval calls: vector, generator, legacy, function VECTORCALL, build class, " "slot, function \"ex\", API, method." msgstr "" -#: ../../using/configure.rst:271 +#: ../../using/configure.rst:306 msgid "Object:" msgstr "物件:" -#: ../../using/configure.rst:273 +#: ../../using/configure.rst:308 msgid "incref and decref;" msgstr "" -#: ../../using/configure.rst:274 +#: ../../using/configure.rst:309 msgid "interpreter incref and decref;" msgstr "" -#: ../../using/configure.rst:275 +#: ../../using/configure.rst:310 msgid "allocations: all, 512 bytes, 4 kiB, big;" msgstr "" -#: ../../using/configure.rst:276 +#: ../../using/configure.rst:311 msgid "free;" msgstr "" -#: ../../using/configure.rst:277 +#: ../../using/configure.rst:312 msgid "to/from free lists;" msgstr "" -#: ../../using/configure.rst:278 +#: ../../using/configure.rst:313 msgid "dictionary materialized/dematerialized;" msgstr "" -#: ../../using/configure.rst:279 +#: ../../using/configure.rst:314 msgid "type cache;" msgstr "" -#: ../../using/configure.rst:280 +#: ../../using/configure.rst:315 msgid "optimization attempts;" msgstr "最佳化嘗試;" -#: ../../using/configure.rst:281 +#: ../../using/configure.rst:316 msgid "optimization traces created/executed;" msgstr "" -#: ../../using/configure.rst:282 +#: ../../using/configure.rst:317 msgid "uops executed." msgstr "" -#: ../../using/configure.rst:284 +#: ../../using/configure.rst:319 msgid "Garbage collector:" msgstr "垃圾回收器:" -#: ../../using/configure.rst:286 +#: ../../using/configure.rst:321 msgid "Garbage collections;" msgstr "垃圾回收;" -#: ../../using/configure.rst:287 +#: ../../using/configure.rst:322 msgid "Objects visited;" msgstr "" -#: ../../using/configure.rst:288 +#: ../../using/configure.rst:323 msgid "Objects collected." msgstr "" -#: ../../using/configure.rst:296 +#: ../../using/configure.rst:331 msgid "" "Enables support for running Python without the :term:`global interpreter " "lock` (GIL): free threading build." msgstr "" -#: ../../using/configure.rst:299 +#: ../../using/configure.rst:334 msgid "" -"Defines the ``Py_GIL_DISABLED`` macro and adds ``\"t\"`` " -"to :data:`sys.abiflags`." +"Defines the ``Py_GIL_DISABLED`` macro and adds ``\"t\"`` to :data:`sys." +"abiflags`." msgstr "" -#: ../../using/configure.rst:302 +#: ../../using/configure.rst:337 msgid "See :ref:`whatsnew313-free-threaded-cpython` for more detail." msgstr "" -#: ../../using/configure.rst:308 +#: ../../using/configure.rst:343 msgid "" "Indicate how to integrate the :ref:`experimental just-in-time compiler " "`." msgstr "" -#: ../../using/configure.rst:310 +#: ../../using/configure.rst:345 msgid "``no``: Don't build the JIT." msgstr "" -#: ../../using/configure.rst:311 +#: ../../using/configure.rst:346 msgid "" "``yes``: Enable the JIT. To disable it at runtime, set the environment " "variable :envvar:`PYTHON_JIT=0 `." msgstr "" -#: ../../using/configure.rst:313 +#: ../../using/configure.rst:348 msgid "" "``yes-off``: Build the JIT, but disable it by default. To enable it at " "runtime, set the environment variable :envvar:`PYTHON_JIT=1 `." msgstr "" -#: ../../using/configure.rst:315 +#: ../../using/configure.rst:350 msgid "" "``interpreter``: Enable the \"JIT interpreter\" (only useful for those " "debugging the JIT itself). To disable it at runtime, set the environment " "variable :envvar:`PYTHON_JIT=0 `." msgstr "" -#: ../../using/configure.rst:319 +#: ../../using/configure.rst:354 msgid "" "``--enable-experimental-jit=no`` is the default behavior if the option is " "not provided, and ``--enable-experimental-jit`` is shorthand for ``--enable-" @@ -595,215 +665,215 @@ msgid "" "information, including how to install the necessary build-time dependencies." msgstr "" -#: ../../using/configure.rst:326 +#: ../../using/configure.rst:361 msgid "" "When building CPython with JIT enabled, ensure that your system has Python " "3.11 or later installed." msgstr "" -#: ../../using/configure.rst:332 +#: ../../using/configure.rst:367 msgid "Path to ``pkg-config`` utility." msgstr "" -#: ../../using/configure.rst:337 +#: ../../using/configure.rst:372 msgid "``pkg-config`` options." msgstr "``pkg-config`` 選項。" -#: ../../using/configure.rst:341 +#: ../../using/configure.rst:376 msgid "C compiler options" msgstr "C 編譯器選項。" -#: ../../using/configure.rst:345 ../../using/configure.rst:1329 +#: ../../using/configure.rst:380 ../../using/configure.rst:1364 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:349 ../../using/configure.rst:1341 +#: ../../using/configure.rst:384 ../../using/configure.rst:1376 msgid "C compiler flags." msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:353 +#: ../../using/configure.rst:388 msgid "C preprocessor command." msgstr "C 預處理器指令。" -#: ../../using/configure.rst:357 +#: ../../using/configure.rst:392 msgid "C preprocessor flags, e.g. :samp:`-I{include_dir}`." msgstr "C 預處理器旗標,例如::samp:`-I{include_dir}`。" -#: ../../using/configure.rst:361 ../../using/configure.rst:833 +#: ../../using/configure.rst:396 ../../using/configure.rst:868 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:365 +#: ../../using/configure.rst:400 msgid "Linker flags, e.g. :samp:`-L{library_directory}`." msgstr "" -#: ../../using/configure.rst:369 +#: ../../using/configure.rst:404 msgid "Libraries to pass to the linker, e.g. :samp:`-l{library}`." msgstr "" -#: ../../using/configure.rst:373 +#: ../../using/configure.rst:408 msgid "Name for machine-dependent library files." msgstr "" -#: ../../using/configure.rst:377 +#: ../../using/configure.rst:412 msgid "Options for third-party dependencies" msgstr "" -#: ../../using/configure.rst:384 +#: ../../using/configure.rst:419 msgid "" "C compiler and linker flags to link Python to ``libbz2``, used by :mod:`bz2` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:390 +#: ../../using/configure.rst:425 msgid "" -"C compiler and linker flags for ``libncurses`` or ``libncursesw``, used " -"by :mod:`curses` module, overriding ``pkg-config``." +"C compiler and linker flags for ``libncurses`` or ``libncursesw``, used by :" +"mod:`curses` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:396 +#: ../../using/configure.rst:431 msgid "C compiler and linker flags for ``gdbm``." msgstr "" -#: ../../using/configure.rst:401 +#: ../../using/configure.rst:436 msgid "" "C compiler and linker flags for ``libb2`` (:ref:`BLAKE2 `), " "used by :mod:`hashlib` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:407 +#: ../../using/configure.rst:442 msgid "" "C compiler and linker flags for ``libedit``, used by :mod:`readline` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:413 +#: ../../using/configure.rst:448 msgid "" "C compiler and linker flags for ``libffi``, used by :mod:`ctypes` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:419 +#: ../../using/configure.rst:454 msgid "" "C compiler and linker flags for ``libmpdec``, used by :mod:`decimal` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:424 +#: ../../using/configure.rst:459 msgid "" "These environment variables have no effect unless :option:`--with-system-" "libmpdec` is specified." msgstr "" -#: ../../using/configure.rst:430 +#: ../../using/configure.rst:465 msgid "" "C compiler and linker flags for ``liblzma``, used by :mod:`lzma` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:436 +#: ../../using/configure.rst:471 msgid "" "C compiler and linker flags for ``libreadline``, used by :mod:`readline` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:442 +#: ../../using/configure.rst:477 msgid "" "C compiler and linker flags for ``libsqlite3``, used by :mod:`sqlite3` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:448 +#: ../../using/configure.rst:483 msgid "" "C compiler and linker flags for ``libuuid``, used by :mod:`uuid` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:454 +#: ../../using/configure.rst:489 msgid "" "C compiler and linker flags for ``libzstd``, used by :mod:`compression.zstd` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:462 +#: ../../using/configure.rst:497 msgid "C compiler and linker flags for PANEL, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:464 +#: ../../using/configure.rst:499 msgid "" -"C compiler and linker flags for ``libpanel`` or ``libpanelw``, used " -"by :mod:`curses.panel` module, overriding ``pkg-config``." +"C compiler and linker flags for ``libpanel`` or ``libpanelw``, used by :mod:" +"`curses.panel` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:470 +#: ../../using/configure.rst:505 msgid "C compiler and linker flags for TCLTK, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:475 +#: ../../using/configure.rst:510 msgid "" "C compiler and linker flags for ``libzlib``, used by :mod:`gzip` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:480 +#: ../../using/configure.rst:515 msgid "WebAssembly Options" msgstr "WebAssembly 選項" -#: ../../using/configure.rst:484 +#: ../../using/configure.rst:519 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:486 +#: ../../using/configure.rst:521 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:493 +#: ../../using/configure.rst:528 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:499 +#: ../../using/configure.rst:534 msgid "Install Options" msgstr "安裝選項" -#: ../../using/configure.rst:503 +#: ../../using/configure.rst:538 msgid "" -"Install architecture-independent files in PREFIX. On Unix, it defaults " -"to :file:`/usr/local`." +"Install architecture-independent files in PREFIX. On Unix, it defaults to :" +"file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:506 +#: ../../using/configure.rst:541 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.prefix` 取得。" -#: ../../using/configure.rst:508 +#: ../../using/configure.rst:543 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:513 +#: ../../using/configure.rst:548 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:515 +#: ../../using/configure.rst:550 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.exec_prefix` 取得" -#: ../../using/configure.rst:519 +#: ../../using/configure.rst:554 msgid "" -"Don't build nor install test modules, like the :mod:`test` package or " -"the :mod:`!_testcapi` extension module (built and installed by default)." +"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:526 +#: ../../using/configure.rst:561 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "選擇在 Python 安裝時執行的 :mod:`ensurepip` 命令:" -#: ../../using/configure.rst:528 +#: ../../using/configure.rst:563 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." @@ -811,45 +881,45 @@ msgstr "" "``upgrade`` (預設):執行 ``python -m ensurepip --altinstall --upgrade`` 命" "令。" -#: ../../using/configure.rst:530 +#: ../../using/configure.rst:565 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "``install``:執行 ``python -m ensurepip --altinstall`` 命令;" -#: ../../using/configure.rst:531 +#: ../../using/configure.rst:566 msgid "``no``: don't run ensurepip;" msgstr "``no``:不要執行 ensurepip;" -#: ../../using/configure.rst:537 +#: ../../using/configure.rst:572 msgid "Performance options" msgstr "效能選項" -#: ../../using/configure.rst:539 +#: ../../using/configure.rst:574 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:545 +#: ../../using/configure.rst:580 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:548 +#: ../../using/configure.rst:583 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:551 +#: ../../using/configure.rst:586 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:557 +#: ../../using/configure.rst:592 msgid "" "During the build, you may encounter compiler warnings about profile data not " "being available for some source files. These warnings are harmless, as only " @@ -858,58 +928,58 @@ msgid "" "profile-instr-unprofiled`` to :envvar:`CFLAGS`." msgstr "" -#: ../../using/configure.rst:566 +#: ../../using/configure.rst:601 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "在 GCC 上使用 ``-fno-semantic-interposition``。" -#: ../../using/configure.rst:571 +#: ../../using/configure.rst:606 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:574 +#: ../../using/configure.rst:609 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "預設值:``-m test --pgo --timeout=$(TESTTIMEOUT)``。" -#: ../../using/configure.rst:578 +#: ../../using/configure.rst:613 msgid "Task failure is no longer ignored silently." msgstr "" -#: ../../using/configure.rst:583 +#: ../../using/configure.rst:618 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:585 +#: ../../using/configure.rst:620 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:590 +#: ../../using/configure.rst:625 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:593 +#: ../../using/configure.rst:628 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" -#: ../../using/configure.rst:598 +#: ../../using/configure.rst:633 msgid "" "Enable usage of the `BOLT post-link binary optimizer `_ (disabled by default)." msgstr "" -#: ../../using/configure.rst:602 +#: ../../using/configure.rst:637 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:606 +#: ../../using/configure.rst:641 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 " @@ -920,80 +990,80 @@ msgid "" "encouraged." msgstr "" -#: ../../using/configure.rst:614 +#: ../../using/configure.rst:649 msgid "" -"The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!" -"BOLT_APPLY_FLAGS` :program:`configure` variables can be defined to override " -"the default set of arguments for :program:`llvm-bolt` to instrument and " -"apply BOLT data to binaries, respectively." +"The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" +"program:`configure` variables can be defined to override the default set of " +"arguments for :program:`llvm-bolt` to instrument and apply BOLT data to " +"binaries, respectively." msgstr "" -#: ../../using/configure.rst:623 +#: ../../using/configure.rst:658 msgid "" "Arguments to ``llvm-bolt`` when creating a `BOLT optimized binary `_." msgstr "" -#: ../../using/configure.rst:630 +#: ../../using/configure.rst:665 msgid "Arguments to ``llvm-bolt`` when instrumenting binaries." msgstr "" -#: ../../using/configure.rst:636 +#: ../../using/configure.rst:671 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:641 +#: ../../using/configure.rst:676 msgid "" -"Enable interpreters using tail calls in CPython. If enabled, enabling PGO " -"(:option:`--enable-optimizations`) is highly recommended. This option " +"Enable interpreters using tail calls in CPython. If enabled, enabling PGO (:" +"option:`--enable-optimizations`) is highly recommended. This option " "specifically requires a C compiler with proper tail call support, and the " "`preserve_none `_ calling convention. For example, Clang 19 and newer supports this " "feature." msgstr "" -#: ../../using/configure.rst:651 +#: ../../using/configure.rst:686 msgid "" "Disable the fast :ref:`mimalloc ` allocator (enabled by default)." msgstr "" -#: ../../using/configure.rst:654 ../../using/configure.rst:661 +#: ../../using/configure.rst:689 ../../using/configure.rst:696 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:658 +#: ../../using/configure.rst:693 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:665 +#: ../../using/configure.rst:700 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:668 +#: ../../using/configure.rst:703 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "不要定義 ``WITH_DOC_STRINGS`` 巨集。" -#: ../../using/configure.rst:670 +#: ../../using/configure.rst:705 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "請見 ``PyDoc_STRVAR()`` 巨集。" -#: ../../using/configure.rst:674 +#: ../../using/configure.rst:709 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:678 +#: ../../using/configure.rst:713 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" -#: ../../using/configure.rst:683 +#: ../../using/configure.rst:718 msgid "" "Deactivate remote debugging support described in :pep:`768` (enabled by " "default). When this flag is provided the code that allows the interpreter to " @@ -1003,73 +1073,73 @@ msgid "" "executed." msgstr "" -#: ../../using/configure.rst:691 +#: ../../using/configure.rst:726 msgid "" -"This macro is defined by default, unless Python is configured " -"with :option:`--without-remote-debug`." +"This macro is defined by default, unless Python is configured with :option:" +"`--without-remote-debug`." msgstr "" -#: ../../using/configure.rst:694 +#: ../../using/configure.rst:729 msgid "" "Note that even if the macro is defined, remote debugging may not be " "available (for example, on an incompatible platform)." msgstr "" -#: ../../using/configure.rst:703 +#: ../../using/configure.rst:738 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:705 +#: ../../using/configure.rst:740 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:708 +#: ../../using/configure.rst:743 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:710 +#: ../../using/configure.rst:745 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:712 +#: ../../using/configure.rst:747 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "新增 ``d`` 到 :data:`sys.abiflags`。" -#: ../../using/configure.rst:713 +#: ../../using/configure.rst:748 msgid "Add :func:`!sys.gettotalrefcount` function." msgstr "新增 :func:`!sys.gettotalrefcount` 函式。" -#: ../../using/configure.rst:714 +#: ../../using/configure.rst:749 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" -#: ../../using/configure.rst:715 +#: ../../using/configure.rst:750 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" -#: ../../using/configure.rst:717 +#: ../../using/configure.rst:752 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:719 +#: ../../using/configure.rst:754 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:721 +#: ../../using/configure.rst:756 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" -#: ../../using/configure.rst:722 +#: ../../using/configure.rst:757 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -1077,56 +1147,56 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:727 +#: ../../using/configure.rst:762 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:728 +#: ../../using/configure.rst:763 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:730 +#: ../../using/configure.rst:765 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:732 +#: ../../using/configure.rst:767 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:733 +#: ../../using/configure.rst:768 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:735 +#: ../../using/configure.rst:770 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:738 +#: ../../using/configure.rst:773 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:741 +#: ../../using/configure.rst:776 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 :option:`--with-trace-refs` option)." +"``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see the :" +"option:`--with-trace-refs` option)." msgstr "" -#: ../../using/configure.rst:748 +#: ../../using/configure.rst:783 msgid "Debug options" msgstr "偵錯選項" -#: ../../using/configure.rst:752 +#: ../../using/configure.rst:787 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." @@ -1134,23 +1204,23 @@ msgstr "" ":ref:`以偵錯模式建置 Python `:定義 ``Py_DEBUG`` 巨集(預設不啟" "用)。" -#: ../../using/configure.rst:757 +#: ../../using/configure.rst:792 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "以偵錯為目的啟用參照追蹤(預設不啟用)。" -#: ../../using/configure.rst:761 +#: ../../using/configure.rst:796 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" -#: ../../using/configure.rst:762 +#: ../../using/configure.rst:797 msgid "Add :func:`sys.getobjects` function." msgstr "新增 :func:`sys.getobjects` 函式。" -#: ../../using/configure.rst:763 +#: ../../using/configure.rst:798 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" -#: ../../using/configure.rst:765 +#: ../../using/configure.rst:800 msgid "" "The :envvar:`PYTHONDUMPREFS` environment variable can be used to dump " "objects and reference counts still alive at Python exit." @@ -1158,11 +1228,11 @@ msgstr "" ":envvar:`PYTHONDUMPREFS` 環境變數可以用來在 Python 結束時轉儲仍然有效的物件和" "參照計數。" -#: ../../using/configure.rst:768 +#: ../../using/configure.rst:803 msgid ":ref:`Statically allocated objects ` are not traced." msgstr "不追蹤\\ :ref:`靜態配置的物件 `。" -#: ../../using/configure.rst:772 +#: ../../using/configure.rst:807 msgid "" "This build is now ABI compatible with release build and :ref:`debug build " "`." @@ -1170,21 +1240,21 @@ msgstr "" "這個建置現在與發佈版本建置和\\ :ref:`偵錯建置 `\\ 具有 ABI 相容" "性。" -#: ../../using/configure.rst:778 +#: ../../using/configure.rst:813 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -"啟用 C 斷言建置(預設不啟用):``assert(...);`` 和 " -"``_PyObject_ASSERT(...);``。" +"啟用 C 斷言建置(預設不啟用):``assert(...);`` 和 ``_PyObject_ASSERT(...);" +"``。" -#: ../../using/configure.rst:781 +#: ../../using/configure.rst:816 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "如果設定,``NDEBUG`` 巨集不會在 :envvar:`OPT` 編譯器變數中定義。" -#: ../../using/configure.rst:784 +#: ../../using/configure.rst:819 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." @@ -1192,49 +1262,49 @@ msgstr "" "另請參閱 :option:`--with-pydebug` 選項(:ref:`debug build `)," "它也啟用了斷言。" -#: ../../using/configure.rst:791 +#: ../../using/configure.rst:826 msgid "Enable Valgrind support (default is no)." msgstr "啟用 Valgrind 支援(預設不啟用)。" -#: ../../using/configure.rst:795 +#: ../../using/configure.rst:830 msgid "Enable DTrace support (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:797 +#: ../../using/configure.rst:832 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" "請參閱\\ :ref:`使用 DTrace 和 SystemTap 檢測 CPython `。" -#: ../../using/configure.rst:804 +#: ../../using/configure.rst:839 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no). To " -"improve ASan detection capabilities you may also want to combine this " -"with :option:`--without-pymalloc` to disable the specialized small-object " +"improve ASan detection capabilities you may also want to combine this with :" +"option:`--without-pymalloc` to disable the specialized small-object " "allocator whose allocations are not tracked by ASan." msgstr "" -#: ../../using/configure.rst:813 +#: ../../using/configure.rst:848 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "啟用 MemorySanitizer 分配錯誤偵測器 ``msan``\\ (預設不啟用)。" -#: ../../using/configure.rst:819 +#: ../../using/configure.rst:854 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" "啟用 UndefinedBehaviorSanitizer 未定義行為偵測器 ``ubsan``\\ (預設不啟用)。" -#: ../../using/configure.rst:826 +#: ../../using/configure.rst:861 msgid "Enable ThreadSanitizer data race detector, ``tsan`` (default is no)." msgstr "啟用 ThreadSanitizer 資料競爭偵測器 ``tsan``\\ (預設不啟用)。" -#: ../../using/configure.rst:837 +#: ../../using/configure.rst:872 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "啟用建置共享 Python 函式庫:``libpython``\\ (預設不啟用)。" -#: ../../using/configure.rst:841 +#: ../../using/configure.rst:876 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." @@ -1242,171 +1312,172 @@ msgstr "" "不要建置 ``libpythonMAJOR.MINOR.a`` 並且不要安裝 ``python.o``\\ (預設會建置" "並啟用)。" -#: ../../using/configure.rst:848 +#: ../../using/configure.rst:883 msgid "Libraries options" msgstr "函式庫選項" -#: ../../using/configure.rst:852 +#: ../../using/configure.rst:887 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:856 +#: ../../using/configure.rst:891 msgid "" "Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "使用已安裝的 ``expat`` 函式庫建置 :mod:`!pyexpat` 模組(預設不建置)。" -#: ../../using/configure.rst:861 +#: ../../using/configure.rst:896 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdecimal`` " "library, see the :mod:`decimal` module (default is yes)." msgstr "" -"使用已安裝的 ``mpdecimal`` 函式庫建置 ``_decimal`` 擴充模組,請參" -"閱 :mod:`decimal` 模組(預設建置)。" +"使用已安裝的 ``mpdecimal`` 函式庫建置 ``_decimal`` 擴充模組,請參閱 :mod:" +"`decimal` 模組(預設建置)。" -#: ../../using/configure.rst:866 +#: ../../using/configure.rst:901 msgid "Default to using the installed ``mpdecimal`` library." msgstr "預設使用已安裝的 ``mpdecimal`` 函式庫。" -#: ../../using/configure.rst:869 +#: ../../using/configure.rst:904 +#, fuzzy msgid "" "A copy of the ``mpdecimal`` library sources will no longer be distributed " -"with Python 3.15." +"with Python 3.16." msgstr "Python 3.15 不再隨附 ``mpdecimal`` 函式庫的原始碼副本。" -#: ../../using/configure.rst:873 +#: ../../using/configure.rst:908 msgid ":option:`LIBMPDEC_CFLAGS` and :option:`LIBMPDEC_LIBS`." msgstr ":option:`LIBMPDEC_CFLAGS` 和 :option:`LIBMPDEC_LIBS`。" -#: ../../using/configure.rst:877 +#: ../../using/configure.rst:912 msgid "Designate a backend library for the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:879 +#: ../../using/configure.rst:914 msgid "readline: Use readline as the backend." msgstr "" -#: ../../using/configure.rst:880 +#: ../../using/configure.rst:915 msgid "editline: Use editline as the backend." msgstr "" -#: ../../using/configure.rst:886 +#: ../../using/configure.rst:921 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "不要建置 :mod:`readline` 模組(預設會建置)。" -#: ../../using/configure.rst:888 +#: ../../using/configure.rst:923 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" -#: ../../using/configure.rst:894 +#: ../../using/configure.rst:929 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:898 +#: ../../using/configure.rst:933 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:902 +#: ../../using/configure.rst:937 msgid "Root of the OpenSSL directory." msgstr "OpenSSL 目錄的根目錄。" -#: ../../using/configure.rst:908 +#: ../../using/configure.rst:943 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:910 +#: ../../using/configure.rst:945 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:911 +#: ../../using/configure.rst:946 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:913 +#: ../../using/configure.rst:948 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:919 +#: ../../using/configure.rst:954 msgid "Security Options" msgstr "安全性選項" -#: ../../using/configure.rst:923 +#: ../../using/configure.rst:958 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:925 +#: ../../using/configure.rst:960 msgid "``siphash13`` (default);" msgstr "``siphash13``\\ (預設);" -#: ../../using/configure.rst:926 +#: ../../using/configure.rst:961 msgid "``siphash24``;" msgstr "``siphash24``;" -#: ../../using/configure.rst:927 +#: ../../using/configure.rst:962 msgid "``fnv``." msgstr "``fnv``。" -#: ../../using/configure.rst:931 +#: ../../using/configure.rst:966 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:936 +#: ../../using/configure.rst:971 msgid "Built-in hash modules:" msgstr "內建雜湊模組:" -#: ../../using/configure.rst:938 +#: ../../using/configure.rst:973 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:939 +#: ../../using/configure.rst:974 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:940 +#: ../../using/configure.rst:975 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:941 +#: ../../using/configure.rst:976 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:942 +#: ../../using/configure.rst:977 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:943 +#: ../../using/configure.rst:978 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:949 +#: ../../using/configure.rst:984 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:951 +#: ../../using/configure.rst:986 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:952 +#: ../../using/configure.rst:987 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:953 +#: ../../using/configure.rst:988 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:955 +#: ../../using/configure.rst:990 msgid "See the :mod:`ssl` module." msgstr "請見 :mod:`ssl` 模組。" -#: ../../using/configure.rst:961 +#: ../../using/configure.rst:996 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:966 +#: ../../using/configure.rst:1001 msgid "" "Disable compiler options that are `recommended by OpenSSF`_ for security " "reasons with no performance overhead. If this option is not enabled, CPython " @@ -1415,24 +1486,24 @@ msgid "" "listed below." msgstr "" -#: ../../using/configure.rst:970 +#: ../../using/configure.rst:1005 msgid "" "The following compiler options are disabled with :option:`!--disable-safety`:" msgstr "" -#: ../../using/configure.rst:972 +#: ../../using/configure.rst:1007 msgid "" "`-fstack-protector-strong`_: Enable run-time checks for stack-based buffer " "overflows." msgstr "" -#: ../../using/configure.rst:973 +#: ../../using/configure.rst:1008 msgid "" "`-Wtrampolines`_: Enable warnings about trampolines that require executable " "stacks." msgstr "" -#: ../../using/configure.rst:983 +#: ../../using/configure.rst:1018 msgid "" "Enable compiler options that are `recommended by OpenSSF`_ for security " "reasons which require overhead. If this option is not enabled, CPython will " @@ -1441,81 +1512,81 @@ msgid "" "listed below." msgstr "" -#: ../../using/configure.rst:987 +#: ../../using/configure.rst:1022 msgid "" "The following compiler options are enabled with :option:`!--enable-slower-" "safety`:" msgstr "" -#: ../../using/configure.rst:989 +#: ../../using/configure.rst:1024 msgid "" "`-D_FORTIFY_SOURCE=3`_: Fortify sources with compile- and run-time checks " "for unsafe libc usage and buffer overflows." msgstr "" -#: ../../using/configure.rst:997 +#: ../../using/configure.rst:1032 msgid "macOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:999 +#: ../../using/configure.rst:1034 msgid "See :source:`Mac/README.rst`." msgstr "參閱 :source:`Mac/README.rst`。" -#: ../../using/configure.rst:1004 +#: ../../using/configure.rst:1039 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:1010 +#: ../../using/configure.rst:1045 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:1015 +#: ../../using/configure.rst:1050 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:1018 +#: ../../using/configure.rst:1053 msgid "Options:" msgstr "選項:" -#: ../../using/configure.rst:1020 +#: ../../using/configure.rst:1055 msgid "``universal2`` (x86-64 and arm64);" msgstr "``universal2``\\ (x86-64 與 arm64);" -#: ../../using/configure.rst:1021 +#: ../../using/configure.rst:1056 msgid "``32-bit`` (PPC and i386);" msgstr "``32-bit``\\ (PPC 與 i386);" -#: ../../using/configure.rst:1022 +#: ../../using/configure.rst:1057 msgid "``64-bit`` (PPC64 and x86-64);" msgstr "``64-bit``\\ (PPC64 與 x86-64);" -#: ../../using/configure.rst:1023 +#: ../../using/configure.rst:1058 msgid "``3-way`` (i386, PPC and x86-64);" msgstr "``3-way``\\ (i386、PPC 與 x86-64);" -#: ../../using/configure.rst:1024 +#: ../../using/configure.rst:1059 msgid "``intel`` (i386 and x86-64);" msgstr "``intel``\\ (i386 與 x86-64);" -#: ../../using/configure.rst:1025 +#: ../../using/configure.rst:1060 msgid "``intel-32`` (i386);" msgstr "``intel-32``\\ (i386);" -#: ../../using/configure.rst:1026 +#: ../../using/configure.rst:1061 msgid "``intel-64`` (x86-64);" msgstr "``intel-64``\\ (x86-64);" -#: ../../using/configure.rst:1027 +#: ../../using/configure.rst:1062 msgid "``all`` (PPC, i386, PPC64 and x86-64)." msgstr "``all``\\ (PPC、i386、PPC64 與 x86-64)。" -#: ../../using/configure.rst:1029 +#: ../../using/configure.rst:1064 msgid "" "Note that values for this configuration item are *not* the same as the " "identifiers used for universal binary wheels on macOS. See the Python " @@ -1524,13 +1595,13 @@ msgid "" "platform-compatibility-tags/#macos>`_" msgstr "" -#: ../../using/configure.rst:1037 +#: ../../using/configure.rst:1072 msgid "" -"Specify the name for the python framework on macOS only valid " -"when :option:`--enable-framework` is set (default: ``Python``)." +"Specify the name for the python framework on macOS only valid when :option:" +"`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:1043 +#: ../../using/configure.rst:1078 msgid "" "The Python standard library contains strings that are known to trigger " "automated inspection tool errors when submitted for distribution by the " @@ -1539,29 +1610,29 @@ msgid "" "can also be specified. This option is disabled by default." msgstr "" -#: ../../using/configure.rst:1052 +#: ../../using/configure.rst:1087 msgid "iOS Options" msgstr "iOS 選項" -#: ../../using/configure.rst:1054 +#: ../../using/configure.rst:1089 msgid "See :source:`iOS/README.rst`." msgstr "參閱 :source:`iOS/README.rst`。" -#: ../../using/configure.rst:1058 +#: ../../using/configure.rst:1093 msgid "" "Create a Python.framework. Unlike macOS, the *INSTALLDIR* argument " "specifying the installation path is mandatory." msgstr "" -#: ../../using/configure.rst:1063 +#: ../../using/configure.rst:1098 msgid "Specify the name for the framework (default: ``Python``)." msgstr "指定框架的名稱(預設值:``Python``)。" -#: ../../using/configure.rst:1067 +#: ../../using/configure.rst:1102 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:1069 +#: ../../using/configure.rst:1104 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 " @@ -1569,28 +1640,28 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:1076 +#: ../../using/configure.rst:1111 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:1080 +#: ../../using/configure.rst:1115 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:1084 +#: ../../using/configure.rst:1119 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:1090 +#: ../../using/configure.rst:1125 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:1092 +#: ../../using/configure.rst:1127 msgid "Example *config.site* file:" msgstr "範例 *config.site* 檔案:" -#: ../../using/configure.rst:1094 +#: ../../using/configure.rst:1129 msgid "" "# config.site-aarch64\n" "ac_cv_buggy_getaddrinfo=no\n" @@ -1602,15 +1673,15 @@ msgstr "" "ac_cv_file__dev_ptmx=yes\n" "ac_cv_file__dev_ptc=no" -#: ../../using/configure.rst:1103 +#: ../../using/configure.rst:1138 msgid "Program to run CPython for the host platform for cross-compilation." msgstr "" -#: ../../using/configure.rst:1108 +#: ../../using/configure.rst:1143 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:1110 +#: ../../using/configure.rst:1145 msgid "" "CONFIG_SITE=config.site-aarch64 ../configure \\\n" " --build=x86_64-pc-linux-gnu \\\n" @@ -1622,65 +1693,65 @@ msgstr "" " --host=aarch64-unknown-linux-gnu \\\n" " --with-build-python=../x86_64/python" -#: ../../using/configure.rst:1117 +#: ../../using/configure.rst:1152 msgid "Python Build System" msgstr "Python 建置系統" -#: ../../using/configure.rst:1120 +#: ../../using/configure.rst:1155 msgid "Main files of the build system" msgstr "建置系統的主要檔案" -#: ../../using/configure.rst:1122 +#: ../../using/configure.rst:1157 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`;" -#: ../../using/configure.rst:1123 +#: ../../using/configure.rst:1158 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" ":file:`Makefile.pre.in` => :file:`Makefile`\\ (由 :file:`configure` 建立);" -#: ../../using/configure.rst:1124 +#: ../../using/configure.rst:1159 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h`\\ (由 :file:`configure` 建立);" -#: ../../using/configure.rst:1125 +#: ../../using/configure.rst:1160 msgid "" -":file:`Modules/Setup`: C extensions built by the Makefile " -"using :file:`Module/makesetup` shell script;" +":file:`Modules/Setup`: C extensions built by the Makefile using :file:" +"`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:1129 +#: ../../using/configure.rst:1164 msgid "Main build steps" msgstr "主要建置步驟" -#: ../../using/configure.rst:1131 +#: ../../using/configure.rst:1166 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "C 檔案(``.c``)被建置為目的檔(``.o``)。" -#: ../../using/configure.rst:1132 +#: ../../using/configure.rst:1167 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:1133 +#: ../../using/configure.rst:1168 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:1135 +#: ../../using/configure.rst:1170 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:1138 +#: ../../using/configure.rst:1173 msgid "Main Makefile targets" msgstr "主要 Makefile 目標" -#: ../../using/configure.rst:1141 +#: ../../using/configure.rst:1176 msgid "make" msgstr "make" -#: ../../using/configure.rst:1143 +#: ../../using/configure.rst:1178 msgid "" "For the most part, when rebuilding after editing some code or refreshing " "your checkout from upstream, all you need to do is execute ``make``, which " @@ -1691,22 +1762,22 @@ msgid "" "all`` will build. The three choices are:" msgstr "" -#: ../../using/configure.rst:1152 +#: ../../using/configure.rst:1187 msgid "``profile-opt`` (configured with ``--enable-optimizations``)" msgstr "``profile-opt``\\ (使用 ``--enable-optimizations`` 配置)" -#: ../../using/configure.rst:1153 +#: ../../using/configure.rst:1188 msgid "" "``build_wasm`` (chosen if the host platform matches ``wasm32-wasi*`` or " "``wasm32-emscripten``)" msgstr "" -#: ../../using/configure.rst:1155 +#: ../../using/configure.rst:1190 msgid "" "``build_all`` (configured without explicitly using either of the others)" msgstr "``build_all``\\ (未明確使用其他選項進行配置)" -#: ../../using/configure.rst:1157 +#: ../../using/configure.rst:1192 msgid "" "Depending on the most recent source file changes, Make will rebuild any " "targets (object files and executables) deemed out-of-date, including running " @@ -1719,11 +1790,11 @@ msgid "" "problems, at the expense of longer build times." msgstr "" -#: ../../using/configure.rst:1170 +#: ../../using/configure.rst:1205 msgid "make platform" msgstr "make platform" -#: ../../using/configure.rst:1172 +#: ../../using/configure.rst:1207 msgid "" "Build the ``python`` program, but don't build the standard library extension " "modules. This generates a file named ``platform`` which contains a single " @@ -1731,91 +1802,91 @@ msgid "" "arm64-3.12`` or ``linux-x86_64-3.13``." msgstr "" -#: ../../using/configure.rst:1179 +#: ../../using/configure.rst:1214 msgid "make profile-opt" msgstr "make profile-opt" -#: ../../using/configure.rst:1181 +#: ../../using/configure.rst:1216 msgid "" "Build Python using profile-guided optimization (PGO). You can use the " "configure :option:`--enable-optimizations` option to make this the default " "target of the ``make`` command (``make all`` or just ``make``)." msgstr "" -#: ../../using/configure.rst:1189 +#: ../../using/configure.rst:1224 msgid "make clean" msgstr "make clean" -#: ../../using/configure.rst:1191 +#: ../../using/configure.rst:1226 msgid "Remove built files." msgstr "移除建置的檔案。" -#: ../../using/configure.rst:1195 +#: ../../using/configure.rst:1230 msgid "make distclean" msgstr "make distclean" -#: ../../using/configure.rst:1197 +#: ../../using/configure.rst:1232 msgid "" "In addition to the work done by ``make clean``, remove files created by the " "configure script. ``configure`` will have to be run before building again. " "[#]_" msgstr "" -#: ../../using/configure.rst:1203 +#: ../../using/configure.rst:1238 msgid "make install" msgstr "make install" -#: ../../using/configure.rst:1205 +#: ../../using/configure.rst:1240 msgid "Build the ``all`` target and install Python." msgstr "建置 ``all`` 目標並安裝 Python。" -#: ../../using/configure.rst:1209 +#: ../../using/configure.rst:1244 msgid "make test" msgstr "make test" -#: ../../using/configure.rst:1211 +#: ../../using/configure.rst:1246 msgid "" "Build the ``all`` target and run the Python test suite with the ``--fast-" "ci`` option without GUI tests. Variables:" msgstr "" -#: ../../using/configure.rst:1214 +#: ../../using/configure.rst:1249 msgid "``TESTOPTS``: additional regrtest command-line options." msgstr "``TESTOPTS``:額外的 regrtest 命令列選項。" -#: ../../using/configure.rst:1215 +#: ../../using/configure.rst:1250 msgid "``TESTPYTHONOPTS``: additional Python command-line options." msgstr "``TESTPYTHONOPTS``:額外的 Python 命令列選項。" -#: ../../using/configure.rst:1216 +#: ../../using/configure.rst:1251 msgid "``TESTTIMEOUT``: timeout in seconds (default: 10 minutes)." msgstr "``TESTTIMEOUT``:秒數表示的超時設定(預設值:10 分鐘)。" -#: ../../using/configure.rst:1220 +#: ../../using/configure.rst:1255 msgid "make ci" msgstr "make ci" -#: ../../using/configure.rst:1222 +#: ../../using/configure.rst:1257 msgid "" "This is similar to ``make test``, but uses the ``-ugui`` to also run GUI " "tests." msgstr "" -#: ../../using/configure.rst:1228 +#: ../../using/configure.rst:1263 msgid "make buildbottest" msgstr "make buildbottest" -#: ../../using/configure.rst:1230 +#: ../../using/configure.rst:1265 msgid "" "This is similar to ``make test``, but uses the ``--slow-ci`` option and " "default timeout of 20 minutes, instead of ``--fast-ci`` option." msgstr "" -#: ../../using/configure.rst:1235 +#: ../../using/configure.rst:1270 msgid "make regen-all" msgstr "make regen-all" -#: ../../using/configure.rst:1237 +#: ../../using/configure.rst:1272 msgid "" "Regenerate (almost) all generated files. These include (but are not limited " "to) bytecode cases, and parser generator file. ``make regen-stdlib-module-" @@ -1823,18 +1894,18 @@ msgid "" "files <#generated-files>`_." msgstr "" -#: ../../using/configure.rst:1244 +#: ../../using/configure.rst:1279 msgid "C extensions" msgstr "C 擴充模組" -#: ../../using/configure.rst:1246 +#: ../../using/configure.rst:1281 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:1250 +#: ../../using/configure.rst:1285 msgid "" ">>> import sys\n" ">>> sys\n" @@ -1852,30 +1923,30 @@ msgstr "" " File \"\", line 1, in \n" "AttributeError: module 'sys' has no attribute '__file__'" -#: ../../using/configure.rst:1260 +#: ../../using/configure.rst:1295 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:1264 +#: ../../using/configure.rst:1299 msgid "" ">>> import _asyncio\n" ">>> _asyncio\n" -"\n" +"\n" ">>> _asyncio.__file__\n" "'/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'" msgstr "" ">>> import _asyncio\n" ">>> _asyncio\n" -"\n" +"\n" ">>> _asyncio.__file__\n" "'/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'" -#: ../../using/configure.rst:1272 +#: ../../using/configure.rst:1307 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-" @@ -1883,174 +1954,172 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:1276 +#: ../../using/configure.rst:1311 msgid "" -"The :c:macro:`!PyAPI_FUNC()`, :c:macro:`!PyAPI_DATA()` " -"and :c:macro:`PyMODINIT_FUNC` macros of :file:`Include/exports.h` are " -"defined differently depending if the ``Py_BUILD_CORE_MODULE`` macro is " -"defined:" +"The :c:macro:`!PyAPI_FUNC()`, :c:macro:`!PyAPI_DATA()` and :c:macro:" +"`PyMODINIT_FUNC` macros of :file:`Include/exports.h` are defined differently " +"depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:1280 +#: ../../using/configure.rst:1315 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" -#: ../../using/configure.rst:1281 +#: ../../using/configure.rst:1316 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" -#: ../../using/configure.rst:1283 +#: ../../using/configure.rst:1318 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its :samp:`PyInit_{xxx}()` function is not " "exported, causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:1289 +#: ../../using/configure.rst:1324 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:1291 +#: ../../using/configure.rst:1326 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:1295 +#: ../../using/configure.rst:1330 msgid "Preprocessor flags" msgstr "預處理器旗標" -#: ../../using/configure.rst:1299 +#: ../../using/configure.rst:1334 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1305 +#: ../../using/configure.rst:1340 msgid "" "(Objective) C/C++ preprocessor flags, e.g. :samp:`-I{include_dir}` if you " "have headers in a nonstandard directory *include_dir*." msgstr "" -#: ../../using/configure.rst:1308 ../../using/configure.rst:1498 +#: ../../using/configure.rst:1343 ../../using/configure.rst:1533 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:1318 +#: ../../using/configure.rst:1353 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1320 +#: ../../using/configure.rst:1355 msgid "" -"Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $" -"(CPPFLAGS)``." +"Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " +"$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:1325 +#: ../../using/configure.rst:1360 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:1331 +#: ../../using/configure.rst:1366 msgid "Example: ``gcc -pthread``." msgstr "範例:``gcc -pthread``。" -#: ../../using/configure.rst:1335 +#: ../../using/configure.rst:1370 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:1337 +#: ../../using/configure.rst:1372 msgid "Example: ``g++ -pthread``." msgstr "範例:``g++ -pthread``。" -#: ../../using/configure.rst:1345 +#: ../../using/configure.rst:1380 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`)." +"extensions. Use it when a compiler flag should *not* be part of :envvar:" +"`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1349 +#: ../../using/configure.rst:1384 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1351 +#: ../../using/configure.rst:1386 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." +"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:1356 +#: ../../using/configure.rst:1391 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:1364 +#: ../../using/configure.rst:1399 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:1371 +#: ../../using/configure.rst:1406 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:1375 +#: ../../using/configure.rst:1410 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1382 +#: ../../using/configure.rst:1417 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1389 +#: ../../using/configure.rst:1424 msgid "Base compiler flags." msgstr "基本編譯器旗標。" -#: ../../using/configure.rst:1393 +#: ../../using/configure.rst:1428 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:1397 +#: ../../using/configure.rst:1432 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:1403 +#: ../../using/configure.rst:1438 msgid "Compiler flags used to build a shared library." msgstr "用於建置共享函式庫的編譯器旗標。" -#: ../../using/configure.rst:1405 +#: ../../using/configure.rst:1440 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:1409 +#: ../../using/configure.rst:1444 msgid "Extra C flags added for building the interpreter object files." msgstr "用於建置直譯器目的檔的額外 C 旗標。" -#: ../../using/configure.rst:1411 +#: ../../using/configure.rst:1446 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" "預設值:當使用 :option:`--enable-shared` 時為 ``$(CCSHARED)``,否則為空字串。" -#: ../../using/configure.rst:1416 +#: ../../using/configure.rst:1451 msgid "" -"Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $" -"(EXTRA_CFLAGS)``." +"Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " +"$(EXTRA_CFLAGS)``." msgstr "" -"預設值:``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $" -"(EXTRA_CFLAGS)``。" +"預設值:``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " +"$(EXTRA_CFLAGS)``。" -#: ../../using/configure.rst:1420 +#: ../../using/configure.rst:1455 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." @@ -2058,139 +2127,138 @@ msgstr "" "預設值:``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``。" -#: ../../using/configure.rst:1426 +#: ../../using/configure.rst:1461 msgid "C flags used for building the interpreter object files." msgstr "用於建置直譯器目的檔的 C 旗標。" -#: ../../using/configure.rst:1428 +#: ../../using/configure.rst:1463 msgid "" -"Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $" -"(CFLAGSFORSHARED)``." +"Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " +"$(CFLAGSFORSHARED)``." msgstr "" -"預設值:``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $" -"(CFLAGSFORSHARED)``。" +"預設值:``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " +"$(CFLAGSFORSHARED)``。" -#: ../../using/configure.rst:1434 +#: ../../using/configure.rst:1469 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "預設值:``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``。" -#: ../../using/configure.rst:1440 +#: ../../using/configure.rst:1475 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:1443 +#: ../../using/configure.rst:1478 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "預設值:``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``。" -#: ../../using/configure.rst:1449 +#: ../../using/configure.rst:1484 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:1451 +#: ../../using/configure.rst:1486 msgid "Default: empty string (not used)." msgstr "預設值:空字串(未使用)。" -#: ../../using/configure.rst:1455 +#: ../../using/configure.rst:1490 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:1459 +#: ../../using/configure.rst:1494 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:1461 +#: ../../using/configure.rst:1496 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "預設值:``$(PURIFY) $(CC)``。" -#: ../../using/configure.rst:1465 +#: ../../using/configure.rst:1500 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1467 +#: ../../using/configure.rst:1502 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:1475 +#: ../../using/configure.rst:1510 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`)." +":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:1479 +#: ../../using/configure.rst:1514 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1481 +#: ../../using/configure.rst:1516 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." +"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:1488 +#: ../../using/configure.rst:1523 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1495 +#: ../../using/configure.rst:1530 msgid "" "Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " "nonstandard directory *lib_dir*." msgstr "" -#: ../../using/configure.rst:1504 +#: ../../using/configure.rst:1539 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:1507 +#: ../../using/configure.rst:1542 msgid "Example: ``-lrt``." msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:1511 +#: ../../using/configure.rst:1546 msgid "Command to build a shared library." msgstr "建置共享函式庫的指令。" -#: ../../using/configure.rst:1513 +#: ../../using/configure.rst:1548 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:1517 +#: ../../using/configure.rst:1552 msgid "Command to build ``libpython`` shared library." msgstr "建置 ``libpython`` 共享函式庫的指令。" -#: ../../using/configure.rst:1519 +#: ../../using/configure.rst:1554 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1523 +#: ../../using/configure.rst:1558 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1527 +#: ../../using/configure.rst:1562 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1533 +#: ../../using/configure.rst:1568 msgid "Linker flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1539 +#: ../../using/configure.rst:1574 msgid "Footnotes" msgstr "註腳" -#: ../../using/configure.rst:1540 +#: ../../using/configure.rst:1575 msgid "" "``git clean -fdx`` is an even more extreme way to \"clean\" your checkout. " "It removes all files not known to Git. When bug hunting using ``git " diff --git a/using/ios.po b/using/ios.po index ec5df85db6..c5f7590976 100644 --- a/using/ios.po +++ b/using/ios.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-02 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,9 +33,9 @@ msgstr "Russell Keith-Magee (2024-03)" msgid "" "Python on iOS is unlike Python on desktop platforms. On a desktop platform, " "Python is generally installed as a system resource that can be used by any " -"user of that computer. Users then interact with Python by running " -"a :program:`python` executable and entering commands at an interactive " -"prompt, or by running a Python script." +"user of that computer. Users then interact with Python by running a :program:" +"`python` executable and entering commands at an interactive prompt, or by " +"running a Python script." msgstr "" #: ../../using/ios.rst:16 @@ -49,10 +49,10 @@ msgstr "" msgid "" "As a result, the only way you can use Python on iOS is in embedded mode - " "that is, by writing a native iOS application, and embedding a Python " -"interpreter using ``libPython``, and invoking Python code using " -"the :ref:`Python embedding API `. The full Python interpreter, " -"the standard library, and all your Python code is then packaged as a " -"standalone bundle that can be distributed via the iOS App Store." +"interpreter using ``libPython``, and invoking Python code using the :ref:" +"`Python embedding API `. The full Python interpreter, the " +"standard library, and all your Python code is then packaged as a standalone " +"bundle that can be distributed via the iOS App Store." msgstr "" #: ../../using/ios.rst:27 @@ -74,13 +74,13 @@ msgstr "" #: ../../using/ios.rst:39 msgid "" -"The minimum supported iOS version is specified at compile time, using " -"the :option:`--host` option to ``configure``. By default, when compiled for " -"iOS, Python will be compiled with a minimum supported iOS version of 13.0. " -"To use a different minimum iOS version, provide the version number as part " -"of the :option:`!--host` argument - for example, ``--host=arm64-apple-" -"ios15.4-simulator`` would compile an ARM64 simulator build with a deployment " -"target of 15.4." +"The minimum supported iOS version is specified at compile time, using the :" +"option:`--host` option to ``configure``. By default, when compiled for iOS, " +"Python will be compiled with a minimum supported iOS version of 13.0. To use " +"a different minimum iOS version, provide the version number as part of the :" +"option:`!--host` argument - for example, ``--host=arm64-apple-ios15.4-" +"simulator`` would compile an ARM64 simulator build with a deployment target " +"of 15.4." msgstr "" #: ../../using/ios.rst:48 @@ -147,8 +147,8 @@ msgid "" "``sys.path``. To ensure compliance with App Store policies, an iOS project " "must post-process any Python packages, converting ``.so`` binary modules " "into individual standalone frameworks with appropriate metadata and signing. " -"For details on how to perform this post-processing, see the guide " -"for :ref:`adding Python to your project `." +"For details on how to perform this post-processing, see the guide for :ref:" +"`adding Python to your project `." msgstr "" #: ../../using/ios.rst:90 @@ -165,27 +165,26 @@ msgstr "" msgid "" "For example, consider the case of an import ``from foo.bar import _whiz``, " "where ``_whiz`` is implemented with the binary module ``sources/foo/bar/" -"_whiz.abi3.so``, with ``sources`` being the location registered on " -"``sys.path``, relative to the application bundle. This module *must* be " +"_whiz.abi3.so``, with ``sources`` being the location registered on ``sys." +"path``, relative to the application bundle. This module *must* be " "distributed as ``Frameworks/foo.bar._whiz.framework/foo.bar._whiz`` " "(creating the framework name from the full import path of the module), with " "an ``Info.plist`` file in the ``.framework`` directory identifying the " "binary as a framework. The ``foo.bar._whiz`` module would be represented in " "the original location with a ``sources/foo/bar/_whiz.abi3.fwork`` marker " "file, containing the path ``Frameworks/foo.bar._whiz/foo.bar._whiz``. The " -"framework would also contain ``Frameworks/foo.bar._whiz.framework/" -"foo.bar._whiz.origin``, containing the path to the ``.fwork`` file." +"framework would also contain ``Frameworks/foo.bar._whiz.framework/foo.bar." +"_whiz.origin``, containing the path to the ``.fwork`` file." msgstr "" #: ../../using/ios.rst:110 msgid "" -"When running on iOS, the Python interpreter will install " -"an :class:`~importlib.machinery.AppleFrameworkLoader` that is able to read " -"and import ``.fwork`` files. Once imported, the ``__file__`` attribute of " -"the binary module will report as the location of the ``.fwork`` file. " -"However, the :class:`~importlib.machinery.ModuleSpec` for the loaded module " -"will report the ``origin`` as the location of the binary in the framework " -"folder." +"When running on iOS, the Python interpreter will install an :class:" +"`~importlib.machinery.AppleFrameworkLoader` that is able to read and import " +"``.fwork`` files. Once imported, the ``__file__`` attribute of the binary " +"module will report as the location of the ``.fwork`` file. However, the :" +"class:`~importlib.machinery.ModuleSpec` for the loaded module will report " +"the ``origin`` as the location of the binary in the framework folder." msgstr "" #: ../../using/ios.rst:118 @@ -271,11 +270,11 @@ msgstr "" #: ../../using/ios.rst:172 msgid "" -"Build or obtain a Python ``XCFramework``. See the instructions " -"in :source:`iOS/README.rst` (in the CPython source distribution) for details " -"on how to build a Python ``XCFramework``. At a minimum, you will need a " -"build that supports ``arm64-apple-ios``, plus one of either ``arm64-apple-" -"ios-simulator`` or ``x86_64-apple-ios-simulator``." +"Build or obtain a Python ``XCFramework``. See the instructions in :source:" +"`Apple/iOS/README.md` (in the CPython source distribution) for details on " +"how to build a Python ``XCFramework``. At a minimum, you will need a build " +"that supports ``arm64-apple-ios``, plus one of either ``arm64-apple-ios-" +"simulator`` or ``x86_64-apple-ios-simulator``." msgstr "" #: ../../using/ios.rst:178 @@ -288,12 +287,6 @@ msgstr "" #: ../../using/ios.rst:183 msgid "" -"Drag the ``iOS/Resources/dylib-Info-template.plist`` file into your project, " -"and ensure it is associated with the app target." -msgstr "" - -#: ../../using/ios.rst:186 -msgid "" "Add your application code as a folder in your Xcode project. In the " "following instructions, we'll assume that your user code is in a folder " "named ``app`` in the root of your project; you can use any other location by " @@ -301,335 +294,243 @@ msgid "" "app target." msgstr "" -#: ../../using/ios.rst:192 +#: ../../using/ios.rst:189 msgid "" "Select the app target by selecting the root node of your Xcode project, then " "the target name in the sidebar that appears." msgstr "" -#: ../../using/ios.rst:195 +#: ../../using/ios.rst:192 msgid "" "In the \"General\" settings, under \"Frameworks, Libraries and Embedded " "Content\", add ``Python.xcframework``, with \"Embed & Sign\" selected." msgstr "" -#: ../../using/ios.rst:198 +#: ../../using/ios.rst:195 msgid "In the \"Build Settings\" tab, modify the following:" msgstr "" -#: ../../using/ios.rst:200 +#: ../../using/ios.rst:197 msgid "Build Options" msgstr "建置選項" -#: ../../using/ios.rst:202 +#: ../../using/ios.rst:199 msgid "User Script Sandboxing: No" msgstr "" -#: ../../using/ios.rst:203 +#: ../../using/ios.rst:200 msgid "Enable Testability: Yes" msgstr "" -#: ../../using/ios.rst:205 +#: ../../using/ios.rst:202 msgid "Search Paths" msgstr "" -#: ../../using/ios.rst:207 +#: ../../using/ios.rst:204 msgid "Framework Search Paths: ``$(PROJECT_DIR)``" msgstr "" -#: ../../using/ios.rst:208 +#: ../../using/ios.rst:205 msgid "" "Header Search Paths: ``\"$(BUILT_PRODUCTS_DIR)/Python.framework/Headers\"``" msgstr "" -#: ../../using/ios.rst:210 +#: ../../using/ios.rst:207 msgid "Apple Clang - Warnings - All languages" msgstr "" -#: ../../using/ios.rst:212 +#: ../../using/ios.rst:209 msgid "Quoted Include In Framework Header: No" msgstr "" -#: ../../using/ios.rst:214 +#: ../../using/ios.rst:211 msgid "" -"Add a build step that copies the Python standard library into your app. In " -"the \"Build Phases\" tab, add a new \"Run Script\" build step *before* the " -"\"Embed Frameworks\" step, but *after* the \"Copy Bundle Resources\" step. " -"Name the step \"Install Target Specific Python Standard Library\", disable " -"the \"Based on dependency analysis\" checkbox, and set the script content to:" +"Add a build step that processes the Python standard library, and your own " +"Python binary dependencies. In the \"Build Phases\" tab, add a new \"Run " +"Script\" build step *before* the \"Embed Frameworks\" step, but *after* the " +"\"Copy Bundle Resources\" step. Name the step \"Process Python libraries\", " +"disable the \"Based on dependency analysis\" checkbox, and set the script " +"content to:" msgstr "" -#: ../../using/ios.rst:220 +#: ../../using/ios.rst:218 msgid "" "set -e\n" -"\n" -"mkdir -p \"$CODESIGNING_FOLDER_PATH/python/lib\"\n" -"if [ \"$EFFECTIVE_PLATFORM_NAME\" = \"-iphonesimulator\" ]; then\n" -" echo \"Installing Python modules for iOS Simulator\"\n" -" rsync -au --delete \"$PROJECT_DIR/Python.xcframework/ios-arm64_x86_64-" -"simulator/lib/\" \"$CODESIGNING_FOLDER_PATH/python/lib/\"\n" -"else\n" -" echo \"Installing Python modules for iOS Device\"\n" -" rsync -au --delete \"$PROJECT_DIR/Python.xcframework/ios-arm64/lib/\" " -"\"$CODESIGNING_FOLDER_PATH/python/lib/\"\n" -"fi" +"source $PROJECT_DIR/Python.xcframework/build/build_utils.sh\n" +"install_python Python.xcframework app" msgstr "" -"set -e\n" -"\n" -"mkdir -p \"$CODESIGNING_FOLDER_PATH/python/lib\"\n" -"if [ \"$EFFECTIVE_PLATFORM_NAME\" = \"-iphonesimulator\" ]; then\n" -" echo \"Installing Python modules for iOS Simulator\"\n" -" rsync -au --delete \"$PROJECT_DIR/Python.xcframework/ios-arm64_x86_64-" -"simulator/lib/\" \"$CODESIGNING_FOLDER_PATH/python/lib/\"\n" -"else\n" -" echo \"Installing Python modules for iOS Device\"\n" -" rsync -au --delete \"$PROJECT_DIR/Python.xcframework/ios-arm64/lib/\" " -"\"$CODESIGNING_FOLDER_PATH/python/lib/\"\n" -"fi" -#: ../../using/ios.rst:233 +#: ../../using/ios.rst:224 msgid "" -"Note that the name of the simulator \"slice\" in the XCframework may be " -"different, depending the CPU architectures your ``XCFramework`` supports." +"If you have placed your XCframework somewhere other than the root of your " +"project, modify the path to the first argument." msgstr "" -#: ../../using/ios.rst:236 -msgid "" -"Add a second build step that processes the binary extension modules in the " -"standard library into \"Framework\" format. Add a \"Run Script\" build step " -"*directly after* the one you added in step 8, named \"Prepare Python Binary " -"Modules\". It should also have \"Based on dependency analysis\" unchecked, " -"with the following script content:" -msgstr "" - -#: ../../using/ios.rst:242 -msgid "" -"set -e\n" -"\n" -"install_dylib () {\n" -" INSTALL_BASE=$1\n" -" FULL_EXT=$2\n" -"\n" -" # The name of the extension file\n" -" EXT=$(basename \"$FULL_EXT\")\n" -" # The location of the extension file, relative to the bundle\n" -" RELATIVE_EXT=${FULL_EXT#$CODESIGNING_FOLDER_PATH/}\n" -" # The path to the extension file, relative to the install base\n" -" PYTHON_EXT=${RELATIVE_EXT/$INSTALL_BASE/}\n" -" # The full dotted name of the extension module, constructed from the " -"file path.\n" -" FULL_MODULE_NAME=$(echo $PYTHON_EXT | cut -d \".\" -f 1 | tr \"/\" \"." -"\");\n" -" # A bundle identifier; not actually used, but required by Xcode " -"framework packaging\n" -" FRAMEWORK_BUNDLE_ID=$(echo $PRODUCT_BUNDLE_IDENTIFIER.$FULL_MODULE_NAME " -"| tr \"_\" \"-\")\n" -" # The name of the framework folder.\n" -" FRAMEWORK_FOLDER=\"Frameworks/$FULL_MODULE_NAME.framework\"\n" -"\n" -" # If the framework folder doesn't exist, create it.\n" -" if [ ! -d \"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER\" ]; then\n" -" echo \"Creating framework for $RELATIVE_EXT\"\n" -" mkdir -p \"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER\"\n" -" cp \"$CODESIGNING_FOLDER_PATH/dylib-Info-template.plist\" " -"\"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/Info.plist\"\n" -" plutil -replace CFBundleExecutable -string \"$FULL_MODULE_NAME\" " -"\"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/Info.plist\"\n" -" plutil -replace CFBundleIdentifier -string \"$FRAMEWORK_BUNDLE_ID\" " -"\"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/Info.plist\"\n" -" fi\n" -"\n" -" echo \"Installing binary for $FRAMEWORK_FOLDER/$FULL_MODULE_NAME\"\n" -" mv \"$FULL_EXT\" \"$CODESIGNING_FOLDER_PATH/$FRAMEWORK_FOLDER/" -"$FULL_MODULE_NAME\"\n" -" # Create a placeholder .fwork file where the .so was\n" -" echo \"$FRAMEWORK_FOLDER/$FULL_MODULE_NAME\" > ${FULL_EXT%.so}.fwork\n" -" # Create a back reference to the .so file location in the framework\n" -" echo \"${RELATIVE_EXT%.so}.fwork\" > \"$CODESIGNING_FOLDER_PATH/" -"$FRAMEWORK_FOLDER/$FULL_MODULE_NAME.origin\"\n" -" }\n" -"\n" -" PYTHON_VER=$(ls -1 \"$CODESIGNING_FOLDER_PATH/python/lib\")\n" -" echo \"Install Python $PYTHON_VER standard library extension modules...\"\n" -" find \"$CODESIGNING_FOLDER_PATH/python/lib/$PYTHON_VER/lib-dynload\" -name " -"\"*.so\" | while read FULL_EXT; do\n" -" install_dylib python/lib/$PYTHON_VER/lib-dynload/ \"$FULL_EXT\"\n" -" done\n" -"\n" -" # Clean up dylib template\n" -" rm -f \"$CODESIGNING_FOLDER_PATH/dylib-Info-template.plist\"\n" -"\n" -" echo \"Signing frameworks as $EXPANDED_CODE_SIGN_IDENTITY_NAME " -"($EXPANDED_CODE_SIGN_IDENTITY)...\"\n" -" find \"$CODESIGNING_FOLDER_PATH/Frameworks\" -name \"*.framework\" -exec /" -"usr/bin/codesign --force --sign \"$EXPANDED_CODE_SIGN_IDENTITY\" $" -"{OTHER_CODE_SIGN_FLAGS:-} -o runtime --timestamp=none --preserve-" -"metadata=identifier,entitlements,flags --generate-entitlement-der \"{}\" \\;" -msgstr "" - -#: ../../using/ios.rst:292 +#: ../../using/ios.rst:227 msgid "" "Add Objective C code to initialize and use a Python interpreter in embedded " "mode. You should ensure that:" msgstr "" -#: ../../using/ios.rst:295 +#: ../../using/ios.rst:230 msgid "UTF-8 mode (:c:member:`PyPreConfig.utf8_mode`) is *enabled*;" msgstr "" -#: ../../using/ios.rst:296 +#: ../../using/ios.rst:231 msgid "Buffered stdio (:c:member:`PyConfig.buffered_stdio`) is *disabled*;" msgstr "" -#: ../../using/ios.rst:297 +#: ../../using/ios.rst:232 msgid "Writing bytecode (:c:member:`PyConfig.write_bytecode`) is *disabled*;" msgstr "" -#: ../../using/ios.rst:298 +#: ../../using/ios.rst:233 msgid "" "Signal handlers (:c:member:`PyConfig.install_signal_handlers`) are *enabled*;" msgstr "" -#: ../../using/ios.rst:299 +#: ../../using/ios.rst:234 msgid "" "System logging (:c:member:`PyConfig.use_system_logger`) is *enabled* " "(optional, but strongly recommended; this is enabled by default);" msgstr "" -#: ../../using/ios.rst:301 +#: ../../using/ios.rst:236 msgid "" ":envvar:`PYTHONHOME` for the interpreter is configured to point at the " "``python`` subfolder of your app's bundle; and" msgstr "" -#: ../../using/ios.rst:303 +#: ../../using/ios.rst:238 msgid "The :envvar:`PYTHONPATH` for the interpreter includes:" msgstr "" -#: ../../using/ios.rst:305 +#: ../../using/ios.rst:240 msgid "the ``python/lib/python3.X`` subfolder of your app's bundle," msgstr "" -#: ../../using/ios.rst:306 +#: ../../using/ios.rst:241 msgid "" "the ``python/lib/python3.X/lib-dynload`` subfolder of your app's bundle, and" msgstr "" -#: ../../using/ios.rst:307 +#: ../../using/ios.rst:242 msgid "the ``app`` subfolder of your app's bundle" msgstr "" -#: ../../using/ios.rst:309 +#: ../../using/ios.rst:244 msgid "" "Your app's bundle location can be determined using ``[[NSBundle mainBundle] " "resourcePath]``." msgstr "" -#: ../../using/ios.rst:312 +#: ../../using/ios.rst:247 msgid "" -"Steps 8, 9 and 10 of these instructions assume that you have a single folder " -"of pure Python application code, named ``app``. If you have third-party " -"binary modules in your app, some additional steps will be required:" +"Steps 7 and 8 of these instructions assume that you have a single folder of " +"pure Python application code, named ``app``. If you have third-party binary " +"modules in your app, some additional steps will be required:" msgstr "" -#: ../../using/ios.rst:316 +#: ../../using/ios.rst:251 msgid "" "You need to ensure that any folders containing third-party binaries are " -"either associated with the app target, or copied in as part of step 8. Step " -"8 should also purge any binaries that are not appropriate for the platform a " -"specific build is targeting (i.e., delete any device binaries if you're " -"building an app targeting the simulator)." -msgstr "" - -#: ../../using/ios.rst:322 -msgid "" -"Any folders that contain third-party binaries must be processed into " -"framework form by step 9. The invocation of ``install_dylib`` that processes " -"the ``lib-dynload`` folder can be copied and adapted for this purpose." +"either associated with the app target, or are explicitly copied as part of " +"step 7. Step 7 should also purge any binaries that are not appropriate for " +"the platform a specific build is targeting (i.e., delete any device binaries " +"if you're building an app targeting the simulator)." msgstr "" -#: ../../using/ios.rst:326 +#: ../../using/ios.rst:257 msgid "" "If you're using a separate folder for third-party packages, ensure that " -"folder is included as part of the :envvar:`PYTHONPATH` configuration in step " -"10." +"folder is added to the end of the call to ``install_python`` in step 7, and " +"as part of the :envvar:`PYTHONPATH` configuration in step 8." msgstr "" -#: ../../using/ios.rst:329 +#: ../../using/ios.rst:261 msgid "" -"If any of the folders that contain third-party packages will contain " -"``.pth`` files, you should add that folder as a *site directory* " -"(using :meth:`site.addsitedir`), rather than adding to :envvar:`PYTHONPATH` " -"or :attr:`sys.path` directly." +"If any of the folders that contain third-party packages will contain ``." +"pth`` files, you should add that folder as a *site directory* (using :meth:" +"`site.addsitedir`), rather than adding to :envvar:`PYTHONPATH` or :attr:`sys." +"path` directly." msgstr "" -#: ../../using/ios.rst:335 +#: ../../using/ios.rst:267 msgid "Testing a Python package" msgstr "" -#: ../../using/ios.rst:337 +#: ../../using/ios.rst:269 msgid "" -"The CPython source tree contains :source:`a testbed project ` " -"that is used to run the CPython test suite on the iOS simulator. This " -"testbed can also be used as a testbed project for running your Python " +"The CPython source tree contains :source:`a testbed project ` that is used to run the CPython test suite on the iOS simulator. " +"This testbed can also be used as a testbed project for running your Python " "library's test suite on iOS." msgstr "" -#: ../../using/ios.rst:341 +#: ../../using/ios.rst:273 msgid "" -"After building or obtaining an iOS XCFramework (See :source:`iOS/README.rst` " -"for details), create a clone of the Python iOS testbed project by running:" +"After building or obtaining an iOS XCFramework (see :source:`Apple/iOS/" +"README.md` for details), create a clone of the Python iOS testbed project. " +"If you used the ``Apple`` build script to build the XCframework, you can run:" msgstr "" -#: ../../using/ios.rst:344 +#: ../../using/ios.rst:277 msgid "" -"$ python iOS/testbed clone --framework --app " -" --app app-testbed" +"$ python cross-build/iOS/testbed clone --app --app app-testbed" msgstr "" -#: ../../using/ios.rst:348 +#: ../../using/ios.rst:281 +msgid "Or, if you've sourced your own XCframework, by running:" +msgstr "" + +#: ../../using/ios.rst:283 +msgid "" +"$ python Apple/testbed clone --platform iOS --framework --app --app app-testbed" +msgstr "" + +#: ../../using/ios.rst:287 msgid "" -"You will need to modify the ``iOS/testbed`` reference to point to that " -"directory in the CPython source tree; any folders specified with the ``--" -"app`` flag will be copied into the cloned testbed project. The resulting " -"testbed will be created in the ``app-testbed`` folder. In this example, the " -"``module1`` and ``module2`` would be importable modules at runtime. If your " -"project has additional dependencies, they can be installed into the ``app-" -"testbed/iOSTestbed/app_packages`` folder (using ``pip install --target app-" -"testbed/iOSTestbed/app_packages`` or similar)." +"Any folders specified with the ``--app`` flag will be copied into the cloned " +"testbed project. The resulting testbed will be created in the ``app-" +"testbed`` folder. In this example, the ``module1`` and ``module2`` would be " +"importable modules at runtime. If your project has additional dependencies, " +"they can be installed into the ``app-testbed/Testbed/app_packages`` folder " +"(using ``pip install --target app-testbed/Testbed/app_packages`` or similar)." msgstr "" -#: ../../using/ios.rst:357 +#: ../../using/ios.rst:294 msgid "" "You can then use the ``app-testbed`` folder to run the test suite for your " "app, For example, if ``module1.tests`` was the entry point to your test " "suite, you could run:" msgstr "" -#: ../../using/ios.rst:361 +#: ../../using/ios.rst:298 msgid "$ python app-testbed run -- module1.tests" msgstr "" -#: ../../using/ios.rst:365 +#: ../../using/ios.rst:302 msgid "" "This is the equivalent of running ``python -m module1.tests`` on a desktop " "Python build. Any arguments after the ``--`` will be passed to the testbed " "as if they were arguments to ``python -m`` on a desktop machine." msgstr "" -#: ../../using/ios.rst:369 +#: ../../using/ios.rst:306 msgid "You can also open the testbed project in Xcode by running:" msgstr "" -#: ../../using/ios.rst:371 +#: ../../using/ios.rst:308 msgid "$ open app-testbed/iOSTestbed.xcodeproj" msgstr "" -#: ../../using/ios.rst:375 +#: ../../using/ios.rst:312 msgid "This will allow you to use the full Xcode suite of tools for debugging." msgstr "" -#: ../../using/ios.rst:377 +#: ../../using/ios.rst:314 msgid "" "The arguments used to run the test suite are defined as part of the test " "plan. To modify the test plan, select the test plan node of the project tree " @@ -638,28 +539,33 @@ msgid "" "change the testing arguments." msgstr "" -#: ../../using/ios.rst:383 +#: ../../using/ios.rst:320 msgid "" "The test plan also disables parallel testing, and specifies the use of the " -"``iOSTestbed.lldbinit`` file for providing configuration of the debugger. " -"The default debugger configuration disables automatic breakpoints on the " +"``Testbed.lldbinit`` file for providing configuration of the debugger. The " +"default debugger configuration disables automatic breakpoints on the " "``SIGINT``, ``SIGUSR1``, ``SIGUSR2``, and ``SIGXFSZ`` signals." msgstr "" -#: ../../using/ios.rst:389 +#: ../../using/ios.rst:326 msgid "App Store Compliance" msgstr "" -#: ../../using/ios.rst:391 +#: ../../using/ios.rst:328 msgid "" "The only mechanism for distributing apps to third-party iOS devices is to " "submit the app to the iOS App Store; apps submitted for distribution must " "pass Apple's app review process. This process includes a set of automated " "validation rules that inspect the submitted application bundle for " -"problematic code." +"problematic code. There are some steps that must be taken to ensure that " +"your app will be able to pass these validation steps." msgstr "" -#: ../../using/ios.rst:396 +#: ../../using/ios.rst:336 +msgid "Incompatible code in the standard library" +msgstr "" + +#: ../../using/ios.rst:338 msgid "" "The Python standard library contains some code that is known to violate " "these automated rules. While these violations appear to be false positives, " @@ -667,10 +573,60 @@ msgid "" "Python standard library for an app to pass App Store review." msgstr "" -#: ../../using/ios.rst:401 +#: ../../using/ios.rst:343 msgid "" "The Python source tree contains :source:`a patch file ` that will remove all code that is known to cause " "issues with the App Store review process. This patch is applied " "automatically when building for iOS." msgstr "" + +#: ../../using/ios.rst:349 +msgid "Privacy manifests" +msgstr "" + +#: ../../using/ios.rst:351 +msgid "" +"In April 2025, Apple introduced a requirement for `certain third-party " +"libraries to provide a Privacy Manifest `__. As a result, if you have a binary module " +"that uses one of the affected libraries, you must provide an ``.xcprivacy`` " +"file for that library. OpenSSL is one library affected by this requirement, " +"but there are others." +msgstr "" + +#: ../../using/ios.rst:358 +msgid "" +"If you produce a binary module named ``mymodule.so``, and use you the Xcode " +"build script described in step 7 above, you can place a ``mymodule." +"xcprivacy`` file next to ``mymodule.so``, and the privacy manifest will be " +"installed into the required location when the binary module is converted " +"into a framework." +msgstr "" + +#~ msgid "" +#~ "set -e\n" +#~ "\n" +#~ "mkdir -p \"$CODESIGNING_FOLDER_PATH/python/lib\"\n" +#~ "if [ \"$EFFECTIVE_PLATFORM_NAME\" = \"-iphonesimulator\" ]; then\n" +#~ " echo \"Installing Python modules for iOS Simulator\"\n" +#~ " rsync -au --delete \"$PROJECT_DIR/Python.xcframework/ios-arm64_x86_64-" +#~ "simulator/lib/\" \"$CODESIGNING_FOLDER_PATH/python/lib/\"\n" +#~ "else\n" +#~ " echo \"Installing Python modules for iOS Device\"\n" +#~ " rsync -au --delete \"$PROJECT_DIR/Python.xcframework/ios-arm64/lib/\" " +#~ "\"$CODESIGNING_FOLDER_PATH/python/lib/\"\n" +#~ "fi" +#~ msgstr "" +#~ "set -e\n" +#~ "\n" +#~ "mkdir -p \"$CODESIGNING_FOLDER_PATH/python/lib\"\n" +#~ "if [ \"$EFFECTIVE_PLATFORM_NAME\" = \"-iphonesimulator\" ]; then\n" +#~ " echo \"Installing Python modules for iOS Simulator\"\n" +#~ " rsync -au --delete \"$PROJECT_DIR/Python.xcframework/ios-arm64_x86_64-" +#~ "simulator/lib/\" \"$CODESIGNING_FOLDER_PATH/python/lib/\"\n" +#~ "else\n" +#~ " echo \"Installing Python modules for iOS Device\"\n" +#~ " rsync -au --delete \"$PROJECT_DIR/Python.xcframework/ios-arm64/lib/\" " +#~ "\"$CODESIGNING_FOLDER_PATH/python/lib/\"\n" +#~ "fi" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index f516682068..02b05a5634 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-09 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,9 +44,8 @@ msgid "" "incorporates new features and syntax from 3.0 while remaining compatible " "with existing code by not removing older features or syntax. When it's not " "possible to do that, Python 2.6 tries to do what it can, adding " -"compatibility functions in a :mod:`future_builtins` module and " -"a :option:`!-3` switch to warn about usages that will become unsupported in " -"3.0." +"compatibility functions in a :mod:`!future_builtins` module and a :option:" +"`!-3` switch to warn about usages that will become unsupported in 3.0." msgstr "" #: ../../whatsnew/2.6.rst:62 @@ -107,8 +106,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:106 msgid "" -"The addition of :func:`functools.reduce` as a synonym for the built-" -"in :func:`reduce` function." +"The addition of :func:`functools.reduce` as a synonym for the built-in :func:" +"`reduce` function." msgstr "" #: ../../whatsnew/2.6.rst:109 @@ -116,7 +115,7 @@ msgid "" "Python 3.0 adds several new built-in functions and changes the semantics of " "some existing builtins. Functions that are new in 3.0 such as :func:`bin` " "have simply been added to Python 2.6, but existing builtins haven't been " -"changed; instead, the :mod:`future_builtins` module has versions with the " +"changed; instead, the :mod:`!future_builtins` module has versions with the " "new 3.0 semantics. Code written to be compatible with 3.0 can do ``from " "future_builtins import hex, map`` as necessary." msgstr "" @@ -126,17 +125,16 @@ msgid "" "A new command-line switch, :option:`!-3`, enables warnings about features " "that will be removed in Python 3.0. You can run code with this switch to " "see how much work will be necessary to port code to 3.0. The value of this " -"switch is available to Python code as the boolean " -"variable :data:`sys.py3kwarning`, and to C extension code as :c:data:`!" -"Py_Py3kWarningFlag`." +"switch is available to Python code as the boolean variable :data:`!sys." +"py3kwarning`, and to C extension code as :c:data:`!Py_Py3kWarningFlag`." msgstr "" #: ../../whatsnew/2.6.rst:126 msgid "" -"The 3\\ *xxx* series of PEPs, which contains proposals for Python " -"3.0. :pep:`3000` describes the development process for Python 3.0. Start " -"with :pep:`3100` that describes the general goals for Python 3.0, and then " -"explore the higher-numbered PEPs that propose specific features." +"The 3\\ *xxx* series of PEPs, which contains proposals for Python 3.0. :pep:" +"`3000` describes the development process for Python 3.0. Start with :pep:" +"`3100` that describes the general goals for Python 3.0, and then explore the " +"higher-numbered PEPs that propose specific features." msgstr "" #: ../../whatsnew/2.6.rst:134 @@ -169,8 +167,8 @@ msgid "" "posted a call for issue trackers, asking volunteers to set up different " "products and import some of the bugs and patches from SourceForge. Four " "different trackers were examined: `Jira `__, `Launchpad `__, `Roundup `__, and `Trac `__. The " +"jira/>`__, `Launchpad `__, `Roundup `__, and `Trac `__. The " "committee eventually settled on Jira and Roundup as the two candidates. " "Jira is a commercial product that offers no-cost hosted instances to free-" "software projects; Roundup is an open-source project that requires " @@ -192,8 +190,8 @@ msgid "" "Hosting of the Python bug tracker is kindly provided by `Upfront Systems " "`__ of Stellenbosch, South Africa. Martin " "von Löwis put a lot of effort into importing existing bugs and patches from " -"SourceForge; his scripts for this import operation are at ``https://" -"svn.python.org/view/tracker/importer/`` and may be useful to other projects " +"SourceForge; his scripts for this import operation are at ``https://svn." +"python.org/view/tracker/importer/`` and may be useful to other projects " "wishing to move from SourceForge to Roundup." msgstr "" @@ -273,9 +271,9 @@ msgstr "" #: ../../whatsnew/2.6.rst:226 msgid "" "Sphinx is a standalone package that can be used for writing, and almost two " -"dozen other projects (`listed on the Sphinx web site `__) have adopted Sphinx as their " -"documentation tool." +"dozen other projects (`listed on the Sphinx web site `__) have adopted Sphinx as their documentation " +"tool." msgstr "" #: ../../whatsnew/2.6.rst:233 @@ -343,8 +341,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:269 msgid "" "The expression is evaluated, and it should result in an object that supports " -"the context management protocol (that is, has :meth:`~object.__enter__` " -"and :meth:`~object.__exit__` methods)." +"the context management protocol (that is, has :meth:`~object.__enter__` and :" +"meth:`~object.__exit__` methods)." msgstr "" #: ../../whatsnew/2.6.rst:273 @@ -357,9 +355,9 @@ msgstr "" #: ../../whatsnew/2.6.rst:278 msgid "" -"After execution of the *with-block* is finished, the " -"object's :meth:`~object.__exit__` method is called, even if the block raised " -"an exception, and can therefore run clean-up code." +"After execution of the *with-block* is finished, the object's :meth:`~object." +"__exit__` method is called, even if the block raised an exception, and can " +"therefore run clean-up code." msgstr "" #: ../../whatsnew/2.6.rst:282 @@ -390,8 +388,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:296 msgid "" -"In this case, *f* is the same object created by :func:`open`, " -"because :meth:`~object.__enter__` returns *self*." +"In this case, *f* is the same object created by :func:`open`, because :meth:" +"`~object.__enter__` returns *self*." msgstr "" #: ../../whatsnew/2.6.rst:299 @@ -416,9 +414,10 @@ msgstr "" #: ../../whatsnew/2.6.rst:310 msgid "" -"The :func:`localcontext` function in the :mod:`decimal` module makes it easy " -"to save and restore the current decimal context, which encapsulates the " -"desired precision and rounding characteristics for computations::" +"The :func:`~decimal.localcontext` function in the :mod:`decimal` module " +"makes it easy to save and restore the current decimal context, which " +"encapsulates the desired precision and rounding characteristics for " +"computations::" msgstr "" #: ../../whatsnew/2.6.rst:314 @@ -455,8 +454,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:339 msgid "" "The expression is evaluated and should result in an object called a " -"\"context manager\". The context manager must " -"have :meth:`~object.__enter__` and :meth:`~object.__exit__` methods." +"\"context manager\". The context manager must have :meth:`~object." +"__enter__` and :meth:`~object.__exit__` methods." msgstr "" #: ../../whatsnew/2.6.rst:343 @@ -472,15 +471,15 @@ msgstr "*BLOCK* 中的程式碼會被執行。" #: ../../whatsnew/2.6.rst:349 msgid "" -"If *BLOCK* raises an exception, the context " -"manager's :meth:`~object.__exit__` method is called with three arguments, " -"the exception details (``type, value, traceback``, the same values returned " -"by :func:`sys.exc_info`, which can also be ``None`` if no exception " -"occurred). The method's return value controls whether an exception is re-" -"raised: any false value re-raises the exception, and ``True`` will result in " -"suppressing it. You'll only rarely want to suppress the exception, because " -"if you do the author of the code containing the ':keyword:`with`' statement " -"will never realize anything went wrong." +"If *BLOCK* raises an exception, the context manager's :meth:`~object." +"__exit__` method is called with three arguments, the exception details " +"(``type, value, traceback``, the same values returned by :func:`sys." +"exc_info`, which can also be ``None`` if no exception occurred). The " +"method's return value controls whether an exception is re-raised: any false " +"value re-raises the exception, and ``True`` will result in suppressing it. " +"You'll only rarely want to suppress the exception, because if you do the " +"author of the code containing the ':keyword:`with`' statement will never " +"realize anything went wrong." msgstr "" #: ../../whatsnew/2.6.rst:358 @@ -527,8 +526,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:379 msgid "" "The transaction should be committed if the code in the block runs flawlessly " -"or rolled back if there's an exception. Here's the basic interface " -"for :class:`DatabaseConnection` that I'll assume::" +"or rolled back if there's an exception. Here's the basic interface for :" +"class:`!DatabaseConnection` that I'll assume::" msgstr "" #: ../../whatsnew/2.6.rst:383 @@ -604,24 +603,24 @@ msgstr "" #: ../../whatsnew/2.6.rst:434 msgid "" -"The decorator is called :func:`contextmanager`, and lets you write a single " -"generator function instead of defining a new class. The generator should " -"yield exactly one value. The code up to the :keyword:`yield` will be " -"executed as the :meth:`~object.__enter__` method, and the value yielded will " -"be the method's return value that will get bound to the variable in the " -"':keyword:`with`' statement's :keyword:`!as` clause, if any. The code after " -"the :keyword:`!yield` will be executed in the :meth:`~object.__exit__` " -"method. Any exception raised in the block will be raised by the :keyword:`!" -"yield` statement." +"The decorator is called :func:`~contextlib.contextmanager`, and lets you " +"write a single generator function instead of defining a new class. The " +"generator should yield exactly one value. The code up to the :keyword:" +"`yield` will be executed as the :meth:`~object.__enter__` method, and the " +"value yielded will be the method's return value that will get bound to the " +"variable in the ':keyword:`with`' statement's :keyword:`!as` clause, if " +"any. The code after the :keyword:`!yield` will be executed in the :meth:" +"`~object.__exit__` method. Any exception raised in the block will be raised " +"by the :keyword:`!yield` statement." msgstr "" -#: ../../whatsnew/2.6.rst:443 +#: ../../whatsnew/2.6.rst:444 msgid "" "Using this decorator, our database example from the previous section could " "be written as::" msgstr "" -#: ../../whatsnew/2.6.rst:446 +#: ../../whatsnew/2.6.rst:447 msgid "" "from contextlib import contextmanager\n" "\n" @@ -657,7 +656,7 @@ msgstr "" "with db_transaction(db) as cursor:\n" " ..." -#: ../../whatsnew/2.6.rst:463 +#: ../../whatsnew/2.6.rst:464 msgid "" "The :mod:`contextlib` module also has a ``nested(mgr1, mgr2, ...)`` function " "that combines a number of context managers so you don't need to write nested " @@ -666,7 +665,7 @@ msgid "" "lock::" msgstr "" -#: ../../whatsnew/2.6.rst:468 +#: ../../whatsnew/2.6.rst:469 msgid "" "lock = threading.Lock()\n" "with nested (db_transaction(db), lock) as (cursor, locked):\n" @@ -676,14 +675,14 @@ msgstr "" "with nested (db_transaction(db), lock) as (cursor, locked):\n" " ..." -#: ../../whatsnew/2.6.rst:472 +#: ../../whatsnew/2.6.rst:473 msgid "" -"Finally, the :func:`closing` function returns its argument so that it can be " -"bound to a variable, and calls the argument's ``.close()`` method at the end " -"of the block. ::" +"Finally, the :func:`~contextlib.closing` function returns its argument so " +"that it can be bound to a variable, and calls the argument's ``.close()`` " +"method at the end of the block. ::" msgstr "" -#: ../../whatsnew/2.6.rst:476 +#: ../../whatsnew/2.6.rst:477 msgid "" "import urllib, sys\n" "from contextlib import closing\n" @@ -699,11 +698,11 @@ msgstr "" " for line in f:\n" " sys.stdout.write(line)" -#: ../../whatsnew/2.6.rst:486 +#: ../../whatsnew/2.6.rst:487 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../whatsnew/2.6.rst:487 +#: ../../whatsnew/2.6.rst:488 msgid "" "PEP written by Guido van Rossum and Nick Coghlan; implemented by Mike Bland, " "Guido van Rossum, and Neal Norwitz. The PEP shows the code generated for a " @@ -711,29 +710,29 @@ msgid "" "statement works." msgstr "" -#: ../../whatsnew/2.6.rst:492 +#: ../../whatsnew/2.6.rst:493 msgid "The documentation for the :mod:`contextlib` module." msgstr ":mod:`contextlib` 模組的文件。" -#: ../../whatsnew/2.6.rst:499 +#: ../../whatsnew/2.6.rst:500 msgid "PEP 366: Explicit Relative Imports From a Main Module" msgstr "" -#: ../../whatsnew/2.6.rst:501 +#: ../../whatsnew/2.6.rst:502 msgid "" "Python's :option:`-m` switch allows running a module as a script. When you " "ran a module that was located inside a package, relative imports didn't work " "correctly." msgstr "" -#: ../../whatsnew/2.6.rst:505 +#: ../../whatsnew/2.6.rst:506 msgid "" "The fix for Python 2.6 adds a :attr:`module.__package__` attribute. When " "this attribute is present, relative imports will be relative to the value of " "this attribute instead of the :attr:`~module.__name__` attribute." msgstr "" -#: ../../whatsnew/2.6.rst:510 +#: ../../whatsnew/2.6.rst:511 msgid "" "PEP 302-style importers can then set :attr:`~module.__package__` as " "necessary. The :mod:`runpy` module that implements the :option:`-m` switch " @@ -741,11 +740,11 @@ msgid "" "running from inside a package." msgstr "" -#: ../../whatsnew/2.6.rst:520 +#: ../../whatsnew/2.6.rst:521 msgid "PEP 370: Per-user ``site-packages`` Directory" msgstr "" -#: ../../whatsnew/2.6.rst:522 +#: ../../whatsnew/2.6.rst:523 msgid "" "When you run Python, the module search path ``sys.path`` usually includes a " "directory whose path ends in ``\"site-packages\"``. This directory is " @@ -753,56 +752,56 @@ msgid "" "machine or a particular site installation." msgstr "" -#: ../../whatsnew/2.6.rst:527 +#: ../../whatsnew/2.6.rst:528 msgid "" "Python 2.6 introduces a convention for user-specific site directories. The " "directory varies depending on the platform:" msgstr "" -#: ../../whatsnew/2.6.rst:530 +#: ../../whatsnew/2.6.rst:531 msgid "Unix and Mac OS X: :file:`~/.local/`" msgstr "Unix 和 Mac OS X::file:`~/.local/`" -#: ../../whatsnew/2.6.rst:531 +#: ../../whatsnew/2.6.rst:532 msgid "Windows: :file:`%APPDATA%/Python`" msgstr "Windows::file:`%APPDATA%/Python`" -#: ../../whatsnew/2.6.rst:533 +#: ../../whatsnew/2.6.rst:534 msgid "" "Within this directory, there will be version-specific subdirectories, such " "as :file:`lib/python2.6/site-packages` on Unix/Mac OS and :file:`Python26/" "site-packages` on Windows." msgstr "" -#: ../../whatsnew/2.6.rst:537 +#: ../../whatsnew/2.6.rst:538 msgid "" "If you don't like the default directory, it can be overridden by an " "environment variable. :envvar:`PYTHONUSERBASE` sets the root directory used " "for all Python versions supporting this feature. On Windows, the directory " -"for application-specific data can be changed by setting " -"the :envvar:`APPDATA` environment variable. You can also modify " -"the :file:`site.py` file for your Python installation." +"for application-specific data can be changed by setting the :envvar:`!" +"APPDATA` environment variable. You can also modify the :file:`site.py` file " +"for your Python installation." msgstr "" -#: ../../whatsnew/2.6.rst:544 +#: ../../whatsnew/2.6.rst:545 msgid "" "The feature can be disabled entirely by running Python with the :option:`-s` " "option or setting the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" -#: ../../whatsnew/2.6.rst:550 +#: ../../whatsnew/2.6.rst:551 msgid ":pep:`370` - Per-user ``site-packages`` Directory" msgstr "" -#: ../../whatsnew/2.6.rst:551 +#: ../../whatsnew/2.6.rst:552 msgid "PEP written and implemented by Christian Heimes." msgstr "由 Christian Heimes 撰寫 PEP 與實作。" -#: ../../whatsnew/2.6.rst:559 +#: ../../whatsnew/2.6.rst:560 msgid "PEP 371: The ``multiprocessing`` Package" msgstr "" -#: ../../whatsnew/2.6.rst:561 +#: ../../whatsnew/2.6.rst:562 msgid "" "The new :mod:`multiprocessing` package lets Python programs create new " "processes that will perform a computation and return a result to the " @@ -811,27 +810,28 @@ msgid "" "share simple arrays of data." msgstr "" -#: ../../whatsnew/2.6.rst:567 +#: ../../whatsnew/2.6.rst:568 msgid "" -"The :mod:`multiprocessing` module started out as an exact emulation of " -"the :mod:`threading` module using processes instead of threads. That goal " -"was discarded along the path to Python 2.6, but the general approach of the " -"module is still similar. The fundamental class is the :class:`Process`, " -"which is passed a callable object and a collection of arguments. " -"The :meth:`start` method sets the callable running in a subprocess, after " -"which you can call the :meth:`is_alive` method to check whether the " -"subprocess is still running and the :meth:`join` method to wait for the " -"process to exit." +"The :mod:`multiprocessing` module started out as an exact emulation of the :" +"mod:`threading` module using processes instead of threads. That goal was " +"discarded along the path to Python 2.6, but the general approach of the " +"module is still similar. The fundamental class is the :class:" +"`~multiprocessing.Process`, which is passed a callable object and a " +"collection of arguments. The :meth:`~multiprocessing.Process.start` method " +"sets the callable running in a subprocess, after which you can call the :" +"meth:`~multiprocessing.Process.is_alive` method to check whether the " +"subprocess is still running and the :meth:`~multiprocessing.Process.join` " +"method to wait for the process to exit." msgstr "" -#: ../../whatsnew/2.6.rst:577 +#: ../../whatsnew/2.6.rst:579 msgid "" "Here's a simple example where the subprocess will calculate a factorial. " "The function doing the calculation is written strangely so that it takes " "significantly longer when the input argument is a multiple of 4." msgstr "" -#: ../../whatsnew/2.6.rst:584 +#: ../../whatsnew/2.6.rst:586 msgid "" "import time\n" "from multiprocessing import Process, Queue\n" @@ -893,7 +893,7 @@ msgstr "" " result = queue.get()\n" " print 'Factorial', N, '=', result" -#: ../../whatsnew/2.6.rst:614 +#: ../../whatsnew/2.6.rst:616 msgid "" "A :class:`~queue.Queue` is used to communicate the result of the factorial. " "The :class:`~queue.Queue` object is stored in a global variable. The child " @@ -903,18 +903,20 @@ msgid "" "variable, the child's value would be unaffected, and vice versa.)" msgstr "" -#: ../../whatsnew/2.6.rst:622 +#: ../../whatsnew/2.6.rst:624 msgid "" -"Two other classes, :class:`Pool` and :class:`Manager`, provide higher-level " -"interfaces. :class:`Pool` will create a fixed number of worker processes, " -"and requests can then be distributed to the workers by calling :meth:`apply` " -"or :meth:`apply_async` to add a single request, and :meth:`map` " -"or :meth:`map_async` to add a number of requests. The following code uses " -"a :class:`Pool` to spread requests across 5 worker processes and retrieve a " -"list of results::" +"Two other classes, :class:`~multiprocessing.pool.Pool` and :class:" +"`~multiprocessing.Manager`, provide higher-level interfaces. :class:" +"`~multiprocessing.pool.Pool` will create a fixed number of worker processes, " +"and requests can then be distributed to the workers by calling :meth:" +"`~multiprocessing.pool.Pool.apply` or :meth:`~multiprocessing.pool.Pool." +"apply_async` to add a single request, and :meth:`~multiprocessing.pool.Pool." +"map` or :meth:`~multiprocessing.pool.Pool.map_async` to add a number of " +"requests. The following code uses a :class:`~multiprocessing.pool.Pool` to " +"spread requests across 5 worker processes and retrieve a list of results::" msgstr "" -#: ../../whatsnew/2.6.rst:630 +#: ../../whatsnew/2.6.rst:635 msgid "" "from multiprocessing import Pool\n" "\n" @@ -936,11 +938,11 @@ msgstr "" "for v in result:\n" " print v" -#: ../../whatsnew/2.6.rst:640 +#: ../../whatsnew/2.6.rst:645 msgid "This produces the following output::" msgstr "" -#: ../../whatsnew/2.6.rst:642 +#: ../../whatsnew/2.6.rst:647 msgid "" "1\n" "39916800\n" @@ -956,20 +958,22 @@ msgstr "" "33452526613163807108170062053440751665152000000000\n" "..." -#: ../../whatsnew/2.6.rst:649 +#: ../../whatsnew/2.6.rst:654 msgid "" -"The other high-level interface, the :class:`Manager` class, creates a " -"separate server process that can hold master copies of Python data " +"The other high-level interface, the :class:`~multiprocessing.Manager` class, " +"creates a separate server process that can hold master copies of Python data " "structures. Other processes can then access and modify these data " "structures using proxy objects. The following example creates a shared " "dictionary by calling the :meth:`dict` method; the worker processes then " "insert values into the dictionary. (Locking is not done for you " -"automatically, which doesn't matter in this example. :class:`Manager`'s " -"methods also include :meth:`Lock`, :meth:`RLock`, and :meth:`Semaphore` to " +"automatically, which doesn't matter in this example. :class:" +"`~multiprocessing.Manager`'s methods also include :meth:`~multiprocessing." +"managers.SyncManager.Lock`, :meth:`~multiprocessing.managers.SyncManager." +"RLock`, and :meth:`~multiprocessing.managers.SyncManager.Semaphore` to " "create shared locks.)" msgstr "" -#: ../../whatsnew/2.6.rst:661 +#: ../../whatsnew/2.6.rst:669 msgid "" "import time\n" "from multiprocessing import Pool, Manager\n" @@ -1004,11 +1008,11 @@ msgid "" " print k, v" msgstr "" -#: ../../whatsnew/2.6.rst:693 +#: ../../whatsnew/2.6.rst:701 msgid "This will produce the output::" msgstr "" -#: ../../whatsnew/2.6.rst:695 +#: ../../whatsnew/2.6.rst:703 msgid "" "1 1\n" "11 39916800\n" @@ -1024,32 +1028,32 @@ msgstr "" "41 33452526613163807108170062053440751665152000000000\n" "51 15511187532873822802242430164693032110632597200169861120000..." -#: ../../whatsnew/2.6.rst:704 +#: ../../whatsnew/2.6.rst:712 msgid "The documentation for the :mod:`multiprocessing` module." msgstr ":mod:`multiprocessing` 模組的文件。" -#: ../../whatsnew/2.6.rst:706 +#: ../../whatsnew/2.6.rst:714 msgid ":pep:`371` - Addition of the multiprocessing package" msgstr "" -#: ../../whatsnew/2.6.rst:707 +#: ../../whatsnew/2.6.rst:715 msgid "" "PEP written by Jesse Noller and Richard Oudkerk; implemented by Richard " "Oudkerk and Jesse Noller." msgstr "" -#: ../../whatsnew/2.6.rst:716 +#: ../../whatsnew/2.6.rst:724 msgid "PEP 3101: Advanced String Formatting" msgstr "" -#: ../../whatsnew/2.6.rst:718 +#: ../../whatsnew/2.6.rst:726 msgid "" "In Python 3.0, the ``%`` operator is supplemented by a more powerful string " "formatting method, :meth:`format`. Support for the :meth:`str.format` " "method has been backported to Python 2.6." msgstr "" -#: ../../whatsnew/2.6.rst:722 +#: ../../whatsnew/2.6.rst:730 msgid "" "In 2.6, both 8-bit and Unicode strings have a ``.format()`` method that " "treats the string as a template and takes the arguments to be formatted. The " @@ -1057,7 +1061,7 @@ msgid "" "characters::" msgstr "" -#: ../../whatsnew/2.6.rst:726 +#: ../../whatsnew/2.6.rst:734 msgid "" ">>> # Substitute positional argument 0 into the string.\n" ">>> \"User ID: {0}\".format(\"root\")\n" @@ -1069,28 +1073,28 @@ msgid "" "'User ID: root Last seen: 5 Mar 2008 07:20'" msgstr "" -#: ../../whatsnew/2.6.rst:735 +#: ../../whatsnew/2.6.rst:743 msgid "Curly brackets can be escaped by doubling them::" msgstr "" -#: ../../whatsnew/2.6.rst:737 +#: ../../whatsnew/2.6.rst:745 msgid "" ">>> \"Empty dict: {{}}\".format()\n" "\"Empty dict: {}\"" msgstr "" -#: ../../whatsnew/2.6.rst:740 +#: ../../whatsnew/2.6.rst:748 msgid "" "Field names can be integers indicating positional arguments, such as ``{0}" "``, ``{1}``, etc. or names of keyword arguments. You can also supply " "compound field names that read attributes or access dictionary keys::" msgstr "" -#: ../../whatsnew/2.6.rst:744 +#: ../../whatsnew/2.6.rst:752 msgid "" ">>> import sys\n" -">>> print 'Platform: {0.platform}\\nPython version: " -"{0.version}'.format(sys)\n" +">>> print 'Platform: {0.platform}\\nPython version: {0.version}'." +"format(sys)\n" "Platform: darwin\n" "Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41)\n" "[GCC 4.0.1 (Apple Computer, Inc. build 5367)]'\n" @@ -1100,8 +1104,8 @@ msgid "" "'Content-type: video/mp4'" msgstr "" ">>> import sys\n" -">>> print 'Platform: {0.platform}\\nPython version: " -"{0.version}'.format(sys)\n" +">>> print 'Platform: {0.platform}\\nPython version: {0.version}'." +"format(sys)\n" "Platform: darwin\n" "Python version: 2.6a1+ (trunk:61261M, Mar 5 2008, 20:29:41)\n" "[GCC 4.0.1 (Apple Computer, Inc. build 5367)]'\n" @@ -1110,7 +1114,7 @@ msgstr "" ">>> 'Content-type: {0[.mp4]}'.format(mimetypes.types_map)\n" "'Content-type: video/mp4'" -#: ../../whatsnew/2.6.rst:754 +#: ../../whatsnew/2.6.rst:762 msgid "" "Note that when using dictionary-style notation such as ``[.mp4]``, you don't " "need to put any quotation marks around the string; it will look up the value " @@ -1119,14 +1123,14 @@ msgid "" "inside a format string." msgstr "" -#: ../../whatsnew/2.6.rst:760 +#: ../../whatsnew/2.6.rst:768 msgid "" "So far we've shown how to specify which field to substitute into the " "resulting string. The precise formatting used is also controllable by " "adding a colon followed by a format specifier. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:764 +#: ../../whatsnew/2.6.rst:772 msgid "" ">>> # Field 0: left justify, pad to 15 characters\n" ">>> # Field 1: right justify, pad to 6 characters\n" @@ -1139,11 +1143,11 @@ msgid "" "'Banquet $ 125'" msgstr "" -#: ../../whatsnew/2.6.rst:774 +#: ../../whatsnew/2.6.rst:782 msgid "Format specifiers can reference other fields through nesting::" msgstr "" -#: ../../whatsnew/2.6.rst:776 +#: ../../whatsnew/2.6.rst:784 msgid "" ">>> fmt = '{0:{1}}'\n" ">>> width = 15\n" @@ -1154,58 +1158,58 @@ msgid "" "'Invoice #1234 '" msgstr "" -#: ../../whatsnew/2.6.rst:784 +#: ../../whatsnew/2.6.rst:792 msgid "The alignment of a field within the desired width can be specified:" msgstr "" -#: ../../whatsnew/2.6.rst:787 +#: ../../whatsnew/2.6.rst:795 msgid "Character" msgstr "字元" -#: ../../whatsnew/2.6.rst:787 +#: ../../whatsnew/2.6.rst:795 msgid "Effect" msgstr "效果" -#: ../../whatsnew/2.6.rst:789 +#: ../../whatsnew/2.6.rst:797 msgid "< (default)" msgstr "" -#: ../../whatsnew/2.6.rst:789 +#: ../../whatsnew/2.6.rst:797 msgid "Left-align" msgstr "" -#: ../../whatsnew/2.6.rst:790 +#: ../../whatsnew/2.6.rst:798 msgid ">" msgstr ">" -#: ../../whatsnew/2.6.rst:790 +#: ../../whatsnew/2.6.rst:798 msgid "Right-align" msgstr "" -#: ../../whatsnew/2.6.rst:791 +#: ../../whatsnew/2.6.rst:799 msgid "^" msgstr "^" -#: ../../whatsnew/2.6.rst:791 +#: ../../whatsnew/2.6.rst:799 msgid "Center" msgstr "" -#: ../../whatsnew/2.6.rst:792 +#: ../../whatsnew/2.6.rst:800 msgid "=" msgstr "=" -#: ../../whatsnew/2.6.rst:792 +#: ../../whatsnew/2.6.rst:800 msgid "(For numeric types only) Pad after the sign." msgstr "" -#: ../../whatsnew/2.6.rst:795 +#: ../../whatsnew/2.6.rst:803 msgid "" "Format specifiers can also include a presentation type, which controls how " "the value is formatted. For example, floating-point numbers can be " "formatted as a general number or in exponential notation::" msgstr "" -#: ../../whatsnew/2.6.rst:799 +#: ../../whatsnew/2.6.rst:807 msgid "" ">>> '{0:g}'.format(3.75)\n" "'3.75'\n" @@ -1217,104 +1221,104 @@ msgstr "" ">>> '{0:e}'.format(3.75)\n" "'3.750000e+00'" -#: ../../whatsnew/2.6.rst:804 +#: ../../whatsnew/2.6.rst:812 msgid "" "A variety of presentation types are available. Consult the 2.6 " "documentation for a :ref:`complete list `; here's a sample:" msgstr "" -#: ../../whatsnew/2.6.rst:808 +#: ../../whatsnew/2.6.rst:816 msgid "``b``" msgstr "``b``" -#: ../../whatsnew/2.6.rst:808 +#: ../../whatsnew/2.6.rst:816 msgid "Binary. Outputs the number in base 2." msgstr "" -#: ../../whatsnew/2.6.rst:809 +#: ../../whatsnew/2.6.rst:817 msgid "``c``" msgstr "``c``" -#: ../../whatsnew/2.6.rst:809 +#: ../../whatsnew/2.6.rst:817 msgid "" "Character. Converts the integer to the corresponding Unicode character " "before printing." msgstr "" -#: ../../whatsnew/2.6.rst:811 +#: ../../whatsnew/2.6.rst:819 msgid "``d``" msgstr "``d``" -#: ../../whatsnew/2.6.rst:811 +#: ../../whatsnew/2.6.rst:819 msgid "Decimal Integer. Outputs the number in base 10." msgstr "" -#: ../../whatsnew/2.6.rst:812 +#: ../../whatsnew/2.6.rst:820 msgid "``o``" msgstr "``o``" -#: ../../whatsnew/2.6.rst:812 +#: ../../whatsnew/2.6.rst:820 msgid "Octal format. Outputs the number in base 8." msgstr "" -#: ../../whatsnew/2.6.rst:813 +#: ../../whatsnew/2.6.rst:821 msgid "``x``" msgstr "``x``" -#: ../../whatsnew/2.6.rst:813 +#: ../../whatsnew/2.6.rst:821 msgid "" "Hex format. Outputs the number in base 16, using lower-case letters for the " "digits above 9." msgstr "" -#: ../../whatsnew/2.6.rst:815 +#: ../../whatsnew/2.6.rst:823 msgid "``e``" msgstr "``e``" -#: ../../whatsnew/2.6.rst:815 +#: ../../whatsnew/2.6.rst:823 msgid "" "Exponent notation. Prints the number in scientific notation using the letter " "'e' to indicate the exponent." msgstr "" -#: ../../whatsnew/2.6.rst:817 +#: ../../whatsnew/2.6.rst:825 msgid "``g``" msgstr "``g``" -#: ../../whatsnew/2.6.rst:817 +#: ../../whatsnew/2.6.rst:825 msgid "" "General format. This prints the number as a fixed-point number, unless the " "number is too large, in which case it switches to 'e' exponent notation." msgstr "" -#: ../../whatsnew/2.6.rst:820 +#: ../../whatsnew/2.6.rst:828 msgid "``n``" msgstr "``n``" -#: ../../whatsnew/2.6.rst:820 +#: ../../whatsnew/2.6.rst:828 msgid "" "Number. This is the same as 'g' (for floats) or 'd' (for integers), except " "that it uses the current locale setting to insert the appropriate number " "separator characters." msgstr "" -#: ../../whatsnew/2.6.rst:823 +#: ../../whatsnew/2.6.rst:831 msgid "``%``" msgstr "``%``" -#: ../../whatsnew/2.6.rst:823 +#: ../../whatsnew/2.6.rst:831 msgid "" "Percentage. Multiplies the number by 100 and displays in fixed ('f') format, " "followed by a percent sign." msgstr "" -#: ../../whatsnew/2.6.rst:827 +#: ../../whatsnew/2.6.rst:835 msgid "" -"Classes and types can define a :meth:`__format__` method to control how " -"they're formatted. It receives a single argument, the format specifier::" +"Classes and types can define a :meth:`~object.__format__` method to control " +"how they're formatted. It receives a single argument, the format specifier::" msgstr "" -#: ../../whatsnew/2.6.rst:830 +#: ../../whatsnew/2.6.rst:838 msgid "" "def __format__(self, format_spec):\n" " if isinstance(format_spec, unicode):\n" @@ -1328,13 +1332,14 @@ msgstr "" " else:\n" " return str(self)" -#: ../../whatsnew/2.6.rst:836 +#: ../../whatsnew/2.6.rst:844 msgid "" "There's also a :func:`format` builtin that will format a single value. It " -"calls the type's :meth:`__format__` method with the provided specifier::" +"calls the type's :meth:`~object.__format__` method with the provided " +"specifier::" msgstr "" -#: ../../whatsnew/2.6.rst:840 +#: ../../whatsnew/2.6.rst:848 msgid "" ">>> format(75.6564, '.2f')\n" "'75.66'" @@ -1342,40 +1347,40 @@ msgstr "" ">>> format(75.6564, '.2f')\n" "'75.66'" -#: ../../whatsnew/2.6.rst:846 +#: ../../whatsnew/2.6.rst:854 msgid ":ref:`formatstrings`" msgstr ":ref:`formatstrings`" -#: ../../whatsnew/2.6.rst:847 +#: ../../whatsnew/2.6.rst:855 msgid "The reference documentation for format fields." msgstr "" -#: ../../whatsnew/2.6.rst:849 +#: ../../whatsnew/2.6.rst:857 msgid ":pep:`3101` - Advanced String Formatting" msgstr "" -#: ../../whatsnew/2.6.rst:850 +#: ../../whatsnew/2.6.rst:858 msgid "PEP written by Talin. Implemented by Eric Smith." msgstr "由 Talin 撰寫 PEP、由 Eric Smith 實作。" -#: ../../whatsnew/2.6.rst:857 +#: ../../whatsnew/2.6.rst:865 msgid "PEP 3105: ``print`` As a Function" msgstr "" -#: ../../whatsnew/2.6.rst:859 +#: ../../whatsnew/2.6.rst:867 msgid "" "The ``print`` statement becomes the :func:`print` function in Python 3.0. " "Making :func:`print` a function makes it possible to replace the function by " "doing ``def print(...)`` or importing a new function from somewhere else." msgstr "" -#: ../../whatsnew/2.6.rst:863 +#: ../../whatsnew/2.6.rst:871 msgid "" "Python 2.6 has a ``__future__`` import that removes ``print`` as language " "syntax, letting you use the functional form instead. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:866 +#: ../../whatsnew/2.6.rst:874 msgid "" ">>> from __future__ import print_function\n" ">>> print('# of entries', len(dictionary), file=sys.stderr)" @@ -1383,55 +1388,55 @@ msgstr "" ">>> from __future__ import print_function\n" ">>> print('# of entries', len(dictionary), file=sys.stderr)" -#: ../../whatsnew/2.6.rst:869 +#: ../../whatsnew/2.6.rst:877 msgid "The signature of the new function is::" msgstr "" -#: ../../whatsnew/2.6.rst:871 +#: ../../whatsnew/2.6.rst:879 msgid "def print(*args, sep=' ', end='\\n', file=None)" msgstr "def print(*args, sep=' ', end='\\n', file=None)" -#: ../../whatsnew/2.6.rst:874 +#: ../../whatsnew/2.6.rst:882 msgid "The parameters are:" msgstr "" -#: ../../whatsnew/2.6.rst:876 +#: ../../whatsnew/2.6.rst:884 msgid "*args*: positional arguments whose values will be printed out." msgstr "" -#: ../../whatsnew/2.6.rst:877 +#: ../../whatsnew/2.6.rst:885 msgid "*sep*: the separator, which will be printed between arguments." msgstr "" -#: ../../whatsnew/2.6.rst:878 +#: ../../whatsnew/2.6.rst:886 msgid "" "*end*: the ending text, which will be printed after all of the arguments " "have been output." msgstr "" -#: ../../whatsnew/2.6.rst:880 +#: ../../whatsnew/2.6.rst:888 msgid "*file*: the file object to which the output will be sent." msgstr "" -#: ../../whatsnew/2.6.rst:884 +#: ../../whatsnew/2.6.rst:892 msgid ":pep:`3105` - Make print a function" msgstr ":pep:`3105` - 將 print 變成函式" -#: ../../whatsnew/2.6.rst:885 +#: ../../whatsnew/2.6.rst:893 msgid "PEP written by Georg Brandl." msgstr "由 Georg Brandl 撰寫 PEP。" -#: ../../whatsnew/2.6.rst:892 +#: ../../whatsnew/2.6.rst:900 msgid "PEP 3110: Exception-Handling Changes" msgstr "" -#: ../../whatsnew/2.6.rst:894 +#: ../../whatsnew/2.6.rst:902 msgid "" "One error that Python programmers occasionally make is writing the following " "code::" msgstr "" -#: ../../whatsnew/2.6.rst:897 +#: ../../whatsnew/2.6.rst:905 msgid "" "try:\n" " ...\n" @@ -1443,17 +1448,16 @@ msgstr "" "except TypeError, ValueError: # 錯誤!\n" " ..." -#: ../../whatsnew/2.6.rst:902 +#: ../../whatsnew/2.6.rst:910 msgid "" -"The author is probably trying to catch both :exc:`TypeError` " -"and :exc:`ValueError` exceptions, but this code actually does something " -"different: it will catch :exc:`TypeError` and bind the resulting exception " -"object to the local name ``\"ValueError\"``. The :exc:`ValueError` " -"exception will not be caught at all. The correct code specifies a tuple of " -"exceptions::" +"The author is probably trying to catch both :exc:`TypeError` and :exc:" +"`ValueError` exceptions, but this code actually does something different: it " +"will catch :exc:`TypeError` and bind the resulting exception object to the " +"local name ``\"ValueError\"``. The :exc:`ValueError` exception will not be " +"caught at all. The correct code specifies a tuple of exceptions::" msgstr "" -#: ../../whatsnew/2.6.rst:909 +#: ../../whatsnew/2.6.rst:917 msgid "" "try:\n" " ...\n" @@ -1465,21 +1469,21 @@ msgstr "" "except (TypeError, ValueError):\n" " ..." -#: ../../whatsnew/2.6.rst:914 +#: ../../whatsnew/2.6.rst:922 msgid "" "This error happens because the use of the comma here is ambiguous: does it " "indicate two different nodes in the parse tree, or a single node that's a " "tuple?" msgstr "" -#: ../../whatsnew/2.6.rst:918 +#: ../../whatsnew/2.6.rst:926 msgid "" "Python 3.0 makes this unambiguous by replacing the comma with the word " "\"as\". To catch an exception and store the exception object in the " "variable ``exc``, you must write::" msgstr "" -#: ../../whatsnew/2.6.rst:922 +#: ../../whatsnew/2.6.rst:930 msgid "" "try:\n" " ...\n" @@ -1491,7 +1495,7 @@ msgstr "" "except TypeError as exc:\n" " ..." -#: ../../whatsnew/2.6.rst:927 +#: ../../whatsnew/2.6.rst:935 msgid "" "Python 3.0 will only support the use of \"as\", and therefore interprets the " "first example as catching two different exceptions. Python 2.6 supports " @@ -1500,54 +1504,54 @@ msgid "" "be executed with 2.6." msgstr "" -#: ../../whatsnew/2.6.rst:935 +#: ../../whatsnew/2.6.rst:943 msgid ":pep:`3110` - Catching Exceptions in Python 3000" msgstr "" -#: ../../whatsnew/2.6.rst:936 +#: ../../whatsnew/2.6.rst:944 msgid "PEP written and implemented by Collin Winter." msgstr "由 Collin Winter 撰寫 PEP 與實作。" -#: ../../whatsnew/2.6.rst:943 +#: ../../whatsnew/2.6.rst:951 msgid "PEP 3112: Byte Literals" msgstr "" -#: ../../whatsnew/2.6.rst:945 +#: ../../whatsnew/2.6.rst:953 msgid "" "Python 3.0 adopts Unicode as the language's fundamental string type and " -"denotes 8-bit literals differently, either as ``b'string'`` or using " -"a :class:`bytes` constructor. For future compatibility, Python 2.6 " -"adds :class:`bytes` as a synonym for the :class:`str` type, and it also " -"supports the ``b''`` notation." +"denotes 8-bit literals differently, either as ``b'string'`` or using a :" +"class:`bytes` constructor. For future compatibility, Python 2.6 adds :class:" +"`bytes` as a synonym for the :class:`str` type, and it also supports the " +"``b''`` notation." msgstr "" -#: ../../whatsnew/2.6.rst:952 +#: ../../whatsnew/2.6.rst:960 msgid "" "The 2.6 :class:`str` differs from 3.0's :class:`bytes` type in various ways; " "most notably, the constructor is completely different. In 3.0, ``bytes([65, " "66, 67])`` is 3 elements long, containing the bytes representing ``ABC``; in " -"2.6, ``bytes([65, 66, 67])`` returns the 12-byte string representing " -"the :func:`str` of the list." +"2.6, ``bytes([65, 66, 67])`` returns the 12-byte string representing the :" +"func:`str` of the list." msgstr "" -#: ../../whatsnew/2.6.rst:958 +#: ../../whatsnew/2.6.rst:966 msgid "" "The primary use of :class:`bytes` in 2.6 will be to write tests of object " "type such as ``isinstance(x, bytes)``. This will help the 2to3 converter, " "which can't tell whether 2.x code intends strings to contain either " -"characters or 8-bit bytes; you can now use either :class:`bytes` " -"or :class:`str` to represent your intention exactly, and the resulting code " -"will also be correct in Python 3.0." +"characters or 8-bit bytes; you can now use either :class:`bytes` or :class:" +"`str` to represent your intention exactly, and the resulting code will also " +"be correct in Python 3.0." msgstr "" -#: ../../whatsnew/2.6.rst:965 +#: ../../whatsnew/2.6.rst:973 msgid "" "There's also a ``__future__`` import that causes all string literals to " "become Unicode strings. This means that ``\\u`` escape sequences can be " "used to include Unicode characters::" msgstr "" -#: ../../whatsnew/2.6.rst:970 +#: ../../whatsnew/2.6.rst:978 msgid "" "from __future__ import unicode_literals\n" "\n" @@ -1563,22 +1567,23 @@ msgstr "" "\n" "print len(s) # 12 個 Unicode 字元" -#: ../../whatsnew/2.6.rst:977 +#: ../../whatsnew/2.6.rst:985 msgid "" "At the C level, Python 3.0 will rename the existing 8-bit string type, " "called :c:type:`!PyStringObject` in Python 2.x, to :c:type:`PyBytesObject`. " -"Python 2.6 uses ``#define`` to support using the " -"names :c:func:`PyBytesObject`, :c:func:`PyBytes_Check`, :c:func:`PyBytes_FromStringAndSize`, " -"and all the other functions and macros used with strings." +"Python 2.6 uses ``#define`` to support using the names :c:func:" +"`PyBytesObject`, :c:func:`PyBytes_Check`, :c:func:" +"`PyBytes_FromStringAndSize`, and all the other functions and macros used " +"with strings." msgstr "" -#: ../../whatsnew/2.6.rst:984 +#: ../../whatsnew/2.6.rst:992 msgid "" "Instances of the :class:`bytes` type are immutable just as strings are. A " "new :class:`bytearray` type stores a mutable sequence of bytes::" msgstr "" -#: ../../whatsnew/2.6.rst:988 +#: ../../whatsnew/2.6.rst:996 msgid "" ">>> bytearray([65, 66, 67])\n" "bytearray(b'ABC')\n" @@ -1602,16 +1607,16 @@ msgstr "" ">>> unicode(str(b), 'utf-8')\n" "u'\\u31ef \\u3244'" -#: ../../whatsnew/2.6.rst:999 +#: ../../whatsnew/2.6.rst:1007 msgid "" -"Byte arrays support most of the methods of string types, such " -"as :meth:`~bytearray.startswith`/:meth:`~bytearray.endswith`, :meth:`~bytearray.find`/:meth:`~bytearray.rfind`, " -"and some of the methods of lists, such " -"as :meth:`~bytearray.append`, :meth:`~bytearray.pop`, " -"and :meth:`~bytearray.reverse`." +"Byte arrays support most of the methods of string types, such as :meth:" +"`~bytearray.startswith`/:meth:`~bytearray.endswith`, :meth:`~bytearray." +"find`/:meth:`~bytearray.rfind`, and some of the methods of lists, such as :" +"meth:`~bytearray.append`, :meth:`~bytearray.pop`, and :meth:`~bytearray." +"reverse`." msgstr "" -#: ../../whatsnew/2.6.rst:1007 +#: ../../whatsnew/2.6.rst:1015 msgid "" ">>> b = bytearray('ABC')\n" ">>> b.append('d')\n" @@ -1625,95 +1630,96 @@ msgstr "" ">>> b\n" "bytearray(b'ABCde')" -#: ../../whatsnew/2.6.rst:1013 +#: ../../whatsnew/2.6.rst:1021 msgid "" -"There's also a corresponding C API, " -"with :c:func:`PyByteArray_FromObject`, :c:func:`PyByteArray_FromStringAndSize`, " -"and various other functions." +"There's also a corresponding C API, with :c:func:`PyByteArray_FromObject`, :" +"c:func:`PyByteArray_FromStringAndSize`, and various other functions." msgstr "" -#: ../../whatsnew/2.6.rst:1020 +#: ../../whatsnew/2.6.rst:1028 msgid ":pep:`3112` - Bytes literals in Python 3000" msgstr "" -#: ../../whatsnew/2.6.rst:1021 +#: ../../whatsnew/2.6.rst:1029 msgid "PEP written by Jason Orendorff; backported to 2.6 by Christian Heimes." msgstr "" -#: ../../whatsnew/2.6.rst:1028 +#: ../../whatsnew/2.6.rst:1036 msgid "PEP 3116: New I/O Library" msgstr "PEP 3116:新 I/O 函式庫" -#: ../../whatsnew/2.6.rst:1030 +#: ../../whatsnew/2.6.rst:1038 msgid "" "Python's built-in file objects support a number of methods, but file-like " "objects don't necessarily support all of them. Objects that imitate files " -"usually support :meth:`read` and :meth:`write`, but they may not " -"support :meth:`readline`, for example. Python 3.0 introduces a layered I/O " -"library in the :mod:`io` module that separates buffering and text-handling " -"features from the fundamental read and write operations." +"usually support :meth:`!read` and :meth:`!write`, but they may not support :" +"meth:`!readline`, for example. Python 3.0 introduces a layered I/O library " +"in the :mod:`io` module that separates buffering and text-handling features " +"from the fundamental read and write operations." msgstr "" -#: ../../whatsnew/2.6.rst:1038 +#: ../../whatsnew/2.6.rst:1046 msgid "" "There are three levels of abstract base classes provided by the :mod:`io` " "module:" msgstr "" -#: ../../whatsnew/2.6.rst:1041 +#: ../../whatsnew/2.6.rst:1049 msgid "" -":class:`RawIOBase` defines raw I/O " -"operations: :meth:`read`, :meth:`readinto`, :meth:`write`, :meth:`seek`, :meth:`tell`, :meth:`truncate`, " -"and :meth:`close`. Most of the methods of this class will often map to a " -"single system call. There are also :meth:`readable`, :meth:`writable`, " -"and :meth:`seekable` methods for determining what operations a given object " -"will allow." +":class:`~io.RawIOBase` defines raw I/O operations: :meth:`~io.RawIOBase." +"read`, :meth:`~io.RawIOBase.readinto`, :meth:`~io.RawIOBase.write`, :meth:" +"`~io.IOBase.seek`, :meth:`~io.IOBase.tell`, :meth:`~io.IOBase.truncate`, " +"and :meth:`~io.IOBase.close`. Most of the methods of this class will often " +"map to a single system call. There are also :meth:`~io.IOBase.readable`, :" +"meth:`~io.IOBase.writable`, and :meth:`~io.IOBase.seekable` methods for " +"determining what operations a given object will allow." msgstr "" -#: ../../whatsnew/2.6.rst:1049 +#: ../../whatsnew/2.6.rst:1058 msgid "" "Python 3.0 has concrete implementations of this class for files and sockets, " "but Python 2.6 hasn't restructured its file and socket objects in this way." msgstr "" -#: ../../whatsnew/2.6.rst:1053 +#: ../../whatsnew/2.6.rst:1062 msgid "" -":class:`BufferedIOBase` is an abstract base class that buffers data in " +":class:`~io.BufferedIOBase` is an abstract base class that buffers data in " "memory to reduce the number of system calls used, making I/O processing more " -"efficient. It supports all of the methods of :class:`RawIOBase`, and adds " -"a :attr:`raw` attribute holding the underlying raw object." +"efficient. It supports all of the methods of :class:`~io.RawIOBase`, and " +"adds a :attr:`~io.BufferedIOBase.raw` attribute holding the underlying raw " +"object." msgstr "" -#: ../../whatsnew/2.6.rst:1059 +#: ../../whatsnew/2.6.rst:1069 msgid "" -"There are five concrete classes implementing this " -"ABC. :class:`BufferedWriter` and :class:`BufferedReader` are for objects " -"that support write-only or read-only usage that have a :meth:`seek` method " -"for random access. :class:`BufferedRandom` objects support read and write " -"access upon the same underlying stream, and :class:`BufferedRWPair` is for " -"objects such as TTYs that have both read and write operations acting upon " -"unconnected streams of data. The :class:`BytesIO` class supports reading, " -"writing, and seeking over an in-memory buffer." +"There are five concrete classes implementing this ABC. :class:`~io." +"BufferedWriter` and :class:`~io.BufferedReader` are for objects that support " +"write-only or read-only usage that have a :meth:`~io.IOBase.seek` method for " +"random access. :class:`~io.BufferedRandom` objects support read and write " +"access upon the same underlying stream, and :class:`~io.BufferedRWPair` is " +"for objects such as TTYs that have both read and write operations acting " +"upon unconnected streams of data. The :class:`~io.BytesIO` class supports " +"reading, writing, and seeking over an in-memory buffer." msgstr "" -#: ../../whatsnew/2.6.rst:1072 +#: ../../whatsnew/2.6.rst:1082 msgid "" -":class:`TextIOBase`: Provides functions for reading and writing strings " -"(remember, strings will be Unicode in Python 3.0), and " -"supporting :term:`universal newlines`. :class:`TextIOBase` defines " -"the :meth:`readline` method and supports iteration upon objects." +":class:`~io.TextIOBase`: Provides functions for reading and writing strings " +"(remember, strings will be Unicode in Python 3.0), and supporting :term:" +"`universal newlines`. :class:`~io.TextIOBase` defines the :meth:`readline` " +"method and supports iteration upon objects." msgstr "" -#: ../../whatsnew/2.6.rst:1078 +#: ../../whatsnew/2.6.rst:1088 msgid "" -"There are two concrete implementations. :class:`TextIOWrapper` wraps a " +"There are two concrete implementations. :class:`~io.TextIOWrapper` wraps a " "buffered I/O object, supporting all of the methods for text I/O and adding " -"a :attr:`buffer` attribute for access to the underlying " -"object. :class:`StringIO` simply buffers everything in memory without ever " -"writing anything to disk." +"a :attr:`~io.TextIOBase.buffer` attribute for access to the underlying " +"object. :class:`~io.StringIO` simply buffers everything in memory without " +"ever writing anything to disk." msgstr "" -#: ../../whatsnew/2.6.rst:1084 +#: ../../whatsnew/2.6.rst:1094 msgid "" "(In Python 2.6, :class:`io.StringIO` is implemented in pure Python, so it's " "pretty slow. You should therefore stick with the existing :mod:`!StringIO` " @@ -1722,7 +1728,7 @@ msgid "" "will be backported to the 2.x releases.)" msgstr "" -#: ../../whatsnew/2.6.rst:1090 +#: ../../whatsnew/2.6.rst:1100 msgid "" "In Python 2.6, the underlying implementations haven't been restructured to " "build on top of the :mod:`io` module's classes. The module is being " @@ -1731,22 +1737,22 @@ msgid "" "buffering and text I/O." msgstr "" -#: ../../whatsnew/2.6.rst:1098 +#: ../../whatsnew/2.6.rst:1108 msgid ":pep:`3116` - New I/O" msgstr "" -#: ../../whatsnew/2.6.rst:1099 +#: ../../whatsnew/2.6.rst:1109 msgid "" "PEP written by Daniel Stutzbach, Mike Verdone, and Guido van Rossum. Code by " "Guido van Rossum, Georg Brandl, Walter Doerwald, Jeremy Hylton, Martin von " "Löwis, Tony Lownds, and others." msgstr "" -#: ../../whatsnew/2.6.rst:1108 +#: ../../whatsnew/2.6.rst:1118 msgid "PEP 3118: Revised Buffer Protocol" msgstr "PEP 3118:修訂緩衝協定" -#: ../../whatsnew/2.6.rst:1110 +#: ../../whatsnew/2.6.rst:1120 msgid "" "The buffer protocol is a C-level API that lets Python types exchange " "pointers into their internal representations. A memory-mapped file can be " @@ -1755,7 +1761,7 @@ msgid "" "searched." msgstr "" -#: ../../whatsnew/2.6.rst:1116 +#: ../../whatsnew/2.6.rst:1126 msgid "" "The primary users of the buffer protocol are numeric-processing packages " "such as NumPy, which expose the internal representation of arrays so that " @@ -1765,7 +1771,7 @@ msgid "" "the shape of an array or locking a memory region." msgstr "" -#: ../../whatsnew/2.6.rst:1123 +#: ../../whatsnew/2.6.rst:1133 msgid "" "The most important new C API function is ``PyObject_GetBuffer(PyObject *obj, " "Py_buffer *view, int flags)``, which takes an object and a set of flags, and " @@ -1776,89 +1782,89 @@ msgid "" "external caller is done." msgstr "" -#: ../../whatsnew/2.6.rst:1133 +#: ../../whatsnew/2.6.rst:1143 msgid "" "The *flags* argument to :c:func:`PyObject_GetBuffer` specifies constraints " "upon the memory returned. Some examples are:" msgstr "" -#: ../../whatsnew/2.6.rst:1136 +#: ../../whatsnew/2.6.rst:1146 msgid ":c:macro:`PyBUF_WRITABLE` indicates that the memory must be writable." msgstr "" -#: ../../whatsnew/2.6.rst:1138 +#: ../../whatsnew/2.6.rst:1148 msgid "" ":c:macro:`PyBUF_LOCK` requests a read-only or exclusive lock on the memory." msgstr "" -#: ../../whatsnew/2.6.rst:1140 +#: ../../whatsnew/2.6.rst:1150 msgid "" ":c:macro:`PyBUF_C_CONTIGUOUS` and :c:macro:`PyBUF_F_CONTIGUOUS` requests a C-" "contiguous (last dimension varies the fastest) or Fortran-contiguous (first " "dimension varies the fastest) array layout." msgstr "" -#: ../../whatsnew/2.6.rst:1144 +#: ../../whatsnew/2.6.rst:1154 msgid "" "Two new argument codes for :c:func:`PyArg_ParseTuple`, ``s*`` and ``z*``, " "return locked buffer objects for a parameter." msgstr "" -#: ../../whatsnew/2.6.rst:1149 +#: ../../whatsnew/2.6.rst:1159 msgid ":pep:`3118` - Revising the buffer protocol" msgstr "" -#: ../../whatsnew/2.6.rst:1150 +#: ../../whatsnew/2.6.rst:1160 msgid "" "PEP written by Travis Oliphant and Carl Banks; implemented by Travis " "Oliphant." msgstr "" -#: ../../whatsnew/2.6.rst:1159 +#: ../../whatsnew/2.6.rst:1169 msgid "PEP 3119: Abstract Base Classes" msgstr "" -#: ../../whatsnew/2.6.rst:1161 +#: ../../whatsnew/2.6.rst:1171 msgid "" "Some object-oriented languages such as Java support interfaces, declaring " "that a class has a given set of methods or supports a given access " "protocol. Abstract Base Classes (or ABCs) are an equivalent feature for " "Python. The ABC support consists of an :mod:`abc` module containing a " -"metaclass called :class:`ABCMeta`, special handling of this metaclass by " -"the :func:`isinstance` and :func:`issubclass` builtins, and a collection of " -"basic ABCs that the Python developers think will be widely useful. Future " -"versions of Python will probably add more ABCs." +"metaclass called :class:`~abc.ABCMeta`, special handling of this metaclass " +"by the :func:`isinstance` and :func:`issubclass` builtins, and a collection " +"of basic ABCs that the Python developers think will be widely useful. " +"Future versions of Python will probably add more ABCs." msgstr "" -#: ../../whatsnew/2.6.rst:1171 +#: ../../whatsnew/2.6.rst:1181 msgid "" "Let's say you have a particular class and wish to know whether it supports " "dictionary-style access. The phrase \"dictionary-style\" is vague, however. " "It probably means that accessing items with ``obj[1]`` works. Does it imply " "that setting items with ``obj[2] = value`` works? Or that the object will " -"have :meth:`keys`, :meth:`values`, and :meth:`items` methods? What about " -"the iterative variants such as :meth:`iterkeys`? :meth:`copy` " -"and :meth:`update`? Iterating over the object with :func:`iter`?" +"have :meth:`!keys`, :meth:`!values`, and :meth:`!items` methods? What about " +"the iterative variants such as :meth:`!iterkeys`? :meth:`!copy`and :meth:`!" +"update`? Iterating over the object with :func:`!iter`?" msgstr "" -#: ../../whatsnew/2.6.rst:1179 +#: ../../whatsnew/2.6.rst:1189 msgid "" "The Python 2.6 :mod:`collections` module includes a number of different ABCs " "that represent these distinctions. :class:`Iterable` indicates that a class " -"defines :meth:`__iter__`, and :class:`Container` means the class defines " -"a :meth:`__contains__` method and therefore supports ``x in y`` " -"expressions. The basic dictionary interface of getting items, setting " -"items, and :meth:`keys`, :meth:`values`, and :meth:`items`, is defined by " +"defines :meth:`~object.__iter__`, and :class:`Container` means the class " +"defines a :meth:`~object.__contains__` method and therefore supports ``x in " +"y`` expressions. The basic dictionary interface of getting items, setting " +"items, and :meth:`!keys`, :meth:`!values`, and :meth:`!items`, is defined by " "the :class:`MutableMapping` ABC." msgstr "" -#: ../../whatsnew/2.6.rst:1188 +#: ../../whatsnew/2.6.rst:1198 msgid "" "You can derive your own classes from a particular ABC to indicate they " "support that ABC's interface::" msgstr "" -#: ../../whatsnew/2.6.rst:1191 +#: ../../whatsnew/2.6.rst:1201 msgid "" "import collections\n" "\n" @@ -1870,14 +1876,14 @@ msgstr "" "class Storage(collections.MutableMapping):\n" " ..." -#: ../../whatsnew/2.6.rst:1197 +#: ../../whatsnew/2.6.rst:1207 msgid "" "Alternatively, you could write the class without deriving from the desired " -"ABC and instead register the class by calling the ABC's :meth:`register` " -"method::" +"ABC and instead register the class by calling the ABC's :meth:`~abc.ABCMeta." +"register` method::" msgstr "" -#: ../../whatsnew/2.6.rst:1201 +#: ../../whatsnew/2.6.rst:1211 msgid "" "import collections\n" "\n" @@ -1893,16 +1899,16 @@ msgstr "" "\n" "collections.MutableMapping.register(Storage)" -#: ../../whatsnew/2.6.rst:1208 +#: ../../whatsnew/2.6.rst:1218 msgid "" -"For classes that you write, deriving from the ABC is probably clearer. " -"The :meth:`register` method is useful when you've written a new ABC that " -"can describe an existing type or class, or if you want to declare that some " -"third-party class implements an ABC. For example, if you defined " -"a :class:`PrintableType` ABC, it's legal to do::" +"For classes that you write, deriving from the ABC is probably clearer. The :" +"meth:`~abc.ABCMeta.register` method is useful when you've written a new ABC " +"that can describe an existing type or class, or if you want to declare that " +"some third-party class implements an ABC. For example, if you defined a :" +"class:`!PrintableType` ABC, it's legal to do::" msgstr "" -#: ../../whatsnew/2.6.rst:1215 +#: ../../whatsnew/2.6.rst:1225 msgid "" "# Register Python's types\n" "PrintableType.register(int)\n" @@ -1914,20 +1920,20 @@ msgstr "" "PrintableType.register(float)\n" "PrintableType.register(str)" -#: ../../whatsnew/2.6.rst:1220 +#: ../../whatsnew/2.6.rst:1230 msgid "" "Classes should obey the semantics specified by an ABC, but Python can't " "check this; it's up to the class author to understand the ABC's requirements " "and to implement the code accordingly." msgstr "" -#: ../../whatsnew/2.6.rst:1224 +#: ../../whatsnew/2.6.rst:1234 msgid "" "To check whether an object supports a particular interface, you can now " "write::" msgstr "" -#: ../../whatsnew/2.6.rst:1227 +#: ../../whatsnew/2.6.rst:1237 msgid "" "def func(d):\n" " if not isinstance(d, collections.MutableMapping):\n" @@ -1937,7 +1943,7 @@ msgstr "" " if not isinstance(d, collections.MutableMapping):\n" " raise ValueError(\"Mapping object expected, not %r\" % d)" -#: ../../whatsnew/2.6.rst:1231 +#: ../../whatsnew/2.6.rst:1241 msgid "" "Don't feel that you must now begin writing lots of checks as in the above " "example. Python has a strong tradition of duck-typing, where explicit type-" @@ -1947,13 +1953,13 @@ msgid "" "necessary." msgstr "" -#: ../../whatsnew/2.6.rst:1238 +#: ../../whatsnew/2.6.rst:1248 msgid "" "You can write your own ABCs by using ``abc.ABCMeta`` as the metaclass in a " "class definition::" msgstr "" -#: ../../whatsnew/2.6.rst:1241 +#: ../../whatsnew/2.6.rst:1251 msgid "" "from abc import ABCMeta, abstractmethod\n" "\n" @@ -1989,27 +1995,26 @@ msgstr "" " def draw(self, x, y, scale):\n" " ..." -#: ../../whatsnew/2.6.rst:1259 +#: ../../whatsnew/2.6.rst:1269 msgid "" -"In the :class:`Drawable` ABC above, the :meth:`draw_doubled` method renders " -"the object at twice its size and can be implemented in terms of other " -"methods described in :class:`Drawable`. Classes implementing this ABC " -"therefore don't need to provide their own implementation " -"of :meth:`draw_doubled`, though they can do so. An implementation " -"of :meth:`draw` is necessary, though; the ABC can't provide a useful generic " -"implementation." +"In the :class:`!Drawable` ABC above, the :meth:`!draw_doubled` method " +"renders the object at twice its size and can be implemented in terms of " +"other methods described in :class:`!Drawable`. Classes implementing this " +"ABC therefore don't need to provide their own implementation of :meth:`!" +"draw_doubled`, though they can do so. An implementation of :meth:`!draw` is " +"necessary, though; the ABC can't provide a useful generic implementation." msgstr "" -#: ../../whatsnew/2.6.rst:1267 +#: ../../whatsnew/2.6.rst:1277 msgid "" -"You can apply the ``@abstractmethod`` decorator to methods such " -"as :meth:`draw` that must be implemented; Python will then raise an " -"exception for classes that don't define the method. Note that the exception " -"is only raised when you actually try to create an instance of a subclass " -"lacking the method::" +"You can apply the :deco:`~abc.abstractmethod` decorator to methods such as :" +"meth:`!draw` that must be implemented; Python will then raise an exception " +"for classes that don't define the method. Note that the exception is only " +"raised when you actually try to create an instance of a subclass lacking the " +"method::" msgstr "" -#: ../../whatsnew/2.6.rst:1273 +#: ../../whatsnew/2.6.rst:1283 msgid "" ">>> class Circle(Drawable):\n" "... pass\n" @@ -2031,13 +2036,13 @@ msgstr "" "draw\n" ">>>" -#: ../../whatsnew/2.6.rst:1282 +#: ../../whatsnew/2.6.rst:1292 msgid "" "Abstract data attributes can be declared using the ``@abstractproperty`` " "decorator::" msgstr "" -#: ../../whatsnew/2.6.rst:1285 +#: ../../whatsnew/2.6.rst:1295 msgid "" "from abc import abstractproperty\n" "...\n" @@ -2053,38 +2058,38 @@ msgstr "" "def readonly(self):\n" " return self._x" -#: ../../whatsnew/2.6.rst:1292 -msgid "Subclasses must then define a :meth:`readonly` property." +#: ../../whatsnew/2.6.rst:1302 +msgid "Subclasses must then define a ``readonly`` property." msgstr "" -#: ../../whatsnew/2.6.rst:1296 +#: ../../whatsnew/2.6.rst:1306 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../whatsnew/2.6.rst:1297 +#: ../../whatsnew/2.6.rst:1307 msgid "" "PEP written by Guido van Rossum and Talin. Implemented by Guido van Rossum. " "Backported to 2.6 by Benjamin Aranguren, with Alex Martelli." msgstr "" -#: ../../whatsnew/2.6.rst:1306 +#: ../../whatsnew/2.6.rst:1316 msgid "PEP 3127: Integer Literal Support and Syntax" msgstr "" -#: ../../whatsnew/2.6.rst:1308 +#: ../../whatsnew/2.6.rst:1318 msgid "" "Python 3.0 changes the syntax for octal (base-8) integer literals, prefixing " "them with \"0o\" or \"0O\" instead of a leading zero, and adds support for " "binary (base-2) integer literals, signalled by a \"0b\" or \"0B\" prefix." msgstr "" -#: ../../whatsnew/2.6.rst:1313 +#: ../../whatsnew/2.6.rst:1323 msgid "" "Python 2.6 doesn't drop support for a leading 0 signalling an octal number, " "but it does add support for \"0o\" and \"0b\"::" msgstr "" -#: ../../whatsnew/2.6.rst:1316 +#: ../../whatsnew/2.6.rst:1326 msgid "" ">>> 0o21, 2*8 + 1\n" "(17, 17)\n" @@ -2096,14 +2101,14 @@ msgstr "" ">>> 0b101111\n" "47" -#: ../../whatsnew/2.6.rst:1321 +#: ../../whatsnew/2.6.rst:1331 msgid "" "The :func:`oct` builtin still returns numbers prefixed with a leading zero, " "and a new :func:`bin` builtin returns the binary representation for a " "number::" msgstr "" -#: ../../whatsnew/2.6.rst:1325 +#: ../../whatsnew/2.6.rst:1335 msgid "" ">>> oct(42)\n" "'052'\n" @@ -2119,7 +2124,7 @@ msgstr "" ">>> bin(173)\n" "'0b10101101'" -#: ../../whatsnew/2.6.rst:1332 +#: ../../whatsnew/2.6.rst:1342 msgid "" "The :func:`int` and :func:`long` builtins will now accept the \"0o\" and " "\"0b\" prefixes when base-8 or base-2 are requested, or when the *base* " @@ -2127,7 +2132,7 @@ msgid "" "the string)::" msgstr "" -#: ../../whatsnew/2.6.rst:1337 +#: ../../whatsnew/2.6.rst:1347 msgid "" ">>> int ('0o52', 0)\n" "42\n" @@ -2147,25 +2152,25 @@ msgstr "" ">>> int('0b1101', 0)\n" "13" -#: ../../whatsnew/2.6.rst:1349 +#: ../../whatsnew/2.6.rst:1359 msgid ":pep:`3127` - Integer Literal Support and Syntax" msgstr "" -#: ../../whatsnew/2.6.rst:1350 +#: ../../whatsnew/2.6.rst:1360 msgid "PEP written by Patrick Maupin; backported to 2.6 by Eric Smith." msgstr "" -#: ../../whatsnew/2.6.rst:1358 +#: ../../whatsnew/2.6.rst:1368 msgid "PEP 3129: Class Decorators" msgstr "" -#: ../../whatsnew/2.6.rst:1360 +#: ../../whatsnew/2.6.rst:1370 msgid "" "Decorators have been extended from functions to classes. It's now legal to " "write::" msgstr "" -#: ../../whatsnew/2.6.rst:1363 +#: ../../whatsnew/2.6.rst:1373 msgid "" "@foo\n" "@bar\n" @@ -2177,11 +2182,11 @@ msgstr "" "class A:\n" " pass" -#: ../../whatsnew/2.6.rst:1368 +#: ../../whatsnew/2.6.rst:1378 msgid "This is equivalent to::" msgstr "這等價於: ::" -#: ../../whatsnew/2.6.rst:1370 +#: ../../whatsnew/2.6.rst:1380 msgid "" "class A:\n" " pass\n" @@ -2193,33 +2198,33 @@ msgstr "" "\n" "A = foo(bar(A))" -#: ../../whatsnew/2.6.rst:1377 +#: ../../whatsnew/2.6.rst:1387 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../whatsnew/2.6.rst:1378 +#: ../../whatsnew/2.6.rst:1388 msgid "PEP written by Collin Winter." msgstr "由 Collin Winter 撰寫 PEP。" -#: ../../whatsnew/2.6.rst:1385 +#: ../../whatsnew/2.6.rst:1395 msgid "PEP 3141: A Type Hierarchy for Numbers" msgstr "" -#: ../../whatsnew/2.6.rst:1387 +#: ../../whatsnew/2.6.rst:1397 msgid "" "Python 3.0 adds several abstract base classes for numeric types inspired by " -"Scheme's numeric tower. These classes were backported to 2.6 as " -"the :mod:`numbers` module." +"Scheme's numeric tower. These classes were backported to 2.6 as the :mod:" +"`numbers` module." msgstr "" -#: ../../whatsnew/2.6.rst:1391 +#: ../../whatsnew/2.6.rst:1401 msgid "" "The most general ABC is :class:`Number`. It defines no operations at all, " "and only exists to allow checking if an object is a number by doing " "``isinstance(obj, Number)``." msgstr "" -#: ../../whatsnew/2.6.rst:1395 +#: ../../whatsnew/2.6.rst:1405 msgid "" ":class:`Complex` is a subclass of :class:`Number`. Complex numbers can " "undergo the basic operations of addition, subtraction, multiplication, " @@ -2228,23 +2233,23 @@ msgid "" "implementation of :class:`Complex`." msgstr "" -#: ../../whatsnew/2.6.rst:1401 +#: ../../whatsnew/2.6.rst:1411 msgid "" ":class:`Real` further derives from :class:`Complex`, and adds operations " "that only work on real numbers: :func:`floor`, :func:`trunc`, rounding, " "taking the remainder mod N, floor division, and comparisons." msgstr "" -#: ../../whatsnew/2.6.rst:1406 +#: ../../whatsnew/2.6.rst:1416 msgid "" ":class:`Rational` numbers derive from :class:`Real`, have :attr:`numerator` " "and :attr:`denominator` properties, and can be converted to floats. Python " -"2.6 adds a simple rational-number class, :class:`Fraction`, in " -"the :mod:`fractions` module. (It's called :class:`Fraction` instead " -"of :class:`Rational` to avoid a name clash with :class:`numbers.Rational`.)" +"2.6 adds a simple rational-number class, :class:`Fraction`, in the :mod:" +"`fractions` module. (It's called :class:`Fraction` instead of :class:" +"`Rational` to avoid a name clash with :class:`numbers.Rational`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1413 +#: ../../whatsnew/2.6.rst:1423 msgid "" ":class:`Integral` numbers derive from :class:`Rational`, and can be shifted " "left and right with ``<<`` and ``>>``, combined using bitwise operations " @@ -2252,41 +2257,41 @@ msgid "" "boundaries." msgstr "" -#: ../../whatsnew/2.6.rst:1418 +#: ../../whatsnew/2.6.rst:1428 msgid "" -"In Python 3.0, the PEP slightly redefines the existing " -"builtins :func:`round`, :func:`math.floor`, :func:`math.ceil`, and adds a " -"new one, :func:`math.trunc`, that's been backported to Python " -"2.6. :func:`math.trunc` rounds toward zero, returning the " -"closest :class:`Integral` that's between the function's argument and zero." +"In Python 3.0, the PEP slightly redefines the existing builtins :func:" +"`round`, :func:`math.floor`, :func:`math.ceil`, and adds a new one, :func:" +"`math.trunc`, that's been backported to Python 2.6. :func:`math.trunc` " +"rounds toward zero, returning the closest :class:`Integral` that's between " +"the function's argument and zero." msgstr "" -#: ../../whatsnew/2.6.rst:1426 +#: ../../whatsnew/2.6.rst:1436 msgid ":pep:`3141` - A Type Hierarchy for Numbers" msgstr "" -#: ../../whatsnew/2.6.rst:1427 +#: ../../whatsnew/2.6.rst:1437 msgid "PEP written by Jeffrey Yasskin." msgstr "由 Jeffrey Yasskin 撰寫 PEP。" -#: ../../whatsnew/2.6.rst:1429 +#: ../../whatsnew/2.6.rst:1439 msgid "" "`Scheme's numerical tower `__, from the Guile manual." msgstr "" -#: ../../whatsnew/2.6.rst:1431 +#: ../../whatsnew/2.6.rst:1441 msgid "" "`Scheme's number datatypes `__ from the R5RS " "Scheme specification." msgstr "" -#: ../../whatsnew/2.6.rst:1435 +#: ../../whatsnew/2.6.rst:1445 msgid "The :mod:`fractions` Module" msgstr "" -#: ../../whatsnew/2.6.rst:1437 +#: ../../whatsnew/2.6.rst:1447 msgid "" "To fill out the hierarchy of numeric types, the :mod:`fractions` module " "provides a rational-number class. Rational numbers store their values as a " @@ -2294,13 +2299,13 @@ msgid "" "numbers such as ``2/3`` that floating-point numbers can only approximate." msgstr "" -#: ../../whatsnew/2.6.rst:1443 +#: ../../whatsnew/2.6.rst:1453 msgid "" "The :class:`Fraction` constructor takes two :class:`Integral` values that " "will be the numerator and denominator of the resulting fraction. ::" msgstr "" -#: ../../whatsnew/2.6.rst:1446 +#: ../../whatsnew/2.6.rst:1456 msgid "" ">>> from fractions import Fraction\n" ">>> a = Fraction(2, 3)\n" @@ -2322,14 +2327,14 @@ msgstr "" ">>> a/b\n" "Fraction(5, 3)" -#: ../../whatsnew/2.6.rst:1456 +#: ../../whatsnew/2.6.rst:1466 msgid "" "For converting floating-point numbers to rationals, the float type now has " "an :meth:`as_integer_ratio` method that returns the numerator and " "denominator for a fraction that evaluates to the same floating-point value::" msgstr "" -#: ../../whatsnew/2.6.rst:1461 +#: ../../whatsnew/2.6.rst:1471 msgid "" ">>> (2.5) .as_integer_ratio()\n" "(5, 2)\n" @@ -2345,29 +2350,29 @@ msgstr "" ">>> (1./3) .as_integer_ratio()\n" "(6004799503160661L, 18014398509481984L)" -#: ../../whatsnew/2.6.rst:1468 +#: ../../whatsnew/2.6.rst:1478 msgid "" "Note that values that can only be approximated by floating-point numbers, " "such as 1./3, are not simplified to the number being approximated; the " "fraction attempts to match the floating-point value **exactly**." msgstr "" -#: ../../whatsnew/2.6.rst:1473 +#: ../../whatsnew/2.6.rst:1483 msgid "" "The :mod:`fractions` module is based upon an implementation by Sjoerd " "Mullender that was in Python's :file:`Demo/classes/` directory for a long " "time. This implementation was significantly updated by Jeffrey Yasskin." msgstr "" -#: ../../whatsnew/2.6.rst:1480 +#: ../../whatsnew/2.6.rst:1490 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/2.6.rst:1482 +#: ../../whatsnew/2.6.rst:1492 msgid "Some smaller changes made to the core Python language are:" msgstr "" -#: ../../whatsnew/2.6.rst:1484 +#: ../../whatsnew/2.6.rst:1494 msgid "" "Directories and zip archives containing a :file:`__main__.py` file can now " "be executed directly by passing their name to the interpreter. The directory " @@ -2376,25 +2381,25 @@ msgid "" "J. Eby and Nick Coghlan; :issue:`1739468`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1491 +#: ../../whatsnew/2.6.rst:1501 msgid "" "The :func:`hasattr` function was catching and ignoring all errors, under the " "assumption that they meant a :meth:`__getattr__` method was failing somehow " "and the return value of :func:`hasattr` would therefore be ``False``. This " -"logic shouldn't be applied to :exc:`KeyboardInterrupt` " -"and :exc:`SystemExit`, however; Python 2.6 will no longer discard such " -"exceptions when :func:`hasattr` encounters them. (Fixed by Benjamin " -"Peterson; :issue:`2196`.)" +"logic shouldn't be applied to :exc:`KeyboardInterrupt` and :exc:" +"`SystemExit`, however; Python 2.6 will no longer discard such exceptions " +"when :func:`hasattr` encounters them. (Fixed by Benjamin Peterson; :issue:" +"`2196`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1499 +#: ../../whatsnew/2.6.rst:1509 msgid "" "When calling a function using the ``**`` syntax to provide keyword " "arguments, you are no longer required to use a Python dictionary; any " "mapping will now work::" msgstr "" -#: ../../whatsnew/2.6.rst:1503 +#: ../../whatsnew/2.6.rst:1513 msgid "" ">>> def f(**kw):\n" "... print sorted(kw)\n" @@ -2414,17 +2419,17 @@ msgstr "" ">>> f(**ud)\n" "['a', 'b']" -#: ../../whatsnew/2.6.rst:1512 +#: ../../whatsnew/2.6.rst:1522 msgid "(Contributed by Alexander Belopolsky; :issue:`1686487`.)" msgstr "(由 Alexander Belopolsky 所貢獻;:issue:`1686487`。)" -#: ../../whatsnew/2.6.rst:1514 +#: ../../whatsnew/2.6.rst:1524 msgid "" "It's also become legal to provide keyword arguments after a ``*args`` " "argument to a function call. ::" msgstr "" -#: ../../whatsnew/2.6.rst:1517 +#: ../../whatsnew/2.6.rst:1527 msgid "" ">>> def f(*args, **kw):\n" "... print args, kw\n" @@ -2438,29 +2443,28 @@ msgstr "" ">>> f(1,2,3, *(4,5,6), keyword=13)\n" "(1, 2, 3, 4, 5, 6) {'keyword': 13}" -#: ../../whatsnew/2.6.rst:1523 +#: ../../whatsnew/2.6.rst:1533 msgid "" "Previously this would have been a syntax error. (Contributed by Amaury " "Forgeot d'Arc; :issue:`3473`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1526 +#: ../../whatsnew/2.6.rst:1536 msgid "" "A new builtin, ``next(iterator, [default])`` returns the next item from the " "specified iterator. If the *default* argument is supplied, it will be " -"returned if *iterator* has been exhausted; otherwise, " -"the :exc:`StopIteration` exception will be raised. (Backported " -"in :issue:`2719`.)" +"returned if *iterator* has been exhausted; otherwise, the :exc:" +"`StopIteration` exception will be raised. (Backported in :issue:`2719`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1532 +#: ../../whatsnew/2.6.rst:1542 msgid "" "Tuples now have :meth:`~tuple.index` and :meth:`~tuple.count` methods " "matching the list type's :meth:`~list.index` and :meth:`~list.count` " "methods::" msgstr "" -#: ../../whatsnew/2.6.rst:1535 +#: ../../whatsnew/2.6.rst:1545 msgid "" ">>> t = (0,1,2,3,4,0,1,2)\n" ">>> t.index(3)\n" @@ -2469,11 +2473,11 @@ msgid "" "2" msgstr "" -#: ../../whatsnew/2.6.rst:1541 +#: ../../whatsnew/2.6.rst:1551 msgid "(Contributed by Raymond Hettinger)" msgstr "(由 Raymond Hettinger 所貢獻。)" -#: ../../whatsnew/2.6.rst:1543 +#: ../../whatsnew/2.6.rst:1553 msgid "" "The built-in types now have improved support for extended slicing syntax, " "accepting various combinations of ``(start, stop, step)``. Previously, the " @@ -2481,15 +2485,15 @@ msgid "" "Thomas Wouters.)" msgstr "" -#: ../../whatsnew/2.6.rst:1550 +#: ../../whatsnew/2.6.rst:1560 msgid "" -"Properties now have three attributes, :attr:`getter`, :attr:`setter` " -"and :attr:`deleter`, that are decorators providing useful shortcuts for " -"adding a getter, setter or deleter function to an existing property. You " -"would use them like this::" +"Properties now have three attributes, :attr:`getter`, :attr:`setter` and :" +"attr:`deleter`, that are decorators providing useful shortcuts for adding a " +"getter, setter or deleter function to an existing property. You would use " +"them like this::" msgstr "" -#: ../../whatsnew/2.6.rst:1555 +#: ../../whatsnew/2.6.rst:1565 msgid "" "class C(object):\n" " @property\n" @@ -2535,14 +2539,14 @@ msgstr "" " def x(self, value):\n" " self._x = value / 2" -#: ../../whatsnew/2.6.rst:1577 +#: ../../whatsnew/2.6.rst:1587 msgid "" -"Several methods of the built-in set types now accept multiple " -"iterables: :meth:`intersection`, :meth:`intersection_update`, :meth:`union`, :meth:`update`, :meth:`difference` " -"and :meth:`difference_update`." +"Several methods of the built-in set types now accept multiple iterables: :" +"meth:`intersection`, :meth:`intersection_update`, :meth:`union`, :meth:" +"`update`, :meth:`difference` and :meth:`difference_update`." msgstr "" -#: ../../whatsnew/2.6.rst:1585 +#: ../../whatsnew/2.6.rst:1595 msgid "" ">>> s=set('1234567890')\n" ">>> s.intersection('abc123', 'cdf246') # Intersection between all inputs\n" @@ -2551,28 +2555,28 @@ msgid "" "set(['1', '0', '3', '5'])" msgstr "" -#: ../../whatsnew/2.6.rst:1591 ../../whatsnew/2.6.rst:1876 -#: ../../whatsnew/2.6.rst:1897 +#: ../../whatsnew/2.6.rst:1601 ../../whatsnew/2.6.rst:1886 +#: ../../whatsnew/2.6.rst:1907 msgid "(Contributed by Raymond Hettinger.)" msgstr "(由 Raymond Hettinger 所貢獻。)" -#: ../../whatsnew/2.6.rst:1593 +#: ../../whatsnew/2.6.rst:1603 msgid "" "Many floating-point features were added. The :func:`float` function will " "now turn the string ``nan`` into an IEEE 754 Not A Number value, and " "``+inf`` and ``-inf`` into positive or negative infinity. This works on any " -"platform with IEEE 754 semantics. (Contributed by Christian " -"Heimes; :issue:`1635`.)" +"platform with IEEE 754 semantics. (Contributed by Christian Heimes; :issue:" +"`1635`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1599 +#: ../../whatsnew/2.6.rst:1609 msgid "" "Other functions in the :mod:`math` module, :func:`isinf` and :func:`isnan`, " -"return true if their floating-point argument is infinite or Not A Number. " -"(:issue:`1640`)" +"return true if their floating-point argument is infinite or Not A Number. (:" +"issue:`1640`)" msgstr "" -#: ../../whatsnew/2.6.rst:1603 +#: ../../whatsnew/2.6.rst:1613 msgid "" "Conversion functions were added to convert floating-point numbers into " "hexadecimal strings (:issue:`3008`). These functions convert floats to and " @@ -2582,7 +2586,7 @@ msgid "" "converts a string back into a number::" msgstr "" -#: ../../whatsnew/2.6.rst:1611 +#: ../../whatsnew/2.6.rst:1621 msgid "" ">>> a = 3.75\n" ">>> a.hex()\n" @@ -2602,7 +2606,7 @@ msgstr "" ">>> b.hex()\n" "'0x1.5555555555555p-2'" -#: ../../whatsnew/2.6.rst:1620 +#: ../../whatsnew/2.6.rst:1630 msgid "" "A numerical nicety: when creating a complex number from two floats on " "systems that support signed zeros (-0 and +0), the :func:`complex` " @@ -2610,7 +2614,7 @@ msgid "" "Dickinson; :issue:`1507`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1625 +#: ../../whatsnew/2.6.rst:1635 msgid "" "Classes that inherit a :meth:`__hash__` method from a parent class can set " "``__hash__ = None`` to indicate that the class isn't hashable. This will " @@ -2618,19 +2622,19 @@ msgid "" "indicated as implementing the :class:`Hashable` ABC." msgstr "" -#: ../../whatsnew/2.6.rst:1631 +#: ../../whatsnew/2.6.rst:1641 msgid "" "You should do this when you've defined a :meth:`__cmp__` or :meth:`__eq__` " "method that compares objects by their value rather than by identity. All " "objects have a default hash method that uses ``id(obj)`` as the hash value. " "There's no tidy way to remove the :meth:`__hash__` method inherited from a " "parent class, so assigning ``None`` was implemented as an override. At the " -"C level, extensions can set ``tp_hash`` " -"to :c:func:`PyObject_HashNotImplemented`. (Fixed by Nick Coghlan and Amaury " -"Forgeot d'Arc; :issue:`2235`.)" +"C level, extensions can set ``tp_hash`` to :c:func:" +"`PyObject_HashNotImplemented`. (Fixed by Nick Coghlan and Amaury Forgeot " +"d'Arc; :issue:`2235`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1641 +#: ../../whatsnew/2.6.rst:1651 msgid "" "The :exc:`GeneratorExit` exception now subclasses :exc:`BaseException` " "instead of :exc:`Exception`. This means that an exception handler that does " @@ -2638,76 +2642,76 @@ msgid "" "(Contributed by Chad Austin; :issue:`1537`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1647 +#: ../../whatsnew/2.6.rst:1657 msgid "" "Generator objects now have a :attr:`gi_code` attribute that refers to the " -"original code object backing the generator. (Contributed by Collin " -"Winter; :issue:`1473257`.)" +"original code object backing the generator. (Contributed by Collin Winter; :" +"issue:`1473257`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1651 +#: ../../whatsnew/2.6.rst:1661 msgid "" "The :func:`compile` built-in function now accepts keyword arguments as well " "as positional parameters. (Contributed by Thomas Wouters; :issue:`1444529`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1655 +#: ../../whatsnew/2.6.rst:1665 msgid "" "The :func:`complex` constructor now accepts strings containing parenthesized " "complex numbers, meaning that ``complex(repr(cplx))`` will now round-trip " -"values. For example, ``complex('(3+4j)')`` now returns the value (3+4j). " -"(:issue:`1491866`)" +"values. For example, ``complex('(3+4j)')`` now returns the value (3+4j). (:" +"issue:`1491866`)" msgstr "" -#: ../../whatsnew/2.6.rst:1660 +#: ../../whatsnew/2.6.rst:1670 msgid "" "The string :meth:`translate` method now accepts ``None`` as the translation " "table parameter, which is treated as the identity transformation. This " "makes it easier to carry out operations that only delete characters. " -"(Contributed by Bengt Richter and implemented by Raymond " -"Hettinger; :issue:`1193128`.)" +"(Contributed by Bengt Richter and implemented by Raymond Hettinger; :issue:" +"`1193128`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1666 +#: ../../whatsnew/2.6.rst:1676 msgid "" "The built-in :func:`dir` function now checks for a :meth:`__dir__` method on " "the objects it receives. This method must return a list of strings " "containing the names of valid attributes for the object, and lets the object " -"control the value that :func:`dir` produces. Objects that " -"have :meth:`__getattr__` or :meth:`__getattribute__` methods can use this to " -"advertise pseudo-attributes they will honor. (:issue:`1591665`)" +"control the value that :func:`dir` produces. Objects that have :meth:" +"`__getattr__` or :meth:`__getattribute__` methods can use this to advertise " +"pseudo-attributes they will honor. (:issue:`1591665`)" msgstr "" -#: ../../whatsnew/2.6.rst:1674 +#: ../../whatsnew/2.6.rst:1684 msgid "" "Instance method objects have new attributes for the object and function " -"comprising the method; the new synonym for :attr:`!im_self` " -"is :attr:`~method.__self__`, and :attr:`!im_func` is also available " -"as :attr:`~method.__func__`. The old names are still supported in Python " -"2.6, but are gone in 3.0." +"comprising the method; the new synonym for :attr:`!im_self` is :attr:" +"`~method.__self__`, and :attr:`!im_func` is also available as :attr:`~method." +"__func__`. The old names are still supported in Python 2.6, but are gone in " +"3.0." msgstr "" -#: ../../whatsnew/2.6.rst:1680 +#: ../../whatsnew/2.6.rst:1690 msgid "" -"An obscure change: when you use the :func:`locals` function inside " -"a :keyword:`class` statement, the resulting dictionary no longer returns " -"free variables. (Free variables, in this case, are variables referenced in " -"the :keyword:`!class` statement that aren't attributes of the class.)" +"An obscure change: when you use the :func:`locals` function inside a :" +"keyword:`class` statement, the resulting dictionary no longer returns free " +"variables. (Free variables, in this case, are variables referenced in the :" +"keyword:`!class` statement that aren't attributes of the class.)" msgstr "" -#: ../../whatsnew/2.6.rst:1689 +#: ../../whatsnew/2.6.rst:1699 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/2.6.rst:1691 +#: ../../whatsnew/2.6.rst:1701 msgid "" "The :mod:`warnings` module has been rewritten in C. This makes it possible " "to invoke warnings from the parser, and may also make the interpreter's " -"startup faster. (Contributed by Neal Norwitz and Brett " -"Cannon; :issue:`1631171`.)" +"startup faster. (Contributed by Neal Norwitz and Brett Cannon; :issue:" +"`1631171`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1696 +#: ../../whatsnew/2.6.rst:1706 msgid "" "Type objects now have a cache of methods that can reduce the work required " "to find the correct method implementation for a particular class; once " @@ -2718,7 +2722,7 @@ msgid "" "updated for Python 2.6 by Kevin Jacobs; :issue:`1700288`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1706 +#: ../../whatsnew/2.6.rst:1716 msgid "" "By default, this change is only applied to types that are included with the " "Python core. Extension modules may not necessarily be compatible with this " @@ -2730,7 +2734,7 @@ msgid "" "interpreter to determine that. See :issue:`1878` for some discussion.)" msgstr "" -#: ../../whatsnew/2.6.rst:1717 +#: ../../whatsnew/2.6.rst:1727 msgid "" "Function calls that use keyword arguments are significantly faster by doing " "a quick pointer comparison, usually saving the time of a full string " @@ -2738,46 +2742,46 @@ msgid "" "implementation by Antoine Pitrou; :issue:`1819`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1722 +#: ../../whatsnew/2.6.rst:1732 msgid "" "All of the functions in the :mod:`struct` module have been rewritten in C, " "thanks to work at the Need For Speed sprint. (Contributed by Raymond " "Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1726 +#: ../../whatsnew/2.6.rst:1736 msgid "" "Some of the standard built-in types now set a bit in their type objects. " "This speeds up checking whether an object is a subclass of one of these " "types. (Contributed by Neal Norwitz.)" msgstr "" -#: ../../whatsnew/2.6.rst:1730 +#: ../../whatsnew/2.6.rst:1740 msgid "" "Unicode strings now use faster code for detecting whitespace and line " -"breaks; this speeds up the :meth:`split` method by about 25% " -"and :meth:`splitlines` by 35%. (Contributed by Antoine Pitrou.) Memory " -"usage is reduced by using pymalloc for the Unicode string's data." +"breaks; this speeds up the :meth:`split` method by about 25% and :meth:" +"`splitlines` by 35%. (Contributed by Antoine Pitrou.) Memory usage is " +"reduced by using pymalloc for the Unicode string's data." msgstr "" -#: ../../whatsnew/2.6.rst:1736 +#: ../../whatsnew/2.6.rst:1746 msgid "" "The ``with`` statement now stores the :meth:`~object.__exit__` method on the " "stack, producing a small speedup. (Implemented by Jeffrey Yasskin.)" msgstr "" -#: ../../whatsnew/2.6.rst:1739 +#: ../../whatsnew/2.6.rst:1749 msgid "" "To reduce memory usage, the garbage collector will now clear internal free " "lists when garbage-collecting the highest generation of objects. This may " "return memory to the operating system sooner." msgstr "" -#: ../../whatsnew/2.6.rst:1748 +#: ../../whatsnew/2.6.rst:1758 msgid "Interpreter Changes" msgstr "" -#: ../../whatsnew/2.6.rst:1750 +#: ../../whatsnew/2.6.rst:1760 msgid "" "Two command-line options have been reserved for use by other Python " "implementations. The :option:`!-J` switch has been reserved for use by " @@ -2788,7 +2792,7 @@ msgid "" "the option isn't currently used." msgstr "" -#: ../../whatsnew/2.6.rst:1758 +#: ../../whatsnew/2.6.rst:1768 msgid "" "Python can now be prevented from writing :file:`.pyc` or :file:`.pyo` files " "by supplying the :option:`-B` switch to the Python interpreter, or by " @@ -2799,7 +2803,7 @@ msgid "" "and Georg Brandl.)" msgstr "" -#: ../../whatsnew/2.6.rst:1766 +#: ../../whatsnew/2.6.rst:1776 msgid "" "The encoding used for standard input, output, and standard error can be " "specified by setting the :envvar:`PYTHONIOENCODING` environment variable " @@ -2811,11 +2815,11 @@ msgid "" "\"replace\". (Contributed by Martin von Löwis.)" msgstr "" -#: ../../whatsnew/2.6.rst:1779 +#: ../../whatsnew/2.6.rst:1789 msgid "New and Improved Modules" msgstr "" -#: ../../whatsnew/2.6.rst:1781 +#: ../../whatsnew/2.6.rst:1791 msgid "" "As in every release, Python's standard library received a number of " "enhancements and bug fixes. Here's a partial list of the most notable " @@ -2824,14 +2828,14 @@ msgid "" "the Subversion logs for all the details." msgstr "" -#: ../../whatsnew/2.6.rst:1787 +#: ../../whatsnew/2.6.rst:1797 msgid "" "The :mod:`!asyncore` and :mod:`!asynchat` modules are being actively " "maintained again, and a number of patches and bugfixes were applied. " "(Maintained by Josiah Carlson; see :issue:`1736190` for one patch.)" msgstr "" -#: ../../whatsnew/2.6.rst:1792 +#: ../../whatsnew/2.6.rst:1802 msgid "" "The :mod:`bsddb` module also has a new maintainer, Jesús Cea Avión, and the " "package is now available as a standalone package. The web page for the " @@ -2841,14 +2845,14 @@ msgid "" "frequent than Python's." msgstr "" -#: ../../whatsnew/2.6.rst:1800 +#: ../../whatsnew/2.6.rst:1810 msgid "" "The :mod:`bsddb.dbshelve` module now uses the highest pickling protocol " "available, instead of restricting itself to protocol 1. (Contributed by W. " "Barnes.)" msgstr "" -#: ../../whatsnew/2.6.rst:1804 +#: ../../whatsnew/2.6.rst:1814 msgid "" "The :mod:`!cgi` module will now read variables from the query string of an " "HTTP POST request. This makes it possible to use form actions with URLs " @@ -2856,80 +2860,80 @@ msgid "" "(Contributed by Alexandre Fiori and Nubis; :issue:`1817`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1810 +#: ../../whatsnew/2.6.rst:1820 msgid "" "The :func:`parse_qs` and :func:`parse_qsl` functions have been relocated " "from the :mod:`!cgi` module to the :mod:`urlparse ` module. " -"The versions still available in the :mod:`!cgi` module will " -"trigger :exc:`PendingDeprecationWarning` messages in 2.6 (:issue:`600362`)." +"The versions still available in the :mod:`!cgi` module will trigger :exc:" +"`PendingDeprecationWarning` messages in 2.6 (:issue:`600362`)." msgstr "" -#: ../../whatsnew/2.6.rst:1816 +#: ../../whatsnew/2.6.rst:1826 msgid "" "The :mod:`cmath` module underwent extensive revision, contributed by Mark " "Dickinson and Christian Heimes. Five new functions were added:" msgstr "" -#: ../../whatsnew/2.6.rst:1820 +#: ../../whatsnew/2.6.rst:1830 msgid "" ":func:`polar` converts a complex number to polar form, returning the modulus " "and argument of the complex number." msgstr "" -#: ../../whatsnew/2.6.rst:1823 +#: ../../whatsnew/2.6.rst:1833 msgid "" ":func:`rect` does the opposite, turning a modulus, argument pair back into " "the corresponding complex number." msgstr "" -#: ../../whatsnew/2.6.rst:1826 +#: ../../whatsnew/2.6.rst:1836 msgid "" ":func:`phase` returns the argument (also called the angle) of a complex " "number." msgstr "" -#: ../../whatsnew/2.6.rst:1829 +#: ../../whatsnew/2.6.rst:1839 msgid "" ":func:`isnan` returns True if either the real or imaginary part of its " "argument is a NaN." msgstr "" -#: ../../whatsnew/2.6.rst:1832 +#: ../../whatsnew/2.6.rst:1842 msgid "" ":func:`isinf` returns True if either the real or imaginary part of its " "argument is infinite." msgstr "" -#: ../../whatsnew/2.6.rst:1835 +#: ../../whatsnew/2.6.rst:1845 msgid "" "The revisions also improved the numerical soundness of the :mod:`cmath` " "module. For all functions, the real and imaginary parts of the results are " "accurate to within a few units of least precision (ulps) whenever possible. " -"See :issue:`1381` for the details. The branch cuts " -"for :func:`asinh`, :func:`atanh`: and :func:`atan` have also been corrected." +"See :issue:`1381` for the details. The branch cuts for :func:`asinh`, :func:" +"`atanh`: and :func:`atan` have also been corrected." msgstr "" -#: ../../whatsnew/2.6.rst:1842 +#: ../../whatsnew/2.6.rst:1852 msgid "" "The tests for the module have been greatly expanded; nearly 2000 new test " "cases exercise the algebraic functions." msgstr "" -#: ../../whatsnew/2.6.rst:1845 +#: ../../whatsnew/2.6.rst:1855 msgid "" "On IEEE 754 platforms, the :mod:`cmath` module now handles IEEE 754 special " "values and floating-point exceptions in a manner consistent with Annex 'G' " "of the C99 standard." msgstr "" -#: ../../whatsnew/2.6.rst:1849 +#: ../../whatsnew/2.6.rst:1859 msgid "" "A new data type in the :mod:`collections` module: ``namedtuple(typename, " "fieldnames)`` is a factory function that creates subclasses of the standard " "tuple whose fields are accessible by name as well as index. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:1853 +#: ../../whatsnew/2.6.rst:1863 msgid "" ">>> var_type = collections.namedtuple('variable',\n" "... 'id name type size')\n" @@ -2950,15 +2954,15 @@ msgid "" "variable(id=1, name='amplitude', type='int', size=4)" msgstr "" -#: ../../whatsnew/2.6.rst:1871 +#: ../../whatsnew/2.6.rst:1881 msgid "" "Several places in the standard library that returned tuples have been " -"modified to return :func:`namedtuple` instances. For example, " -"the :meth:`Decimal.as_tuple` method now returns a named tuple " -"with :attr:`sign`, :attr:`digits`, and :attr:`exponent` fields." +"modified to return :func:`namedtuple` instances. For example, the :meth:" +"`Decimal.as_tuple` method now returns a named tuple with :attr:`sign`, :attr:" +"`digits`, and :attr:`exponent` fields." msgstr "" -#: ../../whatsnew/2.6.rst:1878 +#: ../../whatsnew/2.6.rst:1888 msgid "" "Another change to the :mod:`collections` module is that the :class:`deque` " "type now supports an optional *maxlen* parameter; if supplied, the deque's " @@ -2966,7 +2970,7 @@ msgid "" "to a full deque causes old items to be discarded." msgstr "" -#: ../../whatsnew/2.6.rst:1886 +#: ../../whatsnew/2.6.rst:1896 msgid "" ">>> from collections import deque\n" ">>> dq=deque(maxlen=3)\n" @@ -2990,46 +2994,46 @@ msgstr "" ">>> dq\n" "deque([2, 3, 4], maxlen=3)" -#: ../../whatsnew/2.6.rst:1899 +#: ../../whatsnew/2.6.rst:1909 msgid "" "The :mod:`Cookie ` module's :class:`~http.cookies.Morsel` " "objects now support an :attr:`~http.cookies.Morsel.httponly` attribute. In " "some browsers. cookies with this attribute set cannot be accessed or " -"manipulated by JavaScript code. (Contributed by Arvin " -"Schnell; :issue:`1638033`.)" +"manipulated by JavaScript code. (Contributed by Arvin Schnell; :issue:" +"`1638033`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1904 +#: ../../whatsnew/2.6.rst:1914 msgid "" "A new window method in the :mod:`curses` module, :meth:`chgat`, changes the " "display attributes for a certain number of characters on a single line. " "(Contributed by Fabian Kreutz.)" msgstr "" -#: ../../whatsnew/2.6.rst:1910 +#: ../../whatsnew/2.6.rst:1920 msgid "" "# Boldface text starting at y=0,x=21\n" "# and affecting the rest of the line.\n" "stdscr.chgat(0, 21, curses.A_BOLD)" msgstr "" -#: ../../whatsnew/2.6.rst:1914 +#: ../../whatsnew/2.6.rst:1924 msgid "" "The :class:`Textbox` class in the :mod:`curses.textpad` module now supports " "editing in insert mode as well as overwrite mode. Insert mode is enabled by " -"supplying a true value for the *insert_mode* parameter when creating " -"the :class:`Textbox` instance." +"supplying a true value for the *insert_mode* parameter when creating the :" +"class:`Textbox` instance." msgstr "" -#: ../../whatsnew/2.6.rst:1919 +#: ../../whatsnew/2.6.rst:1929 msgid "" "The :mod:`datetime` module's :meth:`strftime` methods now support a ``%f`` " "format code that expands to the number of microseconds in the object, zero-" -"padded on the left to six places. (Contributed by Skip " -"Montanaro; :issue:`1158`.)" +"padded on the left to six places. (Contributed by Skip Montanaro; :issue:" +"`1158`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1924 +#: ../../whatsnew/2.6.rst:1934 msgid "" "The :mod:`decimal` module was updated to version 1.66 of `the General " "Decimal Specification `__. " @@ -3037,7 +3041,7 @@ msgid "" "as :meth:`exp` and :meth:`log10`::" msgstr "" -#: ../../whatsnew/2.6.rst:1929 +#: ../../whatsnew/2.6.rst:1939 msgid "" ">>> Decimal(1).exp()\n" "Decimal(\"2.718281828459045235360287471\")\n" @@ -3053,46 +3057,45 @@ msgstr "" ">>> Decimal(1000).log10()\n" "Decimal(\"3\")" -#: ../../whatsnew/2.6.rst:1936 +#: ../../whatsnew/2.6.rst:1946 msgid "" "The :meth:`as_tuple` method of :class:`Decimal` objects now returns a named " "tuple with :attr:`sign`, :attr:`digits`, and :attr:`exponent` fields." msgstr "" -#: ../../whatsnew/2.6.rst:1939 +#: ../../whatsnew/2.6.rst:1949 msgid "" "(Implemented by Facundo Batista and Mark Dickinson. Named tuple support " "added by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1942 +#: ../../whatsnew/2.6.rst:1952 msgid "" "The :mod:`difflib` module's :class:`SequenceMatcher` class now returns named " "tuples representing matches, with :attr:`a`, :attr:`b`, and :attr:`size` " "attributes. (Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1947 +#: ../../whatsnew/2.6.rst:1957 msgid "" "An optional ``timeout`` parameter, specifying a timeout measured in seconds, " -"was added to the :class:`ftplib.FTP` class constructor as well as " -"the :meth:`connect` method. (Added by Facundo Batista.) Also, " -"the :class:`FTP` class's :meth:`storbinary` and :meth:`storlines` now take " -"an optional *callback* parameter that will be called with each block of data " -"after the data has been sent. (Contributed by Phil " -"Schwartz; :issue:`1221598`.)" +"was added to the :class:`ftplib.FTP` class constructor as well as the :meth:" +"`connect` method. (Added by Facundo Batista.) Also, the :class:`FTP` " +"class's :meth:`storbinary` and :meth:`storlines` now take an optional " +"*callback* parameter that will be called with each block of data after the " +"data has been sent. (Contributed by Phil Schwartz; :issue:`1221598`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1955 +#: ../../whatsnew/2.6.rst:1965 msgid "" -"The :func:`reduce` built-in function is also available in " -"the :mod:`functools` module. In Python 3.0, the builtin has been dropped " -"and :func:`reduce` is only available from :mod:`functools`; currently there " -"are no plans to drop the builtin in the 2.x series. (Patched by Christian " -"Heimes; :issue:`1739906`.)" +"The :func:`reduce` built-in function is also available in the :mod:" +"`functools` module. In Python 3.0, the builtin has been dropped and :func:" +"`reduce` is only available from :mod:`functools`; currently there are no " +"plans to drop the builtin in the 2.x series. (Patched by Christian Heimes; :" +"issue:`1739906`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1961 +#: ../../whatsnew/2.6.rst:1971 msgid "" "When possible, the :mod:`getpass` module will now use :file:`/dev/tty` to " "print a prompt message and read the password, falling back to standard error " @@ -3101,14 +3104,14 @@ msgid "" "P. Smith.)" msgstr "" -#: ../../whatsnew/2.6.rst:1967 +#: ../../whatsnew/2.6.rst:1977 msgid "" "The :func:`glob.glob` function can now return Unicode filenames if a Unicode " -"path was used and Unicode filenames are matched within the directory. " -"(:issue:`1001604`)" +"path was used and Unicode filenames are matched within the directory. (:" +"issue:`1001604`)" msgstr "" -#: ../../whatsnew/2.6.rst:1971 +#: ../../whatsnew/2.6.rst:1981 msgid "" "A new function in the :mod:`heapq` module, ``merge(iter1, iter2, ...)``, " "takes any number of iterables returning data in sorted order, and returns a " @@ -3116,7 +3119,7 @@ msgid "" "order. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:1976 +#: ../../whatsnew/2.6.rst:1986 msgid "" ">>> list(heapq.merge([1, 3, 5, 9], [2, 8, 16]))\n" "[1, 2, 3, 5, 8, 9, 16]" @@ -3124,31 +3127,30 @@ msgstr "" ">>> list(heapq.merge([1, 3, 5, 9], [2, 8, 16]))\n" "[1, 2, 3, 5, 8, 9, 16]" -#: ../../whatsnew/2.6.rst:1979 +#: ../../whatsnew/2.6.rst:1989 msgid "" "Another new function, ``heappushpop(heap, item)``, pushes *item* onto " "*heap*, then pops off and returns the smallest item. This is more efficient " "than making a call to :func:`heappush` and then :func:`heappop`." msgstr "" -#: ../../whatsnew/2.6.rst:1984 +#: ../../whatsnew/2.6.rst:1994 msgid "" ":mod:`heapq` is now implemented to only use less-than comparison, instead of " -"the less-than-or-equal comparison it previously used. This " -"makes :mod:`heapq`'s usage of a type match the :meth:`list.sort` method. " -"(Contributed by Raymond Hettinger.)" +"the less-than-or-equal comparison it previously used. This makes :mod:" +"`heapq`'s usage of a type match the :meth:`list.sort` method. (Contributed " +"by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1990 +#: ../../whatsnew/2.6.rst:2000 msgid "" "An optional ``timeout`` parameter, specifying a timeout measured in seconds, " -"was added to the :class:`httplib.HTTPConnection " -"` and :class:`HTTPSConnection " -"` class constructors. (Added by Facundo " -"Batista.)" +"was added to the :class:`httplib.HTTPConnection ` and :class:`HTTPSConnection ` " +"class constructors. (Added by Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:1995 +#: ../../whatsnew/2.6.rst:2005 msgid "" "Most of the :mod:`inspect` module's functions, such as :func:`getmoduleinfo` " "and :func:`getargs`, now return named tuples. In addition to behaving like " @@ -3156,25 +3158,24 @@ msgid "" "attributes. (Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2001 +#: ../../whatsnew/2.6.rst:2011 msgid "" -"Some new functions in the module " -"include :func:`isgenerator`, :func:`isgeneratorfunction`, " -"and :func:`isabstract`." +"Some new functions in the module include :func:`isgenerator`, :func:" +"`isgeneratorfunction`, and :func:`isabstract`." msgstr "" -#: ../../whatsnew/2.6.rst:2005 +#: ../../whatsnew/2.6.rst:2015 msgid "The :mod:`itertools` module gained several new functions." msgstr "" -#: ../../whatsnew/2.6.rst:2007 +#: ../../whatsnew/2.6.rst:2017 msgid "" "``izip_longest(iter1, iter2, ...[, fillvalue])`` makes tuples from each of " "the elements; if some of the iterables are shorter than others, the missing " "values are set to *fillvalue*. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:2011 +#: ../../whatsnew/2.6.rst:2021 msgid "" ">>> tuple(itertools.izip_longest([1,2,3], [1,2,3,4,5]))\n" "((1, 1), (2, 2), (3, 3), (None, 4), (None, 5))" @@ -3182,14 +3183,14 @@ msgstr "" ">>> tuple(itertools.izip_longest([1,2,3], [1,2,3,4,5]))\n" "((1, 1), (2, 2), (3, 3), (None, 4), (None, 5))" -#: ../../whatsnew/2.6.rst:2014 +#: ../../whatsnew/2.6.rst:2024 msgid "" "``product(iter1, iter2, ..., [repeat=N])`` returns the Cartesian product of " "the supplied iterables, a set of tuples containing every possible " "combination of the elements returned from each iterable. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2018 +#: ../../whatsnew/2.6.rst:2028 msgid "" ">>> list(itertools.product([1,2,3], [4,5,6]))\n" "[(1, 4), (1, 5), (1, 6),\n" @@ -3201,14 +3202,14 @@ msgstr "" " (2, 4), (2, 5), (2, 6),\n" " (3, 4), (3, 5), (3, 6)]" -#: ../../whatsnew/2.6.rst:2023 +#: ../../whatsnew/2.6.rst:2033 msgid "" "The optional *repeat* keyword argument is used for taking the product of an " "iterable or a set of iterables with themselves, repeated *N* times. With a " "single iterable argument, *N*-tuples are returned::" msgstr "" -#: ../../whatsnew/2.6.rst:2028 +#: ../../whatsnew/2.6.rst:2038 msgid "" ">>> list(itertools.product([1,2], repeat=3))\n" "[(1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2),\n" @@ -3218,11 +3219,11 @@ msgstr "" "[(1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2),\n" " (2, 1, 1), (2, 1, 2), (2, 2, 1), (2, 2, 2)]" -#: ../../whatsnew/2.6.rst:2032 +#: ../../whatsnew/2.6.rst:2042 msgid "With two iterables, *2N*-tuples are returned. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2034 +#: ../../whatsnew/2.6.rst:2044 msgid "" ">>> list(itertools.product([1,2], [3,4], repeat=2))\n" "[(1, 3, 1, 3), (1, 3, 1, 4), (1, 3, 2, 3), (1, 3, 2, 4),\n" @@ -3236,13 +3237,13 @@ msgstr "" " (2, 3, 1, 3), (2, 3, 1, 4), (2, 3, 2, 3), (2, 3, 2, 4),\n" " (2, 4, 1, 3), (2, 4, 1, 4), (2, 4, 2, 3), (2, 4, 2, 4)]" -#: ../../whatsnew/2.6.rst:2040 +#: ../../whatsnew/2.6.rst:2050 msgid "" "``combinations(iterable, r)`` returns sub-sequences of length *r* from the " "elements of *iterable*. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2043 +#: ../../whatsnew/2.6.rst:2053 msgid "" ">>> list(itertools.combinations('123', 2))\n" "[('1', '2'), ('1', '3'), ('2', '3')]\n" @@ -3260,14 +3261,14 @@ msgstr "" "[('1', '2', '3'), ('1', '2', '4'),\n" " ('1', '3', '4'), ('2', '3', '4')]" -#: ../../whatsnew/2.6.rst:2051 +#: ../../whatsnew/2.6.rst:2061 msgid "" "``permutations(iter[, r])`` returns all the permutations of length *r* of " "the iterable's elements. If *r* is not specified, it will default to the " "number of elements produced by the iterable. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2055 +#: ../../whatsnew/2.6.rst:2065 msgid "" ">>> list(itertools.permutations([1,2,3,4], 2))\n" "[(1, 2), (1, 3), (1, 4),\n" @@ -3281,17 +3282,16 @@ msgstr "" " (3, 1), (3, 2), (3, 4),\n" " (4, 1), (4, 2), (4, 3)]" -#: ../../whatsnew/2.6.rst:2061 +#: ../../whatsnew/2.6.rst:2071 msgid "" "``itertools.chain(*iterables)`` is an existing function in :mod:`itertools` " -"that gained a new constructor in Python 2.6. " -"``itertools.chain.from_iterable(iterable)`` takes a single iterable that " -"should return other iterables. :func:`chain` will then return all the " -"elements of the first iterable, then all the elements of the second, and so " -"on. ::" +"that gained a new constructor in Python 2.6. ``itertools.chain." +"from_iterable(iterable)`` takes a single iterable that should return other " +"iterables. :func:`chain` will then return all the elements of the first " +"iterable, then all the elements of the second, and so on. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2068 +#: ../../whatsnew/2.6.rst:2078 msgid "" ">>> list(itertools.chain.from_iterable([[1,2,3], [4,5,6]]))\n" "[1, 2, 3, 4, 5, 6]" @@ -3299,83 +3299,81 @@ msgstr "" ">>> list(itertools.chain.from_iterable([[1,2,3], [4,5,6]]))\n" "[1, 2, 3, 4, 5, 6]" -#: ../../whatsnew/2.6.rst:2071 +#: ../../whatsnew/2.6.rst:2081 msgid "(All contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2073 +#: ../../whatsnew/2.6.rst:2083 msgid "" -"The :mod:`logging` module's :class:`FileHandler` class and its " -"subclasses :class:`WatchedFileHandler`, :class:`RotatingFileHandler`, " -"and :class:`TimedRotatingFileHandler` now have an optional *delay* parameter " -"to their constructors. If *delay* is true, opening of the log file is " -"deferred until the first :meth:`emit` call is made. (Contributed by Vinay " -"Sajip.)" +"The :mod:`logging` module's :class:`FileHandler` class and its subclasses :" +"class:`WatchedFileHandler`, :class:`RotatingFileHandler`, and :class:" +"`TimedRotatingFileHandler` now have an optional *delay* parameter to their " +"constructors. If *delay* is true, opening of the log file is deferred until " +"the first :meth:`emit` call is made. (Contributed by Vinay Sajip.)" msgstr "" -#: ../../whatsnew/2.6.rst:2080 +#: ../../whatsnew/2.6.rst:2090 msgid "" ":class:`TimedRotatingFileHandler` also has a *utc* constructor parameter. " "If the argument is true, UTC time will be used in determining when midnight " "occurs and in generating filenames; otherwise local time will be used." msgstr "" -#: ../../whatsnew/2.6.rst:2085 +#: ../../whatsnew/2.6.rst:2095 msgid "Several new functions were added to the :mod:`math` module:" msgstr "" -#: ../../whatsnew/2.6.rst:2087 +#: ../../whatsnew/2.6.rst:2097 msgid "" ":func:`~math.isinf` and :func:`~math.isnan` determine whether a given float " "is a (positive or negative) infinity or a NaN (Not a Number), respectively." msgstr "" -#: ../../whatsnew/2.6.rst:2090 +#: ../../whatsnew/2.6.rst:2100 msgid "" ":func:`~math.copysign` copies the sign bit of an IEEE 754 number, returning " "the absolute value of *x* combined with the sign bit of *y*. For example, " "``math.copysign(1, -0.0)`` returns -1.0. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2095 +#: ../../whatsnew/2.6.rst:2105 msgid "" ":func:`~math.factorial` computes the factorial of a number. (Contributed by " "Raymond Hettinger; :issue:`2138`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2098 +#: ../../whatsnew/2.6.rst:2108 msgid "" ":func:`~math.fsum` adds up the stream of numbers from an iterable, and is " "careful to avoid loss of precision through using partial sums. (Contributed " "by Jean Brouwers, Raymond Hettinger, and Mark Dickinson; :issue:`2819`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2103 +#: ../../whatsnew/2.6.rst:2113 msgid "" ":func:`~math.acosh`, :func:`~math.asinh` and :func:`~math.atanh` compute the " "inverse hyperbolic functions." msgstr "" -#: ../../whatsnew/2.6.rst:2106 +#: ../../whatsnew/2.6.rst:2116 msgid ":func:`~math.log1p` returns the natural logarithm of *1+x* (base *e*)." msgstr "" -#: ../../whatsnew/2.6.rst:2109 +#: ../../whatsnew/2.6.rst:2119 msgid "" -":func:`trunc` rounds a number toward zero, returning the " -"closest :class:`Integral` that's between the function's argument and zero. " -"Added as part of the backport of `PEP 3141's type hierarchy for numbers " -"<#pep-3141>`__." +":func:`trunc` rounds a number toward zero, returning the closest :class:" +"`Integral` that's between the function's argument and zero. Added as part of " +"the backport of `PEP 3141's type hierarchy for numbers <#pep-3141>`__." msgstr "" -#: ../../whatsnew/2.6.rst:2114 +#: ../../whatsnew/2.6.rst:2124 msgid "" "The :mod:`math` module has been improved to give more consistent behaviour " "across platforms, especially with respect to handling of floating-point " "exceptions and IEEE 754 special values." msgstr "" -#: ../../whatsnew/2.6.rst:2118 +#: ../../whatsnew/2.6.rst:2128 msgid "" "Whenever possible, the module follows the recommendations of the C99 " "standard about 754's special values. For example, ``sqrt(-1.)`` should now " @@ -3383,15 +3381,15 @@ msgid "" "``sqrt(float('NaN'))`` should return a NaN on all IEEE 754 platforms. Where " "Annex 'F' of the C99 standard recommends signaling 'divide-by-zero' or " "'invalid', Python will raise :exc:`ValueError`. Where Annex 'F' of the C99 " -"standard recommends signaling 'overflow', Python will " -"raise :exc:`OverflowError`. (See :issue:`711019` and :issue:`1640`.)" +"standard recommends signaling 'overflow', Python will raise :exc:" +"`OverflowError`. (See :issue:`711019` and :issue:`1640`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2128 +#: ../../whatsnew/2.6.rst:2138 msgid "(Contributed by Christian Heimes and Mark Dickinson.)" msgstr "(由 Christian Heimes 和 Mark Dickinson 所貢獻。)" -#: ../../whatsnew/2.6.rst:2130 +#: ../../whatsnew/2.6.rst:2140 msgid "" ":class:`~mmap.mmap` objects now have a :meth:`rfind` method that searches " "for a substring beginning at the end of the string and searching backwards. " @@ -3399,14 +3397,14 @@ msgid "" "which to stop searching. (Contributed by John Lenton.)" msgstr "" -#: ../../whatsnew/2.6.rst:2136 +#: ../../whatsnew/2.6.rst:2146 msgid "" "The :mod:`operator` module gained a :func:`methodcaller` function that takes " "a name and an optional set of arguments, returning a callable that will call " "the named function on any arguments passed to it. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:2141 +#: ../../whatsnew/2.6.rst:2151 msgid "" ">>> # Equivalent to lambda s: s.replace('old', 'new')\n" ">>> replacer = operator.methodcaller('replace', 'old', 'new')\n" @@ -3414,17 +3412,17 @@ msgid "" "'new wine in new bottles'" msgstr "" -#: ../../whatsnew/2.6.rst:2146 +#: ../../whatsnew/2.6.rst:2156 msgid "(Contributed by Georg Brandl, after a suggestion by Gregory Petrosyan.)" msgstr "(經 Gregory Petrosyan 建議後由 Georg Brandl 所貢獻。)" -#: ../../whatsnew/2.6.rst:2148 +#: ../../whatsnew/2.6.rst:2158 msgid "" "The :func:`attrgetter` function now accepts dotted names and performs the " "corresponding attribute lookups::" msgstr "" -#: ../../whatsnew/2.6.rst:2151 +#: ../../whatsnew/2.6.rst:2161 msgid "" ">>> inst_name = operator.attrgetter(\n" "... '__class__.__name__')\n" @@ -3440,11 +3438,11 @@ msgstr "" ">>> inst_name(help)\n" "'_Helper'" -#: ../../whatsnew/2.6.rst:2158 +#: ../../whatsnew/2.6.rst:2168 msgid "(Contributed by Georg Brandl, after a suggestion by Barry Warsaw.)" msgstr "(經 Barry Warsaw 建議後由 Georg Brandl 所貢獻。)" -#: ../../whatsnew/2.6.rst:2160 +#: ../../whatsnew/2.6.rst:2170 msgid "" "The :mod:`os` module now wraps several new system calls. ``fchmod(fd, " "mode)`` and ``fchown(fd, uid, gid)`` change the mode and ownership of an " @@ -3452,7 +3450,7 @@ msgid "" "(Contributed by Georg Brandl and Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2166 +#: ../../whatsnew/2.6.rst:2176 msgid "" ":func:`chflags` and :func:`lchflags` are wrappers for the corresponding " "system calls (where they're available), changing the flags set on a file. " @@ -3462,7 +3460,7 @@ msgid "" "the file. (Contributed by M. Levinson.)" msgstr "" -#: ../../whatsnew/2.6.rst:2174 +#: ../../whatsnew/2.6.rst:2184 msgid "" "``os.closerange(low, high)`` efficiently closes all file descriptors from " "*low* to *high*, ignoring any errors and not including *high* itself. This " @@ -3470,14 +3468,14 @@ msgid "" "processes faster. (Contributed by Georg Brandl; :issue:`1663329`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2179 +#: ../../whatsnew/2.6.rst:2189 msgid "" "The ``os.environ`` object's :meth:`clear` method will now unset the " "environment variables using :func:`os.unsetenv` in addition to clearing the " "object's keys. (Contributed by Martin Horcicka; :issue:`1181`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2183 +#: ../../whatsnew/2.6.rst:2193 msgid "" "The :func:`os.walk` function now has a ``followlinks`` parameter. If set to " "True, it will follow symlinks pointing to directories and visit the " @@ -3486,31 +3484,31 @@ msgid "" "if there's a symlink that points to a parent directory. (:issue:`1273829`)" msgstr "" -#: ../../whatsnew/2.6.rst:2190 +#: ../../whatsnew/2.6.rst:2200 msgid "" "In the :mod:`os.path` module, the :func:`splitext` function has been changed " "to not split on leading period characters. This produces better results when " "operating on Unix's dot-files. For example, ``os.path.splitext('.ipython')`` " -"now returns ``('.ipython', '')`` instead of ``('', '.ipython')``. " -"(:issue:`1115886`)" +"now returns ``('.ipython', '')`` instead of ``('', '.ipython')``. (:issue:" +"`1115886`)" msgstr "" -#: ../../whatsnew/2.6.rst:2197 +#: ../../whatsnew/2.6.rst:2207 msgid "" "A new function, ``os.path.relpath(path, start='.')``, returns a relative " "path from the ``start`` path, if it's supplied, or from the current working " -"directory to the destination ``path``. (Contributed by Richard " -"Barran; :issue:`1339796`.)" +"directory to the destination ``path``. (Contributed by Richard Barran; :" +"issue:`1339796`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2202 +#: ../../whatsnew/2.6.rst:2212 msgid "" "On Windows, :func:`os.path.expandvars` will now expand environment variables " "given in the form \"%var%\", and \"~user\" will be expanded into the user's " "home directory path. (Contributed by Josiah Carlson; :issue:`957650`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2207 +#: ../../whatsnew/2.6.rst:2217 msgid "" "The Python debugger provided by the :mod:`pdb` module gained a new command: " "\"run\" restarts the Python program being debugged and can optionally take " @@ -3518,14 +3516,14 @@ msgid "" "Bernstein; :issue:`1393667`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2212 +#: ../../whatsnew/2.6.rst:2222 msgid "" "The :func:`pdb.post_mortem` function, used to begin debugging a traceback, " "will now use the traceback returned by :func:`sys.exc_info` if no traceback " "is supplied. (Contributed by Facundo Batista; :issue:`1106316`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2217 +#: ../../whatsnew/2.6.rst:2227 msgid "" "The :mod:`pickletools` module now has an :func:`optimize` function that " "takes a string containing a pickle and removes some unused opcodes, " @@ -3533,14 +3531,14 @@ msgid "" "(Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2222 +#: ../../whatsnew/2.6.rst:2232 msgid "" "A :func:`get_data` function was added to the :mod:`pkgutil` module that " "returns the contents of resource files included with an installed Python " "package. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:2226 +#: ../../whatsnew/2.6.rst:2236 msgid "" ">>> import pkgutil\n" ">>> print pkgutil.get_data('test', 'exception_hierarchy.txt')\n" @@ -3564,18 +3562,18 @@ msgstr "" " +-- StandardError\n" " ..." -#: ../../whatsnew/2.6.rst:2237 +#: ../../whatsnew/2.6.rst:2247 msgid "(Contributed by Paul Moore; :issue:`2439`.)" msgstr "(由 Paul Moore 貢獻;:issue:`2439`。)" -#: ../../whatsnew/2.6.rst:2239 +#: ../../whatsnew/2.6.rst:2249 msgid "" -"The :mod:`pyexpat` module's :class:`Parser` objects now allow setting " -"their :attr:`buffer_size` attribute to change the size of the buffer used to " -"hold character data. (Contributed by Achim Gaedke; :issue:`1137`.)" +"The :mod:`pyexpat` module's :class:`Parser` objects now allow setting their :" +"attr:`buffer_size` attribute to change the size of the buffer used to hold " +"character data. (Contributed by Achim Gaedke; :issue:`1137`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2244 +#: ../../whatsnew/2.6.rst:2254 msgid "" "The :mod:`Queue` module now provides queue variants that retrieve entries in " "different orders. The :class:`PriorityQueue` class stores queued items in a " @@ -3584,7 +3582,7 @@ msgid "" "(Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2251 +#: ../../whatsnew/2.6.rst:2261 msgid "" "The :mod:`random` module's :class:`Random` objects can now be pickled on a " "32-bit system and unpickled on a 64-bit system, and vice versa. " @@ -3593,7 +3591,7 @@ msgid "" "(Contributed by Shawn Ligocki; :issue:`1727780`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2258 +#: ../../whatsnew/2.6.rst:2268 msgid "" "The new ``triangular(low, high, mode)`` function returns random numbers " "following a triangular distribution. The returned values are between *low* " @@ -3602,14 +3600,14 @@ msgid "" "der Laan and Raymond Hettinger; :issue:`1681432`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2265 +#: ../../whatsnew/2.6.rst:2275 msgid "" "Long regular expression searches carried out by the :mod:`re` module will " "check for signals being delivered, so time-consuming searches can now be " "interrupted. (Contributed by Josh Hoyt and Ralf Schmitt; :issue:`846388`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2270 +#: ../../whatsnew/2.6.rst:2280 msgid "" "The regular expression module is implemented by compiling bytecodes for a " "tiny regex-specific virtual machine. Untrusted code could create malicious " @@ -3618,23 +3616,22 @@ msgid "" "for Google App Engine; :issue:`3487`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2277 +#: ../../whatsnew/2.6.rst:2287 msgid "" "The :mod:`rlcompleter` module's :meth:`Completer.complete` method will now " "ignore exceptions triggered while evaluating a name. (Fixed by Lorenz " "Quack; :issue:`2250`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2281 +#: ../../whatsnew/2.6.rst:2291 msgid "" -"The :mod:`sched` module's :class:`scheduler` instances now have a read-" -"only :attr:`queue` attribute that returns the contents of the scheduler's " -"queue, represented as a list of named tuples with the fields ``(time, " -"priority, action, argument)``. (Contributed by Raymond " -"Hettinger; :issue:`1861`.)" +"The :mod:`sched` module's :class:`scheduler` instances now have a read-only :" +"attr:`queue` attribute that returns the contents of the scheduler's queue, " +"represented as a list of named tuples with the fields ``(time, priority, " +"action, argument)``. (Contributed by Raymond Hettinger; :issue:`1861`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2287 +#: ../../whatsnew/2.6.rst:2297 msgid "" "The :mod:`select` module now has wrapper functions for the Linux :c:func:`!" "epoll` and BSD :c:func:`!kqueue` system calls. :meth:`modify` method was " @@ -3644,7 +3641,7 @@ msgid "" "Heimes; :issue:`1657`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2295 +#: ../../whatsnew/2.6.rst:2305 msgid "" "The :func:`shutil.copytree` function now has an optional *ignore* argument " "that takes a callable object. This callable will receive each directory " @@ -3652,7 +3649,7 @@ msgid "" "that will be ignored, not copied." msgstr "" -#: ../../whatsnew/2.6.rst:2300 +#: ../../whatsnew/2.6.rst:2310 msgid "" "The :mod:`shutil` module also provides an :func:`ignore_patterns` function " "for use with this new parameter. :func:`ignore_patterns` takes an arbitrary " @@ -3662,7 +3659,7 @@ msgid "" "Emacs backup files, which have names ending with '~'::" msgstr "" -#: ../../whatsnew/2.6.rst:2308 +#: ../../whatsnew/2.6.rst:2318 msgid "" "shutil.copytree('Doc/library', '/tmp/library',\n" " ignore=shutil.ignore_patterns('*~', '.svn'))" @@ -3670,11 +3667,11 @@ msgstr "" "shutil.copytree('Doc/library', '/tmp/library',\n" " ignore=shutil.ignore_patterns('*~', '.svn'))" -#: ../../whatsnew/2.6.rst:2311 +#: ../../whatsnew/2.6.rst:2321 msgid "(Contributed by Tarek Ziadé; :issue:`2663`.)" msgstr "(由 Tarek Ziadé 貢獻;:issue:`2663`。)" -#: ../../whatsnew/2.6.rst:2313 +#: ../../whatsnew/2.6.rst:2323 msgid "" "Integrating signal handling with GUI handling event loops like those used by " "Tkinter or GTk+ has long been a problem; most software ends up polling, " @@ -3686,28 +3683,28 @@ msgid "" "descriptor." msgstr "" -#: ../../whatsnew/2.6.rst:2323 +#: ../../whatsnew/2.6.rst:2333 msgid "" "Event loops will use this by opening a pipe to create two descriptors, one " -"for reading and one for writing. The writable descriptor will be passed " -"to :func:`set_wakeup_fd`, and the readable descriptor will be added to the " -"list of descriptors monitored by the event loop via :c:func:`!select` " -"or :c:func:`!poll`. On receiving a signal, a byte will be written and the " -"main event loop will be woken up, avoiding the need to poll." +"for reading and one for writing. The writable descriptor will be passed to :" +"func:`set_wakeup_fd`, and the readable descriptor will be added to the list " +"of descriptors monitored by the event loop via :c:func:`!select` or :c:func:" +"`!poll`. On receiving a signal, a byte will be written and the main event " +"loop will be woken up, avoiding the need to poll." msgstr "" -#: ../../whatsnew/2.6.rst:2331 +#: ../../whatsnew/2.6.rst:2341 msgid "(Contributed by Adam Olsen; :issue:`1583`.)" msgstr "(由 Adam Olsen 貢獻;:issue:`1583`。)" -#: ../../whatsnew/2.6.rst:2333 +#: ../../whatsnew/2.6.rst:2343 msgid "" "The :func:`siginterrupt` function is now available from Python code, and " "allows changing whether signals can interrupt system calls or not. " "(Contributed by Ralf Schmitt.)" msgstr "" -#: ../../whatsnew/2.6.rst:2337 +#: ../../whatsnew/2.6.rst:2347 msgid "" "The :func:`setitimer` and :func:`getitimer` functions have also been added " "(where they're available). :func:`setitimer` allows setting interval timers " @@ -3716,7 +3713,7 @@ msgid "" "process+system time. (Contributed by Guilherme Polo; :issue:`2240`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2344 +#: ../../whatsnew/2.6.rst:2354 msgid "" "The :mod:`smtplib` module now supports SMTP over SSL thanks to the addition " "of the :class:`SMTP_SSL` class. This class supports an interface identical " @@ -3726,22 +3723,22 @@ msgid "" "seconds. (Contributed by Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:2352 +#: ../../whatsnew/2.6.rst:2362 msgid "" "An implementation of the LMTP protocol (:rfc:`2033`) was also added to the " "module. LMTP is used in place of SMTP when transferring e-mail between " -"agents that don't manage a mail queue. (LMTP implemented by Leif " -"Hedstrom; :issue:`957003`.)" +"agents that don't manage a mail queue. (LMTP implemented by Leif Hedstrom; :" +"issue:`957003`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2357 +#: ../../whatsnew/2.6.rst:2367 msgid "" ":meth:`SMTP.starttls` now complies with :rfc:`3207` and forgets any " "knowledge obtained from the server not obtained from the TLS negotiation " "itself. (Patch contributed by Bill Fenner; :issue:`829951`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2362 +#: ../../whatsnew/2.6.rst:2372 msgid "" "The :mod:`socket` module now supports TIPC (https://tipc.sourceforge.net/), " "a high-performance non-IP-based protocol designed for use in clustered " @@ -3749,7 +3746,7 @@ msgid "" "Bertogli; :issue:`1646`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2367 +#: ../../whatsnew/2.6.rst:2377 msgid "" "A new function, :func:`create_connection`, takes an address and connects to " "it using an optional timeout value, returning the connected socket object. " @@ -3759,52 +3756,51 @@ msgid "" "make your code work with IPv6." msgstr "" -#: ../../whatsnew/2.6.rst:2375 +#: ../../whatsnew/2.6.rst:2385 msgid "" "The base classes in the :mod:`SocketServer ` module now " "support calling a :meth:`~socketserver.BaseServer.handle_timeout` method " -"after a span of inactivity specified by the " -"server's :attr:`~socketserver.BaseServer.timeout` attribute. (Contributed " -"by Michael Pomraning.) The :meth:`~socketserver.BaseServer.serve_forever` " -"method now takes an optional poll interval measured in seconds, controlling " -"how often the server will check for a shutdown request. (Contributed by " -"Pedro Werneck and Jeffrey Yasskin; :issue:`742598`, :issue:`1193577`.)" +"after a span of inactivity specified by the server's :attr:`~socketserver." +"BaseServer.timeout` attribute. (Contributed by Michael Pomraning.) The :" +"meth:`~socketserver.BaseServer.serve_forever` method now takes an optional " +"poll interval measured in seconds, controlling how often the server will " +"check for a shutdown request. (Contributed by Pedro Werneck and Jeffrey " +"Yasskin; :issue:`742598`, :issue:`1193577`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2384 +#: ../../whatsnew/2.6.rst:2394 msgid "" "The :mod:`sqlite3` module, maintained by Gerhard Häring, has been updated " "from version 2.3.2 in Python 2.5 to version 2.4.1." msgstr "" -#: ../../whatsnew/2.6.rst:2388 +#: ../../whatsnew/2.6.rst:2398 msgid "" "The :mod:`struct` module now supports the C99 :c:expr:`_Bool` type, using " "the format character ``'?'``. (Contributed by David Remahl.)" msgstr "" -#: ../../whatsnew/2.6.rst:2392 +#: ../../whatsnew/2.6.rst:2402 msgid "" "The :class:`~subprocess.Popen` objects provided by the :mod:`subprocess` " -"module now " -"have :meth:`~subprocess.Popen.terminate`, :meth:`~subprocess.Popen.kill`, " -"and :meth:`~subprocess.Popen.send_signal` methods. On Windows, :meth:`!" -"send_signal` only supports the :py:const:`~signal.SIGTERM` signal, and all " -"these methods are aliases for the Win32 API function :c:func:`!" +"module now have :meth:`~subprocess.Popen.terminate`, :meth:`~subprocess." +"Popen.kill`, and :meth:`~subprocess.Popen.send_signal` methods. On Windows, :" +"meth:`!send_signal` only supports the :py:const:`~signal.SIGTERM` signal, " +"and all these methods are aliases for the Win32 API function :c:func:`!" "TerminateProcess`. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2399 +#: ../../whatsnew/2.6.rst:2409 msgid "" "A new variable in the :mod:`sys` module, :attr:`float_info`, is an object " "containing information derived from the :file:`float.h` file about the " -"platform's floating-point support. Attributes of this object " -"include :attr:`mant_dig` (number of digits in the mantissa), :attr:`epsilon` " -"(smallest difference between 1.0 and the next largest value representable), " -"and several others. (Contributed by Christian Heimes; :issue:`1534`.)" +"platform's floating-point support. Attributes of this object include :attr:" +"`mant_dig` (number of digits in the mantissa), :attr:`epsilon` (smallest " +"difference between 1.0 and the next largest value representable), and " +"several others. (Contributed by Christian Heimes; :issue:`1534`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2407 +#: ../../whatsnew/2.6.rst:2417 msgid "" "Another new variable, :attr:`dont_write_bytecode`, controls whether Python " "writes any :file:`.pyc` or :file:`.pyo` files on importing a module. If this " @@ -3816,7 +3812,7 @@ msgid "" "written or not. (Contributed by Neal Norwitz and Georg Brandl.)" msgstr "" -#: ../../whatsnew/2.6.rst:2418 +#: ../../whatsnew/2.6.rst:2428 msgid "" "Information about the command-line arguments supplied to the Python " "interpreter is available by reading attributes of a named tuple available as " @@ -3825,23 +3821,23 @@ msgid "" "These attributes are all read-only. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2426 +#: ../../whatsnew/2.6.rst:2436 msgid "" "A new function, :func:`getsizeof`, takes a Python object and returns the " "amount of memory used by the object, measured in bytes. Built-in objects " -"return correct results; third-party extensions may not, but can define " -"a :meth:`__sizeof__` method to return the object's size. (Contributed by " -"Robert Schuppenies; :issue:`2898`.)" +"return correct results; third-party extensions may not, but can define a :" +"meth:`__sizeof__` method to return the object's size. (Contributed by Robert " +"Schuppenies; :issue:`2898`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2433 +#: ../../whatsnew/2.6.rst:2443 msgid "" "It's now possible to determine the current profiler and tracer functions by " "calling :func:`sys.getprofile` and :func:`sys.gettrace`. (Contributed by " "Georg Brandl; :issue:`1648`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2437 +#: ../../whatsnew/2.6.rst:2447 msgid "" "The :mod:`tarfile` module now supports POSIX.1-2001 (pax) tarfiles in " "addition to the POSIX.1-1988 (ustar) and GNU tar formats that were already " @@ -3849,7 +3845,7 @@ msgid "" "to open a file using a different format::" msgstr "" -#: ../../whatsnew/2.6.rst:2442 +#: ../../whatsnew/2.6.rst:2452 msgid "" "tar = tarfile.open(\"output.tar\", \"w\",\n" " format=tarfile.PAX_FORMAT)" @@ -3857,7 +3853,7 @@ msgstr "" "tar = tarfile.open(\"output.tar\", \"w\",\n" " format=tarfile.PAX_FORMAT)" -#: ../../whatsnew/2.6.rst:2445 +#: ../../whatsnew/2.6.rst:2455 msgid "" "The new ``encoding`` and ``errors`` parameters specify an encoding and an " "error handling scheme for character conversions. ``'strict'``, " @@ -3867,7 +3863,7 @@ msgid "" "PAX format supports Unicode filenames, defaulting to UTF-8 encoding.)" msgstr "" -#: ../../whatsnew/2.6.rst:2453 +#: ../../whatsnew/2.6.rst:2463 msgid "" "The :meth:`TarFile.add` method now accepts an ``exclude`` argument that's a " "function that can be used to exclude certain filenames from an archive. The " @@ -3877,18 +3873,18 @@ msgid "" "added directories." msgstr "" -#: ../../whatsnew/2.6.rst:2461 +#: ../../whatsnew/2.6.rst:2471 msgid "(All changes contributed by Lars Gustäbel)." msgstr "" -#: ../../whatsnew/2.6.rst:2463 +#: ../../whatsnew/2.6.rst:2473 msgid "" -"An optional ``timeout`` parameter was added to the :class:`!" -"telnetlib.Telnet` class constructor, specifying a timeout measured in " -"seconds. (Added by Facundo Batista.)" +"An optional ``timeout`` parameter was added to the :class:`!telnetlib." +"Telnet` class constructor, specifying a timeout measured in seconds. (Added " +"by Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:2467 +#: ../../whatsnew/2.6.rst:2477 msgid "" "The :class:`tempfile.NamedTemporaryFile` class usually deletes the temporary " "file it created when the file is closed. This behaviour can now be changed " @@ -3896,7 +3892,7 @@ msgid "" "Miller; :issue:`1537850`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2472 +#: ../../whatsnew/2.6.rst:2482 msgid "" "A new class, :class:`SpooledTemporaryFile`, behaves like a temporary file " "but stores its data in memory until a maximum size is exceeded. On reaching " @@ -3904,24 +3900,23 @@ msgid "" "(Contributed by Dustin J. Mitchell.)" msgstr "" -#: ../../whatsnew/2.6.rst:2477 +#: ../../whatsnew/2.6.rst:2487 msgid "" "The :class:`NamedTemporaryFile` and :class:`SpooledTemporaryFile` classes " -"both work as context managers, so you can write ``with " -"tempfile.NamedTemporaryFile() as tmp: ...``. (Contributed by Alexander " -"Belopolsky; :issue:`2021`.)" +"both work as context managers, so you can write ``with tempfile." +"NamedTemporaryFile() as tmp: ...``. (Contributed by Alexander Belopolsky; :" +"issue:`2021`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2482 +#: ../../whatsnew/2.6.rst:2492 msgid "" "The :mod:`test.test_support ` module gained a number of " -"context managers useful for writing " -"tests. :func:`~test.support.os_helper.EnvironmentVarGuard` is a context " -"manager that temporarily changes environment variables and automatically " -"restores them to their old values." +"context managers useful for writing tests. :func:`~test.support.os_helper." +"EnvironmentVarGuard` is a context manager that temporarily changes " +"environment variables and automatically restores them to their old values." msgstr "" -#: ../../whatsnew/2.6.rst:2488 +#: ../../whatsnew/2.6.rst:2498 msgid "" "Another context manager, :class:`TransientResource`, can surround calls to " "resources that may or may not be available; it will catch and ignore a " @@ -3929,7 +3924,7 @@ msgid "" "certain failures when connecting to an external web site::" msgstr "" -#: ../../whatsnew/2.6.rst:2494 +#: ../../whatsnew/2.6.rst:2504 msgid "" "with test_support.TransientResource(IOError,\n" " errno=errno.ETIMEDOUT):\n" @@ -3941,14 +3936,14 @@ msgstr "" " f = urllib.urlopen('https://sf.net')\n" " ..." -#: ../../whatsnew/2.6.rst:2499 +#: ../../whatsnew/2.6.rst:2509 msgid "" "Finally, :func:`check_warnings` resets the :mod:`warning` module's warning " "filters and returns an object that will record all warning messages " "triggered (:issue:`3781`)::" msgstr "" -#: ../../whatsnew/2.6.rst:2503 +#: ../../whatsnew/2.6.rst:2513 msgid "" "with test_support.check_warnings() as wrec:\n" " warnings.simplefilter(\"always\")\n" @@ -3957,18 +3952,18 @@ msgid "" " assert len(wrec.warnings) == 1, \"Multiple warnings raised\"" msgstr "" -#: ../../whatsnew/2.6.rst:2509 +#: ../../whatsnew/2.6.rst:2519 msgid "(Contributed by Brett Cannon.)" msgstr "(由 Brett Cannon 貢獻。)" -#: ../../whatsnew/2.6.rst:2511 +#: ../../whatsnew/2.6.rst:2521 msgid "" "The :mod:`textwrap` module can now preserve existing whitespace at the " "beginnings and ends of the newly created lines by specifying " "``drop_whitespace=False`` as an argument::" msgstr "" -#: ../../whatsnew/2.6.rst:2516 +#: ../../whatsnew/2.6.rst:2526 msgid "" ">>> S = \"\"\"This sentence has a bunch of\n" "... extra whitespace.\"\"\"\n" @@ -3985,96 +3980,96 @@ msgid "" ">>>" msgstr "" -#: ../../whatsnew/2.6.rst:2530 +#: ../../whatsnew/2.6.rst:2540 msgid "(Contributed by Dwayne Bailey; :issue:`1581073`.)" msgstr "(由 Dwayne Bailey 貢獻;:issue:`1581073`。)" -#: ../../whatsnew/2.6.rst:2532 +#: ../../whatsnew/2.6.rst:2542 msgid "" -"The :mod:`threading` module API is being changed to use properties such " -"as :attr:`daemon` instead of :meth:`setDaemon` and :meth:`isDaemon` methods, " -"and some methods have been renamed to use underscores instead of camel-case; " -"for example, the :meth:`activeCount` method is renamed " -"to :meth:`active_count`. Both the 2.6 and 3.0 versions of the module " -"support the same properties and renamed methods, but don't remove the old " -"methods. No date has been set for the deprecation of the old APIs in Python " -"3.x; the old APIs won't be removed in any 2.x version. (Carried out by " -"several people, most notably Benjamin Peterson.)" +"The :mod:`threading` module API is being changed to use properties such as :" +"attr:`daemon` instead of :meth:`setDaemon` and :meth:`isDaemon` methods, and " +"some methods have been renamed to use underscores instead of camel-case; for " +"example, the :meth:`activeCount` method is renamed to :meth:`active_count`. " +"Both the 2.6 and 3.0 versions of the module support the same properties and " +"renamed methods, but don't remove the old methods. No date has been set for " +"the deprecation of the old APIs in Python 3.x; the old APIs won't be removed " +"in any 2.x version. (Carried out by several people, most notably Benjamin " +"Peterson.)" msgstr "" -#: ../../whatsnew/2.6.rst:2543 +#: ../../whatsnew/2.6.rst:2553 msgid "" -"The :mod:`threading` module's :class:`Thread` objects gained " -"an :attr:`ident` property that returns the thread's identifier, a nonzero " -"integer. (Contributed by Gregory P. Smith; :issue:`2871`.)" +"The :mod:`threading` module's :class:`Thread` objects gained an :attr:" +"`ident` property that returns the thread's identifier, a nonzero integer. " +"(Contributed by Gregory P. Smith; :issue:`2871`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2548 +#: ../../whatsnew/2.6.rst:2558 msgid "" "The :mod:`timeit` module now accepts callables as well as strings for the " "statement being timed and for the setup code. Two convenience functions were " "added for creating :class:`Timer` instances: ``repeat(stmt, setup, time, " "repeat, number)`` and ``timeit(stmt, setup, time, number)`` create an " -"instance and call the corresponding method. (Contributed by Erik " -"Demaine; :issue:`1533909`.)" +"instance and call the corresponding method. (Contributed by Erik Demaine; :" +"issue:`1533909`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2557 +#: ../../whatsnew/2.6.rst:2567 msgid "" "The :mod:`Tkinter` module now accepts lists and tuples for options, " "separating the elements by spaces before passing the resulting value to Tcl/" "Tk. (Contributed by Guilherme Polo; :issue:`2906`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2562 +#: ../../whatsnew/2.6.rst:2572 msgid "" "The :mod:`turtle` module for turtle graphics was greatly enhanced by Gregor " "Lingl. New features in the module include:" msgstr "" -#: ../../whatsnew/2.6.rst:2565 +#: ../../whatsnew/2.6.rst:2575 msgid "Better animation of turtle movement and rotation." msgstr "" -#: ../../whatsnew/2.6.rst:2566 +#: ../../whatsnew/2.6.rst:2576 msgid "" "Control over turtle movement using the new :meth:`delay`, :meth:`tracer`, " "and :meth:`speed` methods." msgstr "" -#: ../../whatsnew/2.6.rst:2568 +#: ../../whatsnew/2.6.rst:2578 msgid "" "The ability to set new shapes for the turtle, and to define a new coordinate " "system." msgstr "" -#: ../../whatsnew/2.6.rst:2570 +#: ../../whatsnew/2.6.rst:2580 msgid "Turtles now have an :meth:`undo` method that can roll back actions." msgstr "" -#: ../../whatsnew/2.6.rst:2571 +#: ../../whatsnew/2.6.rst:2581 msgid "" "Simple support for reacting to input events such as mouse and keyboard " "activity, making it possible to write simple games." msgstr "" -#: ../../whatsnew/2.6.rst:2573 +#: ../../whatsnew/2.6.rst:2583 msgid "" "A :file:`turtle.cfg` file can be used to customize the starting appearance " "of the turtle's screen." msgstr "" -#: ../../whatsnew/2.6.rst:2575 +#: ../../whatsnew/2.6.rst:2585 msgid "" "The module's docstrings can be replaced by new docstrings that have been " "translated into another language." msgstr "" -#: ../../whatsnew/2.6.rst:2578 +#: ../../whatsnew/2.6.rst:2588 msgid "(:issue:`1513695`)" msgstr "(:issue:`1513695`)" -#: ../../whatsnew/2.6.rst:2580 +#: ../../whatsnew/2.6.rst:2590 msgid "" "An optional ``timeout`` parameter was added to the :func:`urllib.urlopen " "` function and the :class:`urllib.ftpwrapper` class " @@ -4083,7 +4078,7 @@ msgid "" "example::" msgstr "" -#: ../../whatsnew/2.6.rst:2586 +#: ../../whatsnew/2.6.rst:2596 msgid "" ">>> u = urllib2.urlopen(\"http://slow.example.com\",\n" " timeout=3)\n" @@ -4099,17 +4094,17 @@ msgstr "" "urllib2.URLError: \n" ">>>" -#: ../../whatsnew/2.6.rst:2593 +#: ../../whatsnew/2.6.rst:2603 msgid "(Added by Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:2595 +#: ../../whatsnew/2.6.rst:2605 msgid "" "The Unicode database provided by the :mod:`unicodedata` module has been " "updated to version 5.1.0. (Updated by Martin von Löwis; :issue:`3811`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2599 +#: ../../whatsnew/2.6.rst:2609 msgid "" "The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning` " "gained an optional *line* argument that can be used to supply the line of " @@ -4117,26 +4112,26 @@ msgid "" "of the :mod:`warnings` module in C code.)" msgstr "" -#: ../../whatsnew/2.6.rst:2604 +#: ../../whatsnew/2.6.rst:2614 msgid "" "A new function, :func:`catch_warnings`, is a context manager intended for " "testing purposes that lets you temporarily modify the warning filters and " "then restore their original values (:issue:`3781`)." msgstr "" -#: ../../whatsnew/2.6.rst:2608 +#: ../../whatsnew/2.6.rst:2618 msgid "" -"The XML-RPC :class:`SimpleXMLRPCServer ` " -"and :class:`DocXMLRPCServer ` classes can now be prevented " -"from immediately opening and binding to their socket by passing ``False`` as " -"the *bind_and_activate* constructor parameter. This can be used to modify " -"the instance's :attr:`allow_reuse_address` attribute before calling " -"the :meth:`server_bind` and :meth:`server_activate` methods to open the " -"socket and begin listening for connections. (Contributed by Peter " -"Parente; :issue:`1599845`.)" +"The XML-RPC :class:`SimpleXMLRPCServer ` and :class:" +"`DocXMLRPCServer ` classes can now be prevented from " +"immediately opening and binding to their socket by passing ``False`` as the " +"*bind_and_activate* constructor parameter. This can be used to modify the " +"instance's :attr:`allow_reuse_address` attribute before calling the :meth:" +"`server_bind` and :meth:`server_activate` methods to open the socket and " +"begin listening for connections. (Contributed by Peter Parente; :issue:" +"`1599845`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2617 +#: ../../whatsnew/2.6.rst:2627 msgid "" ":class:`SimpleXMLRPCServer` also has a :attr:`_send_traceback_header` " "attribute; if true, the exception and formatted traceback are returned as " @@ -4147,27 +4142,27 @@ msgid "" "Code 2007.)" msgstr "" -#: ../../whatsnew/2.6.rst:2625 +#: ../../whatsnew/2.6.rst:2635 msgid "" "The :mod:`xmlrpclib ` module no longer automatically " -"converts :class:`datetime.date` and :class:`datetime.time` to " -"the :class:`xmlrpclib.DateTime ` type; the " -"conversion semantics were not necessarily correct for all applications. " -"Code using :mod:`!xmlrpclib` should convert :class:`date` " -"and :class:`~datetime.time` instances. (:issue:`1330538`) The code can also " -"handle dates before 1900 (contributed by Ralf Schmitt; :issue:`2014`) and 64-" -"bit integers represented by using ```` in XML-RPC responses (contributed " -"by Riku Lindblad; :issue:`2985`)." +"converts :class:`datetime.date` and :class:`datetime.time` to the :class:" +"`xmlrpclib.DateTime ` type; the conversion semantics " +"were not necessarily correct for all applications. Code using :mod:`!" +"xmlrpclib` should convert :class:`date` and :class:`~datetime.time` " +"instances. (:issue:`1330538`) The code can also handle dates before 1900 " +"(contributed by Ralf Schmitt; :issue:`2014`) and 64-bit integers represented " +"by using ```` in XML-RPC responses (contributed by Riku Lindblad; :issue:" +"`2985`)." msgstr "" -#: ../../whatsnew/2.6.rst:2635 +#: ../../whatsnew/2.6.rst:2645 msgid "" "The :mod:`zipfile` module's :class:`ZipFile` class now has :meth:`extract` " "and :meth:`extractall` methods that will unpack a single file or all the " "files in the archive to the current directory, or to a specified directory::" msgstr "" -#: ../../whatsnew/2.6.rst:2640 +#: ../../whatsnew/2.6.rst:2650 msgid "" "z = zipfile.ZipFile('python-251.zip')\n" "\n" @@ -4179,11 +4174,11 @@ msgid "" "z.extractall()" msgstr "" -#: ../../whatsnew/2.6.rst:2649 +#: ../../whatsnew/2.6.rst:2659 msgid "(Contributed by Alan McIntyre; :issue:`467924`.)" msgstr "(由 Alan McIntyre 貢獻;:issue:`467924`。)" -#: ../../whatsnew/2.6.rst:2651 +#: ../../whatsnew/2.6.rst:2661 msgid "" "The :meth:`open`, :meth:`read` and :meth:`extract` methods can now take " "either a filename or a :class:`ZipInfo` object. This is useful when an " @@ -4191,17 +4186,17 @@ msgid "" "Horler; :issue:`1775025`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2656 +#: ../../whatsnew/2.6.rst:2666 msgid "" "Finally, :mod:`zipfile` now supports using Unicode filenames for archived " "files. (Contributed by Alexey Borzenkov; :issue:`1734346`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2663 +#: ../../whatsnew/2.6.rst:2673 msgid "The :mod:`ast` module" msgstr ":mod:`ast` 模組" -#: ../../whatsnew/2.6.rst:2665 +#: ../../whatsnew/2.6.rst:2675 msgid "" "The :mod:`ast` module provides an Abstract Syntax Tree representation of " "Python code, and Armin Ronacher contributed a set of helper functions that " @@ -4209,14 +4204,13 @@ msgid "" "packages, code analyzers, and similar tools that process Python code." msgstr "" -#: ../../whatsnew/2.6.rst:2672 +#: ../../whatsnew/2.6.rst:2682 msgid "" -"The :func:`parse` function takes an expression and returns an AST. " -"The :func:`dump` function outputs a representation of a tree, suitable for " -"debugging::" +"The :func:`parse` function takes an expression and returns an AST. The :func:" +"`dump` function outputs a representation of a tree, suitable for debugging::" msgstr "" -#: ../../whatsnew/2.6.rst:2676 +#: ../../whatsnew/2.6.rst:2686 msgid "" "import ast\n" "\n" @@ -4238,11 +4232,11 @@ msgstr "" "\"\"\")\n" "print ast.dump(t)" -#: ../../whatsnew/2.6.rst:2686 +#: ../../whatsnew/2.6.rst:2696 msgid "This outputs a deeply nested tree::" msgstr "" -#: ../../whatsnew/2.6.rst:2688 +#: ../../whatsnew/2.6.rst:2698 msgid "" "Module(body=[\n" " Assign(targets=[\n" @@ -4306,7 +4300,7 @@ msgstr "" " ], nl=True)\n" " ])" -#: ../../whatsnew/2.6.rst:2719 +#: ../../whatsnew/2.6.rst:2729 msgid "" "The :func:`literal_eval` method takes a string or an AST representing a " "literal expression, parses and evaluates it, and returns the resulting " @@ -4316,7 +4310,7 @@ msgid "" "an :func:`eval` call, :func:`literal_eval` will handle it safely::" msgstr "" -#: ../../whatsnew/2.6.rst:2727 +#: ../../whatsnew/2.6.rst:2737 msgid "" ">>> literal = '(\"a\", \"b\", {2:4, 3:8, 1:2})'\n" ">>> print ast.literal_eval(literal)\n" @@ -4334,56 +4328,57 @@ msgstr "" " ...\n" "ValueError: malformed string" -#: ../../whatsnew/2.6.rst:2735 +#: ../../whatsnew/2.6.rst:2745 msgid "" "The module also includes :class:`NodeVisitor` and :class:`NodeTransformer` " "classes for traversing and modifying an AST, and functions for common " "transformations such as changing line numbers." msgstr "" -#: ../../whatsnew/2.6.rst:2743 -msgid "The :mod:`future_builtins` module" +#: ../../whatsnew/2.6.rst:2753 +#, fuzzy +msgid "The :mod:`!future_builtins` module" msgstr ":mod:`future_builtins` 模組" -#: ../../whatsnew/2.6.rst:2745 +#: ../../whatsnew/2.6.rst:2755 msgid "" "Python 3.0 makes many changes to the repertoire of built-in functions, and " "most of the changes can't be introduced in the Python 2.x series because " -"they would break compatibility. The :mod:`future_builtins` module provides " +"they would break compatibility. The :mod:`!future_builtins` module provides " "versions of these built-in functions that can be imported when writing 3.0-" "compatible code." msgstr "" -#: ../../whatsnew/2.6.rst:2752 +#: ../../whatsnew/2.6.rst:2762 msgid "The functions in this module currently include:" msgstr "" -#: ../../whatsnew/2.6.rst:2754 +#: ../../whatsnew/2.6.rst:2764 msgid "" "``ascii(obj)``: equivalent to :func:`repr`. In Python 3.0, :func:`repr` " "will return a Unicode string, while :func:`ascii` will return a pure ASCII " "bytestring." msgstr "" -#: ../../whatsnew/2.6.rst:2758 +#: ../../whatsnew/2.6.rst:2768 msgid "" "``filter(predicate, iterable)``, ``map(func, iterable1, ...)``: the 3.0 " "versions return iterators, unlike the 2.x builtins which return lists." msgstr "" -#: ../../whatsnew/2.6.rst:2762 +#: ../../whatsnew/2.6.rst:2772 msgid "" -"``hex(value)``, ``oct(value)``: instead of calling the :meth:`__hex__` " -"or :meth:`__oct__` methods, these versions will call the :meth:`__index__` " +"``hex(value)``, ``oct(value)``: instead of calling the :meth:`__hex__` or :" +"meth:`__oct__` methods, these versions will call the :meth:`__index__` " "method and convert the result to hexadecimal or octal. :func:`oct` will use " "the new ``0o`` notation for its result." msgstr "" -#: ../../whatsnew/2.6.rst:2771 +#: ../../whatsnew/2.6.rst:2781 msgid "The :mod:`json` module: JavaScript Object Notation" msgstr "" -#: ../../whatsnew/2.6.rst:2773 +#: ../../whatsnew/2.6.rst:2783 msgid "" "The new :mod:`json` module supports the encoding and decoding of Python " "types in JSON (Javascript Object Notation). JSON is a lightweight " @@ -4391,13 +4386,13 @@ msgid "" "about JSON, see http://www.json.org." msgstr "" -#: ../../whatsnew/2.6.rst:2778 +#: ../../whatsnew/2.6.rst:2788 msgid "" ":mod:`json` comes with support for decoding and encoding most built-in " "Python types. The following example encodes and decodes a dictionary::" msgstr "" -#: ../../whatsnew/2.6.rst:2781 +#: ../../whatsnew/2.6.rst:2791 msgid "" ">>> import json\n" ">>> data = {\"spam\": \"foo\", \"parrot\": 42}\n" @@ -4408,28 +4403,28 @@ msgid "" "{\"spam\": \"foo\", \"parrot\": 42}" msgstr "" -#: ../../whatsnew/2.6.rst:2789 +#: ../../whatsnew/2.6.rst:2799 msgid "" "It's also possible to write your own decoders and encoders to support more " "types. Pretty-printing of the JSON strings is also supported." msgstr "" -#: ../../whatsnew/2.6.rst:2792 +#: ../../whatsnew/2.6.rst:2802 msgid ":mod:`json` (originally called simplejson) was written by Bob Ippolito." msgstr "" -#: ../../whatsnew/2.6.rst:2799 +#: ../../whatsnew/2.6.rst:2809 msgid "The :mod:`plistlib` module: A Property-List Parser" msgstr "" -#: ../../whatsnew/2.6.rst:2801 +#: ../../whatsnew/2.6.rst:2811 msgid "" "The ``.plist`` format is commonly used on Mac OS X to store basic data types " "(numbers, strings, lists, and dictionaries) by serializing them into an XML-" "based format. It resembles the XML-RPC serialization of data types." msgstr "" -#: ../../whatsnew/2.6.rst:2806 +#: ../../whatsnew/2.6.rst:2816 msgid "" "Despite being primarily used on Mac OS X, the format has nothing Mac-" "specific about it and the Python implementation works on any platform that " @@ -4437,11 +4432,11 @@ msgid "" "standard library." msgstr "" -#: ../../whatsnew/2.6.rst:2811 +#: ../../whatsnew/2.6.rst:2821 msgid "Using the module is simple::" msgstr "" -#: ../../whatsnew/2.6.rst:2813 +#: ../../whatsnew/2.6.rst:2823 msgid "" "import sys\n" "import plistlib\n" @@ -4466,44 +4461,44 @@ msgid "" "plistlib.writePlist(data_struct, sys.stdout)" msgstr "" -#: ../../whatsnew/2.6.rst:2838 +#: ../../whatsnew/2.6.rst:2848 msgid "ctypes Enhancements" msgstr "" -#: ../../whatsnew/2.6.rst:2840 +#: ../../whatsnew/2.6.rst:2850 msgid "" "Thomas Heller continued to maintain and enhance the :mod:`ctypes` module." msgstr "" -#: ../../whatsnew/2.6.rst:2843 +#: ../../whatsnew/2.6.rst:2853 msgid "" ":mod:`ctypes` now supports a :class:`c_bool` datatype that represents the " "C99 ``bool`` type. (Contributed by David Remahl; :issue:`1649190`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2847 +#: ../../whatsnew/2.6.rst:2857 msgid "" "The :mod:`ctypes` string, buffer and array types have improved support for " "extended slicing syntax, where various combinations of ``(start, stop, " "step)`` are supplied. (Implemented by Thomas Wouters.)" msgstr "" -#: ../../whatsnew/2.6.rst:2854 +#: ../../whatsnew/2.6.rst:2864 msgid "" -"All :mod:`ctypes` data types now support :meth:`from_buffer` " -"and :meth:`from_buffer_copy` methods that create a ctypes instance based on " -"a provided buffer object. :meth:`from_buffer_copy` copies the contents of " -"the object, while :meth:`from_buffer` will share the same memory area." +"All :mod:`ctypes` data types now support :meth:`from_buffer` and :meth:" +"`from_buffer_copy` methods that create a ctypes instance based on a provided " +"buffer object. :meth:`from_buffer_copy` copies the contents of the object, " +"while :meth:`from_buffer` will share the same memory area." msgstr "" -#: ../../whatsnew/2.6.rst:2861 +#: ../../whatsnew/2.6.rst:2871 msgid "" "A new calling convention tells :mod:`ctypes` to clear the ``errno`` or Win32 " "LastError variables at the outset of each wrapped call. (Implemented by " "Thomas Heller; :issue:`1798`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2865 +#: ../../whatsnew/2.6.rst:2875 msgid "" "You can now retrieve the Unix ``errno`` variable after a function call. " "When creating a wrapped function, you can supply ``use_errno=True`` as a " @@ -4512,26 +4507,26 @@ msgid "" "error value." msgstr "" -#: ../../whatsnew/2.6.rst:2871 +#: ../../whatsnew/2.6.rst:2881 msgid "" -"The Win32 LastError variable is similarly supported by " -"the :func:`DLL`, :func:`OleDLL`, and :func:`WinDLL` functions. You supply " +"The Win32 LastError variable is similarly supported by the :func:`DLL`, :" +"func:`OleDLL`, and :func:`WinDLL` functions. You supply " "``use_last_error=True`` as a keyword parameter and then call the module-" "level methods :meth:`set_last_error` and :meth:`get_last_error`." msgstr "" -#: ../../whatsnew/2.6.rst:2877 +#: ../../whatsnew/2.6.rst:2887 msgid "" "The :func:`byref` function, used to retrieve a pointer to a ctypes instance, " "now has an optional *offset* parameter that is a byte count that will be " "added to the returned pointer." msgstr "" -#: ../../whatsnew/2.6.rst:2884 +#: ../../whatsnew/2.6.rst:2894 msgid "Improved SSL Support" msgstr "" -#: ../../whatsnew/2.6.rst:2886 +#: ../../whatsnew/2.6.rst:2896 msgid "" "Bill Janssen made extensive improvements to Python 2.6's support for the " "Secure Sockets Layer by adding a new module, :mod:`ssl`, that's built atop " @@ -4542,7 +4537,7 @@ msgid "" "removed and continues to work, though it will be removed in Python 3.0." msgstr "" -#: ../../whatsnew/2.6.rst:2895 +#: ../../whatsnew/2.6.rst:2905 msgid "" "To use the new module, you must first create a TCP connection in the usual " "way and then pass it to the :func:`ssl.wrap_socket` function. It's possible " @@ -4550,122 +4545,122 @@ msgid "" "by calling the :meth:`getpeercert` method." msgstr "" -#: ../../whatsnew/2.6.rst:2902 +#: ../../whatsnew/2.6.rst:2912 msgid "The documentation for the :mod:`ssl` module." msgstr "" -#: ../../whatsnew/2.6.rst:2907 +#: ../../whatsnew/2.6.rst:2917 msgid "Deprecations and Removals" msgstr "" -#: ../../whatsnew/2.6.rst:2909 ../../whatsnew/2.6.rst:3263 +#: ../../whatsnew/2.6.rst:2919 ../../whatsnew/2.6.rst:3273 msgid "" -"String exceptions have been removed. Attempting to use them raises " -"a :exc:`TypeError`." +"String exceptions have been removed. Attempting to use them raises a :exc:" +"`TypeError`." msgstr "" -#: ../../whatsnew/2.6.rst:2912 +#: ../../whatsnew/2.6.rst:2922 msgid "" "Changes to the :class:`Exception` interface as dictated by :pep:`352` " "continue to be made. For 2.6, the :attr:`!message` attribute is being " "deprecated in favor of the :attr:`~BaseException.args` attribute." msgstr "" -#: ../../whatsnew/2.6.rst:2917 +#: ../../whatsnew/2.6.rst:2927 msgid "" "(3.0-warning mode) Python 3.0 will feature a reorganized standard library " "that will drop many outdated modules and rename others. Python 2.6 running " "in 3.0-warning mode will warn about these modules when they are imported." msgstr "" -#: ../../whatsnew/2.6.rst:2922 +#: ../../whatsnew/2.6.rst:2932 msgid "" -"The list of deprecated modules is: :mod:`!audiodev`, :mod:`!" -"bgenlocations`, :mod:`!buildtools`, :mod:`!bundlebuilder`, :mod:`!" -"Canvas`, :mod:`!compiler`, :mod:`!dircache`, :mod:`!dl`, :mod:`!" -"fpformat`, :mod:`!gensuitemodule`, :mod:`!ihooks`, :mod:`!imageop`, :mod:`!" -"imgfile`, :mod:`!linuxaudiodev`, :mod:`!mhlib`, :mod:`!mimetools`, :mod:`!" -"multifile`, :mod:`!new`, :mod:`!pure`, :mod:`!statvfs`, :mod:`!" -"sunaudiodev`, :mod:`!test.testall`, and :mod:`!toaiff`." +"The list of deprecated modules is: :mod:`!audiodev`, :mod:`!bgenlocations`, :" +"mod:`!buildtools`, :mod:`!bundlebuilder`, :mod:`!Canvas`, :mod:`!compiler`, :" +"mod:`!dircache`, :mod:`!dl`, :mod:`!fpformat`, :mod:`!gensuitemodule`, :mod:" +"`!ihooks`, :mod:`!imageop`, :mod:`!imgfile`, :mod:`!linuxaudiodev`, :mod:`!" +"mhlib`, :mod:`!mimetools`, :mod:`!multifile`, :mod:`!new`, :mod:`!pure`, :" +"mod:`!statvfs`, :mod:`!sunaudiodev`, :mod:`!test.testall`, and :mod:`!" +"toaiff`." msgstr "" -#: ../../whatsnew/2.6.rst:2947 +#: ../../whatsnew/2.6.rst:2957 msgid "The :mod:`!gopherlib` module has been removed." msgstr "" -#: ../../whatsnew/2.6.rst:2949 +#: ../../whatsnew/2.6.rst:2959 msgid "" "The :mod:`!MimeWriter` module and :mod:`!mimify` module have been " "deprecated; use the :mod:`email` package instead." msgstr "" -#: ../../whatsnew/2.6.rst:2953 +#: ../../whatsnew/2.6.rst:2963 msgid "" "The :mod:`!md5` module has been deprecated; use the :mod:`hashlib` module " "instead." msgstr "" -#: ../../whatsnew/2.6.rst:2956 +#: ../../whatsnew/2.6.rst:2966 msgid "" "The :mod:`!posixfile` module has been deprecated; :func:`fcntl.lockf` " "provides better locking." msgstr "" -#: ../../whatsnew/2.6.rst:2959 +#: ../../whatsnew/2.6.rst:2969 msgid "" "The :mod:`!popen2` module has been deprecated; use the :mod:`subprocess` " "module." msgstr "" -#: ../../whatsnew/2.6.rst:2962 +#: ../../whatsnew/2.6.rst:2972 msgid "The :mod:`!rgbimg` module has been removed." msgstr "" -#: ../../whatsnew/2.6.rst:2964 +#: ../../whatsnew/2.6.rst:2974 msgid "" "The :mod:`!sets` module has been deprecated; it's better to use the built-" "in :class:`set` and :class:`frozenset` types." msgstr "" -#: ../../whatsnew/2.6.rst:2967 +#: ../../whatsnew/2.6.rst:2977 msgid "" "The :mod:`!sha` module has been deprecated; use the :mod:`hashlib` module " "instead." msgstr "" -#: ../../whatsnew/2.6.rst:2975 +#: ../../whatsnew/2.6.rst:2985 msgid "Build and C API Changes" msgstr "建置和 C API 變更" -#: ../../whatsnew/2.6.rst:2977 +#: ../../whatsnew/2.6.rst:2987 msgid "Changes to Python's build process and to the C API include:" msgstr "Python 建置程序和 C API 的變更包括:" -#: ../../whatsnew/2.6.rst:2979 +#: ../../whatsnew/2.6.rst:2989 msgid "" "Python now must be compiled with C89 compilers (after 19 years!). This " -"means that the Python source tree has dropped its own implementations " -"of :c:func:`!memmove` and :c:func:`!strerror`, which are in the C89 standard " +"means that the Python source tree has dropped its own implementations of :c:" +"func:`!memmove` and :c:func:`!strerror`, which are in the C89 standard " "library." msgstr "" -#: ../../whatsnew/2.6.rst:2984 +#: ../../whatsnew/2.6.rst:2994 msgid "" "Python 2.6 can be built with Microsoft Visual Studio 2008 (version 9.0), and " "this is the new default compiler. See the :file:`PCbuild` directory for the " "build files. (Implemented by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2989 +#: ../../whatsnew/2.6.rst:2999 msgid "" -"On Mac OS X, Python 2.6 can be compiled as a 4-way universal build. " -"The :program:`configure` script can take a :option:`!--with-universal-" -"archs=[32-bit|64-bit|all]` switch, controlling whether the binaries are " -"built for 32-bit architectures (x86, PowerPC), 64-bit (x86-64 and PPC-64), " -"or both. (Contributed by Ronald Oussoren.)" +"On Mac OS X, Python 2.6 can be compiled as a 4-way universal build. The :" +"program:`configure` script can take a :option:`!--with-universal-archs=[32-" +"bit|64-bit|all]` switch, controlling whether the binaries are built for 32-" +"bit architectures (x86, PowerPC), 64-bit (x86-64 and PPC-64), or both. " +"(Contributed by Ronald Oussoren.)" msgstr "" -#: ../../whatsnew/2.6.rst:2996 +#: ../../whatsnew/2.6.rst:3006 msgid "" "A new function added in Python 2.6.6, :c:func:`!PySys_SetArgvEx`, sets the " "value of ``sys.argv`` and can optionally update ``sys.path`` to include the " @@ -4673,7 +4668,7 @@ msgid "" "value of an *updatepath* parameter." msgstr "" -#: ../../whatsnew/2.6.rst:3001 +#: ../../whatsnew/2.6.rst:3011 msgid "" "This function was added to close a security hole for applications that embed " "Python. The old function, :c:func:`!PySys_SetArgv`, would always update " @@ -4684,7 +4679,7 @@ msgid "" "and run." msgstr "" -#: ../../whatsnew/2.6.rst:3009 +#: ../../whatsnew/2.6.rst:3019 msgid "" "If you maintain a C/C++ application that embeds Python, check whether you're " "calling :c:func:`!PySys_SetArgv` and carefully consider whether the " @@ -4696,28 +4691,27 @@ msgid "" "discard the first ``sys.path`` component." msgstr "" -#: ../../whatsnew/2.6.rst:3019 +#: ../../whatsnew/2.6.rst:3029 msgid "" "Security issue reported as :cve:`2008-5983`; discussed in :gh:`50003`, and " "fixed by Antoine Pitrou." msgstr "" -#: ../../whatsnew/2.6.rst:3022 +#: ../../whatsnew/2.6.rst:3032 msgid "" -"The BerkeleyDB module now has a C API object, available as " -"``bsddb.db.api``. This object can be used by other C extensions that wish " -"to use the :mod:`bsddb` module for their own purposes. (Contributed by " -"Duncan Grisby.)" +"The BerkeleyDB module now has a C API object, available as ``bsddb.db." +"api``. This object can be used by other C extensions that wish to use the :" +"mod:`bsddb` module for their own purposes. (Contributed by Duncan Grisby.)" msgstr "" -#: ../../whatsnew/2.6.rst:3027 +#: ../../whatsnew/2.6.rst:3037 msgid "" "The new buffer interface, previously described in `the PEP 3118 section " "<#pep-3118-revised-buffer-protocol>`__, adds :c:func:`PyObject_GetBuffer` " "and :c:func:`PyBuffer_Release`, as well as a few other functions." msgstr "" -#: ../../whatsnew/2.6.rst:3032 +#: ../../whatsnew/2.6.rst:3042 msgid "" "Python's use of the C stdio library is now thread-safe, or at least as " "thread-safe as the underlying library is. A long-standing potential bug " @@ -4732,17 +4726,17 @@ msgid "" "Gregory P. Smith.)" msgstr "" -#: ../../whatsnew/2.6.rst:3045 +#: ../../whatsnew/2.6.rst:3055 msgid "" "Importing modules simultaneously in two different threads no longer " -"deadlocks; it will now raise an :exc:`ImportError`. A new API " -"function, :c:func:`PyImport_ImportModuleNoBlock`, will look for a module in " -"``sys.modules`` first, then try to import it after acquiring an import " -"lock. If the import lock is held by another thread, an :exc:`ImportError` " -"is raised. (Contributed by Christian Heimes.)" +"deadlocks; it will now raise an :exc:`ImportError`. A new API function, :c:" +"func:`PyImport_ImportModuleNoBlock`, will look for a module in ``sys." +"modules`` first, then try to import it after acquiring an import lock. If " +"the import lock is held by another thread, an :exc:`ImportError` is raised. " +"(Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3053 +#: ../../whatsnew/2.6.rst:3063 msgid "" "Several functions return information about the platform's floating-point " "support. :c:func:`PyFloat_GetMax` returns the maximum representable " @@ -4754,7 +4748,7 @@ msgid "" "by Christian Heimes; :issue:`1534`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3064 +#: ../../whatsnew/2.6.rst:3074 msgid "" "C functions and methods that use :c:func:`PyComplex_AsCComplex` will now " "accept arguments that have a :meth:`__complex__` method. In particular, the " @@ -4763,40 +4757,39 @@ msgid "" "Dickinson; :issue:`1675423`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3071 +#: ../../whatsnew/2.6.rst:3081 msgid "" "Python's C API now includes two functions for case-insensitive string " "comparisons, ``PyOS_stricmp(char*, char*)`` and ``PyOS_strnicmp(char*, " "char*, Py_ssize_t)``. (Contributed by Christian Heimes; :issue:`1635`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3076 +#: ../../whatsnew/2.6.rst:3086 msgid "" "Many C extensions define their own little macro for adding integers and " "strings to the module's dictionary in the ``init*`` function. Python 2.6 " -"finally defines standard macros for adding values to a " -"module, :c:macro:`PyModule_AddStringMacro` " -"and :c:macro:`PyModule_AddIntMacro()`. (Contributed by Christian Heimes.)" +"finally defines standard macros for adding values to a module, :c:macro:" +"`PyModule_AddStringMacro` and :c:macro:`PyModule_AddIntMacro()`. " +"(Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3083 +#: ../../whatsnew/2.6.rst:3093 msgid "" "Some macros were renamed in both 3.0 and 2.6 to make it clearer that they " -"are macros, not functions. :c:macro:`!Py_Size()` " -"became :c:macro:`Py_SIZE()`, :c:macro:`!Py_Type()` " -"became :c:macro:`Py_TYPE()`, and :c:macro:`!Py_Refcnt()` " -"became :c:macro:`Py_REFCNT()`. The mixed-case macros are still available in " -"Python 2.6 for backward compatibility. (:issue:`1629`)" +"are macros, not functions. :c:macro:`!Py_Size()` became :c:macro:" +"`Py_SIZE()`, :c:macro:`!Py_Type()` became :c:macro:`Py_TYPE()`, and :c:macro:" +"`!Py_Refcnt()` became :c:macro:`Py_REFCNT()`. The mixed-case macros are " +"still available in Python 2.6 for backward compatibility. (:issue:`1629`)" msgstr "" -#: ../../whatsnew/2.6.rst:3092 +#: ../../whatsnew/2.6.rst:3102 msgid "" "Distutils now places C extensions it builds in a different directory when " -"running on a debug version of Python. (Contributed by Collin " -"Winter; :issue:`1530959`.)" +"running on a debug version of Python. (Contributed by Collin Winter; :issue:" +"`1530959`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3096 +#: ../../whatsnew/2.6.rst:3106 msgid "" "Several basic data types, such as integers and strings, maintain internal " "free lists of objects that can be re-used. The data structures for these " @@ -4805,7 +4798,7 @@ msgid "" "``Py_MAXFREELIST`` is always defined." msgstr "" -#: ../../whatsnew/2.6.rst:3103 +#: ../../whatsnew/2.6.rst:3113 msgid "" "A new Makefile target, \"make patchcheck\", prepares the Python source tree " "for making a patch: it fixes trailing whitespace in all modified ``.py`` " @@ -4814,7 +4807,7 @@ msgid "" "(Contributed by Brett Cannon.)" msgstr "" -#: ../../whatsnew/2.6.rst:3110 +#: ../../whatsnew/2.6.rst:3120 msgid "" "Another new target, \"make profile-opt\", compiles a Python binary using " "GCC's profile-guided optimization. It compiles Python with profiling " @@ -4823,17 +4816,17 @@ msgid "" "Smith.)" msgstr "" -#: ../../whatsnew/2.6.rst:3119 +#: ../../whatsnew/2.6.rst:3129 msgid "Port-Specific Changes: Windows" msgstr "" -#: ../../whatsnew/2.6.rst:3121 +#: ../../whatsnew/2.6.rst:3131 msgid "" "The support for Windows 95, 98, ME and NT4 has been dropped. Python 2.6 " "requires at least Windows 2000 SP4." msgstr "" -#: ../../whatsnew/2.6.rst:3124 +#: ../../whatsnew/2.6.rst:3134 msgid "" "The new default compiler on Windows is Visual Studio 2008 (version 9.0). The " "build directories for Visual Studio 2003 (version 7.1) and 2005 (version " @@ -4844,7 +4837,7 @@ msgid "" "Martin von Löwis.)" msgstr "" -#: ../../whatsnew/2.6.rst:3132 +#: ../../whatsnew/2.6.rst:3142 msgid "" "The :mod:`msvcrt` module now supports both the normal and wide char variants " "of the console I/O API. The :func:`~msvcrt.getwch` function reads a " @@ -4853,118 +4846,117 @@ msgid "" "writes it to the console. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3139 +#: ../../whatsnew/2.6.rst:3149 msgid "" ":func:`os.path.expandvars` will now expand environment variables in the form " "\"%var%\", and \"~user\" will be expanded into the user's home directory " "path. (Contributed by Josiah Carlson; :issue:`957650`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3143 +#: ../../whatsnew/2.6.rst:3153 msgid "" -"The :mod:`socket` module's socket objects now have " -"an :meth:`~socket.socket.ioctl` method that provides a limited interface to " -"the :c:func:`WSAIoctl` system interface." +"The :mod:`socket` module's socket objects now have an :meth:`~socket.socket." +"ioctl` method that provides a limited interface to the :c:func:`WSAIoctl` " +"system interface." msgstr "" -#: ../../whatsnew/2.6.rst:3147 +#: ../../whatsnew/2.6.rst:3157 msgid "" -"The :mod:`_winreg ` module now has a " -"function, :func:`~winreg.ExpandEnvironmentStrings`, that expands environment " -"variable references such as ``%NAME%`` in an input string. The handle " -"objects provided by this module now support the context protocol, so they " -"can be used in :keyword:`with` statements. (Contributed by Christian Heimes.)" +"The :mod:`_winreg ` module now has a function, :func:`~winreg." +"ExpandEnvironmentStrings`, that expands environment variable references such " +"as ``%NAME%`` in an input string. The handle objects provided by this " +"module now support the context protocol, so they can be used in :keyword:" +"`with` statements. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3154 +#: ../../whatsnew/2.6.rst:3164 msgid "" ":mod:`_winreg ` also has better support for x64 systems, exposing " -"the :func:`~winreg.DisableReflectionKey`, :func:`~winreg.EnableReflectionKey`, " -"and :func:`~winreg.QueryReflectionKey` functions, which enable and disable " -"registry reflection for 32-bit processes running on 64-bit systems. " -"(:issue:`1753245`)" +"the :func:`~winreg.DisableReflectionKey`, :func:`~winreg." +"EnableReflectionKey`, and :func:`~winreg.QueryReflectionKey` functions, " +"which enable and disable registry reflection for 32-bit processes running on " +"64-bit systems. (:issue:`1753245`)" msgstr "" -#: ../../whatsnew/2.6.rst:3160 +#: ../../whatsnew/2.6.rst:3170 msgid "" "The :mod:`!msilib` module's :class:`!Record` object gained :meth:`!" "GetInteger` and :meth:`!GetString` methods that return field values as an " "integer or a string. (Contributed by Floris Bruynooghe; :issue:`2125`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3168 +#: ../../whatsnew/2.6.rst:3178 msgid "Port-Specific Changes: Mac OS X" msgstr "" -#: ../../whatsnew/2.6.rst:3170 +#: ../../whatsnew/2.6.rst:3180 msgid "" "When compiling a framework build of Python, you can now specify the " "framework name to be used by providing the :option:`!--with-framework-name=` " "option to the :program:`configure` script." msgstr "" -#: ../../whatsnew/2.6.rst:3175 +#: ../../whatsnew/2.6.rst:3185 msgid "" -"The :mod:`!macfs` module has been removed. This in turn required " -"the :func:`!macostools.touched` function to be removed because it depended " -"on the :mod:`!macfs` module. (:issue:`1490190`)" +"The :mod:`!macfs` module has been removed. This in turn required the :func:" +"`!macostools.touched` function to be removed because it depended on the :mod:" +"`!macfs` module. (:issue:`1490190`)" msgstr "" -#: ../../whatsnew/2.6.rst:3179 +#: ../../whatsnew/2.6.rst:3189 msgid "" "Many other Mac OS modules have been deprecated and will be removed in Python " "3.0: :mod:`!_builtinSuites`, :mod:`!aepack`, :mod:`!aetools`, :mod:`!" -"aetypes`, :mod:`!applesingle`, :mod:`!appletrawmain`, :mod:`!" -"appletrunner`, :mod:`!argvemulator`, :mod:`!Audio_mac`, :mod:`!" -"autoGIL`, :mod:`!Carbon`, :mod:`!cfmfile`, :mod:`!CodeWarrior`, :mod:`!" -"ColorPicker`, :mod:`!EasyDialogs`, :mod:`!Explorer`, :mod:`!Finder`, :mod:`!" -"FrameWork`, :mod:`!findertools`, :mod:`!ic`, :mod:`!icglue`, :mod:`!" -"icopen`, :mod:`!macerrors`, :mod:`!MacOS`, :mod:`!macfs`, :mod:`!" -"macostools`, :mod:`!macresource`, :mod:`!MiniAEFrame`, :mod:`!Nav`, :mod:`!" -"Netscape`, :mod:`!OSATerminology`, :mod:`!pimp`, :mod:`!" -"PixMapWrapper`, :mod:`!StdSuites`, :mod:`!SystemEvents`, :mod:`!Terminal`, " -"and :mod:`!terminalcommand`." -msgstr "" - -#: ../../whatsnew/2.6.rst:3222 +"aetypes`, :mod:`!applesingle`, :mod:`!appletrawmain`, :mod:`!appletrunner`, :" +"mod:`!argvemulator`, :mod:`!Audio_mac`, :mod:`!autoGIL`, :mod:`!Carbon`, :" +"mod:`!cfmfile`, :mod:`!CodeWarrior`, :mod:`!ColorPicker`, :mod:`!" +"EasyDialogs`, :mod:`!Explorer`, :mod:`!Finder`, :mod:`!FrameWork`, :mod:`!" +"findertools`, :mod:`!ic`, :mod:`!icglue`, :mod:`!icopen`, :mod:`!" +"macerrors`, :mod:`!MacOS`, :mod:`!macfs`, :mod:`!macostools`, :mod:`!" +"macresource`, :mod:`!MiniAEFrame`, :mod:`!Nav`, :mod:`!Netscape`, :mod:`!" +"OSATerminology`, :mod:`!pimp`, :mod:`!PixMapWrapper`, :mod:`!StdSuites`, :" +"mod:`!SystemEvents`, :mod:`!Terminal`, and :mod:`!terminalcommand`." +msgstr "" + +#: ../../whatsnew/2.6.rst:3232 msgid "Port-Specific Changes: IRIX" msgstr "" -#: ../../whatsnew/2.6.rst:3224 +#: ../../whatsnew/2.6.rst:3234 msgid "" "A number of old IRIX-specific modules were deprecated and will be removed in " "Python 3.0: :mod:`!al` and :mod:`!AL`, :mod:`!cd`, :mod:`!cddb`, :mod:`!" "cdplayer`, :mod:`!CL` and :mod:`!cl`, :mod:`!DEVICE`, :mod:`!ERRNO`, :mod:`!" -"FILE`, :mod:`!FL` and :mod:`!fl`, :mod:`!flp`, :mod:`!fm`, :mod:`!" -"GET`, :mod:`!GLWS`, :mod:`!GL` and :mod:`!gl`, :mod:`!IN`, :mod:`!" -"IOCTL`, :mod:`!jpeg`, :mod:`!panelparser`, :mod:`!readcd`, :mod:`!SV` " -"and :mod:`!sv`, :mod:`!torgb`, :mod:`!videoreader`, and :mod:`!WAIT`." +"FILE`, :mod:`!FL` and :mod:`!fl`, :mod:`!flp`, :mod:`!fm`, :mod:`!GET`, :mod:" +"`!GLWS`, :mod:`!GL` and :mod:`!gl`, :mod:`!IN`, :mod:`!IOCTL`, :mod:`!" +"jpeg`, :mod:`!panelparser`, :mod:`!readcd`, :mod:`!SV` and :mod:`!sv`, :mod:" +"`!torgb`, :mod:`!videoreader`, and :mod:`!WAIT`." msgstr "" -#: ../../whatsnew/2.6.rst:3254 +#: ../../whatsnew/2.6.rst:3264 msgid "Porting to Python 2.6" msgstr "" -#: ../../whatsnew/2.6.rst:3256 +#: ../../whatsnew/2.6.rst:3266 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/2.6.rst:3259 +#: ../../whatsnew/2.6.rst:3269 msgid "" "Classes that aren't supposed to be hashable should set ``__hash__ = None`` " "in their definitions to indicate the fact." msgstr "" -#: ../../whatsnew/2.6.rst:3266 +#: ../../whatsnew/2.6.rst:3276 msgid "" "The :meth:`__init__` method of :class:`collections.deque` now clears any " "existing contents of the deque before adding elements from the iterable. " "This change makes the behavior match ``list.__init__()``." msgstr "" -#: ../../whatsnew/2.6.rst:3271 +#: ../../whatsnew/2.6.rst:3281 msgid "" ":meth:`object.__init__` previously accepted arbitrary arguments and keyword " "arguments, ignoring them. In Python 2.6, this is no longer allowed and will " @@ -4973,16 +4965,16 @@ msgid "" "through using :func:`super`). See :issue:`1683368` for discussion." msgstr "" -#: ../../whatsnew/2.6.rst:3278 +#: ../../whatsnew/2.6.rst:3288 msgid "" "The :class:`Decimal` constructor now accepts leading and trailing whitespace " "when passed a string. Previously it would raise an :exc:`InvalidOperation` " -"exception. On the other hand, the :meth:`create_decimal` method " -"of :class:`Context` objects now explicitly disallows extra whitespace, " -"raising a :exc:`ConversionSyntax` exception." +"exception. On the other hand, the :meth:`create_decimal` method of :class:" +"`Context` objects now explicitly disallows extra whitespace, raising a :exc:" +"`ConversionSyntax` exception." msgstr "" -#: ../../whatsnew/2.6.rst:3285 +#: ../../whatsnew/2.6.rst:3295 msgid "" "Due to an implementation accident, if you passed a file path to the built-" "in :func:`__import__` function, it would actually import the specified " @@ -4990,63 +4982,63 @@ msgid "" "explicitly checks for this case and raises an :exc:`ImportError`." msgstr "" -#: ../../whatsnew/2.6.rst:3291 +#: ../../whatsnew/2.6.rst:3301 msgid "" "C API: the :c:func:`PyImport_Import` and :c:func:`PyImport_ImportModule` " "functions now default to absolute imports, not relative imports. This will " "affect C extensions that import other modules." msgstr "" -#: ../../whatsnew/2.6.rst:3295 +#: ../../whatsnew/2.6.rst:3305 msgid "" "C API: extension data types that shouldn't be hashable should define their " "``tp_hash`` slot to :c:func:`PyObject_HashNotImplemented`." msgstr "" -#: ../../whatsnew/2.6.rst:3299 +#: ../../whatsnew/2.6.rst:3309 msgid "" -"The :mod:`socket` module exception :exc:`socket.error` now inherits " -"from :exc:`IOError`. Previously it wasn't a subclass " -"of :exc:`StandardError` but now it is, through :exc:`IOError`. (Implemented " -"by Gregory P. Smith; :issue:`1706815`.)" +"The :mod:`socket` module exception :exc:`socket.error` now inherits from :" +"exc:`IOError`. Previously it wasn't a subclass of :exc:`StandardError` but " +"now it is, through :exc:`IOError`. (Implemented by Gregory P. Smith; :issue:" +"`1706815`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3304 +#: ../../whatsnew/2.6.rst:3314 msgid "" "The :mod:`xmlrpclib ` module no longer automatically " -"converts :class:`datetime.date` and :class:`datetime.time` to " -"the :class:`xmlrpclib.DateTime ` type; the " -"conversion semantics were not necessarily correct for all applications. " -"Code using :mod:`!xmlrpclib` should convert :class:`date` " -"and :class:`~datetime.time` instances. (:issue:`1330538`)" +"converts :class:`datetime.date` and :class:`datetime.time` to the :class:" +"`xmlrpclib.DateTime ` type; the conversion semantics " +"were not necessarily correct for all applications. Code using :mod:`!" +"xmlrpclib` should convert :class:`date` and :class:`~datetime.time` " +"instances. (:issue:`1330538`)" msgstr "" -#: ../../whatsnew/2.6.rst:3311 +#: ../../whatsnew/2.6.rst:3321 msgid "" "(3.0-warning mode) The :class:`Exception` class now warns when accessed " "using slicing or index access; having :class:`Exception` behave like a tuple " "is being phased out." msgstr "" -#: ../../whatsnew/2.6.rst:3315 +#: ../../whatsnew/2.6.rst:3325 msgid "" "(3.0-warning mode) inequality comparisons between two dictionaries or two " "objects that don't implement comparison methods are reported as warnings. " "``dict1 == dict2`` still works, but ``dict1 < dict2`` is being phased out." msgstr "" -#: ../../whatsnew/2.6.rst:3320 +#: ../../whatsnew/2.6.rst:3330 msgid "" "Comparisons between cells, which are an implementation detail of Python's " "scoping rules, also cause warnings because such comparisons are forbidden " "entirely in 3.0." msgstr "" -#: ../../whatsnew/2.6.rst:3324 +#: ../../whatsnew/2.6.rst:3334 msgid "For applications that embed Python:" msgstr "" -#: ../../whatsnew/2.6.rst:3326 +#: ../../whatsnew/2.6.rst:3336 msgid "" "The :c:func:`!PySys_SetArgvEx` function was added in Python 2.6.6, letting " "applications close a security hole when the existing :c:func:`!" @@ -5055,11 +5047,11 @@ msgid "" "using :c:func:`!PySys_SetArgvEx` with *updatepath* set to false." msgstr "" -#: ../../whatsnew/2.6.rst:3339 +#: ../../whatsnew/2.6.rst:3349 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.6.rst:3341 +#: ../../whatsnew/2.6.rst:3351 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " @@ -5067,11 +5059,11 @@ msgid "" "Johnson, Chris Lambacher, Martin Michlmayr, Antoine Pitrou, Brian Warner." msgstr "" -#: ../../whatsnew/2.6.rst:1069 +#: ../../whatsnew/2.6.rst:1079 msgid "universal newlines" msgstr "universal newlines" -#: ../../whatsnew/2.6.rst:1069 +#: ../../whatsnew/2.6.rst:1079 msgid "What's new" msgstr "What's new(有什麼新功能)" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index b61992560b..cd4db017f2 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-04 00:15+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1302,11 +1302,10 @@ msgstr "" #: ../../whatsnew/2.7.rst:861 msgid "" -"When using :class:`@classmethod ` and :class:`@staticmethod " -"` to wrap methods as class or static methods, the wrapper " -"object now exposes the wrapped function as their :attr:`~method.__func__` " -"attribute. (Contributed by Amaury Forgeot d'Arc, after a suggestion by " -"George Sakkis; :issue:`5982`.)" +"When using :deco:`classmethod` and :deco:`staticmethod` to wrap methods as " +"class or static methods, the wrapper object now exposes the wrapped function " +"as their :attr:`~method.__func__` attribute. (Contributed by Amaury Forgeot " +"d'Arc, after a suggestion by George Sakkis; :issue:`5982`.)" msgstr "" #: ../../whatsnew/2.7.rst:869 ../../whatsnew/2.7.rst:2466 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 7b0820cb3a..788a73b6e2 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,8 +32,8 @@ msgstr "Pablo Galindo Salgado" #: ../../whatsnew/3.10.rst:47 msgid "" "This article explains the new features in Python 3.10, compared to 3.9. " -"Python 3.10 was released on October 4, 2021. For full details, see " -"the :ref:`changelog `." +"Python 3.10 was released on October 4, 2021. For full details, see the :ref:" +"`changelog `." msgstr "" "本文介紹了 Python 3.10 與 3.9 相比多了哪些新功能。Python 3.10 已於 2021 年 " "10 月 4 日發布。有關完整詳細資訊,請參閱 :ref:`changelog `。" @@ -216,15 +216,15 @@ msgstr "" #: ../../whatsnew/3.10.rst:142 msgid "" -"This new syntax uses the non LL(1) capacities of the new parser. " -"Check :pep:`617` for more details." +"This new syntax uses the non LL(1) capacities of the new parser. Check :pep:" +"`617` for more details." msgstr "" "此新語法使用新剖析器的非 LL(1) 功能。檢查 :pep:`617` 了解更多詳細資訊。" #: ../../whatsnew/3.10.rst:145 msgid "" -"(Contributed by Guido van Rossum, Pablo Galindo and Lysandros Nikolaou " -"in :issue:`12782` and :issue:`40334`.)" +"(Contributed by Guido van Rossum, Pablo Galindo and Lysandros Nikolaou in :" +"issue:`12782` and :issue:`40334`.)" msgstr "" "(由 Guido van Rossum、Pablo Galindo 和 Lysandros Nikolaou 在 :issue:`12782` " "和 :issue:`40334` 中貢獻。)" @@ -309,8 +309,8 @@ msgstr "這些改進是受到 PyPy 直譯器的啟發。" #: ../../whatsnew/3.10.rst:191 msgid "" -"(Contributed by Pablo Galindo in :issue:`42864` and Batuhan Taskaya " -"in :issue:`40176`.)" +"(Contributed by Pablo Galindo in :issue:`42864` and Batuhan Taskaya in :" +"issue:`40176`.)" msgstr "" "(由 Pablo Galindo 在 :issue:`42864` 和 Batuhan Taskaya 在 :issue:`40176` 中" "貢獻。)" @@ -718,12 +718,12 @@ msgstr "影格 (frame) 物件的 :attr:`~frame.f_lineno` 屬性總會包含預 msgid "" "The :attr:`~codeobject.co_lnotab` attribute of :ref:`code objects ` is deprecated and will be removed in 3.12. Code that needs to " -"convert from offset to line number should use the " -"new :meth:`~codeobject.co_lines` method instead." +"convert from offset to line number should use the new :meth:`~codeobject." +"co_lines` method instead." msgstr "" ":ref:`程式碼物件 `\\ 的 :attr:`~codeobject.co_lnotab` 屬性已棄" -"用,並將在 3.12 中刪除。需要從偏移量轉換為列號的程式碼應使用新" -"的 :meth:`~codeobject.co_lines` 方法。" +"用,並將在 3.12 中刪除。需要從偏移量轉換為列號的程式碼應使用新的 :meth:" +"`~codeobject.co_lines` 方法。" #: ../../whatsnew/3.10.rst:412 msgid "PEP 634: Structural Pattern Matching" @@ -1221,8 +1221,8 @@ msgstr "" #: ../../whatsnew/3.10.rst:685 msgid "" -"For the full specification see :pep:`634`. Motivation and rationale are " -"in :pep:`635`, and a longer tutorial is in :pep:`636`." +"For the full specification see :pep:`634`. Motivation and rationale are in :" +"pep:`635`, and a longer tutorial is in :pep:`636`." msgstr "" "有關完整規範,請參閱 :pep:`634`。動機和基本原理位於 :pep:`635` 中,較完整的教" "學位於 :pep:`636` 中。" @@ -1255,9 +1255,9 @@ msgid "" "emitted when :data:`sys.flags.warn_default_encoding ` is true and " "locale-specific default encoding is used." msgstr "" -"為了發現這種錯誤,新增了一個可選的 ``EncodingWarning``。" -"當 :data:`sys.flags.warn_default_encoding ` 為 true 且使用特定於語" -"言環境的預設編碼時,會發出該信號。" +"為了發現這種錯誤,新增了一個可選的 ``EncodingWarning``。當 :data:`sys.flags." +"warn_default_encoding ` 為 true 且使用特定於語言環境的預設編碼時," +"會發出該信號。" #: ../../whatsnew/3.10.rst:707 msgid "" @@ -1277,8 +1277,8 @@ msgstr "與型別提示相關的新功能" #: ../../whatsnew/3.10.rst:717 msgid "" -"This section covers major changes affecting :pep:`484` type hints and " -"the :mod:`typing` module." +"This section covers major changes affecting :pep:`484` type hints and the :" +"mod:`typing` module." msgstr "本節介紹影響 :pep:`484` 型別提示和 :mod:`typing` 模組的主要更改。" #: ../../whatsnew/3.10.rst:722 @@ -1292,16 +1292,16 @@ msgid "" "of using :class:`typing.Union`, especially in type hints." msgstr "" "引入了一種新的聯集運算子,該運算子啟用像是 ``X | Y`` 的語法。這提供了一種在型" -"別提示中更清晰的方式來表達「型別 X 或型別 Y」,來取代使" -"用 :class:`typing.Union`。" +"別提示中更清晰的方式來表達「型別 X 或型別 Y」,來取代使用 :class:`typing." +"Union`。" #: ../../whatsnew/3.10.rst:728 msgid "" "In previous versions of Python, to apply a type hint for functions accepting " "arguments of multiple types, :class:`typing.Union` was used::" msgstr "" -"在以前版本的 Python 中,要使用接受多種型別之引數的型別提示的函式,要使" -"用 :class:`typing.Union`: ::" +"在以前版本的 Python 中,要使用接受多種型別之引數的型別提示的函式,要使用 :" +"class:`typing.Union`: ::" #: ../../whatsnew/3.10.rst:731 msgid "" @@ -1325,8 +1325,8 @@ msgstr "" #: ../../whatsnew/3.10.rst:741 msgid "" -"This new syntax is also accepted as the second argument " -"to :func:`isinstance` and :func:`issubclass`::" +"This new syntax is also accepted as the second argument to :func:" +"`isinstance` and :func:`issubclass`::" msgstr "" "這種新語法也接受作為 :func:`isinstance` 和 :func:`issubclass` 的第二個引" "數: ::" @@ -1389,11 +1389,12 @@ msgstr "" #: ../../whatsnew/3.10.rst:770 msgid "" -"See :class:`typing.Callable`, :class:`typing.ParamSpec`, :class:`typing.Concatenate`, :class:`typing.ParamSpecArgs`, :class:`typing.ParamSpecKwargs`, " -"and :pep:`612` for more details." +"See :class:`typing.Callable`, :class:`typing.ParamSpec`, :class:`typing." +"Concatenate`, :class:`typing.ParamSpecArgs`, :class:`typing." +"ParamSpecKwargs`, and :pep:`612` for more details." msgstr "" -"請參" -"閱 :class:`typing.Callable`、:class:`typing.ParamSpec`、:class:`typing.Concatenate`、:class:`typing.ParamSpecArgs`、:class:`typing.ParamSpecKwargs` " +"請參閱 :class:`typing.Callable`、:class:`typing.ParamSpec`、:class:`typing." +"Concatenate`、:class:`typing.ParamSpecArgs`、:class:`typing.ParamSpecKwargs` " "和 :pep:`612` 以了解更多詳情。" #: ../../whatsnew/3.10.rst:774 @@ -1457,8 +1458,8 @@ msgstr "PEP 647:使用者定義的型別防護" msgid "" ":data:`~typing.TypeGuard` has been added to the :mod:`typing` module to " "annotate type guard functions and improve information provided to static " -"type checkers during type narrowing. For more information, please " -"see :data:`~typing.TypeGuard`\\ 's documentation, and :pep:`647`." +"type checkers during type narrowing. For more information, please see :data:" +"`~typing.TypeGuard`\\ 's documentation, and :pep:`647`." msgstr "" ":data:`~typing.TypeGuard`\\ (型別防護)已新增到 :mod:`typing` 模組中,用以註" "釋型別防護函式並改進在型別窄縮 (type narrowing) 期間提供給靜態型別檢查器的資" @@ -1483,20 +1484,20 @@ msgid "" "population count. (Contributed by Niklas Fiekas in :issue:`29882`.)" msgstr "" ":class:`int` 型別有一個新方法 :meth:`int.bit_count`,回傳給定整數的二進位展開" -"式中 1 的數量,也稱為總體計數 (population count)。(由 Niklas Fiekas " -"在 :issue:`29882` 中貢獻。)" +"式中 1 的數量,也稱為總體計數 (population count)。(由 Niklas Fiekas 在 :" +"issue:`29882` 中貢獻。)" #: ../../whatsnew/3.10.rst:817 msgid "" -"The views returned by :meth:`dict.keys`, :meth:`dict.values` " -"and :meth:`dict.items` now all have a ``mapping`` attribute that gives " -"a :class:`types.MappingProxyType` object wrapping the original dictionary. " -"(Contributed by Dennis Sweeney in :issue:`40890`.)" +"The views returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:`dict." +"items` now all have a ``mapping`` attribute that gives a :class:`types." +"MappingProxyType` object wrapping the original dictionary. (Contributed by " +"Dennis Sweeney in :issue:`40890`.)" msgstr "" ":meth:`dict.keys`、:meth:`dict.values` 和 :meth:`dict.items` 回傳的視圖 " -"(view) 現在都有一個 ``mapping`` 屬性,該屬性提" -"供 :class:`types.MappingProxyType` 包裝原始的字典物件。(由 Dennis Sweeney " -"在 :issue:`40890` 中貢獻。)" +"(view) 現在都有一個 ``mapping`` 屬性,該屬性提供 :class:`types." +"MappingProxyType` 包裝原始的字典物件。(由 Dennis Sweeney 在 :issue:`40890` " +"中貢獻。)" #: ../../whatsnew/3.10.rst:822 msgid "" @@ -1511,15 +1512,13 @@ msgid "" "Builtin and extension functions that take integer arguments no longer " "accept :class:`~decimal.Decimal`\\ s, :class:`~fractions.Fraction`\\ s and " "other objects that can be converted to integers only with a loss (e.g. that " -"have the :meth:`~object.__int__` method but do not have " -"the :meth:`~object.__index__` method). (Contributed by Serhiy Storchaka " -"in :issue:`37999`.)" -msgstr "" -"採用整數引數的內建函式和擴充函式不再接" -"受 :class:`~decimal.Decimal`、:class:`~fractions.Fraction` 以及其他只能在有損" -"失的情況下轉換為整數的物件(例如有 :meth:`~object.__int__` 方法,但沒" -"有 :meth:`~object.__index__` 方法)。(由 Serhiy Storchaka 在 :issue:`37999` " -"中貢獻。)" +"have the :meth:`~object.__int__` method but do not have the :meth:`~object." +"__index__` method). (Contributed by Serhiy Storchaka in :issue:`37999`.)" +msgstr "" +"採用整數引數的內建函式和擴充函式不再接受 :class:`~decimal.Decimal`、:class:" +"`~fractions.Fraction` 以及其他只能在有損失的情況下轉換為整數的物件(例如有 :" +"meth:`~object.__int__` 方法,但沒有 :meth:`~object.__index__` 方法)。(由 " +"Serhiy Storchaka 在 :issue:`37999` 中貢獻。)" #: ../../whatsnew/3.10.rst:832 msgid "" @@ -1559,21 +1558,21 @@ msgid "" "respectively. (Contributed by Joshua Bronson, Daniel Pope, and Justin Wang " "in :issue:`31861`.)" msgstr "" -"新增兩個內建函式 -- :func:`aiter` 和 :func:`anext`,分別為 :func:`iter` " -"和 :func:`next` 提供非同步的對應函式。(由 Joshua Bronson、Daniel Pope 和 " -"Justin Wang 在 :issue:`31861` 中貢獻。)" +"新增兩個內建函式 -- :func:`aiter` 和 :func:`anext`,分別為 :func:`iter` 和 :" +"func:`next` 提供非同步的對應函式。(由 Joshua Bronson、Daniel Pope 和 Justin " +"Wang 在 :issue:`31861` 中貢獻。)" #: ../../whatsnew/3.10.rst:850 +#, fuzzy msgid "" -"Static methods (:func:`@staticmethod `) and class methods " -"(:func:`@classmethod `) now inherit the method attributes " -"(``__module__``, ``__name__``, ``__qualname__``, ``__doc__``, " -"``__annotations__``) and have a new ``__wrapped__`` attribute. Moreover, " -"static methods are now callable as regular functions. (Contributed by Victor " -"Stinner in :issue:`43682`.)" +"Static methods (:deco:`staticmethod`) and class methods (:deco:" +"`classmethod`) now inherit the method attributes (``__module__``, " +"``__name__``, ``__qualname__``, ``__doc__``, ``__annotations__``) and have a " +"new ``__wrapped__`` attribute. Moreover, static methods are now callable as " +"regular functions. (Contributed by Victor Stinner in :issue:`43682`.)" msgstr "" -"靜態方法 (:func:`@staticmethod `) 和類別方法 " -"(:func:`@classmethod `) 現在繼承方法屬性 (``__module__``, " +"靜態方法 (:func:`@staticmethod `) 和類別方法 (:func:" +"`@classmethod `) 現在繼承方法屬性 (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__``, ``__annotations__``) 並有一個新" "的 ``__wrapped__`` 屬性。此外,靜態方法現在可以像是常規函式般呼叫。(由 " "Victor Stinner 在 :issue:`43682` 中貢獻。)" @@ -1582,8 +1581,8 @@ msgstr "" msgid "" "Annotations for complex targets (everything beside ``simple name`` targets " "defined by :pep:`526`) no longer cause any runtime effects with ``from " -"__future__ import annotations``. (Contributed by Batuhan Taskaya " -"in :issue:`42737`.)" +"__future__ import annotations``. (Contributed by Batuhan Taskaya in :issue:" +"`42737`.)" msgstr "" "複雜目標(除 :pep:`526` 定義的 ``simple name`` 目標之外的所有內容)的註釋不再" "使用 ``from __future__ import comments`` 造成任何執行環境 (runtime) 影響。" @@ -1599,15 +1598,15 @@ msgid "" msgstr "" "類別和模組物件現在會根據需求來延遲建立 (lazy-create) 空的註釋字典 " "(annotations dicts)。註釋字典儲存在物件的 ``__dict__`` 中以達成向後相容性。這" -"改進了 ``__annotations__`` 使用方式的最佳實踐方法;有關更多資訊,請參" -"閱 :ref:`annotations-howto`。(由 Larry Hastings 在 :issue:`43901` 中貢獻。)" +"改進了 ``__annotations__`` 使用方式的最佳實踐方法;有關更多資訊,請參閱 :ref:" +"`annotations-howto`。(由 Larry Hastings 在 :issue:`43901` 中貢獻。)" #: ../../whatsnew/3.10.rst:868 msgid "" "Annotations consist of ``yield``, ``yield from``, ``await`` or named " "expressions are now forbidden under ``from __future__ import annotations`` " -"due to their side effects. (Contributed by Batuhan Taskaya " -"in :issue:`42725`.)" +"due to their side effects. (Contributed by Batuhan Taskaya in :issue:" +"`42725`.)" msgstr "" "附名運算式或由 ``yield``、``yield from``、``await`` 組成的註釋現在在 ``from " "__future__ import comments`` 下被禁止,因為它們有些不預期的行為。(由 " @@ -1626,12 +1625,12 @@ msgstr "" #: ../../whatsnew/3.10.rst:878 msgid "" -"Hashes of NaN values of both :class:`float` type " -"and :class:`decimal.Decimal` type now depend on object identity. Formerly, " -"they always hashed to ``0`` even though NaN values are not equal to one " -"another. This caused potentially quadratic runtime behavior due to excessive " -"hash collisions when creating dictionaries and sets containing multiple " -"NaNs. (Contributed by Raymond Hettinger in :issue:`43475`.)" +"Hashes of NaN values of both :class:`float` type and :class:`decimal." +"Decimal` type now depend on object identity. Formerly, they always hashed to " +"``0`` even though NaN values are not equal to one another. This caused " +"potentially quadratic runtime behavior due to excessive hash collisions when " +"creating dictionaries and sets containing multiple NaNs. (Contributed by " +"Raymond Hettinger in :issue:`43475`.)" msgstr "" ":class:`float` 型別和 :class:`decimal.Decimal` 型別的 NaN 值的雜湊值現在取決" "於物件的標識值 (identity)。以前即使 NaN 值彼此不相等,它們也總是被雜湊為 " @@ -1642,11 +1641,11 @@ msgstr "" #: ../../whatsnew/3.10.rst:885 msgid "" "A :exc:`SyntaxError` (instead of a :exc:`NameError`) will be raised when " -"deleting the :const:`__debug__` constant. (Contributed by Donghee Na " -"in :issue:`45000`.)" +"deleting the :const:`__debug__` constant. (Contributed by Donghee Na in :" +"issue:`45000`.)" msgstr "" -"刪除 :const:`__debug__` 常數時將引發 :exc:`SyntaxError` (而不" -"是 :exc:`NameError`)。(由 Donghee Na 在 :issue:`45000` 中貢獻。)" +"刪除 :const:`__debug__` 常數時將引發 :exc:`SyntaxError` (而不是 :exc:" +"`NameError`)。(由 Donghee Na 在 :issue:`45000` 中貢獻。)" #: ../../whatsnew/3.10.rst:888 msgid "" @@ -1706,8 +1705,8 @@ msgid "" "Zackery Spytz in :issue:`31956`.)" msgstr "" ":class:`array.array` 的 :meth:`~array.array.index` 方法現在具有可選的 " -"*start* 和 *stop* 參數。(由 Anders Lorentsen 和 Zackery Spytz " -"在 :issue:`31956` 中貢獻。)" +"*start* 和 *stop* 參數。(由 Anders Lorentsen 和 Zackery Spytz 在 :issue:" +"`31956` 中貢獻。)" #: ../../whatsnew/3.10.rst:922 msgid "asynchat, asyncore, smtpd" @@ -1719,8 +1718,8 @@ msgid "" "since Python 3.6. An import-time :class:`DeprecationWarning` has now been " "added to all three of these modules." msgstr "" -"自 Python 3.6 起,這些模組在其文件中被標記為已棄用。引入時" -"的 :class:`DeprecationWarning` 現已新增到這三個模組中。" +"自 Python 3.6 起,這些模組在其文件中被標記為已棄用。引入時的 :class:" +"`DeprecationWarning` 現已新增到這三個模組中。" #: ../../whatsnew/3.10.rst:928 msgid "base64" @@ -1743,8 +1742,8 @@ msgid "" "Add :meth:`!clearBreakpoints` to reset all set breakpoints. (Contributed by " "Irit Katriel in :issue:`24160`.)" msgstr "" -"新增 :meth:`!clearBreakpoints` 來重置所有設定的斷點。(由 Irit Katriel " -"在 :issue:`24160` 中貢獻。)" +"新增 :meth:`!clearBreakpoints` 來重置所有設定的斷點。(由 Irit Katriel 在 :" +"issue:`24160` 中貢獻。)" #: ../../whatsnew/3.10.rst:940 msgid "bisect" @@ -1752,9 +1751,8 @@ msgstr "bisect" #: ../../whatsnew/3.10.rst:942 msgid "" -"Added the possibility of providing a *key* function to the APIs in " -"the :mod:`bisect` module. (Contributed by Raymond Hettinger " -"in :issue:`4356`.)" +"Added the possibility of providing a *key* function to the APIs in the :mod:" +"`bisect` module. (Contributed by Raymond Hettinger in :issue:`4356`.)" msgstr "" "新增向 :mod:`bisect` 模組 API 提供 *key* 函式的可能性。(由 Raymond " "Hettinger 在 :issue:`4356` 中貢獻。)" @@ -1778,29 +1776,28 @@ msgstr "collections.abc" #: ../../whatsnew/3.10.rst:954 msgid "" "The ``__args__`` of the :ref:`parameterized generic ` " -"for :class:`collections.abc.Callable` are now consistent " -"with :data:`typing.Callable`. :class:`collections.abc.Callable` generic now " -"flattens type parameters, similar to what :data:`typing.Callable` currently " -"does. This means that ``collections.abc.Callable[[int, str], str]`` will " -"have ``__args__`` of ``(int, str, str)``; previously this was ``([int, str], " +"for :class:`collections.abc.Callable` are now consistent with :data:`typing." +"Callable`. :class:`collections.abc.Callable` generic now flattens type " +"parameters, similar to what :data:`typing.Callable` currently does. This " +"means that ``collections.abc.Callable[[int, str], str]`` will have " +"``__args__`` of ``(int, str, str)``; previously this was ``([int, str], " "str)``. To allow this change, :class:`types.GenericAlias` can now be " -"subclassed, and a subclass will be returned when subscripting " -"the :class:`collections.abc.Callable` type. Note that a :exc:`TypeError` " -"may be raised for invalid forms of " -"parameterizing :class:`collections.abc.Callable` which may have passed " -"silently in Python 3.9. (Contributed by Ken Jin in :issue:`42195`.)" +"subclassed, and a subclass will be returned when subscripting the :class:" +"`collections.abc.Callable` type. Note that a :exc:`TypeError` may be raised " +"for invalid forms of parameterizing :class:`collections.abc.Callable` which " +"may have passed silently in Python 3.9. (Contributed by Ken Jin in :issue:" +"`42195`.)" msgstr "" ":class:`collections.abc.Callable` 的\\ :ref:`參數化泛型 (parameterized " -"generic) ` 的 ``__args__`` 現在" -"與 :data:`typing.Callable` 一致。:class:`collections.abc.Callable` 泛型現在會" -"將型別參數攤平,類似於 :data:`typing.Callable` 目前的做法。這意味著 " -"``collections.abc.Callable[[int, str], str]`` 將具有 ``(int, str, str)`` 的 " -"``__args__``;在以前這是 ``([int, str], str)``。為了允許此更改,現在可以" -"對 :class:`types.GenericAlias` 進行子類別化,並且在下標 " -"(subscript) :class:`collections.abc.Callable` 型別時將回傳子類別。請注意,對" -"於無效形式的 :class:`collections.abc.Callable` 參數化可能會引" -"發 :exc:`TypeError`,而在 Python 3.9 中該參數可能會無引發例外地傳遞。(由 " -"Ken Jin 在 :issue:`42195` 中貢獻。)" +"generic) ` 的 ``__args__`` 現在與 :data:`typing." +"Callable` 一致。:class:`collections.abc.Callable` 泛型現在會將型別參數攤平," +"類似於 :data:`typing.Callable` 目前的做法。這意味著 ``collections.abc." +"Callable[[int, str], str]`` 將具有 ``(int, str, str)`` 的 ``__args__``;在以" +"前這是 ``([int, str], str)``。為了允許此更改,現在可以對 :class:`types." +"GenericAlias` 進行子類別化,並且在下標 (subscript) :class:`collections.abc." +"Callable` 型別時將回傳子類別。請注意,對於無效形式的 :class:`collections.abc." +"Callable` 參數化可能會引發 :exc:`TypeError`,而在 Python 3.9 中該參數可能會無" +"引發例外地傳遞。(由 Ken Jin 在 :issue:`42195` 中貢獻。)" #: ../../whatsnew/3.10.rst:967 msgid "contextlib" @@ -1839,18 +1836,17 @@ msgstr "curses" #: ../../whatsnew/3.10.rst:982 msgid "" "The extended color functions added in ncurses 6.1 will be used transparently " -"by :func:`curses.color_content`, :func:`curses.init_color`, :func:`curses.init_pair`, " -"and :func:`curses.pair_content`. A new " -"function, :func:`curses.has_extended_color_support`, indicates whether " -"extended color support is provided by the underlying ncurses library. " -"(Contributed by Jeffrey Kintscher and Hans Petter Jansson in :issue:`36982`.)" -msgstr "" -"ncurses 6.1 中新增的擴充顏色函式將" -"由 :func:`curses.color_content`、:func:`curses.init_color`、:func:`curses.init_pair` " -"和 :func:`curses.pair_content` 透明地使用。新函" -"式 :func:`curses.has_extended_color_support` 表示了底層的 ncurses 函式庫是否" -"支援擴充顏色。(由 Jeffrey Kintscher 和 Hans Petter Jansson " -"在 :issue:`36982` 中貢獻。)" +"by :func:`curses.color_content`, :func:`curses.init_color`, :func:`curses." +"init_pair`, and :func:`curses.pair_content`. A new function, :func:`curses." +"has_extended_color_support`, indicates whether extended color support is " +"provided by the underlying ncurses library. (Contributed by Jeffrey " +"Kintscher and Hans Petter Jansson in :issue:`36982`.)" +msgstr "" +"ncurses 6.1 中新增的擴充顏色函式將由 :func:`curses.color_content`、:func:" +"`curses.init_color`、:func:`curses.init_pair` 和 :func:`curses.pair_content` " +"透明地使用。新函式 :func:`curses.has_extended_color_support` 表示了底層的 " +"ncurses 函式庫是否支援擴充顏色。(由 Jeffrey Kintscher 和 Hans Petter " +"Jansson 在 :issue:`36982` 中貢獻。)" #: ../../whatsnew/3.10.rst:989 msgid "" @@ -1995,18 +1991,18 @@ msgid "" "3.12. Its functionality for specifying package builds has already been " "completely replaced by third-party packages ``setuptools`` and " "``packaging``, and most other commonly used APIs are available elsewhere in " -"the standard library (such " -"as :mod:`platform`, :mod:`shutil`, :mod:`subprocess` or :mod:`sysconfig`). " -"There are no plans to migrate any other functionality from ``distutils``, " -"and applications that are using other functions should plan to make private " -"copies of the code. Refer to :pep:`632` for discussion." +"the standard library (such as :mod:`platform`, :mod:`shutil`, :mod:" +"`subprocess` or :mod:`sysconfig`). There are no plans to migrate any other " +"functionality from ``distutils``, and applications that are using other " +"functions should plan to make private copies of the code. Refer to :pep:" +"`632` for discussion." msgstr "" "整個 ``distutils`` 套件已被棄用,將在 Python 3.12 中刪除。它指定套件建置的功" "能已經完全被第三方套件 ``setuptools`` 和 ``packaging`` 所取代,並且大多數其他" -"常用的 API 都可以在標準函式庫的其他地方被找到(例" -"如 :mod:`platform` 、:mod:`shutil`、:mod:`subprocess` 或 :mod:`sysconfig`)。" -"目前沒有將 ``distutils`` 遷移任何其他地方的計畫,且使用其他功能的應用程式應該" -"開始規劃如何取得程式碼的私有副本。請參閱 :pep:`632` 的討論。" +"常用的 API 都可以在標準函式庫的其他地方被找到(例如 :mod:`platform` 、:mod:" +"`shutil`、:mod:`subprocess` 或 :mod:`sysconfig`)。目前沒有將 ``distutils`` " +"遷移任何其他地方的計畫,且使用其他功能的應用程式應該開始規劃如何取得程式碼的" +"私有副本。請參閱 :pep:`632` 的討論。" #: ../../whatsnew/3.10.rst:1073 msgid "" @@ -2015,8 +2011,8 @@ msgid "" "Windows. (Contributed by Victor Stinner in :issue:`42802`.)" msgstr "" "Python 3.8 中不推薦使用的 ``bdist_wininst`` 命令已被刪除。現在建議使用 " -"``bdist_wheel`` 命令來在 Windows 上發布二進位套件。(由 Victor Stinner " -"在 :issue:`42802` 中貢獻。)" +"``bdist_wheel`` 命令來在 Windows 上發布二進位套件。(由 Victor Stinner 在 :" +"issue:`42802` 中貢獻。)" #: ../../whatsnew/3.10.rst:1079 msgid "doctest" @@ -2025,8 +2021,8 @@ msgstr "doctest" #: ../../whatsnew/3.10.rst:1081 ../../whatsnew/3.10.rst:1216 #: ../../whatsnew/3.10.rst:1243 ../../whatsnew/3.10.rst:1342 msgid "" -"When a module does not define ``__loader__``, fall back to " -"``__spec__.loader``. (Contributed by Brett Cannon in :issue:`42133`.)" +"When a module does not define ``__loader__``, fall back to ``__spec__." +"loader``. (Contributed by Brett Cannon in :issue:`42133`.)" msgstr "" "當模組未定義 ``__loader__`` 時,回退到 ``__spec__.loader`` 。(由 Brett " "Cannon 在 :issue:`42133` 中貢獻。)" @@ -2040,8 +2036,8 @@ msgid "" ":func:`encodings.normalize_encoding` now ignores non-ASCII characters. " "(Contributed by Hai Shi in :issue:`39337`.)" msgstr "" -":func:`encodings.normalize_encoding` 現在會忽略非 ASCII 字元。(Hai Shi " -"在 :issue:`39337` 中貢獻。)" +":func:`encodings.normalize_encoding` 現在會忽略非 ASCII 字元。(Hai Shi 在 :" +"issue:`39337` 中貢獻。)" #: ../../whatsnew/3.10.rst:1091 msgid "enum" @@ -2049,25 +2045,23 @@ msgstr "enum" #: ../../whatsnew/3.10.rst:1093 msgid "" -":class:`~enum.Enum` :func:`~object.__repr__` now returns " -"``enum_name.member_name`` and :func:`~object.__str__` now returns " -"``member_name``. Stdlib enums available as module constants have " -"a :func:`repr` of ``module_name.member_name``. (Contributed by Ethan Furman " -"in :issue:`40066`.)" +":class:`~enum.Enum` :func:`~object.__repr__` now returns ``enum_name." +"member_name`` and :func:`~object.__str__` now returns ``member_name``. " +"Stdlib enums available as module constants have a :func:`repr` of " +"``module_name.member_name``. (Contributed by Ethan Furman in :issue:`40066`.)" msgstr "" -":class:`~enum.Enum` :func:`~object.__repr__` 現在會回傳 " -"``enum_name.member_name`` 、:func:`~object.__str__` 現在會回傳 " -"``member_name`` 。可用作模組常數的標準函式庫列舉會有 " -"``module_name.member_name`` 的 :func:`repr`。(由 Ethan Furman " -"在 :issue:`40066` 中貢獻。)" +":class:`~enum.Enum` :func:`~object.__repr__` 現在會回傳 ``enum_name." +"member_name`` 、:func:`~object.__str__` 現在會回傳 ``member_name`` 。可用作模" +"組常數的標準函式庫列舉會有 ``module_name.member_name`` 的 :func:`repr`。(由 " +"Ethan Furman 在 :issue:`40066` 中貢獻。)" #: ../../whatsnew/3.10.rst:1098 msgid "" "Add :class:`enum.StrEnum` for enums where all members are strings. " "(Contributed by Ethan Furman in :issue:`41816`.)" msgstr "" -"新增 :class:`enum.StrEnum`,為所有成員都是字串的列舉。(由 Ethan Furman " -"在 :issue:`41816` 中貢獻。)" +"新增 :class:`enum.StrEnum`,為所有成員都是字串的列舉。(由 Ethan Furman 在 :" +"issue:`41816` 中貢獻。)" #: ../../whatsnew/3.10.rst:1102 msgid "fileinput" @@ -2075,9 +2069,8 @@ msgstr "fileinput" #: ../../whatsnew/3.10.rst:1104 msgid "" -"Add *encoding* and *errors* parameters in :func:`fileinput.input` " -"and :class:`fileinput.FileInput`. (Contributed by Inada Naoki " -"in :issue:`43712`.)" +"Add *encoding* and *errors* parameters in :func:`fileinput.input` and :class:" +"`fileinput.FileInput`. (Contributed by Inada Naoki in :issue:`43712`.)" msgstr "" "在 :func:`fileinput.input` 和 :class:`fileinput.FileInput` 中新增 *encoding* " "和 *errors* 參數。(由 Inada Naoki 在 :issue:`43712` 中貢獻。)" @@ -2099,8 +2092,8 @@ msgstr "faulthandler" #: ../../whatsnew/3.10.rst:1115 msgid "" "The :mod:`faulthandler` module now detects if a fatal error occurs during a " -"garbage collector collection. (Contributed by Victor Stinner " -"in :issue:`44466`.)" +"garbage collector collection. (Contributed by Victor Stinner in :issue:" +"`44466`.)" msgstr "" ":mod:`faulthandler` 模組現在可以檢測垃圾收集器 (garbage collector) 在收集期間" "是否發生嚴重錯誤。(由 Victor Stinner 在 :issue:`44466` 中貢獻。)" @@ -2111,13 +2104,12 @@ msgstr "gc" #: ../../whatsnew/3.10.rst:1122 msgid "" -"Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` " -"and :func:`gc.get_referents`. (Contributed by Pablo Galindo " -"in :issue:`43439`.)" +"Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and :" +"func:`gc.get_referents`. (Contributed by Pablo Galindo in :issue:`43439`.)" msgstr "" -"為 :func:`gc.get_objects`、:func:`gc.get_referrers` " -"和 :func:`gc.get_referents` 新增稽核掛鉤 (audit hooks)。(由 Pablo Galindo " -"在 :issue:`43439` 中貢獻。)" +"為 :func:`gc.get_objects`、:func:`gc.get_referrers` 和 :func:`gc." +"get_referents` 新增稽核掛鉤 (audit hooks)。(由 Pablo Galindo 在 :issue:" +"`43439` 中貢獻。)" #: ../../whatsnew/3.10.rst:1126 msgid "glob" @@ -2125,9 +2117,9 @@ msgstr "glob" #: ../../whatsnew/3.10.rst:1128 msgid "" -"Add the *root_dir* and *dir_fd* parameters in :func:`~glob.glob` " -"and :func:`~glob.iglob` which allow to specify the root directory for " -"searching. (Contributed by Serhiy Storchaka in :issue:`38144`.)" +"Add the *root_dir* and *dir_fd* parameters in :func:`~glob.glob` and :func:" +"`~glob.iglob` which allow to specify the root directory for searching. " +"(Contributed by Serhiy Storchaka in :issue:`38144`.)" msgstr "" "在 :func:`~glob.glob` 和 :func:`~glob.iglob` 中新增 *root_dir* 和 *dir_fd* 參" "數,允許指定搜尋的根目錄。(由 Serhiy Storchaka 在 :issue:`38144` 中貢獻。)" @@ -2141,8 +2133,8 @@ msgid "" "The hashlib module requires OpenSSL 1.1.1 or newer. (Contributed by " "Christian Heimes in :pep:`644` and :issue:`43669`.)" msgstr "" -"hashlib 模組需要 OpenSSL 1.1.1 或更高版本。(由 Christian Heimes " -"在 :pep:`644` 和 :issue:`43669` 中貢獻。)" +"hashlib 模組需要 OpenSSL 1.1.1 或更高版本。(由 Christian Heimes 在 :pep:" +"`644` 和 :issue:`43669` 中貢獻。)" #: ../../whatsnew/3.10.rst:1138 msgid "" @@ -2171,8 +2163,8 @@ msgid "" "The hmac module now uses OpenSSL's HMAC implementation internally. " "(Contributed by Christian Heimes in :issue:`40645`.)" msgstr "" -"hmac 模組現在在內部使用 OpenSSL 的 HMAC 實作。(由 Christian Heimes " -"在 :issue:`40645` 中貢獻。)" +"hmac 模組現在在內部使用 OpenSSL 的 HMAC 實作。(由 Christian Heimes 在 :" +"issue:`40645` 中貢獻。)" #: ../../whatsnew/3.10.rst:1153 msgid "IDLE and idlelib" @@ -2181,8 +2173,8 @@ msgstr "IDLE 和 idlelib" #: ../../whatsnew/3.10.rst:1155 msgid "" "Make IDLE invoke :func:`sys.excepthook` (when started without '-n'). User " -"hooks were previously ignored. (Contributed by Ken Hilton " -"in :issue:`43008`.)" +"hooks were previously ignored. (Contributed by Ken Hilton in :issue:" +"`43008`.)" msgstr "" "讓 IDLE 叫用 :func:`sys.excepthook` (在沒有 ``-n`` 的情況下啟動時)。使用者" "掛鉤 (user hooks) 在以前是被忽略的。(由 Ken Hilton 在 :issue:`43008` 中貢" @@ -2193,10 +2185,10 @@ msgid "" "Rearrange the settings dialog. Split the General tab into Windows and Shell/" "Ed tabs. Move help sources, which extend the Help menu, to the Extensions " "tab. Make space for new options and shorten the dialog. The latter makes " -"the dialog better fit small screens. (Contributed by Terry Jan Reedy " -"in :issue:`40468`.) Move the indent space setting from the Font tab to the " -"new Windows tab. (Contributed by Mark Roseman and Terry Jan Reedy " -"in :issue:`33962`.)" +"the dialog better fit small screens. (Contributed by Terry Jan Reedy in :" +"issue:`40468`.) Move the indent space setting from the Font tab to the new " +"Windows tab. (Contributed by Mark Roseman and Terry Jan Reedy in :issue:" +"`33962`.)" msgstr "" "重新排列設定對話框。將 General 分頁拆分為 Windows 和 Shell/Ed 分頁。將擴充 " "Help 選單的幫助來源移至 Extensions 分頁。為新選項騰出空間並縮短對話框,而後者" @@ -2218,9 +2210,9 @@ msgid "" "the selected text. This option also appears on the context menu for the " "text. (Contributed by Tal Einat in :issue:`37903`.)" msgstr "" -"新增 Shell 側邊欄。將主要提示字元 (``>>>``) 移至側邊欄。將輔助提示字元" -"(``...``)新增到側邊欄。點擊左鍵再拖動能夠選擇一行或多行文字,和編輯器列號側" -"邊欄操作一樣。選擇文字列後點擊右鍵會顯示帶有「一併複製提示字元 (copy with " +"新增 Shell 側邊欄。將主要提示字元 (``>>>``) 移至側邊欄。將輔助提示字元(``..." +"``)新增到側邊欄。點擊左鍵再拖動能夠選擇一行或多行文字,和編輯器列號側邊欄操" +"作一樣。選擇文字列後點擊右鍵會顯示帶有「一併複製提示字元 (copy with " "prompts)」的情境選單,這會將側邊欄中提示字元與所選文字並排,此選項也會出現在" "文字的情境選單上。(由 Tal Einat 在 :issue:`37903` 中貢獻。)" @@ -2237,12 +2229,11 @@ msgstr "" #: ../../whatsnew/3.10.rst:1183 msgid "" -"Highlight the new :ref:`soft keywords ` :keyword:`match`, :keyword:`case `, and :keyword:`_ " -"` in pattern-matching statements. However, this " -"highlighting is not perfect and will be incorrect in some rare cases, " -"including some ``_``-s in ``case`` patterns. (Contributed by Tal Einat " -"in :issue:`44010`.)" +"Highlight the new :ref:`soft keywords ` :keyword:`match`, :" +"keyword:`case `, and :keyword:`_ ` in pattern-" +"matching statements. However, this highlighting is not perfect and will be " +"incorrect in some rare cases, including some ``_``-s in ``case`` patterns. " +"(Contributed by Tal Einat in :issue:`44010`.)" msgstr "" "突顯 (highlight) 模式匹配陳述式中的新\\ :ref:`軟關鍵字 (soft keywords) ` :keyword:`match`、:keyword:`case ` 和 :keyword:`_ " @@ -2266,8 +2257,8 @@ msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" msgstr "" -"保存帶有輸入和輸出的 Shell 時,會包含提示字元。(由 Terry Jan Reedy " -"在 :gh:`95191` 中貢獻。)" +"保存帶有輸入和輸出的 Shell 時,會包含提示字元。(由 Terry Jan Reedy 在 :gh:" +"`95191` 中貢獻。)" #: ../../whatsnew/3.10.rst:1198 msgid "importlib.metadata" @@ -2278,19 +2269,19 @@ msgid "" "Feature parity with ``importlib_metadata`` 4.6 (`history `_)." msgstr "" -"與 ``importlib_metadata`` 4.6 功能相同(`歷史 `_)。" +"與 ``importlib_metadata`` 4.6 功能相同(`歷史 `_)。" #: ../../whatsnew/3.10.rst:1203 msgid "" ":ref:`importlib.metadata entry points ` now provide a nicer " -"experience for selecting entry points by group and name through a " -"new :ref:`importlib.metadata.EntryPoints ` class. See the " -"Compatibility Note in the docs for more info on the deprecation and usage." +"experience for selecting entry points by group and name through a new :ref:" +"`importlib.metadata.EntryPoints ` class. See the Compatibility " +"Note in the docs for more info on the deprecation and usage." msgstr "" -":ref:`importlib.metadata 入口點 `\\ 現在透過新" -"的 :ref:`importlib.metadata.EntryPoints ` 類別提供了以群組和名" -"稱選擇入口點的更好體驗。有關棄用與用法的更多資訊,請參閱文件中的相容性說明。" +":ref:`importlib.metadata 入口點 `\\ 現在透過新的 :ref:" +"`importlib.metadata.EntryPoints ` 類別提供了以群組和名稱選擇入" +"口點的更好體驗。有關棄用與用法的更多資訊,請參閱文件中的相容性說明。" #: ../../whatsnew/3.10.rst:1209 msgid "" @@ -2299,8 +2290,8 @@ msgid "" "their :ref:`importlib.metadata.Distribution `." msgstr "" "新增了 :ref:`importlib.metadata.packages_distributions() ` 用於將頂階 Python 模組和套件解析" -"出 :ref:`importlib.metadata.Distribution `。" +"distributions>` 用於將頂階 Python 模組和套件解析出 :ref:`importlib.metadata." +"Distribution `。" #: ../../whatsnew/3.10.rst:1214 msgid "inspect" @@ -2312,27 +2303,25 @@ msgid "" "defined on an object. It works around the quirks of accessing the " "annotations on various types of objects, and makes very few assumptions " "about the object it examines. :func:`inspect.get_annotations` can also " -"correctly un-stringize stringized " -"annotations. :func:`inspect.get_annotations` is now considered best " -"practice for accessing the annotations dict defined on any Python object; " -"for more information on best practices for working with annotations, please " -"see :ref:`annotations-howto`. " -"Relatedly, :func:`inspect.signature`, :func:`inspect.Signature.from_callable`, " -"and :func:`!inspect.Signature.from_function` now " -"call :func:`inspect.get_annotations` to retrieve annotations. This " -"means :func:`inspect.signature` and :func:`inspect.Signature.from_callable` " -"can also now un-stringize stringized annotations. (Contributed by Larry " -"Hastings in :issue:`43817`.)" +"correctly un-stringize stringized annotations. :func:`inspect." +"get_annotations` is now considered best practice for accessing the " +"annotations dict defined on any Python object; for more information on best " +"practices for working with annotations, please see :ref:`annotations-howto`. " +"Relatedly, :func:`inspect.signature`, :func:`inspect.Signature." +"from_callable`, and :func:`!inspect.Signature.from_function` now call :func:" +"`inspect.get_annotations` to retrieve annotations. This means :func:`inspect." +"signature` and :func:`inspect.Signature.from_callable` can also now un-" +"stringize stringized annotations. (Contributed by Larry Hastings in :issue:" +"`43817`.)" msgstr "" "新增 :func:`inspect.get_annotations`,它可以安全地計算物件上定義的註釋。它是" "存取各種型別物件註釋的怪作法 (quirks) 的變通解法 (work around),並且對其檢查" "的物件做出很少的假設。 :func:`inspect.get_annotations` 也可以正確地取消字串化" "註釋 (stringized annotations)。 :func:`inspect.get_annotations` 現在被認為是" "存取任何 Python 物件上定義的註釋字典的最佳實踐;有關使用註釋的最佳實踐的更多" -"資訊,請參閱 :ref:`annotations-howto`。相關" -"地,:func:`inspect.signature`、:func:`inspect.Signature.from_callable` " -"和 :func:`!inspect.Signature.from_function` 現在呼" -"叫 :func:`inspect.get_annotations` 來檢索註釋。這意味" +"資訊,請參閱 :ref:`annotations-howto`。相關地,:func:`inspect.signature`、:" +"func:`inspect.Signature.from_callable` 和 :func:`!inspect.Signature." +"from_function` 現在呼叫 :func:`inspect.get_annotations` 來檢索註釋。這意味" "著 :func:`inspect.signature` 和 :func:`inspect.Signature.from_callable` 現在" "也可以取消字串化註釋。(由 Larry Hastings 在 :issue:`43817` 中貢獻。)" @@ -2342,8 +2331,8 @@ msgstr "itertools" #: ../../whatsnew/3.10.rst:1237 msgid "" -"Add :func:`itertools.pairwise`. (Contributed by Raymond Hettinger " -"in :issue:`38200`.)" +"Add :func:`itertools.pairwise`. (Contributed by Raymond Hettinger in :issue:" +"`38200`.)" msgstr "" "新增 :func:`itertools.pairwise`。(由 Raymond Hettinger 在 :issue:`38200` 中" "貢獻。)" @@ -2361,14 +2350,14 @@ msgid "" "Add :func:`os.cpu_count` support for VxWorks RTOS. (Contributed by Peixing " "Xin in :issue:`41440`.)" msgstr "" -"為 VxWorks RTOS 新增 :func:`os.cpu_count` 支援。(由 Peixing Xin " -"在 :issue:`41440` 中貢獻。)" +"為 VxWorks RTOS 新增 :func:`os.cpu_count` 支援。(由 Peixing Xin 在 :issue:" +"`41440` 中貢獻。)" #: ../../whatsnew/3.10.rst:1252 msgid "" "Add a new function :func:`os.eventfd` and related helpers to wrap the " -"``eventfd2`` syscall on Linux. (Contributed by Christian Heimes " -"in :issue:`41001`.)" +"``eventfd2`` syscall on Linux. (Contributed by Christian Heimes in :issue:" +"`41001`.)" msgstr "" "新增函式 :func:`os.eventfd` 和相關幫助程式來包裝 Linux 上的 ``eventfd2`` 系統" "呼叫。(由 Christian Heimes 在 :issue:`41001` 中貢獻。)" @@ -2388,12 +2377,12 @@ msgstr "" #: ../../whatsnew/3.10.rst:1261 msgid "" "Add :const:`~os.O_EVTONLY`, :const:`~os.O_FSYNC`, :const:`~os.O_SYMLINK` " -"and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Donghee Na " -"in :issue:`43106`.)" +"and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Donghee Na in :" +"issue:`43106`.)" msgstr "" -"為 macOS 新" -"增 :const:`~os.O_EVTONLY`、:const:`~os.O_FSYNC`、:const:`~os.O_SYMLINK` " -"和 :const:`~os.O_NOFOLLOW_ANY`。(由 Donghee Na 在 :issue:`43106` 中貢獻。)" +"為 macOS 新增 :const:`~os.O_EVTONLY`、:const:`~os.O_FSYNC`、:const:`~os." +"O_SYMLINK` 和 :const:`~os.O_NOFOLLOW_ANY`。(由 Donghee Na 在 :issue:`43106` " +"中貢獻。)" #: ../../whatsnew/3.10.rst:1266 msgid "os.path" @@ -2406,8 +2395,8 @@ msgid "" "symlink loop is encountered. (Contributed by Barney Gale in :issue:`43757`.)" msgstr "" ":func:`os.path.realpath` 現在接受一個 *strict* 僅限關鍵字引數。當設定為 " -"``True`` 時,如果路徑不存在或遇到符號鏈接循環 (symlink loop),則會引" -"發 :exc:`OSError`。(由 Barney Gale 在 :issue:`43757` 中貢獻。)" +"``True`` 時,如果路徑不存在或遇到符號鏈接循環 (symlink loop),則會引發 :exc:" +"`OSError`。(由 Barney Gale 在 :issue:`43757` 中貢獻。)" #: ../../whatsnew/3.10.rst:1274 msgid "pathlib" @@ -2423,9 +2412,8 @@ msgstr "" #: ../../whatsnew/3.10.rst:1279 msgid "" -"Add negative indexing support to :attr:`PurePath.parents " -"`. (Contributed by Yaroslav Pankovych " -"in :issue:`21041`.)" +"Add negative indexing support to :attr:`PurePath.parents `. (Contributed by Yaroslav Pankovych in :issue:`21041`.)" msgstr "" "向 :attr:`PurePath.parents ` 新增負索引支援。(由 " "Yaroslav Pankovych 在 :issue:`21041` 中貢獻。)" @@ -2433,20 +2421,20 @@ msgstr "" #: ../../whatsnew/3.10.rst:1283 msgid "" "Add :meth:`Path.hardlink_to ` method that " -"supersedes :meth:`!link_to`. The new method has the same argument order " -"as :meth:`~pathlib.Path.symlink_to`. (Contributed by Barney Gale " -"in :issue:`39950`.)" +"supersedes :meth:`!link_to`. The new method has the same argument order as :" +"meth:`~pathlib.Path.symlink_to`. (Contributed by Barney Gale in :issue:" +"`39950`.)" msgstr "" -"新增替代 :meth:`!link_to` 的 :meth:`Path.hardlink_to " -"` 方法。新方法與 :meth:`~pathlib.Path.symlink_to` " -"具有相同的引數順序。(由 Barney Gale 在 :issue:`39950` 中貢獻。)" +"新增替代 :meth:`!link_to` 的 :meth:`Path.hardlink_to ` 方法。新方法與 :meth:`~pathlib.Path.symlink_to` 具有相同的引數" +"順序。(由 Barney Gale 在 :issue:`39950` 中貢獻。)" #: ../../whatsnew/3.10.rst:1288 msgid "" ":meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now accept a " "*follow_symlinks* keyword-only argument for consistency with corresponding " -"functions in the :mod:`os` module. (Contributed by Barney Gale " -"in :issue:`39906`.)" +"functions in the :mod:`os` module. (Contributed by Barney Gale in :issue:" +"`39906`.)" msgstr "" ":meth:`pathlib.Path.stat` 和 :meth:`~pathlib.Path.chmod` 現在接受 " "*follow_symlinks* 僅限關鍵字引數,以與 :mod:`os` 模組中的相應函式保持一致。" @@ -2507,14 +2495,13 @@ msgstr "pyclbr" #: ../../whatsnew/3.10.rst:1319 msgid "" "Add an ``end_lineno`` attribute to the ``Function`` and ``Class`` objects in " -"the tree returned by :func:`pyclbr.readmodule` " -"and :func:`pyclbr.readmodule_ex`. It matches the existing (start) " -"``lineno``. (Contributed by Aviral Srivastava in :issue:`38307`.)" +"the tree returned by :func:`pyclbr.readmodule` and :func:`pyclbr." +"readmodule_ex`. It matches the existing (start) ``lineno``. (Contributed by " +"Aviral Srivastava in :issue:`38307`.)" msgstr "" -"將 ``end_lineno`` 屬性新增到 :func:`pyclbr.readmodule` " -"和 :func:`pyclbr.readmodule_ex` 回傳的樹中的 ``Function`` 和 ``Class`` 物件。" -"它與現有的(開始) ``lineno`` 匹配。(由 Aviral Srivastava 在 :issue:`38307` " -"中貢獻。)" +"將 ``end_lineno`` 屬性新增到 :func:`pyclbr.readmodule` 和 :func:`pyclbr." +"readmodule_ex` 回傳的樹中的 ``Function`` 和 ``Class`` 物件。它與現有的(開" +"始) ``lineno`` 匹配。(由 Aviral Srivastava 在 :issue:`38307` 中貢獻。)" #: ../../whatsnew/3.10.rst:1325 msgid "shelve" @@ -2526,9 +2513,9 @@ msgid "" "default instead of :mod:`pickle` protocol ``3`` when creating shelves. " "(Contributed by Zackery Spytz in :issue:`34204`.)" msgstr "" -"現在,:mod:`shelve` 模組在建立 shelve 時預設使" -"用 :const:`pickle.DEFAULT_PROTOCOL`,而不是 :mod:`pickle` 的協定 ``3``。(由 " -"Zackery Spytz 在 :issue:`34204` 中貢獻。)" +"現在,:mod:`shelve` 模組在建立 shelve 時預設使用 :const:`pickle." +"DEFAULT_PROTOCOL`,而不是 :mod:`pickle` 的協定 ``3``。(由 Zackery Spytz 在 :" +"issue:`34204` 中貢獻。)" #: ../../whatsnew/3.10.rst:1332 msgid "statistics" @@ -2536,10 +2523,9 @@ msgstr "statistics" #: ../../whatsnew/3.10.rst:1334 msgid "" -"Add :func:`~statistics.covariance`, " -"Pearson's :func:`~statistics.correlation`, and " -"simple :func:`~statistics.linear_regression` functions. (Contributed by " -"Tymoteusz Wołodźko in :issue:`38490`.)" +"Add :func:`~statistics.covariance`, Pearson's :func:`~statistics." +"correlation`, and simple :func:`~statistics.linear_regression` functions. " +"(Contributed by Tymoteusz Wołodźko in :issue:`38490`.)" msgstr "" "新增 :func:`~statistics.covariance`、Pearson :func:`~statistics.correlation` " "和簡單 :func:`~statistics.linear_regression` 函式。(由 Tymoteusz Wołodźko " @@ -2566,8 +2552,8 @@ msgid "" "Add option to create MPTCP sockets with ``IPPROTO_MPTCP`` (Contributed by " "Rui Cunha in :issue:`43571`.)" msgstr "" -"新增使用 ``IPPROTO_MPTCP`` 建立 MPTCP socket 的選項(由 Rui Cunha " -"在 :issue:`43571` 中貢獻。)" +"新增使用 ``IPPROTO_MPTCP`` 建立 MPTCP socket 的選項(由 Rui Cunha 在 :issue:" +"`43571` 中貢獻。)" #: ../../whatsnew/3.10.rst:1354 msgid "" @@ -2591,45 +2577,44 @@ msgstr "" #: ../../whatsnew/3.10.rst:1363 msgid "" -"The ssl module has preliminary support for OpenSSL 3.0.0 and new " -"option :const:`~ssl.OP_IGNORE_UNEXPECTED_EOF`. (Contributed by Christian " -"Heimes " -"in :issue:`38820`, :issue:`43794`, :issue:`43788`, :issue:`43791`, :issue:`43799`, :issue:`43920`, :issue:`43789`, " -"and :issue:`43811`.)" +"The ssl module has preliminary support for OpenSSL 3.0.0 and new option :" +"const:`~ssl.OP_IGNORE_UNEXPECTED_EOF`. (Contributed by Christian Heimes in :" +"issue:`38820`, :issue:`43794`, :issue:`43788`, :issue:`43791`, :issue:" +"`43799`, :issue:`43920`, :issue:`43789`, and :issue:`43811`.)" msgstr "" -"ssl 模組初步支援 OpenSSL 3.0.0 和新選" -"項 :const:`~ssl.OP_IGNORE_UNEXPECTED_EOF`。(由 Christian Heimes " -"於 :issue:`38820`、:issue:`43794`、:issue:`43788`、:issue:`43791`、:issue:`43799`、:issue:`43920`、:issue:`43789` " -"和 :issue:`43811` 貢獻。)" +"ssl 模組初步支援 OpenSSL 3.0.0 和新選項 :const:`~ssl." +"OP_IGNORE_UNEXPECTED_EOF`。(由 Christian Heimes 於 :issue:`38820`、:issue:" +"`43794`、:issue:`43788`、:issue:`43791`、:issue:`43799`、:issue:`43920`、:" +"issue:`43789` 和 :issue:`43811` 貢獻。)" #: ../../whatsnew/3.10.rst:1369 msgid "" -"Deprecated function and use of deprecated constants now result in " -"a :exc:`DeprecationWarning`. :attr:`ssl.SSLContext.options` " -"has :data:`~ssl.OP_NO_SSLv2` and :data:`~ssl.OP_NO_SSLv3` set by default and " -"therefore cannot warn about setting the flag again. The :ref:`deprecation " -"section ` has a list of deprecated features. " -"(Contributed by Christian Heimes in :issue:`43880`.)" -msgstr "" -"已棄用函式和使用已棄用常數現在會導" -"致 :exc:`DeprecationWarning`。 :attr:`ssl.SSLContext.options` 預設設定" -"有 :data:`~ssl.OP_NO_SSLv2` 和 :data:`~ssl.OP_NO_SSLv3`,因此無法再次發出設定" -"該旗標的警告。:ref:`棄用部分 `\\ 包含已棄用功能的列" -"表。(由 Christian Heimes 在 :issue:`43880` 中貢獻。)" +"Deprecated function and use of deprecated constants now result in a :exc:" +"`DeprecationWarning`. :attr:`ssl.SSLContext.options` has :data:`~ssl." +"OP_NO_SSLv2` and :data:`~ssl.OP_NO_SSLv3` set by default and therefore " +"cannot warn about setting the flag again. The :ref:`deprecation section " +"` has a list of deprecated features. (Contributed by " +"Christian Heimes in :issue:`43880`.)" +msgstr "" +"已棄用函式和使用已棄用常數現在會導致 :exc:`DeprecationWarning`。 :attr:`ssl." +"SSLContext.options` 預設設定有 :data:`~ssl.OP_NO_SSLv2` 和 :data:`~ssl." +"OP_NO_SSLv3`,因此無法再次發出設定該旗標的警告。:ref:`棄用部分 `\\ 包含已棄用功能的列表。(由 Christian Heimes 在 :issue:`43880` " +"中貢獻。)" #: ../../whatsnew/3.10.rst:1377 msgid "" "The ssl module now has more secure default settings. Ciphers without forward " "secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits " -"weak RSA, DH, and ECC keys with less than 112 bits of " -"security. :class:`~ssl.SSLContext` defaults to minimum protocol version TLS " -"1.2. Settings are based on Hynek Schlawack's research. (Contributed by " -"Christian Heimes in :issue:`43998`.)" +"weak RSA, DH, and ECC keys with less than 112 bits of security. :class:`~ssl." +"SSLContext` defaults to minimum protocol version TLS 1.2. Settings are based " +"on Hynek Schlawack's research. (Contributed by Christian Heimes in :issue:" +"`43998`.)" msgstr "" "ssl 模組現在具有更安全的預設設定。預設情況下禁用沒有前向保密或 SHA-1 MAC 的密" -"碼。安全級別 2 禁止安全性低於 112 位元的弱 RSA、DH 和 ECC 密" -"鑰。 :class:`~ssl.SSLContext` 預設為最低協定版本 TLS 1.2。設定基於 Hynek " -"Schlawack 的研究。(由 Christian Heimes 在 :issue:`43998` 中貢獻。)" +"碼。安全級別 2 禁止安全性低於 112 位元的弱 RSA、DH 和 ECC 密鑰。 :class:" +"`~ssl.SSLContext` 預設為最低協定版本 TLS 1.2。設定基於 Hynek Schlawack 的研" +"究。(由 Christian Heimes 在 :issue:`43998` 中貢獻。)" #: ../../whatsnew/3.10.rst:1384 msgid "" @@ -2663,8 +2648,8 @@ msgid "" "A new verify flag :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN` has been added. " "(Contributed by l0x in :issue:`40849`.)" msgstr "" -"新增驗證旗標 :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN`。(由 l0x " -"在 :issue:`40849` 中貢獻。)" +"新增驗證旗標 :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN`。(由 l0x 在 :issue:" +"`40849` 中貢獻。)" #: ../../whatsnew/3.10.rst:1399 msgid "sqlite3" @@ -2672,15 +2657,13 @@ msgstr "sqlite3" #: ../../whatsnew/3.10.rst:1401 msgid "" -"Add audit events " -"for :func:`~sqlite3.connect`, :meth:`~sqlite3.Connection.enable_load_extension`, " -"and :meth:`~sqlite3.Connection.load_extension`. (Contributed by Erlend E. " -"Aasland in :issue:`43762`.)" +"Add audit events for :func:`~sqlite3.connect`, :meth:`~sqlite3.Connection." +"enable_load_extension`, and :meth:`~sqlite3.Connection.load_extension`. " +"(Contributed by Erlend E. Aasland in :issue:`43762`.)" msgstr "" -"新" -"增 :func:`~sqlite3.connect`、:meth:`~sqlite3.Connection.enable_load_extension` " -"和 :meth:`~sqlite3.Connection.load_extension` 的稽核事件。(由 Erlend E. " -"Aasland 在 :issue:`43762` 中貢獻。)" +"新增 :func:`~sqlite3.connect`、:meth:`~sqlite3.Connection." +"enable_load_extension` 和 :meth:`~sqlite3.Connection.load_extension` 的稽核事" +"件。(由 Erlend E. Aasland 在 :issue:`43762` 中貢獻。)" #: ../../whatsnew/3.10.rst:1407 msgid "sys" @@ -2724,13 +2707,12 @@ msgstr "threading" #: ../../whatsnew/3.10.rst:1427 msgid "" "Add :func:`threading.gettrace` and :func:`threading.getprofile` to retrieve " -"the functions set by :func:`threading.settrace` " -"and :func:`threading.setprofile` respectively. (Contributed by Mario " -"Corchero in :issue:`42251`.)" +"the functions set by :func:`threading.settrace` and :func:`threading." +"setprofile` respectively. (Contributed by Mario Corchero in :issue:`42251`.)" msgstr "" -"新增 :func:`threading.gettrace` 和 :func:`threading.getprofile` 分別取" -"得 :func:`threading.settrace` 和 :func:`threading.setprofile` 設定的函式。" -"(由 Mario Corchero 在 :issue:`42251` 中貢獻。)" +"新增 :func:`threading.gettrace` 和 :func:`threading.getprofile` 分別取得 :" +"func:`threading.settrace` 和 :func:`threading.setprofile` 設定的函式。(由 " +"Mario Corchero 在 :issue:`42251` 中貢獻。)" #: ../../whatsnew/3.10.rst:1432 msgid "" @@ -2738,9 +2720,9 @@ msgid "" "of :func:`threading.excepthook` in case it is set to a broken or a different " "value. (Contributed by Mario Corchero in :issue:`42308`.)" msgstr "" -"新增 :data:`threading.__excepthook__` 以允許取" -"得 :func:`threading.excepthook` 的原始值,以防它被設定為損壞或不同的值。(由 " -"Mario Corchero 在 :issue:`42308` 中貢獻。)" +"新增 :data:`threading.__excepthook__` 以允許取得 :func:`threading." +"excepthook` 的原始值,以防它被設定為損壞或不同的值。(由 Mario Corchero 在 :" +"issue:`42308` 中貢獻。)" #: ../../whatsnew/3.10.rst:1438 msgid "traceback" @@ -2748,14 +2730,15 @@ msgstr "traceback" #: ../../whatsnew/3.10.rst:1440 msgid "" -"The :func:`~traceback.format_exception`, :func:`~traceback.format_exception_only`, " -"and :func:`~traceback.print_exception` functions can now take an exception " -"object as a positional-only argument. (Contributed by Zackery Spytz and " -"Matthias Bussonnier in :issue:`26389`.)" +"The :func:`~traceback.format_exception`, :func:`~traceback." +"format_exception_only`, and :func:`~traceback.print_exception` functions can " +"now take an exception object as a positional-only argument. (Contributed by " +"Zackery Spytz and Matthias Bussonnier in :issue:`26389`.)" msgstr "" -":func:`~traceback.format_exception`、:func:`~traceback.format_exception_only` " -"和 :func:`~traceback.print_exception` 函式現在可以將例外物件作為僅限位置引" -"數。(由 Zackery Spytz 和 Matthias Bussonnier 在 :issue:`26389` 中貢獻。)" +":func:`~traceback.format_exception`、:func:`~traceback." +"format_exception_only` 和 :func:`~traceback.print_exception` 函式現在可以將例" +"外物件作為僅限位置引數。(由 Zackery Spytz 和 Matthias Bussonnier 在 :issue:" +"`26389` 中貢獻。)" #: ../../whatsnew/3.10.rst:1447 msgid "types" @@ -2763,14 +2746,14 @@ msgstr "types" #: ../../whatsnew/3.10.rst:1449 msgid "" -"Reintroduce the :data:`types.EllipsisType`, :data:`types.NoneType` " -"and :data:`types.NotImplementedType` classes, providing a new set of types " -"readily interpretable by type checkers. (Contributed by Bas van Beek " -"in :issue:`41810`.)" +"Reintroduce the :data:`types.EllipsisType`, :data:`types.NoneType` and :data:" +"`types.NotImplementedType` classes, providing a new set of types readily " +"interpretable by type checkers. (Contributed by Bas van Beek in :issue:" +"`41810`.)" msgstr "" -"重新引入 :data:`types.EllipsisType`、:data:`types.NoneType` " -"和 :data:`types.NotImplementedType` 類別,提供一組易於型別檢查器直譯的新型" -"別。(由 Bas van Beek 在 :issue:`41810` 中貢獻。)" +"重新引入 :data:`types.EllipsisType`、:data:`types.NoneType` 和 :data:`types." +"NotImplementedType` 類別,提供一組易於型別檢查器直譯的新型別。(由 Bas van " +"Beek 在 :issue:`41810` 中貢獻。)" #: ../../whatsnew/3.10.rst:1455 msgid "typing" @@ -2782,9 +2765,8 @@ msgstr "有關重大更改,請參閱\\ :ref:`new-feat-related-type-hints`。" #: ../../whatsnew/3.10.rst:1459 msgid "" -"The behavior of :class:`typing.Literal` was changed to conform " -"with :pep:`586` and to match the behavior of static type checkers specified " -"in the PEP." +"The behavior of :class:`typing.Literal` was changed to conform with :pep:" +"`586` and to match the behavior of static type checkers specified in the PEP." msgstr "" ":class:`typing.Literal` 的行為已更改為符合 :pep:`586` 並匹配 PEP 中指定的靜態" "型別檢查器的行為。" @@ -2843,20 +2825,19 @@ msgstr "(由 Yurii Karabas 在 :issue:`42345` 中貢獻。)" #: ../../whatsnew/3.10.rst:1482 msgid "" "Add new function :func:`typing.is_typeddict` to introspect if an annotation " -"is a :class:`typing.TypedDict`. (Contributed by Patrick Reader " -"in :issue:`41792`.)" +"is a :class:`typing.TypedDict`. (Contributed by Patrick Reader in :issue:" +"`41792`.)" msgstr "" -"新增函式 :func:`typing.is_typeddict` 來自我審查 (introspect) 註釋是否" -"為 :class:`typing.TypedDict`。(由 Patrick Reader 在 :issue:`41792` 中貢" -"獻。)" +"新增函式 :func:`typing.is_typeddict` 來自我審查 (introspect) 註釋是否為 :" +"class:`typing.TypedDict`。(由 Patrick Reader 在 :issue:`41792` 中貢獻。)" #: ../../whatsnew/3.10.rst:1486 msgid "" "Subclasses of ``typing.Protocol`` which only have data variables declared " "will now raise a ``TypeError`` when checked with ``isinstance`` unless they " "are decorated with :func:`~typing.runtime_checkable`. Previously, these " -"checks passed silently. Users should decorate their subclasses with " -"the :func:`!runtime_checkable` decorator if they want runtime protocols. " +"checks passed silently. Users should decorate their subclasses with the :" +"func:`!runtime_checkable` decorator if they want runtime protocols. " "(Contributed by Yurii Karabas in :issue:`38908`.)" msgstr "" "僅宣告了資料變數的 ``typing.Protocol`` 子類別現在在使用 ``isinstance`` 檢查時" @@ -2867,16 +2848,16 @@ msgstr "" #: ../../whatsnew/3.10.rst:1494 msgid "" -"Importing from the ``typing.io`` and ``typing.re`` submodules will now " -"emit :exc:`DeprecationWarning`. These submodules have been deprecated since " +"Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" +"exc:`DeprecationWarning`. These submodules have been deprecated since " "Python 3.8 and will be removed in a future version of Python. Anything " "belonging to those submodules should be imported directly from :mod:`typing` " "instead. (Contributed by Sebastian Rittau in :issue:`38291`.)" msgstr "" -"從 ``typing.io`` 和 ``typing.re`` 子模組引入現在將發" -"出 :exc:`DeprecationWarning`。這些子模組自 Python 3.8 起已被棄用,並將在未來" -"版本的 Python 中刪除。屬於這些子模組的任何內容都應該直接從 :mod:`typing` 引" -"入。 (由 Sebastian Rittau 在 :issue:`38291` 中貢獻。)" +"從 ``typing.io`` 和 ``typing.re`` 子模組引入現在將發出 :exc:" +"`DeprecationWarning`。這些子模組自 Python 3.8 起已被棄用,並將在未來版本的 " +"Python 中刪除。屬於這些子模組的任何內容都應該直接從 :mod:`typing` 引入。 " +"(由 Sebastian Rittau 在 :issue:`38291` 中貢獻。)" #: ../../whatsnew/3.10.rst:1502 msgid "unittest" @@ -2888,9 +2869,9 @@ msgid "" "existing :meth:`~unittest.TestCase.assertLogs`. (Contributed by Kit Yan Choi " "in :issue:`39385`.)" msgstr "" -"新增方法 :meth:`~unittest.TestCase.assertNoLogs` 以補足現有" -"的 :meth:`~unittest.TestCase.assertLogs`。(由 Kit Yan Choi " -"在 :issue:`39385` 中貢獻。)" +"新增方法 :meth:`~unittest.TestCase.assertNoLogs` 以補足現有的 :meth:" +"`~unittest.TestCase.assertLogs`。(由 Kit Yan Choi 在 :issue:`39385` 中貢" +"獻。)" #: ../../whatsnew/3.10.rst:1509 msgid "urllib.parse" @@ -2899,32 +2880,31 @@ msgstr "urllib.parse" #: ../../whatsnew/3.10.rst:1511 msgid "" "Python versions earlier than Python 3.10 allowed using both ``;`` and ``&`` " -"as query parameter separators in :func:`urllib.parse.parse_qs` " -"and :func:`urllib.parse.parse_qsl`. Due to security concerns, and to " -"conform with newer W3C recommendations, this has been changed to allow only " -"a single separator key, with ``&`` as the default. This change also " -"affects :func:`!cgi.parse` and :func:`!cgi.parse_multipart` as they use the " -"affected functions internally. For more details, please see their " -"respective documentation. (Contributed by Adam Goldschmidt, Senthil Kumaran " -"and Ken Jin in :issue:`42967`.)" -msgstr "" -"Python 3.10 之前的 Python 版本允許在 :func:`urllib.parse.parse_qs` " -"和 :func:`urllib.parse.parse_qsl` 中使用 ``;`` 和 ``&`` 作為查詢參數 (query " +"as query parameter separators in :func:`urllib.parse.parse_qs` and :func:" +"`urllib.parse.parse_qsl`. Due to security concerns, and to conform with " +"newer W3C recommendations, this has been changed to allow only a single " +"separator key, with ``&`` as the default. This change also affects :func:`!" +"cgi.parse` and :func:`!cgi.parse_multipart` as they use the affected " +"functions internally. For more details, please see their respective " +"documentation. (Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin " +"in :issue:`42967`.)" +msgstr "" +"Python 3.10 之前的 Python 版本允許在 :func:`urllib.parse.parse_qs` 和 :func:" +"`urllib.parse.parse_qsl` 中使用 ``;`` 和 ``&`` 作為查詢參數 (query " "parameter) 的分隔符號。出於安全考慮,並且為了符合更新的 W3C 建議,已將其更改" -"為僅允許單個分隔符號鍵,預設為 ``&``。此更改還會影響 :func:`!cgi.parse` " -"和 :func:`!cgi.parse_multipart`,因為它們在內部使用受影響的函式。有關更多詳細" -"資訊,請參閱各自的文件。(由 Adam Goldschmidt、Senthil Kumaran 和 Ken Jin " -"在 :issue:`42967` 中貢獻。)" +"為僅允許單個分隔符號鍵,預設為 ``&``。此更改還會影響 :func:`!cgi.parse` 和 :" +"func:`!cgi.parse_multipart`,因為它們在內部使用受影響的函式。有關更多詳細資" +"訊,請參閱各自的文件。(由 Adam Goldschmidt、Senthil Kumaran 和 Ken Jin 在 :" +"issue:`42967` 中貢獻。)" #: ../../whatsnew/3.10.rst:1521 msgid "" "The presence of newline or tab characters in parts of a URL allows for some " -"forms of attacks. Following the WHATWG specification that " -"updates :rfc:`3986`, ASCII newline ``\\n``, ``\\r`` and tab ``\\t`` " -"characters are stripped from the URL by the parser in :mod:`urllib.parse` " -"preventing such attacks. The removal characters are controlled by a new " -"module level variable ``urllib.parse._UNSAFE_URL_BYTES_TO_REMOVE``. " -"(See :gh:`88048`)" +"forms of attacks. Following the WHATWG specification that updates :rfc:" +"`3986`, ASCII newline ``\\n``, ``\\r`` and tab ``\\t`` characters are " +"stripped from the URL by the parser in :mod:`urllib.parse` preventing such " +"attacks. The removal characters are controlled by a new module level " +"variable ``urllib.parse._UNSAFE_URL_BYTES_TO_REMOVE``. (See :gh:`88048`)" msgstr "" #: ../../whatsnew/3.10.rst:1529 @@ -2933,9 +2913,9 @@ msgstr "xml" #: ../../whatsnew/3.10.rst:1531 msgid "" -"Add a :class:`~xml.sax.handler.LexicalHandler` class to " -"the :mod:`xml.sax.handler` module. (Contributed by Jonathan Gossage and " -"Zackery Spytz in :issue:`35018`.)" +"Add a :class:`~xml.sax.handler.LexicalHandler` class to the :mod:`xml.sax." +"handler` module. (Contributed by Jonathan Gossage and Zackery Spytz in :" +"issue:`35018`.)" msgstr "" "新增 :class:`~xml.sax.handler.LexicalHandler` 類別到 :mod:`xml.sax.handler` " "模組。(由 Jonathan Gossage 和 Zackery Spytz 在 :issue:`35018` 中貢獻。)" @@ -2946,15 +2926,14 @@ msgstr "zipimport" #: ../../whatsnew/3.10.rst:1537 msgid "" -"Add methods related " -"to :pep:`451`: :meth:`~zipimport.zipimporter.find_spec`, :meth:`zipimport.zipimporter.create_module`, " -"and :meth:`zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon " -"in :issue:`42131`.)" +"Add methods related to :pep:`451`: :meth:`~zipimport.zipimporter." +"find_spec`, :meth:`zipimport.zipimporter.create_module`, and :meth:" +"`zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon in :issue:" +"`42131`.)" msgstr "" -"新增與 :pep:`451` 相關的方" -"法::meth:`~zipimport.zipimporter.find_spec`、:meth:`zipimport.zipimporter.create_module` " -"和 :meth:`zipimport.zipimporter.exec_module`。(由 Brett Cannon " -"在 :issue:`42131` 中貢獻。)" +"新增與 :pep:`451` 相關的方法::meth:`~zipimport.zipimporter.find_spec`、:" +"meth:`zipimport.zipimporter.create_module` 和 :meth:`zipimport.zipimporter." +"exec_module`。(由 Brett Cannon 在 :issue:`42131` 中貢獻。)" #: ../../whatsnew/3.10.rst:1542 msgid "" @@ -2971,8 +2950,8 @@ msgstr "最佳化" #: ../../whatsnew/3.10.rst:1549 msgid "" "Constructors :func:`str`, :func:`bytes` and :func:`bytearray` are now faster " -"(around 30--40% for small objects). (Contributed by Serhiy Storchaka " -"in :issue:`41334`.)" +"(around 30--40% for small objects). (Contributed by Serhiy Storchaka in :" +"issue:`41334`.)" msgstr "" "建構函式 :func:`str`、:func:`bytes` 和 :func:`bytearray` 現在更快了(對於小型" "物件大約快了 30--40%)。(由 Serhiy Storchaka 在 :issue:`41334` 中貢獻。)" @@ -2980,10 +2959,10 @@ msgstr "" #: ../../whatsnew/3.10.rst:1553 msgid "" "The :mod:`runpy` module now imports fewer modules. The ``python3 -m module-" -"name`` command startup time is 1.4x faster in average. On Linux, ``python3 " -"-I -m module-name`` imports 69 modules on Python 3.9, whereas it only " -"imports 51 modules (-18) on Python 3.10. (Contributed by Victor Stinner " -"in :issue:`41006` and :issue:`41718`.)" +"name`` command startup time is 1.4x faster in average. On Linux, ``python3 -" +"I -m module-name`` imports 69 modules on Python 3.9, whereas it only imports " +"51 modules (-18) on Python 3.10. (Contributed by Victor Stinner in :issue:" +"`41006` and :issue:`41718`.)" msgstr "" ":mod:`runpy` 模組現在引入更少的模組。``python3 -m module-name`` 指令啟動時間" "平均快了 1.4 倍。在 Linux 上,``python3 -I -m module-name`` 在 Python 3.9 上" @@ -3008,10 +2987,10 @@ msgid "" "When building Python with :option:`--enable-optimizations` now ``-fno-" "semantic-interposition`` is added to both the compile and link line. This " "speeds builds of the Python interpreter created with :option:`--enable-" -"shared` with ``gcc`` by up to 30%. See `this article `_ for more details. (Contributed by Victor " -"Stinner and Pablo Galindo in :issue:`38980`.)" +"shared` with ``gcc`` by up to 30%. See `this article `_ for more details. (Contributed by Victor Stinner " +"and Pablo Galindo in :issue:`38980`.)" msgstr "" "當使用 :option:`--enable-optimizations` 建置 Python 時,現在 ``-fno-semantic-" "interposition`` 被新增到編譯和鏈接列 (link line) 中。這使得使用 :option:`--" @@ -3022,18 +3001,18 @@ msgstr "" #: ../../whatsnew/3.10.rst:1573 msgid "" -"Use a new output buffer management code " -"for :mod:`bz2` / :mod:`lzma` / :mod:`zlib` modules, and add ``.readall()`` " -"function to ``_compression.DecompressReader`` class. bz2 decompression is " -"now 1.09x ~ 1.17x faster, lzma decompression 1.20x ~ 1.32x faster, " -"``GzipFile.read(-1)`` 1.11x ~ 1.18x faster. (Contributed by Ma Lin, reviewed " -"by Gregory P. Smith, in :issue:`41486`)" +"Use a new output buffer management code for :mod:`bz2` / :mod:`lzma` / :mod:" +"`zlib` modules, and add ``.readall()`` function to ``_compression." +"DecompressReader`` class. bz2 decompression is now 1.09x ~ 1.17x faster, " +"lzma decompression 1.20x ~ 1.32x faster, ``GzipFile.read(-1)`` 1.11x ~ 1.18x " +"faster. (Contributed by Ma Lin, reviewed by Gregory P. Smith, in :issue:" +"`41486`)" msgstr "" "對 :mod:`bz2` / :mod:`lzma` / :mod:`zlib` 模組使用新的輸出緩衝區管理程式碼," "並將 ``.readall()`` 函式新增到 ``_compression.DecompressReader`` 類別。 bz2 " "解壓縮速度提高了 1.09x ~ 1.17x,lzma 解壓縮速度提高了 1.20x ~ 1.32x," -"``GzipFile.read(-1)`` 速度提高了 1.11x ~ 1.18x。(由 Ma Lin " -"於 :issue:`41486` 貢獻、由 Gregory P. Smith 審閱)" +"``GzipFile.read(-1)`` 速度提高了 1.11x ~ 1.18x。(由 Ma Lin 於 :issue:" +"`41486` 貢獻、由 Gregory P. Smith 審閱)" #: ../../whatsnew/3.10.rst:1579 msgid "" @@ -3064,27 +3043,25 @@ msgstr "" msgid "" "Add micro-optimizations to ``_PyType_Lookup()`` to improve type attribute " "cache lookup performance in the common case of cache hits. This makes the " -"interpreter 1.04 times faster on average. (Contributed by Dino Viehland " -"in :issue:`43452`.)" +"interpreter 1.04 times faster on average. (Contributed by Dino Viehland in :" +"issue:`43452`.)" msgstr "" "向 ``_PyType_Lookup()`` 新增微最佳化以提高快取命中的常見情況下的型別屬性快取" -"查找性能。這使得直譯器平均速度提高了 1.04 倍。(由 Dino Viehland " -"在 :issue:`43452` 中貢獻。)" +"查找性能。這使得直譯器平均速度提高了 1.04 倍。(由 Dino Viehland 在 :issue:" +"`43452` 中貢獻。)" #: ../../whatsnew/3.10.rst:1595 msgid "" "The following built-in functions now support the faster :pep:`590` " -"vectorcall calling " -"convention: :func:`map`, :func:`filter`, :func:`reversed`, :func:`bool` " -"and :func:`float`. (Contributed by Donghee Na and Jeroen Demeyer " -"in :issue:`43575`, :issue:`43287`, :issue:`41922`, :issue:`41873` " -"and :issue:`41870`.)" -msgstr "" -"以下內建函式現在支援更快的 :pep:`590` vectorcall 呼叫慣" -"例::func:`map`、:func:`filter`、:func:`reversed`、:func:`bool` " -"和 :func:`float`。(由 Donghee Na 和 Jeroen Demeyer " -"在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:issue:`41873` " -"和 :issue:`41870` 中貢獻。)" +"vectorcall calling convention: :func:`map`, :func:`filter`, :func:" +"`reversed`, :func:`bool` and :func:`float`. (Contributed by Donghee Na and " +"Jeroen Demeyer in :issue:`43575`, :issue:`43287`, :issue:`41922`, :issue:" +"`41873` and :issue:`41870`.)" +msgstr "" +"以下內建函式現在支援更快的 :pep:`590` vectorcall 呼叫慣例::func:`map`、:" +"func:`filter`、:func:`reversed`、:func:`bool` 和 :func:`float`。(由 Donghee " +"Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" +"issue:`41873` 和 :issue:`41870` 中貢獻。)" #: ../../whatsnew/3.10.rst:1599 msgid "" @@ -3094,10 +3071,10 @@ msgid "" "in :mod:`gzip` and :mod:`lzma` have always been. (Contributed by Inada " "Naoki in :issue:`43785`.)" msgstr "" -"通過刪除內部 ``RLock``,:class:`~bz2.BZ2File` 的性能得到了改進。這使" -"得 :class:`!BZ2File` 在面對多個同時的讀取器或寫入器時執行緒不安全,就" -"像 :mod:`gzip` 和 :mod:`lzma` 中的等效類別一樣。(由 Inada Naoki " -"在 :issue:`43785` 中貢獻。)" +"通過刪除內部 ``RLock``,:class:`~bz2.BZ2File` 的性能得到了改進。這使得 :" +"class:`!BZ2File` 在面對多個同時的讀取器或寫入器時執行緒不安全,就像 :mod:" +"`gzip` 和 :mod:`lzma` 中的等效類別一樣。(由 Inada Naoki 在 :issue:`43785` 中" +"貢獻。)" #: ../../whatsnew/3.10.rst:1607 ../../whatsnew/3.10.rst:2213 msgid "Deprecated" @@ -3110,46 +3087,44 @@ msgid "" "ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " "``[0x1 for x in y]`` or ``[0x1f or x in y]``). Starting in this release, a " "deprecation warning is raised if the numeric literal is immediately followed " -"by one of " -"keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :keyword:`is` " -"and :keyword:`or`. In future releases it will be changed to syntax warning, " -"and finally to syntax error. (Contributed by Serhiy Storchaka " -"in :issue:`43833`.)" +"by one of keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:" +"`if`, :keyword:`in`, :keyword:`is` and :keyword:`or`. In future releases it " +"will be changed to syntax warning, and finally to syntax error. (Contributed " +"by Serhiy Storchaka in :issue:`43833`.)" msgstr "" "目前 Python 接受緊跟關鍵字的數字字面值 (numeric literals),例如 ``0in x``、" "``1or x``、``0if 1else 2``。它允許了令人困惑和不明確的運算式,例如 ``[0x1for " "x in y]`` (可以直譯為 ``[0x1 for x in y]`` 或 ``[0x1f or x in y]`` )。從此" -"版本開始,如果數字字面值後緊跟關鍵" -"字 :keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:`in`、:keyword:`is` " -"與 :keyword:`or` 其中之一,則會引發棄用警告。在未來的版本中,它將被變更為語法" -"警告,最後成為為語法錯誤。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" +"版本開始,如果數字字面值後緊跟關鍵字 :keyword:`and`、:keyword:`else`、:" +"keyword:`for`、:keyword:`if`、:keyword:`in`、:keyword:`is` 與 :keyword:`or` " +"其中之一,則會引發棄用警告。在未來的版本中,它將被變更為語法警告,最後成為為" +"語法錯誤。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" #: ../../whatsnew/3.10.rst:1620 msgid "" "Starting in this release, there will be a concerted effort to begin cleaning " "up old import semantics that were kept for Python 2.7 compatibility. " -"Specifically, :meth:`!find_loader`/:meth:`!find_module` (superseded " -"by :meth:`~importlib.abc.MetaPathFinder.find_spec`), :meth:`~importlib.abc.Loader.load_module` " -"(superseded by :meth:`~importlib.abc.Loader.exec_module`), :meth:`!" -"module_repr` (which the import system takes care of for you), the " +"Specifically, :meth:`!find_loader`/:meth:`!find_module` (superseded by :meth:" +"`~importlib.abc.MetaPathFinder.find_spec`), :meth:`~importlib.abc.Loader." +"load_module` (superseded by :meth:`~importlib.abc.Loader.exec_module`), :" +"meth:`!module_repr` (which the import system takes care of for you), the " "``__package__`` attribute (superseded by ``__spec__.parent``), the " "``__loader__`` attribute (superseded by ``__spec__.loader``), and the " "``__cached__`` attribute (superseded by ``__spec__.cached``) will slowly be " -"removed (as well as other classes and methods " -"in :mod:`importlib`). :exc:`ImportWarning` and/or :exc:`DeprecationWarning` " -"will be raised as appropriate to help identify code which needs updating " -"during this transition." +"removed (as well as other classes and methods in :mod:`importlib`). :exc:" +"`ImportWarning` and/or :exc:`DeprecationWarning` will be raised as " +"appropriate to help identify code which needs updating during this " +"transition." msgstr "" "從這個版本開始,我們將齊心協力開始清理為相容 Python 2.7 而保留的舊引入語義。" -"具體來說, :meth:`!find_loader`/:meth:`!find_module` " -"(被 :meth:`~importlib.abc.MetaPathFinder.find_spec` 取" -"代)、:meth:`~importlib.abc.Loader.load_module` " -"(被 :meth:`~importlib.abc.Loader.exec_module` 取代)、 :meth:`!module_repr` " -"(引入系統負責處理你)、``__package__`` 屬性(由 ``__spec__.parent`` 取" -"代)、 ``__loader__`` 屬性(由 ``__spec__.loader`` 取代)和 ``__cached__`` 屬" -"性(由 ``__spec__.cached`` 取代)將慢慢被刪除(以及 :mod:`importlib` 中的其他" -"類別和方法)。將酌情引發 :exc:`ImportWarning` 和/" -"或 :exc:`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" +"具體來說, :meth:`!find_loader`/:meth:`!find_module` (被 :meth:`~importlib." +"abc.MetaPathFinder.find_spec` 取代)、:meth:`~importlib.abc.Loader." +"load_module` (被 :meth:`~importlib.abc.Loader.exec_module` 取代)、 :meth:`!" +"module_repr` (引入系統負責處理你)、``__package__`` 屬性(由 ``__spec__." +"parent`` 取代)、 ``__loader__`` 屬性(由 ``__spec__.loader`` 取代)和 " +"``__cached__`` 屬性(由 ``__spec__.cached`` 取代)將慢慢被刪除(以及 :mod:" +"`importlib` 中的其他類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :exc:" +"`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" #: ../../whatsnew/3.10.rst:1637 msgid "" @@ -3162,25 +3137,24 @@ msgstr "" #: ../../whatsnew/3.10.rst:1641 msgid "" -"Non-integer arguments to :func:`random.randrange` are deprecated. " -"The :exc:`ValueError` is deprecated in favor of a :exc:`TypeError`. " -"(Contributed by Serhiy Storchaka and Raymond Hettinger in :issue:`37319`.)" +"Non-integer arguments to :func:`random.randrange` are deprecated. The :exc:" +"`ValueError` is deprecated in favor of a :exc:`TypeError`. (Contributed by " +"Serhiy Storchaka and Raymond Hettinger in :issue:`37319`.)" msgstr "" ":func:`random.randrange` 的非整數引數已棄用。:exc:`ValueError` 已被棄用,取而" -"代之的是 :exc:`TypeError`。(由 Serhiy Storchaka 和 Raymond Hettinger " -"在 :issue:`37319` 中貢獻。)" +"代之的是 :exc:`TypeError`。(由 Serhiy Storchaka 和 Raymond Hettinger 在 :" +"issue:`37319` 中貢獻。)" #: ../../whatsnew/3.10.rst:1645 msgid "" "The various ``load_module()`` methods of :mod:`importlib` have been " -"documented as deprecated since Python 3.6, but will now also trigger " -"a :exc:`DeprecationWarning`. Use :meth:`~importlib.abc.Loader.exec_module` " -"instead. (Contributed by Brett Cannon in :issue:`26131`.)" +"documented as deprecated since Python 3.6, but will now also trigger a :exc:" +"`DeprecationWarning`. Use :meth:`~importlib.abc.Loader.exec_module` instead. " +"(Contributed by Brett Cannon in :issue:`26131`.)" msgstr "" ":mod:`importlib` 的各種 ``load_module()`` 方法自 Python 3.6 起已被記錄為已棄" -"用,但現在也會觸發 :exc:`DeprecationWarning`。請改" -"用 :meth:`~importlib.abc.Loader.exec_module`。(由 Brett Cannon " -"在 :issue:`26131` 中貢獻。)" +"用,但現在也會觸發 :exc:`DeprecationWarning`。請改用 :meth:`~importlib.abc." +"Loader.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" #: ../../whatsnew/3.10.rst:1651 msgid "" @@ -3188,20 +3162,18 @@ msgid "" "for :meth:`~zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon " "in :issue:`26131`.)" msgstr "" -":meth:`!zimport.zipimporter.load_module` 已被棄用,請" -"用 :meth:`~zipimport.zipimporter.exec_module`。(由 Brett Cannon " -"在 :issue:`26131` 中貢獻。)" +":meth:`!zimport.zipimporter.load_module` 已被棄用,請用 :meth:`~zipimport." +"zipimporter.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" #: ../../whatsnew/3.10.rst:1655 msgid "" "The use of :meth:`~importlib.abc.Loader.load_module` by the import system " -"now triggers an :exc:`ImportWarning` " -"as :meth:`~importlib.abc.Loader.exec_module` is preferred. (Contributed by " -"Brett Cannon in :issue:`26131`.)" +"now triggers an :exc:`ImportWarning` as :meth:`~importlib.abc.Loader." +"exec_module` is preferred. (Contributed by Brett Cannon in :issue:`26131`.)" msgstr "" -"引入系統使用 :meth:`~importlib.abc.Loader.load_module` 現在會觸" -"發 :exc:`ImportWarning`,因為 :meth:`~importlib.abc.Loader.exec_module` 是目" -"前首選。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" +"引入系統使用 :meth:`~importlib.abc.Loader.load_module` 現在會觸發 :exc:" +"`ImportWarning`,因為 :meth:`~importlib.abc.Loader.exec_module` 是目前首選。" +"(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" #: ../../whatsnew/3.10.rst:1660 msgid "" @@ -3214,86 +3186,78 @@ msgid "" msgstr "" "引入系統使用 :meth:`!importlib.abc.MetaPathFinder.find_module` 和 :meth:`!" "importlib.abc.PathEntryFinder.find_module` 現在會觸發 :exc:`ImportWarning`," -"因為 :meth:`importlib.abc.MetaPathFinder.find_spec` " -"和 :meth:`importlib.abc.PathEntryFinder.find_spec` 分別是替代方案的首選。你可" -"以使用 :func:`importlib.util.spec_from_loader` 來幫助移植。(由 Brett Cannon " -"在 :issue:`42134` 中貢獻。)" +"因為 :meth:`importlib.abc.MetaPathFinder.find_spec` 和 :meth:`importlib.abc." +"PathEntryFinder.find_spec` 分別是替代方案的首選。你可以使用 :func:`importlib." +"util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :issue:`42134` 中貢" +"獻。)" #: ../../whatsnew/3.10.rst:1669 msgid "" "The use of :meth:`!importlib.abc.PathEntryFinder.find_loader` by the import " -"system now triggers an :exc:`ImportWarning` " -"as :meth:`importlib.abc.PathEntryFinder.find_spec` is preferred. You can " -"use :func:`importlib.util.spec_from_loader` to help in porting. (Contributed " -"by Brett Cannon in :issue:`43672`.)" +"system now triggers an :exc:`ImportWarning` as :meth:`importlib.abc." +"PathEntryFinder.find_spec` is preferred. You can use :func:`importlib.util." +"spec_from_loader` to help in porting. (Contributed by Brett Cannon in :issue:" +"`43672`.)" msgstr "" -"引入系統使用 :meth:`!importlib.abc.PathEntryFinder.find_loader` 現在會觸" -"發 :exc:`ImportWarning`,因" -"為 :meth:`importlib.abc.PathEntryFinder.find_spec` 是首選。你可以使" -"用 :func:`importlib.util.spec_from_loader` 來幫助移植。(由 Brett Cannon " -"在 :issue:`43672` 中貢獻。)" +"引入系統使用 :meth:`!importlib.abc.PathEntryFinder.find_loader` 現在會觸發 :" +"exc:`ImportWarning`,因為 :meth:`importlib.abc.PathEntryFinder.find_spec` 是" +"首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫助移植。(由 " +"Brett Cannon 在 :issue:`43672` 中貢獻。)" #: ../../whatsnew/3.10.rst:1675 msgid "" -"The various implementations of :meth:`!" -"importlib.abc.MetaPathFinder.find_module` ( :meth:`!" -"importlib.machinery.BuiltinImporter.find_module`, :meth:`!" -"importlib.machinery.FrozenImporter.find_module`, :meth:`!" -"importlib.machinery.WindowsRegistryFinder.find_module`, :meth:`!" -"importlib.machinery.PathFinder.find_module`, :meth:`!" -"importlib.abc.MetaPathFinder.find_module` ), :meth:`!" -"importlib.abc.PathEntryFinder.find_module` ( :meth:`!" -"importlib.machinery.FileFinder.find_module` ), and :meth:`!" -"importlib.abc.PathEntryFinder.find_loader` ( :meth:`!" -"importlib.machinery.FileFinder.find_loader` ) now " -"raise :exc:`DeprecationWarning` and are slated for removal in Python 3.12 " -"(previously they were documented as deprecated in Python 3.4). (Contributed " -"by Brett Cannon in :issue:`42135`.)" +"The various implementations of :meth:`!importlib.abc.MetaPathFinder." +"find_module` ( :meth:`!importlib.machinery.BuiltinImporter.find_module`, :" +"meth:`!importlib.machinery.FrozenImporter.find_module`, :meth:`!importlib." +"machinery.WindowsRegistryFinder.find_module`, :meth:`!importlib.machinery." +"PathFinder.find_module`, :meth:`!importlib.abc.MetaPathFinder." +"find_module` ), :meth:`!importlib.abc.PathEntryFinder.find_module` ( :meth:`!" +"importlib.machinery.FileFinder.find_module` ), and :meth:`!importlib.abc." +"PathEntryFinder.find_loader` ( :meth:`!importlib.machinery.FileFinder." +"find_loader` ) now raise :exc:`DeprecationWarning` and are slated for " +"removal in Python 3.12 (previously they were documented as deprecated in " +"Python 3.4). (Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" ":meth:`!importlib.abc.MetaPathFinder.find_module` 的各種實作(:meth:`!" -"importlib.machinery.BuiltinImporter.find_module`、:meth:`!" -"importlib.machinery.FrozenImporter.find_module`、:meth:`!" -"importlib.machinery.WindowsRegistryFinder.find_module`、:meth:`!" -"importlib.machinery.PathFinder.find_module`、:meth:`!" -"importlib.abc.MetaPathFinder.find_module` )、:meth:`!" -"importlib.abc.PathEntryFinder.find_module` (:meth:`!" -"importlib.machinery.FileFinder.find_module` ) 和 :meth:`!" -"importlib.abc.PathEntryFinder.find_loader` (:meth:`!" -"importlib.machinery.FileFinder.find_loader` ) 現在引" +"importlib.machinery.BuiltinImporter.find_module`、:meth:`!importlib." +"machinery.FrozenImporter.find_module`、:meth:`!importlib.machinery." +"WindowsRegistryFinder.find_module`、:meth:`!importlib.machinery.PathFinder." +"find_module`、:meth:`!importlib.abc.MetaPathFinder.find_module` )、:meth:`!" +"importlib.abc.PathEntryFinder.find_module` (:meth:`!importlib.machinery." +"FileFinder.find_module` ) 和 :meth:`!importlib.abc.PathEntryFinder." +"find_loader` (:meth:`!importlib.machinery.FileFinder.find_loader` ) 現在引" "發 :exc:`DeprecationWarning` 並計劃在 Python 3.12 中刪除(之前它們已在 " "Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" #: ../../whatsnew/3.10.rst:1690 msgid "" -":class:`!importlib.abc.Finder` is deprecated (including its sole " -"method, :meth:`!find_module`). Both :class:`importlib.abc.MetaPathFinder` " -"and :class:`importlib.abc.PathEntryFinder` no longer inherit from the class. " -"Users should inherit from one of these two classes as appropriate instead. " +":class:`!importlib.abc.Finder` is deprecated (including its sole method, :" +"meth:`!find_module`). Both :class:`importlib.abc.MetaPathFinder` and :class:" +"`importlib.abc.PathEntryFinder` no longer inherit from the class. Users " +"should inherit from one of these two classes as appropriate instead. " "(Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" ":class:`!importlib.abc.Finder` 已被棄用(包括其唯一方法 :meth:`!" -"find_module`)。:class:`importlib.abc.MetaPathFinder` " -"和 :class:`importlib.abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據" -"需求來選擇其一以繼承。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" +"find_module`)。:class:`importlib.abc.MetaPathFinder` 和 :class:`importlib." +"abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需求來選擇其一以繼承。" +"(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" #: ../../whatsnew/3.10.rst:1697 msgid "" "The deprecations of :mod:`!imp`, :func:`!importlib.find_loader`, :func:`!" -"importlib.util.set_package_wrapper`, :func:`!" -"importlib.util.set_loader_wrapper`, :func:`!" -"importlib.util.module_for_loader`, :class:`!pkgutil.ImpImporter`, " -"and :class:`!pkgutil.ImpLoader` have all been updated to list Python 3.12 as " -"the slated version of removal (they began raising :exc:`DeprecationWarning` " -"in previous versions of Python). (Contributed by Brett Cannon " -"in :issue:`43720`.)" -msgstr "" -"棄用 :mod:`!imp`、:func:`!importlib.find_loader`、:func:`!" -"importlib.util.set_package_wrapper`、:func:`!" -"importlib.util.set_loader_wrapper`、:func:`!" +"importlib.util.set_package_wrapper`, :func:`!importlib.util." +"set_loader_wrapper`, :func:`!importlib.util.module_for_loader`, :class:`!" +"pkgutil.ImpImporter`, and :class:`!pkgutil.ImpLoader` have all been updated " +"to list Python 3.12 as the slated version of removal (they began raising :" +"exc:`DeprecationWarning` in previous versions of Python). (Contributed by " +"Brett Cannon in :issue:`43720`.)" +msgstr "" +"棄用 :mod:`!imp`、:func:`!importlib.find_loader`、:func:`!importlib.util." +"set_package_wrapper`、:func:`!importlib.util.set_loader_wrapper`、:func:`!" "importlib.util.module_for_loader`、:class:`!pkgutil.ImpImporter` 和 :class:`!" "pkgutil.ImpLoader` 均已更新,將於 Python 3.12 列為預定的刪除版本(它們開始在" -"過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 Brett Cannon " -"在 :issue:`43720` 中貢獻。)" +"過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 Brett Cannon 在 :" +"issue:`43720` 中貢獻。)" #: ../../whatsnew/3.10.rst:1707 msgid "" @@ -3308,22 +3272,22 @@ msgstr "" #: ../../whatsnew/3.10.rst:1713 msgid "" -":meth:`!importlib.abc.Loader.module_repr`, :meth:`!" -"importlib.machinery.FrozenLoader.module_repr`, and :meth:`!" -"importlib.machinery.BuiltinLoader.module_repr` are deprecated and slated for " -"removal in Python 3.12. (Contributed by Brett Cannon in :issue:`42136`.)" +":meth:`!importlib.abc.Loader.module_repr`, :meth:`!importlib.machinery." +"FrozenLoader.module_repr`, and :meth:`!importlib.machinery.BuiltinLoader." +"module_repr` are deprecated and slated for removal in Python 3.12. " +"(Contributed by Brett Cannon in :issue:`42136`.)" msgstr "" -":meth:`!importlib.abc.Loader.module_repr`、:meth:`!" -"importlib.machinery.FrozenLoader.module_repr` 和 :meth:`!" -"importlib.machinery.BuiltinLoader.module_repr` 已棄用並計劃在 Python 3.12 中" -"刪除。(由 Brett Cannon 在 :issue:`42136` 中貢獻。)" +":meth:`!importlib.abc.Loader.module_repr`、:meth:`!importlib.machinery." +"FrozenLoader.module_repr` 和 :meth:`!importlib.machinery.BuiltinLoader." +"module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :issue:" +"`42136` 中貢獻。)" #: ../../whatsnew/3.10.rst:1719 msgid "" "``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python " "3.3, when it was made an alias to :class:`str`. It is now deprecated, " -"scheduled for removal in Python 3.12. (Contributed by Erlend E. Aasland " -"in :issue:`42264`.)" +"scheduled for removal in Python 3.12. (Contributed by Erlend E. Aasland in :" +"issue:`42264`.)" msgstr "" "自 Python 3.3 起,``sqlite3.OptimizedUnicode`` 就沒有文件記錄並且已過時,當時" "它被用作 :class:`str` 的別名。它現已被棄用,並計劃在 Python 3.12 中刪除。" @@ -3392,8 +3356,8 @@ msgid "" "3.12. Use :meth:`pathlib.Path.hardlink_to` instead. (Contributed by Barney " "Gale in :issue:`39950`.)" msgstr "" -":meth:`!pathlib.Path.link_to` 已棄用並計劃在 Python 3.12 中刪除。請改" -"用 :meth:`pathlib.Path.hardlink_to`。(由 Barney Gale 在 :issue:`39950` 中貢" +":meth:`!pathlib.Path.link_to` 已棄用並計劃在 Python 3.12 中刪除。請改用 :" +"meth:`pathlib.Path.hardlink_to`。(由 Barney Gale 在 :issue:`39950` 中貢" "獻。)" #: ../../whatsnew/3.10.rst:1757 @@ -3401,8 +3365,8 @@ msgid "" "``cgi.log()`` is deprecated and slated for removal in Python 3.12. " "(Contributed by Inada Naoki in :issue:`41139`.)" msgstr "" -"``cgi.log()`` 已棄用並計劃在 Python 3.12 中刪除。(由 Inada Naoki " -"在 :issue:`41139` 中貢獻。)" +"``cgi.log()`` 已棄用並計劃在 Python 3.12 中刪除。(由 Inada Naoki 在 :issue:" +"`41139` 中貢獻。)" #: ../../whatsnew/3.10.rst:1760 msgid "" @@ -3416,27 +3380,25 @@ msgstr "" msgid "" ":data:`!OP_NO_SSLv2`, :data:`!OP_NO_SSLv3`, :data:`!OP_NO_TLSv1`, :data:`!" "OP_NO_TLSv1_1`, :data:`!OP_NO_TLSv1_2`, and :data:`!OP_NO_TLSv1_3` are " -"replaced by :attr:`~ssl.SSLContext.minimum_version` " -"and :attr:`~ssl.SSLContext.maximum_version`." +"replaced by :attr:`~ssl.SSLContext.minimum_version` and :attr:`~ssl." +"SSLContext.maximum_version`." msgstr "" ":data:`!OP_NO_SSLv2`、:data:`!OP_NO_SSLv3`、:data:`!OP_NO_TLSv1`、:data:`!" "OP_NO_TLSv1_1`、:data:`!OP_NO_TLSv1_2`、和 :data:`!OP_NO_TLSv1_3` 已被替換" -"為 :attr:`~ssl.sslSSLContext.minimum_version` " -"和 :attr:`~ssl.sslSSLContext.maximum_version`。" +"為 :attr:`~ssl.sslSSLContext.minimum_version` 和 :attr:`~ssl.sslSSLContext." +"maximum_version`。" #: ../../whatsnew/3.10.rst:1769 msgid "" -":data:`!PROTOCOL_SSLv2`, :data:`!PROTOCOL_SSLv3`, :data:`!" -"PROTOCOL_SSLv23`, :data:`!PROTOCOL_TLSv1`, :data:`!" -"PROTOCOL_TLSv1_1`, :data:`!PROTOCOL_TLSv1_2`, and :const:`!PROTOCOL_TLS` are " -"deprecated in favor of :const:`~ssl.PROTOCOL_TLS_CLIENT` " -"and :const:`~ssl.PROTOCOL_TLS_SERVER`" +":data:`!PROTOCOL_SSLv2`, :data:`!PROTOCOL_SSLv3`, :data:`!PROTOCOL_SSLv23`, :" +"data:`!PROTOCOL_TLSv1`, :data:`!PROTOCOL_TLSv1_1`, :data:`!" +"PROTOCOL_TLSv1_2`, and :const:`!PROTOCOL_TLS` are deprecated in favor of :" +"const:`~ssl.PROTOCOL_TLS_CLIENT` and :const:`~ssl.PROTOCOL_TLS_SERVER`" msgstr "" -":data:`!PROTOCOL_SSLv2`、:data:`!PROTOCOL_SSLv3`、:data:`!" -"PROTOCOL_SSLv23`、:data:`!PROTOCOL_TLSv1`、:data:`!" -"PROTOCOL_TLSv1_1`、:data:`!PROTOCOL_TLSv1_2` 和 :const:`!PROTOCOL_TLS` 已棄" -"用,取而代之的是 :const:`~ssl.PROTOCOL_TLS_CLIENT` " -"和 :const:`~ssl.PROTOCOL_TLS_SERVER`" +":data:`!PROTOCOL_SSLv2`、:data:`!PROTOCOL_SSLv3`、:data:`!PROTOCOL_SSLv23`、:" +"data:`!PROTOCOL_TLSv1`、:data:`!PROTOCOL_TLSv1_1`、:data:`!PROTOCOL_TLSv1_2` " +"和 :const:`!PROTOCOL_TLS` 已棄用,取而代之的是 :const:`~ssl." +"PROTOCOL_TLS_CLIENT` 和 :const:`~ssl.PROTOCOL_TLS_SERVER`" #: ../../whatsnew/3.10.rst:1775 msgid ":func:`!wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`" @@ -3452,11 +3414,11 @@ msgstr ":func:`!RAND_pseudo_bytes`, :func:`!RAND_egd`" #: ../../whatsnew/3.10.rst:1781 msgid "" -"NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` " -"and :meth:`ssl.SSLContext.set_npn_protocols` are replaced by ALPN." +"NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` and :meth:`ssl." +"SSLContext.set_npn_protocols` are replaced by ALPN." msgstr "" -"NPN 功能如 :meth:`ssl.SSLSocket.selected_npn_protocol` " -"和 :meth:`ssl.SSLContext.set_npn_protocols` 已被 ALPN 取代。" +"NPN 功能如 :meth:`ssl.SSLSocket.selected_npn_protocol` 和 :meth:`ssl." +"SSLContext.set_npn_protocols` 已被 ALPN 取代。" #: ../../whatsnew/3.10.rst:1784 msgid "" @@ -3471,16 +3433,16 @@ msgstr "" #: ../../whatsnew/3.10.rst:1789 msgid "" -"Importing from the ``typing.io`` and ``typing.re`` submodules will now " -"emit :exc:`DeprecationWarning`. These submodules will be removed in a " -"future version of Python. Anything belonging to these submodules should be " +"Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" +"exc:`DeprecationWarning`. These submodules will be removed in a future " +"version of Python. Anything belonging to these submodules should be " "imported directly from :mod:`typing` instead. (Contributed by Sebastian " "Rittau in :issue:`38291`.)" msgstr "" -"從 ``typing.io`` 和 ``typing.re`` 子模組引入現在將發" -"出 :exc:`DeprecationWarning`。這些子模組將在 Python 的未來版本中刪除。屬於這" -"些子模組的任何內容都應該直接從 :mod:`typing` 引入。(由 Sebastian Rittau " -"在 :issue:`38291` 中貢獻。)" +"從 ``typing.io`` 和 ``typing.re`` 子模組引入現在將發出 :exc:" +"`DeprecationWarning`。這些子模組將在 Python 的未來版本中刪除。屬於這些子模組" +"的任何內容都應該直接從 :mod:`typing` 引入。(由 Sebastian Rittau 在 :issue:" +"`38291` 中貢獻。)" #: ../../whatsnew/3.10.rst:1798 ../../whatsnew/3.10.rst:2221 msgid "Removed" @@ -3490,8 +3452,8 @@ msgstr "已刪除" msgid "" "Removed special methods ``__int__``, ``__float__``, ``__floordiv__``, " "``__mod__``, ``__divmod__``, ``__rfloordiv__``, ``__rmod__`` and " -"``__rdivmod__`` of the :class:`complex` class. They always raised " -"a :exc:`TypeError`. (Contributed by Serhiy Storchaka in :issue:`41974`.)" +"``__rdivmod__`` of the :class:`complex` class. They always raised a :exc:" +"`TypeError`. (Contributed by Serhiy Storchaka in :issue:`41974`.)" msgstr "" "刪除了 :class:`complex` 類別的特殊方法 ``__int__``、``__float__``、" "``__floordiv__``、``__mod__``、``__divmod__``、``__rfloordiv__``、" @@ -3503,8 +3465,8 @@ msgid "" "The ``ParserBase.error()`` method from the private and undocumented " "``_markupbase`` module has been removed. :class:`html.parser.HTMLParser` is " "the only subclass of ``ParserBase`` and its ``error()`` implementation was " -"already removed in Python 3.5. (Contributed by Berker Peksag " -"in :issue:`31844`.)" +"already removed in Python 3.5. (Contributed by Berker Peksag in :issue:" +"`31844`.)" msgstr "" "``_markupbase`` 模組中私有、未於文件記錄的 ``ParserBase.error()`` 方法已被刪" "除。:class:`html.parser.HTMLParser` 是 ``ParserBase`` 的唯一子類別,它的 " @@ -3515,12 +3477,12 @@ msgstr "" msgid "" "Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an internal " "PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` structure was " -"moved to the internal C API. (Contributed by Victor Stinner " -"in :issue:`42157`.)" +"moved to the internal C API. (Contributed by Victor Stinner in :issue:" +"`42157`.)" msgstr "" "刪除了 ``unicodedata.ucnhash_CAPI`` 屬性,該屬性是內部 PyCapsule 物件。相關的" -"私有 ``_PyUnicode_Name_CAPI`` 結構已移至內部 C API。(由 Victor Stinner " -"在 :issue:`42157` 中貢獻。)" +"私有 ``_PyUnicode_Name_CAPI`` 結構已移至內部 C API。(由 Victor Stinner 在 :" +"issue:`42157` 中貢獻。)" #: ../../whatsnew/3.10.rst:1817 msgid "" @@ -3564,24 +3526,24 @@ msgid "" "now due to the :mod:`!_warnings` module was converted to a builtin module in " "2.6. (Contributed by Hai Shi in :issue:`42599`.)" msgstr "" -"刪除了 :c:func:`!PyModule_GetWarningsModule` 函式,該函式現在無用,因" -"為 :mod:`!_warnings` 模組在 2.6 中已轉換為內建模組。(由 Hai Shi " -"在 :issue:`42599` 中貢獻。)" +"刪除了 :c:func:`!PyModule_GetWarningsModule` 函式,該函式現在無用,因為 :mod:" +"`!_warnings` 模組在 2.6 中已轉換為內建模組。(由 Hai Shi 在 :issue:`42599` 中" +"貢獻。)" #: ../../whatsnew/3.10.rst:1838 msgid "" "Remove deprecated aliases to :ref:`collections-abstract-base-classes` from " -"the :mod:`collections` module. (Contributed by Victor Stinner " -"in :issue:`37324`.)" +"the :mod:`collections` module. (Contributed by Victor Stinner in :issue:" +"`37324`.)" msgstr "" "從 :mod:`collections` 模組中刪除已棄用的、對 :ref:`collections-abstract-base-" "classes` 的別名。(由 Victor Stinner 在 :issue:`37324` 中貢獻。)" #: ../../whatsnew/3.10.rst:1842 msgid "" -"The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ " -"'s :doc:`high-level API <../library/asyncio-api-index>` following " -"deprecation in Python 3.8. The motivation behind this change is multifold:" +"The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" +"doc:`high-level API <../library/asyncio-api-index>` following deprecation in " +"Python 3.8. The motivation behind this change is multifold:" msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。這一變化的背後動機是多方面的:" @@ -3610,16 +3572,16 @@ msgid "" "Note that the low-level API will still accept ``loop``. See :ref:`changes-" "python-api` for examples of how to replace existing code." msgstr "" -"請注意,低階 API 仍會接受 ``loop``。有關如何替換現有程式碼的範例,請參" -"閱 :ref:`changes-python-api`。" +"請注意,低階 API 仍會接受 ``loop``。有關如何替換現有程式碼的範例,請參閱 :" +"ref:`changes-python-api`。" #: ../../whatsnew/3.10.rst:1856 ../../whatsnew/3.10.rst:1928 msgid "" "(Contributed by Yurii Karabas, Andrew Svetlov, Yury Selivanov and Kyle " "Stanley in :issue:`42392`.)" msgstr "" -"(由 Yurii Karabas、Andrew Svetlov、Yury Selivanov 和 Kyle Stanley " -"在 :issue:`42392` 中貢獻。)" +"(由 Yurii Karabas、Andrew Svetlov、Yury Selivanov 和 Kyle Stanley 在 :issue:" +"`42392` 中貢獻。)" #: ../../whatsnew/3.10.rst:1861 ../../whatsnew/3.10.rst:2148 msgid "Porting to Python 3.10" @@ -3655,23 +3617,22 @@ msgstr "Python API 的變更" #: ../../whatsnew/3.10.rst:1883 msgid "" -"The *etype* parameters of " -"the :func:`~traceback.format_exception`, :func:`~traceback.format_exception_only`, " -"and :func:`~traceback.print_exception` functions in the :mod:`traceback` " -"module have been renamed to *exc*. (Contributed by Zackery Spytz and " -"Matthias Bussonnier in :issue:`26389`.)" +"The *etype* parameters of the :func:`~traceback.format_exception`, :func:" +"`~traceback.format_exception_only`, and :func:`~traceback.print_exception` " +"functions in the :mod:`traceback` module have been renamed to *exc*. " +"(Contributed by Zackery Spytz and Matthias Bussonnier in :issue:`26389`.)" msgstr "" -":func:`~traceback.format_exception`、:func:`~traceback.format_exception_only` " -"和 :mod:`traceback` 模組中的 :func:`~traceback.print_exception` 函式的 " -"*etype* 參數已重命名為 *exc*。(由 Zackery Spytz 和 Matthias Bussonnier " -"在 :issue:`26389` 中貢獻。)" +":func:`~traceback.format_exception`、:func:`~traceback." +"format_exception_only` 和 :mod:`traceback` 模組中的 :func:`~traceback." +"print_exception` 函式的 *etype* 參數已重命名為 *exc*。(由 Zackery Spytz 和 " +"Matthias Bussonnier 在 :issue:`26389` 中貢獻。)" #: ../../whatsnew/3.10.rst:1889 msgid "" -":mod:`atexit`: At Python exit, if a callback registered " -"with :func:`atexit.register` fails, its exception is now logged. Previously, " -"only some exceptions were logged, and the last exception was always silently " -"ignored. (Contributed by Victor Stinner in :issue:`42639`.)" +":mod:`atexit`: At Python exit, if a callback registered with :func:`atexit." +"register` fails, its exception is now logged. Previously, only some " +"exceptions were logged, and the last exception was always silently ignored. " +"(Contributed by Victor Stinner in :issue:`42639`.)" msgstr "" ":mod:`atexit`:在 Python 退出時,如果一個使用 :func:`atexit.register` 註冊的" "回呼 (callback) 失敗,該例外現在會被記錄下來。在以前只記錄一些例外,並且最後" @@ -3686,35 +3647,34 @@ msgid "" "accesses the arguments via :func:`typing.get_args` or ``__args__`` need to " "account for this change. Furthermore, :exc:`TypeError` may be raised for " "invalid forms of parameterizing :class:`collections.abc.Callable` which may " -"have passed silently in Python 3.9. (Contributed by Ken Jin " -"in :issue:`42195`.)" -msgstr "" -":class:`collections.abc.Callable` 泛型現在會攤平型別參數,類似" -"於 :data:`typing.Callable` 目前的做法。這意味著 " -"``collections.abc.Callable[[int, str], str]`` 將具有 ``(int, str, str)`` 的 " -"``__args__``;以前這是 ``([int, str], str)``。透過 :func:`typing.get_args` " -"或 ``__args__`` 存取參數的程式碼需要考慮此變更。此外,對於無效形式的參數" -"化 :class:`collections.abc.Callable`,可能會引發 :exc:`TypeError`,而在 " -"Python 3.9 中,該參數可能已被默默地傳遞。(由 Ken Jin 在 :issue:`42195` 中貢" -"獻。)" +"have passed silently in Python 3.9. (Contributed by Ken Jin in :issue:" +"`42195`.)" +msgstr "" +":class:`collections.abc.Callable` 泛型現在會攤平型別參數,類似於 :data:" +"`typing.Callable` 目前的做法。這意味著 ``collections.abc.Callable[[int, " +"str], str]`` 將具有 ``(int, str, str)`` 的 ``__args__``;以前這是 ``([int, " +"str], str)``。透過 :func:`typing.get_args` 或 ``__args__`` 存取參數的程式碼需" +"要考慮此變更。此外,對於無效形式的參數化 :class:`collections.abc.Callable`," +"可能會引發 :exc:`TypeError`,而在 Python 3.9 中,該參數可能已被默默地傳遞。" +"(由 Ken Jin 在 :issue:`42195` 中貢獻。)" #: ../../whatsnew/3.10.rst:1905 msgid "" ":meth:`socket.htons` and :meth:`socket.ntohs` now raise :exc:`OverflowError` " "instead of :exc:`DeprecationWarning` if the given parameter will not fit in " -"a 16-bit unsigned integer. (Contributed by Erlend E. Aasland " -"in :issue:`42393`.)" +"a 16-bit unsigned integer. (Contributed by Erlend E. Aasland in :issue:" +"`42393`.)" msgstr "" -"如果給定參數不適合 16 位元無符號整數 (16-bit unsigned " -"integer),:meth:`socket.htons` 和 :meth:`socket.ntohs` 現在會引" -"發 :exc:`OverflowError` 而不是 :exc:`DeprecationWarning`。(由 Erlend E. " -"Aasland 在 :issue:`42393` 中貢獻。)" +"如果給定參數不適合 16 位元無符號整數 (16-bit unsigned integer),:meth:" +"`socket.htons` 和 :meth:`socket.ntohs` 現在會引發 :exc:`OverflowError` 而不" +"是 :exc:`DeprecationWarning`。(由 Erlend E. Aasland 在 :issue:`42393` 中貢" +"獻。)" #: ../../whatsnew/3.10.rst:1910 msgid "" -"The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ " -"'s :doc:`high-level API <../library/asyncio-api-index>` following " -"deprecation in Python 3.8." +"The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" +"doc:`high-level API <../library/asyncio-api-index>` following deprecation in " +"Python 3.8." msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。" @@ -3756,18 +3716,17 @@ msgstr "" msgid "" "The :data:`types.FunctionType` constructor now inherits the current builtins " "if the *globals* dictionary has no ``\"__builtins__\"`` key, rather than " -"using ``{\"None\": None}`` as builtins: same behavior as :func:`eval` " -"and :func:`exec` functions. Defining a function with ``def " -"function(...): ...`` in Python is not affected, globals cannot be overridden " -"with this syntax: it also inherits the current builtins. (Contributed by " -"Victor Stinner in :issue:`42990`.)" -msgstr "" -"如果 *globals* 字典沒有 ``\"__builtins__\"`` 鍵," -"則 :data:`types.FunctionType` 建構函式現在會繼承目前的內建物件,而不是使用 " -"``{\"None\": None}``:相同行為如 :func:`eval` 和 :func:`exec` 函式。在 " -"Python 中使用 ``def function(...): ...`` 定義函式不受影響,全域變數不能用此語" -"法覆蓋:它也繼承目前的內建物件。(由 Victor Stinner 在 :issue:`42990` 中貢" -"獻。)" +"using ``{\"None\": None}`` as builtins: same behavior as :func:`eval` and :" +"func:`exec` functions. Defining a function with ``def function(...): ...`` " +"in Python is not affected, globals cannot be overridden with this syntax: it " +"also inherits the current builtins. (Contributed by Victor Stinner in :issue:" +"`42990`.)" +msgstr "" +"如果 *globals* 字典沒有 ``\"__builtins__\"`` 鍵,則 :data:`types." +"FunctionType` 建構函式現在會繼承目前的內建物件,而不是使用 ``{\"None\": None}" +"``:相同行為如 :func:`eval` 和 :func:`exec` 函式。在 Python 中使用 ``def " +"function(...): ...`` 定義函式不受影響,全域變數不能用此語法覆蓋:它也繼承目前" +"的內建物件。(由 Victor Stinner 在 :issue:`42990` 中貢獻。)" #: ../../whatsnew/3.10.rst:1940 msgid "Changes in the C API" @@ -3821,15 +3780,14 @@ msgstr "" msgid "" "To compile a file given a ``char *`` filename, explicitly open the file, " "read it and compile the result. One way to do this is using the :py:mod:`io` " -"module " -"with :c:func:`PyImport_ImportModule`, :c:func:`PyObject_CallMethod`, :c:func:`PyBytes_AsString` " -"and :c:func:`Py_CompileString`, as sketched below. (Declarations and error " -"handling are omitted.) ::" +"module with :c:func:`PyImport_ImportModule`, :c:func:`PyObject_CallMethod`, :" +"c:func:`PyBytes_AsString` and :c:func:`Py_CompileString`, as sketched below. " +"(Declarations and error handling are omitted.) ::" msgstr "" "要編譯給定 ``char *`` 檔案名稱的檔案,請顯式打開該檔案,讀取它並編譯結果。一" -"種方法是使用 :py:mod:`io` 模組" -"和 :c:func:`PyImport_ImportModule`、:c:func:`PyObject_CallMethod`、:c:func:`PyBytes_AsString` " -"和 :c:func:`Py_CompileString`,如下所示。(宣告和錯誤處理在此被省略。): ::" +"種方法是使用 :py:mod:`io` 模組和 :c:func:`PyImport_ImportModule`、:c:func:" +"`PyObject_CallMethod`、:c:func:`PyBytes_AsString` 和 :c:func:" +"`Py_CompileString`,如下所示。(宣告和錯誤處理在此被省略。): ::" #: ../../whatsnew/3.10.rst:1967 msgid "" @@ -3856,8 +3814,8 @@ msgid "" "string. This means that this number needs to be multiplied by 2 to be used " "with APIs that expect a byte offset instead (like :c:func:`PyCode_Addr2Line` " "for example). Notice as well that the :attr:`!f_lasti` member of " -"``FrameObject`` objects is not considered stable: please " -"use :c:func:`PyFrame_GetLineNumber` instead." +"``FrameObject`` objects is not considered stable: please use :c:func:" +"`PyFrame_GetLineNumber` instead." msgstr "" "對於 ``FrameObject`` 物件,:attr:`~frame.f_lasti` 成員現在表示了字碼偏移量 " "(wordcode offset),而不是位元組碼字串的簡單偏移量。這意味著這個數字需要乘以 " @@ -3911,8 +3869,8 @@ msgid "" "The :mod:`atexit` module must now always be built as a built-in module. " "(Contributed by Victor Stinner in :issue:`42639`.)" msgstr "" -":mod:`atexit` 模組現在必須都被建置為內建模組。(由 Victor Stinner " -"在 :issue:`42639` 中貢獻。)" +":mod:`atexit` 模組現在必須都被建置為內建模組。(由 Victor Stinner 在 :issue:" +"`42639` 中貢獻。)" #: ../../whatsnew/3.10.rst:2005 msgid "" @@ -3921,8 +3879,8 @@ msgid "" "Petazzoni and Peixing Xin in :issue:`27640`.)" msgstr "" "將 :option:`--disable-test-modules` 選項新增到 ``configure`` 腳本中:不建置也" -"不安裝測試模組。(由 Xavier de Gaye、Thomas Petazzoni 和 Peixing Xin " -"在 :issue:`27640` 中貢獻。)" +"不安裝測試模組。(由 Xavier de Gaye、Thomas Petazzoni 和 Peixing Xin 在 :" +"issue:`27640` 中貢獻。)" #: ../../whatsnew/3.10.rst:2009 msgid "" @@ -3941,12 +3899,12 @@ msgstr "" msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" -"share/python-wheels/`` directory and don't install the " -"``ensurepip._bundled`` package." +"share/python-wheels/`` directory and don't install the ``ensurepip." +"_bundled`` package." msgstr "" "一些 Linux 發行版的打包策略建議不要一併包入依賴項目。例如,Fedora 在 ``/usr/" -"share/python-wheels/`` 目錄中安裝 wheel 套件,並且不安裝 " -"``ensurepip._bundled`` 套件。" +"share/python-wheels/`` 目錄中安裝 wheel 套件,並且不安裝 ``ensurepip." +"_bundled`` 套件。" #: ../../whatsnew/3.10.rst:2020 msgid "(Contributed by Victor Stinner in :issue:`42856`.)" @@ -3959,8 +3917,8 @@ msgid "" "library and not install the ``python.o`` object file." msgstr "" "新增 :option:`configure --without-static-libpython 選項 <--without-static-" -"libpython>` 以不建置 ``libpythonMAJOR.MINOR.a`` 靜態函式庫且不安裝 " -"``python.o`` 目標檔案。" +"libpython>` 以不建置 ``libpythonMAJOR.MINOR.a`` 靜態函式庫且不安裝 ``python." +"o`` 目標檔案。" #: ../../whatsnew/3.10.rst:2026 msgid "(Contributed by Victor Stinner in :issue:`43103`.)" @@ -4006,9 +3964,8 @@ msgid "" "and ABI stability guarantees along with best practices for using the Stable " "ABI." msgstr "" -"用於擴充模組或嵌入 Python 的穩定 ABI(應用程式二進位介面)現已明確定" -"義。 :ref:`stable` 描述了 C API 和 ABI 穩定性保證以及使用穩定 ABI 的最佳實" -"踐。" +"用於擴充模組或嵌入 Python 的穩定 ABI(應用程式二進位介面)現已明確定義。 :" +"ref:`stable` 描述了 C API 和 ABI 穩定性保證以及使用穩定 ABI 的最佳實踐。" #: ../../whatsnew/3.10.rst:2051 msgid "(Contributed by Petr Viktorin in :pep:`652` and :issue:`43795`.)" @@ -4016,9 +3973,9 @@ msgstr "(由 Petr Viktorin 在 :pep:`652` 和 :issue:`43795` 中貢獻。)" #: ../../whatsnew/3.10.rst:2056 msgid "" -"The result of :c:func:`PyNumber_Index` now always has exact " -"type :class:`int`. Previously, the result could have been an instance of a " -"subclass of ``int``. (Contributed by Serhiy Storchaka in :issue:`40792`.)" +"The result of :c:func:`PyNumber_Index` now always has exact type :class:" +"`int`. Previously, the result could have been an instance of a subclass of " +"``int``. (Contributed by Serhiy Storchaka in :issue:`40792`.)" msgstr "" ":c:func:`PyNumber_Index` 的結果現在都具有精確的 :class:`int` 型別。在以前,結" "果可能是 ``int`` 子類別的實例。(由 Serhiy Storchaka 在 :issue:`40792` 中貢" @@ -4031,21 +3988,20 @@ msgid "" "Python executable. (Contributed by Victor Stinner in :issue:`23427`.)" msgstr "" "將新的 :c:member:`~PyConfig.orig_argv` 成員新增到 :c:type:`PyConfig` 結構:傳" -"遞給 Python 可執行檔案的原始命令列參數列表。(由 Victor Stinner " -"在 :issue:`23427` 中貢獻。)" +"遞給 Python 可執行檔案的原始命令列參數列表。(由 Victor Stinner 在 :issue:" +"`23427` 中貢獻。)" #: ../../whatsnew/3.10.rst:2065 msgid "" -"The :c:func:`PyDateTime_DATE_GET_TZINFO` " -"and :c:func:`PyDateTime_TIME_GET_TZINFO` macros have been added for " -"accessing the ``tzinfo`` attributes of :class:`datetime.datetime` " -"and :class:`datetime.time` objects. (Contributed by Zackery Spytz " -"in :issue:`30155`.)" +"The :c:func:`PyDateTime_DATE_GET_TZINFO` and :c:func:" +"`PyDateTime_TIME_GET_TZINFO` macros have been added for accessing the " +"``tzinfo`` attributes of :class:`datetime.datetime` and :class:`datetime." +"time` objects. (Contributed by Zackery Spytz in :issue:`30155`.)" msgstr "" -"新增了 :c:func:`PyDateTime_DATE_GET_TZINFO` " -"和 :c:func:`PyDateTime_TIME_GET_TZINFO` 巨集,用於存" -"取 :class:`datetime.datetime` 和 :class:`datetime.time` 物件的 ``tzinfo`` 屬" -"性。(由 Zackery Spytz 在 :issue:`30155` 中貢獻。)" +"新增了 :c:func:`PyDateTime_DATE_GET_TZINFO` 和 :c:func:" +"`PyDateTime_TIME_GET_TZINFO` 巨集,用於存取 :class:`datetime.datetime` 和 :" +"class:`datetime.time` 物件的 ``tzinfo`` 屬性。(由 Zackery Spytz 在 :issue:" +"`30155` 中貢獻。)" #: ../../whatsnew/3.10.rst:2071 msgid "" @@ -4074,13 +4030,13 @@ msgstr "" #: ../../whatsnew/3.10.rst:2082 msgid "" -"Add :c:func:`PyModule_AddObjectRef` function: similar " -"to :c:func:`PyModule_AddObject` but don't steal a reference to the value on " -"success. (Contributed by Victor Stinner in :issue:`1635741`.)" +"Add :c:func:`PyModule_AddObjectRef` function: similar to :c:func:" +"`PyModule_AddObject` but don't steal a reference to the value on success. " +"(Contributed by Victor Stinner in :issue:`1635741`.)" msgstr "" -"新增 :c:func:`PyModule_AddObjectRef` 函式:類似" -"於 :c:func:`PyModule_AddObject` 但成功時不竊取對值的參照。(由 Victor " -"Stinner 在 :issue:`1635741` 中貢獻。)" +"新增 :c:func:`PyModule_AddObjectRef` 函式:類似於 :c:func:" +"`PyModule_AddObject` 但成功時不竊取對值的參照。(由 Victor Stinner 在 :issue:" +"`1635741` 中貢獻。)" #: ../../whatsnew/3.10.rst:2087 msgid "" @@ -4093,9 +4049,9 @@ msgstr "" #: ../../whatsnew/3.10.rst:2091 msgid "" -"The :c:func:`PyType_FromSpecWithBases` " -"and :c:func:`PyType_FromModuleAndSpec` functions now accept a single class " -"as the *bases* argument. (Contributed by Serhiy Storchaka in :issue:`42423`.)" +"The :c:func:`PyType_FromSpecWithBases` and :c:func:" +"`PyType_FromModuleAndSpec` functions now accept a single class as the " +"*bases* argument. (Contributed by Serhiy Storchaka in :issue:`42423`.)" msgstr "" ":c:func:`PyType_FromSpecWithBases` 和 :c:func:`PyType_FromModuleAndSpec` 函式" "現在接受單個類別作為 *bases* 引數。(由 Serhiy Storchaka 在 :issue:`42423` 中" @@ -4139,12 +4095,12 @@ msgid "" "The limited C API is now supported if :ref:`Python is built in debug mode " "` (if the ``Py_DEBUG`` macro is defined). In the limited C API, " "the :c:func:`Py_INCREF` and :c:func:`Py_DECREF` functions are now " -"implemented as opaque function calls, rather than accessing directly " -"the :c:member:`PyObject.ob_refcnt` member, if Python is built in debug mode " -"and the ``Py_LIMITED_API`` macro targets Python 3.10 or newer. It became " -"possible to support the limited C API in debug mode because " -"the :c:type:`PyObject` structure is the same in release and debug mode since " -"Python 3.8 (see :issue:`36465`)." +"implemented as opaque function calls, rather than accessing directly the :c:" +"member:`PyObject.ob_refcnt` member, if Python is built in debug mode and the " +"``Py_LIMITED_API`` macro targets Python 3.10 or newer. It became possible to " +"support the limited C API in debug mode because the :c:type:`PyObject` " +"structure is the same in release and debug mode since Python 3.8 (see :issue:" +"`36465`)." msgstr "" "如 :ref:`Python 是在除錯模式 (debug mode) ` 下建置的(如果有定" "義 ``Py_DEBUG`` 巨集),現在會支援受限 C API。在受限 C API 中,如果 Python 是" @@ -4157,8 +4113,8 @@ msgstr "" #: ../../whatsnew/3.10.rst:2121 msgid "" "The limited C API is still not supported in the :option:`--with-trace-refs` " -"special build (``Py_TRACE_REFS`` macro). (Contributed by Victor Stinner " -"in :issue:`43688`.)" +"special build (``Py_TRACE_REFS`` macro). (Contributed by Victor Stinner in :" +"issue:`43688`.)" msgstr "" ":option:`--with-trace-refs` 特殊建置(``Py_TRACE_REFS`` 巨集)仍不支援受限 C " "API。(由 Victor Stinner 在 :issue:`43688` 中貢獻。)" @@ -4166,29 +4122,28 @@ msgstr "" #: ../../whatsnew/3.10.rst:2125 msgid "" "Add the :c:func:`Py_Is(x, y) ` function to test if the *x* object is " -"the *y* object, the same as ``x is y`` in Python. Add also " -"the :c:func:`Py_IsNone`, :c:func:`Py_IsTrue`, :c:func:`Py_IsFalse` functions " -"to test if an object is, respectively, the ``None`` singleton, the ``True`` " -"singleton or the ``False`` singleton. (Contributed by Victor Stinner " -"in :issue:`43753`.)" +"the *y* object, the same as ``x is y`` in Python. Add also the :c:func:" +"`Py_IsNone`, :c:func:`Py_IsTrue`, :c:func:`Py_IsFalse` functions to test if " +"an object is, respectively, the ``None`` singleton, the ``True`` singleton " +"or the ``False`` singleton. (Contributed by Victor Stinner in :issue:" +"`43753`.)" msgstr "" "新增 :c:func:`Py_Is(x, y) ` 函式來測試 *x* 物件是否為 *y* 物件,與 " -"Python 中的 ``x is y`` 相同。還新" -"增 :c:func:`Py_IsNone`、:c:func:`Py_IsTrue`、:c:func:`Py_IsFalse` 函式來分別" -"測試物件是否為 ``None`` 單例、 ``True`` 單例或 ``False`` 單例。(由 Victor " -"Stinner 在 :issue:`43753` 中貢獻。)" +"Python 中的 ``x is y`` 相同。還新增 :c:func:`Py_IsNone`、:c:func:" +"`Py_IsTrue`、:c:func:`Py_IsFalse` 函式來分別測試物件是否為 ``None`` 單例、 " +"``True`` 單例或 ``False`` 單例。(由 Victor Stinner 在 :issue:`43753` 中貢" +"獻。)" #: ../../whatsnew/3.10.rst:2132 msgid "" -"Add new functions to control the garbage collector from C " -"code: :c:func:`PyGC_Enable()`, :c:func:`PyGC_Disable()`, :c:func:`PyGC_IsEnabled()`. " -"These functions allow to activate, deactivate and query the state of the " -"garbage collector from C code without having to import the :mod:`gc` module." +"Add new functions to control the garbage collector from C code: :c:func:" +"`PyGC_Enable()`, :c:func:`PyGC_Disable()`, :c:func:`PyGC_IsEnabled()`. These " +"functions allow to activate, deactivate and query the state of the garbage " +"collector from C code without having to import the :mod:`gc` module." msgstr "" -"新增函式以從 C 程式碼控制垃圾收集" -"器::c:func:`PyGC_Enable()`、:c:func:`PyGC_Disable()`、:c:func:`PyGC_IsEnabled()`。" -"這些函式使得能夠從 C 程式碼啟用、停用和查詢垃圾收集器的狀態,而無需引" -"入 :mod:`gc` 模組。" +"新增函式以從 C 程式碼控制垃圾收集器::c:func:`PyGC_Enable()`、:c:func:" +"`PyGC_Disable()`、:c:func:`PyGC_IsEnabled()`。這些函式使得能夠從 C 程式碼啟" +"用、停用和查詢垃圾收集器的狀態,而無需引入 :mod:`gc` 模組。" #: ../../whatsnew/3.10.rst:2139 msgid "" @@ -4205,21 +4160,21 @@ msgid "" "(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)" msgstr "" "新增 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標用於建立不可變型別物件:無法" -"設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland " -"在 :issue:`43908` 中貢獻。)" +"設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 :issue:" +"`43908` 中貢獻。)" #: ../../whatsnew/3.10.rst:2150 msgid "" -"The ``PY_SSIZE_T_CLEAN`` macro must now be defined to " -"use :c:func:`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use " -"``#``: ``es#``, ``et#``, ``s#``, ``u#``, ``y#``, ``z#``, ``U#`` and ``Z#``. " -"See :ref:`arg-parsing` and :pep:`353`. (Contributed by Victor Stinner " -"in :issue:`40943`.)" +"The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use :c:func:" +"`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use ``#``: " +"``es#``, ``et#``, ``s#``, ``u#``, ``y#``, ``z#``, ``U#`` and ``Z#``. See :" +"ref:`arg-parsing` and :pep:`353`. (Contributed by Victor Stinner in :issue:" +"`40943`.)" msgstr "" -"現在必須定義 ``PY_SSIZE_T_CLEAN`` 巨集以使用 :c:func:`PyArg_ParseTuple` " -"和 :c:func:`Py_BuildValue` 格式,這些格式使用 ``#``: ``es#``, ``et#``、" -"``s#``、``u#``、``y#``、``z#``、``U#`` 和 ``Z#``。請參閱 :ref:`arg-parsing` " -"和 :pep:`353`。(由 Victor Stinner 在 :issue:`40943` 中貢獻。)" +"現在必須定義 ``PY_SSIZE_T_CLEAN`` 巨集以使用 :c:func:`PyArg_ParseTuple` 和 :" +"c:func:`Py_BuildValue` 格式,這些格式使用 ``#``: ``es#``, ``et#``、``s#``、" +"``u#``、``y#``、``z#``、``U#`` 和 ``Z#``。請參閱 :ref:`arg-parsing` 和 :pep:" +"`353`。(由 Victor Stinner 在 :issue:`40943` 中貢獻。)" #: ../../whatsnew/3.10.rst:2156 msgid "" @@ -4253,9 +4208,9 @@ msgid "" "for historical reason. It is no longer allowed. (Contributed by Victor " "Stinner in :issue:`40839`.)" msgstr "" -"由於過去的種種原因,過去在不持有 :term:`GIL` 的情況下呼" -"叫 :c:func:`PyDict_GetItem` 是被允許的。目前已被禁止。(由 Victor Stinner " -"在 :issue:`40839` 中貢獻。)" +"由於過去的種種原因,過去在不持有 :term:`GIL` 的情況下呼叫 :c:func:" +"`PyDict_GetItem` 是被允許的。目前已被禁止。(由 Victor Stinner 在 :issue:" +"`40839` 中貢獻。)" #: ../../whatsnew/3.10.rst:2171 msgid "" @@ -4280,58 +4235,57 @@ msgstr "" #: ../../whatsnew/3.10.rst:2180 msgid "" -":c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` " -"and :c:func:`Py_GetProgramName` functions now return ``NULL`` if called " -"before :c:func:`Py_Initialize` (before Python is initialized). Use the " -"new :ref:`init-config` API to get the :ref:`init-path-config`. (Contributed " -"by Victor Stinner in :issue:`42260`.)" +":c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:" +"func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and :c:func:" +"`Py_GetProgramName` functions now return ``NULL`` if called before :c:func:" +"`Py_Initialize` (before Python is initialized). Use the new :ref:`init-" +"config` API to get the :ref:`init-path-config`. (Contributed by Victor " +"Stinner in :issue:`42260`.)" msgstr "" -"如果在 :c:func:`Py_Initialize` 之前(Python 初始化之前)被呼" -"叫,:c:func:`Py_GetPath`、:c:func:`Py_GetPrefix`、:c:func:`Py_GetExecPrefix`、:c:func:`Py_GetProgramFullPath`、:c:func:`Py_GetPythonHome` " -"和 :c:func:`Py_GetProgramName` 現在會回傳 ``NULL``。使用新的 :ref:`init-" -"config` API 來取得 :ref:`init-path-config`。(由 Victor Stinner " -"在 :issue:`42260` 中貢獻。)" +"如果在 :c:func:`Py_Initialize` 之前(Python 初始化之前)被呼叫,:c:func:" +"`Py_GetPath`、:c:func:`Py_GetPrefix`、:c:func:`Py_GetExecPrefix`、:c:func:" +"`Py_GetProgramFullPath`、:c:func:`Py_GetPythonHome` 和 :c:func:" +"`Py_GetProgramName` 現在會回傳 ``NULL``。使用新的 :ref:`init-config` API 來取" +"得 :ref:`init-path-config`。(由 Victor Stinner 在 :issue:`42260` 中貢獻。)" #: ../../whatsnew/3.10.rst:2187 msgid "" -":c:func:`PyList_SET_ITEM`, :c:func:`PyTuple_SET_ITEM` " -"and :c:func:`PyCell_SET` macros can no longer be used as l-value or r-value. " -"For example, ``x = PyList_SET_ITEM(a, b, c)`` and ``PyList_SET_ITEM(a, b, c) " -"= x`` now fail with a compiler error. It prevents bugs like ``if " +":c:func:`PyList_SET_ITEM`, :c:func:`PyTuple_SET_ITEM` and :c:func:" +"`PyCell_SET` macros can no longer be used as l-value or r-value. For " +"example, ``x = PyList_SET_ITEM(a, b, c)`` and ``PyList_SET_ITEM(a, b, c) = " +"x`` now fail with a compiler error. It prevents bugs like ``if " "(PyList_SET_ITEM (a, b, c) < 0) ...`` test. (Contributed by Zackery Spytz " "and Victor Stinner in :issue:`30459`.)" msgstr "" -":c:func:`PyList_SET_ITEM`、:c:func:`PyTuple_SET_ITEM` " -"和 :c:func:`PyCell_SET` 巨集不能再用作左值 (l-value) 或右值 (r-value)。例如," -"``x = PyList_SET_ITEM(a, b, c)`` 和 ``PyList_SET_ITEM(a, b, c) = x`` 現在會失" -"敗並出現編譯器錯誤。它可以防止如 ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` " -"測試之類的錯誤。(由 Zackery Spytz 和 Victor Stinner 在 :issue:`30459` 中貢" -"獻。)" +":c:func:`PyList_SET_ITEM`、:c:func:`PyTuple_SET_ITEM` 和 :c:func:" +"`PyCell_SET` 巨集不能再用作左值 (l-value) 或右值 (r-value)。例如,``x = " +"PyList_SET_ITEM(a, b, c)`` 和 ``PyList_SET_ITEM(a, b, c) = x`` 現在會失敗並出" +"現編譯器錯誤。它可以防止如 ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` 測試之" +"類的錯誤。(由 Zackery Spytz 和 Victor Stinner 在 :issue:`30459` 中貢獻。)" #: ../../whatsnew/3.10.rst:2194 msgid "" "The non-limited API files ``odictobject.h``, ``parser_interface.h``, " -"``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``, " -"``pyfpe.h``, and ``pytime.h`` have been moved to the ``Include/cpython`` " -"directory. These files must not be included directly, as they are already " -"included in ``Python.h``; see :ref:`api-includes`. If they have been " -"included directly, consider including ``Python.h`` instead. (Contributed by " -"Nicholas Sim in :issue:`35134`.)" -msgstr "" -"非受限 API 檔案 ``odictobject.h``、``parser_interface.h``、" -"``picklebufobject.h``、``pyarena.h``、``pyctype.h``、``pydebug.h``、" -"``pyfpe.h`` 和 ``pytime.h`` 已移至 ``Include/cpython`` 目錄。這些檔案不得直接" -"被引入,因為它們已於 ``Python.h`` 中引入;請參閱 :ref:`api-includes`。如果直" -"接引入它們,請考慮改為引入 ``Python.h``。(由 Nicholas Sim 在 :issue:`35134` " -"中貢獻。)" +"``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``, ``pyfpe." +"h``, and ``pytime.h`` have been moved to the ``Include/cpython`` directory. " +"These files must not be included directly, as they are already included in " +"``Python.h``; see :ref:`api-includes`. If they have been included directly, " +"consider including ``Python.h`` instead. (Contributed by Nicholas Sim in :" +"issue:`35134`.)" +msgstr "" +"非受限 API 檔案 ``odictobject.h``、``parser_interface.h``、``picklebufobject." +"h``、``pyarena.h``、``pyctype.h``、``pydebug.h``、``pyfpe.h`` 和 ``pytime." +"h`` 已移至 ``Include/cpython`` 目錄。這些檔案不得直接被引入,因為它們已於 " +"``Python.h`` 中引入;請參閱 :ref:`api-includes`。如果直接引入它們,請考慮改為" +"引入 ``Python.h``。(由 Nicholas Sim 在 :issue:`35134` 中貢獻。)" #: ../../whatsnew/3.10.rst:2202 msgid "" "Use the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable " "type objects. Do not rely on :c:macro:`Py_TPFLAGS_HEAPTYPE` to decide if a " "type object is mutable or not; check if :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` " -"is set instead. (Contributed by Victor Stinner and Erlend E. Aasland " -"in :issue:`43908`.)" +"is set instead. (Contributed by Victor Stinner and Erlend E. Aasland in :" +"issue:`43908`.)" msgstr "" "使用 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標來建立不可變型別物件。不要依" "賴 :c:macro:`Py_TPFLAGS_HEAPTYPE` 來決定型別物件是否可變;應改為檢查是否設定" @@ -4367,27 +4321,27 @@ msgstr "" #: ../../whatsnew/3.10.rst:2226 msgid "" -"``Py_UNICODE_strlen``: use :c:func:`PyUnicode_GetLength` " -"or :c:macro:`PyUnicode_GET_LENGTH`" +"``Py_UNICODE_strlen``: use :c:func:`PyUnicode_GetLength` or :c:macro:" +"`PyUnicode_GET_LENGTH`" msgstr "" -"``Py_UNICODE_strlen``:使用 :c:func:`PyUnicode_GetLength` " -"或 :c:macro:`PyUnicode_GET_LENGTH`" +"``Py_UNICODE_strlen``:使用 :c:func:`PyUnicode_GetLength` 或 :c:macro:" +"`PyUnicode_GET_LENGTH`" #: ../../whatsnew/3.10.rst:2228 msgid "" -"``Py_UNICODE_strcat``: use :c:func:`PyUnicode_CopyCharacters` " -"or :c:func:`PyUnicode_FromFormat`" +"``Py_UNICODE_strcat``: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" +"`PyUnicode_FromFormat`" msgstr "" -"``Py_UNICODE_strcat``:使用 :c:func:`PyUnicode_CopyCharacters` " -"或 :c:func:`PyUnicode_FromFormat`" +"``Py_UNICODE_strcat``:使用 :c:func:`PyUnicode_CopyCharacters` 或 :c:func:" +"`PyUnicode_FromFormat`" #: ../../whatsnew/3.10.rst:2230 msgid "" -"``Py_UNICODE_strcpy``, ``Py_UNICODE_strncpy``: " -"use :c:func:`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`" +"``Py_UNICODE_strcpy``, ``Py_UNICODE_strncpy``: use :c:func:" +"`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`" msgstr "" -"``Py_UNICODE_strcpy``、``Py_UNICODE_strncpy``:使" -"用 :c:func:`PyUnicode_CopyCharacters` 或 :c:func:`PyUnicode_Substring`" +"``Py_UNICODE_strcpy``、``Py_UNICODE_strncpy``:使用 :c:func:" +"`PyUnicode_CopyCharacters` 或 :c:func:`PyUnicode_Substring`" #: ../../whatsnew/3.10.rst:2232 msgid "``Py_UNICODE_strcmp``: use :c:func:`PyUnicode_Compare`" @@ -4399,11 +4353,11 @@ msgstr "``Py_UNICODE_strncmp``:使用 :c:func:`PyUnicode_Tailmatch`" #: ../../whatsnew/3.10.rst:2234 msgid "" -"``Py_UNICODE_strchr``, ``Py_UNICODE_strrchr``: " -"use :c:func:`PyUnicode_FindChar`" +"``Py_UNICODE_strchr``, ``Py_UNICODE_strrchr``: use :c:func:" +"`PyUnicode_FindChar`" msgstr "" -"``Py_UNICODE_strchr``、``Py_UNICODE_strrchr``:使" -"用 :c:func:`PyUnicode_FindChar`" +"``Py_UNICODE_strchr``、``Py_UNICODE_strrchr``:使用 :c:func:" +"`PyUnicode_FindChar`" #: ../../whatsnew/3.10.rst:2237 msgid "" @@ -4415,18 +4369,17 @@ msgstr "" #: ../../whatsnew/3.10.rst:2240 msgid "" -"Removed ``PyLong_FromUnicode()``. Please migrate " -"to :c:func:`PyLong_FromUnicodeObject`. (Contributed by Inada Naoki " -"in :issue:`41103`.)" +"Removed ``PyLong_FromUnicode()``. Please migrate to :c:func:" +"`PyLong_FromUnicodeObject`. (Contributed by Inada Naoki in :issue:`41103`.)" msgstr "" "刪除了 ``PyLong_FromUnicode()``。請改用 :c:func:`PyLong_FromUnicodeObject`。" "(由 Inada Naoki 在 :issue:`41103` 中貢獻。)" #: ../../whatsnew/3.10.rst:2243 msgid "" -"Removed ``PyUnicode_AsUnicodeCopy()``. Please " -"use :c:func:`PyUnicode_AsUCS4Copy` or :c:func:`PyUnicode_AsWideCharString` " -"(Contributed by Inada Naoki in :issue:`41103`.)" +"Removed ``PyUnicode_AsUnicodeCopy()``. Please use :c:func:" +"`PyUnicode_AsUCS4Copy` or :c:func:`PyUnicode_AsWideCharString` (Contributed " +"by Inada Naoki in :issue:`41103`.)" msgstr "" "刪除了 ``PyUnicode_AsUnicodeCopy()``。請改用 :c:func:`PyUnicode_AsUCS4Copy` " "或 :c:func:`PyUnicode_AsWideCharString` (由 Inada Naoki 在 :issue:`41103` 中" @@ -4445,9 +4398,9 @@ msgstr "" #: ../../whatsnew/3.10.rst:2251 msgid "" "Removed undocumented macros ``Py_ALLOW_RECURSION`` and " -"``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of " -"the :c:type:`PyInterpreterState` structure. (Contributed by Serhiy Storchaka " -"in :issue:`41936`.)" +"``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the :c:" +"type:`PyInterpreterState` structure. (Contributed by Serhiy Storchaka in :" +"issue:`41936`.)" msgstr "" "刪除了未被說明文件記錄的巨集 ``Py_ALLOW_RECURSION`` 和 " "``Py_END_ALLOW_RECURSION`` 以及 :c:type:`PyInterpreterState` 結構的 " @@ -4456,9 +4409,8 @@ msgstr "" #: ../../whatsnew/3.10.rst:2256 msgid "" "Removed the undocumented ``PyOS_InitInterrupts()`` function. Initializing " -"Python already implicitly installs signal handlers: " -"see :c:member:`PyConfig.install_signal_handlers`. (Contributed by Victor " -"Stinner in :issue:`41713`.)" +"Python already implicitly installs signal handlers: see :c:member:`PyConfig." +"install_signal_handlers`. (Contributed by Victor Stinner in :issue:`41713`.)" msgstr "" "刪除了未被說明文件記錄的 ``PyOS_InitInterrupts()`` 函式。初始化 Python 已經隱" "式安裝信號處理程式:請參閱 :c:member:`PyConfig.install_signal_handlers`。" @@ -4509,8 +4461,8 @@ msgid "" "it could not be used, because the ``symtable.h`` header file was excluded " "from the limited C API." msgstr "" -"``Py_SymtableString()`` 函式錯誤地成為穩定 ABI 的一部分,但它因為 " -"``symtable.h`` 標頭檔被排除在受限 C API 之外而無法使用。" +"``Py_SymtableString()`` 函式錯誤地成為穩定 ABI 的一部分,但它因為 ``symtable." +"h`` 標頭檔被排除在受限 C API 之外而無法使用。" #: ../../whatsnew/3.10.rst:2279 msgid "" @@ -4544,8 +4496,8 @@ msgstr "" "刪除 ``ast.h``、``asdl.h`` 和 ``Python-ast.h`` 標頭檔。這些函式沒有文件記錄," "並且被排除在受限 C API 之外。這些標頭檔定義的大多數名稱都沒有前綴 ``Py``,因" "此可能會產生名稱衝突。例如,``Python-ast.h`` 定義了一個 ``Yield`` 巨集,它與 " -"Windows ```` 標頭使用的 ``Yield`` 有名稱衝突。請改用 " -"Python :mod:`ast` 模組。(由 Victor Stinner 在 :issue:`43244` 中貢獻。)" +"Windows ```` 標頭使用的 ``Yield`` 有名稱衝突。請改用 Python :mod:" +"`ast` 模組。(由 Victor Stinner 在 :issue:`43244` 中貢獻。)" #: ../../whatsnew/3.10.rst:2296 msgid "" @@ -4599,8 +4551,8 @@ msgid "" "These functions were undocumented and excluded from the limited C API. " "(Contributed by Victor Stinner in :issue:`43244`.)" msgstr "" -"這些函式沒有文件記錄,並且被排除在受限 C API 之外。(由 Victor Stinner " -"在 :issue:`43244` 中貢獻。)" +"這些函式沒有文件記錄,並且被排除在受限 C API 之外。(由 Victor Stinner 在 :" +"issue:`43244` 中貢獻。)" #: ../../whatsnew/3.10.rst:2313 msgid "Remove the ``pyarena.h`` header file with functions:" @@ -4625,8 +4577,8 @@ msgstr "``PyArena_AddPyObject()``" #: ../../whatsnew/3.10.rst:2320 msgid "" "These functions were undocumented, excluded from the limited C API, and were " -"only used internally by the compiler. (Contributed by Victor Stinner " -"in :issue:`43244`.)" +"only used internally by the compiler. (Contributed by Victor Stinner in :" +"issue:`43244`.)" msgstr "" "這些函式沒有文件記錄、被排除在受限 C API 之外,並僅被編譯器於內部使用。(由 " "Victor Stinner 在 :issue:`43244` 中貢獻。)" @@ -4665,8 +4617,8 @@ msgid "" "The deprecated :mod:`!mailcap` module now refuses to inject unsafe text " "(filenames, MIME types, parameters) into shell commands. Instead of using " "such text, it will warn and act as if a match was not found (or for test " -"commands, as if the test failed). (Contributed by Petr Viktorin " -"in :gh:`98966`.)" +"commands, as if the test failed). (Contributed by Petr Viktorin in :gh:" +"`98966`.)" msgstr "" #: ../../whatsnew/3.10.rst:2351 diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index ef485f0251..bce1c6c436 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-18 00:15+0000\n" +"POT-Creation-Date: 2025-10-06 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -281,7 +281,7 @@ msgstr "" "`unittest.TestCase` 的\\ `方法別名 `_\\ " "已被刪除。" -#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1842 +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1856 msgid "New Features" msgstr "新增功能" @@ -1324,7 +1324,7 @@ msgid "" "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:869 ../../whatsnew/3.12.rst:1546 +#: ../../whatsnew/3.12.rst:869 ../../whatsnew/3.12.rst:1560 msgid "sqlite3" msgstr "sqlite3" @@ -1399,7 +1399,7 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:920 ../../whatsnew/3.12.rst:1741 +#: ../../whatsnew/3.12.rst:920 ../../whatsnew/3.12.rst:1755 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 " @@ -1587,7 +1587,7 @@ msgid "" "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:1034 ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1034 ../../whatsnew/3.12.rst:1600 msgid "unittest" msgstr "unittest" @@ -1824,7 +1824,7 @@ msgid "" "demos>`_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1151 ../../whatsnew/3.12.rst:2144 +#: ../../whatsnew/3.12.rst:1151 ../../whatsnew/3.12.rst:2158 msgid "Deprecated" msgstr "已棄用" @@ -1928,7 +1928,7 @@ msgstr "" "和 Guido van Rossum 於 :gh:`100160` 貢獻。)" #: ../../whatsnew/3.12.rst:1190 -#: ../../deprecations/pending-removal-in-future.rst:45 +#: ../../deprecations/pending-removal-in-future.rst:44 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." @@ -1939,18 +1939,42 @@ msgstr "" "Roshan 於 :gh:`103636` 貢獻。)" #: ../../whatsnew/3.12.rst:1194 +msgid ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`." +msgstr "" + +#: ../../whatsnew/3.12.rst:1196 +#: ../../deprecations/pending-removal-in-3.17.rst:8 +#: ../../deprecations/pending-removal-in-3.17.rst:36 msgid "" -":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " -"Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in type " -"annotations, prefer a union, like ``bytes | bytearray``, or :class:" -"`collections.abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" +"Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " +"implements the :ref:`buffer protocol ` at runtime. For use in " +"type annotations, either use :class:`~collections.abc.Buffer` or a union " +"that explicitly specifies the types your code supports (e.g., ``bytes | " +"bytearray | memoryview``)." msgstr "" -":mod:`collections.abc`:已棄用 :class:`collections.abc.ByteString`。請改用 :" -"class:`Sequence` 或 :class:`collections.abc.Buffer`。在 typing 中使用時,請改" -"用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " -"Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../whatsnew/3.12.rst:1199 +#: ../../whatsnew/3.12.rst:1202 +#: ../../deprecations/pending-removal-in-3.17.rst:14 +#: ../../deprecations/pending-removal-in-3.17.rst:42 +msgid "" +":class:`!ByteString` was originally intended to be an abstract class that " +"would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " +"However, since the ABC never had any methods, knowing that an object was an " +"instance of :class:`!ByteString` never actually told you anything useful " +"about the object. Other common buffer types such as :class:`memoryview` were " +"also never understood as subtypes of :class:`!ByteString` (either at runtime " +"or by static type checkers)." +msgstr "" + +#: ../../whatsnew/3.12.rst:1210 +#: ../../deprecations/pending-removal-in-3.17.rst:22 +#: ../../deprecations/pending-removal-in-3.17.rst:50 +msgid "" +"See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1213 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1960,7 +1984,7 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1207 +#: ../../whatsnew/3.12.rst:1221 msgid "" ":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" @@ -1968,48 +1992,48 @@ msgstr "" ":mod:`email`:棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1210 +#: ../../whatsnew/3.12.rst:1224 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr ":mod:`importlib.abc`:棄用下列類別,預定於 Python 3.14 中移除:" -#: ../../whatsnew/3.12.rst:1213 +#: ../../whatsnew/3.12.rst:1227 #: ../../deprecations/pending-removal-in-3.14.rst:46 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1214 +#: ../../whatsnew/3.12.rst:1228 #: ../../deprecations/pending-removal-in-3.14.rst:47 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1215 +#: ../../whatsnew/3.12.rst:1229 #: ../../deprecations/pending-removal-in-3.14.rst:48 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1217 +#: ../../whatsnew/3.12.rst:1231 #: ../../deprecations/pending-removal-in-3.14.rst:50 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../whatsnew/3.12.rst:1219 +#: ../../whatsnew/3.12.rst:1233 #: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1220 +#: ../../whatsnew/3.12.rst:1234 #: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1222 +#: ../../whatsnew/3.12.rst:1236 #: ../../deprecations/pending-removal-in-3.14.rst:55 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:1224 +#: ../../whatsnew/3.12.rst:1238 msgid "" ":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " "operations, which is undocumented, inefficient, historically buggy, and " @@ -2018,7 +2042,7 @@ msgid "" "`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1230 +#: ../../whatsnew/3.12.rst:1244 msgid "" ":mod:`multiprocessing`: In Python 3.14, the default :mod:`multiprocessing` " "start method will change to a safer one on Linux, BSDs, and other non-macOS " @@ -2030,7 +2054,7 @@ msgid "" "methods `." msgstr "" -#: ../../whatsnew/3.12.rst:1240 +#: ../../whatsnew/3.12.rst:1254 msgid "" ":mod:`pkgutil`: :func:`!pkgutil.find_loader` and :func:`!pkgutil.get_loader` " "are deprecated and will be removed in Python 3.14; use :func:`importlib.util." @@ -2040,7 +2064,7 @@ msgstr "" "已被棄用並將在 Python 3.14 中移除;請改用 :func:`importlib.util.find_spec`。" "(由 Nikita Sobolev 於 :gh:`97850` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1245 +#: ../../whatsnew/3.12.rst:1259 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " @@ -2048,11 +2072,11 @@ msgid "" "(Contributed by Soumendra Ganguly and Gregory P. Smith in :gh:`85984`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1250 +#: ../../whatsnew/3.12.rst:1264 msgid ":mod:`os`:" msgstr ":mod:`os`:" -#: ../../whatsnew/3.12.rst:1252 +#: ../../whatsnew/3.12.rst:1266 msgid "" "The ``st_ctime`` fields return by :func:`os.stat` and :func:`os.lstat` on " "Windows are deprecated. In a future release, they will contain the last " @@ -2061,7 +2085,7 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1258 +#: ../../whatsnew/3.12.rst:1272 msgid "" "On POSIX platforms, :func:`os.fork` can now raise a :exc:" "`DeprecationWarning` when it can detect being called from a multithreaded " @@ -2075,14 +2099,14 @@ msgid "" "platform compatibility problem to developers." msgstr "" -#: ../../whatsnew/3.12.rst:1268 +#: ../../whatsnew/3.12.rst:1282 msgid "" "When this warning appears due to usage of :mod:`multiprocessing` or :mod:" "`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " "start method such as ``\"spawn\"`` or ``\"forkserver\"``." msgstr "" -#: ../../whatsnew/3.12.rst:1272 +#: ../../whatsnew/3.12.rst:1286 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is " "deprecated; use *onexc* instead. (Contributed by Irit Katriel in :gh:" @@ -2091,19 +2115,19 @@ msgstr "" ":mod:`shutil`::func:`shutil.rmtree` 的 *onerror* 引數已被棄用,請改用 " "*onexc*。(由 Irit Katriel 於 :gh:`102828` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1275 +#: ../../whatsnew/3.12.rst:1289 #: ../../deprecations/pending-removal-in-3.14.rst:85 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../whatsnew/3.12.rst:1277 +#: ../../whatsnew/3.12.rst:1291 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:1283 +#: ../../whatsnew/3.12.rst:1297 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -2113,7 +2137,7 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1290 +#: ../../whatsnew/3.12.rst:1304 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. " @@ -2123,27 +2147,27 @@ msgstr "" "last_traceback` 欄位已被棄用。請改用 :data:`sys.last_exc`。(由 Irit Katriel " "於 :gh:`102778` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1294 +#: ../../whatsnew/3.12.rst:1308 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:1298 +#: ../../whatsnew/3.12.rst:1312 #: ../../deprecations/pending-removal-in-3.15.rst:80 -#: ../../deprecations/pending-removal-in-3.17.rst:4 +#: ../../deprecations/pending-removal-in-3.17.rst:26 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" -#: ../../whatsnew/3.12.rst:1300 +#: ../../whatsnew/3.12.rst:1314 msgid "" ":class:`typing.Hashable` and :class:`typing.Sized`, aliases for :class:" "`collections.abc.Hashable` and :class:`collections.abc.Sized` respectively, " "are deprecated. (:gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1304 +#: ../../whatsnew/3.12.rst:1318 msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" "`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " @@ -2152,7 +2176,7 @@ msgstr "" "自 Python 3.9 起已被棄用的 :class:`typing.ByteString` 現在在使用時會發出 :" "exc:`DeprecationWarning`。(由 Alex Waygood 於 :gh:`91896` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1308 +#: ../../whatsnew/3.12.rst:1322 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -2160,7 +2184,7 @@ msgid "" "implementation emitted nothing. (Contributed by Jacob Walls in :gh:`83122`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1314 +#: ../../whatsnew/3.12.rst:1328 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " "`, :meth:`generator throw() ` and :meth:" @@ -2169,7 +2193,7 @@ msgid "" "instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1320 +#: ../../whatsnew/3.12.rst:1334 msgid "" ":exc:`DeprecationWarning` is now raised when :attr:`~module.__package__` on " "a module differs from :attr:`__spec__.parent = 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -3470,7 +3477,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1404 +#: ../../whatsnew/3.12.rst:1418 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -3480,15 +3487,15 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1411 +#: ../../whatsnew/3.12.rst:1425 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1414 +#: ../../whatsnew/3.12.rst:1428 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.12.rst:1416 +#: ../../whatsnew/3.12.rst:1430 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" @@ -3496,11 +3503,11 @@ msgstr "" "移除 :mod:`enum` 的 ``EnumMeta.__getattr__``,對於列舉屬性的存取不再會需要" "它。" -#: ../../whatsnew/3.12.rst:1421 +#: ../../whatsnew/3.12.rst:1435 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1423 +#: ../../whatsnew/3.12.rst:1437 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" @@ -3508,11 +3515,11 @@ msgstr "" "移除 :mod:`ftplib` 的 ``FTP_TLS.ssl_version`` 類別屬性:請改用 *context* 參" "數。(由 Victor Stinner 於 :gh:`94172` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1442 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1444 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -3521,11 +3528,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1451 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1453 msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -3534,17 +3541,17 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1446 ../../whatsnew/3.12.rst:1475 +#: ../../whatsnew/3.12.rst:1460 ../../whatsnew/3.12.rst:1489 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1462 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "現已完成清理 :mod:`importlib` 中許多過去已經棄用的東西:" -#: ../../whatsnew/3.12.rst:1451 +#: ../../whatsnew/3.12.rst:1465 msgid "" "References to, and support for :meth:`!module_repr` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" @@ -3552,7 +3559,7 @@ msgstr "" "對 :meth:`!module_repr` 的參照和支援已刪除。(由 Barry Warsaw 在 :gh:`97850` " "中貢獻。)" -#: ../../whatsnew/3.12.rst:1454 +#: ../../whatsnew/3.12.rst:1468 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " @@ -3562,7 +3569,7 @@ msgstr "" "util.module_for_loader`` 已全部刪除。(由 Brett Cannon 和 Nikita Sobolev 在 :" "gh:`65961` 和 :gh:`97850` 貢獻。)" -#: ../../whatsnew/3.12.rst:1458 +#: ../../whatsnew/3.12.rst:1472 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" @@ -3570,7 +3577,7 @@ msgstr "" "對 ``find_loader()`` 和 ``find_module()`` API 的支援已被刪除。(由 Barry " "Warsaw 在 :gh:`98040` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:1475 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" @@ -3578,57 +3585,57 @@ msgstr "" "``importlib.abc.Finder``、``pkgutil.ImpImporter`` 和 ``pkgutil.ImpLoader`` 已" "被刪除。(由 Barry Warsaw 在 :gh:`98040` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:1475 +#: ../../whatsnew/3.12.rst:1481 ../../whatsnew/3.12.rst:1489 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1483 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr ":mod:`!imp` 模組已被移除。(由 Barry Warsaw 在 :gh:`98040` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1486 msgid "To migrate, consult the following correspondence table:" msgstr "要遷移的話請參考以下對應表:" -#: ../../whatsnew/3.12.rst:1477 +#: ../../whatsnew/3.12.rst:1491 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1477 +#: ../../whatsnew/3.12.rst:1491 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "將 ``None`` 插入 ``sys.path_importer_cache``" -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1492 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1492 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1479 +#: ../../whatsnew/3.12.rst:1493 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1479 +#: ../../whatsnew/3.12.rst:1493 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1480 +#: ../../whatsnew/3.12.rst:1494 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1480 +#: ../../whatsnew/3.12.rst:1494 msgid ":const:`importlib.util.MAGIC_NUMBER`" msgstr ":const:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1481 +#: ../../whatsnew/3.12.rst:1495 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1481 +#: ../../whatsnew/3.12.rst:1495 msgid "" ":const:`importlib.machinery.SOURCE_SUFFIXES`, :const:`importlib.machinery." "EXTENSION_SUFFIXES`, and :const:`importlib.machinery.BYTECODE_SUFFIXES`" @@ -3636,59 +3643,59 @@ msgstr "" ":const:`importlib.machinery.SOURCE_SUFFIXES`、:const:`importlib.machinery." "EXTENSION_SUFFIXES` 和 :const:`importlib.machinery.BYTECODE_SUFFIXES`" -#: ../../whatsnew/3.12.rst:1482 +#: ../../whatsnew/3.12.rst:1496 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1482 +#: ../../whatsnew/3.12.rst:1496 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1483 +#: ../../whatsnew/3.12.rst:1497 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1483 +#: ../../whatsnew/3.12.rst:1497 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1484 +#: ../../whatsnew/3.12.rst:1498 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1484 +#: ../../whatsnew/3.12.rst:1498 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1485 +#: ../../whatsnew/3.12.rst:1499 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1485 +#: ../../whatsnew/3.12.rst:1499 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1486 +#: ../../whatsnew/3.12.rst:1500 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1486 +#: ../../whatsnew/3.12.rst:1500 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1487 +#: ../../whatsnew/3.12.rst:1501 msgid "``imp.load_source()``" msgstr "``imp.load_source()``" -#: ../../whatsnew/3.12.rst:1487 +#: ../../whatsnew/3.12.rst:1501 msgid "*See below*" msgstr "*見下文*" -#: ../../whatsnew/3.12.rst:1490 +#: ../../whatsnew/3.12.rst:1504 msgid "Replace ``imp.load_source()`` with::" msgstr "用以下取代 ``imp.load_source()``: ::" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1506 msgid "" "import importlib.util\n" "import importlib.machinery\n" @@ -3718,37 +3725,37 @@ msgstr "" " loader.exec_module(module)\n" " return module" -#: ../../whatsnew/3.12.rst:1505 +#: ../../whatsnew/3.12.rst:1519 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "移除 :mod:`!imp` 函式和屬性、沒有替代方案:" -#: ../../whatsnew/3.12.rst:1507 +#: ../../whatsnew/3.12.rst:1521 msgid "Undocumented functions:" msgstr "未以文件記錄的函式:" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1523 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1510 +#: ../../whatsnew/3.12.rst:1524 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1511 +#: ../../whatsnew/3.12.rst:1525 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1526 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1528 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:1516 +#: ../../whatsnew/3.12.rst:1530 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " @@ -3758,11 +3765,11 @@ msgstr "" "``PY_COMPILED``、``C_EXTENSION``、``PY_RESOURCE``、``PKG_DIRECTORY``、" "``C_BUILTIN``、``PY_FROZEN``、``PY_CODERESOURCE``、``IMP_HOOK``。" -#: ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1535 msgid "io" msgstr "io" -#: ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1537 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -3771,22 +3778,22 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1530 +#: ../../whatsnew/3.12.rst:1544 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.12.rst:1532 +#: ../../whatsnew/3.12.rst:1546 msgid "" "Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1537 +#: ../../whatsnew/3.12.rst:1551 msgid "smtpd" msgstr "smtpd" -#: ../../whatsnew/3.12.rst:1539 +#: ../../whatsnew/3.12.rst:1553 msgid "" "The ``smtpd`` module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use the :pypi:" @@ -3797,7 +3804,7 @@ msgstr "" "被棄用。請改用 PyPI 上的 :pypi:`aiosmtpd` 模組或任何其他基於 :mod:`asyncio` " "的伺服器。" -#: ../../whatsnew/3.12.rst:1548 +#: ../../whatsnew/3.12.rst:1562 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" @@ -3805,21 +3812,21 @@ msgstr "" "以下未以文件記錄的 :mod:`sqlite3` 功能已在 Python 3.10 中被棄用、現在已被移" "除:" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1565 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1552 +#: ../../whatsnew/3.12.rst:1566 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1554 +#: ../../whatsnew/3.12.rst:1568 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:1557 +#: ../../whatsnew/3.12.rst:1571 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 " @@ -3827,22 +3834,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1562 +#: ../../whatsnew/3.12.rst:1576 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1565 +#: ../../whatsnew/3.12.rst:1579 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.12.rst:1567 +#: ../../whatsnew/3.12.rst:1581 msgid "" "Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1585 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 " @@ -3850,7 +3857,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1577 +#: ../../whatsnew/3.12.rst:1591 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." @@ -3861,152 +3868,152 @@ msgid "" "`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1602 msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "移除許多 :mod:`unittest` 中被棄用已久的功能:" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1606 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "許多 :class:`~unittest.TestCase` 方法別名:" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1609 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1609 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1609 msgid "Deprecated in" msgstr "已棄用於" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1611 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1597 ../../whatsnew/3.12.rst:1604 +#: ../../whatsnew/3.12.rst:1611 ../../whatsnew/3.12.rst:1618 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1597 ../../whatsnew/3.12.rst:1598 -#: ../../whatsnew/3.12.rst:1599 ../../whatsnew/3.12.rst:1600 -#: ../../whatsnew/3.12.rst:1601 ../../whatsnew/3.12.rst:1602 -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1611 ../../whatsnew/3.12.rst:1612 +#: ../../whatsnew/3.12.rst:1613 ../../whatsnew/3.12.rst:1614 +#: ../../whatsnew/3.12.rst:1615 ../../whatsnew/3.12.rst:1616 +#: ../../whatsnew/3.12.rst:1617 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1598 +#: ../../whatsnew/3.12.rst:1612 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1598 +#: ../../whatsnew/3.12.rst:1612 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1599 +#: ../../whatsnew/3.12.rst:1613 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1599 ../../whatsnew/3.12.rst:1605 +#: ../../whatsnew/3.12.rst:1613 ../../whatsnew/3.12.rst:1619 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1600 +#: ../../whatsnew/3.12.rst:1614 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1600 ../../whatsnew/3.12.rst:1606 +#: ../../whatsnew/3.12.rst:1614 ../../whatsnew/3.12.rst:1620 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1615 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1601 ../../whatsnew/3.12.rst:1607 +#: ../../whatsnew/3.12.rst:1615 ../../whatsnew/3.12.rst:1621 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1602 +#: ../../whatsnew/3.12.rst:1616 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1602 ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1616 ../../whatsnew/3.12.rst:1622 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1617 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1617 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1604 +#: ../../whatsnew/3.12.rst:1618 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1604 ../../whatsnew/3.12.rst:1605 -#: ../../whatsnew/3.12.rst:1606 ../../whatsnew/3.12.rst:1607 -#: ../../whatsnew/3.12.rst:1608 ../../whatsnew/3.12.rst:1609 -#: ../../whatsnew/3.12.rst:1610 +#: ../../whatsnew/3.12.rst:1618 ../../whatsnew/3.12.rst:1619 +#: ../../whatsnew/3.12.rst:1620 ../../whatsnew/3.12.rst:1621 +#: ../../whatsnew/3.12.rst:1622 ../../whatsnew/3.12.rst:1623 +#: ../../whatsnew/3.12.rst:1624 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1605 +#: ../../whatsnew/3.12.rst:1619 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1606 +#: ../../whatsnew/3.12.rst:1620 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1607 +#: ../../whatsnew/3.12.rst:1621 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1622 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1609 +#: ../../whatsnew/3.12.rst:1623 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1609 +#: ../../whatsnew/3.12.rst:1623 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1610 +#: ../../whatsnew/3.12.rst:1624 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1610 +#: ../../whatsnew/3.12.rst:1624 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1611 +#: ../../whatsnew/3.12.rst:1625 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1611 +#: ../../whatsnew/3.12.rst:1625 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1611 +#: ../../whatsnew/3.12.rst:1625 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1614 +#: ../../whatsnew/3.12.rst:1628 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" "你可以使用 https://github.com/isidentical/teyit 來自動現代化你的單元測試。" -#: ../../whatsnew/3.12.rst:1617 +#: ../../whatsnew/3.12.rst:1631 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." @@ -4014,14 +4021,14 @@ msgstr "" "未以文件記錄且已失效的 :class:`~unittest.TestCase` 方法 " "``assertDictContainsSubset``\\ (自 Python 3.2 起已棄用)。" -#: ../../whatsnew/3.12.rst:1620 +#: ../../whatsnew/3.12.rst:1634 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.5)." msgstr "" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1638 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." @@ -4029,26 +4036,26 @@ msgstr "" "對 :class:`~unittest.TextTestResult` 類別的別名:``_TextTestResult``\\ (自 " "Python 3.2 起已棄用)。" -#: ../../whatsnew/3.12.rst:1627 +#: ../../whatsnew/3.12.rst:1641 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1630 +#: ../../whatsnew/3.12.rst:1644 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1632 +#: ../../whatsnew/3.12.rst:1646 msgid "" "Remove support for obsolete browsers from :mod:`webbrowser`. The removed " "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1637 +#: ../../whatsnew/3.12.rst:1651 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1653 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -4057,22 +4064,22 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1646 +#: ../../whatsnew/3.12.rst:1660 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1648 +#: ../../whatsnew/3.12.rst:1662 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1654 +#: ../../whatsnew/3.12.rst:1668 msgid "Others" msgstr "其他" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1670 msgid "" "Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" "file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -4372,15 +4379,15 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1852 +#: ../../whatsnew/3.12.rst:1866 msgid "Code object constructors:" msgstr "程式碼物件建構函式:" -#: ../../whatsnew/3.12.rst:1854 +#: ../../whatsnew/3.12.rst:1868 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "``PyUnstable_Code_New()``\\ (自 ``PyCode_New`` 重新命名)" -#: ../../whatsnew/3.12.rst:1855 +#: ../../whatsnew/3.12.rst:1869 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" @@ -4388,11 +4395,11 @@ msgstr "" "``PyUnstable_Code_NewWithPosOnlyArgs()``\\ (自 " "``PyCode_NewWithPosOnlyArgs`` 重新命名)" -#: ../../whatsnew/3.12.rst:1857 +#: ../../whatsnew/3.12.rst:1871 msgid "Extra storage for code objects (:pep:`523`):" msgstr "程式碼物件的額外儲存 (:pep:`523`):" -#: ../../whatsnew/3.12.rst:1859 +#: ../../whatsnew/3.12.rst:1873 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" @@ -4400,31 +4407,31 @@ msgstr "" "``PyUnstable_Eval_RequestCodeExtraIndex()``\\ (自 " "``_PyEval_RequestCodeExtraIndex`` 重新命名)" -#: ../../whatsnew/3.12.rst:1860 +#: ../../whatsnew/3.12.rst:1874 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "``PyUnstable_Code_GetExtra()``\\ (自 ``_PyCode_GetExtra`` 重新命名)" -#: ../../whatsnew/3.12.rst:1861 +#: ../../whatsnew/3.12.rst:1875 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "``PyUnstable_Code_SetExtra()``\\ (自 ``_PyCode_SetExtra`` 重新命名)" -#: ../../whatsnew/3.12.rst:1863 +#: ../../whatsnew/3.12.rst:1877 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "原始名稱將可繼續使用,直到相應的 API 發生變更。" -#: ../../whatsnew/3.12.rst:1866 +#: ../../whatsnew/3.12.rst:1880 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1868 +#: ../../whatsnew/3.12.rst:1882 msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1871 +#: ../../whatsnew/3.12.rst:1885 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." @@ -4432,30 +4439,30 @@ msgstr "" ":c:member:`PyType_Spec.basicsize` 可以為零或負數來指定繼承或擴充基底類別大" "小。" -#: ../../whatsnew/3.12.rst:1873 +#: ../../whatsnew/3.12.rst:1887 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1875 +#: ../../whatsnew/3.12.rst:1889 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:1878 +#: ../../whatsnew/3.12.rst:1892 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:1881 +#: ../../whatsnew/3.12.rst:1895 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1883 +#: ../../whatsnew/3.12.rst:1897 msgid "" "Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -4463,29 +4470,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1888 +#: ../../whatsnew/3.12.rst:1902 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:1892 +#: ../../whatsnew/3.12.rst:1906 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -#: ../../whatsnew/3.12.rst:1893 +#: ../../whatsnew/3.12.rst:1907 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1894 +#: ../../whatsnew/3.12.rst:1908 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1895 +#: ../../whatsnew/3.12.rst:1909 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1897 +#: ../../whatsnew/3.12.rst:1911 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 " @@ -4496,7 +4503,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1905 +#: ../../whatsnew/3.12.rst:1919 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -4504,32 +4511,32 @@ msgid "" "bookkeeping, using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1910 +#: ../../whatsnew/3.12.rst:1924 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1914 +#: ../../whatsnew/3.12.rst:1928 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1915 +#: ../../whatsnew/3.12.rst:1929 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1916 +#: ../../whatsnew/3.12.rst:1930 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:1918 +#: ../../whatsnew/3.12.rst:1932 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:1922 +#: ../../whatsnew/3.12.rst:1936 msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -4537,14 +4544,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1928 +#: ../../whatsnew/3.12.rst:1942 msgid "" "Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " "the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " "Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1932 +#: ../../whatsnew/3.12.rst:1946 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -4553,28 +4560,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1938 +#: ../../whatsnew/3.12.rst:1952 msgid "" "Add :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1942 +#: ../../whatsnew/3.12.rst:1956 msgid "" "Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1947 +#: ../../whatsnew/3.12.rst:1961 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:1951 +#: ../../whatsnew/3.12.rst:1965 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -4584,14 +4591,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1959 +#: ../../whatsnew/3.12.rst:1973 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:1963 +#: ../../whatsnew/3.12.rst:1977 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -4599,71 +4606,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1982 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:1974 +#: ../../whatsnew/3.12.rst:1988 msgid "" ":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " "reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1977 +#: ../../whatsnew/3.12.rst:1991 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "``_Py_IMMORTAL_REFCNT``:定義物件的參照計數" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:1992 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1979 +#: ../../whatsnew/3.12.rst:1993 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1980 +#: ../../whatsnew/3.12.rst:1994 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "``PyObject_HEAD_INIT`` 這現在將初始化參照計數" -#: ../../whatsnew/3.12.rst:1981 +#: ../../whatsnew/3.12.rst:1995 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "``_Py_IMMORTAL_REFCNT``\\ (與 ``Py_BUILD_CORE`` 一起使用時)。" -#: ../../whatsnew/3.12.rst:1982 +#: ../../whatsnew/3.12.rst:1996 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "``SSTATE_INTERNED_IMMORTAL`` 駐留的 (interned) unicode 物件的識別字" -#: ../../whatsnew/3.12.rst:1983 +#: ../../whatsnew/3.12.rst:1997 msgid "that are immortal." msgstr "那是不滅的。" -#: ../../whatsnew/3.12.rst:1984 +#: ../../whatsnew/3.12.rst:1998 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "``SSSTATE_INTERNED_IMMORTAL_STATIC`` 駐留的 unicode 的識別字" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:1999 msgid "objects that are immortal and static" msgstr "不滅且靜態的物體" -#: ../../whatsnew/3.12.rst:1986 +#: ../../whatsnew/3.12.rst:2000 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "``sys.getunicodeinternedsize`` 這會回傳 unicode 的總數" -#: ../../whatsnew/3.12.rst:1987 +#: ../../whatsnew/3.12.rst:2001 msgid "" "objects that have been interned. This is now needed for :file:`refleak.py` " "to correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1990 +#: ../../whatsnew/3.12.rst:2004 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1992 +#: ../../whatsnew/3.12.rst:2006 msgid "" ":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" "c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " @@ -4675,27 +4682,27 @@ msgstr "" "訊,請參閱 :ref:`whatsnew312-pep684`。)(由 Eric Snow 在 :gh:`104110` 中貢" "獻。)" -#: ../../whatsnew/3.12.rst:1998 +#: ../../whatsnew/3.12.rst:2012 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:2006 +#: ../../whatsnew/3.12.rst:2020 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:2009 +#: ../../whatsnew/3.12.rst:2023 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:2013 +#: ../../whatsnew/3.12.rst:2027 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 " @@ -4704,7 +4711,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:2020 +#: ../../whatsnew/3.12.rst:2034 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 " @@ -4712,13 +4719,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:2025 +#: ../../whatsnew/3.12.rst:2039 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~type." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:2029 +#: ../../whatsnew/3.12.rst:2043 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 " @@ -4727,7 +4734,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2035 +#: ../../whatsnew/3.12.rst:2049 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -4736,13 +4743,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2041 +#: ../../whatsnew/3.12.rst:2055 msgid "" "Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2059 msgid "" "Extension classes wanting to add a :attr:`~object.__dict__` or weak " "reference slot should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -4756,7 +4763,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:2057 +#: ../../whatsnew/3.12.rst:2071 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -4764,7 +4771,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2062 +#: ../../whatsnew/3.12.rst:2076 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 " @@ -4772,7 +4779,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2067 +#: ../../whatsnew/3.12.rst:2081 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 " @@ -4780,7 +4787,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2072 +#: ../../whatsnew/3.12.rst:2086 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 " @@ -4788,25 +4795,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:2077 +#: ../../whatsnew/3.12.rst:2091 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:2080 +#: ../../whatsnew/3.12.rst:2094 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:2081 +#: ../../whatsnew/3.12.rst:2095 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:2082 +#: ../../whatsnew/3.12.rst:2096 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:2084 +#: ../../whatsnew/3.12.rst:2098 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 " @@ -4814,14 +4821,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:2089 +#: ../../whatsnew/3.12.rst:2103 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:2093 +#: ../../whatsnew/3.12.rst:2107 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -4830,17 +4837,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:2100 +#: ../../whatsnew/3.12.rst:2114 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:2102 +#: ../../whatsnew/3.12.rst:2116 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:2104 +#: ../../whatsnew/3.12.rst:2118 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -4848,20 +4855,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2109 +#: ../../whatsnew/3.12.rst:2123 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:2113 +#: ../../whatsnew/3.12.rst:2127 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:2116 +#: ../../whatsnew/3.12.rst:2130 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -4869,14 +4876,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2121 +#: ../../whatsnew/3.12.rst:2135 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:2125 +#: ../../whatsnew/3.12.rst:2139 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -4887,15 +4894,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2133 +#: ../../whatsnew/3.12.rst:2147 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2134 +#: ../../whatsnew/3.12.rst:2148 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2136 +#: ../../whatsnew/3.12.rst:2150 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 " @@ -4904,7 +4911,7 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2146 +#: ../../whatsnew/3.12.rst:2160 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -4913,76 +4920,76 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:2151 +#: ../../whatsnew/3.12.rst:2165 msgid "Deprecate global configuration variable:" msgstr "棄用全域配置變數:" -#: ../../whatsnew/3.12.rst:2153 +#: ../../whatsnew/3.12.rst:2167 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr ":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug`" -#: ../../whatsnew/3.12.rst:2154 +#: ../../whatsnew/3.12.rst:2168 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr ":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose`" -#: ../../whatsnew/3.12.rst:2155 +#: ../../whatsnew/3.12.rst:2169 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr ":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet`" -#: ../../whatsnew/3.12.rst:2156 +#: ../../whatsnew/3.12.rst:2170 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr ":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive`" -#: ../../whatsnew/3.12.rst:2157 +#: ../../whatsnew/3.12.rst:2171 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr ":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect`" -#: ../../whatsnew/3.12.rst:2158 +#: ../../whatsnew/3.12.rst:2172 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" ":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level`" -#: ../../whatsnew/3.12.rst:2159 +#: ../../whatsnew/3.12.rst:2173 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr ":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import`" -#: ../../whatsnew/3.12.rst:2160 +#: ../../whatsnew/3.12.rst:2174 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" ":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning`" -#: ../../whatsnew/3.12.rst:2161 +#: ../../whatsnew/3.12.rst:2175 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" ":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings`" -#: ../../whatsnew/3.12.rst:2162 +#: ../../whatsnew/3.12.rst:2176 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" ":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." "use_environment`" -#: ../../whatsnew/3.12.rst:2163 +#: ../../whatsnew/3.12.rst:2177 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" ":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig.write_bytecode`" -#: ../../whatsnew/3.12.rst:2164 +#: ../../whatsnew/3.12.rst:2178 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" ":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." "user_site_directory`" -#: ../../whatsnew/3.12.rst:2165 +#: ../../whatsnew/3.12.rst:2179 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" ":c:var:`Py_UnbufferedStdioFlag`:請改用 :c:member:`PyConfig.buffered_stdio`" -#: ../../whatsnew/3.12.rst:2166 +#: ../../whatsnew/3.12.rst:2180 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" @@ -4990,11 +4997,11 @@ msgstr "" ":c:var:`Py_HashRandomizationFlag`:請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`" -#: ../../whatsnew/3.12.rst:2168 +#: ../../whatsnew/3.12.rst:2182 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr ":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated`" -#: ../../whatsnew/3.12.rst:2169 +#: ../../whatsnew/3.12.rst:2183 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" @@ -5002,7 +5009,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" -#: ../../whatsnew/3.12.rst:2170 +#: ../../whatsnew/3.12.rst:2184 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" @@ -5010,7 +5017,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." "legacy_windows_stdio`" -#: ../../whatsnew/3.12.rst:2171 +#: ../../whatsnew/3.12.rst:2185 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -5018,7 +5025,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2172 +#: ../../whatsnew/3.12.rst:2186 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -5026,7 +5033,7 @@ msgstr "" ":c:var:`!Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2173 +#: ../../whatsnew/3.12.rst:2187 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" @@ -5034,7 +5041,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." "filesystem_errors`" -#: ../../whatsnew/3.12.rst:2174 +#: ../../whatsnew/3.12.rst:2188 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" @@ -5042,7 +5049,7 @@ msgstr "" ":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" "func:`Py_PreInitialize`)" -#: ../../whatsnew/3.12.rst:2176 +#: ../../whatsnew/3.12.rst:2190 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" @@ -5050,26 +5057,26 @@ msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2180 +#: ../../whatsnew/3.12.rst:2194 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2183 +#: ../../whatsnew/3.12.rst:2197 msgid "" "The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr ":file:`structmember.h` 標頭已棄用,但仍可使用,且還沒有移除它的計畫。" -#: ../../whatsnew/3.12.rst:2186 +#: ../../whatsnew/3.12.rst:2200 msgid "" "Its contents are now available just by including :file:`Python.h`, with a " "``Py`` prefix added if it was missing:" msgstr "" "現在只需包含 :file:`Python.h` 即可使用其內容,如果缺少,則新增 ``Py`` 前綴:" -#: ../../whatsnew/3.12.rst:2189 +#: ../../whatsnew/3.12.rst:2203 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" @@ -5077,7 +5084,7 @@ msgstr "" ":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" "`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2191 +#: ../../whatsnew/3.12.rst:2205 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" @@ -5085,7 +5092,7 @@ msgstr "" "型別巨集,如 :c:macro:`Py_T_INT`、:c:macro:`Py_T_DOUBLE` 等(以前為 " "``T_INT``、 ``T_DOUBLE`` 等)" -#: ../../whatsnew/3.12.rst:2193 +#: ../../whatsnew/3.12.rst:2207 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" @@ -5093,23 +5100,23 @@ msgstr "" ":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" "`Py_AUDIT_READ`\\ (先前全大寫)旗標" -#: ../../whatsnew/3.12.rst:2196 +#: ../../whatsnew/3.12.rst:2210 msgid "Several items are not exposed from :file:`Python.h`:" msgstr "數個項目不再從 :file:`Python.h` 中公開:" -#: ../../whatsnew/3.12.rst:2198 +#: ../../whatsnew/3.12.rst:2212 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr ":c:macro:`T_OBJECT`\\ (請改用 :c:macro:`Py_T_OBJECT_EX`)" -#: ../../whatsnew/3.12.rst:2199 +#: ../../whatsnew/3.12.rst:2213 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr ":c:macro:`T_NONE`\\ (先前未記錄於文件上,且相當古怪)" -#: ../../whatsnew/3.12.rst:2200 +#: ../../whatsnew/3.12.rst:2214 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" -#: ../../whatsnew/3.12.rst:2201 +#: ../../whatsnew/3.12.rst:2215 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." @@ -5117,20 +5124,20 @@ msgstr "" "``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" "`Py_AUDIT_READ`。" -#: ../../whatsnew/3.12.rst:2203 +#: ../../whatsnew/3.12.rst:2217 msgid "" "In some configurations, ```` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2206 +#: ../../whatsnew/3.12.rst:2220 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:2211 +#: ../../whatsnew/3.12.rst:2225 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" @@ -5138,14 +5145,14 @@ msgstr "" "(由 Petr Viktorin 在 :gh:`47146` 中貢獻,其基於 Alexander Belopolsky 和 " "Matthias Braun 的前期工作。)" -#: ../../whatsnew/3.12.rst:2214 +#: ../../whatsnew/3.12.rst:2228 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:2219 +#: ../../whatsnew/3.12.rst:2233 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." @@ -5153,7 +5160,7 @@ msgstr "" ":c:func:`!PyErr_Display` 已棄用,請改用 :c:func:`PyErr_DisplayException`。" "(由 Irit Katriel 於 :gh:`102755` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2222 +#: ../../whatsnew/3.12.rst:2236 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" @@ -5161,7 +5168,7 @@ msgstr "" "``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " "Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2225 +#: ../../whatsnew/3.12.rst:2239 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" @@ -5653,7 +5660,7 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.12.rst:2243 +#: ../../whatsnew/3.12.rst:2257 msgid "" "Remove the :file:`token.h` header file. There was never any public tokenizer " "C API. The :file:`token.h` header file was only designed to be used by " @@ -5663,47 +5670,47 @@ msgstr "" "`token.h` 標頭檔案的設計是僅限用於 Python 內部。(由 Victor Stinner 於 :gh:" "`92651` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2248 +#: ../../whatsnew/3.12.rst:2262 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2250 +#: ../../whatsnew/3.12.rst:2264 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2251 +#: ../../whatsnew/3.12.rst:2265 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2252 +#: ../../whatsnew/3.12.rst:2266 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2253 +#: ../../whatsnew/3.12.rst:2267 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2254 +#: ../../whatsnew/3.12.rst:2268 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2255 +#: ../../whatsnew/3.12.rst:2269 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2256 +#: ../../whatsnew/3.12.rst:2270 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2257 +#: ../../whatsnew/3.12.rst:2271 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2258 +#: ../../whatsnew/3.12.rst:2272 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2260 +#: ../../whatsnew/3.12.rst:2274 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" @@ -5711,6 +5718,45 @@ msgstr "" "移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 於 :gh:" "`85858` 中貢獻。)" +#~ msgid "``bool(NotImplemented)``." +#~ msgstr "``bool(NotImplemented)``。" + +#~ msgid "" +#~ ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " +#~ "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " +#~ "type annotations, prefer a union, like ``bytes | bytearray``, or :class:" +#~ "`collections.abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" +#~ msgstr "" +#~ ":mod:`collections.abc`:已棄用 :class:`collections.abc.ByteString`。請改" +#~ "用 :class:`Sequence` 或 :class:`collections.abc.Buffer`。在 typing 中使用" +#~ "時,請改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc." +#~ "Buffer`。(由 Shantanu Jain 於 :gh:`91896` 貢獻。)" + +#~ msgid "" +#~ ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " +#~ "removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :" +#~ "class:`~collections.abc.Buffer`. For use in type annotations, prefer a " +#~ "union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. " +#~ "(Contributed by Shantanu Jain in :gh:`91896`.)" +#~ msgstr "" +#~ "自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python 3.17 " +#~ "中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:" +#~ "`~collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " +#~ "bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:" +#~ "`91896` 貢獻。)" + +#~ msgid "" +#~ ":class:`collections.abc.ByteString` is scheduled for removal in Python " +#~ "3.17. Prefer :class:`~collections.abc.Sequence` or :class:`~collections." +#~ "abc.Buffer`. For use in type annotations, prefer a union, like ``bytes | " +#~ "bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " +#~ "Jain in :gh:`91896`.)" +#~ msgstr "" +#~ ":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 :" +#~ "class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" +#~ "型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections." +#~ "abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" + #~ msgid "" #~ ":mod:`typing`: :class:`!typing.ByteString`, deprecated since Python 3.9, " #~ "now causes a :exc:`DeprecationWarning` to be emitted when it is used." diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 82dd87b198..d7d6476eed 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-18 00:15+0000\n" +"POT-Creation-Date: 2025-10-10 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -47,13 +47,12 @@ msgstr "發布重點摘要" #: ../../whatsnew/3.13.rst:63 msgid "" -"Python 3.13 is the latest stable release of the Python programming language, " -"with a mix of changes to the language, the implementation and the standard " -"library. The biggest changes include a new `interactive interpreter " -"`_, experimental support for " -"running in a `free-threaded mode `_ (:" -"pep:`703`), and a `Just-In-Time compiler `_ (:pep:" -"`744`)." +"Python 3.13 is a stable release of the Python programming language, with a " +"mix of changes to the language, the implementation and the standard library. " +"The biggest changes include a new `interactive interpreter `_, experimental support for running in a " +"`free-threaded mode `_ (:pep:`703`), and " +"a `Just-In-Time compiler `_ (:pep:`744`)." msgstr "" #: ../../whatsnew/3.13.rst:72 @@ -346,7 +345,7 @@ msgid "" "years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:2046 +#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:2044 msgid "New Features" msgstr "新增功能" @@ -1195,7 +1194,7 @@ msgstr "" msgid "concurrent.futures" msgstr "concurrent.futures" -#: ../../whatsnew/3.13.rst:778 ../../whatsnew/3.13.rst:1680 +#: ../../whatsnew/3.13.rst:778 ../../whatsnew/3.13.rst:1678 msgid "configparser" msgstr "configparser" @@ -1304,9 +1303,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:836 msgid "" -"Allow removing all items from the database through the new :meth:`.gdbm." -"clear` and :meth:`.ndbm.clear` methods. (Contributed by Donghee Na in :gh:" -"`107122`.)" +"Allow removing all items from the database through the new :meth:`!clear` " +"methods of the GDBM and NDBM database objects. (Contributed by Donghee Na " +"in :gh:`107122`.)" msgstr "" #: ../../whatsnew/3.13.rst:842 @@ -1666,7 +1665,7 @@ msgid "" "file is not accessible. (Contributed by Moonsik Park in :gh:`82367`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1105 ../../whatsnew/3.13.rst:1736 +#: ../../whatsnew/3.13.rst:1105 ../../whatsnew/3.13.rst:1734 msgid "pathlib" msgstr "pathlib" @@ -1780,7 +1779,7 @@ msgid "" "Kemenade in :gh:`118131`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1182 ../../whatsnew/3.13.rst:1744 +#: ../../whatsnew/3.13.rst:1182 ../../whatsnew/3.13.rst:1742 msgid "re" msgstr "re" @@ -2061,7 +2060,7 @@ msgid "" "`108191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1389 ../../whatsnew/3.13.rst:1769 +#: ../../whatsnew/3.13.rst:1389 ../../whatsnew/3.13.rst:1767 msgid "typing" msgstr "typing" @@ -2347,16 +2346,10 @@ msgid "" msgstr ":pypi:`bcrypt`:適用於你的軟體與伺服器的現代密碼雜湊演算法。" #: ../../whatsnew/3.13.rst:1572 -msgid "" -":pypi:`passlib`: Comprehensive password hashing framework supporting over 30 " -"schemes." -msgstr ":pypi:`passlib`:支援超過 30 種方案的廣泛密碼雜湊框架。" - -#: ../../whatsnew/3.13.rst:1574 msgid ":pypi:`argon2-cffi`: The secure Argon2 password hashing algorithm." msgstr ":pypi:`argon2-cffi`:安全的 Argon2 密碼雜湊演算法。" -#: ../../whatsnew/3.13.rst:1576 +#: ../../whatsnew/3.13.rst:1574 msgid "" ":pypi:`legacycrypt`: :mod:`ctypes` wrapper to the POSIX crypt library call " "and associated functionality." @@ -2364,7 +2357,7 @@ msgstr "" ":pypi:`legacycrypt`:對 POSIX crypt 函式庫呼叫及相關功能的 :mod:`ctypes` 包" "裝。" -#: ../../whatsnew/3.13.rst:1579 +#: ../../whatsnew/3.13.rst:1577 msgid "" ":pypi:`crypt_r`: Fork of the :mod:`!crypt` module, wrapper to the :manpage:" "`crypt_r(3)` library call and associated functionality." @@ -2372,7 +2365,7 @@ msgstr "" ":pypi:`crypt_r`:對 :mod:`!crypt` 模組的分支 (fork),對 :manpage:" "`crypt_r(3)` 函式庫呼叫及相關功能的包裝。" -#: ../../whatsnew/3.13.rst:1583 +#: ../../whatsnew/3.13.rst:1581 msgid "" ":pypi:`standard-crypt` and :pypi:`deprecated-crypt-alternative`: Use the " "redistribution of ``crypt`` and reimplementation of ``_crypt`` libraries " @@ -2381,7 +2374,7 @@ msgstr "" ":pypi:`standard-crypt` 和 :pypi:`deprecated-crypt-alternative`:PyPI 上的 " "``crypt`` 函式庫重新發布版和 ``_crypt`` 函式庫的重新實作。" -#: ../../whatsnew/3.13.rst:1586 +#: ../../whatsnew/3.13.rst:1584 msgid "" ":mod:`!imghdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements. For example, the :func:`!" @@ -2392,48 +2385,48 @@ msgstr "" "magic` 函式庫。例如 :func:`!puremagic.what` 函式可以取代 :mod:`!imghdr` 過去" "所支援所有文件格式的 :func:`!imghdr.what` 函式。" -#: ../../whatsnew/3.13.rst:1593 +#: ../../whatsnew/3.13.rst:1591 msgid "" ":pypi:`standard-imghdr`: Use the redistribution of ``imghdr`` library from " "PyPI." msgstr ":pypi:`standard-imghdr`:PyPI 上的 ``imghdr`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1596 +#: ../../whatsnew/3.13.rst:1594 msgid ":mod:`!mailcap`: Use the :mod:`mimetypes` module instead." msgstr ":mod:`!mailcap`:請改用 :mod:`mimetypes` 模組。" -#: ../../whatsnew/3.13.rst:1599 +#: ../../whatsnew/3.13.rst:1597 msgid "" ":pypi:`standard-mailcap`: Use the redistribution of ``mailcap`` library from " "PyPI." msgstr ":pypi:`standard-mailcap`:PyPI 上的 ``mailcap`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1602 +#: ../../whatsnew/3.13.rst:1600 msgid ":mod:`!msilib`" msgstr ":mod:`!msilib`" -#: ../../whatsnew/3.13.rst:1603 +#: ../../whatsnew/3.13.rst:1601 msgid ":mod:`!nis`" msgstr ":mod:`!nis`" -#: ../../whatsnew/3.13.rst:1604 +#: ../../whatsnew/3.13.rst:1602 msgid ":mod:`!nntplib`: Use the :pypi:`pynntp` library from PyPI instead." msgstr ":mod:`!nntplib`:請改用 PyPI 上的 :pypi:`pynntp` 函式庫。" -#: ../../whatsnew/3.13.rst:1607 +#: ../../whatsnew/3.13.rst:1605 msgid "" ":pypi:`standard-nntplib`: Use the redistribution of ``nntplib`` library from " "PyPI." msgstr ":pypi:`standard-nntplib`:PyPI 上的 ``nntplib`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1610 +#: ../../whatsnew/3.13.rst:1608 msgid "" ":mod:`!ossaudiodev`: For audio playback, use the :pypi:`pygame` library from " "PyPI instead." msgstr "" ":mod:`!ossaudiodev`:音訊播放方面,請改用 PyPI 上的 :pypi:`pygame` 函式庫。" -#: ../../whatsnew/3.13.rst:1612 +#: ../../whatsnew/3.13.rst:1610 msgid "" ":mod:`!pipes`: Use the :mod:`subprocess` module instead. Use :func:`shlex." "quote` to replace the undocumented ``pipes.quote`` function." @@ -2441,13 +2434,13 @@ msgstr "" ":mod:`!pipes`:請改用 :mod:`subprocess` 模組。使用 :func:`shlex.quote` 來取代" "未以文件紀錄的 ``pipes.quote`` 函式。" -#: ../../whatsnew/3.13.rst:1617 +#: ../../whatsnew/3.13.rst:1615 msgid "" ":pypi:`standard-pipes`: Use the redistribution of ``pipes`` library from " "PyPI." msgstr ":pypi:`standard-pipes`:PyPI 上的 ``pipes`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1620 +#: ../../whatsnew/3.13.rst:1618 msgid "" ":mod:`!sndhdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements." @@ -2455,27 +2448,27 @@ msgstr "" ":mod:`!sndhdr`:請改用 :pypi:`filetype`、:pypi:`puremagic` 或 :pypi:`python-" "magic` 函式庫。" -#: ../../whatsnew/3.13.rst:1624 +#: ../../whatsnew/3.13.rst:1622 msgid "" ":pypi:`standard-sndhdr`: Use the redistribution of ``sndhdr`` library from " "PyPI." msgstr ":pypi:`standard-sndhdr`:PyPI 上的 ``sndhdr`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1627 +#: ../../whatsnew/3.13.rst:1625 msgid ":mod:`!spwd`: Use the :pypi:`python-pam` library from PyPI instead." msgstr ":mod:`!spwd`:請改用 PyPI 上的 :pypi:`python-pam` 函式庫。" -#: ../../whatsnew/3.13.rst:1629 +#: ../../whatsnew/3.13.rst:1627 msgid ":mod:`!sunau`" msgstr ":mod:`!sunau`" -#: ../../whatsnew/3.13.rst:1631 +#: ../../whatsnew/3.13.rst:1629 msgid "" ":pypi:`standard-sunau`: Use the redistribution of ``sunau`` library from " "PyPI." msgstr ":pypi:`standard-sunau`:PyPI 上的 ``sunau`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1634 +#: ../../whatsnew/3.13.rst:1632 msgid "" ":mod:`!telnetlib`, Use the :pypi:`telnetlib3` or :pypi:`Exscript` libraries " "from PyPI instead." @@ -2483,33 +2476,33 @@ msgstr "" ":mod:`!telnetlib`:請改用 PyPI 上的 :pypi:`telnetlib3` 或 :pypi:`Exscript` 函" "式庫。" -#: ../../whatsnew/3.13.rst:1637 +#: ../../whatsnew/3.13.rst:1635 msgid "" ":pypi:`standard-telnetlib`: Use the redistribution of ``telnetlib`` library " "from PyPI." msgstr ":pypi:`standard-telnetlib`:PyPI 上的 ``telnetlib`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1640 +#: ../../whatsnew/3.13.rst:1638 msgid "" ":mod:`!uu`: Use the :mod:`base64` module instead, as a modern alternative." msgstr ":mod:`!uu`:請改用 :mod:`base64` 模組來作為當代的替代方案。" -#: ../../whatsnew/3.13.rst:1643 +#: ../../whatsnew/3.13.rst:1641 msgid "" ":pypi:`standard-uu`: Use the redistribution of ``uu`` library from PyPI." msgstr ":pypi:`standard-uu`:PyPI 上的 ``uu`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1646 +#: ../../whatsnew/3.13.rst:1644 msgid ":mod:`!xdrlib`" msgstr ":mod:`!xdrlib`" -#: ../../whatsnew/3.13.rst:1648 +#: ../../whatsnew/3.13.rst:1646 msgid "" ":pypi:`standard-xdrlib`: Use the redistribution of ``xdrlib`` library from " "PyPI." msgstr ":pypi:`standard-xdrlib`:PyPI 上的 ``xdrlib`` 函式庫重新發布版。" -#: ../../whatsnew/3.13.rst:1651 +#: ../../whatsnew/3.13.rst:1649 msgid "" "(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" "`104780`.)" @@ -2517,22 +2510,22 @@ msgstr "" "(由 Victor Stinner 和 Zachary Ware 在 :gh:`104773` 和 :gh:`104780` 中貢" "獻。)" -#: ../../whatsnew/3.13.rst:1655 +#: ../../whatsnew/3.13.rst:1653 msgid "2to3" msgstr "2to3" -#: ../../whatsnew/3.13.rst:1657 +#: ../../whatsnew/3.13.rst:1655 msgid "" "Remove the :program:`2to3` program and the :mod:`!lib2to3` module, " "previously deprecated in Python 3.11. (Contributed by Victor Stinner in :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1663 +#: ../../whatsnew/3.13.rst:1661 msgid "builtins" msgstr "builtins" -#: ../../whatsnew/3.13.rst:1665 +#: ../../whatsnew/3.13.rst:1663 msgid "" "Remove support for chained :class:`classmethod` descriptors (introduced in :" "gh:`63272`). These can no longer be used to wrap other descriptors, such as :" @@ -2542,47 +2535,47 @@ msgid "" "(Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1674 +#: ../../whatsnew/3.13.rst:1672 msgid "" "Raise a :exc:`RuntimeError` when calling :meth:`frame.clear` on a suspended " "frame (as has always been the case for an executing frame). (Contributed by " "Irit Katriel in :gh:`79932`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1682 +#: ../../whatsnew/3.13.rst:1680 msgid "" "Remove the undocumented :class:`!LegacyInterpolation` class, deprecated in " "the docstring since Python 3.2, and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104886`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1689 +#: ../../whatsnew/3.13.rst:1687 msgid "importlib.metadata" msgstr "importlib.metadata" -#: ../../whatsnew/3.13.rst:1691 +#: ../../whatsnew/3.13.rst:1689 msgid "" "Remove deprecated subscript (:meth:`~object.__getitem__`) access for :ref:" "`EntryPoint ` objects. (Contributed by Jason R. Coombs in :gh:" "`113175`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1697 +#: ../../whatsnew/3.13.rst:1695 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.13.rst:1699 +#: ../../whatsnew/3.13.rst:1697 msgid "" "Remove the :func:`!locale.resetlocale` function, deprecated in Python 3.11. " "Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. (Contributed by " "Victor Stinner in :gh:`104783`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1705 +#: ../../whatsnew/3.13.rst:1703 msgid "opcode" msgstr "opcode" -#: ../../whatsnew/3.13.rst:1707 +#: ../../whatsnew/3.13.rst:1705 msgid "" "Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!_opcode." "ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " @@ -2590,7 +2583,7 @@ msgid "" "Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1712 +#: ../../whatsnew/3.13.rst:1710 msgid "" "Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, and :" "attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but were " @@ -2598,11 +2591,11 @@ msgid "" "be used externally. (Contributed by Irit Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1720 +#: ../../whatsnew/3.13.rst:1718 msgid "optparse" msgstr "optparse" -#: ../../whatsnew/3.13.rst:1722 +#: ../../whatsnew/3.13.rst:1720 msgid "" "This module is no longer considered :term:`soft deprecated`. While :mod:" "`argparse` remains preferred for new projects that aren't using a third " @@ -2615,43 +2608,43 @@ msgid "" "(Contributed by Alyssa Coghlan and Serhiy Storchaka in :gh:`126180`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1738 +#: ../../whatsnew/3.13.rst:1736 msgid "" "Remove the ability to use :class:`~pathlib.Path` objects as context " "managers. This functionality was deprecated and has had no effect since " "Python 3.9. (Contributed by Barney Gale in :gh:`83863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1746 +#: ../../whatsnew/3.13.rst:1744 msgid "" "Remove the undocumented, deprecated, and broken :func:`!re.template` " "function and :attr:`!re.TEMPLATE` / :attr:`!re.T` flag. (Contributed by " "Serhiy Storchaka and Nikita Sobolev in :gh:`105687`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1752 +#: ../../whatsnew/3.13.rst:1750 msgid "tkinter.tix" msgstr "tkinter.tix" -#: ../../whatsnew/3.13.rst:1754 +#: ../../whatsnew/3.13.rst:1752 msgid "" "Remove the :mod:`!tkinter.tix` module, deprecated in Python 3.6. The third-" "party Tix library which the module wrapped is unmaintained. (Contributed by " "Zachary Ware in :gh:`75552`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1760 +#: ../../whatsnew/3.13.rst:1758 msgid "turtle" msgstr "turtle" -#: ../../whatsnew/3.13.rst:1762 +#: ../../whatsnew/3.13.rst:1760 msgid "" "Remove the :meth:`!RawTurtle.settiltangle` method, deprecated in the " "documentation since Python 3.1 and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104876`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1771 +#: ../../whatsnew/3.13.rst:1769 msgid "" "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces, deprecated " "since Python 3.8. The items in those namespaces can be imported directly " @@ -2659,66 +2652,66 @@ msgid "" "`92871`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1777 +#: ../../whatsnew/3.13.rst:1775 msgid "" "Remove the keyword-argument method of creating :class:`~typing.TypedDict` " "types, deprecated in Python 3.11. (Contributed by Tomas Roun in :gh:" "`104786`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1783 +#: ../../whatsnew/3.13.rst:1781 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.13.rst:1785 +#: ../../whatsnew/3.13.rst:1783 msgid "" "Remove the following :mod:`unittest` functions, deprecated in Python 3.11:" msgstr "移除以下在 Python 3.11 中已被棄用的 :mod:`unittest` 函式:" -#: ../../whatsnew/3.13.rst:1787 +#: ../../whatsnew/3.13.rst:1785 msgid ":func:`!unittest.findTestCases`" msgstr ":func:`!unittest.findTestCases`" -#: ../../whatsnew/3.13.rst:1788 +#: ../../whatsnew/3.13.rst:1786 msgid ":func:`!unittest.makeSuite`" msgstr ":func:`!unittest.makeSuite`" -#: ../../whatsnew/3.13.rst:1789 +#: ../../whatsnew/3.13.rst:1787 msgid ":func:`!unittest.getTestCaseNames`" msgstr ":func:`!unittest.getTestCaseNames`" -#: ../../whatsnew/3.13.rst:1791 +#: ../../whatsnew/3.13.rst:1789 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "改用 :class:`~unittest.TestLoader` 方法:" -#: ../../whatsnew/3.13.rst:1793 +#: ../../whatsnew/3.13.rst:1791 msgid ":meth:`~unittest.TestLoader.loadTestsFromModule`" msgstr ":meth:`~unittest.TestLoader.loadTestsFromModule`" -#: ../../whatsnew/3.13.rst:1794 +#: ../../whatsnew/3.13.rst:1792 msgid ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" msgstr ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" -#: ../../whatsnew/3.13.rst:1795 +#: ../../whatsnew/3.13.rst:1793 msgid ":meth:`~unittest.TestLoader.getTestCaseNames`" msgstr ":meth:`~unittest.TestLoader.getTestCaseNames`" -#: ../../whatsnew/3.13.rst:1797 +#: ../../whatsnew/3.13.rst:1795 msgid "(Contributed by Hugo van Kemenade in :gh:`104835`.)" msgstr "(由 Hugo van Kemenade 在 :gh:`104835` 中貢獻。)" -#: ../../whatsnew/3.13.rst:1799 +#: ../../whatsnew/3.13.rst:1797 msgid "" "Remove the untested and undocumented :meth:`!TestProgram.usageExit` method, " "deprecated in Python 3.11. (Contributed by Hugo van Kemenade in :gh:" "`104992`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1805 +#: ../../whatsnew/3.13.rst:1803 msgid "urllib" msgstr "urllib" -#: ../../whatsnew/3.13.rst:1807 +#: ../../whatsnew/3.13.rst:1805 msgid "" "Remove the *cafile*, *capath*, and *cadefault* parameters of the :func:" "`urllib.request.urlopen` function, deprecated in Python 3.6. Use the " @@ -2729,33 +2722,33 @@ msgid "" "Victor Stinner in :gh:`105382`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1818 +#: ../../whatsnew/3.13.rst:1816 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.13.rst:1820 +#: ../../whatsnew/3.13.rst:1818 msgid "" "Remove the untested and undocumented :class:`!MacOSX` class, deprecated in " "Python 3.11. Use the :class:`!MacOSXOSAScript` class (introduced in Python " "3.2) instead. (Contributed by Hugo van Kemenade in :gh:`104804`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1825 +#: ../../whatsnew/3.13.rst:1823 msgid "" "Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use the :" "attr:`MacOSXOSAScript.name ` attribute instead. " "(Contributed by Nikita Sobolev in :gh:`105546`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1832 +#: ../../whatsnew/3.13.rst:1830 msgid "New Deprecations" msgstr "" -#: ../../whatsnew/3.13.rst:1834 +#: ../../whatsnew/3.13.rst:1832 msgid ":ref:`User-defined functions `:" msgstr "" -#: ../../whatsnew/3.13.rst:1836 +#: ../../whatsnew/3.13.rst:1834 msgid "" "Deprecate assignment to a function's :attr:`~function.__code__` attribute, " "where the new code object's type does not match the function's type. The " @@ -2763,12 +2756,12 @@ msgid "" "coroutine. (Contributed by Irit Katriel in :gh:`81137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1842 +#: ../../whatsnew/3.13.rst:1840 #: ../../deprecations/pending-removal-in-3.16.rst:11 msgid ":mod:`array`:" msgstr ":mod:`array`:" -#: ../../whatsnew/3.13.rst:1844 +#: ../../whatsnew/3.13.rst:1842 msgid "" "Deprecate the ``'u'`` format code (:c:type:`wchar_t`) at runtime. This " "format code has been deprecated in documentation since Python 3.3, and will " @@ -2777,61 +2770,61 @@ msgid "" "`80480`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1851 +#: ../../whatsnew/3.13.rst:1849 #: ../../deprecations/pending-removal-in-3.15.rst:16 msgid ":mod:`ctypes`:" msgstr ":mod:`ctypes`:" -#: ../../whatsnew/3.13.rst:1853 +#: ../../whatsnew/3.13.rst:1851 msgid "" "Deprecate the undocumented :func:`!SetPointerType` function, to be removed " "in Python 3.15. (Contributed by Victor Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1857 +#: ../../whatsnew/3.13.rst:1855 msgid "" ":term:`Soft-deprecate ` the :func:`~ctypes.ARRAY` function " "in favour of ``type * length`` multiplication. (Contributed by Victor " "Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1861 +#: ../../whatsnew/3.13.rst:1859 msgid ":mod:`decimal`:" msgstr ":mod:`decimal`:" -#: ../../whatsnew/3.13.rst:1863 +#: ../../whatsnew/3.13.rst:1861 msgid "" "Deprecate the non-standard and undocumented :class:`~decimal.Decimal` format " "specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C " "implementation. (Contributed by Serhiy Storchaka in :gh:`89902`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1868 +#: ../../whatsnew/3.13.rst:1866 msgid ":mod:`dis`:" msgstr ":mod:`dis`:" -#: ../../whatsnew/3.13.rst:1870 +#: ../../whatsnew/3.13.rst:1868 msgid "" "Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership in :data:" "`~dis.hasarg` instead. (Contributed by Irit Katriel in :gh:`109319`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1874 +#: ../../whatsnew/3.13.rst:1872 msgid ":mod:`gettext`:" msgstr ":mod:`gettext`:" -#: ../../whatsnew/3.13.rst:1876 +#: ../../whatsnew/3.13.rst:1874 msgid "" "Deprecate non-integer numbers as arguments to functions and methods that " "consider plural forms in the :mod:`!gettext` module, even if no translation " "was found. (Contributed by Serhiy Storchaka in :gh:`88434`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1881 +#: ../../whatsnew/3.13.rst:1879 msgid ":mod:`glob`:" msgstr ":mod:`glob`:" -#: ../../whatsnew/3.13.rst:1883 +#: ../../whatsnew/3.13.rst:1881 msgid "" "Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" "func:`~glob.glob` and pass a :term:`path-like object` specifying the root " @@ -2839,12 +2832,12 @@ msgid "" "in :gh:`117337`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1888 +#: ../../whatsnew/3.13.rst:1886 #: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr ":mod:`http.server`:" -#: ../../whatsnew/3.13.rst:1890 +#: ../../whatsnew/3.13.rst:1888 msgid "" "Deprecate :class:`~http.server.CGIHTTPRequestHandler`, to be removed in " "Python 3.15. Process-based CGI HTTP servers have been out of favor for a " @@ -2853,30 +2846,30 @@ msgid "" "by Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1897 +#: ../../whatsnew/3.13.rst:1895 msgid "" "Deprecate the :option:`!--cgi` flag to the :program:`python -m http.server` " "command-line interface, to be removed in Python 3.15. (Contributed by " "Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1902 +#: ../../whatsnew/3.13.rst:1900 #: ../../deprecations/pending-removal-in-3.16.rst:70 msgid ":mod:`mimetypes`:" msgstr ":mod:`mimetypes`:" -#: ../../whatsnew/3.13.rst:1904 +#: ../../whatsnew/3.13.rst:1902 msgid "" ":term:`Soft-deprecate ` file path arguments to :func:" "`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. " "(Contributed by Serhiy Storchaka in :gh:`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1909 +#: ../../whatsnew/3.13.rst:1907 msgid ":mod:`re`:" msgstr ":mod:`re`:" -#: ../../whatsnew/3.13.rst:1911 +#: ../../whatsnew/3.13.rst:1909 msgid "" "Deprecate passing the optional *maxsplit*, *count*, or *flags* arguments as " "positional arguments to the module-level :func:`~re.split`, :func:`~re.sub`, " @@ -2885,46 +2878,46 @@ msgid "" "by Serhiy Storchaka in :gh:`56166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1918 +#: ../../whatsnew/3.13.rst:1916 #: ../../deprecations/pending-removal-in-3.15.rst:46 msgid ":mod:`pathlib`:" msgstr ":mod:`pathlib`:" -#: ../../whatsnew/3.13.rst:1920 +#: ../../whatsnew/3.13.rst:1918 msgid "" "Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed " "by Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1925 +#: ../../whatsnew/3.13.rst:1923 #: ../../deprecations/pending-removal-in-3.15.rst:52 msgid ":mod:`platform`:" msgstr ":mod:`platform`:" -#: ../../whatsnew/3.13.rst:1927 +#: ../../whatsnew/3.13.rst:1925 msgid "" "Deprecate :func:`~platform.java_ver`, to be removed in Python 3.15. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested. (Contributed by Nikita Sobolev in :gh:`116349`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1933 +#: ../../whatsnew/3.13.rst:1931 msgid ":mod:`pydoc`:" msgstr ":mod:`pydoc`:" -#: ../../whatsnew/3.13.rst:1935 +#: ../../whatsnew/3.13.rst:1933 msgid "" "Deprecate the undocumented :func:`!ispackage` function. (Contributed by " "Zackery Spytz in :gh:`64020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1938 +#: ../../whatsnew/3.13.rst:1936 #: ../../deprecations/pending-removal-in-3.14.rst:85 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../whatsnew/3.13.rst:1940 +#: ../../whatsnew/3.13.rst:1938 msgid "" "Deprecate passing more than one positional argument to the :func:`~sqlite3." "connect` function and the :class:`~sqlite3.Connection` constructor. The " @@ -2932,7 +2925,7 @@ msgid "" "by Erlend E. Aasland in :gh:`107948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1946 +#: ../../whatsnew/3.13.rst:1944 msgid "" "Deprecate passing name, number of arguments, and the callable as keyword " "arguments for :meth:`.Connection.create_function` and :meth:`.Connection." @@ -2940,7 +2933,7 @@ msgid "" "3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1952 +#: ../../whatsnew/3.13.rst:1950 msgid "" "Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." "Connection.set_authorizer`, :meth:`~sqlite3.Connection." @@ -2950,47 +2943,47 @@ msgid "" "`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1960 +#: ../../whatsnew/3.13.rst:1958 #: ../../deprecations/pending-removal-in-3.16.rst:90 msgid ":mod:`sys`:" msgstr ":mod:`sys`:" -#: ../../whatsnew/3.13.rst:1962 +#: ../../whatsnew/3.13.rst:1960 msgid "" "Deprecate the :func:`~sys._enablelegacywindowsfsencoding` function, to be " "removed in Python 3.16. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead. (Contributed by Inada Naoki in :gh:`73427`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1967 +#: ../../whatsnew/3.13.rst:1965 #: ../../deprecations/pending-removal-in-3.16.rst:102 msgid ":mod:`tarfile`:" msgstr ":mod:`tarfile`:" -#: ../../whatsnew/3.13.rst:1969 +#: ../../whatsnew/3.13.rst:1967 msgid "" "Deprecate the undocumented and unused :attr:`!TarFile.tarfile` attribute, to " "be removed in Python 3.16. (Contributed in :gh:`115256`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1973 +#: ../../whatsnew/3.13.rst:1971 msgid ":mod:`traceback`:" msgstr ":mod:`traceback`:" -#: ../../whatsnew/3.13.rst:1975 +#: ../../whatsnew/3.13.rst:1973 msgid "" "Deprecate the :attr:`.TracebackException.exc_type` attribute. Use :attr:`." "TracebackException.exc_type_str` instead. (Contributed by Irit Katriel in :" "gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1979 +#: ../../whatsnew/3.13.rst:1977 #: ../../deprecations/pending-removal-in-3.15.rst:80 -#: ../../deprecations/pending-removal-in-3.17.rst:4 +#: ../../deprecations/pending-removal-in-3.17.rst:26 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" -#: ../../whatsnew/3.13.rst:1981 +#: ../../whatsnew/3.13.rst:1979 msgid "" "Deprecate the undocumented keyword argument syntax for creating :class:" "`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " @@ -2998,7 +2991,7 @@ msgid "" "functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1988 +#: ../../whatsnew/3.13.rst:1986 msgid "" "Deprecate omitting the *fields* parameter when creating a :class:`~typing." "NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " @@ -3010,7 +3003,7 @@ msgid "" "Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1998 +#: ../../whatsnew/3.13.rst:1996 msgid "" "Deprecate the :func:`typing.no_type_check_decorator` decorator function, to " "be removed in Python 3.15. After eight years in the :mod:`typing` module, it " @@ -3021,7 +3014,7 @@ msgstr "" "除。在 :mod:`typing` 模組中經過八年後,它至今仍未被任何主要的型別檢查器所支" "援。(由 Alex Waygood 在 :gh:`106309` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2004 +#: ../../whatsnew/3.13.rst:2002 msgid "" "Deprecate :data:`typing.AnyStr`. In Python 3.16, it will be removed from " "``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted at " @@ -3030,12 +3023,12 @@ msgid "" "(Contributed by Michael The in :gh:`107116`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2012 +#: ../../whatsnew/3.13.rst:2010 #: ../../deprecations/pending-removal-in-3.15.rst:100 msgid ":mod:`wave`:" msgstr ":mod:`wave`:" -#: ../../whatsnew/3.13.rst:2014 +#: ../../whatsnew/3.13.rst:2012 msgid "" "Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" "`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" @@ -3313,7 +3306,7 @@ msgstr "" "cgi` 旗標已被棄用。" #: ../../deprecations/pending-removal-in-3.15.rst:32 -#: ../../deprecations/pending-removal-in-future.rst:64 +#: ../../deprecations/pending-removal-in-future.rst:63 msgid ":mod:`importlib`:" msgstr ":mod:`importlib`:" @@ -3667,8 +3660,46 @@ msgstr "" msgid "Pending removal in Python 3.17" msgstr "Python 3.17 中待移除的項目" +#: ../../deprecations/pending-removal-in-3.17.rst:4 +msgid ":mod:`collections.abc`:" +msgstr ":mod:`collections.abc`:" + #: ../../deprecations/pending-removal-in-3.17.rst:6 msgid "" +":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:8 +#: ../../deprecations/pending-removal-in-3.17.rst:36 +msgid "" +"Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " +"implements the :ref:`buffer protocol ` at runtime. For use in " +"type annotations, either use :class:`~collections.abc.Buffer` or a union " +"that explicitly specifies the types your code supports (e.g., ``bytes | " +"bytearray | memoryview``)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:14 +#: ../../deprecations/pending-removal-in-3.17.rst:42 +msgid "" +":class:`!ByteString` was originally intended to be an abstract class that " +"would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " +"However, since the ABC never had any methods, knowing that an object was an " +"instance of :class:`!ByteString` never actually told you anything useful " +"about the object. Other common buffer types such as :class:`memoryview` were " +"also never understood as subtypes of :class:`!ByteString` (either at runtime " +"or by static type checkers)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:22 +#: ../../deprecations/pending-removal-in-3.17.rst:50 +msgid "" +"See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:28 +msgid "" "Before Python 3.14, old-style unions were implemented using the private " "class ``typing._UnionGenericAlias``. This class is no longer needed for the " "implementation, but it has been retained for backward compatibility, with " @@ -3681,35 +3712,14 @@ msgstr "" "除。使用者應該改用文件中記錄的內省輔助函式,例如 :func:`typing.get_origin` " "和 :func:`typing.get_args`,或者依賴私有實作細節。" -#: ../../deprecations/pending-removal-in-3.17.rst:11 +#: ../../deprecations/pending-removal-in-3.17.rst:33 +#, fuzzy msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " -"removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :class:" -"`~collections.abc.Buffer`. For use in type annotations, prefer a union, like " -"``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by " -"Shantanu Jain in :gh:`91896`.)" -msgstr "" -"自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python " -"3.17 中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:`~" -"collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " -"bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" - -#: ../../deprecations/pending-removal-in-3.17.rst:17 -msgid ":mod:`collections.abc`:" -msgstr ":mod:`collections.abc`:" - -#: ../../deprecations/pending-removal-in-3.17.rst:19 -msgid "" -":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. " -"Prefer :class:`~collections.abc.Sequence` or :class:`~collections.abc." -"Buffer`. For use in type annotations, prefer a union, like ``bytes | " -"bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " -"Jain in :gh:`91896`.)" +"removal in Python 3.17." msgstr "" -":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 " -":class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" -"型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections.abc." -"Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" +":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`!typing.ByteString` 現在在" +"使用時會發出 :exc:`DeprecationWarning`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:2 #: ../../deprecations/pending-removal-in-future.rst:2 @@ -3744,10 +3754,6 @@ msgid "The :class:`argparse.FileType` type converter is deprecated." msgstr ":class:`argparse.FileType` 型別轉換器已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:18 -msgid "``bool(NotImplemented)``." -msgstr "``bool(NotImplemented)``。" - -#: ../../deprecations/pending-removal-in-future.rst:19 msgid "" "Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " "is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " @@ -3756,7 +3762,7 @@ msgstr "" "產生器:``throw(type, exc, tb)`` 和 ``athrow(type, exc, tb)`` 簽名已被棄用:" "請改用 ``throw(exc)`` 和 ``athrow(exc)``,為單引數簽名。" -#: ../../deprecations/pending-removal-in-future.rst:22 +#: ../../deprecations/pending-removal-in-future.rst:21 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -3774,7 +3780,7 @@ msgstr "" "`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版" "本中,它將被更改為語法錯誤。(:gh:`87999`)" -#: ../../deprecations/pending-removal-in-future.rst:30 +#: ../../deprecations/pending-removal-in-future.rst:29 msgid "" "Support for ``__index__()`` and ``__int__()`` method returning non-int type: " "these methods will be required to return an instance of a strict subclass " @@ -3783,7 +3789,7 @@ msgstr "" "``__index__()`` 和 ``__int__()`` 方法回傳非 int 型別的支援:這些方法將需要回" "傳 :class:`int` 的嚴格子類別實例。" -#: ../../deprecations/pending-removal-in-future.rst:33 +#: ../../deprecations/pending-removal-in-future.rst:32 msgid "" "Support for ``__float__()`` method returning a strict subclass of :class:" "`float`: these methods will be required to return an instance of :class:" @@ -3792,7 +3798,7 @@ msgstr "" "回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回" "傳 :class:`float` 的實例。" -#: ../../deprecations/pending-removal-in-future.rst:36 +#: ../../deprecations/pending-removal-in-future.rst:35 msgid "" "Support for ``__complex__()`` method returning a strict subclass of :class:" "`complex`: these methods will be required to return an instance of :class:" @@ -3801,11 +3807,11 @@ msgstr "" "回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要" "回傳 :class:`complex` 的實例。" -#: ../../deprecations/pending-removal-in-future.rst:39 +#: ../../deprecations/pending-removal-in-future.rst:38 msgid "Delegation of ``int()`` to ``__trunc__()`` method." msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" -#: ../../deprecations/pending-removal-in-future.rst:40 +#: ../../deprecations/pending-removal-in-future.rst:39 msgid "" "Passing a complex number as the *real* or *imag* argument in the :func:" "`complex` constructor is now deprecated; it should only be passed as a " @@ -3815,7 +3821,7 @@ msgstr "" "在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" "它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:45 +#: ../../deprecations/pending-removal-in-future.rst:44 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." @@ -3825,25 +3831,25 @@ msgstr "" "被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince " "Roshan 於 :gh:`103636` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:50 +#: ../../deprecations/pending-removal-in-future.rst:49 msgid "" ":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:" "`133038`)" msgstr "" ":mod:`codecs`:請改用 :func:`open` 而非 :func:`codecs.open`。(:gh:`133038`)" -#: ../../deprecations/pending-removal-in-future.rst:52 +#: ../../deprecations/pending-removal-in-future.rst:51 msgid "" ":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " "instead." msgstr "" ":attr:`codeobject.co_lnotab`:請改用 :meth:`codeobject.co_lines` 方法。" -#: ../../deprecations/pending-removal-in-future.rst:55 +#: ../../deprecations/pending-removal-in-future.rst:54 msgid ":mod:`datetime`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-future.rst:57 +#: ../../deprecations/pending-removal-in-future.rst:56 msgid "" ":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." "UTC)``." @@ -3851,7 +3857,7 @@ msgstr "" ":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime." "now(tz=datetime.UTC)``。" -#: ../../deprecations/pending-removal-in-future.rst:59 +#: ../../deprecations/pending-removal-in-future.rst:58 msgid "" ":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." "fromtimestamp(timestamp, tz=datetime.UTC)``." @@ -3859,11 +3865,11 @@ msgstr "" ":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime." "fromtimestamp(timestamp, tz=datetime.UTC)``。" -#: ../../deprecations/pending-removal-in-future.rst:62 +#: ../../deprecations/pending-removal-in-future.rst:61 msgid ":mod:`gettext`: Plural value must be an integer." msgstr ":mod:`gettext`:複數值必須是整數。" -#: ../../deprecations/pending-removal-in-future.rst:66 +#: ../../deprecations/pending-removal-in-future.rst:65 msgid "" ":func:`~importlib.util.cache_from_source` *debug_override* parameter is " "deprecated: use the *optimization* parameter instead." @@ -3871,19 +3877,19 @@ msgstr "" ":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改" "用 *optimization* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:69 +#: ../../deprecations/pending-removal-in-future.rst:68 msgid ":mod:`importlib.metadata`:" msgstr ":mod:`importlib.metadata`:" -#: ../../deprecations/pending-removal-in-future.rst:71 +#: ../../deprecations/pending-removal-in-future.rst:70 msgid "``EntryPoints`` tuple interface." msgstr "``EntryPoints`` 元組介面。" -#: ../../deprecations/pending-removal-in-future.rst:72 +#: ../../deprecations/pending-removal-in-future.rst:71 msgid "Implicit ``None`` on return values." msgstr "回傳值上的隱式 ``None``。" -#: ../../deprecations/pending-removal-in-future.rst:74 +#: ../../deprecations/pending-removal-in-future.rst:73 msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." @@ -3891,19 +3897,19 @@ msgstr "" ":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" "`~logging.warning`。" -#: ../../deprecations/pending-removal-in-future.rst:77 +#: ../../deprecations/pending-removal-in-future.rst:76 msgid "" ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " "BytesIO and binary mode instead." msgstr "" ":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。" -#: ../../deprecations/pending-removal-in-future.rst:80 +#: ../../deprecations/pending-removal-in-future.rst:79 msgid "" ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。" -#: ../../deprecations/pending-removal-in-future.rst:82 +#: ../../deprecations/pending-removal-in-future.rst:81 msgid "" ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " "deprecated, use an exception instance." @@ -3911,7 +3917,7 @@ msgstr "" ":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外" "實例。" -#: ../../deprecations/pending-removal-in-future.rst:85 +#: ../../deprecations/pending-removal-in-future.rst:84 msgid "" ":mod:`re`: More strict rules are now applied for numerical group references " "and group names in regular expressions. Only sequence of ASCII digits is " @@ -3923,12 +3929,12 @@ msgstr "" "有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能" "包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:92 +#: ../../deprecations/pending-removal-in-future.rst:91 msgid "" ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。" -#: ../../deprecations/pending-removal-in-future.rst:94 +#: ../../deprecations/pending-removal-in-future.rst:93 msgid "" ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " "Python 3.12; use the *onexc* parameter instead." @@ -3936,15 +3942,15 @@ msgstr "" ":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被" "棄用;請改用 *onexc* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:97 +#: ../../deprecations/pending-removal-in-future.rst:96 msgid ":mod:`ssl` options and protocols:" msgstr ":mod:`ssl` 選項和協定:" -#: ../../deprecations/pending-removal-in-future.rst:99 +#: ../../deprecations/pending-removal-in-future.rst:98 msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:100 +#: ../../deprecations/pending-removal-in-future.rst:99 msgid "" ":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" "`!selected_npn_protocol` are deprecated: use ALPN instead." @@ -3952,51 +3958,51 @@ msgstr "" ":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" "`!selected_npn_protocol` 已被棄用:請改用 ALPN。" -#: ../../deprecations/pending-removal-in-future.rst:103 +#: ../../deprecations/pending-removal-in-future.rst:102 msgid "``ssl.OP_NO_SSL*`` options" msgstr "``ssl.OP_NO_SSL*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:104 +#: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.OP_NO_TLS*`` options" msgstr "``ssl.OP_NO_TLS*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:105 +#: ../../deprecations/pending-removal-in-future.rst:104 msgid "``ssl.PROTOCOL_SSLv3``" msgstr "``ssl.PROTOCOL_SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:106 +#: ../../deprecations/pending-removal-in-future.rst:105 msgid "``ssl.PROTOCOL_TLS``" msgstr "``ssl.PROTOCOL_TLS``" -#: ../../deprecations/pending-removal-in-future.rst:107 +#: ../../deprecations/pending-removal-in-future.rst:106 msgid "``ssl.PROTOCOL_TLSv1``" msgstr "``ssl.PROTOCOL_TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:108 +#: ../../deprecations/pending-removal-in-future.rst:107 msgid "``ssl.PROTOCOL_TLSv1_1``" msgstr "``ssl.PROTOCOL_TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:109 +#: ../../deprecations/pending-removal-in-future.rst:108 msgid "``ssl.PROTOCOL_TLSv1_2``" msgstr "``ssl.PROTOCOL_TLSv1_2``" -#: ../../deprecations/pending-removal-in-future.rst:110 +#: ../../deprecations/pending-removal-in-future.rst:109 msgid "``ssl.TLSVersion.SSLv3``" msgstr "``ssl.TLSVersion.SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:111 +#: ../../deprecations/pending-removal-in-future.rst:110 msgid "``ssl.TLSVersion.TLSv1``" msgstr "``ssl.TLSVersion.TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:112 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "``ssl.TLSVersion.TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:113 msgid ":mod:`threading` methods:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-future.rst:116 +#: ../../deprecations/pending-removal-in-future.rst:115 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." @@ -4004,11 +4010,11 @@ msgstr "" ":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." "notify_all`。" -#: ../../deprecations/pending-removal-in-future.rst:117 +#: ../../deprecations/pending-removal-in-future.rst:116 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。" -#: ../../deprecations/pending-removal-in-future.rst:118 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." @@ -4016,7 +4022,7 @@ msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." @@ -4024,20 +4030,20 @@ msgstr "" ":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" "attr:`threading.Thread.name` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:122 +#: ../../deprecations/pending-removal-in-future.rst:121 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" ":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。" -#: ../../deprecations/pending-removal-in-future.rst:123 +#: ../../deprecations/pending-removal-in-future.rst:122 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。" -#: ../../deprecations/pending-removal-in-future.rst:125 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr ":class:`typing.Text` (:gh:`92332`)。" -#: ../../deprecations/pending-removal-in-future.rst:127 +#: ../../deprecations/pending-removal-in-future.rst:126 msgid "" "The internal class ``typing._UnionGenericAlias`` is no longer used to " "implement :class:`typing.Union`. To preserve compatibility with users using " @@ -4048,7 +4054,7 @@ msgstr "" "了保持與此私有類別使用者的相容性,直到至少 Python 3.17 都將提供一個相容性 " "shim。(由 Jelle Zijlstra 於 :gh:`105499` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." @@ -4056,64 +4062,64 @@ msgstr "" ":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已" "被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" ":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``splitattr()``" msgstr "``splitattr()``" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:137 msgid "``splithost()``" msgstr "``splithost()``" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "``splitnport()``" msgstr "``splitnport()``" -#: ../../deprecations/pending-removal-in-future.rst:140 +#: ../../deprecations/pending-removal-in-future.rst:139 msgid "``splitpasswd()``" msgstr "``splitpasswd()``" -#: ../../deprecations/pending-removal-in-future.rst:141 +#: ../../deprecations/pending-removal-in-future.rst:140 msgid "``splitport()``" msgstr "``splitport()``" -#: ../../deprecations/pending-removal-in-future.rst:142 +#: ../../deprecations/pending-removal-in-future.rst:141 msgid "``splitquery()``" msgstr "``splitquery()``" -#: ../../deprecations/pending-removal-in-future.rst:143 +#: ../../deprecations/pending-removal-in-future.rst:142 msgid "``splittag()``" msgstr "``splittag()``" -#: ../../deprecations/pending-removal-in-future.rst:144 +#: ../../deprecations/pending-removal-in-future.rst:143 msgid "``splittype()``" msgstr "``splittype()``" -#: ../../deprecations/pending-removal-in-future.rst:145 +#: ../../deprecations/pending-removal-in-future.rst:144 msgid "``splituser()``" msgstr "``splituser()``" -#: ../../deprecations/pending-removal-in-future.rst:146 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "``splitvalue()``" msgstr "``splitvalue()``" -#: ../../deprecations/pending-removal-in-future.rst:147 +#: ../../deprecations/pending-removal-in-future.rst:146 msgid "``to_bytes()``" msgstr "``to_bytes()``" -#: ../../deprecations/pending-removal-in-future.rst:149 +#: ../../deprecations/pending-removal-in-future.rst:148 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。" -#: ../../deprecations/pending-removal-in-future.rst:152 +#: ../../deprecations/pending-removal-in-future.rst:151 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -4124,7 +4130,7 @@ msgstr "" "Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " "``len(elem)`` 或 ``elem is not None`` 測試。" -#: ../../deprecations/pending-removal-in-future.rst:157 +#: ../../deprecations/pending-removal-in-future.rst:156 msgid "" ":func:`sys._clear_type_cache` is deprecated: use :func:`sys." "_clear_internal_caches` instead." @@ -4132,11 +4138,11 @@ msgstr "" ":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." "_clear_internal_caches`。" -#: ../../whatsnew/3.13.rst:2033 +#: ../../whatsnew/3.13.rst:2031 msgid "CPython Bytecode Changes" msgstr "CPython 位元組碼變更" -#: ../../whatsnew/3.13.rst:2035 +#: ../../whatsnew/3.13.rst:2033 msgid "" "The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the yield is part of a " "yield-from or await, and ``0`` otherwise. The oparg of :opcode:`RESUME` was " @@ -4145,97 +4151,97 @@ msgid "" "`111354`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2043 +#: ../../whatsnew/3.13.rst:2041 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.13.rst:2048 +#: ../../whatsnew/3.13.rst:2046 msgid "" "Add the :ref:`PyMonitoring C API ` for generating :pep:" "`669` monitoring events:" msgstr "" -#: ../../whatsnew/3.13.rst:2051 +#: ../../whatsnew/3.13.rst:2049 msgid ":c:type:`PyMonitoringState`" msgstr ":c:type:`PyMonitoringState`" -#: ../../whatsnew/3.13.rst:2052 +#: ../../whatsnew/3.13.rst:2050 msgid ":c:func:`PyMonitoring_FirePyStartEvent`" msgstr ":c:func:`PyMonitoring_FirePyStartEvent`" -#: ../../whatsnew/3.13.rst:2053 +#: ../../whatsnew/3.13.rst:2051 msgid ":c:func:`PyMonitoring_FirePyResumeEvent`" msgstr ":c:func:`PyMonitoring_FirePyResumeEvent`" -#: ../../whatsnew/3.13.rst:2054 +#: ../../whatsnew/3.13.rst:2052 msgid ":c:func:`PyMonitoring_FirePyReturnEvent`" msgstr ":c:func:`PyMonitoring_FirePyReturnEvent`" -#: ../../whatsnew/3.13.rst:2055 +#: ../../whatsnew/3.13.rst:2053 msgid ":c:func:`PyMonitoring_FirePyYieldEvent`" msgstr ":c:func:`PyMonitoring_FirePyYieldEvent`" -#: ../../whatsnew/3.13.rst:2056 +#: ../../whatsnew/3.13.rst:2054 msgid ":c:func:`PyMonitoring_FireCallEvent`" msgstr ":c:func:`PyMonitoring_FireCallEvent`" -#: ../../whatsnew/3.13.rst:2057 +#: ../../whatsnew/3.13.rst:2055 msgid ":c:func:`PyMonitoring_FireLineEvent`" msgstr ":c:func:`PyMonitoring_FireLineEvent`" -#: ../../whatsnew/3.13.rst:2058 +#: ../../whatsnew/3.13.rst:2056 msgid ":c:func:`PyMonitoring_FireJumpEvent`" msgstr ":c:func:`PyMonitoring_FireJumpEvent`" -#: ../../whatsnew/3.13.rst:2059 +#: ../../whatsnew/3.13.rst:2057 msgid "``PyMonitoring_FireBranchEvent``" msgstr "``PyMonitoring_FireBranchEvent``" -#: ../../whatsnew/3.13.rst:2060 +#: ../../whatsnew/3.13.rst:2058 msgid ":c:func:`PyMonitoring_FireCReturnEvent`" msgstr ":c:func:`PyMonitoring_FireCReturnEvent`" -#: ../../whatsnew/3.13.rst:2061 +#: ../../whatsnew/3.13.rst:2059 msgid ":c:func:`PyMonitoring_FirePyThrowEvent`" msgstr ":c:func:`PyMonitoring_FirePyThrowEvent`" -#: ../../whatsnew/3.13.rst:2062 +#: ../../whatsnew/3.13.rst:2060 msgid ":c:func:`PyMonitoring_FireRaiseEvent`" msgstr ":c:func:`PyMonitoring_FireRaiseEvent`" -#: ../../whatsnew/3.13.rst:2063 +#: ../../whatsnew/3.13.rst:2061 msgid ":c:func:`PyMonitoring_FireCRaiseEvent`" msgstr ":c:func:`PyMonitoring_FireCRaiseEvent`" -#: ../../whatsnew/3.13.rst:2064 +#: ../../whatsnew/3.13.rst:2062 msgid ":c:func:`PyMonitoring_FireReraiseEvent`" msgstr ":c:func:`PyMonitoring_FireReraiseEvent`" -#: ../../whatsnew/3.13.rst:2065 +#: ../../whatsnew/3.13.rst:2063 msgid ":c:func:`PyMonitoring_FireExceptionHandledEvent`" msgstr ":c:func:`PyMonitoring_FireExceptionHandledEvent`" -#: ../../whatsnew/3.13.rst:2066 +#: ../../whatsnew/3.13.rst:2064 msgid ":c:func:`PyMonitoring_FirePyUnwindEvent`" msgstr ":c:func:`PyMonitoring_FirePyUnwindEvent`" -#: ../../whatsnew/3.13.rst:2067 +#: ../../whatsnew/3.13.rst:2065 msgid ":c:func:`PyMonitoring_FireStopIterationEvent`" msgstr ":c:func:`PyMonitoring_FireStopIterationEvent`" -#: ../../whatsnew/3.13.rst:2068 +#: ../../whatsnew/3.13.rst:2066 msgid ":c:func:`PyMonitoring_EnterScope`" msgstr ":c:func:`PyMonitoring_EnterScope`" -#: ../../whatsnew/3.13.rst:2069 +#: ../../whatsnew/3.13.rst:2067 msgid ":c:func:`PyMonitoring_ExitScope`" msgstr ":c:func:`PyMonitoring_ExitScope`" -#: ../../whatsnew/3.13.rst:2071 +#: ../../whatsnew/3.13.rst:2069 msgid "(Contributed by Irit Katriel in :gh:`111997`)." msgstr "(由 Irit Katriel 在 :gh:`111997` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2073 +#: ../../whatsnew/3.13.rst:2071 msgid "" "Add :c:type:`PyMutex`, a lightweight mutex that occupies a single byte, and " "the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` functions. :c:" @@ -4243,52 +4249,52 @@ msgid "" "operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2079 +#: ../../whatsnew/3.13.rst:2077 msgid "" "Add the :ref:`PyTime C API ` to provide access to system clocks:" msgstr "" -#: ../../whatsnew/3.13.rst:2081 +#: ../../whatsnew/3.13.rst:2079 msgid ":c:type:`PyTime_t`." msgstr ":c:type:`PyTime_t`。" -#: ../../whatsnew/3.13.rst:2082 +#: ../../whatsnew/3.13.rst:2080 msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX`." msgstr "" -#: ../../whatsnew/3.13.rst:2083 +#: ../../whatsnew/3.13.rst:2081 msgid ":c:func:`PyTime_AsSecondsDouble`." msgstr ":c:func:`PyTime_AsSecondsDouble`。" -#: ../../whatsnew/3.13.rst:2084 +#: ../../whatsnew/3.13.rst:2082 msgid ":c:func:`PyTime_Monotonic`." msgstr ":c:func:`PyTime_Monotonic`。" -#: ../../whatsnew/3.13.rst:2085 +#: ../../whatsnew/3.13.rst:2083 msgid ":c:func:`PyTime_MonotonicRaw`." msgstr ":c:func:`PyTime_MonotonicRaw`。" -#: ../../whatsnew/3.13.rst:2086 +#: ../../whatsnew/3.13.rst:2084 msgid ":c:func:`PyTime_PerfCounter`." msgstr ":c:func:`PyTime_PerfCounter`。" -#: ../../whatsnew/3.13.rst:2087 +#: ../../whatsnew/3.13.rst:2085 msgid ":c:func:`PyTime_PerfCounterRaw`." msgstr ":c:func:`PyTime_PerfCounterRaw`。" -#: ../../whatsnew/3.13.rst:2088 +#: ../../whatsnew/3.13.rst:2086 msgid ":c:func:`PyTime_Time`." msgstr ":c:func:`PyTime_Time`。" -#: ../../whatsnew/3.13.rst:2089 +#: ../../whatsnew/3.13.rst:2087 msgid ":c:func:`PyTime_TimeRaw`." msgstr ":c:func:`PyTime_TimeRaw`。" -#: ../../whatsnew/3.13.rst:2091 +#: ../../whatsnew/3.13.rst:2089 msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" msgstr "(由 Victor Stinner 和 Petr Viktorin 在 :gh:`110850` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2093 +#: ../../whatsnew/3.13.rst:2091 msgid "" "Add the :c:func:`PyDict_ContainsString` function with the same behavior as :" "c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` " @@ -4296,7 +4302,7 @@ msgid "" "by Victor Stinner in :gh:`108314`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2099 +#: ../../whatsnew/3.13.rst:2097 msgid "" "Add the :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " "functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " @@ -4306,7 +4312,7 @@ msgid "" "`106004`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2107 +#: ../../whatsnew/3.13.rst:2105 msgid "" "Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" "c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " @@ -4315,7 +4321,7 @@ msgid "" "dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2115 +#: ../../whatsnew/3.13.rst:2113 msgid "" "Add the :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions to " "remove a key from a dictionary and optionally return the removed value. This " @@ -4324,7 +4330,7 @@ msgid "" "Victor Stinner in :gh:`111262`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2122 +#: ../../whatsnew/3.13.rst:2120 msgid "" "Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" "`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" @@ -4335,7 +4341,7 @@ msgid "" "gh:`106307`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2132 +#: ../../whatsnew/3.13.rst:2130 msgid "" "Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" "`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" @@ -4346,37 +4352,37 @@ msgid "" "Serhiy Storchaka in :gh:`106521`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2142 +#: ../../whatsnew/3.13.rst:2140 msgid "" "Add the :c:func:`PyErr_FormatUnraisable` function as an extension to :c:func:" "`PyErr_WriteUnraisable` that allows customizing the warning message. " "(Contributed by Serhiy Storchaka in :gh:`108082`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2147 +#: ../../whatsnew/3.13.rst:2145 msgid "" "Add new functions that return a :term:`strong reference` instead of a :term:" "`borrowed reference` for frame locals, globals, and builtins, as part of :" "ref:`PEP 667 `:" msgstr "" -#: ../../whatsnew/3.13.rst:2151 +#: ../../whatsnew/3.13.rst:2149 msgid ":c:func:`PyEval_GetFrameBuiltins` replaces :c:func:`PyEval_GetBuiltins`" msgstr ":c:func:`PyEval_GetFrameBuiltins` 取代 :c:func:`PyEval_GetBuiltins`" -#: ../../whatsnew/3.13.rst:2152 +#: ../../whatsnew/3.13.rst:2150 msgid ":c:func:`PyEval_GetFrameGlobals` replaces :c:func:`PyEval_GetGlobals`" msgstr ":c:func:`PyEval_GetFrameGlobals` 取代 :c:func:`PyEval_GetGlobals`" -#: ../../whatsnew/3.13.rst:2153 +#: ../../whatsnew/3.13.rst:2151 msgid ":c:func:`PyEval_GetFrameLocals` replaces :c:func:`PyEval_GetLocals`" msgstr ":c:func:`PyEval_GetFrameLocals` 取代 :c:func:`PyEval_GetLocals`" -#: ../../whatsnew/3.13.rst:2155 +#: ../../whatsnew/3.13.rst:2153 msgid "(Contributed by Mark Shannon and Tian Gao in :gh:`74929`.)" msgstr "(由 Mark Shannon 和 Tian Gao 在 :gh:`74929` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2157 +#: ../../whatsnew/3.13.rst:2155 msgid "" "Add the :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` " "functions to get :term:`strong ` or :term:`borrowed " @@ -4385,7 +4391,7 @@ msgid "" "constant zero. (Contributed by Victor Stinner in :gh:`115754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2164 +#: ../../whatsnew/3.13.rst:2162 msgid "" "Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" "func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " @@ -4393,35 +4399,35 @@ msgid "" "`105922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2169 +#: ../../whatsnew/3.13.rst:2167 msgid "" "Add the :c:func:`Py_IsFinalizing` function to check whether the main Python " "interpreter is :term:`shutting down `. (Contributed by " "Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2174 +#: ../../whatsnew/3.13.rst:2172 msgid "" "Add the :c:func:`PyList_GetItemRef` function as a replacement for :c:func:" "`PyList_GetItem` that returns a :term:`strong reference` instead of a :term:" "`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2179 +#: ../../whatsnew/3.13.rst:2177 msgid "" "Add the :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions, " "mirroring the Python :meth:`list.extend` and :meth:`list.clear` methods. " "(Contributed by Victor Stinner in :gh:`111138`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2183 +#: ../../whatsnew/3.13.rst:2181 msgid "" "Add the :c:func:`PyLong_AsInt` function. It behaves similarly to :c:func:" "`PyLong_AsLong`, but stores the result in a C :c:expr:`int` instead of a C :" "c:expr:`long`. (Contributed by Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2188 +#: ../../whatsnew/3.13.rst:2186 msgid "" "Add the :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes`, " "and :c:func:`PyLong_FromUnsignedNativeBytes` functions to simplify " @@ -4429,27 +4435,27 @@ msgid "" "(Contributed by Steve Dower in :gh:`111140`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2194 +#: ../../whatsnew/3.13.rst:2192 msgid "" "Add :c:func:`PyModule_Add` function, which is similar to :c:func:" "`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but always steals " "a reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2199 +#: ../../whatsnew/3.13.rst:2197 msgid "" "Add the :c:func:`PyObject_GenericHash` function that implements the default " "hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" "`113024`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2203 +#: ../../whatsnew/3.13.rst:2201 msgid "" "Add the :c:func:`Py_HashPointer` function to hash a raw pointer. " "(Contributed by Victor Stinner in :gh:`111545`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2206 +#: ../../whatsnew/3.13.rst:2204 msgid "" "Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" "`PyObject_ClearManagedDict` functions. which must be called by the traverse " @@ -4458,7 +4464,7 @@ msgid "" "with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2214 +#: ../../whatsnew/3.13.rst:2212 msgid "" "Add the :c:func:`PyRefTracer_SetTracer` and :c:func:`PyRefTracer_GetTracer` " "functions, which enable tracking object creation and destruction in the same " @@ -4466,14 +4472,14 @@ msgid "" "in :gh:`93502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2220 +#: ../../whatsnew/3.13.rst:2218 msgid "" "Add the :c:func:`PySys_AuditTuple` function as an alternative to :c:func:" "`PySys_Audit` that takes event arguments as a Python :class:`tuple` object. " "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2225 +#: ../../whatsnew/3.13.rst:2223 msgid "" "Add the :c:func:`PyThreadState_GetUnchecked()` function as an alternative " "to :c:func:`PyThreadState_Get()` that doesn't kill the process with a fatal " @@ -4481,7 +4487,7 @@ msgid "" "result is ``NULL``. (Contributed by Victor Stinner in :gh:`108867`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2231 +#: ../../whatsnew/3.13.rst:2229 msgid "" "Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " "fully qualified name. The module name is prepended if :attr:`type." @@ -4489,14 +4495,14 @@ msgid "" "``'__main__'``. (Contributed by Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2237 +#: ../../whatsnew/3.13.rst:2235 msgid "" "Add the :c:func:`PyType_GetModuleName` function to get the type's module " "name. This is equivalent to getting the :attr:`type.__module__` attribute. " "(Contributed by Eric Snow and Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2242 +#: ../../whatsnew/3.13.rst:2240 msgid "" "Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" "`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" @@ -4505,7 +4511,7 @@ msgid "" "Storchaka in :gh:`110289`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2249 +#: ../../whatsnew/3.13.rst:2247 msgid "" "Add the :c:func:`PyWeakref_GetRef` function as an alternative to :c:func:" "`PyWeakref_GetObject` that returns a :term:`strong reference` or ``NULL`` if " @@ -4513,16 +4519,16 @@ msgid "" "`105927`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2255 +#: ../../whatsnew/3.13.rst:2253 msgid "Add fixed variants of functions which silently ignore errors:" msgstr "" -#: ../../whatsnew/3.13.rst:2257 +#: ../../whatsnew/3.13.rst:2255 msgid "" ":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." msgstr ":c:func:`PyObject_HasAttrWithError` 取代 :c:func:`PyObject_HasAttr`。" -#: ../../whatsnew/3.13.rst:2258 +#: ../../whatsnew/3.13.rst:2256 msgid "" ":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" "`PyObject_HasAttrString`." @@ -4530,12 +4536,12 @@ msgstr "" ":c:func:`PyObject_HasAttrStringWithError` 取代 :c:func:" "`PyObject_HasAttrString`。" -#: ../../whatsnew/3.13.rst:2260 +#: ../../whatsnew/3.13.rst:2258 msgid "" ":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." msgstr ":c:func:`PyMapping_HasKeyWithError` 取代 :c:func:`PyMapping_HasKey`。" -#: ../../whatsnew/3.13.rst:2261 +#: ../../whatsnew/3.13.rst:2259 msgid "" ":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" "`PyMapping_HasKeyString`." @@ -4543,21 +4549,21 @@ msgstr "" ":c:func:`PyMapping_HasKeyStringWithError` 取代 :c:func:" "`PyMapping_HasKeyString`。" -#: ../../whatsnew/3.13.rst:2264 +#: ../../whatsnew/3.13.rst:2262 msgid "" "The new functions return ``-1`` for errors and the standard ``1`` for true " "and ``0`` for false." msgstr "" -#: ../../whatsnew/3.13.rst:2267 +#: ../../whatsnew/3.13.rst:2265 msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" msgstr "(由 Serhiy Storchaka 在 :gh:`108511` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2271 +#: ../../whatsnew/3.13.rst:2269 msgid "Changed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2273 +#: ../../whatsnew/3.13.rst:2271 msgid "" "The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" "func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " @@ -4570,20 +4576,20 @@ msgid "" "`65210`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2285 +#: ../../whatsnew/3.13.rst:2283 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " "parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2289 +#: ../../whatsnew/3.13.rst:2287 msgid "" "The :c:func:`!PyCode_GetFirstFree` function is now unstable API and is now " "named :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan " "Romanyuk in :gh:`115781`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2293 +#: ../../whatsnew/3.13.rst:2291 msgid "" "The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" "`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" @@ -4594,35 +4600,35 @@ msgid "" "documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2302 +#: ../../whatsnew/3.13.rst:2300 msgid "" "Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" "`PyUnicode_FromFormat`:" msgstr "" -#: ../../whatsnew/3.13.rst:2305 +#: ../../whatsnew/3.13.rst:2303 msgid "``%T``: Get the fully qualified name of an object type" msgstr "" -#: ../../whatsnew/3.13.rst:2306 +#: ../../whatsnew/3.13.rst:2304 msgid "``%#T``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2307 +#: ../../whatsnew/3.13.rst:2305 msgid "``%N``: Get the fully qualified name of a type" msgstr "" -#: ../../whatsnew/3.13.rst:2308 +#: ../../whatsnew/3.13.rst:2306 msgid "``%#N``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2310 +#: ../../whatsnew/3.13.rst:2308 msgid "" "See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" "`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2313 +#: ../../whatsnew/3.13.rst:2311 msgid "" "You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " "including :file:`Python.h` when using ``#`` formats in :ref:`format codes " @@ -4631,7 +4637,7 @@ msgid "" "`104922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2319 +#: ../../whatsnew/3.13.rst:2317 msgid "" "If Python is built in :ref:`debug mode ` or :option:`with " "assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" @@ -4639,61 +4645,61 @@ msgid "" "(Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2327 +#: ../../whatsnew/3.13.rst:2325 msgid "Limited C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2329 +#: ../../whatsnew/3.13.rst:2327 msgid "The following functions are now included in the Limited C API:" msgstr "" -#: ../../whatsnew/3.13.rst:2331 +#: ../../whatsnew/3.13.rst:2329 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../whatsnew/3.13.rst:2332 +#: ../../whatsnew/3.13.rst:2330 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../whatsnew/3.13.rst:2333 +#: ../../whatsnew/3.13.rst:2331 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../whatsnew/3.13.rst:2334 +#: ../../whatsnew/3.13.rst:2332 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../whatsnew/3.13.rst:2335 +#: ../../whatsnew/3.13.rst:2333 msgid ":c:func:`PySys_Audit`" msgstr ":c:func:`PySys_Audit`" -#: ../../whatsnew/3.13.rst:2336 +#: ../../whatsnew/3.13.rst:2334 msgid ":c:func:`PySys_AuditTuple`" msgstr ":c:func:`PySys_AuditTuple`" -#: ../../whatsnew/3.13.rst:2337 +#: ../../whatsnew/3.13.rst:2335 msgid ":c:func:`PyType_GetModuleByDef`" msgstr ":c:func:`PyType_GetModuleByDef`" -#: ../../whatsnew/3.13.rst:2339 +#: ../../whatsnew/3.13.rst:2337 msgid "" "(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, and :gh:" "`116936`.)" msgstr "" "(由 Victor Stinner 貢獻於 :gh:`85283`、:gh:`85283` 和 :gh:`116936`。)" -#: ../../whatsnew/3.13.rst:2341 +#: ../../whatsnew/3.13.rst:2339 msgid "" "Python built with :option:`--with-trace-refs` (tracing references) now " "supports the :ref:`Limited API `. (Contributed by Victor " "Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2347 +#: ../../whatsnew/3.13.rst:2345 msgid "Removed C APIs" msgstr "移除的 C API" -#: ../../whatsnew/3.13.rst:2349 +#: ../../whatsnew/3.13.rst:2347 msgid "" "Remove several functions, macros, variables, etc with names prefixed by " "``_Py`` or ``_PY`` (which are considered private). If your project is " @@ -4703,13 +4709,13 @@ msgid "" "Victor Stinner. (Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2357 +#: ../../whatsnew/3.13.rst:2355 msgid "" "Remove old buffer protocols deprecated in Python 3.0. Use :ref:" "`bufferobjects` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2360 +#: ../../whatsnew/3.13.rst:2358 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " "test whether the object supports the buffer protocol. Note that :c:func:" @@ -4718,7 +4724,7 @@ msgid "" "example of :c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../whatsnew/3.13.rst:2368 +#: ../../whatsnew/3.13.rst:2366 msgid "" ":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" "func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" @@ -4726,7 +4732,7 @@ msgstr "" ":c:func:`!PyObject_AsCharBuffer`、:c:func:`!PyObject_AsReadBuffer`:請改用 :" "c:func:`PyObject_GetBuffer` 和 :c:func:`PyBuffer_Release`。" -#: ../../whatsnew/3.13.rst:2371 +#: ../../whatsnew/3.13.rst:2369 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) < 0) {\n" @@ -4737,7 +4743,7 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2381 +#: ../../whatsnew/3.13.rst:2379 msgid "" ":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" "func:`PyBuffer_Release` instead:" @@ -4745,7 +4751,7 @@ msgstr "" ":c:func:`!PyObject_AsWriteBuffer`:請改用 :c:func:`PyObject_GetBuffer` 和 :c:" "func:`PyBuffer_Release`。" -#: ../../whatsnew/3.13.rst:2384 +#: ../../whatsnew/3.13.rst:2382 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_WRITABLE) < 0) {\n" @@ -4755,15 +4761,15 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2393 +#: ../../whatsnew/3.13.rst:2391 msgid "(Contributed by Inada Naoki in :gh:`85275`.)" msgstr "(由 Inada Naoki 貢獻於 :gh:`85275`。)" -#: ../../whatsnew/3.13.rst:2395 +#: ../../whatsnew/3.13.rst:2393 msgid "Remove various functions deprecated in Python 3.9:" msgstr "" -#: ../../whatsnew/3.13.rst:2397 +#: ../../whatsnew/3.13.rst:2395 msgid "" ":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" "c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." @@ -4771,7 +4777,7 @@ msgstr "" ":c:func:`!PyEval_CallObject`、:c:func:`!PyEval_CallObjectWithKeywords`:請改" "用 :c:func:`PyObject_CallNoArgs` 或 :c:func:`PyObject_Call`。" -#: ../../whatsnew/3.13.rst:2402 +#: ../../whatsnew/3.13.rst:2400 msgid "" "In :c:func:`PyObject_Call`, positional arguments must be a :class:`tuple` " "and must not be ``NULL``, and keyword arguments must be a :class:`dict` or " @@ -4782,33 +4788,33 @@ msgid "" "`PyTuple_New(0) `." msgstr "" -#: ../../whatsnew/3.13.rst:2412 +#: ../../whatsnew/3.13.rst:2410 msgid "" ":c:func:`!PyEval_CallFunction`: Use :c:func:`PyObject_CallFunction` instead." msgstr "" ":c:func:`!PyEval_CallFunction`:請改用 :c:func:`PyObject_CallFunction`。" -#: ../../whatsnew/3.13.rst:2414 +#: ../../whatsnew/3.13.rst:2412 msgid "" ":c:func:`!PyEval_CallMethod`: Use :c:func:`PyObject_CallMethod` instead." msgstr ":c:func:`!PyEval_CallMethod`:請改用 :c:func:`PyObject_CallMethod`。" -#: ../../whatsnew/3.13.rst:2416 +#: ../../whatsnew/3.13.rst:2414 msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." msgstr ":c:func:`!PyCFunction_Call`:請改用 :c:func:`PyCFunction_Call`。" -#: ../../whatsnew/3.13.rst:2419 +#: ../../whatsnew/3.13.rst:2417 msgid "(Contributed by Victor Stinner in :gh:`105107`.)" msgstr "(由 Victor Stinner 貢獻於 :gh:`105107`。)" -#: ../../whatsnew/3.13.rst:2421 +#: ../../whatsnew/3.13.rst:2419 msgid "" "Remove the following old functions to configure the Python initialization, " "deprecated in Python 3.11:" msgstr "" "移除以下設定 Python 初始化的舊函式,這些函式在 Python 3.11 中已被棄用:" -#: ../../whatsnew/3.13.rst:2424 +#: ../../whatsnew/3.13.rst:2422 msgid "" ":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." @@ -4816,36 +4822,36 @@ msgstr "" ":c:func:`!PySys_AddWarnOptionUnicode`:請改用 :c:member:`PyConfig." "warnoptions`。" -#: ../../whatsnew/3.13.rst:2426 +#: ../../whatsnew/3.13.rst:2424 msgid "" ":c:func:`!PySys_AddWarnOption`: Use :c:member:`PyConfig.warnoptions` instead." msgstr "" ":c:func:`!PySys_AddWarnOption`:請改用 :c:member:`PyConfig.warnoptions`。" -#: ../../whatsnew/3.13.rst:2428 +#: ../../whatsnew/3.13.rst:2426 msgid ":c:func:`!PySys_AddXOption`: Use :c:member:`PyConfig.xoptions` instead." msgstr ":c:func:`!PySys_AddXOption`:請改用 :c:member:`PyConfig.xoptions`。" -#: ../../whatsnew/3.13.rst:2430 +#: ../../whatsnew/3.13.rst:2428 msgid "" ":c:func:`!PySys_HasWarnOptions`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" ":c:func:`!PySys_HasWarnOptions`:請改用 :c:member:`PyConfig.xoptions`。" -#: ../../whatsnew/3.13.rst:2432 +#: ../../whatsnew/3.13.rst:2430 msgid "" ":c:func:`!PySys_SetPath`: Set :c:member:`PyConfig.module_search_paths` " "instead." msgstr "" ":c:func:`!PySys_SetPath`:請改用 :c:member:`PyConfig.module_search_paths`。" -#: ../../whatsnew/3.13.rst:2434 +#: ../../whatsnew/3.13.rst:2432 msgid "" ":c:func:`!Py_SetPath`: Set :c:member:`PyConfig.module_search_paths` instead." msgstr "" ":c:func:`!Py_SetPath`:請改用 :c:member:`PyConfig.module_search_paths`。" -#: ../../whatsnew/3.13.rst:2436 +#: ../../whatsnew/3.13.rst:2434 msgid "" ":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." "stdio_encoding` instead, and set also maybe :c:member:`PyConfig." @@ -4855,14 +4861,14 @@ msgstr "" "stdio_encoding` 並設定可能的 :c:member:`PyConfig.legacy_windows_stdio`\\ " "(在 Windows 上)。" -#: ../../whatsnew/3.13.rst:2439 +#: ../../whatsnew/3.13.rst:2437 msgid "" ":c:func:`!_Py_SetProgramFullPath`: Set :c:member:`PyConfig.executable` " "instead." msgstr "" ":c:func:`!_Py_SetProgramFullPath`:請改用 :c:member:`PyConfig.executable`。" -#: ../../whatsnew/3.13.rst:2442 +#: ../../whatsnew/3.13.rst:2440 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`), added to Python 3.8. " @@ -4872,7 +4878,7 @@ msgstr "" "(:pep:`587`),這是在 Python 3.8 中新增的。(由 Victor Stinner 於 :gh:" "`105145` 貢獻。)" -#: ../../whatsnew/3.13.rst:2446 +#: ../../whatsnew/3.13.rst:2444 msgid "" "Remove :c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_ReleaseLock` " "functions, deprecated in Python 3.2. They didn't update the current thread " @@ -4882,25 +4888,25 @@ msgstr "" "些函式在 Python 3.2 中已被廢棄。它們不會更新目前的執行緒狀態。可以用以下函式" "取代:" -#: ../../whatsnew/3.13.rst:2451 +#: ../../whatsnew/3.13.rst:2449 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`;" msgstr ":c:func:`PyEval_SaveThread` 和 :c:func:`PyEval_RestoreThread`;" -#: ../../whatsnew/3.13.rst:2452 +#: ../../whatsnew/3.13.rst:2450 msgid "" "low-level :c:func:`PyEval_AcquireThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" "低階的 :c:func:`PyEval_AcquireThread` 和 :c:func:`PyEval_RestoreThread`;" -#: ../../whatsnew/3.13.rst:2453 +#: ../../whatsnew/3.13.rst:2451 msgid "or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`." msgstr "或 :c:func:`PyGILState_Ensure` 與 :c:func:`PyGILState_Release`。" -#: ../../whatsnew/3.13.rst:2455 +#: ../../whatsnew/3.13.rst:2453 msgid "(Contributed by Victor Stinner in :gh:`105182`.)" msgstr "(由 Victor Stinner 貢獻於 :gh:`105182`。)" -#: ../../whatsnew/3.13.rst:2457 +#: ../../whatsnew/3.13.rst:2455 msgid "" "Remove the :c:func:`!PyEval_ThreadsInitialized` function, deprecated in " "Python 3.9. Since Python 3.7, :c:func:`!Py_Initialize` always creates the " @@ -4913,7 +4919,7 @@ msgstr "" "PyEval_InitThreads` 不會有任何作用,而 :c:func:`!PyEval_ThreadsInitialized` " "總是會回傳非零值。(由 Victor Stinner 於 :gh:`105182` 貢獻。)" -#: ../../whatsnew/3.13.rst:2464 +#: ../../whatsnew/3.13.rst:2462 msgid "" "Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" "`PyInterpreterState_Get()` which was kept for backward compatibility with " @@ -4927,7 +4933,7 @@ msgstr "" "得 :c:func:`PyInterpreterState_Get()`。(由 Victor Stinner 於 :gh:`106320` 貢" "獻。)" -#: ../../whatsnew/3.13.rst:2471 +#: ../../whatsnew/3.13.rst:2469 msgid "" "Remove the private :c:func:`!_PyObject_FastCall` function: use :c:func:`!" "PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " @@ -4937,7 +4943,7 @@ msgstr "" "c:func:`!PyObject_Vectorcall` 函式(:pep:`590`)。(由 Victor Stinner 於 :gh:" "`106023` 貢獻。)" -#: ../../whatsnew/3.13.rst:2476 +#: ../../whatsnew/3.13.rst:2474 msgid "" "Remove the ``cpython/pytime.h`` header file, which only contained private " "functions. (Contributed by Victor Stinner in :gh:`106316`.)" @@ -4945,13 +4951,13 @@ msgstr "" "移除只包含私有函式的 ``cpython/pytime.h`` 標頭檔。(由 Victor Stinner 於 :gh:" "`106316` 貢獻。)" -#: ../../whatsnew/3.13.rst:2480 +#: ../../whatsnew/3.13.rst:2478 msgid "" "Remove the undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API. " "(Contributed by Victor Stinner in :gh:`110014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2483 +#: ../../whatsnew/3.13.rst:2481 msgid "" "Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END``. Replace both with the new macros " @@ -4962,15 +4968,15 @@ msgstr "" "將兩者都替換為新的巨集 ``Py_TRASHCAN_BEGIN`` 和 ``Py_TRASHCAN_END``。(由 " "Irit Katriel 在 :gh:`105111` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2490 +#: ../../whatsnew/3.13.rst:2488 msgid "Deprecated C APIs" msgstr "器用的 C API" -#: ../../whatsnew/3.13.rst:2492 +#: ../../whatsnew/3.13.rst:2490 msgid "Deprecate old Python initialization functions:" msgstr "棄用舊的 Python 初始化函式:" -#: ../../whatsnew/3.13.rst:2494 +#: ../../whatsnew/3.13.rst:2492 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:62 msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" @@ -4979,27 +4985,27 @@ msgstr "" ":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" "data:`!warnings.filters`。" -#: ../../whatsnew/3.13.rst:2496 +#: ../../whatsnew/3.13.rst:2494 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr ":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.exec_prefix`。" -#: ../../whatsnew/3.13.rst:2498 +#: ../../whatsnew/3.13.rst:2496 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" -#: ../../whatsnew/3.13.rst:2500 +#: ../../whatsnew/3.13.rst:2498 msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr ":c:func:`Py_GetPrefix`:請改用 :data:`sys.prefix`。" -#: ../../whatsnew/3.13.rst:2502 +#: ../../whatsnew/3.13.rst:2500 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramFullPath`:請改用 :data:`sys.executable`。" -#: ../../whatsnew/3.13.rst:2504 +#: ../../whatsnew/3.13.rst:2502 msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。" -#: ../../whatsnew/3.13.rst:2506 +#: ../../whatsnew/3.13.rst:2504 msgid "" ":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable instead." @@ -5007,11 +5013,11 @@ msgstr "" ":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:" "`PYTHONHOME` 環境變數。" -#: ../../whatsnew/3.13.rst:2510 +#: ../../whatsnew/3.13.rst:2508 msgid "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "(由 Victor Stinner 在 :gh:`105145` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2512 +#: ../../whatsnew/3.13.rst:2510 msgid "" ":term:`Soft deprecate ` the :c:func:`PyEval_GetBuiltins`, :" "c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " @@ -5022,7 +5028,7 @@ msgstr "" "\\ :term:`借用參照 `。(作為 :pep:`667` 一部分的軟性棄" "用。)" -#: ../../whatsnew/3.13.rst:2518 +#: ../../whatsnew/3.13.rst:2516 msgid "" "Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function, which is just " "an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " @@ -5032,7 +5038,7 @@ msgstr "" "c:func:`PyImport_ImportModule` 的別名。(由 Victor Stinner 在 :gh:`105396` 中" "貢獻。)" -#: ../../whatsnew/3.13.rst:2522 +#: ../../whatsnew/3.13.rst:2520 msgid "" ":term:`Soft deprecate ` the :c:func:`PyModule_AddObject` " "function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" @@ -5042,7 +5048,7 @@ msgstr "" "用 :c:func:`PyModule_Add` 或 :c:func:`PyModule_AddObjectRef`。(由 Serhiy " "Storchaka 在 :gh:`86493` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2528 +#: ../../whatsnew/3.13.rst:2526 msgid "" "Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and the :c:" "macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type directly " @@ -5055,7 +5061,7 @@ msgstr "" "``Py_UNICODE`` 和 ``PY_UNICODE_TYPE`` 只是 :c:type:`!wchar_t` 的別名。(由 " "Victor Stinner 在 :gh:`105156` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2535 +#: ../../whatsnew/3.13.rst:2533 msgid "" "Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" "`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " @@ -5594,8 +5600,8 @@ msgid "" "(Contributed by Victor Stinner in :gh:`128863`.)" msgstr "" "可以使用 `pythoncapi-compat project `__ 來取得這些於 Python 3.13 及更早版本的新公開函式。(由 " -"Victor Stinner 在 :gh:`128863` 貢獻)" +"compat/>`__ 來取得這些於 Python 3.13 及更早版本的新公開函式。(由 Victor " +"Stinner 在 :gh:`128863` 貢獻)" #: ../../deprecations/c-api-pending-removal-in-future.rst:4 msgid "" @@ -5700,31 +5706,31 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.13.rst:2559 +#: ../../whatsnew/3.13.rst:2557 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.13.rst:2561 +#: ../../whatsnew/3.13.rst:2559 msgid "" "``arm64-apple-ios`` and ``arm64-apple-ios-simulator`` are both now :pep:`11` " "tier 3 platforms. (:ref:`PEP 730 ` written and " "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2566 +#: ../../whatsnew/3.13.rst:2564 msgid "" "``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" "`11` tier 3 platforms. (:ref:`PEP 738 ` " "written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2571 +#: ../../whatsnew/3.13.rst:2569 msgid "" "``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " "Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2574 +#: ../../whatsnew/3.13.rst:2572 msgid "" "``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " "(Contributed by Brett Cannon in :gh:`115192`.)" @@ -5732,26 +5738,26 @@ msgstr "" "``wasm32-emscripten`` 不再是 :pep:`11` 支援的平台。(由 Brett Cannon 在 :gh:" "`115192` 貢獻。)" -#: ../../whatsnew/3.13.rst:2577 +#: ../../whatsnew/3.13.rst:2575 msgid "" "Building CPython now requires a compiler with support for the C11 atomic " "library, GCC built-in atomic functions, or MSVC interlocked intrinsics." msgstr "" -#: ../../whatsnew/3.13.rst:2580 +#: ../../whatsnew/3.13.rst:2578 msgid "" "Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate the :file:" "`configure` script. (Contributed by Christian Heimes in :gh:`89886` and by " "Victor Stinner in :gh:`112090`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2584 +#: ../../whatsnew/3.13.rst:2582 msgid "" "SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension " "module. (Contributed by Erlend Aasland in :gh:`105875`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2588 +#: ../../whatsnew/3.13.rst:2586 msgid "" "CPython now bundles the `mimalloc library`_ by default. It is licensed under " "the MIT license; see :ref:`mimalloc license `. The bundled " @@ -5759,27 +5765,27 @@ msgid "" "Dino Viehland in :gh:`109914`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2596 +#: ../../whatsnew/3.13.rst:2594 msgid "" "The :file:`configure` option :option:`--with-system-libmpdec` now defaults " "to ``yes``. The bundled copy of ``libmpdec`` will be removed in Python 3.16." msgstr "" -#: ../../whatsnew/3.13.rst:2600 +#: ../../whatsnew/3.13.rst:2598 msgid "" "Python built with :file:`configure` :option:`--with-trace-refs` (tracing " "references) is now ABI compatible with the Python release build and :ref:" "`debug build `. (Contributed by Victor Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2605 +#: ../../whatsnew/3.13.rst:2603 msgid "" "On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI " "flags. For example, the free-threaded build generates ``python-3.13t.pc`` " "and the debug build generates ``python-3.13d.pc``." msgstr "" -#: ../../whatsnew/3.13.rst:2609 +#: ../../whatsnew/3.13.rst:2607 msgid "" "The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " "``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." @@ -5789,27 +5795,27 @@ msgid "" "`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2618 +#: ../../whatsnew/3.13.rst:2616 msgid "Porting to Python 3.13" msgstr "移植至 Python 3.13" -#: ../../whatsnew/3.13.rst:2620 +#: ../../whatsnew/3.13.rst:2618 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.13.rst:2624 +#: ../../whatsnew/3.13.rst:2622 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.13.rst:2628 +#: ../../whatsnew/3.13.rst:2626 msgid "" ":ref:`PEP 667 ` introduces several changes to " "the semantics of :func:`locals` and :attr:`f_locals `:" msgstr "" -#: ../../whatsnew/3.13.rst:2631 +#: ../../whatsnew/3.13.rst:2629 msgid "" "Calling :func:`locals` in an :term:`optimized scope` now produces an " "independent snapshot on each call, and hence no longer implicitly updates " @@ -5821,7 +5827,7 @@ msgid "" "scope. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2640 +#: ../../whatsnew/3.13.rst:2638 msgid "" "Calling :func:`locals` from a comprehension at module or class scope " "(including via ``exec`` or ``eval``) once more behaves as if the " @@ -5831,7 +5837,7 @@ msgid "" "implementing :pep:`709`. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2647 +#: ../../whatsnew/3.13.rst:2645 msgid "" "Accessing :attr:`FrameType.f_locals ` in an :term:`optimized " "scope` now returns a write-through proxy rather than a snapshot that gets " @@ -5840,7 +5846,7 @@ msgid "" "of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2653 +#: ../../whatsnew/3.13.rst:2651 msgid "" ":class:`functools.partial` now emits a :exc:`FutureWarning` when used as a " "method. The behavior will change in future Python versions. Wrap it in :func:" @@ -5848,14 +5854,14 @@ msgid "" "Serhiy Storchaka in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2659 +#: ../../whatsnew/3.13.rst:2657 msgid "" "An :exc:`OSError` is now raised by :func:`getpass.getuser` for any failure " "to retrieve a username, instead of :exc:`ImportError` on non-Unix platforms " "or :exc:`KeyError` on Unix platforms where the password database is empty." msgstr "" -#: ../../whatsnew/3.13.rst:2664 +#: ../../whatsnew/3.13.rst:2662 msgid "" "The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` is now a " "string (``'rb'`` or ``'wb'``) instead of an integer (``1`` or ``2``). The " @@ -5864,7 +5870,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2670 +#: ../../whatsnew/3.13.rst:2668 msgid "" ":class:`mailbox.Maildir` now ignores files with a leading dot (``.``). " "(Contributed by Zackery Spytz in :gh:`65559`.)" @@ -5872,7 +5878,7 @@ msgstr "" ":class:`mailbox.Maildir` 現在會忽略以點號 (``.``) 開頭的檔案。 (由 Zackery " "Spytz 在 :gh:`65559` 貢獻。)" -#: ../../whatsnew/3.13.rst:2673 +#: ../../whatsnew/3.13.rst:2671 msgid "" ":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " "files and directories if a pattern that ends with \"``**``\" is given, " @@ -5880,25 +5886,25 @@ msgid "" "behavior and only match directories." msgstr "" -#: ../../whatsnew/3.13.rst:2678 +#: ../../whatsnew/3.13.rst:2676 msgid "" "The :mod:`threading` module now expects the :mod:`!_thread` module to have " "an :func:`!_is_main_interpreter` function. This function takes no arguments " "and returns ``True`` if the current interpreter is the main interpreter." msgstr "" -#: ../../whatsnew/3.13.rst:2683 +#: ../../whatsnew/3.13.rst:2681 msgid "" "Any library or application that provides a custom :mod:`!_thread` module " "must provide :func:`!_is_main_interpreter`, just like the module's other " "\"private\" attributes. (:gh:`112826`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2690 +#: ../../whatsnew/3.13.rst:2688 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.13.rst:2692 +#: ../../whatsnew/3.13.rst:2690 msgid "" "``Python.h`` no longer includes the ```` standard header. It was " "included for the :c:func:`!finite` function which is now provided by the " @@ -5907,7 +5913,7 @@ msgid "" "`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2698 +#: ../../whatsnew/3.13.rst:2696 msgid "" "``Python.h`` no longer includes these standard header files: ````, " "```` and ````. If needed, they should now be " @@ -5918,7 +5924,7 @@ msgid "" "Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2706 +#: ../../whatsnew/3.13.rst:2704 msgid "" "On Windows, ``Python.h`` no longer includes the ```` standard " "header file. If needed, it should now be included explicitly. For example, " @@ -5928,7 +5934,7 @@ msgid "" "(Contributed by Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2713 +#: ../../whatsnew/3.13.rst:2711 msgid "" "If the :c:macro:`Py_LIMITED_API` macro is defined, :c:macro:`!" "Py_BUILD_CORE`, :c:macro:`!Py_BUILD_CORE_BUILTIN` and :c:macro:`!" @@ -5936,18 +5942,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2718 +#: ../../whatsnew/3.13.rst:2716 msgid "" "The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END`` were removed. They should be replaced by the new " "macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.13.rst:2722 +#: ../../whatsnew/3.13.rst:2720 msgid "A ``tp_dealloc`` function that has the old macros, such as::" msgstr "有舊巨集的 ``tp_dealloc`` 函式,例如: ::" -#: ../../whatsnew/3.13.rst:2724 +#: ../../whatsnew/3.13.rst:2722 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5967,11 +5973,11 @@ msgstr "" " Py_TRASHCAN_SAFE_END\n" "}" -#: ../../whatsnew/3.13.rst:2733 +#: ../../whatsnew/3.13.rst:2731 msgid "should migrate to the new macros as follows::" msgstr "應該改為使用新的巨集,如下所示: ::" -#: ../../whatsnew/3.13.rst:2735 +#: ../../whatsnew/3.13.rst:2733 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5991,7 +5997,7 @@ msgstr "" " Py_TRASHCAN_END\n" "}" -#: ../../whatsnew/3.13.rst:2744 +#: ../../whatsnew/3.13.rst:2742 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in. The new macros were added in Python 3.8 and " @@ -5999,13 +6005,13 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2751 +#: ../../whatsnew/3.13.rst:2749 msgid "" ":ref:`PEP 667 ` introduces several changes to " "frame-related functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2754 +#: ../../whatsnew/3.13.rst:2752 msgid "" "The effects of mutating the dictionary returned from :c:func:" "`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " @@ -6019,7 +6025,7 @@ msgid "" "being used, so refer to the deprecation notice on the function for details." msgstr "" -#: ../../whatsnew/3.13.rst:2767 +#: ../../whatsnew/3.13.rst:2765 msgid "" "Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " "returns a write-through proxy rather than a snapshot that gets updated at " @@ -6028,40 +6034,40 @@ msgid "" "`PyEval_GetFrameLocals` API." msgstr "" -#: ../../whatsnew/3.13.rst:2774 +#: ../../whatsnew/3.13.rst:2772 msgid "" ":c:func:`!PyFrame_FastToLocals` and :c:func:`!PyFrame_FastToLocalsWithError` " "no longer have any effect. Calling these functions has been redundant since " "Python 3.11, when :c:func:`PyFrame_GetLocals` was first introduced." msgstr "" -#: ../../whatsnew/3.13.rst:2779 +#: ../../whatsnew/3.13.rst:2777 msgid "" ":c:func:`!PyFrame_LocalsToFast` no longer has any effect. Calling this " "function is redundant now that :c:func:`PyFrame_GetLocals` returns a write-" "through proxy for :term:`optimized scopes `." msgstr "" -#: ../../whatsnew/3.13.rst:2783 +#: ../../whatsnew/3.13.rst:2781 msgid "" "Python 3.13 removed many private functions. Some of them can be replaced " "using these alternatives:" msgstr "" -#: ../../whatsnew/3.13.rst:2786 +#: ../../whatsnew/3.13.rst:2784 msgid "``_PyDict_Pop()``: :c:func:`PyDict_Pop` or :c:func:`PyDict_PopString`;" msgstr "" "``_PyDict_Pop()``::c:func:`PyDict_Pop` 或 :c:func:`PyDict_PopString`;" -#: ../../whatsnew/3.13.rst:2787 +#: ../../whatsnew/3.13.rst:2785 msgid "``_PyDict_GetItemWithError()``: :c:func:`PyDict_GetItemRef`;" msgstr "``_PyDict_GetItemWithError()``::c:func:`PyDict_GetItemRef`;" -#: ../../whatsnew/3.13.rst:2788 +#: ../../whatsnew/3.13.rst:2786 msgid "``_PyErr_WriteUnraisableMsg()``: :c:func:`PyErr_FormatUnraisable`;" msgstr "``_PyErr_WriteUnraisableMsg()``::c:func:`PyErr_FormatUnraisable`;" -#: ../../whatsnew/3.13.rst:2789 +#: ../../whatsnew/3.13.rst:2787 msgid "" "``_PyEval_SetTrace()``: :c:func:`PyEval_SetTrace` or :c:func:" "`PyEval_SetTraceAllThreads`;" @@ -6069,43 +6075,43 @@ msgstr "" "``_PyEval_SetTrace()``::c:func:`PyEval_SetTrace` 或 :c:func:" "`PyEval_SetTraceAllThreads`;" -#: ../../whatsnew/3.13.rst:2790 +#: ../../whatsnew/3.13.rst:2788 msgid "``_PyList_Extend()``: :c:func:`PyList_Extend`;" msgstr "``_PyList_Extend()``::c:func:`PyList_Extend`;" -#: ../../whatsnew/3.13.rst:2791 +#: ../../whatsnew/3.13.rst:2789 msgid "``_PyLong_AsInt()``: :c:func:`PyLong_AsInt`;" msgstr "``_PyLong_AsInt()``::c:func:`PyLong_AsInt`;" -#: ../../whatsnew/3.13.rst:2792 +#: ../../whatsnew/3.13.rst:2790 msgid "``_PyMem_RawStrdup()``: ``strdup()``;" msgstr "``_PyMem_RawStrdup()``:``strdup()``;" -#: ../../whatsnew/3.13.rst:2793 +#: ../../whatsnew/3.13.rst:2791 msgid "``_PyMem_Strdup()``: ``strdup()``;" msgstr "``_PyMem_Strdup()``:``strdup()``;" -#: ../../whatsnew/3.13.rst:2794 +#: ../../whatsnew/3.13.rst:2792 msgid "``_PyObject_ClearManagedDict()``: :c:func:`PyObject_ClearManagedDict`;" msgstr "" "``_PyObject_ClearManagedDict()``::c:func:`PyObject_ClearManagedDict`;" -#: ../../whatsnew/3.13.rst:2795 +#: ../../whatsnew/3.13.rst:2793 msgid "``_PyObject_VisitManagedDict()``: :c:func:`PyObject_VisitManagedDict`;" msgstr "" "``_PyObject_VisitManagedDict()``::c:func:`PyObject_VisitManagedDict`;" -#: ../../whatsnew/3.13.rst:2796 +#: ../../whatsnew/3.13.rst:2794 msgid "" "``_PyThreadState_UncheckedGet()``: :c:func:`PyThreadState_GetUnchecked()`;" msgstr "" "``_PyThreadState_UncheckedGet()``::c:func:`PyThreadState_GetUnchecked()`;" -#: ../../whatsnew/3.13.rst:2797 +#: ../../whatsnew/3.13.rst:2795 msgid "``_PyTime_AsSecondsDouble()``: :c:func:`PyTime_AsSecondsDouble`;" msgstr "``_PyTime_AsSecondsDouble()``::c:func:`PyTime_AsSecondsDouble`;" -#: ../../whatsnew/3.13.rst:2798 +#: ../../whatsnew/3.13.rst:2796 msgid "" "``_PyTime_GetMonotonicClock()``: :c:func:`PyTime_Monotonic` or :c:func:" "`PyTime_MonotonicRaw`;" @@ -6113,7 +6119,7 @@ msgstr "" "``_PyTime_GetMonotonicClock()``::c:func:`PyTime_Monotonic` 或 :c:func:" "`PyTime_MonotonicRaw`;" -#: ../../whatsnew/3.13.rst:2799 +#: ../../whatsnew/3.13.rst:2797 msgid "" "``_PyTime_GetPerfCounter()``: :c:func:`PyTime_PerfCounter` or :c:func:" "`PyTime_PerfCounterRaw`;" @@ -6121,7 +6127,7 @@ msgstr "" "``_PyTime_GetPerfCounter()``::c:func:`PyTime_PerfCounter` 或 :c:func:" "`PyTime_PerfCounterRaw`;" -#: ../../whatsnew/3.13.rst:2800 +#: ../../whatsnew/3.13.rst:2798 msgid "" "``_PyTime_GetSystemClock()``: :c:func:`PyTime_Time` or :c:func:" "`PyTime_TimeRaw`;" @@ -6129,27 +6135,27 @@ msgstr "" "``_PyTime_GetSystemClock()``::c:func:`PyTime_Time` 或 :c:func:" "`PyTime_TimeRaw`;" -#: ../../whatsnew/3.13.rst:2801 +#: ../../whatsnew/3.13.rst:2799 msgid "``_PyTime_MAX``: :c:var:`PyTime_MAX`;" msgstr "``_PyTime_MAX``::c:var:`PyTime_MAX`;" -#: ../../whatsnew/3.13.rst:2802 +#: ../../whatsnew/3.13.rst:2800 msgid "``_PyTime_MIN``: :c:var:`PyTime_MIN`;" msgstr "``_PyTime_MIN``::c:var:`PyTime_MIN`;" -#: ../../whatsnew/3.13.rst:2803 +#: ../../whatsnew/3.13.rst:2801 msgid "``_PyTime_t``: :c:type:`PyTime_t`;" msgstr "``_PyTime_t``::c:type:`PyTime_t`;" -#: ../../whatsnew/3.13.rst:2804 +#: ../../whatsnew/3.13.rst:2802 msgid "``_Py_HashPointer()``: :c:func:`Py_HashPointer`;" msgstr "``_Py_HashPointer()``::c:func:`Py_HashPointer`;" -#: ../../whatsnew/3.13.rst:2805 +#: ../../whatsnew/3.13.rst:2803 msgid "``_Py_IsFinalizing()``: :c:func:`Py_IsFinalizing`." msgstr "``_Py_IsFinalizing()``::c:func:`Py_IsFinalizing`。" -#: ../../whatsnew/3.13.rst:2807 +#: ../../whatsnew/3.13.rst:2805 msgid "" "The `pythoncapi-compat project`_ can be used to get most of these new " "functions on Python 3.12 and older." @@ -6157,11 +6163,11 @@ msgstr "" "可以使用 `pythoncapi-compat 專案`_\\ 來在 Python 3.12 及更舊的版本中取用大部" "分的這些新函式。" -#: ../../whatsnew/3.13.rst:2811 +#: ../../whatsnew/3.13.rst:2809 msgid "Regression Test Changes" msgstr "迴歸測試的變更" -#: ../../whatsnew/3.13.rst:2813 +#: ../../whatsnew/3.13.rst:2811 msgid "" "Python built with :file:`configure` :option:`--with-pydebug` now supports a :" "option:`-X presite=package.module <-X>` command-line option. If used, it " @@ -6175,8 +6181,34 @@ msgstr "" "Łukasz Langa 在 :gh:`110769` 中貢獻。)" #~ msgid "" -#~ ":mod:`typing`: :class:`!typing.ByteString`, deprecated since Python 3.9, " -#~ "now causes a :exc:`DeprecationWarning` to be emitted when it is used." +#~ ":pypi:`passlib`: Comprehensive password hashing framework supporting over " +#~ "30 schemes." +#~ msgstr ":pypi:`passlib`:支援超過 30 種方案的廣泛密碼雜湊框架。" + +#~ msgid "``bool(NotImplemented)``." +#~ msgstr "``bool(NotImplemented)``。" + +#~ msgid "" +#~ ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " +#~ "removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :" +#~ "class:`~collections.abc.Buffer`. For use in type annotations, prefer a " +#~ "union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. " +#~ "(Contributed by Shantanu Jain in :gh:`91896`.)" +#~ msgstr "" +#~ "自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python 3.17 " +#~ "中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:" +#~ "`~collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " +#~ "bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:" +#~ "`91896` 貢獻。)" + +#~ msgid "" +#~ ":class:`collections.abc.ByteString` is scheduled for removal in Python " +#~ "3.17. Prefer :class:`~collections.abc.Sequence` or :class:`~collections." +#~ "abc.Buffer`. For use in type annotations, prefer a union, like ``bytes | " +#~ "bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " +#~ "Jain in :gh:`91896`.)" #~ msgstr "" -#~ ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`!typing.ByteString` 現在" -#~ "在使用時會發出 :exc:`DeprecationWarning`。" +#~ ":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 :" +#~ "class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" +#~ "型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections." +#~ "abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" diff --git a/whatsnew/3.14.po b/whatsnew/3.14.po index 147dddd4b7..654231a7c6 100644 --- a/whatsnew/3.14.po +++ b/whatsnew/3.14.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-18 00:15+0000\n" +"POT-Creation-Date: 2025-10-08 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,498 +16,588 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../../whatsnew/3.14.rst:3 +#: ../../whatsnew/3.14.rst:4 msgid "What's new in Python 3.14" msgstr "" #: ../../whatsnew/3.14.rst:0 -msgid "Editor" +#, fuzzy +msgid "Editors" msgstr "編輯者" -#: ../../whatsnew/3.14.rst:5 -msgid "Hugo van Kemenade" +#: ../../whatsnew/3.14.rst:6 +msgid "Adam Turner and Hugo van Kemenade" msgstr "" -#: ../../whatsnew/3.14.rst:47 +#: ../../whatsnew/3.14.rst:48 msgid "" -"This article explains the new features in Python 3.14, compared to 3.13." -msgstr "" - -#: ../../whatsnew/3.14.rst:49 -msgid "For full details, see the :ref:`changelog `." +"This article explains the new features in Python 3.14, compared to 3.13. " +"Python 3.14 was released on 7 October 2025. For full details, see the :ref:" +"`changelog `." msgstr "" -#: ../../whatsnew/3.14.rst:53 +#: ../../whatsnew/3.14.rst:54 msgid ":pep:`745` -- Python 3.14 release schedule" msgstr "" -#: ../../whatsnew/3.14.rst:57 -msgid "" -"Prerelease users should be aware that this document is currently in draft " -"form. It will be updated substantially as Python 3.14 moves towards release, " -"so it's worth checking back even after reading earlier versions." +#: ../../whatsnew/3.14.rst:58 +msgid "Summary -- Release highlights" msgstr "" #: ../../whatsnew/3.14.rst:63 -msgid "Summary -- release highlights" -msgstr "" - -#: ../../whatsnew/3.14.rst:68 msgid "" -"Python 3.14 will be the latest stable release of the Python programming " -"language, with a mix of changes to the language, the implementation and the " -"standard library." +"Python 3.14 is the latest stable release of the Python programming language, " +"with a mix of changes to the language, the implementation, and the standard " +"library. The biggest changes include :ref:`template string literals " +"`, :ref:`deferred evaluation of " +"annotations `, and support for :ref:" +"`subinterpreters ` in the standard " +"library." msgstr "" #: ../../whatsnew/3.14.rst:72 msgid "" -"The biggest changes to the implementation include template strings (:pep:" -"`750`), deferred evaluation of annotations (:pep:`649`), and a new type of " -"interpreter that uses tail calls." +"The library changes include significantly improved capabilities for :ref:" +"`introspection in asyncio `, :ref:" +"`support for Zstandard ` via a new :mod:`compression." +"zstd` module, syntax highlighting in the REPL, as well as the usual " +"deprecations and removals, and improvements in user-friendliness and " +"correctness." msgstr "" -#: ../../whatsnew/3.14.rst:76 +#: ../../whatsnew/3.14.rst:79 msgid "" -"The library changes include the addition of a new :mod:`!annotationlib` " -"module for introspecting and wrapping annotations (:pep:`749`), a new :mod:`!" -"compression.zstd` module for Zstandard support (:pep:`784`), plus syntax " -"highlighting in the REPL, as well as the usual deprecations and removals, " -"and improvements in user-friendliness and correctness." +"This article doesn't attempt to provide a complete specification of all new " +"features, but instead gives a convenient overview. For full details refer to " +"the documentation, such as the :ref:`Library Reference ` and :" +"ref:`Language Reference `. To understand the complete " +"implementation and design rationale for a change, refer to the PEP for a " +"particular new feature; but note that PEPs usually are not kept up-to-date " +"once a feature has been fully implemented. See `Porting to Python 3.14`_ for " +"guidance on upgrading from earlier versions of Python." msgstr "" -#: ../../whatsnew/3.14.rst:85 -msgid "" -":ref:`PEP 779: Free-threaded Python is officially supported `" +#: ../../whatsnew/3.14.rst:95 +msgid "Interpreter improvements:" msgstr "" -#: ../../whatsnew/3.14.rst:86 +#: ../../whatsnew/3.14.rst:97 msgid "" -":ref:`PEP 649 and 749: deferred evaluation of annotations `" +":pep:`649` and :pep:`749`: :ref:`Deferred evaluation of annotations " +"`" msgstr "" -#: ../../whatsnew/3.14.rst:87 +#: ../../whatsnew/3.14.rst:99 msgid "" -":ref:`PEP 734: Multiple interpreters in the stdlib `" +":pep:`734`: :ref:`Multiple interpreters in the standard library `" msgstr "" -#: ../../whatsnew/3.14.rst:88 -msgid ":ref:`PEP 741: Python configuration C API `" +#: ../../whatsnew/3.14.rst:101 +msgid "" +":pep:`750`: :ref:`Template strings `" msgstr "" -#: ../../whatsnew/3.14.rst:89 -msgid ":ref:`PEP 750: Template strings `" +#: ../../whatsnew/3.14.rst:102 +msgid "" +":pep:`758`: :ref:`Allow except and except* expressions without brackets " +"`" msgstr "" -#: ../../whatsnew/3.14.rst:90 +#: ../../whatsnew/3.14.rst:104 msgid "" -":ref:`PEP 758: Allow except and except* expressions without parentheses " -"`" +":pep:`765`: :ref:`Control flow in finally blocks `" msgstr "" -#: ../../whatsnew/3.14.rst:91 +#: ../../whatsnew/3.14.rst:106 msgid "" -":ref:`PEP 761: Discontinuation of PGP signatures `" +":pep:`768`: :ref:`Safe external debugger interface for CPython `" msgstr "" -#: ../../whatsnew/3.14.rst:92 -msgid "" -":ref:`PEP 765: Disallow return/break/continue that exit a finally block " -"`" +#: ../../whatsnew/3.14.rst:108 +msgid ":ref:`A new type of interpreter `" msgstr "" -#: ../../whatsnew/3.14.rst:93 +#: ../../whatsnew/3.14.rst:109 msgid "" ":ref:`Free-threaded mode improvements `" msgstr "" -#: ../../whatsnew/3.14.rst:94 -msgid "" -":ref:`PEP 768: Safe external debugger interface for CPython `" +#: ../../whatsnew/3.14.rst:110 +msgid ":ref:`Improved error messages `" msgstr "" -#: ../../whatsnew/3.14.rst:95 +#: ../../whatsnew/3.14.rst:111 +msgid ":ref:`Incremental garbage collection `" +msgstr "" + +#: ../../whatsnew/3.14.rst:113 +msgid "Significant improvements in the standard library:" +msgstr "" + +#: ../../whatsnew/3.14.rst:115 msgid "" -":ref:`PEP 784: Adding Zstandard to the standard library `" +":pep:`784`: :ref:`Zstandard support in the standard library `" msgstr "" -#: ../../whatsnew/3.14.rst:96 -msgid ":ref:`A new type of interpreter `" +#: ../../whatsnew/3.14.rst:117 +msgid ":ref:`whatsnew314-asyncio-introspection`" msgstr "" -#: ../../whatsnew/3.14.rst:97 +#: ../../whatsnew/3.14.rst:118 +msgid ":ref:`whatsnew314-concurrent-warnings-control`" +msgstr "" + +#: ../../whatsnew/3.14.rst:119 msgid "" -":ref:`Syntax highlighting in PyREPL `, and " -"color output in :ref:`unittest `, :ref:`argparse " -"`, :ref:`json ` and :ref:" -"`calendar ` CLIs" +":ref:`Syntax highlighting in the default interactive shell `, and color output in several standard library CLIs" msgstr "" -#: ../../whatsnew/3.14.rst:102 +#: ../../whatsnew/3.14.rst:123 +msgid "C API improvements:" +msgstr "" + +#: ../../whatsnew/3.14.rst:125 +msgid ":pep:`741`: :ref:`Python configuration C API `" +msgstr "" + +#: ../../whatsnew/3.14.rst:127 +msgid "Platform support:" +msgstr "" + +#: ../../whatsnew/3.14.rst:129 msgid "" -":ref:`Binary releases for the experimental just-in-time compiler " -"`" +":pep:`776`: Emscripten is now an :ref:`officially supported platform " +"`, at :pep:`tier 3 <11#tier-3>`." msgstr "" -#: ../../whatsnew/3.14.rst:106 -msgid "Incompatible changes" +#: ../../whatsnew/3.14.rst:132 +msgid "Release changes:" msgstr "" -#: ../../whatsnew/3.14.rst:108 +#: ../../whatsnew/3.14.rst:134 msgid "" -"On platforms other than macOS and Windows, the default :ref:`start method " -"` for :mod:`multiprocessing` and :class:" -"`~concurrent.futures.ProcessPoolExecutor` switches from *fork* to " -"*forkserver*." +":pep:`779`: :ref:`Free-threaded Python is officially supported `" msgstr "" -#: ../../whatsnew/3.14.rst:113 +#: ../../whatsnew/3.14.rst:136 msgid "" -"See :ref:`(1) ` and :ref:`(2) " -"` for details." +":pep:`761`: :ref:`PGP signatures have been discontinued for official " +"releases `" msgstr "" -#: ../../whatsnew/3.14.rst:116 +#: ../../whatsnew/3.14.rst:138 msgid "" -"If you encounter :exc:`NameError`\\s or pickling errors coming out of :mod:" -"`multiprocessing` or :mod:`concurrent.futures`, see the :ref:`forkserver " -"restrictions `." +":ref:`Windows and macOS binary releases now support the experimental just-in-" +"time compiler `" msgstr "" -#: ../../whatsnew/3.14.rst:120 +#: ../../whatsnew/3.14.rst:140 msgid "" -"The interpreter avoids some reference count modifications internally when " -"it's safe to do so. This can lead to different values returned from :func:" -"`sys.getrefcount` and :c:func:`Py_REFCNT` compared to previous versions of " -"Python. See :ref:`below ` for details." +":ref:`Binary releases for Android are now provided `" msgstr "" -#: ../../whatsnew/3.14.rst:126 +#: ../../whatsnew/3.14.rst:144 msgid "New features" msgstr "" -#: ../../whatsnew/3.14.rst:131 -msgid "PEP 779: Free-threaded Python is officially supported" +#: ../../whatsnew/3.14.rst:149 +msgid ":pep:`649` & :pep:`749`: Deferred evaluation of annotations" msgstr "" -#: ../../whatsnew/3.14.rst:133 +#: ../../whatsnew/3.14.rst:151 msgid "" -"The free-threaded build of Python is now supported and no longer " -"experimental. This is the start of phase II where free-threaded Python is " -"officially supported but still optional." +"The :term:`annotations ` on functions, classes, and modules are " +"no longer evaluated eagerly. Instead, annotations are stored in special-" +"purpose :term:`annotate functions ` and evaluated only " +"when necessary (except if ``from __future__ import annotations`` is used)." msgstr "" -#: ../../whatsnew/3.14.rst:137 +#: ../../whatsnew/3.14.rst:156 msgid "" -"We are confident that the project is on the right path, and we appreciate " -"the continued dedication from everyone working to make free-threading ready " -"for broader adoption across the Python community." +"This change is designed to improve performance and usability of annotations " +"in Python in most circumstances. The runtime cost for defining annotations " +"is minimized, but it remains possible to introspect annotations at runtime. " +"It is no longer necessary to enclose annotations in strings if they contain " +"forward references." msgstr "" -#: ../../whatsnew/3.14.rst:141 +#: ../../whatsnew/3.14.rst:162 msgid "" -"With these recommendations and the acceptance of this PEP, we as the Python " -"developer community should broadly advertise that free-threading is a " -"supported Python build option now and into the future, and that it will not " -"be removed without a proper deprecation schedule." +"The new :mod:`annotationlib` module provides tools for inspecting deferred " +"annotations. Annotations may be evaluated in the :attr:`~annotationlib." +"Format.VALUE` format (which evaluates annotations to runtime values, similar " +"to the behavior in earlier Python versions), the :attr:`~annotationlib." +"Format.FORWARDREF` format (which replaces undefined names with special " +"markers), and the :attr:`~annotationlib.Format.STRING` format (which returns " +"annotations as strings)." +msgstr "" + +#: ../../whatsnew/3.14.rst:169 +msgid "This example shows how these formats behave:" +msgstr "" + +#: ../../whatsnew/3.14.rst:171 +msgid "" +">>> from annotationlib import get_annotations, Format\n" +">>> def func(arg: Undefined):\n" +"... pass\n" +">>> get_annotations(func, format=Format.VALUE)\n" +"Traceback (most recent call last):\n" +" ...\n" +"NameError: name 'Undefined' is not defined\n" +">>> get_annotations(func, format=Format.FORWARDREF)\n" +"{'arg': ForwardRef('Undefined', owner=)}\n" +">>> get_annotations(func, format=Format.STRING)\n" +"{'arg': 'Undefined'}" msgstr "" -#: ../../whatsnew/3.14.rst:146 +#: ../../whatsnew/3.14.rst:185 msgid "" -"Any decision to transition to phase III, with free-threading as the default " -"or sole build of Python is still undecided, and dependent on many factors " -"both within CPython itself and the community. This decision is for the " -"future." +"The :ref:`porting ` section contains " +"guidance on changes that may be needed due to these changes, though in the " +"majority of cases, code will continue working as-is." msgstr "" -#: ../../whatsnew/3.14.rst:151 +#: ../../whatsnew/3.14.rst:189 +#, fuzzy msgid "" -":pep:`779` and its `acceptance `__." +"(Contributed by Jelle Zijlstra in :pep:`749` and :gh:`119180`; :pep:`649` " +"was written by Larry Hastings.)" +msgstr "(由 Jelle Zijlstra 於 :gh:`105499` 貢獻。)" + +#: ../../whatsnew/3.14.rst:194 +#, fuzzy +msgid ":pep:`649`" +msgstr ":pep:`744`" + +#: ../../whatsnew/3.14.rst:195 +msgid "Deferred Evaluation Of Annotations Using Descriptors" +msgstr "" + +#: ../../whatsnew/3.14.rst:196 +#, fuzzy +msgid ":pep:`749`" +msgstr ":pep:`744`" + +#: ../../whatsnew/3.14.rst:197 +msgid "Implementing PEP 649" msgstr "" -#: ../../whatsnew/3.14.rst:157 -msgid "PEP 734: Multiple interpreters in the stdlib" +#: ../../whatsnew/3.14.rst:203 +msgid ":pep:`734`: Multiple interpreters in the standard library" msgstr "" -#: ../../whatsnew/3.14.rst:159 +#: ../../whatsnew/3.14.rst:205 msgid "" "The CPython runtime supports running multiple copies of Python in the same " "process simultaneously and has done so for over 20 years. Each of these " -"separate copies is called an \"interpreter\". However, the feature had been " -"available only through the C-API." +"separate copies is called an 'interpreter'. However, the feature had been " +"available only through the :ref:`C-API `." msgstr "" -#: ../../whatsnew/3.14.rst:164 +#: ../../whatsnew/3.14.rst:211 msgid "" -"That limitation is removed in the 3.14 release, with the new :mod:" -"`concurrent.interpreters` module." +"That limitation is removed in Python 3.14, with the new :mod:`concurrent." +"interpreters` module." msgstr "" -#: ../../whatsnew/3.14.rst:167 +#: ../../whatsnew/3.14.rst:214 msgid "" -"There are at least two notable reasons why using multiple interpreters is " -"worth considering:" +"There are at least two notable reasons why using multiple interpreters has " +"significant benefits:" msgstr "" -#: ../../whatsnew/3.14.rst:170 +#: ../../whatsnew/3.14.rst:217 msgid "they support a new (to Python), human-friendly concurrency model" msgstr "" -#: ../../whatsnew/3.14.rst:171 +#: ../../whatsnew/3.14.rst:218 msgid "true multi-core parallelism" msgstr "" -#: ../../whatsnew/3.14.rst:173 +#: ../../whatsnew/3.14.rst:220 msgid "" -"For some use cases, concurrency in software enables efficiency and can " -"simplify software, at a high level. At the same time, implementing and " +"For some use cases, concurrency in software improves efficiency and can " +"simplify design, at a high level. At the same time, implementing and " "maintaining all but the simplest concurrency is often a struggle for the " -"human brain. That especially applies to plain threads (for example, :mod:" +"human brain. That especially applies to plain threads (for example, :mod:" "`threading`), where all memory is shared between all threads." msgstr "" -#: ../../whatsnew/3.14.rst:179 +#: ../../whatsnew/3.14.rst:227 msgid "" "With multiple isolated interpreters, you can take advantage of a class of " -"concurrency models, like CSP or the actor model, that have found success in " -"other programming languages, like Smalltalk, Erlang, Haskell, and Go. Think " -"of multiple interpreters like threads but with opt-in sharing." +"concurrency models, like Communicating Sequential Processes (CSP) or the " +"actor model, that have found success in other programming languages, like " +"Smalltalk, Erlang, Haskell, and Go. Think of multiple interpreters as " +"threads but with opt-in sharing." msgstr "" -#: ../../whatsnew/3.14.rst:185 +#: ../../whatsnew/3.14.rst:234 msgid "" -"Regarding multi-core parallelism: as of the 3.12 release, interpreters are " -"now sufficiently isolated from one another to be used in parallel. (See :pep:" -"`684`.) This unlocks a variety of CPU-intensive use cases for Python that " +"Regarding multi-core parallelism: as of Python 3.12, interpreters are now " +"sufficiently isolated from one another to be used in parallel (see :pep:" +"`684`). This unlocks a variety of CPU-intensive use cases for Python that " "were limited by the :term:`GIL`." msgstr "" -#: ../../whatsnew/3.14.rst:190 +#: ../../whatsnew/3.14.rst:239 msgid "" "Using multiple interpreters is similar in many ways to :mod:" "`multiprocessing`, in that they both provide isolated logical \"processes\" " "that can run in parallel, with no sharing by default. However, when using " "multiple interpreters, an application will use fewer system resources and " -"will operate more efficiently (since it stays within the same process). " +"will operate more efficiently (since it stays within the same process). " "Think of multiple interpreters as having the isolation of processes with the " "efficiency of threads." msgstr "" -#: ../../whatsnew/3.14.rst:201 +#: ../../whatsnew/3.14.rst:250 msgid "" "While the feature has been around for decades, multiple interpreters have " -"not been used widely, due to low awareness and the lack of a stdlib module. " -"Consequently, they currently have several notable limitations, which will " -"improve significantly now that the feature is finally going mainstream." +"not been used widely, due to low awareness and the lack of a standard " +"library module. Consequently, they currently have several notable " +"limitations, which are expected to improve significantly now that the " +"feature is going mainstream." msgstr "" -#: ../../whatsnew/3.14.rst:207 +#: ../../whatsnew/3.14.rst:256 msgid "Current limitations:" msgstr "" -#: ../../whatsnew/3.14.rst:209 +#: ../../whatsnew/3.14.rst:258 msgid "starting each interpreter has not been optimized yet" msgstr "" -#: ../../whatsnew/3.14.rst:210 +#: ../../whatsnew/3.14.rst:259 msgid "" -"each interpreter uses more memory than necessary (we will be working next on " +"each interpreter uses more memory than necessary (work continues on " "extensive internal sharing between interpreters)" msgstr "" -#: ../../whatsnew/3.14.rst:213 +#: ../../whatsnew/3.14.rst:261 msgid "" "there aren't many options *yet* for truly sharing objects or other data " "between interpreters (other than :type:`memoryview`)" msgstr "" -#: ../../whatsnew/3.14.rst:215 +#: ../../whatsnew/3.14.rst:263 msgid "" -"many extension modules on PyPI are not compatible with multiple interpreters " -"yet (stdlib extension modules *are* compatible)" +"many third-party extension modules on PyPI are not yet compatible with " +"multiple interpreters (all standard library extension modules *are* " +"compatible)" msgstr "" -#: ../../whatsnew/3.14.rst:217 +#: ../../whatsnew/3.14.rst:266 msgid "" "the approach to writing applications that use multiple isolated interpreters " "is mostly unfamiliar to Python users, for now" msgstr "" -#: ../../whatsnew/3.14.rst:220 +#: ../../whatsnew/3.14.rst:269 msgid "" "The impact of these limitations will depend on future CPython improvements, " "how interpreters are used, and what the community solves through PyPI " -"packages. Depending on the use case, the limitations may not have much " +"packages. Depending on the use case, the limitations may not have much " "impact, so try it out!" msgstr "" -#: ../../whatsnew/3.14.rst:225 +#: ../../whatsnew/3.14.rst:274 msgid "" "Furthermore, future CPython releases will reduce or eliminate overhead and " -"provide utilities that are less appropriate on PyPI. In the meantime, most " +"provide utilities that are less appropriate on PyPI. In the meantime, most " "of the limitations can also be addressed through extension modules, meaning " "PyPI packages can fill any gap for 3.14, and even back to 3.12 where " "interpreters were finally properly isolated and stopped sharing the :term:" -"`GIL`. Likewise, we expect to slowly see libraries on PyPI for high-level " +"`GIL`. Likewise, libraries on PyPI are expected to emerge for high-level " "abstractions on top of interpreters." msgstr "" -#: ../../whatsnew/3.14.rst:233 +#: ../../whatsnew/3.14.rst:282 msgid "" "Regarding extension modules, work is in progress to update some PyPI " "projects, as well as tools like Cython, pybind11, nanobind, and PyO3. The " "steps for isolating an extension module are found at :ref:`isolating-" -"extensions-howto`. Isolating a module has a lot of overlap with what is " +"extensions-howto`. Isolating a module has a lot of overlap with what is " "required to support :ref:`free-threading `, so the ongoing work in the community in that area will help " "accelerate support for multiple interpreters." msgstr "" -#: ../../whatsnew/3.14.rst:242 +#: ../../whatsnew/3.14.rst:291 msgid "" "Also added in 3.14: :ref:`concurrent.futures.InterpreterPoolExecutor " "`." msgstr "" -#: ../../whatsnew/3.14.rst:246 -msgid ":pep:`734`." -msgstr "" +#: ../../whatsnew/3.14.rst:294 +#, fuzzy +msgid "(Contributed by Eric Snow in :gh:`134939`.)" +msgstr "(由 Steve Dower 於 :gh:`91349` 貢獻。)" -#: ../../whatsnew/3.14.rst:252 -msgid "PEP 750: Template strings" +#: ../../whatsnew/3.14.rst:296 +#, fuzzy +msgid ":pep:`734`" +msgstr ":pep:`744`" + +#: ../../whatsnew/3.14.rst:302 +msgid ":pep:`750`: Template string literals" msgstr "" -#: ../../whatsnew/3.14.rst:254 +#: ../../whatsnew/3.14.rst:304 msgid "" -"Template string literals (t-strings) are a generalization of f-strings, " -"using a ``t`` in place of the ``f`` prefix. Instead of evaluating to :class:" -"`str`, t-strings evaluate to a new :class:`!string.templatelib.Template` " -"type:" +"Template strings are a new mechanism for custom string processing. They " +"share the familiar syntax of f-strings but, unlike f-strings, return an " +"object representing the static and interpolated parts of the string, instead " +"of a simple :class:`str`." msgstr "" -#: ../../whatsnew/3.14.rst:258 +#: ../../whatsnew/3.14.rst:309 +msgid "To write a t-string, use a ``'t'`` prefix instead of an ``'f'``:" +msgstr "" + +#: ../../whatsnew/3.14.rst:311 msgid "" -"from string.templatelib import Template\n" -"\n" -"name = \"World\"\n" -"template: Template = t\"Hello {name}\"" +">>> variety = 'Stilton'\n" +">>> template = t'Try some {variety} cheese!'\n" +">>> type(template)\n" +"" msgstr "" -#: ../../whatsnew/3.14.rst:265 +#: ../../whatsnew/3.14.rst:318 msgid "" -"The template can then be combined with functions that operate on the " -"template's structure to produce a :class:`str` or a string-like result. For " -"example, sanitizing input:" +":class:`~string.templatelib.Template` objects provide access to the static " +"and interpolated (in curly braces) parts of a string *before* they are " +"combined. Iterate over :class:`!Template` instances to access their parts in " +"order:" msgstr "" -#: ../../whatsnew/3.14.rst:269 +#: ../../whatsnew/3.14.rst:327 msgid "" -"evil = \"\"\n" -"template = t\"

{evil}

\"\n" -"assert html(template) == \"

<script>alert('evil')</script>\"" +">>> list(template)\n" +"['Try some ', Interpolation('Stilton', 'variety', None, ''), ' cheese!']" msgstr "" -#: ../../whatsnew/3.14.rst:275 -msgid "As another example, generating HTML attributes from data:" +#: ../../whatsnew/3.14.rst:332 +msgid "" +"It's easy to write (or call) code to process :class:`!Template` instances. " +"For example, here's a function that renders static parts lowercase and :" +"class:`~string.templatelib.Interpolation` instances uppercase:" msgstr "" -#: ../../whatsnew/3.14.rst:277 +#: ../../whatsnew/3.14.rst:336 msgid "" -"attributes = {\"src\": \"shrubbery.jpg\", \"alt\": \"looks nice\"}\n" -"template = t\"\"\n" -"assert html(template) == '\"looks'" +"from string.templatelib import Interpolation\n" +"\n" +"def lower_upper(template):\n" +" \"\"\"Render static parts lowercase and interpolations uppercase.\"\"\"\n" +" parts = []\n" +" for part in template:\n" +" if isinstance(part, Interpolation):\n" +" parts.append(str(part.value).upper())\n" +" else:\n" +" parts.append(part.lower())\n" +" return ''.join(parts)\n" +"\n" +"name = 'Wenslydale'\n" +"template = t'Mister {name}'\n" +"assert lower_upper(template) == 'mister WENSLYDALE'" msgstr "" -#: ../../whatsnew/3.14.rst:283 +#: ../../whatsnew/3.14.rst:354 msgid "" -"Compared to using an f-string, the ``html`` function has access to template " -"attributes containing the original information: static strings, " -"interpolations, and values from the original scope. Unlike existing " -"templating approaches, t-strings build from the well-known f-string syntax " -"and rules. Template systems thus benefit from Python tooling as they are " -"much closer to the Python language, syntax, scoping, and more." +"Because :class:`!Template` instances distinguish between static strings and " +"interpolations at runtime, they can be useful for sanitising user input. " +"Writing a :func:`!html` function that escapes user input in HTML is an " +"exercise left to the reader! Template processing code can provide improved " +"flexibility. For instance, a more advanced :func:`!html` function could " +"accept a :class:`!dict` of HTML attributes directly in the template:" msgstr "" -#: ../../whatsnew/3.14.rst:290 -msgid "Writing template handlers is straightforward:" +#: ../../whatsnew/3.14.rst:362 +msgid "" +"attributes = {'src': 'limburger.jpg', 'alt': 'lovely cheese'}\n" +"template = t''\n" +"assert html(template) == '\"lovely'" msgstr "" -#: ../../whatsnew/3.14.rst:292 +#: ../../whatsnew/3.14.rst:368 msgid "" -"from string.templatelib import Template, Interpolation\n" -"\n" -"def lower_upper(template: Template) -> str:\n" -" \"\"\"Render static parts lowercased and interpolations uppercased." -"\"\"\"\n" -" parts: list[str] = []\n" -" for item in template:\n" -" if isinstance(item, Interpolation):\n" -" parts.append(str(item.value).upper())\n" -" else:\n" -" parts.append(item.lower())\n" -" return \"\".join(parts)\n" -"\n" -"name = \"world\"\n" -"assert lower_upper(t\"HELLO {name}\") == \"hello WORLD\"" +"Of course, template processing code does not need to return a string-like " +"result. An even *more* advanced :func:`!html` could return a custom type " +"representing a DOM-like structure." msgstr "" -#: ../../whatsnew/3.14.rst:309 +#: ../../whatsnew/3.14.rst:372 msgid "" -"With this in place, developers can write template systems to sanitize SQL, " +"With t-strings in place, developers can write systems that sanitise SQL, " "make safe shell operations, improve logging, tackle modern ideas in web " -"development (HTML, CSS, and so on), and implement lightweight, custom " +"development (HTML, CSS, and so on), and implement lightweight custom " "business DSLs." msgstr "" -#: ../../whatsnew/3.14.rst:313 +#: ../../whatsnew/3.14.rst:376 msgid "" "(Contributed by Jim Baker, Guido van Rossum, Paul Everitt, Koudai Aono, " "Lysandros Nikolaou, Dave Peck, Adam Turner, Jelle Zijlstra, Bénédikt Tran, " "and Pablo Galindo Salgado in :gh:`132661`.)" msgstr "" -#: ../../whatsnew/3.14.rst:318 +#: ../../whatsnew/3.14.rst:380 msgid ":pep:`750`." msgstr "" -#: ../../whatsnew/3.14.rst:324 -msgid "PEP 768: Safe external debugger interface for CPython" +#: ../../whatsnew/3.14.rst:386 +msgid ":pep:`768`: Safe external debugger interface" msgstr "" -#: ../../whatsnew/3.14.rst:326 +#: ../../whatsnew/3.14.rst:388 msgid "" -":pep:`768` introduces a zero-overhead debugging interface that allows " -"debuggers and profilers to safely attach to running Python processes. This " -"is a significant enhancement to Python's debugging capabilities allowing " -"debuggers to forego unsafe alternatives. See :ref:`below ` for how this feature is leveraged to implement the new :mod:`pdb` " -"module's remote attaching capabilities." +"Python 3.14 introduces a zero-overhead debugging interface that allows " +"debuggers and profilers to safely attach to running Python processes without " +"stopping or restarting them. This is a significant enhancement to Python's " +"debugging capabilities, meaning that unsafe alternatives are no longer " +"required." msgstr "" -#: ../../whatsnew/3.14.rst:332 +#: ../../whatsnew/3.14.rst:394 msgid "" "The new interface provides safe execution points for attaching debugger code " -"without modifying the interpreter's normal execution path or adding runtime " -"overhead. This enables tools to inspect and interact with Python " -"applications in real-time without stopping or restarting them — a crucial " -"capability for high-availability systems and production environments." +"without modifying the interpreter's normal execution path or adding any " +"overhead at runtime. Due to this, tools can now inspect and interact with " +"Python applications in real-time, which is a crucial capability for high-" +"availability systems and production environments." msgstr "" -#: ../../whatsnew/3.14.rst:337 +#: ../../whatsnew/3.14.rst:401 msgid "" -"For convenience, CPython implements this interface through the :mod:`sys` " -"module with a :func:`sys.remote_exec` function::" +"For convenience, this interface is implemented in the :func:`sys." +"remote_exec` function. For example:" msgstr "" -#: ../../whatsnew/3.14.rst:340 -msgid "sys.remote_exec(pid, script_path)" +#: ../../whatsnew/3.14.rst:404 +msgid "" +"import sys\n" +"from tempfile import NamedTemporaryFile\n" +"\n" +"with NamedTemporaryFile(mode='w', suffix='.py', delete=False) as f:\n" +" script_path = f.name\n" +" f.write(f'import my_debugger; my_debugger.connect({os.getpid()})')\n" +"\n" +"# Execute in process with PID 1234\n" +"print('Behold! An offering:')\n" +"sys.remote_exec(1234, script_path)" msgstr "" -#: ../../whatsnew/3.14.rst:342 +#: ../../whatsnew/3.14.rst:418 msgid "" "This function allows sending Python code to be executed in a target process " "at the next safe execution point. However, tool authors can also implement " @@ -515,455 +605,206 @@ msgid "" "mechanisms used to safely attach to running processes." msgstr "" -#: ../../whatsnew/3.14.rst:346 -msgid "" -"Here's a simple example that inspects object types in a running Python " -"process:" -msgstr "" - -#: ../../whatsnew/3.14.rst:348 -msgid "" -"import os\n" -"import sys\n" -"import tempfile\n" -"\n" -"# Create a temporary script\n" -"with tempfile.NamedTemporaryFile(mode='w', suffix='.py', delete=False) as " -"f:\n" -" script_path = f.name\n" -" f.write(f\"import my_debugger; my_debugger.connect({os.getpid()})\")\n" -"try:\n" -" # Execute in process with PID 1234\n" -" print(\"Behold! An offering:\")\n" -" sys.remote_exec(1234, script_path)\n" -"finally:\n" -" os.unlink(script_path)" -msgstr "" - -#: ../../whatsnew/3.14.rst:365 +#: ../../whatsnew/3.14.rst:424 msgid "" "The debugging interface has been carefully designed with security in mind " "and includes several mechanisms to control access:" msgstr "" -#: ../../whatsnew/3.14.rst:368 +#: ../../whatsnew/3.14.rst:427 msgid "A :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` environment variable." msgstr "" -#: ../../whatsnew/3.14.rst:369 +#: ../../whatsnew/3.14.rst:428 msgid "A :option:`-X disable-remote-debug` command-line option." msgstr "" -#: ../../whatsnew/3.14.rst:370 +#: ../../whatsnew/3.14.rst:429 msgid "" "A :option:`--without-remote-debug` configure flag to completely disable the " "feature at build time." msgstr "" -#: ../../whatsnew/3.14.rst:372 -msgid "" -"A key implementation detail is that the interface piggybacks on the " -"interpreter's existing evaluation loop and safe points, ensuring zero " -"overhead during normal execution while providing a reliable way for external " -"processes to coordinate debugging operations." -msgstr "" - -#: ../../whatsnew/3.14.rst:376 +#: ../../whatsnew/3.14.rst:432 msgid "" "(Contributed by Pablo Galindo Salgado, Matt Wozniski, and Ivona Stojanovic " "in :gh:`131591`.)" msgstr "" -#: ../../whatsnew/3.14.rst:379 ../../whatsnew/3.14.rst:453 +#: ../../whatsnew/3.14.rst:435 msgid ":pep:`768`." msgstr "" -#: ../../whatsnew/3.14.rst:385 -msgid "PEP 784: Adding Zstandard to the standard library" +#: ../../whatsnew/3.14.rst:441 +msgid "A new type of interpreter" msgstr "" -#: ../../whatsnew/3.14.rst:387 +#: ../../whatsnew/3.14.rst:443 msgid "" -"The new ``compression`` package contains modules :mod:`!compression.lzma`, :" -"mod:`!compression.bz2`, :mod:`!compression.gzip` and :mod:`!compression." -"zlib` which re-export the :mod:`lzma`, :mod:`bz2`, :mod:`gzip` and :mod:" -"`zlib` modules respectively. The new import names under ``compression`` are " -"the canonical names for importing these compression modules going forward. " -"However, the existing modules names have not been deprecated. Any " -"deprecation or removal of the existing compression modules will occur no " -"sooner than five years after the release of 3.14." +"A new type of interpreter has been added to CPython. It uses tail calls " +"between small C functions that implement individual Python opcodes, rather " +"than one large C ``case`` statement. For certain newer compilers, this " +"interpreter provides significantly better performance. Preliminary " +"benchmarks suggest a geometric mean of 3-5% faster on the standard " +"``pyperformance`` benchmark suite, depending on platform and architecture. " +"The baseline is Python 3.14 built with Clang 19, without this new " +"interpreter." msgstr "" -#: ../../whatsnew/3.14.rst:396 +#: ../../whatsnew/3.14.rst:452 msgid "" -"The new :mod:`!compression.zstd` module provides compression and " -"decompression APIs for the Zstandard format via bindings to `Meta's zstd " -"library `__. Zstandard is a widely " -"adopted, highly efficient, and fast compression format. In addition to the " -"APIs introduced in :mod:`!compression.zstd`, support for reading and writing " -"Zstandard compressed archives has been added to the :mod:`tarfile`, :mod:" -"`zipfile`, and :mod:`shutil` modules." +"This interpreter currently only works with Clang 19 and newer on x86-64 and " +"AArch64 architectures. However, a future release of GCC is expected to " +"support this as well." msgstr "" -#: ../../whatsnew/3.14.rst:404 -msgid "Here's an example of using the new module to compress some data:" +#: ../../whatsnew/3.14.rst:456 +msgid "" +"This feature is opt-in for now. Enabling profile-guided optimization is " +"highly recommendeded when using the new interpreter as it is the only " +"configuration that has been tested and validated for improved performance. " +"For further information, see :option:`--with-tail-call-interp`." msgstr "" -#: ../../whatsnew/3.14.rst:406 +#: ../../whatsnew/3.14.rst:463 msgid "" -"from compression import zstd\n" -"import math\n" -"\n" -"data = str(math.pi).encode() * 20\n" -"\n" -"compressed = zstd.compress(data)\n" -"\n" -"ratio = len(compressed) / len(data)\n" -"print(f\"Achieved compression ratio of {ratio}\")" +"This is not to be confused with `tail call optimization`__ of Python " +"functions, which is currently not implemented in CPython." msgstr "" -#: ../../whatsnew/3.14.rst:418 +#: ../../whatsnew/3.14.rst:466 msgid "" -"As can be seen, the API is similar to the APIs of the :mod:`!lzma` and :mod:" -"`!bz2` modules." +"This new interpreter type is an internal implementation detail of the " +"CPython interpreter. It doesn't change the visible behavior of Python " +"programs at all. It can improve their performance, but doesn't change " +"anything else." msgstr "" -#: ../../whatsnew/3.14.rst:421 +#: ../../whatsnew/3.14.rst:472 msgid "" -"(Contributed by Emma Harper Smith, Adam Turner, Gregory P. Smith, Tomas " -"Roun, Victor Stinner, and Rogdham in :gh:`132983`.)" +"(Contributed by Ken Jin in :gh:`128563`, with ideas on how to implement this " +"in CPython by Mark Shannon, Garrett Gu, Haoran Xu, and Josh Haberman.)" msgstr "" -#: ../../whatsnew/3.14.rst:425 -msgid ":pep:`784`." +#: ../../whatsnew/3.14.rst:479 +msgid "Free-threaded mode improvements" msgstr "" -#: ../../whatsnew/3.14.rst:431 -msgid "Remote attaching to a running Python process with PDB" +#: ../../whatsnew/3.14.rst:481 +msgid "" +"CPython's free-threaded mode (:pep:`703`), initially added in 3.13, has been " +"significantly improved in Python 3.14. The implementation described in PEP " +"703 has been finished, including C API changes, and temporary workarounds in " +"the interpreter were replaced with more permanent solutions. The " +"specializing adaptive interpreter (:pep:`659`) is now enabled in free-" +"threaded mode, which along with many other optimizations greatly improves " +"its performance. The performance penalty on single-threaded code in free-" +"threaded mode is now roughly 5-10%, depending on the platform and C compiler " +"used." msgstr "" -#: ../../whatsnew/3.14.rst:433 +#: ../../whatsnew/3.14.rst:492 msgid "" -"The :mod:`pdb` module now supports remote attaching to a running Python " -"process using a new ``-p PID`` command-line option:" +"From Python 3.14, when compiling extension modules for the free-threaded " +"build of CPython on Windows, the preprocessor variable ``Py_GIL_DISABLED`` " +"now needs to be specified by the build backend, as it will no longer be " +"determined automatically by the C compiler. For a running interpreter, the " +"setting that was used at compile time can be found using :func:`sysconfig." +"get_config_var`." msgstr "" -#: ../../whatsnew/3.14.rst:436 -msgid "python -m pdb -p 1234" +#: ../../whatsnew/3.14.rst:498 +msgid "" +"The new :option:`-X context_aware_warnings <-X>` flag controls if :ref:" +"`concurrent safe warnings control ` " +"is enabled. The flag defaults to true for the free-threaded build and false " +"for the GIL-enabled build." msgstr "" -#: ../../whatsnew/3.14.rst:440 +#: ../../whatsnew/3.14.rst:503 msgid "" -"This will connect to the Python process with the given PID and allow you to " -"debug it interactively. Notice that due to how the Python interpreter works " -"attaching to a remote process that is blocked in a system call or waiting " -"for I/O will only work once the next bytecode instruction is executed or " -"when the process receives a signal." +"A new :data:`~sys.flags.thread_inherit_context` flag has been added, which " +"if enabled means that threads created with :class:`threading.Thread` start " +"with a copy of the :class:`~contextvars.Context()` of the caller of :meth:" +"`~threading.Thread.start`. Most significantly, this makes the warning " +"filtering context established by :class:`~warnings.catch_warnings` be " +"\"inherited\" by threads (or asyncio tasks) started within that context. It " +"also affects other modules that use context variables, such as the :mod:" +"`decimal` context manager. This flag defaults to true for the free-threaded " +"build and false for the GIL-enabled build." msgstr "" -#: ../../whatsnew/3.14.rst:446 +#: ../../whatsnew/3.14.rst:514 msgid "" -"This feature uses :pep:`768` and the :func:`sys.remote_exec` function to " -"attach to the remote process and send the PDB commands to it." +"(Contributed by Sam Gross, Matt Page, Neil Schemenauer, Thomas Wouters, " +"Donghee Na, Kirill Podoprigora, Ken Jin, Itamar Oren, Brett Simmers, Dino " +"Viehland, Nathan Goldbaum, Ralf Gommers, Lysandros Nikolaou, Kumar Aditya, " +"Edgar Margffoy, and many others. Some of these contributors are employed by " +"Meta, which has continued to provide significant engineering resources to " +"support this project.)" msgstr "" -#: ../../whatsnew/3.14.rst:450 -msgid "(Contributed by Matt Wozniski and Pablo Galindo in :gh:`131591`.)" -msgstr "(由 Matt Wozniski and Pablo Galindo 於 :gh:`131591` 貢獻。)" +#: ../../whatsnew/3.14.rst:525 +msgid "Improved error messages" +msgstr "改善錯誤訊息" -#: ../../whatsnew/3.14.rst:459 -msgid "PEP 758 – Allow except and except* expressions without parentheses" +#: ../../whatsnew/3.14.rst:527 +msgid "" +"The interpreter now provides helpful suggestions when it detects typos in " +"Python keywords. When a word that closely resembles a Python keyword is " +"encountered, the interpreter will suggest the correct keyword in the error " +"message. This feature helps programmers quickly identify and fix common " +"typing mistakes. For example:" msgstr "" -#: ../../whatsnew/3.14.rst:461 +#: ../../whatsnew/3.14.rst:533 msgid "" -"The :keyword:`except` and :keyword:`except* ` expressions now " -"allow parentheses to be omitted when there are multiple exception types and " -"the ``as`` clause is not used. For example the following expressions are now " -"valid:" +">>> whille True:\n" +"... pass\n" +"Traceback (most recent call last):\n" +" File \"\", line 1\n" +" whille True:\n" +" ^^^^^^\n" +"SyntaxError: invalid syntax. Did you mean 'while'?" msgstr "" -#: ../../whatsnew/3.14.rst:465 +#: ../../whatsnew/3.14.rst:543 msgid "" -"try:\n" -" connect_to_server()\n" -"except TimeoutError, ConnectionRefusedError:\n" -" print(\"Network issue encountered.\")\n" -"\n" -" # The same applies to except* (for exception groups):\n" -"\n" -"try:\n" -" connect_to_server()\n" -"except* TimeoutError, ConnectionRefusedError:\n" -" print(\"Network issue encountered.\")" +"While the feature focuses on the most common cases, some variations of " +"misspellings may still result in regular syntax errors. (Contributed by " +"Pablo Galindo in :gh:`132449`.)" msgstr "" -#: ../../whatsnew/3.14.rst:479 -msgid "Check :pep:`758` for more details." +#: ../../whatsnew/3.14.rst:547 +msgid "" +":keyword:`elif` statements that follow an :keyword:`else` block now have a " +"specific error message. (Contributed by Steele Farnsworth in :gh:`129902`.)" msgstr "" -#: ../../whatsnew/3.14.rst:481 -msgid "(Contributed by Pablo Galindo and Brett Cannon in :gh:`131831`.)" -msgstr "(由 Pablo Galindo 和 Brett Cannon 於 :gh:`131831` 貢獻。)" - -#: ../../whatsnew/3.14.rst:484 -msgid ":pep:`758`." -msgstr ":pep:`758`。" - -#: ../../whatsnew/3.14.rst:490 -msgid "PEP 649 and 749: deferred evaluation of annotations" +#: ../../whatsnew/3.14.rst:551 +msgid "" +">>> if who == \"me\":\n" +"... print(\"It's me!\")\n" +"... else:\n" +"... print(\"It's not me!\")\n" +"... elif who is None:\n" +"... print(\"Who is it?\")\n" +"File \"\", line 5\n" +" elif who is None:\n" +" ^^^^\n" +"SyntaxError: 'elif' block follows an 'else' block" msgstr "" -#: ../../whatsnew/3.14.rst:492 +#: ../../whatsnew/3.14.rst:564 msgid "" -"The :term:`annotations ` on functions, classes, and modules are " -"no longer evaluated eagerly. Instead, annotations are stored in special-" -"purpose :term:`annotate functions ` and evaluated only " -"when necessary (except if ``from __future__ import annotations`` is used). " -"This is specified in :pep:`649` and :pep:`749`." +"If a statement is passed to the :ref:`if_expr` after :keyword:`else`, or one " +"of :keyword:`pass`, :keyword:`break`, or :keyword:`continue` is passed " +"before :keyword:`if`, then the error message highlights where the :token:" +"`~python-grammar:expression` is required. (Contributed by Sergey Miryanov " +"in :gh:`129515`.)" msgstr "" -#: ../../whatsnew/3.14.rst:498 -msgid "" -"This change is designed to make annotations in Python more performant and " -"more usable in most circumstances. The runtime cost for defining annotations " -"is minimized, but it remains possible to introspect annotations at runtime. " -"It is no longer necessary to enclose annotations in strings if they contain " -"forward references." -msgstr "" - -#: ../../whatsnew/3.14.rst:504 -msgid "" -"The new :mod:`annotationlib` module provides tools for inspecting deferred " -"annotations. Annotations may be evaluated in the :attr:`~annotationlib." -"Format.VALUE` format (which evaluates annotations to runtime values, similar " -"to the behavior in earlier Python versions), the :attr:`~annotationlib." -"Format.FORWARDREF` format (which replaces undefined names with special " -"markers), and the :attr:`~annotationlib.Format.STRING` format (which returns " -"annotations as strings)." -msgstr "" - -#: ../../whatsnew/3.14.rst:511 -msgid "This example shows how these formats behave:" -msgstr "" - -#: ../../whatsnew/3.14.rst:513 -msgid "" -">>> from annotationlib import get_annotations, Format\n" -">>> def func(arg: Undefined):\n" -"... pass\n" -">>> get_annotations(func, format=Format.VALUE)\n" -"Traceback (most recent call last):\n" -" ...\n" -"NameError: name 'Undefined' is not defined\n" -">>> get_annotations(func, format=Format.FORWARDREF)\n" -"{'arg': ForwardRef('Undefined', owner=)}\n" -">>> get_annotations(func, format=Format.STRING)\n" -"{'arg': 'Undefined'}" -msgstr "" - -#: ../../whatsnew/3.14.rst:528 -msgid "Implications for annotated code" -msgstr "" - -#: ../../whatsnew/3.14.rst:530 -msgid "" -"If you define annotations in your code (for example, for use with a static " -"type checker), then this change probably does not affect you: you can keep " -"writing annotations the same way you did with previous versions of Python." -msgstr "" - -#: ../../whatsnew/3.14.rst:534 -msgid "" -"You will likely be able to remove quoted strings in annotations, which are " -"frequently used for forward references. Similarly, if you use ``from " -"__future__ import annotations`` to avoid having to write strings in " -"annotations, you may well be able to remove that import once you support " -"only Python 3.14 and newer. However, if you rely on third-party libraries " -"that read annotations, those libraries may need changes to support unquoted " -"annotations before they work as expected." -msgstr "" - -#: ../../whatsnew/3.14.rst:543 -msgid "Implications for readers of ``__annotations__``" -msgstr "" - -#: ../../whatsnew/3.14.rst:545 -msgid "" -"If your code reads the ``__annotations__`` attribute on objects, you may " -"want to make changes in order to support code that relies on deferred " -"evaluation of annotations. For example, you may want to use :func:" -"`annotationlib.get_annotations` with the :attr:`~annotationlib.Format." -"FORWARDREF` format, as the :mod:`dataclasses` module now does." -msgstr "" - -#: ../../whatsnew/3.14.rst:551 -msgid "" -"The external :pypi:`typing_extensions` package provides partial backports of " -"some of the functionality of the :mod:`annotationlib` module, such as the :" -"class:`~annotationlib.Format` enum and the :func:`~annotationlib." -"get_annotations` function. These can be used to write cross-version code " -"that takes advantage of the new behavior in Python 3.14." -msgstr "" - -#: ../../whatsnew/3.14.rst:557 -msgid "Related changes" -msgstr "" - -#: ../../whatsnew/3.14.rst:559 -msgid "" -"The changes in Python 3.14 are designed to rework how ``__annotations__`` " -"works at runtime while minimizing breakage to code that contains annotations " -"in source code and to code that reads ``__annotations__``. However, if you " -"rely on undocumented details of the annotation behavior or on private " -"functions in the standard library, there are many ways in which your code " -"may not work in Python 3.14. To safeguard your code against future changes, " -"use only the documented functionality of the :mod:`annotationlib` module." -msgstr "" - -#: ../../whatsnew/3.14.rst:567 -msgid "" -"In particular, do not read annotations directly from the namespace " -"dictionary attribute of type objects. Use :func:`annotationlib." -"get_annotate_from_class_namespace` during class construction and :func:" -"`annotationlib.get_annotations` afterwards." -msgstr "" - -#: ../../whatsnew/3.14.rst:571 -msgid "" -"In previous releases, it was sometimes possible to access class annotations " -"from an instance of an annotated class. This behavior was undocumented and " -"accidental, and will no longer work in Python 3.14." -msgstr "" - -#: ../../whatsnew/3.14.rst:576 -msgid "``from __future__ import annotations``" -msgstr "" - -#: ../../whatsnew/3.14.rst:578 -msgid "" -"In Python 3.7, :pep:`563` introduced the ``from __future__ import " -"annotations`` directive, which turns all annotations into strings. This " -"directive is now considered deprecated and it is expected to be removed in a " -"future version of Python. However, this removal will not happen until after " -"Python 3.13, the last version of Python without deferred evaluation of " -"annotations, reaches its end of life in 2029. In Python 3.14, the behavior " -"of code using ``from __future__ import annotations`` is unchanged." -msgstr "" - -#: ../../whatsnew/3.14.rst:586 -msgid "" -"(Contributed by Jelle Zijlstra in :gh:`119180`; :pep:`649` was written by " -"Larry Hastings.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:589 -msgid ":pep:`649` and :pep:`749`." -msgstr "" - -#: ../../whatsnew/3.14.rst:593 -msgid "Improved error messages" -msgstr "改善錯誤訊息" - -#: ../../whatsnew/3.14.rst:595 -msgid "" -"The interpreter now provides helpful suggestions when it detects typos in " -"Python keywords. When a word that closely resembles a Python keyword is " -"encountered, the interpreter will suggest the correct keyword in the error " -"message. This feature helps programmers quickly identify and fix common " -"typing mistakes. For example:" -msgstr "" - -#: ../../whatsnew/3.14.rst:601 -msgid "" -">>> whille True:\n" -"... pass\n" -"Traceback (most recent call last):\n" -" File \"\", line 1\n" -" whille True:\n" -" ^^^^^^\n" -"SyntaxError: invalid syntax. Did you mean 'while'?\n" -"\n" -">>> asynch def fetch_data():\n" -"... pass\n" -"Traceback (most recent call last):\n" -" File \"\", line 1\n" -" asynch def fetch_data():\n" -" ^^^^^^\n" -"SyntaxError: invalid syntax. Did you mean 'async'?\n" -"\n" -">>> async def foo():\n" -"... awaid fetch_data()\n" -"Traceback (most recent call last):\n" -" File \"\", line 2\n" -" awaid fetch_data()\n" -" ^^^^^\n" -"SyntaxError: invalid syntax. Did you mean 'await'?\n" -"\n" -">>> raisee ValueError(\"Error\")\n" -"Traceback (most recent call last):\n" -" File \"\", line 1\n" -" raisee ValueError(\"Error\")\n" -" ^^^^^^\n" -"SyntaxError: invalid syntax. Did you mean 'raise'?" -msgstr "" - -#: ../../whatsnew/3.14.rst:634 -msgid "" -"While the feature focuses on the most common cases, some variations of " -"misspellings may still result in regular syntax errors. (Contributed by " -"Pablo Galindo in :gh:`132449`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:638 -msgid "" -"When an unpacking assignment fails due to an incorrect number of variables, " -"the error message prints the received number of values in more cases than " -"before. (Contributed by Tushar Sadhwani in :gh:`122239`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:642 -msgid "" -">>> x, y, z = 1, 2, 3, 4\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -" x, y, z = 1, 2, 3, 4\n" -" ^^^^^^^\n" -"ValueError: too many values to unpack (expected 3, got 4)" -msgstr "" - -#: ../../whatsnew/3.14.rst:651 -msgid "" -":keyword:`elif` statements that follow an :keyword:`else` block now have a " -"specific error message. (Contributed by Steele Farnsworth in :gh:`129902`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:654 -msgid "" -">>> if who == \"me\":\n" -"... print(\"It's me!\")\n" -"... else:\n" -"... print(\"It's not me!\")\n" -"... elif who is None:\n" -"... print(\"Who is it?\")\n" -"File \"\", line 5\n" -" elif who is None:\n" -" ^^^^\n" -"SyntaxError: 'elif' block follows an 'else' block" -msgstr "" - -#: ../../whatsnew/3.14.rst:667 -msgid "" -"If a statement (:keyword:`pass`, :keyword:`del`, :keyword:`return`, :keyword:" -"`yield`, :keyword:`raise`, :keyword:`break`, :keyword:`continue`, :keyword:" -"`assert`, :keyword:`import`, :keyword:`from`) is passed to the :ref:" -"`if_expr` after :keyword:`else`, or one of :keyword:`pass`, :keyword:" -"`break`, or :keyword:`continue` is passed before :keyword:`if`, then the " -"error message highlights where the :token:`~python-grammar:expression` is " -"required. (Contributed by Sergey Miryanov in :gh:`129515`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:675 +#: ../../whatsnew/3.14.rst:570 msgid "" ">>> x = 1 if True else pass\n" "Traceback (most recent call last):\n" @@ -980,27 +821,27 @@ msgid "" "SyntaxError: expected expression before 'if', but statement is given" msgstr "" -#: ../../whatsnew/3.14.rst:692 +#: ../../whatsnew/3.14.rst:586 msgid "" "When incorrectly closed strings are detected, the error message suggests " "that the string may be intended to be part of the string. (Contributed by " "Pablo Galindo in :gh:`88535`.)" msgstr "" -#: ../../whatsnew/3.14.rst:696 +#: ../../whatsnew/3.14.rst:590 msgid "" ">>> \"The interesting object \"The important object\" is very important\"\n" "Traceback (most recent call last):\n" "SyntaxError: invalid syntax. Is this intended to be part of the string?" msgstr "" -#: ../../whatsnew/3.14.rst:702 +#: ../../whatsnew/3.14.rst:596 msgid "" "When strings have incompatible prefixes, the error now shows which prefixes " "are incompatible. (Contributed by Nikita Sobolev in :gh:`133197`.)" msgstr "" -#: ../../whatsnew/3.14.rst:706 +#: ../../whatsnew/3.14.rst:600 msgid "" ">>> ub'abc'\n" " File \"\", line 1\n" @@ -1009,49 +850,40 @@ msgid "" "SyntaxError: 'u' and 'b' prefixes are incompatible" msgstr "" -#: ../../whatsnew/3.14.rst:714 +#: ../../whatsnew/3.14.rst:608 msgid "Improved error messages when using ``as`` with incompatible targets in:" msgstr "" -#: ../../whatsnew/3.14.rst:716 +#: ../../whatsnew/3.14.rst:610 msgid "Imports: ``import ... as ...``" msgstr "" -#: ../../whatsnew/3.14.rst:717 +#: ../../whatsnew/3.14.rst:611 msgid "From imports: ``from ... import ... as ...``" msgstr "" -#: ../../whatsnew/3.14.rst:718 +#: ../../whatsnew/3.14.rst:612 msgid "Except handlers: ``except ... as ...``" msgstr "" -#: ../../whatsnew/3.14.rst:719 +#: ../../whatsnew/3.14.rst:613 msgid "Pattern-match cases: ``case ... as ...``" msgstr "" -#: ../../whatsnew/3.14.rst:721 +#: ../../whatsnew/3.14.rst:615 msgid "" "(Contributed by Nikita Sobolev in :gh:`123539`, :gh:`123562`, and :gh:" "`123440`.)" msgstr "" -#: ../../whatsnew/3.14.rst:724 -msgid "" -">>> import ast as arr[0]\n" -" File \"\", line 1\n" -" import ast as arr[0]\n" -" ^^^^^^\n" -"SyntaxError: cannot use subscript as import target" -msgstr "" - -#: ../../whatsnew/3.14.rst:732 +#: ../../whatsnew/3.14.rst:617 msgid "" "Improved error message when trying to add an instance of an unhashable type " "to a :class:`dict` or :class:`set`. (Contributed by CF Bolz-Tereick and " "Victor Stinner in :gh:`132828`.)" msgstr "" -#: ../../whatsnew/3.14.rst:736 +#: ../../whatsnew/3.14.rst:621 msgid "" ">>> s = set()\n" ">>> s.add({'pages': 12, 'grade': 'A'})\n" @@ -1070,128 +902,137 @@ msgid "" "TypeError: cannot use 'list' as a dict key (unhashable type: 'list')" msgstr "" -#: ../../whatsnew/3.14.rst:758 -msgid "PEP 741: Python configuration C API" +#: ../../whatsnew/3.14.rst:639 +msgid "" +"Improved error message when an object supporting the synchronous context " +"manager protocol is entered using :keyword:`async with` instead of :keyword:" +"`with`, and vice versa for the asynchronous context manager protocol. " +"(Contributed by Bénédikt Tran in :gh:`128398`.)" msgstr "" -#: ../../whatsnew/3.14.rst:760 -msgid "" -"Add a :ref:`PyInitConfig C API ` to configure the Python " -"initialization without relying on C structures and the ability to make ABI-" -"compatible changes in the future." +#: ../../whatsnew/3.14.rst:649 +msgid ":pep:`784`: Zstandard support in the standard library" msgstr "" -#: ../../whatsnew/3.14.rst:764 +#: ../../whatsnew/3.14.rst:651 msgid "" -"Complete the :pep:`587` :ref:`PyConfig C API ` by adding :c:" -"func:`PyInitConfig_AddModule` which can be used to add a built-in extension " -"module; a feature previously referred to as the “inittab”." +"The new :mod:`!compression` package contains modules :mod:`!compression." +"lzma`, :mod:`!compression.bz2`, :mod:`!compression.gzip` and :mod:`!" +"compression.zlib` which re-export the :mod:`lzma`, :mod:`bz2`, :mod:`gzip` " +"and :mod:`zlib` modules respectively. The new import names under :mod:`!" +"compression` are the preferred names for importing these compression modules " +"from Python 3.14. However, the existing modules names have not been " +"deprecated. Any deprecation or removal of the existing compression modules " +"will occur no sooner than five years after the release of 3.14." msgstr "" -#: ../../whatsnew/3.14.rst:768 +#: ../../whatsnew/3.14.rst:660 msgid "" -"Add :c:func:`PyConfig_Get` and :c:func:`PyConfig_Set` functions to get and " -"set the current runtime configuration." +"The new :mod:`!compression.zstd` module provides compression and " +"decompression APIs for the Zstandard format via bindings to `Meta's zstd " +"library `__. Zstandard is a widely " +"adopted, highly efficient, and fast compression format. In addition to the " +"APIs introduced in :mod:`!compression.zstd`, support for reading and writing " +"Zstandard compressed archives has been added to the :mod:`tarfile`, :mod:" +"`zipfile`, and :mod:`shutil` modules." +msgstr "" + +#: ../../whatsnew/3.14.rst:668 +msgid "Here's an example of using the new module to compress some data:" msgstr "" -#: ../../whatsnew/3.14.rst:771 +#: ../../whatsnew/3.14.rst:670 msgid "" -"PEP 587 “Python Initialization Configuration” unified all the ways to " -"configure the Python initialization. This PEP unifies also the configuration " -"of the Python preinitialization and the Python initialization in a single " -"API. Moreover, this PEP only provides a single choice to embed Python, " -"instead of having two “Python” and “Isolated” choices (PEP 587), to simplify " -"the API further." +"from compression import zstd\n" +"import math\n" +"\n" +"data = str(math.pi).encode() * 20\n" +"compressed = zstd.compress(data)\n" +"ratio = len(compressed) / len(data)\n" +"print(f\"Achieved compression ratio of {ratio}\")" msgstr "" -#: ../../whatsnew/3.14.rst:778 +#: ../../whatsnew/3.14.rst:680 msgid "" -"The lower level PEP 587 PyConfig API remains available for use cases with an " -"intentionally higher level of coupling to CPython implementation details " -"(such as emulating the full functionality of CPython’s CLI, including its " -"configuration mechanisms)." +"As can be seen, the API is similar to the APIs of the :mod:`!lzma` and :mod:" +"`!bz2` modules." msgstr "" -#: ../../whatsnew/3.14.rst:783 ../../whatsnew/3.14.rst:2832 -#: ../../whatsnew/3.14.rst:2852 -msgid "(Contributed by Victor Stinner in :gh:`107954`.)" -msgstr "(由 Victor Stinner 於 :gh:`107954` 貢獻。)" +#: ../../whatsnew/3.14.rst:683 +msgid "" +"(Contributed by Emma Harper Smith, Adam Turner, Gregory P. Smith, Tomas " +"Roun, Victor Stinner, and Rogdham in :gh:`132983`.)" +msgstr "" -#: ../../whatsnew/3.14.rst:786 -msgid ":pep:`741`." +#: ../../whatsnew/3.14.rst:686 +msgid ":pep:`784`." msgstr "" -#: ../../whatsnew/3.14.rst:791 +#: ../../whatsnew/3.14.rst:692 msgid "Asyncio introspection capabilities" msgstr "" -#: ../../whatsnew/3.14.rst:793 +#: ../../whatsnew/3.14.rst:694 msgid "" "Added a new command-line interface to inspect running Python processes using " -"asynchronous tasks, available via:" +"asynchronous tasks, available via ``python -m asyncio ps PID`` or ``python -" +"m asyncio pstree PID``." msgstr "" -#: ../../whatsnew/3.14.rst:796 -msgid "python -m asyncio ps PID" -msgstr "" - -#: ../../whatsnew/3.14.rst:800 +#: ../../whatsnew/3.14.rst:698 msgid "" -"This tool inspects the given process ID (PID) and displays information about " -"currently running asyncio tasks. It outputs a task table: a flat listing of " -"all tasks, their names, their coroutine stacks, and which tasks are awaiting " -"them." -msgstr "" - -#: ../../whatsnew/3.14.rst:805 -msgid "python -m asyncio pstree PID" +"The ``ps`` subcommand inspects the given process ID (PID) and displays " +"information about currently running asyncio tasks. It outputs a task table: " +"a flat listing of all tasks, their names, their coroutine stacks, and which " +"tasks are awaiting them." msgstr "" -#: ../../whatsnew/3.14.rst:809 +#: ../../whatsnew/3.14.rst:704 msgid "" -"This tool fetches the same information, but renders a visual async call " -"tree, showing coroutine relationships in a hierarchical format. This " -"command is particularly useful for debugging long-running or stuck " -"asynchronous programs. It can help developers quickly identify where a " +"The ``pstree`` subcommand fetches the same information, but instead renders " +"a visual async call tree, showing coroutine relationships in a hierarchical " +"format. This command is particularly useful for debugging long-running or " +"stuck asynchronous programs. It can help developers quickly identify where a " "program is blocked, what tasks are pending, and how coroutines are chained " "together." msgstr "" -#: ../../whatsnew/3.14.rst:815 +#: ../../whatsnew/3.14.rst:711 msgid "For example given this code:" msgstr "" -#: ../../whatsnew/3.14.rst:817 +#: ../../whatsnew/3.14.rst:713 msgid "" "import asyncio\n" "\n" -"async def play(track):\n" +"async def play_track(track):\n" " await asyncio.sleep(5)\n" -" print(f\"🎵 Finished: {track}\")\n" +" print(f'🎵 Finished: {track}')\n" "\n" -"async def album(name, tracks):\n" +"async def play_album(name, tracks):\n" " async with asyncio.TaskGroup() as tg:\n" " for track in tracks:\n" -" tg.create_task(play(track), name=track)\n" +" tg.create_task(play_track(track), name=track)\n" "\n" "async def main():\n" " async with asyncio.TaskGroup() as tg:\n" " tg.create_task(\n" -" album(\"Sundowning\", [\"TNDNBTG\", \"Levitate\"]), " -"name=\"Sundowning\")\n" +" play_album('Sundowning', ['TNDNBTG', 'Levitate']),\n" +" name='Sundowning')\n" " tg.create_task(\n" -" album(\"TMBTE\", [\"DYWTYLM\", \"Aqua Regia\"]), name=\"TMBTE\")\n" +" play_album('TMBTE', ['DYWTYLM', 'Aqua Regia']),\n" +" name='TMBTE')\n" "\n" -"if __name__ == \"__main__\":\n" +"if __name__ == '__main__':\n" " asyncio.run(main())" msgstr "" -#: ../../whatsnew/3.14.rst:840 +#: ../../whatsnew/3.14.rst:738 msgid "" "Executing the new tool on the running process will yield a table like this:" msgstr "" -#: ../../whatsnew/3.14.rst:842 +#: ../../whatsnew/3.14.rst:740 msgid "" "python -m asyncio ps 12345\n" "\n" @@ -1223,11 +1064,11 @@ msgid "" "__aexit__ -> album TMBTE 0x7fc93173fa50" msgstr "" -#: ../../whatsnew/3.14.rst:856 +#: ../../whatsnew/3.14.rst:754 msgid "or a tree like this:" msgstr "" -#: ../../whatsnew/3.14.rst:858 +#: ../../whatsnew/3.14.rst:756 msgid "" "python -m asyncio pstree 12345\n" "\n" @@ -1243,533 +1084,381 @@ msgid "" "py:121\n" " │ ├── (T) TNDNBTG\n" " │ │ └── play example.py:4\n" -" │ │ └── sleep Lib/asyncio/tasks.py:702\n" -" │ └── (T) Levitate\n" -" │ └── play example.py:4\n" -" │ └── sleep Lib/asyncio/tasks.py:702\n" -" └── (T) TMBTE\n" -" └── album example.py:8\n" -" └── TaskGroup.__aexit__ Lib/asyncio/taskgroups." -"py:72\n" -" └── TaskGroup._aexit Lib/asyncio/taskgroups." -"py:121\n" -" ├── (T) DYWTYLM\n" -" │ └── play example.py:4\n" -" │ └── sleep Lib/asyncio/tasks.py:702\n" -" └── (T) Aqua Regia\n" -" └── play example.py:4\n" -" └── sleep Lib/asyncio/tasks.py:702" -msgstr "" - -#: ../../whatsnew/3.14.rst:887 -msgid "" -"If a cycle is detected in the async await graph (which could indicate a " -"programming issue), the tool raises an error and lists the cycle paths that " -"prevent tree construction:" -msgstr "" - -#: ../../whatsnew/3.14.rst:891 -msgid "" -"python -m asyncio pstree 12345\n" -"\n" -"ERROR: await-graph contains cycles - cannot print a tree!\n" -"\n" -"cycle: Task-2 → Task-3 → Task-2" -msgstr "" - -#: ../../whatsnew/3.14.rst:899 -msgid "" -"(Contributed by Pablo Galindo, Łukasz Langa, Yury Selivanov, and Marta Gomez " -"Macias in :gh:`91048`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:905 -msgid "A new type of interpreter" -msgstr "" - -#: ../../whatsnew/3.14.rst:907 -msgid "" -"A new type of interpreter has been added to CPython. It uses tail calls " -"between small C functions that implement individual Python opcodes, rather " -"than one large C case statement. For certain newer compilers, this " -"interpreter provides significantly better performance. Preliminary numbers " -"on our machines suggest anywhere up to 30% faster Python code, and a " -"geometric mean of 3-5% faster on ``pyperformance`` depending on platform and " -"architecture. The baseline is Python 3.14 built with Clang 19 without this " -"new interpreter." -msgstr "" - -#: ../../whatsnew/3.14.rst:916 -msgid "" -"This interpreter currently only works with Clang 19 and newer on x86-64 and " -"AArch64 architectures. However, we expect that a future release of GCC will " -"support this as well." -msgstr "" - -#: ../../whatsnew/3.14.rst:920 -msgid "" -"This feature is opt-in for now. We highly recommend enabling profile-guided " -"optimization with the new interpreter as it is the only configuration we " -"have tested and can validate its improved performance. For further " -"information on how to build Python, see :option:`--with-tail-call-interp`." -msgstr "" - -#: ../../whatsnew/3.14.rst:928 -msgid "" -"This is not to be confused with `tail call optimization`__ of Python " -"functions, which is currently not implemented in CPython." -msgstr "" - -#: ../../whatsnew/3.14.rst:931 -msgid "" -"This new interpreter type is an internal implementation detail of the " -"CPython interpreter. It doesn't change the visible behavior of Python " -"programs at all. It can improve their performance, but doesn't change " -"anything else." -msgstr "" - -#: ../../whatsnew/3.14.rst:939 -msgid "" -"This section previously reported a 9-15% geometric mean speedup. This number " -"has since been cautiously revised down to 3-5%. While we expect performance " -"results to be better than what we report, our estimates are more " -"conservative due to a `compiler bug `_ found in Clang/LLVM 19, which causes the normal interpreter " -"to be slower. We were unaware of this bug, resulting in inaccurate results. " -"We sincerely apologize for communicating results that were only accurate for " -"LLVM v19.1.x and v20.1.0. In the meantime, the bug has been fixed in LLVM " -"v20.1.1 and for the upcoming v21.1, but it will remain unfixed for LLVM " -"v19.1.x and v20.1.0. Thus any benchmarks with those versions of LLVM may " -"produce inaccurate numbers. (Thanks to Nelson Elhage for bringing this to " -"light.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:951 -msgid "" -"(Contributed by Ken Jin in :gh:`128563`, with ideas on how to implement this " -"in CPython by Mark Shannon, Garrett Gu, Haoran Xu, and Josh Haberman.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:957 -msgid "Free-threaded mode" -msgstr "" - -#: ../../whatsnew/3.14.rst:959 -msgid "" -"Free-threaded mode (:pep:`703`), initially added in 3.13, has been " -"significantly improved. The implementation described in PEP 703 was " -"finished, including C API changes, and temporary workarounds in the " -"interpreter were replaced with more permanent solutions. The specializing " -"adaptive interpreter (:pep:`659`) is now enabled in free-threaded mode, " -"which along with many other optimizations greatly improves its performance. " -"The performance penalty on single-threaded code in free-threaded mode is now " -"roughly 5-10%, depending on platform and C compiler used." -msgstr "" - -#: ../../whatsnew/3.14.rst:967 -msgid "" -"This work was done by many contributors: Sam Gross, Matt Page, Neil " -"Schemenauer, Thomas Wouters, Donghee Na, Kirill Podoprigora, Ken Jin, Itamar " -"Oren, Brett Simmers, Dino Viehland, Nathan Goldbaum, Ralf Gommers, Lysandros " -"Nikolaou, Kumar Aditya, Edgar Margffoy, and many others." -msgstr "" - -#: ../../whatsnew/3.14.rst:972 -msgid "" -"Some of these contributors are employed by Meta, which has continued to " -"provide significant engineering resources to support this project." -msgstr "" - -#: ../../whatsnew/3.14.rst:975 -msgid "" -"From 3.14, when compiling extension modules for the free-threaded build of " -"CPython on Windows, the preprocessor variable ``Py_GIL_DISABLED`` now needs " -"to be specified by the build backend, as it will no longer be determined " -"automatically by the C compiler. For a running interpreter, the setting that " -"was used at compile time can be found using :func:`sysconfig.get_config_var`." -msgstr "" - -#: ../../whatsnew/3.14.rst:981 -msgid "" -"A new flag has been added, :data:`~sys.flags.context_aware_warnings`. This " -"flag defaults to true for the free-threaded build and false for the GIL-" -"enabled build. If the flag is true then the :class:`warnings.catch_warnings` " -"context manager uses a context variable for warning filters. This makes the " -"context manager behave predictably when used with multiple threads or " -"asynchronous tasks." -msgstr "" - -#: ../../whatsnew/3.14.rst:988 -msgid "" -"A new flag has been added, :data:`~sys.flags.thread_inherit_context`. This " -"flag defaults to true for the free-threaded build and false for the GIL-" -"enabled build. If the flag is true then threads created with :class:" -"`threading.Thread` start with a copy of the :class:`~contextvars.Context()` " -"of the caller of :meth:`~threading.Thread.start`. Most significantly, this " -"makes the warning filtering context established by :class:`~warnings." -"catch_warnings` be \"inherited\" by threads (or asyncio tasks) started " -"within that context. It also affects other modules that use context " -"variables, such as the :mod:`decimal` context manager." -msgstr "" - -#: ../../whatsnew/3.14.rst:1002 -msgid "Syntax highlighting in PyREPL" -msgstr "" - -#: ../../whatsnew/3.14.rst:1004 -msgid "" -"The default :term:`interactive` shell now highlights Python syntax as you " -"type. The feature is enabled by default unless the :envvar:" -"`PYTHON_BASIC_REPL` environment is set or any color-disabling environment " -"variables are used. See :ref:`using-on-controlling-color` for details." -msgstr "" - -#: ../../whatsnew/3.14.rst:1010 -msgid "" -"The default color theme for syntax highlighting strives for good contrast " -"and uses exclusively the 4-bit VGA standard ANSI color codes for maximum " -"compatibility. The theme can be customized using an experimental API " -"``_colorize.set_theme()``. This can be called interactively, as well as in " -"the :envvar:`PYTHONSTARTUP` script." -msgstr "" - -#: ../../whatsnew/3.14.rst:1016 -msgid "(Contributed by Łukasz Langa in :gh:`131507`.)" -msgstr "(由 Łukasz Langa 於 :gh:`131507` 貢獻。)" - -#: ../../whatsnew/3.14.rst:1022 -msgid "Binary releases for the experimental just-in-time compiler" -msgstr "" - -#: ../../whatsnew/3.14.rst:1024 -msgid "" -"The official macOS and Windows release binaries now include an " -"*experimental* just-in-time (JIT) compiler. Although it is **not** " -"recommended for production use, it can be tested by setting :envvar:" -"`PYTHON_JIT=1 ` as an environment variable. Downstream source " -"builds and redistributors can use the :option:`--enable-experimental-jit=yes-" -"off` configuration option for similar behavior." +" │ │ └── sleep Lib/asyncio/tasks.py:702\n" +" │ └── (T) Levitate\n" +" │ └── play example.py:4\n" +" │ └── sleep Lib/asyncio/tasks.py:702\n" +" └── (T) TMBTE\n" +" └── album example.py:8\n" +" └── TaskGroup.__aexit__ Lib/asyncio/taskgroups." +"py:72\n" +" └── TaskGroup._aexit Lib/asyncio/taskgroups." +"py:121\n" +" ├── (T) DYWTYLM\n" +" │ └── play example.py:4\n" +" │ └── sleep Lib/asyncio/tasks.py:702\n" +" └── (T) Aqua Regia\n" +" └── play example.py:4\n" +" └── sleep Lib/asyncio/tasks.py:702" msgstr "" -#: ../../whatsnew/3.14.rst:1031 +#: ../../whatsnew/3.14.rst:785 msgid "" -"The JIT is at an early stage and still in active development. As such, the " -"typical performance impact of enabling it can range from 10% slower to 20% " -"faster, depending on workload. To aid in testing and evaluation, a set of " -"introspection functions has been provided in the :data:`sys._jit` " -"namespace. :func:`sys._jit.is_available` can be used to determine if the " -"current executable supports JIT compilation, while :func:`sys._jit." -"is_enabled` can be used to tell if JIT compilation has been enabled for the " -"current process." +"If a cycle is detected in the async await graph (which could indicate a " +"programming issue), the tool raises an error and lists the cycle paths that " +"prevent tree construction:" msgstr "" -#: ../../whatsnew/3.14.rst:1039 +#: ../../whatsnew/3.14.rst:789 msgid "" -"Currently, the most significant missing functionality is that native " -"debuggers and profilers like ``gdb`` and ``perf`` are unable to unwind " -"through JIT frames (Python debuggers and profilers, like :mod:`pdb` or :mod:" -"`profile`, continue to work without modification). Free-threaded builds do " -"not support JIT compilation." +"python -m asyncio pstree 12345\n" +"\n" +"ERROR: await-graph contains cycles - cannot print a tree!\n" +"\n" +"cycle: Task-2 → Task-3 → Task-2" msgstr "" -#: ../../whatsnew/3.14.rst:1044 +#: ../../whatsnew/3.14.rst:797 msgid "" -"Please report any bugs or major performance regressions that you encounter!" +"(Contributed by Pablo Galindo, Łukasz Langa, Yury Selivanov, and Marta Gomez " +"Macias in :gh:`91048`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1046 -msgid ":pep:`744`" -msgstr ":pep:`744`" - -#: ../../whatsnew/3.14.rst:1049 +#: ../../whatsnew/3.14.rst:804 msgid "Concurrent safe warnings control" msgstr "" -#: ../../whatsnew/3.14.rst:1051 +#: ../../whatsnew/3.14.rst:806 msgid "" "The :class:`warnings.catch_warnings` context manager will now optionally use " -"a context variable for warning filters. This is enabled by setting the :" -"data:`~sys.flags.context_aware_warnings` flag, either with the ``-X`` " -"command-line option or an environment variable. This gives predictable " -"warnings control when using :class:`~warnings.catch_warnings` combined with " -"multiple threads or asynchronous tasks. The flag defaults to true for the " -"free-threaded build and false for the GIL-enabled build." +"a context variable for warning filters. This is enabled by setting the :data:" +"`~sys.flags.context_aware_warnings` flag, either with the ``-X`` command-" +"line option or an environment variable. This gives predictable warnings " +"control when using :class:`~warnings.catch_warnings` combined with multiple " +"threads or asynchronous tasks. The flag defaults to true for the free-" +"threaded build and false for the GIL-enabled build." msgstr "" -#: ../../whatsnew/3.14.rst:1059 +#: ../../whatsnew/3.14.rst:814 msgid "(Contributed by Neil Schemenauer and Kumar Aditya in :gh:`130010`.)" msgstr "(由 Neil Schemenauer 和 Kumar Aditya 於 :gh:`130010` 貢獻。)" -#: ../../whatsnew/3.14.rst:1064 -msgid "Incremental garbage collection" +#: ../../whatsnew/3.14.rst:818 +msgid "Other language changes" msgstr "" -#: ../../whatsnew/3.14.rst:1066 +#: ../../whatsnew/3.14.rst:820 msgid "" -"The cycle garbage collector is now incremental. This means that maximum " -"pause times are reduced by an order of magnitude or more for larger heaps." +"All Windows code pages are now supported as 'cpXXX' codecs on Windows. " +"(Contributed by Serhiy Storchaka in :gh:`123803`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1070 +#: ../../whatsnew/3.14.rst:823 msgid "" -"There are now only two generations: young and old. When :func:`gc.collect` " -"is not called directly, the GC is invoked a little less frequently. When " -"invoked, it collects the young generation and an increment of the old " -"generation, instead of collecting one or more generations." -msgstr "" - -#: ../../whatsnew/3.14.rst:1076 -msgid "The behavior of :func:`!gc.collect` changes slightly:" +"Implement mixed-mode arithmetic rules combining real and complex numbers as " +"specified by the C standard since C99. (Contributed by Sergey B Kirpichev " +"in :gh:`69639`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1078 ../../whatsnew/3.14.rst:3145 +#: ../../whatsnew/3.14.rst:827 msgid "" -"``gc.collect(1)``: Performs an increment of garbage collection, rather than " -"collecting generation 1." +"More syntax errors are now detected regardless of optimisation and the :" +"option:`-O` command-line option. This includes writes to ``__debug__``, " +"incorrect use of :keyword:`await`, and asynchronous comprehensions outside " +"asynchronous functions. For example, ``python -O -c 'assert (__debug__ := " +"1)'`` or ``python -O -c 'assert await 1'`` now produce :exc:`SyntaxError`\\ " +"s. (Contributed by Irit Katriel and Jelle Zijlstra in :gh:`122245` & :gh:" +"`121637`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1080 ../../whatsnew/3.14.rst:3147 -msgid "Other calls to :func:`!gc.collect` are unchanged." +#: ../../whatsnew/3.14.rst:835 +msgid "" +"When subclassing a pure C type, the C slots for the new type are no longer " +"replaced with a wrapped version on class creation if they are not explicitly " +"overridden in the subclass. (Contributed by Tomasz Pytel in :gh:`132284`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1082 ../../whatsnew/3.14.rst:2332 -msgid "(Contributed by Mark Shannon in :gh:`108362`.)" -msgstr "(由 Mark Shannon 於 :gh:`108362` 貢獻。)" - -#: ../../whatsnew/3.14.rst:1085 -msgid "Platform support" +#: ../../whatsnew/3.14.rst:842 +msgid "Built-ins" msgstr "" -#: ../../whatsnew/3.14.rst:1087 +#: ../../whatsnew/3.14.rst:844 msgid "" -":pep:`776`: Emscripten is now an officially supported platform at :pep:`tier " -"3 <11#tier-3>`. As a part of this effort, more than 25 bugs in `Emscripten " -"libc`__ were fixed. Emscripten now includes support for :mod:`ctypes`, :mod:" -"`termios`, and :mod:`fcntl`, as well as experimental support for :ref:" -"`PyREPL `." +"The :meth:`bytes.fromhex` and :meth:`bytearray.fromhex` methods now accept " +"ASCII :class:`bytes` and :term:`bytes-like objects `. " +"(Contributed by Daniel Pope in :gh:`129349`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1093 +#: ../../whatsnew/3.14.rst:848 msgid "" -"(Contributed by R. Hood Chatham in :gh:`127146`, :gh:`127683`, and :gh:" -"`136931`.)" +"Add class methods :meth:`float.from_number` and :meth:`complex.from_number` " +"to convert a number to :class:`float` or :class:`complex` type " +"correspondingly. They raise a :exc:`TypeError` if the argument is not a real " +"number. (Contributed by Serhiy Storchaka in :gh:`84978`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1098 -msgid "Other language changes" +#: ../../whatsnew/3.14.rst:853 +msgid "" +"Support underscore and comma as thousands separators in the fractional part " +"for floating-point presentation types of the new-style string formatting " +"(with :func:`format` or :ref:`f-strings`). (Contributed by Sergey B " +"Kirpichev in :gh:`87790`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1100 +#: ../../whatsnew/3.14.rst:858 msgid "" -"The default :term:`interactive` shell now supports import autocompletion. " -"This means that typing ``import foo`` and pressing ```` will suggest " -"modules starting with ``foo``. Similarly, typing ``from foo import b`` will " -"suggest submodules of ``foo`` starting with ``b``. Note that autocompletion " -"of module attributes is not currently supported. (Contributed by Tomas Roun " -"in :gh:`69605`.)" +"The :func:`int` function no longer delegates to :meth:`~object.__trunc__`. " +"Classes that want to support conversion to :func:`!int` must implement " +"either :meth:`~object.__int__` or :meth:`~object.__index__`. (Contributed by " +"Mark Dickinson in :gh:`119743`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1107 +#: ../../whatsnew/3.14.rst:863 msgid "" -"The :func:`map` built-in now has an optional keyword-only *strict* flag " +"The :func:`map` function now has an optional keyword-only *strict* flag " "like :func:`zip` to check that all the iterables are of equal length. " "(Contributed by Wannes Boeykens in :gh:`119793`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1111 +#: ../../whatsnew/3.14.rst:867 msgid "" -"Incorrect usage of :keyword:`await` and asynchronous comprehensions is now " -"detected even if the code is optimized away by the :option:`-O` command-line " -"option. For example, ``python -O -c 'assert await 1'`` now produces a :exc:" -"`SyntaxError`. (Contributed by Jelle Zijlstra in :gh:`121637`.)" +"The :class:`memoryview` type now supports subscription, making it a :term:" +"`generic type`. (Contributed by Brian Schubert in :gh:`126012`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1116 +#: ../../whatsnew/3.14.rst:871 msgid "" -"Writes to ``__debug__`` are now detected even if the code is optimized away " -"by the :option:`-O` command-line option. For example, ``python -O -c 'assert " -"(__debug__ := 1)'`` now produces a :exc:`SyntaxError`. (Contributed by Irit " -"Katriel in :gh:`122245`.)" +"Using :data:`NotImplemented` in a boolean context will now raise a :exc:" +"`TypeError`. This has raised a :exc:`DeprecationWarning` since Python 3.9. " +"(Contributed by Jelle Zijlstra in :gh:`118767`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1121 +#: ../../whatsnew/3.14.rst:876 msgid "" -"Add class methods :meth:`float.from_number` and :meth:`complex.from_number` " -"to convert a number to :class:`float` or :class:`complex` type " -"correspondingly. They raise an error if the argument is a string. " -"(Contributed by Serhiy Storchaka in :gh:`84978`.)" +"Three-argument :func:`pow` now tries calling :meth:`~object.__rpow__` if " +"necessary. Previously it was only called in two-argument :func:`!pow` and " +"the binary power operator. (Contributed by Serhiy Storchaka in :gh:`130104`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1126 +#: ../../whatsnew/3.14.rst:882 msgid "" -"Implement mixed-mode arithmetic rules combining real and complex numbers as " -"specified by C standards since C99. (Contributed by Sergey B Kirpichev in :" -"gh:`69639`.)" +":class:`super` objects are now :mod:`copyable ` and :mod:`pickleable " +"`. (Contributed by Serhiy Storchaka in :gh:`125767`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1130 -msgid "" -"All Windows code pages are now supported as \"cpXXX\" codecs on Windows. " -"(Contributed by Serhiy Storchaka in :gh:`123803`.)" +#: ../../whatsnew/3.14.rst:888 +msgid "Command line and environment" msgstr "" -#: ../../whatsnew/3.14.rst:1133 +#: ../../whatsnew/3.14.rst:890 msgid "" -":class:`super` objects are now :mod:`pickleable ` and :mod:`copyable " -"`. (Contributed by Serhiy Storchaka in :gh:`125767`.)" +"The import time flag can now track modules that are already loaded " +"('cached'), via the new :option:`-X importtime=2 <-X>`. When such a module " +"is imported, the ``self`` and ``cumulative`` times are replaced by the " +"string ``cached``." msgstr "" -#: ../../whatsnew/3.14.rst:1137 +#: ../../whatsnew/3.14.rst:895 msgid "" -"The :class:`memoryview` type now supports subscription, making it a :term:" -"`generic type`. (Contributed by Brian Schubert in :gh:`126012`.)" +"Values above ``2`` for ``-X importtime`` are now reserved for future use." msgstr "" -#: ../../whatsnew/3.14.rst:1141 +#: ../../whatsnew/3.14.rst:897 +#, fuzzy +msgid "(Contributed by Noah Kim and Adam Turner in :gh:`118655`.)" +msgstr "(由 Kumar Aditya 於 :gh:`126353` 貢獻。)" + +#: ../../whatsnew/3.14.rst:899 msgid "" -"Support underscore and comma as thousands separators in the fractional part " -"for floating-point presentation types of the new-style string formatting " -"(with :func:`format` or :ref:`f-strings`). (Contributed by Sergey B " -"Kirpichev in :gh:`87790`.)" +"The command-line option :option:`-c` now automatically dedents its code " +"argument before execution. The auto-dedentation behavior mirrors :func:" +"`textwrap.dedent`. (Contributed by Jon Crall and Steven Sun in :gh:`103998`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1146 +#: ../../whatsnew/3.14.rst:904 msgid "" -"The :func:`bytes.fromhex` and :func:`bytearray.fromhex` methods now accept " -"ASCII :class:`bytes` and :term:`bytes-like objects `. " -"(Contributed by Daniel Pope in :gh:`129349`.)" +":option:`!-J` is no longer a reserved flag for Jython_, and now has no " +"special meaning. (Contributed by Adam Turner in :gh:`133336`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1150 -msgid "" -"Support ``\\z`` as a synonym for ``\\Z`` in :mod:`regular expressions `. " -"It is interpreted unambiguously in many other regular expression engines, " -"unlike ``\\Z``, which has subtly different behavior. (Contributed by Serhiy " -"Storchaka in :gh:`133306`.)" +#: ../../whatsnew/3.14.rst:914 +msgid "PEP 758: Allow ``except`` and ``except*`` expressions without brackets" msgstr "" -#: ../../whatsnew/3.14.rst:1155 +#: ../../whatsnew/3.14.rst:916 msgid "" -"``\\B`` in :mod:`regular expression ` now matches the empty input " -"string. Now it is always the opposite of ``\\b``. (Contributed by Serhiy " -"Storchaka in :gh:`124130`.)" +"The :keyword:`except` and :keyword:`except* ` expressions now " +"allow brackets to be omitted when there are multiple exception types and the " +"``as`` clause is not used. For example:" msgstr "" -#: ../../whatsnew/3.14.rst:1159 +#: ../../whatsnew/3.14.rst:921 msgid "" -"iOS and macOS apps can now be configured to redirect ``stdout`` and " -"``stderr`` content to the system log. (Contributed by Russell Keith-Magee " -"in :gh:`127592`.)" +"try:\n" +" connect_to_server()\n" +"except TimeoutError, ConnectionRefusedError:\n" +" print('The network has ceased to be!')" msgstr "" -#: ../../whatsnew/3.14.rst:1163 +#: ../../whatsnew/3.14.rst:928 +#, fuzzy msgid "" -"The iOS testbed is now able to stream test output while the test is running. " -"The testbed can also be used to run the test suite of projects other than " -"CPython itself. (Contributed by Russell Keith-Magee in :gh:`127592`.)" +"(Contributed by Pablo Galindo and Brett Cannon in :pep:`758` and :gh:" +"`131831`.)" +msgstr "(由 Pablo Galindo 和 Brett Cannon 於 :gh:`131831` 貢獻。)" + +#: ../../whatsnew/3.14.rst:934 +msgid "PEP 765: Control flow in :keyword:`finally` blocks" msgstr "" -#: ../../whatsnew/3.14.rst:1167 +#: ../../whatsnew/3.14.rst:936 msgid "" -"Three-argument :func:`pow` now tries calling :meth:`~object.__rpow__` if " -"necessary. Previously it was only called in two-argument :func:`!pow` and " -"the binary power operator. (Contributed by Serhiy Storchaka in :gh:`130104`.)" +"The compiler now emits a :exc:`SyntaxWarning` when a :keyword:`return`, :" +"keyword:`break`, or :keyword:`continue` statement have the effect of leaving " +"a :keyword:`finally` block. This change is specified in :pep:`765`." msgstr "" -#: ../../whatsnew/3.14.rst:1172 +#: ../../whatsnew/3.14.rst:941 msgid "" -"Add a built-in implementation for HMAC (:rfc:`2104`) using formally verified " -"code from the `HACL* `__ project. " -"This implementation is used as a fallback when the OpenSSL implementation of " -"HMAC is not available. (Contributed by Bénédikt Tran in :gh:`99108`.)" +"In situations where this change is inconvenient (such as those where the " +"warnings are redundant due to code linting), the :ref:`warning filter " +"` can be used to turn off all syntax warnings by adding " +"``ignore::SyntaxWarning`` as a filter. This can be specified in combination " +"with a filter that converts other warnings to errors (for example, passing " +"``-Werror -Wignore::SyntaxWarning`` as CLI options, or setting " +"``PYTHONWARNINGS=error,ignore::SyntaxWarning``)." msgstr "" -#: ../../whatsnew/3.14.rst:1178 +#: ../../whatsnew/3.14.rst:949 msgid "" -"The import time flag can now track modules that are already loaded " -"('cached'), via the new :option:`-X importtime=2 <-X>`. When such a module " -"is imported, the ``self`` and ``cumulative`` times are replaced by the " -"string ``cached``. Values above ``2`` for ``-X importtime`` are now reserved " -"for future use. (Contributed by Noah Kim and Adam Turner in :gh:`118655`.)" +"Note that applying such a filter at runtime using the :mod:`warnings` module " +"will only suppress the warning in code that is compiled *after* the filter " +"is adjusted. Code that is compiled prior to the filter adjustment (for " +"example, when a module is imported) will still emit the syntax warning." msgstr "" -#: ../../whatsnew/3.14.rst:1185 -msgid "" -"When subclassing from a pure C type, the C slots for the new type are no " -"longer replaced with a wrapped version on class creation if they are not " -"explicitly overridden in the subclass. (Contributed by Tomasz Pytel in :gh:" -"`132329`.)" +#: ../../whatsnew/3.14.rst:954 +#, fuzzy +msgid "(Contributed by Irit Katriel in :gh:`130080`.)" +msgstr "(由 Victor Stinner 於 :gh:`120389` 貢獻。)" + +#: ../../whatsnew/3.14.rst:960 +msgid "Incremental garbage collection" msgstr "" -#: ../../whatsnew/3.14.rst:1190 +#: ../../whatsnew/3.14.rst:962 msgid "" -"The command-line option :option:`-c` now automatically dedents its code " -"argument before execution. The auto-dedentation behavior mirrors :func:" -"`textwrap.dedent`. (Contributed by Jon Crall and Steven Sun in :gh:`103998`.)" +"The cycle garbage collector is now incremental. This means that maximum " +"pause times are reduced by an order of magnitude or more for larger heaps." msgstr "" -#: ../../whatsnew/3.14.rst:1195 +#: ../../whatsnew/3.14.rst:966 msgid "" -"Improve error message when an object supporting the synchronous context " -"manager protocol is entered using :keyword:`async with` instead of :keyword:" -"`with`. And vice versa with the asynchronous context manager protocol. " -"(Contributed by Bénédikt Tran in :gh:`128398`.)" +"There are now only two generations: young and old. When :func:`gc.collect` " +"is not called directly, the GC is invoked a little less frequently. When " +"invoked, it collects the young generation and an increment of the old " +"generation, instead of collecting one or more generations." msgstr "" -#: ../../whatsnew/3.14.rst:1201 -msgid "" -":option:`!-J` is no longer a reserved flag for Jython_, and now has no " -"special meaning. (Contributed by Adam Turner in :gh:`133336`.)" +#: ../../whatsnew/3.14.rst:972 +msgid "The behavior of :func:`!gc.collect` changes slightly:" msgstr "" -#: ../../whatsnew/3.14.rst:1207 +#: ../../whatsnew/3.14.rst:974 ../../whatsnew/3.14.rst:3267 msgid "" -"The :func:`int` built-in no longer delegates to :meth:`~object.__trunc__`. " -"Classes that want to support conversion to :func:`!int` must implement " -"either :meth:`~object.__int__` or :meth:`~object.__index__`. (Contributed by " -"Mark Dickinson in :gh:`119743`.)" +"``gc.collect(1)``: Performs an increment of garbage collection, rather than " +"collecting generation 1." msgstr "" -#: ../../whatsnew/3.14.rst:1212 +#: ../../whatsnew/3.14.rst:976 ../../whatsnew/3.14.rst:3269 +msgid "Other calls to :func:`!gc.collect` are unchanged." +msgstr "" + +#: ../../whatsnew/3.14.rst:978 ../../whatsnew/3.14.rst:2236 +msgid "(Contributed by Mark Shannon in :gh:`108362`.)" +msgstr "(由 Mark Shannon 於 :gh:`108362` 貢獻。)" + +#: ../../whatsnew/3.14.rst:982 +msgid "Default interactive shell" +msgstr "" + +#: ../../whatsnew/3.14.rst:986 msgid "" -"Using :data:`NotImplemented` in a boolean context will now raise a :exc:" -"`TypeError`. This has raised a :exc:`DeprecationWarning` since Python 3.9. " -"(Contributed by Jelle Zijlstra in :gh:`118767`.)" +"The default :term:`interactive` shell now highlights Python syntax. The " +"feature is enabled by default, save if :envvar:`PYTHON_BASIC_REPL` or any " +"other environment variable that disables colour is set. See :ref:`using-on-" +"controlling-color` for details." msgstr "" -#: ../../whatsnew/3.14.rst:1221 +#: ../../whatsnew/3.14.rst:991 msgid "" -"PEP 765: Disallow ``return``/``break``/``continue`` that exit a ``finally`` " -"block" +"The default color theme for syntax highlighting strives for good contrast " +"and exclusively uses the 4-bit VGA standard ANSI color codes for maximum " +"compatibility. The theme can be customized using an experimental API :func:`!" +"_colorize.set_theme`. This can be called interactively or in the :envvar:" +"`PYTHONSTARTUP` script. Note that this function has no stability guarantees, " +"and may change or be removed." msgstr "" -#: ../../whatsnew/3.14.rst:1223 +#: ../../whatsnew/3.14.rst:999 +msgid "(Contributed by Łukasz Langa in :gh:`131507`.)" +msgstr "(由 Łukasz Langa 於 :gh:`131507` 貢獻。)" + +#: ../../whatsnew/3.14.rst:1001 msgid "" -"The compiler emits a :exc:`SyntaxWarning` when a :keyword:`return`, :keyword:" -"`break` or :keyword:`continue` statement appears where it exits a :keyword:" -"`finally` block. This change is specified in :pep:`765`." +"The default :term:`interactive` shell now supports import auto-completion. " +"This means that typing ``import co`` and pressing :kbd:`` will suggest " +"modules starting with ``co``. Similarly, typing ``from concurrent import i`` " +"will suggest submodules of ``concurrent`` starting with ``i``. Note that " +"autocompletion of module attributes is not currently supported. (Contributed " +"by Tomas Roun in :gh:`69605`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1229 +#: ../../whatsnew/3.14.rst:1010 msgid "New modules" msgstr "" -#: ../../whatsnew/3.14.rst:1231 +#: ../../whatsnew/3.14.rst:1012 msgid "" ":mod:`annotationlib`: For introspecting :term:`annotations `. " -"See :pep:`749` for more details. (Contributed by Jelle Zijlstra in :gh:" -"`119180`.)" +"See :ref:`PEP 749 ` for more details. " +"(Contributed by Jelle Zijlstra in :gh:`119180`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:1017 +msgid "" +":mod:`compression` (including :mod:`compression.zstd`): A package for " +"compression-related modules, including a new module to support the Zstandard " +"compression format. See :ref:`PEP 784 ` for more " +"details. (Contributed by Emma Harper Smith, Adam Turner, Gregory P. Smith, " +"Tomas Roun, Victor Stinner, and Rogdham in :gh:`132983`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:1024 +msgid "" +":mod:`concurrent.interpreters`: Support for multiple interpreters in the " +"standard library. See :ref:`PEP 734 ` for " +"more details. (Contributed by Eric Snow in :gh:`134939`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:1029 +msgid "" +":mod:`string.templatelib`: Support for template string literals (t-strings). " +"See :ref:`PEP 750 ` for more details. " +"(Contributed by Jim Baker, Guido van Rossum, Paul Everitt, Koudai Aono, " +"Lysandros Nikolaou, Dave Peck, Adam Turner, Jelle Zijlstra, Bénédikt Tran, " +"and Pablo Galindo Salgado in :gh:`132661`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1237 +#: ../../whatsnew/3.14.rst:1038 msgid "Improved modules" msgstr "" -#: ../../whatsnew/3.14.rst:1240 ../../whatsnew/3.14.rst:2397 +#: ../../whatsnew/3.14.rst:1041 ../../whatsnew/3.14.rst:2301 msgid "argparse" msgstr "argparse" -#: ../../whatsnew/3.14.rst:1242 +#: ../../whatsnew/3.14.rst:1043 msgid "" "The default value of the :ref:`program name ` for :class:`argparse." "ArgumentParser` now reflects the way the Python interpreter was instructed " @@ -1777,7 +1466,7 @@ msgid "" "Alyssa Coghlan in :gh:`66436`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1247 +#: ../../whatsnew/3.14.rst:1048 msgid "" "Introduced the optional *suggest_on_error* parameter to :class:`argparse." "ArgumentParser`, enabling suggestions for argument choices and subparser " @@ -1785,7 +1474,7 @@ msgid "" "`124456`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1254 +#: ../../whatsnew/3.14.rst:1053 msgid "" "Enable color for help text, which can be disabled with the optional *color* " "parameter to :class:`argparse.ArgumentParser`. This can also be controlled " @@ -1793,53 +1482,55 @@ msgid "" "by Hugo van Kemenade in :gh:`130645`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1262 ../../whatsnew/3.14.rst:2416 +#: ../../whatsnew/3.14.rst:1061 ../../whatsnew/3.14.rst:2320 msgid "ast" msgstr "ast" -#: ../../whatsnew/3.14.rst:1264 +#: ../../whatsnew/3.14.rst:1063 msgid "" -"Add :func:`ast.compare` for comparing two ASTs. (Contributed by Batuhan " -"Taskaya and Jeremy Hylton in :gh:`60191`.)" +"Add :func:`~ast.compare`, a function for comparing two ASTs. (Contributed by " +"Batuhan Taskaya and Jeremy Hylton in :gh:`60191`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1267 +#: ../../whatsnew/3.14.rst:1066 msgid "" "Add support for :func:`copy.replace` for AST nodes. (Contributed by Bénédikt " "Tran in :gh:`121141`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1270 +#: ../../whatsnew/3.14.rst:1069 msgid "" "Docstrings are now removed from an optimized AST in optimization level 2. " "(Contributed by Irit Katriel in :gh:`123958`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1273 +#: ../../whatsnew/3.14.rst:1072 msgid "" -"The ``repr()`` output for AST nodes now includes more information. " +"The :func:`repr` output for AST nodes now includes more information. " "(Contributed by Tomas Roun in :gh:`116022`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1276 +#: ../../whatsnew/3.14.rst:1075 msgid "" -":func:`ast.parse`, when called with an AST as input, now always verifies " -"that the root node type is appropriate. (Contributed by Irit Katriel in :gh:" -"`130139`.)" +"When called with an AST as input, the :func:`~ast.parse` function now always " +"verifies that the root node type is appropriate. (Contributed by Irit " +"Katriel in :gh:`130139`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1280 +#: ../../whatsnew/3.14.rst:1079 msgid "" -"Add new ``--feature-version``, ``--optimize``, ``--show-empty`` options to " -"the command-line interface. (Contributed by Semyon Moroz in :gh:`133367`.)" +"Add new options to the command-line interface: :option:`--feature-version " +"`, :option:`--optimize `, and :option:" +"`--show-empty `. (Contributed by Semyon Moroz in :gh:" +"`133367`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1286 ../../whatsnew/3.14.rst:2258 -#: ../../whatsnew/3.14.rst:2447 +#: ../../whatsnew/3.14.rst:1087 ../../whatsnew/3.14.rst:2162 +#: ../../whatsnew/3.14.rst:2351 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.14.rst:1288 +#: ../../whatsnew/3.14.rst:1089 msgid "" "The function and methods named :func:`!create_task` now take an arbitrary " "list of keyword arguments. All keyword arguments are passed to the :class:" @@ -1849,26 +1540,32 @@ msgid "" "``name`` keyword argument of the factory, and ``context`` may be ``None``." msgstr "" -#: ../../whatsnew/3.14.rst:1296 +#: ../../whatsnew/3.14.rst:1097 msgid "" "This affects the following function and methods: :meth:`asyncio." "create_task`, :meth:`asyncio.loop.create_task`, :meth:`asyncio.TaskGroup." -"create_task`. (Contributed by Thomas Grainger in :gh:`128307`.)" +"create_task`." msgstr "" -#: ../../whatsnew/3.14.rst:1302 +#: ../../whatsnew/3.14.rst:1102 +#, fuzzy +msgid "(Contributed by Thomas Grainger in :gh:`128307`.)" +msgstr "(由 Łukasz Langa 於 :gh:`131507` 貢獻。)" + +#: ../../whatsnew/3.14.rst:1104 msgid "" "There are two new utility functions for introspecting and printing a " "program's call graph: :func:`~asyncio.capture_call_graph` and :func:" -"`~asyncio.print_call_graph`. (Contributed by Yury Selivanov, Pablo Galindo " -"Salgado, and Łukasz Langa in :gh:`91048`.)" +"`~asyncio.print_call_graph`. See :ref:`Asyncio introspection capabilities " +"` for more details. (Contributed by Yury " +"Selivanov, Pablo Galindo Salgado, and Łukasz Langa in :gh:`91048`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1312 +#: ../../whatsnew/3.14.rst:1114 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.14.rst:1314 +#: ../../whatsnew/3.14.rst:1118 msgid "" "By default, today's date is highlighted in color in :mod:`calendar`'s :ref:" "`command-line ` text output. This can be controlled by :ref:" @@ -1876,35 +1573,43 @@ msgid "" "van Kemenade in :gh:`128317`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1322 +#: ../../whatsnew/3.14.rst:1126 msgid "concurrent.futures" msgstr "concurrent.futures" -#: ../../whatsnew/3.14.rst:1326 +#: ../../whatsnew/3.14.rst:1130 +msgid "" +"Add a new executor class, :class:`~concurrent.futures." +"InterpreterPoolExecutor`, which exposes multiple Python interpreters in the " +"same process ('subinterpreters') to Python code. This uses a pool of " +"independent Python interpreters to execute calls asynchronously." +msgstr "" + +#: ../../whatsnew/3.14.rst:1136 msgid "" -"Add :class:`~concurrent.futures.InterpreterPoolExecutor`, which exposes " -"\"subinterpreters\" (multiple Python interpreters in the same process) to " -"Python code. This is separate from the proposed API in :pep:`734`. " +"This is separate from the new :mod:`~concurrent.interpreters` module " +"introduced by :ref:`PEP 734 `. " "(Contributed by Eric Snow in :gh:`124548`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1334 +#: ../../whatsnew/3.14.rst:1142 msgid "" -"The default :class:`~concurrent.futures.ProcessPoolExecutor` :ref:`start " -"method ` changed from :ref:`fork " -"` to :ref:`forkserver ` on platforms other than macOS and Windows where it " -"was already :ref:`spawn `." +"On Unix platforms other than macOS, :ref:`'forkserver' ` is now the the default :ref:`start method " +"` for :class:`~concurrent.futures." +"ProcessPoolExecutor` (replacing :ref:`'fork' `). This change does not affect Windows or macOS, where :ref:`'spawn' " +"` remains the default start method." msgstr "" -#: ../../whatsnew/3.14.rst:1340 +#: ../../whatsnew/3.14.rst:1150 msgid "" "If the threading incompatible *fork* method is required, you must explicitly " "request it by supplying a multiprocessing context *mp_context* to :class:" "`~concurrent.futures.ProcessPoolExecutor`." msgstr "" -#: ../../whatsnew/3.14.rst:1344 ../../whatsnew/3.14.rst:1774 +#: ../../whatsnew/3.14.rst:1154 ../../whatsnew/3.14.rst:1604 msgid "" "See :ref:`forkserver restrictions ` " "for information and differences with the *fork* method and how this change " @@ -1912,68 +1617,70 @@ msgid "" "objects that can not be automatically :mod:`pickled `." msgstr "" -#: ../../whatsnew/3.14.rst:1349 ../../whatsnew/3.14.rst:1779 +#: ../../whatsnew/3.14.rst:1159 ../../whatsnew/3.14.rst:1609 msgid "(Contributed by Gregory P. Smith in :gh:`84559`.)" msgstr "(由 Gregory P. Smith 於 :gh:`84559` 貢獻。)" -#: ../../whatsnew/3.14.rst:1351 +#: ../../whatsnew/3.14.rst:1161 msgid "" -"Add :meth:`concurrent.futures.ProcessPoolExecutor.terminate_workers` and :" -"meth:`concurrent.futures.ProcessPoolExecutor.kill_workers` as ways to " -"terminate or kill all living worker processes in the given pool. " -"(Contributed by Charles Machalow in :gh:`130849`.)" +"Add two new methods to :class:`~concurrent.futures.ProcessPoolExecutor`, :" +"meth:`~concurrent.futures.ProcessPoolExecutor.terminate_workers` and :meth:" +"`~concurrent.futures.ProcessPoolExecutor.kill_workers`, as ways to terminate " +"or kill all living worker processes in the given pool. (Contributed by " +"Charles Machalow in :gh:`130849`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1356 +#: ../../whatsnew/3.14.rst:1167 msgid "" -"Add the optional ``buffersize`` parameter to :meth:`concurrent.futures." -"Executor.map` to limit the number of submitted tasks whose results have not " -"yet been yielded. If the buffer is full, iteration over the *iterables* " -"pauses until a result is yielded from the buffer. (Contributed by Enzo " -"Bonnal and Josh Rosenberg in :gh:`74028`.)" +"Add the optional *buffersize* parameter to :meth:`Executor.map ` to limit the number of submitted tasks whose results " +"have not yet been yielded. If the buffer is full, iteration over the " +"*iterables* pauses until a result is yielded from the buffer. (Contributed " +"by Enzo Bonnal and Josh Rosenberg in :gh:`74028`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1364 +#: ../../whatsnew/3.14.rst:1176 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.14.rst:1366 +#: ../../whatsnew/3.14.rst:1178 msgid "" -"Security fix: will no longer write config files it cannot read. Attempting " -"to :meth:`configparser.ConfigParser.write` keys containing delimiters or " -"beginning with the section header pattern will raise a :class:`configparser." -"InvalidWriteError`. (Contributed by Jacob Lincoln in :gh:`129270`.)" +":mod:`!configparser` will no longer write config files it cannot read, to " +"improve security. Attempting to :meth:`~configparser.ConfigParser.write` " +"keys containing delimiters or beginning with the section header pattern will " +"raise an :class:`~configparser.InvalidWriteError`. (Contributed by Jacob " +"Lincoln in :gh:`129270`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1373 +#: ../../whatsnew/3.14.rst:1187 msgid "contextvars" msgstr "contextvars" -#: ../../whatsnew/3.14.rst:1375 +#: ../../whatsnew/3.14.rst:1189 msgid "" -"Support context manager protocol by :class:`contextvars.Token`. (Contributed " -"by Andrew Svetlov in :gh:`129889`.)" +"Support the :term:`context manager` protocol for :class:`~contextvars.Token` " +"objects. (Contributed by Andrew Svetlov in :gh:`129889`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1380 +#: ../../whatsnew/3.14.rst:1195 msgid "ctypes" msgstr "ctypes" -#: ../../whatsnew/3.14.rst:1382 +#: ../../whatsnew/3.14.rst:1197 msgid "" "The layout of :ref:`bit fields ` in :" -"class:`~ctypes.Structure` and :class:`~ctypes.Union` now matches platform " -"defaults (GCC/Clang or MSVC) more closely. In particular, fields no longer " -"overlap. (Contributed by Matthias Görgens in :gh:`97702`.)" +"class:`~ctypes.Structure` and :class:`~ctypes.Union` objects is now a closer " +"match to platform defaults (GCC/Clang or MSVC). In particular, fields no " +"longer overlap. (Contributed by Matthias Görgens in :gh:`97702`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1388 +#: ../../whatsnew/3.14.rst:1203 msgid "" "The :attr:`.Structure._layout_` class attribute can now be set to help match " "a non-default ABI. (Contributed by Petr Viktorin in :gh:`97702`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1392 +#: ../../whatsnew/3.14.rst:1207 msgid "" "The class of :class:`~ctypes.Structure`/:class:`~ctypes.Union` field " "descriptors is now available as :class:`~ctypes.CField`, and has new " @@ -1981,117 +1688,118 @@ msgid "" "in :gh:`128715`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1397 +#: ../../whatsnew/3.14.rst:1212 msgid "" "On Windows, the :exc:`~ctypes.COMError` exception is now public. " "(Contributed by Jun Komoda in :gh:`126686`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1400 +#: ../../whatsnew/3.14.rst:1215 msgid "" "On Windows, the :func:`~ctypes.CopyComPointer` function is now public. " "(Contributed by Jun Komoda in :gh:`127275`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1403 +#: ../../whatsnew/3.14.rst:1218 msgid "" -":func:`ctypes.memoryview_at` now exists to create a :class:`memoryview` " -"object that refers to the supplied pointer and length. This works like :func:" -"`ctypes.string_at` except it avoids a buffer copy, and is typically useful " -"when implementing pure Python callback functions that are passed dynamically-" -"sized buffers. (Contributed by Rian Hunter in :gh:`112018`.)" +"Add :func:`~ctypes.memoryview_at`, a function to create a :class:" +"`memoryview` object that refers to the supplied pointer and length. This " +"works like :func:`ctypes.string_at` except it avoids a buffer copy, and is " +"typically useful when implementing pure Python callback functions that are " +"passed dynamically-sized buffers. (Contributed by Rian Hunter in :gh:" +"`112018`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1410 +#: ../../whatsnew/3.14.rst:1225 msgid "" "Complex types, :class:`~ctypes.c_float_complex`, :class:`~ctypes." -"c_double_complex` and :class:`~ctypes.c_longdouble_complex`, are now " +"c_double_complex`, and :class:`~ctypes.c_longdouble_complex`, are now " "available if both the compiler and the ``libffi`` library support complex C " "types. (Contributed by Sergey B Kirpichev in :gh:`61103`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1416 +#: ../../whatsnew/3.14.rst:1231 msgid "" "Add :func:`ctypes.util.dllist` for listing the shared libraries loaded by " "the current process. (Contributed by Brian Ward in :gh:`119349`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1420 +#: ../../whatsnew/3.14.rst:1235 msgid "" "Move :func:`ctypes.POINTER` types cache from a global internal cache " -"(``_pointer_type_cache``) to the :attr:`ctypes._CData.__pointer_type__` " -"attribute of the corresponding :mod:`ctypes` types. This will stop the cache " -"from growing without limits in some situations. (Contributed by Sergey " -"Miryanov in :gh:`100926`.)" +"(``_pointer_type_cache``) to the :attr:`_CData.__pointer_type__ ` attribute of the corresponding :mod:`!ctypes` " +"types. This will stop the cache from growing without limits in some " +"situations. (Contributed by Sergey Miryanov in :gh:`100926`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1426 +#: ../../whatsnew/3.14.rst:1242 msgid "" -"The :class:`ctypes.py_object` type now supports subscription, making it a :" +"The :class:`~ctypes.py_object` type now supports subscription, making it a :" "term:`generic type`. (Contributed by Brian Schubert in :gh:`132168`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1430 +#: ../../whatsnew/3.14.rst:1246 msgid "" -":mod:`ctypes` now supports :term:`free-threading builds `. " +":mod:`!ctypes` now supports :term:`free-threading builds `. " "(Contributed by Kumar Aditya and Peter Bierma in :gh:`127945`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1434 +#: ../../whatsnew/3.14.rst:1251 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.14.rst:1436 +#: ../../whatsnew/3.14.rst:1253 msgid "" "Add the :func:`~curses.assume_default_colors` function, a refinement of the :" -"func:`~curses.use_default_colors` function which allows to change the color " +"func:`~curses.use_default_colors` function which allows changing the color " "pair ``0``. (Contributed by Serhiy Storchaka in :gh:`133139`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1442 +#: ../../whatsnew/3.14.rst:1260 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.14.rst:1444 +#: ../../whatsnew/3.14.rst:1262 msgid "" -"Add :meth:`datetime.time.strptime` and :meth:`datetime.date.strptime`. " -"(Contributed by Wannes Boeykens in :gh:`41431`.)" +"Add the :meth:`~datetime.date.strptime` method to the :class:`datetime.date` " +"and :class:`datetime.time` classes. (Contributed by Wannes Boeykens in :gh:" +"`41431`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1448 +#: ../../whatsnew/3.14.rst:1268 msgid "decimal" msgstr "decimal" -#: ../../whatsnew/3.14.rst:1450 +#: ../../whatsnew/3.14.rst:1270 msgid "" -"Add alternative :class:`~decimal.Decimal` constructor :meth:`Decimal." -"from_number() `. (Contributed by Serhiy " -"Storchaka in :gh:`121798`.)" +"Add :meth:`.Decimal.from_number` as an alternative constructor for :class:" +"`~decimal.Decimal`. (Contributed by Serhiy Storchaka in :gh:`121798`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1454 +#: ../../whatsnew/3.14.rst:1274 msgid "" -"Expose :func:`decimal.IEEEContext` to support creation of contexts " +"Expose :func:`~decimal.IEEEContext` to support creation of contexts " "corresponding to the IEEE 754 (2008) decimal interchange formats. " "(Contributed by Sergey B Kirpichev in :gh:`53032`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1459 ../../whatsnew/3.14.rst:2294 +#: ../../whatsnew/3.14.rst:1280 ../../whatsnew/3.14.rst:2198 msgid "difflib" msgstr "difflib" -#: ../../whatsnew/3.14.rst:1461 +#: ../../whatsnew/3.14.rst:1282 msgid "" -"Comparison pages with highlighted changes generated by the :class:`difflib." -"HtmlDiff` class now support dark mode. (Contributed by Jiahao Li in :gh:" +"Comparison pages with highlighted changes generated by the :class:`~difflib." +"HtmlDiff` class now support 'dark mode'. (Contributed by Jiahao Li in :gh:" "`129939`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1466 +#: ../../whatsnew/3.14.rst:1288 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.14.rst:1468 +#: ../../whatsnew/3.14.rst:1290 msgid "" "Add support for rendering full source location information of :class:" "`instructions `, rather than only the line number. This " @@ -2099,191 +1807,199 @@ msgid "" "keyword argument:" msgstr "" -#: ../../whatsnew/3.14.rst:1473 +#: ../../whatsnew/3.14.rst:1295 msgid ":class:`dis.Bytecode`" msgstr ":class:`dis.Bytecode`" -#: ../../whatsnew/3.14.rst:1474 +#: ../../whatsnew/3.14.rst:1296 msgid ":func:`dis.dis`" msgstr ":func:`dis.dis`" -#: ../../whatsnew/3.14.rst:1475 +#: ../../whatsnew/3.14.rst:1297 msgid ":func:`dis.distb`" msgstr ":func:`dis.distb`" -#: ../../whatsnew/3.14.rst:1476 +#: ../../whatsnew/3.14.rst:1298 msgid ":func:`dis.disassemble`" msgstr ":func:`dis.disassemble`" -#: ../../whatsnew/3.14.rst:1478 +#: ../../whatsnew/3.14.rst:1300 msgid "" "This feature is also exposed via :option:`dis --show-positions`. " "(Contributed by Bénédikt Tran in :gh:`123165`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1481 +#: ../../whatsnew/3.14.rst:1303 msgid "" "Add the :option:`dis --specialized` command-line option to show specialized " "bytecode. (Contributed by Bénédikt Tran in :gh:`127413`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1487 +#: ../../whatsnew/3.14.rst:1309 msgid "errno" msgstr "errno" -#: ../../whatsnew/3.14.rst:1489 +#: ../../whatsnew/3.14.rst:1311 msgid "" -"Add :data:`errno.EHWPOISON` error code. (Contributed by James Roy in :gh:" -"`126585`.)" +"Add the :data:`~errno.EHWPOISON` error code constant. (Contributed by James " +"Roy in :gh:`126585`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1494 +#: ../../whatsnew/3.14.rst:1316 msgid "faulthandler" msgstr "faulthandler" -#: ../../whatsnew/3.14.rst:1496 +#: ../../whatsnew/3.14.rst:1318 msgid "" "Add support for printing the C stack trace on systems that :ref:`support it " -"` via :func:`faulthandler.dump_c_stack` or via the " -"*c_stack* argument in :func:`faulthandler.enable`. (Contributed by Peter " -"Bierma in :gh:`127604`.)" +"` via the new :func:`~faulthandler.dump_c_stack` " +"function or via the *c_stack* argument in :func:`faulthandler.enable`. " +"(Contributed by Peter Bierma in :gh:`127604`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1503 +#: ../../whatsnew/3.14.rst:1326 msgid "fnmatch" msgstr "fnmatch" -#: ../../whatsnew/3.14.rst:1505 +#: ../../whatsnew/3.14.rst:1328 msgid "" -"Added :func:`fnmatch.filterfalse` for excluding names matching a pattern. " -"(Contributed by Bénédikt Tran in :gh:`74598`.)" +"Add :func:`~fnmatch.filterfalse`, a function to reject names matching a " +"given pattern. (Contributed by Bénédikt Tran in :gh:`74598`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1510 +#: ../../whatsnew/3.14.rst:1334 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.14.rst:1512 +#: ../../whatsnew/3.14.rst:1336 msgid "" -"Add support for converting any objects that have the :meth:`!" -"as_integer_ratio` method to a :class:`~fractions.Fraction`. (Contributed by " -"Serhiy Storchaka in :gh:`82017`.)" +"A :class:`~fractions.Fraction` object may now be constructed from any object " +"with the :meth:`!as_integer_ratio` method. (Contributed by Serhiy Storchaka " +"in :gh:`82017`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1516 +#: ../../whatsnew/3.14.rst:1340 msgid "" -"Add alternative :class:`~fractions.Fraction` constructor :meth:`Fraction." -"from_number() `. (Contributed by Serhiy " -"Storchaka in :gh:`121797`.)" +"Add :meth:`.Fraction.from_number` as an alternative constructor for :class:" +"`~fractions.Fraction`. (Contributed by Serhiy Storchaka in :gh:`121797`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1522 +#: ../../whatsnew/3.14.rst:1346 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.14.rst:1524 +#: ../../whatsnew/3.14.rst:1348 msgid "" -"Add support to :func:`functools.partial` and :func:`functools.partialmethod` " -"for :data:`functools.Placeholder` sentinels to reserve a place for " -"positional arguments. (Contributed by Dominykas Grigonis in :gh:`119127`.)" +"Add the :data:`~functools.Placeholder` sentinel. This may be used with the :" +"func:`~functools.partial` or :func:`~functools.partialmethod` functions to " +"reserve a place for positional arguments in the returned :ref:`partial " +"object `. (Contributed by Dominykas Grigonis in :gh:" +"`119127`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1529 +#: ../../whatsnew/3.14.rst:1355 msgid "" -"Allow the *initial* parameter of :func:`functools.reduce` to be passed as a " +"Allow the *initial* parameter of :func:`~functools.reduce` to be passed as a " "keyword argument. (Contributed by Sayandip Dutta in :gh:`125916`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1535 +#: ../../whatsnew/3.14.rst:1361 msgid "getopt" msgstr "getopt" -#: ../../whatsnew/3.14.rst:1537 +#: ../../whatsnew/3.14.rst:1363 msgid "" "Add support for options with optional arguments. (Contributed by Serhiy " "Storchaka in :gh:`126374`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1540 +#: ../../whatsnew/3.14.rst:1366 msgid "" "Add support for returning intermixed options and non-option arguments in " "order. (Contributed by Serhiy Storchaka in :gh:`126390`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1545 +#: ../../whatsnew/3.14.rst:1371 msgid "getpass" msgstr "getpass" -#: ../../whatsnew/3.14.rst:1547 +#: ../../whatsnew/3.14.rst:1373 msgid "" -"Support keyboard feedback by :func:`getpass.getpass` via the keyword-only " -"optional argument ``echo_char``. Placeholder characters are rendered " -"whenever a character is entered, and removed when a character is deleted. " -"(Contributed by Semyon Moroz in :gh:`77065`.)" +"Support keyboard feedback in the :func:`~getpass.getpass` function via the " +"keyword-only optional argument *echo_char*. Placeholder characters are " +"rendered whenever a character is entered, and removed when a character is " +"deleted. (Contributed by Semyon Moroz in :gh:`77065`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1554 +#: ../../whatsnew/3.14.rst:1381 msgid "graphlib" msgstr "graphlib" -#: ../../whatsnew/3.14.rst:1556 +#: ../../whatsnew/3.14.rst:1383 msgid "" -"Allow :meth:`graphlib.TopologicalSorter.prepare` to be called more than once " -"as long as sorting has not started. (Contributed by Daniel Pope in :gh:" -"`130914`.)" +"Allow :meth:`.TopologicalSorter.prepare` to be called more than once as long " +"as sorting has not started. (Contributed by Daniel Pope in :gh:`130914`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1562 +#: ../../whatsnew/3.14.rst:1389 msgid "heapq" msgstr "heapq" -#: ../../whatsnew/3.14.rst:1564 -msgid "Add functions for working with max-heaps:" +#: ../../whatsnew/3.14.rst:1391 +msgid "" +"The :mod:`!heapq` module has improved support for working with max-heaps, " +"via the following new functions:" msgstr "" -#: ../../whatsnew/3.14.rst:1566 -msgid ":func:`heapq.heapify_max`," +#: ../../whatsnew/3.14.rst:1394 +#, fuzzy +msgid ":func:`~heapq.heapify_max`" msgstr ":func:`heapq.heapify_max`," -#: ../../whatsnew/3.14.rst:1567 -msgid ":func:`heapq.heappush_max`," +#: ../../whatsnew/3.14.rst:1395 +#, fuzzy +msgid ":func:`~heapq.heappush_max`" msgstr ":func:`heapq.heappush_max`," -#: ../../whatsnew/3.14.rst:1568 -msgid ":func:`heapq.heappop_max`," +#: ../../whatsnew/3.14.rst:1396 +#, fuzzy +msgid ":func:`~heapq.heappop_max`" msgstr ":func:`heapq.heappop_max`," -#: ../../whatsnew/3.14.rst:1569 -msgid ":func:`heapq.heapreplace_max`" +#: ../../whatsnew/3.14.rst:1397 +#, fuzzy +msgid ":func:`~heapq.heapreplace_max`" msgstr ":func:`heapq.heapreplace_max`" -#: ../../whatsnew/3.14.rst:1570 -msgid ":func:`heapq.heappushpop_max`" +#: ../../whatsnew/3.14.rst:1398 +#, fuzzy +msgid ":func:`~heapq.heappushpop_max`" msgstr ":func:`heapq.heappushpop_max`" -#: ../../whatsnew/3.14.rst:1574 +#: ../../whatsnew/3.14.rst:1402 msgid "hmac" msgstr "hmac" -#: ../../whatsnew/3.14.rst:1576 +#: ../../whatsnew/3.14.rst:1404 msgid "" "Add a built-in implementation for HMAC (:rfc:`2104`) using formally verified " "code from the `HACL* `__ project. " -"(Contributed by Bénédikt Tran in :gh:`99108`.)" +"This implementation is used as a fallback when the OpenSSL implementation of " +"HMAC is not available. (Contributed by Bénédikt Tran in :gh:`99108`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1582 +#: ../../whatsnew/3.14.rst:1412 msgid "http" msgstr "http" -#: ../../whatsnew/3.14.rst:1584 +#: ../../whatsnew/3.14.rst:1414 msgid "" "Directory lists and error pages generated by the :mod:`http.server` module " "allow the browser to apply its default dark mode. (Contributed by Yorik " "Hansen in :gh:`123430`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1588 +#: ../../whatsnew/3.14.rst:1418 msgid "" "The :mod:`http.server` module now supports serving over HTTPS using the :" "class:`http.server.HTTPSServer` class. This functionality is exposed by the " @@ -2291,97 +2007,101 @@ msgid "" "options:" msgstr "" -#: ../../whatsnew/3.14.rst:1593 -msgid "``--tls-cert ``: Path to the TLS certificate file." +#: ../../whatsnew/3.14.rst:1423 +msgid "" +":option:`--tls-cert \\ `: Path to the TLS " +"certificate file." msgstr "" -#: ../../whatsnew/3.14.rst:1594 -msgid "``--tls-key ``: Optional path to the private key file." +#: ../../whatsnew/3.14.rst:1425 +msgid "" +":option:`--tls-key \\ `: Optional path to the " +"private key file." msgstr "" -#: ../../whatsnew/3.14.rst:1595 +#: ../../whatsnew/3.14.rst:1427 msgid "" -"``--tls-password-file ``: Optional path to the password file for the " -"private key." +":option:`--tls-password-file \\ `: " +"Optional path to the password file for the private key." msgstr "" -#: ../../whatsnew/3.14.rst:1597 +#: ../../whatsnew/3.14.rst:1430 msgid "(Contributed by Semyon Moroz in :gh:`85162`.)" msgstr "(由 Semyon Moroz 於 :gh:`85162` 貢獻。)" -#: ../../whatsnew/3.14.rst:1601 +#: ../../whatsnew/3.14.rst:1434 msgid "imaplib" msgstr "imaplib" -#: ../../whatsnew/3.14.rst:1603 +#: ../../whatsnew/3.14.rst:1436 msgid "" -"Add :meth:`IMAP4.idle() `, implementing the IMAP4 " -"``IDLE`` command as defined in :rfc:`2177`. (Contributed by Forest in :gh:" -"`55454`.)" +"Add :meth:`.IMAP4.idle`, implementing the IMAP4 ``IDLE`` command as defined " +"in :rfc:`2177`. (Contributed by Forest in :gh:`55454`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1609 +#: ../../whatsnew/3.14.rst:1442 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.14.rst:1611 +#: ../../whatsnew/3.14.rst:1444 msgid "" -":func:`inspect.signature` takes a new argument *annotation_format* to " +":func:`~inspect.signature` takes a new argument *annotation_format* to " "control the :class:`annotationlib.Format` used for representing annotations. " "(Contributed by Jelle Zijlstra in :gh:`101552`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1615 +#: ../../whatsnew/3.14.rst:1448 msgid "" -":meth:`inspect.Signature.format` takes a new argument *unquote_annotations*. " -"If true, string :term:`annotations ` are displayed without " +":meth:`.Signature.format` takes a new argument *unquote_annotations*. If " +"true, string :term:`annotations ` are displayed without " "surrounding quotes. (Contributed by Jelle Zijlstra in :gh:`101552`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1619 +#: ../../whatsnew/3.14.rst:1453 msgid "" -"Add function :func:`inspect.ispackage` to determine whether an object is a :" +"Add function :func:`~inspect.ispackage` to determine whether an object is a :" "term:`package` or not. (Contributed by Zhikang Yan in :gh:`125634`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1625 ../../whatsnew/3.14.rst:2336 +#: ../../whatsnew/3.14.rst:1459 ../../whatsnew/3.14.rst:2240 msgid "io" msgstr "io" -#: ../../whatsnew/3.14.rst:1627 +#: ../../whatsnew/3.14.rst:1461 msgid "" "Reading text from a non-blocking stream with ``read`` may now raise a :exc:" "`BlockingIOError` if the operation cannot immediately return bytes. " "(Contributed by Giovanni Siragusa in :gh:`109523`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1631 +#: ../../whatsnew/3.14.rst:1465 msgid "" -"Add protocols :class:`io.Reader` and :class:`io.Writer` as simpler " +"Add the :class:`~io.Reader` and :class:`~io.Writer` protocols as simpler " "alternatives to the pseudo-protocols :class:`typing.IO`, :class:`typing." "TextIO`, and :class:`typing.BinaryIO`. (Contributed by Sebastian Rittau in :" "gh:`127648`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1638 +#: ../../whatsnew/3.14.rst:1472 msgid "json" msgstr "json" -#: ../../whatsnew/3.14.rst:1640 +#: ../../whatsnew/3.14.rst:1474 msgid "" -"Add notes for JSON serialization errors that allow to identify the source of " -"the error. (Contributed by Serhiy Storchaka in :gh:`122163`.)" +"Add exception notes for JSON serialization errors that allow identifying the " +"source of the error. (Contributed by Serhiy Storchaka in :gh:`122163`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1644 +#: ../../whatsnew/3.14.rst:1478 msgid "" -"Enable the :mod:`json` module to work as a script using the :option:`-m` " -"switch: :program:`python -m json`. See the :ref:`JSON command-line interface " -"` documentation. (Contributed by Trey Hunner in :gh:" -"`122873`.)" +"Allow using the :mod:`json` module as a script using the :option:`-m` " +"switch: :program:`python -m json`. This is now preferred to :program:`python " +"-m json.tool`, which is :term:`soft deprecated`. See the :ref:`JSON command-" +"line interface ` documentation. (Contributed by Trey " +"Hunner in :gh:`122873`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1651 +#: ../../whatsnew/3.14.rst:1485 msgid "" "By default, the output of the :ref:`JSON command-line interface ` is highlighted in color. This can be controlled by :ref:" @@ -2389,413 +2109,435 @@ msgid "" "Roun in :gh:`131952`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1658 +#: ../../whatsnew/3.14.rst:1493 msgid "linecache" msgstr "linecache" -#: ../../whatsnew/3.14.rst:1660 +#: ../../whatsnew/3.14.rst:1495 msgid "" -":func:`linecache.getline` can retrieve source code for frozen modules. " +":func:`~linecache.getline` can now retrieve source code for frozen modules. " "(Contributed by Tian Gao in :gh:`131638`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1665 +#: ../../whatsnew/3.14.rst:1500 msgid "logging.handlers" msgstr "logging.handlers" -#: ../../whatsnew/3.14.rst:1667 +#: ../../whatsnew/3.14.rst:1502 msgid "" -":class:`logging.handlers.QueueListener` now implements the context manager " -"protocol, allowing it to be used in a :keyword:`with` statement. " -"(Contributed by Charles Machalow in :gh:`132106`.)" +":class:`~logging.handlers.QueueListener` objects now support the :term:" +"`context manager` protocol. (Contributed by Charles Machalow in :gh:" +"`132106`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1671 +#: ../../whatsnew/3.14.rst:1506 msgid "" ":meth:`QueueListener.start ` now " "raises a :exc:`RuntimeError` if the listener is already started. " "(Contributed by Charles Machalow in :gh:`132106`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1677 +#: ../../whatsnew/3.14.rst:1512 msgid "math" msgstr "math" -#: ../../whatsnew/3.14.rst:1679 +#: ../../whatsnew/3.14.rst:1514 msgid "" "Added more detailed error messages for domain errors in the module. " "(Contributed by Charlie Zhao and Sergey B Kirpichev in :gh:`101410`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1684 +#: ../../whatsnew/3.14.rst:1519 msgid "mimetypes" msgstr "mimetypes" -#: ../../whatsnew/3.14.rst:1686 +#: ../../whatsnew/3.14.rst:1521 msgid "" -"Document the command-line for :mod:`mimetypes`. It now exits with ``1`` on " -"failure instead of ``0`` and ``2`` on incorrect command-line parameters " -"instead of ``1``. Also, errors are printed to stderr instead of stdout and " -"their text is made tighter. (Contributed by Oleg Iarygin and Hugo van " -"Kemenade in :gh:`93096`.)" +"Add a public :ref:`command-line ` for the module, invoked " +"via :program:`python -m mimetypes`. (Contributed by Oleg Iarygin and Hugo " +"van Kemenade in :gh:`93096`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:1525 +msgid "Add several new MIME types based on RFCs and common usage:" msgstr "" -#: ../../whatsnew/3.14.rst:1693 -msgid "Add MS and :rfc:`8081` MIME types for fonts:" +#: ../../whatsnew/3.14.rst:0 +msgid "Microsoft and :rfc:`8081` MIME types for fonts" msgstr "" -#: ../../whatsnew/3.14.rst:1695 +#: ../../whatsnew/3.14.rst:1529 msgid "Embedded OpenType: ``application/vnd.ms-fontobject``" msgstr "" -#: ../../whatsnew/3.14.rst:1696 +#: ../../whatsnew/3.14.rst:1530 msgid "OpenType Layout (OTF) ``font/otf``" msgstr "" -#: ../../whatsnew/3.14.rst:1697 +#: ../../whatsnew/3.14.rst:1531 msgid "TrueType: ``font/ttf``" msgstr "" -#: ../../whatsnew/3.14.rst:1698 +#: ../../whatsnew/3.14.rst:1532 msgid "WOFF 1.0 ``font/woff``" msgstr "WOFF 1.0 ``font/woff``" -#: ../../whatsnew/3.14.rst:1699 +#: ../../whatsnew/3.14.rst:1533 msgid "WOFF 2.0 ``font/woff2``" msgstr "WOFF 2.0 ``font/woff2``" -#: ../../whatsnew/3.14.rst:1701 -msgid "(Contributed by Sahil Prajapati and Hugo van Kemenade in :gh:`84852`.)" -msgstr "(由 Sahil Prajapati and Hugo van Kemenade 於 :gh:`84852` 貢獻。)" - -#: ../../whatsnew/3.14.rst:1703 +#: ../../whatsnew/3.14.rst:0 msgid "" -"Add :rfc:`9559` MIME types for Matroska audiovisual data container " -"structures, containing:" +":rfc:`9559` MIME types for Matroska audiovisual data container structures" msgstr "" -#: ../../whatsnew/3.14.rst:1706 +#: ../../whatsnew/3.14.rst:1538 msgid "audio with no video: ``audio/matroska`` (``.mka``)" msgstr "" -#: ../../whatsnew/3.14.rst:1707 +#: ../../whatsnew/3.14.rst:1539 msgid "video: ``video/matroska`` (``.mkv``)" msgstr "" -#: ../../whatsnew/3.14.rst:1708 +#: ../../whatsnew/3.14.rst:1540 msgid "stereoscopic video: ``video/matroska-3d`` (``.mk3d``)" msgstr "" -#: ../../whatsnew/3.14.rst:1710 -msgid "(Contributed by Hugo van Kemenade in :gh:`89416`.)" -msgstr "(由 Hugo van Kemenade 於 :gh:`89416` 貢獻。)" - -#: ../../whatsnew/3.14.rst:1712 -msgid "Add MIME types for images with RFCs:" +#: ../../whatsnew/3.14.rst:0 +msgid "Images with RFCs" msgstr "" -#: ../../whatsnew/3.14.rst:1714 +#: ../../whatsnew/3.14.rst:1544 msgid ":rfc:`1494`: CCITT Group 3 (``.g3``)" msgstr "" -#: ../../whatsnew/3.14.rst:1715 +#: ../../whatsnew/3.14.rst:1545 msgid ":rfc:`3362`: Real-time Facsimile, T.38 (``.t38``)" msgstr "" -#: ../../whatsnew/3.14.rst:1716 +#: ../../whatsnew/3.14.rst:1546 msgid "" ":rfc:`3745`: JPEG 2000 (``.jp2``), extension (``.jpx``) and compound (``." "jpm``)" msgstr "" -#: ../../whatsnew/3.14.rst:1717 +#: ../../whatsnew/3.14.rst:1547 msgid ":rfc:`3950`: Tag Image File Format Fax eXtended, TIFF-FX (``.tfx``)" msgstr "" -#: ../../whatsnew/3.14.rst:1718 +#: ../../whatsnew/3.14.rst:1548 msgid ":rfc:`4047`: Flexible Image Transport System (``.fits``)" msgstr "" -#: ../../whatsnew/3.14.rst:1719 +#: ../../whatsnew/3.14.rst:1549 msgid "" ":rfc:`7903`: Enhanced Metafile (``.emf``) and Windows Metafile (``.wmf``)" msgstr "" -#: ../../whatsnew/3.14.rst:1721 -msgid "(Contributed by Hugo van Kemenade in :gh:`85957`.)" -msgstr "(由 Hugo van Kemenade 於 :gh:`85957` 貢獻。)" - -#: ../../whatsnew/3.14.rst:1723 -msgid "More MIME type changes:" +#: ../../whatsnew/3.14.rst:0 +msgid "Other MIME type additions and changes" msgstr "" -#: ../../whatsnew/3.14.rst:1725 +#: ../../whatsnew/3.14.rst:1553 msgid "" ":rfc:`2361`: Change type for ``.avi`` to ``video/vnd.avi`` and for ``.wav`` " "to ``audio/vnd.wave``" msgstr "" -#: ../../whatsnew/3.14.rst:1727 +#: ../../whatsnew/3.14.rst:1555 msgid ":rfc:`4337`: Add MPEG-4 ``audio/mp4`` (``.m4a``)" msgstr "" -#: ../../whatsnew/3.14.rst:1728 +#: ../../whatsnew/3.14.rst:1556 msgid ":rfc:`5334`: Add Ogg media (``.oga``, ``.ogg`` and ``.ogx``)" msgstr "" -#: ../../whatsnew/3.14.rst:1729 +#: ../../whatsnew/3.14.rst:1557 msgid ":rfc:`6713`: Add gzip ``application/gzip`` (``.gz``)" msgstr "" -#: ../../whatsnew/3.14.rst:1730 +#: ../../whatsnew/3.14.rst:1558 msgid ":rfc:`9639`: Add FLAC ``audio/flac`` (``.flac``)" msgstr "" -#: ../../whatsnew/3.14.rst:1731 +#: ../../whatsnew/3.14.rst:1559 +msgid "" +":rfc:`9512` ``application/yaml`` MIME type for YAML files (``.yaml`` and ``." +"yml``)" +msgstr "" + +#: ../../whatsnew/3.14.rst:1561 msgid "Add 7z ``application/x-7z-compressed`` (``.7z``)" msgstr "" -#: ../../whatsnew/3.14.rst:1732 +#: ../../whatsnew/3.14.rst:1562 msgid "" "Add Android Package ``application/vnd.android.package-archive`` (``.apk``) " "when not strict" msgstr "" -#: ../../whatsnew/3.14.rst:1734 +#: ../../whatsnew/3.14.rst:1564 msgid "Add deb ``application/x-debian-package`` (``.deb``)" msgstr "" -#: ../../whatsnew/3.14.rst:1735 +#: ../../whatsnew/3.14.rst:1565 msgid "Add glTF binary ``model/gltf-binary`` (``.glb``)" msgstr "" -#: ../../whatsnew/3.14.rst:1736 +#: ../../whatsnew/3.14.rst:1566 msgid "Add glTF JSON/ASCII ``model/gltf+json`` (``.gltf``)" msgstr "" -#: ../../whatsnew/3.14.rst:1737 +#: ../../whatsnew/3.14.rst:1567 msgid "Add M4V ``video/x-m4v`` (``.m4v``)" msgstr "" -#: ../../whatsnew/3.14.rst:1738 +#: ../../whatsnew/3.14.rst:1568 msgid "Add PHP ``application/x-httpd-php`` (``.php``)" msgstr "" -#: ../../whatsnew/3.14.rst:1739 +#: ../../whatsnew/3.14.rst:1569 msgid "Add RAR ``application/vnd.rar`` (``.rar``)" msgstr "" -#: ../../whatsnew/3.14.rst:1740 +#: ../../whatsnew/3.14.rst:1570 msgid "Add RPM ``application/x-rpm`` (``.rpm``)" msgstr "" -#: ../../whatsnew/3.14.rst:1741 +#: ../../whatsnew/3.14.rst:1571 msgid "Add STL ``model/stl`` (``.stl``)" msgstr "" -#: ../../whatsnew/3.14.rst:1742 +#: ../../whatsnew/3.14.rst:1572 msgid "Add Windows Media Video ``video/x-ms-wmv`` (``.wmv``)" msgstr "" -#: ../../whatsnew/3.14.rst:1743 +#: ../../whatsnew/3.14.rst:1573 msgid "De facto: Add WebM ``audio/webm`` (``.weba``)" msgstr "" -#: ../../whatsnew/3.14.rst:1744 +#: ../../whatsnew/3.14.rst:1574 msgid "" "`ECMA-376 `__: Add ``.docx``, ``.pptx`` and ``.xlsx`` types" msgstr "" -#: ../../whatsnew/3.14.rst:1747 +#: ../../whatsnew/3.14.rst:1577 msgid "" "`OASIS `__: Add OpenDocument ``.odg``, ``.odp``, ``.ods`` and " "``.odt`` types" msgstr "" -#: ../../whatsnew/3.14.rst:1750 +#: ../../whatsnew/3.14.rst:1580 msgid "" "`W3C `__: Add EPUB " "``application/epub+zip`` (``.epub``)" msgstr "" -#: ../../whatsnew/3.14.rst:1753 -msgid "(Contributed by Hugo van Kemenade in :gh:`129965`.)" -msgstr "(由 Hugo van Kemenade 於 :gh:`129965` 貢獻。)" - -#: ../../whatsnew/3.14.rst:1755 +#: ../../whatsnew/3.14.rst:1583 msgid "" -"Add :rfc:`9512` ``application/yaml`` MIME type for YAML files (``.yaml`` and " -"``.yml``). (Contributed by Sasha \"Nelie\" Chernykh and Hugo van Kemenade " -"in :gh:`132056`.)" +"(Contributed by Sahil Prajapati and Hugo van Kemenade in :gh:`84852`, by " +"Sasha \"Nelie\" Chernykh and Hugo van Kemenade in :gh:`132056`, and by Hugo " +"van Kemenade in :gh:`89416`, :gh:`85957`, and :gh:`129965`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1761 +#: ../../whatsnew/3.14.rst:1589 msgid "multiprocessing" msgstr "multiprocessing" -#: ../../whatsnew/3.14.rst:1765 +#: ../../whatsnew/3.14.rst:1593 msgid "" -"The default :ref:`start method ` changed " -"from :ref:`fork ` to :ref:`forkserver " -"` on platforms other than macOS and " -"Windows where it was already :ref:`spawn `." +"On Unix platforms other than macOS, :ref:`'forkserver' ` is now the the default :ref:`start method " +"` (replacing :ref:`'fork' `). This change does not affect Windows or macOS, where :" +"ref:`'spawn' ` remains the default start " +"method." msgstr "" -#: ../../whatsnew/3.14.rst:1770 +#: ../../whatsnew/3.14.rst:1600 msgid "" "If the threading incompatible *fork* method is required, you must explicitly " -"request it via a context from :func:`multiprocessing.get_context` " -"(preferred) or change the default via :func:`multiprocessing." +"request it via a context from :func:`~multiprocessing.get_context` " +"(preferred) or change the default via :func:`~multiprocessing." "set_start_method`." msgstr "" -#: ../../whatsnew/3.14.rst:1781 +#: ../../whatsnew/3.14.rst:1611 msgid "" -":mod:`multiprocessing`'s ``\"forkserver\"`` start method now authenticates " -"its control socket to avoid solely relying on filesystem permissions to " -"restrict what other processes could cause the forkserver to spawn workers " -"and run code. (Contributed by Gregory P. Smith for :gh:`97514`.)" +":mod:`multiprocessing`'s ``'forkserver'`` start method now authenticates its " +"control socket to avoid solely relying on filesystem permissions to restrict " +"what other processes could cause the forkserver to spawn workers and run " +"code. (Contributed by Gregory P. Smith for :gh:`97514`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1787 +#: ../../whatsnew/3.14.rst:1617 msgid "" "The :ref:`multiprocessing proxy objects ` for " "*list* and *dict* types gain previously overlooked missing methods:" msgstr "" -#: ../../whatsnew/3.14.rst:1790 +#: ../../whatsnew/3.14.rst:1620 msgid ":meth:`!clear` and :meth:`!copy` for proxies of :class:`list`" msgstr "" -#: ../../whatsnew/3.14.rst:1791 +#: ../../whatsnew/3.14.rst:1621 msgid "" ":meth:`~dict.fromkeys`, ``reversed(d)``, ``d | {}``, ``{} | d``, ``d |= " "{'b': 2}`` for proxies of :class:`dict`" msgstr "" -#: ../../whatsnew/3.14.rst:1794 +#: ../../whatsnew/3.14.rst:1624 msgid "(Contributed by Roy Hyunjin Han for :gh:`103134`.)" msgstr "(由 Roy Hyunjin Han 於 :gh:`103134` 貢獻。)" -#: ../../whatsnew/3.14.rst:1796 +#: ../../whatsnew/3.14.rst:1626 msgid "" -"Add support for shared :class:`set` objects via :meth:`SyncManager.set() " -"`. The :func:`set` in :func:" -"`multiprocessing.Manager` method is now available. (Contributed by Mingyu " -"Park in :gh:`129949`.)" +"Add support for shared :class:`set` objects via :meth:`.SyncManager.set`. " +"The :func:`set` in :func:`~multiprocessing.Manager` method is now available. " +"(Contributed by Mingyu Park in :gh:`129949`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1801 +#: ../../whatsnew/3.14.rst:1631 msgid "" -"Add :func:`multiprocessing.Process.interrupt` which terminates the child " -"process by sending :py:const:`~signal.SIGINT`. This enables :keyword:" -"`finally` clauses to print a stack trace for the terminated process. " -"(Contributed by Artem Pulkin in :gh:`131913`.)" +"Add the :meth:`~multiprocessing.Process.interrupt` to :class:" +"`multiprocessing.Process` objects, which terminates the child process by " +"sending :py:const:`~signal.SIGINT`. This enables :keyword:`finally` clauses " +"to print a stack trace for the terminated process. (Contributed by Artem " +"Pulkin in :gh:`131913`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1807 +#: ../../whatsnew/3.14.rst:1639 msgid "operator" msgstr "operator" -#: ../../whatsnew/3.14.rst:1809 +#: ../../whatsnew/3.14.rst:1641 msgid "" -"Two new functions :func:`operator.is_none` and :func:`operator.is_not_none` " -"have been added, such that ``operator.is_none(obj)`` is equivalent to ``obj " -"is None`` and ``operator.is_not_none(obj)`` is equivalent to ``obj is not " +"Add :func:`~operator.is_none` and :func:`~operator.is_not_none` as a pair of " +"functions, such that ``operator.is_none(obj)`` is equivalent to ``obj is " +"None`` and ``operator.is_not_none(obj)`` is equivalent to ``obj is not " "None``. (Contributed by Raymond Hettinger and Nico Mexis in :gh:`115808`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1817 +#: ../../whatsnew/3.14.rst:1649 msgid "os" msgstr "os" -#: ../../whatsnew/3.14.rst:1819 +#: ../../whatsnew/3.14.rst:1651 msgid "" -"Add the :func:`os.reload_environ` function to update :data:`os.environ` and :" -"data:`os.environb` with changes to the environment made by :func:`os." +"Add the :func:`~os.reload_environ` function to update :data:`os.environ` " +"and :data:`os.environb` with changes to the environment made by :func:`os." "putenv`, by :func:`os.unsetenv`, or made outside Python in the same process. " "(Contributed by Victor Stinner in :gh:`120057`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1825 +#: ../../whatsnew/3.14.rst:1657 msgid "" "Add the :data:`~os.SCHED_DEADLINE` and :data:`~os.SCHED_NORMAL` constants to " -"the :mod:`os` module. (Contributed by James Roy in :gh:`127688`.)" +"the :mod:`!os` module. (Contributed by James Roy in :gh:`127688`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1829 +#: ../../whatsnew/3.14.rst:1661 msgid "" -"Add the :func:`os.readinto` function to read into a :ref:`buffer object " +"Add the :func:`~os.readinto` function to read into a :ref:`buffer object " "` from a file descriptor. (Contributed by Cody Maloney in :gh:" "`129205`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1835 +#: ../../whatsnew/3.14.rst:1667 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.14.rst:1837 +#: ../../whatsnew/3.14.rst:1669 msgid "" -"The *strict* parameter to :func:`os.path.realpath` accepts a new value, :" -"data:`os.path.ALLOW_MISSING`. If used, errors other than :exc:" +"The *strict* parameter to :func:`~os.path.realpath` accepts a new value, :" +"data:`~os.path.ALLOW_MISSING`. If used, errors other than :exc:" "`FileNotFoundError` will be re-raised; the resulting path can be missing but " "it will be free of symlinks. (Contributed by Petr Viktorin for :cve:" "`2025-4517`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1845 ../../whatsnew/3.14.rst:2345 -#: ../../whatsnew/3.14.rst:2596 +#: ../../whatsnew/3.14.rst:1677 ../../whatsnew/3.14.rst:2249 +#: ../../whatsnew/3.14.rst:2501 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.14.rst:1847 +#: ../../whatsnew/3.14.rst:1679 msgid "" "Add methods to :class:`pathlib.Path` to recursively copy or move files and " "directories:" msgstr "" -#: ../../whatsnew/3.14.rst:1850 +#: ../../whatsnew/3.14.rst:1682 msgid "" ":meth:`~pathlib.Path.copy` copies a file or directory tree to a destination." msgstr "" -#: ../../whatsnew/3.14.rst:1851 +#: ../../whatsnew/3.14.rst:1683 msgid ":meth:`~pathlib.Path.copy_into` copies *into* a destination directory." msgstr "" -#: ../../whatsnew/3.14.rst:1852 +#: ../../whatsnew/3.14.rst:1684 msgid "" ":meth:`~pathlib.Path.move` moves a file or directory tree to a destination." msgstr "" -#: ../../whatsnew/3.14.rst:1853 +#: ../../whatsnew/3.14.rst:1685 msgid ":meth:`~pathlib.Path.move_into` moves *into* a destination directory." msgstr "" -#: ../../whatsnew/3.14.rst:1855 +#: ../../whatsnew/3.14.rst:1687 msgid "(Contributed by Barney Gale in :gh:`73991`.)" msgstr "(由 Barney Gale 於 :gh:`73991` 貢獻。)" -#: ../../whatsnew/3.14.rst:1857 +#: ../../whatsnew/3.14.rst:1689 msgid "" -"Add :attr:`pathlib.Path.info` attribute, which stores an object implementing " -"the :class:`pathlib.types.PathInfo` protocol (also new). The object supports " -"querying the file type and internally caching :func:`~os.stat` results. Path " -"objects generated by :meth:`~pathlib.Path.iterdir` are initialized with file " -"type information gleaned from scanning the parent directory. (Contributed by " -"Barney Gale in :gh:`125413`.)" +"Add the :attr:`~pathlib.Path.info` attribute, which stores an object " +"implementing the new :class:`pathlib.types.PathInfo` protocol. The object " +"supports querying the file type and internally caching :func:`~os.stat` " +"results. Path objects generated by :meth:`~pathlib.Path.iterdir` are " +"initialized with file type information gleaned from scanning the parent " +"directory. (Contributed by Barney Gale in :gh:`125413`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1867 ../../whatsnew/3.14.rst:2353 +#: ../../whatsnew/3.14.rst:1699 ../../whatsnew/3.14.rst:2257 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.14.rst:1869 +#: ../../whatsnew/3.14.rst:1701 +msgid "" +"The :mod:`pdb` module now supports remote attaching to a running Python " +"process using a new :option:`-p PID ` command-line option:" +msgstr "" + +#: ../../whatsnew/3.14.rst:1704 +msgid "python -m pdb -p 1234" +msgstr "" + +#: ../../whatsnew/3.14.rst:1708 +msgid "" +"This will connect to the Python process with the given PID and allow you to " +"debug it interactively. Notice that due to how the Python interpreter works " +"attaching to a remote process that is blocked in a system call or waiting " +"for I/O will only work once the next bytecode instruction is executed or " +"when the process receives a signal." +msgstr "" + +#: ../../whatsnew/3.14.rst:1714 +msgid "" +"This feature uses :ref:`PEP 768 ` and the new :" +"func:`sys.remote_exec` function to attach to the remote process and send the " +"PDB commands to it." +msgstr "" + +#: ../../whatsnew/3.14.rst:1718 +msgid "(Contributed by Matt Wozniski and Pablo Galindo in :gh:`131591`.)" +msgstr "(由 Matt Wozniski and Pablo Galindo 於 :gh:`131591` 貢獻。)" + +#: ../../whatsnew/3.14.rst:1720 msgid "" -"Hardcoded breakpoints (:func:`breakpoint` and :func:`pdb.set_trace`) now " +"Hardcoded breakpoints (:func:`breakpoint` and :func:`~pdb.set_trace`) now " "reuse the most recent :class:`~pdb.Pdb` instance that calls :meth:`~pdb.Pdb." "set_trace`, instead of creating a new one each time. As a result, all the " "instance specific data like :pdbcmd:`display` and :pdbcmd:`commands` are " @@ -2803,14 +2545,14 @@ msgid "" "`121450`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1876 +#: ../../whatsnew/3.14.rst:1727 msgid "" "Add a new argument *mode* to :class:`pdb.Pdb`. Disable the ``restart`` " "command when :mod:`pdb` is in ``inline`` mode. (Contributed by Tian Gao in :" "gh:`123757`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1880 +#: ../../whatsnew/3.14.rst:1731 msgid "" "A confirmation prompt will be shown when the user tries to quit :mod:`pdb` " "in ``inline`` mode. ``y``, ``Y``, ```` or ``EOF`` will confirm the " @@ -2818,254 +2560,291 @@ msgid "" "(Contributed by Tian Gao in :gh:`124704`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1885 +#: ../../whatsnew/3.14.rst:1736 msgid "" "Inline breakpoints like :func:`breakpoint` or :func:`pdb.set_trace` will " "always stop the program at calling frame, ignoring the ``skip`` pattern (if " "any). (Contributed by Tian Gao in :gh:`130493`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1890 +#: ../../whatsnew/3.14.rst:1741 msgid "" "```` at the beginning of the line in :mod:`pdb` multi-line input will " "fill in a 4-space indentation now, instead of inserting a ``\\t`` character. " "(Contributed by Tian Gao in :gh:`130471`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1894 +#: ../../whatsnew/3.14.rst:1745 msgid "" "Auto-indent is introduced in :mod:`pdb` multi-line input. It will either " "keep the indentation of the last line or insert a 4-space indentation when " "it detects a new code block. (Contributed by Tian Gao in :gh:`133350`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1899 +#: ../../whatsnew/3.14.rst:1750 msgid "" "``$_asynctask`` is added to access the current asyncio task if applicable. " "(Contributed by Tian Gao in :gh:`124367`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1902 +#: ../../whatsnew/3.14.rst:1753 msgid "" ":func:`pdb.set_trace_async` is added to support debugging asyncio " "coroutines. :keyword:`await` statements are supported with this function. " "(Contributed by Tian Gao in :gh:`132576`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1907 +#: ../../whatsnew/3.14.rst:1758 msgid "" "Source code displayed in :mod:`pdb` will be syntax-highlighted. This feature " -"can be controlled using the same methods as PyREPL, in addition to the newly " -"added ``colorize`` argument of :class:`pdb.Pdb`. (Contributed by Tian Gao " -"and Łukasz Langa in :gh:`133355`.)" +"can be controlled using the same methods as the default :term:`interactive` " +"shell, in addition to the newly added ``colorize`` argument of :class:`pdb." +"Pdb`. (Contributed by Tian Gao and Łukasz Langa in :gh:`133355`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1914 +#: ../../whatsnew/3.14.rst:1765 msgid "pickle" msgstr "pickle" -#: ../../whatsnew/3.14.rst:1916 +#: ../../whatsnew/3.14.rst:1767 msgid "" "Set the default protocol version on the :mod:`pickle` module to 5. For more " "details, see :ref:`pickle protocols `." msgstr "" -#: ../../whatsnew/3.14.rst:1919 +#: ../../whatsnew/3.14.rst:1770 msgid "" -"Add notes for pickle serialization errors that allow to identify the source " -"of the error. (Contributed by Serhiy Storchaka in :gh:`122213`.)" +"Add exception notes for pickle serialization errors that allow identifying " +"the source of the error. (Contributed by Serhiy Storchaka in :gh:`122213`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1925 +#: ../../whatsnew/3.14.rst:1776 msgid "platform" msgstr "platform" -#: ../../whatsnew/3.14.rst:1927 +#: ../../whatsnew/3.14.rst:1778 msgid "" -"Add :func:`platform.invalidate_caches` to invalidate the cached results. " -"(Contributed by Bénédikt Tran in :gh:`122549`.)" +"Add :func:`~platform.invalidate_caches`, a function to invalidate cached " +"results in the :mod:`!platform` module. (Contributed by Bénédikt Tran in :gh:" +"`122549`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1932 +#: ../../whatsnew/3.14.rst:1784 msgid "pydoc" msgstr "pydoc" -#: ../../whatsnew/3.14.rst:1934 +#: ../../whatsnew/3.14.rst:1786 msgid "" ":term:`Annotations ` in help output are now usually displayed in " "a format closer to that in the original source. (Contributed by Jelle " "Zijlstra in :gh:`101552`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1940 +#: ../../whatsnew/3.14.rst:1792 +msgid "re" +msgstr "" + +#: ../../whatsnew/3.14.rst:1794 +msgid "" +"Support ``\\z`` as a synonym for ``\\Z`` in :mod:`regular expressions `. " +"It is interpreted unambiguously in many other regular expression engines, " +"unlike ``\\Z``, which has subtly different behavior. (Contributed by Serhiy " +"Storchaka in :gh:`133306`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:1799 +msgid "" +"``\\B`` in :mod:`regular expression ` now matches the empty input " +"string, meaning that it is now always the opposite of ``\\b``. (Contributed " +"by Serhiy Storchaka in :gh:`124130`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:1805 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.14.rst:1942 +#: ../../whatsnew/3.14.rst:1807 msgid "Improve and fix support for Bluetooth sockets." msgstr "" -#: ../../whatsnew/3.14.rst:1944 +#: ../../whatsnew/3.14.rst:1809 msgid "" "Fix support of Bluetooth sockets on NetBSD and DragonFly BSD. (Contributed " "by Serhiy Storchaka in :gh:`132429`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1946 +#: ../../whatsnew/3.14.rst:1811 msgid "" "Fix support for :const:`~socket.BTPROTO_HCI` on FreeBSD. (Contributed by " "Victor Stinner in :gh:`111178`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1948 +#: ../../whatsnew/3.14.rst:1813 msgid "" "Add support for :const:`~socket.BTPROTO_SCO` on FreeBSD. (Contributed by " "Serhiy Storchaka in :gh:`85302`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1950 +#: ../../whatsnew/3.14.rst:1815 msgid "" "Add support for *cid* and *bdaddr_type* in the address for :const:`~socket." "BTPROTO_L2CAP` on FreeBSD. (Contributed by Serhiy Storchaka in :gh:`132429`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1953 +#: ../../whatsnew/3.14.rst:1818 msgid "" "Add support for *channel* in the address for :const:`~socket.BTPROTO_HCI` on " "Linux. (Contributed by Serhiy Storchaka in :gh:`70145`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1956 +#: ../../whatsnew/3.14.rst:1821 msgid "" "Accept an integer as the address for :const:`~socket.BTPROTO_HCI` on Linux. " "(Contributed by Serhiy Storchaka in :gh:`132099`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1959 +#: ../../whatsnew/3.14.rst:1824 msgid "" "Return *cid* in :meth:`~socket.socket.getsockname` for :const:`~socket." "BTPROTO_L2CAP`. (Contributed by Serhiy Storchaka in :gh:`132429`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1962 +#: ../../whatsnew/3.14.rst:1827 msgid "" "Add many new constants. (Contributed by Serhiy Storchaka in :gh:`132734`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1966 +#: ../../whatsnew/3.14.rst:1832 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.14.rst:1968 +#: ../../whatsnew/3.14.rst:1834 msgid "" -"Indicate through :data:`ssl.HAS_PHA` whether the :mod:`ssl` module supports " -"TLSv1.3 post-handshake client authentication (PHA). (Contributed by Will " -"Childs-Klein in :gh:`128036`.)" +"Indicate through the :data:`~ssl.HAS_PHA` Boolean whether the :mod:`!ssl` " +"module supports TLSv1.3 post-handshake client authentication (PHA). " +"(Contributed by Will Childs-Klein in :gh:`128036`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1974 +#: ../../whatsnew/3.14.rst:1840 msgid "struct" msgstr "struct" -#: ../../whatsnew/3.14.rst:1976 +#: ../../whatsnew/3.14.rst:1842 msgid "" "Support the :c:expr:`float complex` and :c:expr:`double complex` C types in " "the :mod:`struct` module (formatting characters ``'F'`` and ``'D'`` " "respectively). (Contributed by Sergey B Kirpichev in :gh:`121249`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1983 +#: ../../whatsnew/3.14.rst:1849 msgid "symtable" msgstr "symtable" -#: ../../whatsnew/3.14.rst:1985 -msgid "Expose the following :class:`symtable.Symbol` methods:" +#: ../../whatsnew/3.14.rst:1851 +msgid "Expose the following :class:`~symtable.Symbol` methods:" msgstr "" -#: ../../whatsnew/3.14.rst:1987 +#: ../../whatsnew/3.14.rst:1853 msgid ":meth:`~symtable.Symbol.is_comp_cell`" msgstr ":meth:`~symtable.Symbol.is_comp_cell`" -#: ../../whatsnew/3.14.rst:1988 +#: ../../whatsnew/3.14.rst:1854 msgid ":meth:`~symtable.Symbol.is_comp_iter`" msgstr ":meth:`~symtable.Symbol.is_comp_iter`" -#: ../../whatsnew/3.14.rst:1989 +#: ../../whatsnew/3.14.rst:1855 msgid ":meth:`~symtable.Symbol.is_free_class`" msgstr ":meth:`~symtable.Symbol.is_free_class`" -#: ../../whatsnew/3.14.rst:1991 +#: ../../whatsnew/3.14.rst:1857 msgid "(Contributed by Bénédikt Tran in :gh:`120029`.)" msgstr "(由 Bénédikt Tran 於 :gh:`120029` 貢獻。)" -#: ../../whatsnew/3.14.rst:1995 +#: ../../whatsnew/3.14.rst:1861 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.14.rst:1997 +#: ../../whatsnew/3.14.rst:1863 msgid "" "The previously undocumented special function :func:`sys.getobjects`, which " "only exists in specialized builds of Python, may now return objects from " -"other interpreters than the one it's called in." +"other interpreters than the one it's called in. (Contributed by Eric Snow " +"in :gh:`125286`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2001 +#: ../../whatsnew/3.14.rst:1868 msgid "" "Add :func:`sys._is_immortal` for determining if an object is :term:" "`immortal`. (Contributed by Peter Bierma in :gh:`128509`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2004 +#: ../../whatsnew/3.14.rst:1871 msgid "" -"On FreeBSD, :data:`sys.platform` doesn't contain the major version anymore. " -"It is always ``'freebsd'``, instead of ``'freebsd13'`` or ``'freebsd14'``." +"On FreeBSD, :data:`sys.platform` no longer contains the major version " +"number. It is always ``'freebsd'``, instead of ``'freebsd13'`` or " +"``'freebsd14'``. (Contributed by Michael Osipov in :gh:`129393`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2007 +#: ../../whatsnew/3.14.rst:1875 msgid "" "Raise :exc:`DeprecationWarning` for :func:`sys._clear_type_cache`. This " "function was deprecated in Python 3.13 but it didn't raise a runtime warning." msgstr "" -#: ../../whatsnew/3.14.rst:2012 +#: ../../whatsnew/3.14.rst:1878 +msgid "" +"Add :func:`sys.remote_exec` to implement the new external debugger " +"interface. See :ref:`PEP 768 ` for details. " +"(Contributed by Pablo Galindo Salgado, Matt Wozniski, and Ivona Stojanovic " +"in :gh:`131591`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:1883 +msgid "" +"Add the :data:`sys._jit` namespace, containing utilities for introspecting " +"just-in-time compilation. (Contributed by Brandt Bucher in :gh:`133231`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:1889 msgid "sys.monitoring" msgstr "sys.monitoring" -#: ../../whatsnew/3.14.rst:2014 +#: ../../whatsnew/3.14.rst:1891 msgid "" -"Two new events are added: :monitoring-event:`BRANCH_LEFT` and :monitoring-" -"event:`BRANCH_RIGHT`. The ``BRANCH`` event is deprecated." +"Add two new monitoring events, :monitoring-event:`BRANCH_LEFT` and :" +"monitoring-event:`BRANCH_RIGHT`. These replace and deprecate the :monitoring-" +"event:`!BRANCH` event. (Contributed by Mark Shannon in :gh:`122548`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2019 +#: ../../whatsnew/3.14.rst:1898 msgid "sysconfig" msgstr "sysconfig" -#: ../../whatsnew/3.14.rst:2021 +#: ../../whatsnew/3.14.rst:1900 msgid "" -"Add ``ABIFLAGS`` key to :func:`sysconfig.get_config_vars` on Windows. " +"Add ``ABIFLAGS`` key to :func:`~sysconfig.get_config_vars` on Windows. " "(Contributed by Xuehai Pan in :gh:`131799`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2026 +#: ../../whatsnew/3.14.rst:1905 msgid "tarfile" msgstr "tarfile" -#: ../../whatsnew/3.14.rst:2028 +#: ../../whatsnew/3.14.rst:1907 msgid "" ":func:`~tarfile.data_filter` now normalizes symbolic link targets in order " "to avoid path traversal attacks. (Contributed by Petr Viktorin in :gh:" "`127987` and :cve:`2025-4138`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2031 +#: ../../whatsnew/3.14.rst:1911 msgid "" ":func:`~tarfile.TarFile.extractall` now skips fixing up directory attributes " "when a directory was removed or replaced by another kind of file. " "(Contributed by Petr Viktorin in :gh:`127987` and :cve:`2024-12718`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2034 +#: ../../whatsnew/3.14.rst:1915 msgid "" ":func:`~tarfile.TarFile.extract` and :func:`~tarfile.TarFile.extractall` now " "(re-)apply the extraction filter when substituting a link (hard or symbolic) " @@ -3075,7 +2854,7 @@ msgid "" "cve:`2024-12718`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2040 +#: ../../whatsnew/3.14.rst:1922 msgid "" ":func:`~tarfile.TarFile.extract` and :func:`~tarfile.TarFile.extractall` no " "longer extract rejected members when :func:`~tarfile.TarFile.errorlevel` is " @@ -3083,177 +2862,181 @@ msgid "" "cve:`2025-4435`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2048 +#: ../../whatsnew/3.14.rst:1930 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.14.rst:2050 +#: ../../whatsnew/3.14.rst:1932 msgid "" ":meth:`threading.Thread.start` now sets the operating system thread name to :" "attr:`threading.Thread.name`. (Contributed by Victor Stinner in :gh:`59705`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2056 +#: ../../whatsnew/3.14.rst:1938 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.14.rst:2058 +#: ../../whatsnew/3.14.rst:1940 msgid "" "Make :mod:`tkinter` widget methods :meth:`!after` and :meth:`!after_idle` " -"accept arguments passed by keyword. (Contributed by Zhikang Yan in :gh:" -"`126899`.)" +"accept keyword arguments. (Contributed by Zhikang Yan in :gh:`126899`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2062 +#: ../../whatsnew/3.14.rst:1944 msgid "" -"Add ability to specify name for :class:`!tkinter.OptionMenu` and :class:`!" +"Add ability to specify a name for :class:`!tkinter.OptionMenu` and :class:`!" "tkinter.ttk.OptionMenu`. (Contributed by Zhikang Yan in :gh:`130482`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2067 +#: ../../whatsnew/3.14.rst:1950 msgid "turtle" msgstr "turtle" -#: ../../whatsnew/3.14.rst:2069 +#: ../../whatsnew/3.14.rst:1952 msgid "" -"Add context managers for :func:`turtle.fill`, :func:`turtle.poly` and :func:" +"Add context managers for :func:`turtle.fill`, :func:`turtle.poly`, and :func:" "`turtle.no_animation`. (Contributed by Marie Roald and Yngve Mardal Moe in :" "gh:`126350`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2075 +#: ../../whatsnew/3.14.rst:1958 msgid "types" msgstr "types" -#: ../../whatsnew/3.14.rst:2077 +#: ../../whatsnew/3.14.rst:1960 msgid "" ":class:`types.UnionType` is now an alias for :class:`typing.Union`. See :ref:" "`below ` for more details. (Contributed by Jelle " "Zijlstra in :gh:`105499`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2083 +#: ../../whatsnew/3.14.rst:1966 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.14.rst:2087 +#: ../../whatsnew/3.14.rst:1970 msgid "" -":class:`types.UnionType` and :class:`typing.Union` are now aliases for each " -"other, meaning that both old-style unions (created with ``Union[int, str]``) " -"and new-style unions (``int | str``) now create instances of the same " -"runtime type. This unifies the behavior between the two syntaxes, but leads " -"to some differences in behavior that may affect users who introspect types " -"at runtime:" +"The :class:`types.UnionType` and :class:`typing.Union` types are now aliases " +"for each other, meaning that both old-style unions (created with " +"``Union[int, str]``) and new-style unions (``int | str``) now create " +"instances of the same runtime type. This unifies the behavior between the " +"two syntaxes, but leads to some differences in behavior that may affect " +"users who introspect types at runtime:" msgstr "" -#: ../../whatsnew/3.14.rst:2093 +#: ../../whatsnew/3.14.rst:1977 msgid "" "Both syntaxes for creating a union now produce the same string " -"representation in ``repr()``. For example, ``repr(Union[int, str])`` is now " -"``\"int | str\"`` instead of ``\"typing.Union[int, str]\"``." +"representation in :func:`repr`. For example, ``repr(Union[int, str])`` is " +"now ``\"int | str\"`` instead of ``\"typing.Union[int, str]\"``." msgstr "" -#: ../../whatsnew/3.14.rst:2096 +#: ../../whatsnew/3.14.rst:1982 msgid "" "Unions created using the old syntax are no longer cached. Previously, " "running ``Union[int, str]`` multiple times would return the same object " "(``Union[int, str] is Union[int, str]`` would be ``True``), but now it will " -"return two different objects. Users should use ``==`` to compare unions for " -"equality, not ``is``. New-style unions have never been cached this way. This " -"change could increase memory usage for some programs that use a large number " -"of unions created by subscripting ``typing.Union``. However, several factors " -"offset this cost: unions used in annotations are no longer evaluated by " -"default in Python 3.14 because of :pep:`649`; an instance of :class:`types." -"UnionType` is itself much smaller than the object returned by ``Union[]`` " -"was on prior Python versions; and removing the cache also saves some space. " -"It is therefore unlikely that this change will cause a significant increase " -"in memory usage for most users." -msgstr "" - -#: ../../whatsnew/3.14.rst:2109 +"return two different objects. Use ``==`` to compare unions for equality, not " +"``is``. New-style unions have never been cached this way. This change could " +"increase memory usage for some programs that use a large number of unions " +"created by subscripting ``typing.Union``. However, several factors offset " +"this cost: unions used in annotations are no longer evaluated by default in " +"Python 3.14 because of :pep:`649`; an instance of :class:`types.UnionType` " +"is itself much smaller than the object returned by ``Union[]`` was on prior " +"Python versions; and removing the cache also saves some space. It is " +"therefore unlikely that this change will cause a significant increase in " +"memory usage for most users." +msgstr "" + +#: ../../whatsnew/3.14.rst:1998 +#, fuzzy msgid "" "Previously, old-style unions were implemented using the private class " "``typing._UnionGenericAlias``. This class is no longer needed for the " "implementation, but it has been retained for backward compatibility, with " "removal scheduled for Python 3.17. Users should use documented introspection " -"helpers like :func:`typing.get_origin` and :func:`typing.get_args` instead " +"helpers like :func:`~typing.get_origin` and :func:`typing.get_args` instead " "of relying on private implementation details." msgstr "" +"在 Python 3.14 之前,舊式聯集是使用私有類別 ``typing._UnionGenericAlias`` 實" +"作的。這個類別不再被需要,但為了向後相容性而保留,並計劃將在 Python 3.17 中移" +"除。使用者應該改用文件中記錄的內省輔助函式,例如 :func:`typing.get_origin` " +"和 :func:`typing.get_args`,或者依賴私有實作細節。" -#: ../../whatsnew/3.14.rst:2114 +#: ../../whatsnew/3.14.rst:2007 msgid "" "It is now possible to use :class:`typing.Union` itself in :func:`isinstance` " "checks. For example, ``isinstance(int | str, typing.Union)`` will return " "``True``; previously this raised :exc:`TypeError`." msgstr "" -#: ../../whatsnew/3.14.rst:2117 +#: ../../whatsnew/3.14.rst:2012 msgid "" -"The ``__args__`` attribute of :class:`typing.Union` objects is no longer " -"writable." +"The :attr:`!__args__` attribute of :class:`typing.Union` objects is no " +"longer writable." msgstr "" -#: ../../whatsnew/3.14.rst:2118 +#: ../../whatsnew/3.14.rst:2015 msgid "" -"It is no longer possible to set any attributes on :class:`typing.Union` " +"It is no longer possible to set any attributes on :class:`~typing.Union` " "objects. This only ever worked for dunder attributes on previous versions, " "was never documented to work, and was subtly broken in many cases." msgstr "" -#: ../../whatsnew/3.14.rst:2122 +#: ../../whatsnew/3.14.rst:2020 msgid "(Contributed by Jelle Zijlstra in :gh:`105499`.)" msgstr "(由 Jelle Zijlstra 於 :gh:`105499` 貢獻。)" -#: ../../whatsnew/3.14.rst:2124 -msgid ":class:`typing.TypeAliasType` now supports star unpacking." +#: ../../whatsnew/3.14.rst:2022 +msgid ":class:`~typing.TypeAliasType` now supports star unpacking." msgstr "" -#: ../../whatsnew/3.14.rst:2128 +#: ../../whatsnew/3.14.rst:2026 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.14.rst:2130 +#: ../../whatsnew/3.14.rst:2028 msgid "The Unicode database has been updated to Unicode 16.0.0." msgstr "" -#: ../../whatsnew/3.14.rst:2136 +#: ../../whatsnew/3.14.rst:2032 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.14.rst:2138 +#: ../../whatsnew/3.14.rst:2036 msgid "" ":mod:`unittest` output is now colored by default. This can be controlled by :" "ref:`environment variables `. (Contributed by " "Hugo van Kemenade in :gh:`127221`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2143 +#: ../../whatsnew/3.14.rst:2041 msgid "" "unittest discovery supports :term:`namespace package` as start directory " "again. It was removed in Python 3.11. (Contributed by Jacob Walls in :gh:" "`80958`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2147 +#: ../../whatsnew/3.14.rst:2045 msgid "" "A number of new methods were added in the :class:`~unittest.TestCase` class " "that provide more specialized tests." msgstr "" -#: ../../whatsnew/3.14.rst:2150 +#: ../../whatsnew/3.14.rst:2048 msgid "" ":meth:`~unittest.TestCase.assertHasAttr` and :meth:`~unittest.TestCase." "assertNotHasAttr` check whether the object has a particular attribute." msgstr "" -#: ../../whatsnew/3.14.rst:2153 +#: ../../whatsnew/3.14.rst:2051 msgid "" ":meth:`~unittest.TestCase.assertIsSubclass` and :meth:`~unittest.TestCase." "assertNotIsSubclass` check whether the object is a subclass of a particular " "class, or of one of a tuple of classes." msgstr "" -#: ../../whatsnew/3.14.rst:2156 +#: ../../whatsnew/3.14.rst:2054 msgid "" ":meth:`~unittest.TestCase.assertStartsWith`, :meth:`~unittest.TestCase." "assertNotStartsWith`, :meth:`~unittest.TestCase.assertEndsWith` and :meth:" @@ -3261,147 +3044,148 @@ msgid "" "string starts or ends with particular strings." msgstr "" -#: ../../whatsnew/3.14.rst:2162 +#: ../../whatsnew/3.14.rst:2060 msgid "(Contributed by Serhiy Storchaka in :gh:`71339`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`71339` 貢獻。)" -#: ../../whatsnew/3.14.rst:2166 ../../whatsnew/3.14.rst:2642 +#: ../../whatsnew/3.14.rst:2064 ../../whatsnew/3.14.rst:2547 msgid "urllib" msgstr "urllib" -#: ../../whatsnew/3.14.rst:2168 +#: ../../whatsnew/3.14.rst:2066 msgid "" "Upgrade HTTP digest authentication algorithm for :mod:`urllib.request` by " "supporting SHA-256 digest authentication as specified in :rfc:`7616`. " "(Contributed by Calvin Bui in :gh:`128193`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2172 +#: ../../whatsnew/3.14.rst:2070 msgid "" "Improve ergonomics and standards compliance when parsing and emitting ``file:" "`` URLs." msgstr "" -#: ../../whatsnew/3.14.rst:2175 -msgid "In :func:`urllib.request.url2pathname`:" +#: ../../whatsnew/3.14.rst:2073 +msgid "In :func:`~urllib.request.url2pathname`:" msgstr "" -#: ../../whatsnew/3.14.rst:2177 +#: ../../whatsnew/3.14.rst:2075 msgid "" "Accept a complete URL when the new *require_scheme* argument is set to true." msgstr "" -#: ../../whatsnew/3.14.rst:2179 +#: ../../whatsnew/3.14.rst:2077 msgid "Discard URL authority if it matches the local hostname." msgstr "" -#: ../../whatsnew/3.14.rst:2180 +#: ../../whatsnew/3.14.rst:2078 msgid "" "Discard URL authority if it resolves to a local IP address when the new " "*resolve_host* argument is set to true." msgstr "" -#: ../../whatsnew/3.14.rst:2182 +#: ../../whatsnew/3.14.rst:2080 msgid "Discard URL query and fragment components." msgstr "" -#: ../../whatsnew/3.14.rst:2183 +#: ../../whatsnew/3.14.rst:2081 msgid "" "Raise :exc:`~urllib.error.URLError` if a URL authority isn't local, except " "on Windows where we return a UNC path as before." msgstr "" -#: ../../whatsnew/3.14.rst:2186 -msgid "In :func:`urllib.request.pathname2url`:" +#: ../../whatsnew/3.14.rst:2084 +msgid "In :func:`~urllib.request.pathname2url`:" msgstr "" -#: ../../whatsnew/3.14.rst:2188 +#: ../../whatsnew/3.14.rst:2086 msgid "" "Return a complete URL when the new *add_scheme* argument is set to true." msgstr "" -#: ../../whatsnew/3.14.rst:2189 +#: ../../whatsnew/3.14.rst:2087 msgid "" "Include an empty URL authority when a path begins with a slash. For example, " "the path ``/etc/hosts`` is converted to the URL ``///etc/hosts``." msgstr "" -#: ../../whatsnew/3.14.rst:2192 +#: ../../whatsnew/3.14.rst:2090 msgid "" "On Windows, drive letters are no longer converted to uppercase, and ``:`` " "characters not following a drive letter no longer cause an :exc:`OSError` " "exception to be raised." msgstr "" -#: ../../whatsnew/3.14.rst:2196 +#: ../../whatsnew/3.14.rst:2094 msgid "(Contributed by Barney Gale in :gh:`125866`.)" msgstr "(由 Barney Gale 於 :gh:`125866` 貢獻。)" -#: ../../whatsnew/3.14.rst:2200 ../../whatsnew/3.14.rst:2365 +#: ../../whatsnew/3.14.rst:2098 ../../whatsnew/3.14.rst:2269 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.14.rst:2202 +#: ../../whatsnew/3.14.rst:2100 msgid "" -"Add support for UUID versions 6, 7, and 8 via :func:`uuid.uuid6`, :func:" -"`uuid.uuid7`, and :func:`uuid.uuid8` respectively, as specified in :rfc:" +"Add support for UUID versions 6, 7, and 8 via :func:`~uuid.uuid6`, :func:" +"`~uuid.uuid7`, and :func:`~uuid.uuid8` respectively, as specified in :rfc:" "`9562`. (Contributed by Bénédikt Tran in :gh:`89083`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2207 +#: ../../whatsnew/3.14.rst:2105 msgid "" -":const:`uuid.NIL` and :const:`uuid.MAX` are now available to represent the " +":const:`~uuid.NIL` and :const:`~uuid.MAX` are now available to represent the " "Nil and Max UUID formats as defined by :rfc:`9562`. (Contributed by Nick " "Pope in :gh:`128427`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2211 +#: ../../whatsnew/3.14.rst:2109 msgid "" -"Allow to generate multiple UUIDs at once via :option:`python -m uuid --count " -"`. (Contributed by Simon Legner in :gh:`131236`.)" +"Allow generating multiple UUIDs simultaneously on the command-line via :" +"option:`python -m uuid --count `. (Contributed by Simon Legner " +"in :gh:`131236`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2216 +#: ../../whatsnew/3.14.rst:2115 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.14.rst:2218 +#: ../../whatsnew/3.14.rst:2117 msgid "" "Names in the :envvar:`BROWSER` environment variable can now refer to already " "registered browsers for the :mod:`webbrowser` module, instead of always " "generating a new browser command." msgstr "" -#: ../../whatsnew/3.14.rst:2222 +#: ../../whatsnew/3.14.rst:2121 msgid "" "This makes it possible to set :envvar:`BROWSER` to the value of one of the " "supported browsers on macOS." msgstr "" -#: ../../whatsnew/3.14.rst:2227 +#: ../../whatsnew/3.14.rst:2126 msgid "zipfile" msgstr "zipfile" -#: ../../whatsnew/3.14.rst:2229 +#: ../../whatsnew/3.14.rst:2128 msgid "" -"Added :func:`ZipInfo._for_archive ` to resolve " -"suitable defaults for a :class:`~zipfile.ZipInfo` object as used by :func:" -"`ZipFile.writestr `. (Contributed by Bénédikt Tran " -"in :gh:`123424`.)" +"Added :meth:`ZipInfo._for_archive `, a method " +"to resolve suitable defaults for a :class:`~zipfile.ZipInfo` object as used " +"by :func:`ZipFile.writestr `. (Contributed by " +"Bénédikt Tran in :gh:`123424`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2234 +#: ../../whatsnew/3.14.rst:2133 msgid "" -":meth:`zipfile.ZipFile.writestr` now respects ``SOURCE_DATE_EPOCH`` that " -"distributions can set centrally and have build tools consume this in order " -"to produce reproducible output. (Contributed by Jiahao Li in :gh:`91279`.)" +":meth:`.ZipFile.writestr` now respects the :envvar:`SOURCE_DATE_EPOCH` " +"environment variable in order to better support reproducible builds. " +"(Contributed by Jiahao Li in :gh:`91279`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2244 +#: ../../whatsnew/3.14.rst:2142 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.14.rst:2246 +#: ../../whatsnew/3.14.rst:2144 msgid "" "The import time for several standard library modules has been improved, " "including :mod:`annotationlib`, :mod:`ast`, :mod:`asyncio`, :mod:`base64`, :" @@ -3412,23 +3196,31 @@ msgid "" "`zipfile`." msgstr "" -#: ../../whatsnew/3.14.rst:2253 +#: ../../whatsnew/3.14.rst:2151 msgid "" "(Contributed by Adam Turner, Bénédikt Tran, Chris Markiewicz, Eli Schwartz, " "Hugo van Kemenade, Jelle Zijlstra, and others in :gh:`118761`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2260 +#: ../../whatsnew/3.14.rst:2154 +msgid "" +"The interpreter now avoids some reference count modifications internally " +"when it's safe to do so. This can lead to different values being returned " +"from :func:`sys.getrefcount` and :c:func:`Py_REFCNT` compared to previous " +"versions of Python. See :ref:`below ` for details." +msgstr "" + +#: ../../whatsnew/3.14.rst:2164 msgid "" -"Standard benchmark results have improved by 10-20%, following the " -"implementation of a new per-thread double linked list for :class:`native " +"Standard benchmark results have improved by 10-20% following the " +"implementation of a new per-thread doubly linked list for :class:`native " "tasks `, also reducing memory usage. This enables external " "introspection tools such as :ref:`python -m asyncio pstree ` to introspect the call graph of asyncio tasks " "running in all threads. (Contributed by Kumar Aditya in :gh:`107803`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2269 +#: ../../whatsnew/3.14.rst:2173 msgid "" "The module now has first class support for :term:`free-threading builds " "`. This enables parallel execution of multiple event loops " @@ -3436,52 +3228,52 @@ msgid "" "(Contributed by Kumar Aditya in :gh:`128002`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2277 +#: ../../whatsnew/3.14.rst:2181 msgid "base64" msgstr "base64" -#: ../../whatsnew/3.14.rst:2279 +#: ../../whatsnew/3.14.rst:2183 msgid "" ":func:`~base64.b16decode` is now up to six times faster. (Contributed by " "Bénédikt Tran, Chris Markiewicz, and Adam Turner in :gh:`118761`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2285 +#: ../../whatsnew/3.14.rst:2189 msgid "bdb" msgstr "bdb" -#: ../../whatsnew/3.14.rst:2287 +#: ../../whatsnew/3.14.rst:2191 msgid "" "The basic debugger now has a :mod:`sys.monitoring`-based backend, which can " "be selected via the passing ``'monitoring'`` to the :class:`~bdb.Bdb` " "class's new *backend* parameter. (Contributed by Tian Gao in :gh:`124533`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2296 +#: ../../whatsnew/3.14.rst:2200 msgid "" "The :func:`~difflib.IS_LINE_JUNK` function is now up to twice as fast. " "(Contributed by Adam Turner and Semyon Moroz in :gh:`130167`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2301 +#: ../../whatsnew/3.14.rst:2205 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.14.rst:2303 +#: ../../whatsnew/3.14.rst:2207 msgid "" "The new :ref:`incremental garbage collector ` " "means that maximum pause times are reduced by an order of magnitude or more " "for larger heaps." msgstr "" -#: ../../whatsnew/3.14.rst:2307 +#: ../../whatsnew/3.14.rst:2211 msgid "" "Because of this optimization, the meaning of the results of :meth:`~gc." "get_threshold` and :meth:`~gc.set_threshold` have changed, along with :meth:" "`~gc.get_count` and :meth:`~gc.get_stats`." msgstr "" -#: ../../whatsnew/3.14.rst:2311 +#: ../../whatsnew/3.14.rst:2215 msgid "" "For backwards compatibility, :meth:`~gc.get_threshold` continues to return a " "three-item tuple. The first value is the threshold for young collections, as " @@ -3491,11 +3283,11 @@ msgid "" "zero." msgstr "" -#: ../../whatsnew/3.14.rst:2319 +#: ../../whatsnew/3.14.rst:2223 msgid ":meth:`~gc.set_threshold` now ignores any items after the second." msgstr "" -#: ../../whatsnew/3.14.rst:2321 +#: ../../whatsnew/3.14.rst:2225 msgid "" ":meth:`~gc.get_count` and :meth:`~gc.get_stats` continue to return the same " "format of results. The only difference is that instead of the results " @@ -3503,28 +3295,28 @@ msgid "" "young generation and the aging and collecting spaces of the old generation." msgstr "" -#: ../../whatsnew/3.14.rst:2328 +#: ../../whatsnew/3.14.rst:2232 msgid "" "In summary, code that attempted to manipulate the behavior of the cycle GC " "may not work exactly as intended, but it is very unlikely to be harmful. All " "other code will work just fine." msgstr "" -#: ../../whatsnew/3.14.rst:2338 +#: ../../whatsnew/3.14.rst:2242 msgid "" "Opening and reading files now executes fewer system calls. Reading a small " "operating system cached file in full is up to 15% faster. (Contributed by " "Cody Maloney and Victor Stinner in :gh:`120754` and :gh:`90102`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2347 +#: ../../whatsnew/3.14.rst:2251 msgid "" ":func:`Path.read_bytes ` now uses unbuffered mode " "to open files, which is between 9% and 17% faster to read in full. " "(Contributed by Cody Maloney in :gh:`120754`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2355 +#: ../../whatsnew/3.14.rst:2259 msgid "" ":mod:`pdb` now supports two backends, based on either :func:`sys.settrace` " "or :mod:`sys.monitoring`. Using the :ref:`pdb CLI ` or :func:" @@ -3534,24 +3326,24 @@ msgid "" "Tian Gao in :gh:`124533`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2367 +#: ../../whatsnew/3.14.rst:2271 msgid "" ":func:`~uuid.uuid3` and :func:`~uuid.uuid5` are now both roughly 40% faster " "for 16-byte names and 20% faster for 1024-byte names. Performance for longer " "names remains unchanged. (Contributed by Bénédikt Tran in :gh:`128150`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2372 +#: ../../whatsnew/3.14.rst:2276 msgid "" ":func:`~uuid.uuid4` is now c. 30% faster. (Contributed by Bénédikt Tran in :" "gh:`128150`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2377 +#: ../../whatsnew/3.14.rst:2281 msgid "zlib" msgstr "" -#: ../../whatsnew/3.14.rst:2379 +#: ../../whatsnew/3.14.rst:2283 msgid "" "On Windows, `zlib-ng `__ is now used as " "the implementation of the :mod:`zlib` module in the default binaries. There " @@ -3560,29 +3352,29 @@ msgid "" "compression levels." msgstr "" -#: ../../whatsnew/3.14.rst:2386 +#: ../../whatsnew/3.14.rst:2290 msgid "" "It is worth noting that ``zlib.Z_BEST_SPEED`` (``1``) may result in " "significantly less compression than the previous implementation, whilst also " "significantly reducing the time taken to compress." msgstr "" -#: ../../whatsnew/3.14.rst:2390 +#: ../../whatsnew/3.14.rst:2294 msgid "(Contributed by Steve Dower in :gh:`91349`.)" msgstr "(由 Steve Dower 於 :gh:`91349` 貢獻。)" -#: ../../whatsnew/3.14.rst:2394 +#: ../../whatsnew/3.14.rst:2298 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.14.rst:2399 +#: ../../whatsnew/3.14.rst:2303 msgid "" "Remove the *type*, *choices*, and *metavar* parameters of :class:`!" "BooleanOptionalAction`. These have been deprecated since Python 3.12. " "(Contributed by Nikita Sobolev in :gh:`118805`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2404 +#: ../../whatsnew/3.14.rst:2308 msgid "" "Calling :meth:`~argparse.ArgumentParser.add_argument_group` on an argument " "group now raises a :exc:`ValueError`. Similarly, :meth:`~argparse." @@ -3594,34 +3386,34 @@ msgid "" "Savannah Ostrowski in :gh:`127186`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2418 +#: ../../whatsnew/3.14.rst:2322 msgid "" "Remove the following classes, which have been deprecated aliases of :class:" "`~ast.Constant` since Python 3.8 and have emitted deprecation warnings since " "Python 3.12:" msgstr "" -#: ../../whatsnew/3.14.rst:2422 +#: ../../whatsnew/3.14.rst:2326 msgid ":class:`!Bytes`" msgstr "" -#: ../../whatsnew/3.14.rst:2423 +#: ../../whatsnew/3.14.rst:2327 msgid ":class:`!Ellipsis`" msgstr "" -#: ../../whatsnew/3.14.rst:2424 +#: ../../whatsnew/3.14.rst:2328 msgid ":class:`!NameConstant`" msgstr "" -#: ../../whatsnew/3.14.rst:2425 +#: ../../whatsnew/3.14.rst:2329 msgid ":class:`!Num`" msgstr "" -#: ../../whatsnew/3.14.rst:2426 +#: ../../whatsnew/3.14.rst:2330 msgid ":class:`!Str`" msgstr "" -#: ../../whatsnew/3.14.rst:2428 +#: ../../whatsnew/3.14.rst:2332 msgid "" "As a consequence of these removals, user-defined ``visit_Num``, " "``visit_Str``, ``visit_Bytes``, ``visit_NameConstant`` and " @@ -3630,106 +3422,106 @@ msgid "" "an AST. Define a ``visit_Constant`` method instead." msgstr "" -#: ../../whatsnew/3.14.rst:2434 +#: ../../whatsnew/3.14.rst:2338 msgid "(Contributed by Alex Waygood in :gh:`119562`.)" msgstr "(由 Alex Waygood 於 :gh:`119562` 貢獻。)" -#: ../../whatsnew/3.14.rst:2436 +#: ../../whatsnew/3.14.rst:2340 msgid "" "Remove the following deprecated properties on :class:`ast.Constant`, which " "were present for compatibility with the now-removed AST classes:" msgstr "" -#: ../../whatsnew/3.14.rst:2439 +#: ../../whatsnew/3.14.rst:2343 msgid ":attr:`!Constant.n`" msgstr "" -#: ../../whatsnew/3.14.rst:2440 +#: ../../whatsnew/3.14.rst:2344 msgid ":attr:`!Constant.s`" msgstr "" -#: ../../whatsnew/3.14.rst:2442 +#: ../../whatsnew/3.14.rst:2346 msgid "" "Use :attr:`!Constant.value` instead. (Contributed by Alex Waygood in :gh:" "`119562`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2449 +#: ../../whatsnew/3.14.rst:2353 msgid "" "Remove the following classes, methods, and functions, which have been " "deprecated since Python 3.12:" msgstr "" -#: ../../whatsnew/3.14.rst:2452 +#: ../../whatsnew/3.14.rst:2356 msgid ":class:`!AbstractChildWatcher`" msgstr "" -#: ../../whatsnew/3.14.rst:2453 +#: ../../whatsnew/3.14.rst:2357 msgid ":class:`!FastChildWatcher`" msgstr "" -#: ../../whatsnew/3.14.rst:2454 +#: ../../whatsnew/3.14.rst:2358 msgid ":class:`!MultiLoopChildWatcher`" msgstr "" -#: ../../whatsnew/3.14.rst:2455 +#: ../../whatsnew/3.14.rst:2359 msgid ":class:`!PidfdChildWatcher`" msgstr "" -#: ../../whatsnew/3.14.rst:2456 +#: ../../whatsnew/3.14.rst:2360 msgid ":class:`!SafeChildWatcher`" msgstr "" -#: ../../whatsnew/3.14.rst:2457 +#: ../../whatsnew/3.14.rst:2361 msgid ":class:`!ThreadedChildWatcher`" msgstr "" -#: ../../whatsnew/3.14.rst:2458 +#: ../../whatsnew/3.14.rst:2362 msgid ":meth:`!AbstractEventLoopPolicy.get_child_watcher`" msgstr "" -#: ../../whatsnew/3.14.rst:2459 +#: ../../whatsnew/3.14.rst:2363 msgid ":meth:`!AbstractEventLoopPolicy.set_child_watcher`" msgstr "" -#: ../../whatsnew/3.14.rst:2460 +#: ../../whatsnew/3.14.rst:2364 msgid ":func:`!get_child_watcher`" msgstr "" -#: ../../whatsnew/3.14.rst:2461 +#: ../../whatsnew/3.14.rst:2365 msgid ":func:`!set_child_watcher`" msgstr "" -#: ../../whatsnew/3.14.rst:2463 +#: ../../whatsnew/3.14.rst:2367 msgid "(Contributed by Kumar Aditya in :gh:`120804`.)" msgstr "(由 Kumar Aditya 於 :gh:`120804` 貢獻。)" -#: ../../whatsnew/3.14.rst:2465 +#: ../../whatsnew/3.14.rst:2369 msgid "" ":func:`asyncio.get_event_loop` now raises a :exc:`RuntimeError` if there is " "no current event loop, and no longer implicitly creates an event loop." msgstr "" -#: ../../whatsnew/3.14.rst:2469 +#: ../../whatsnew/3.14.rst:2373 msgid "(Contributed by Kumar Aditya in :gh:`126353`.)" msgstr "(由 Kumar Aditya 於 :gh:`126353` 貢獻。)" -#: ../../whatsnew/3.14.rst:2474 +#: ../../whatsnew/3.14.rst:2378 msgid "" "There's a few patterns that use :func:`asyncio.get_event_loop`, most of them " "can be replaced with :func:`asyncio.run`." msgstr "" -#: ../../whatsnew/3.14.rst:2477 +#: ../../whatsnew/3.14.rst:2381 msgid "If you're running an async function, simply use :func:`asyncio.run`." msgstr "" -#: ../../whatsnew/3.14.rst:2479 ../../whatsnew/3.14.rst:2506 -#: ../../whatsnew/3.14.rst:2534 +#: ../../whatsnew/3.14.rst:2383 ../../whatsnew/3.14.rst:2410 +#: ../../whatsnew/3.14.rst:2438 msgid "Before:" msgstr "" -#: ../../whatsnew/3.14.rst:2481 +#: ../../whatsnew/3.14.rst:2385 msgid "" "async def main():\n" " ...\n" @@ -3742,12 +3534,12 @@ msgid "" " loop.close()" msgstr "" -#: ../../whatsnew/3.14.rst:2493 ../../whatsnew/3.14.rst:2519 -#: ../../whatsnew/3.14.rst:2550 +#: ../../whatsnew/3.14.rst:2397 ../../whatsnew/3.14.rst:2423 +#: ../../whatsnew/3.14.rst:2454 msgid "After:" msgstr "" -#: ../../whatsnew/3.14.rst:2495 +#: ../../whatsnew/3.14.rst:2399 msgid "" "async def main():\n" " ...\n" @@ -3755,13 +3547,13 @@ msgid "" "asyncio.run(main())" msgstr "" -#: ../../whatsnew/3.14.rst:2502 +#: ../../whatsnew/3.14.rst:2406 msgid "" "If you need to start something, for example, a server listening on a socket " "and then run forever, use :func:`asyncio.run` and an :class:`asyncio.Event`." msgstr "" -#: ../../whatsnew/3.14.rst:2508 +#: ../../whatsnew/3.14.rst:2412 msgid "" "def start_server(loop): ...\n" "\n" @@ -3773,7 +3565,7 @@ msgid "" " loop.close()" msgstr "" -#: ../../whatsnew/3.14.rst:2521 +#: ../../whatsnew/3.14.rst:2425 msgid "" "def start_server(loop): ...\n" "\n" @@ -3784,13 +3576,13 @@ msgid "" "asyncio.run(main())" msgstr "" -#: ../../whatsnew/3.14.rst:2531 +#: ../../whatsnew/3.14.rst:2435 msgid "" "If you need to run something in an event loop, then run some blocking code " "around it, use :class:`asyncio.Runner`." msgstr "" -#: ../../whatsnew/3.14.rst:2536 +#: ../../whatsnew/3.14.rst:2440 msgid "" "async def operation_one(): ...\n" "def blocking_code(): ...\n" @@ -3805,7 +3597,7 @@ msgid "" " loop.close()" msgstr "" -#: ../../whatsnew/3.14.rst:2552 +#: ../../whatsnew/3.14.rst:2456 msgid "" "async def operation_one(): ...\n" "def blocking_code(): ...\n" @@ -3817,65 +3609,65 @@ msgid "" " runner.run(operation_two())" msgstr "" -#: ../../whatsnew/3.14.rst:2564 +#: ../../whatsnew/3.14.rst:2469 msgid "email" msgstr "email" -#: ../../whatsnew/3.14.rst:2566 +#: ../../whatsnew/3.14.rst:2471 msgid "" "Remove :func:`email.utils.localtime`'s *isdst* parameter, which was " "deprecated in and has been ignored since Python 3.12. (Contributed by Hugo " "van Kemenade in :gh:`118798`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2572 +#: ../../whatsnew/3.14.rst:2477 msgid "importlib.abc" msgstr "" -#: ../../whatsnew/3.14.rst:2574 +#: ../../whatsnew/3.14.rst:2479 msgid "Remove deprecated :mod:`importlib.abc` classes:" msgstr "" -#: ../../whatsnew/3.14.rst:2576 +#: ../../whatsnew/3.14.rst:2481 msgid "" ":class:`!ResourceReader` (use :class:`~importlib.resources.abc." "TraversableResources`)" msgstr "" -#: ../../whatsnew/3.14.rst:2578 +#: ../../whatsnew/3.14.rst:2483 msgid "" ":class:`!Traversable` (use :class:`~importlib.resources.abc.Traversable`)" msgstr "" -#: ../../whatsnew/3.14.rst:2580 +#: ../../whatsnew/3.14.rst:2485 msgid "" ":class:`!TraversableResources` (use :class:`~importlib.resources.abc." "TraversableResources`)" msgstr "" -#: ../../whatsnew/3.14.rst:2583 +#: ../../whatsnew/3.14.rst:2488 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../whatsnew/3.14.rst:2587 +#: ../../whatsnew/3.14.rst:2492 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.14.rst:2589 +#: ../../whatsnew/3.14.rst:2494 msgid "" "Remove support for copy, deepcopy, and pickle operations from :mod:" "`itertools` iterators. These have emitted a :exc:`DeprecationWarning` since " "Python 3.12. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2598 +#: ../../whatsnew/3.14.rst:2503 msgid "" "Remove support for passing additional keyword arguments to :class:`~pathlib." "Path`. In previous versions, any such arguments are ignored. (Contributed by " "Barney Gale in :gh:`74033`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2603 +#: ../../whatsnew/3.14.rst:2508 msgid "" "Remove support for passing additional positional arguments to :meth:`." "PurePath.relative_to` and :meth:`~pathlib.PurePath.is_relative_to`. In " @@ -3883,33 +3675,33 @@ msgid "" "by Barney Gale in :gh:`78707`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2610 +#: ../../whatsnew/3.14.rst:2515 msgid "pkgutil" msgstr "" -#: ../../whatsnew/3.14.rst:2612 +#: ../../whatsnew/3.14.rst:2517 msgid "" "Remove the :func:`!get_loader` and :func:`!find_loader` functions, which " "have been deprecated since Python 3.12. (Contributed by Bénédikt Tran in :gh:" "`97850`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2618 +#: ../../whatsnew/3.14.rst:2523 msgid "pty" msgstr "" -#: ../../whatsnew/3.14.rst:2620 +#: ../../whatsnew/3.14.rst:2525 msgid "" "Remove the :func:`!master_open` and :func:`!slave_open` functions, which " "have been deprecated since Python 3.12. Use :func:`pty.openpty` instead. " "(Contributed by Nikita Sobolev in :gh:`118824`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2627 +#: ../../whatsnew/3.14.rst:2532 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.14.rst:2629 +#: ../../whatsnew/3.14.rst:2534 msgid "" "Remove :data:`!version` and :data:`!version_info` from the :mod:`sqlite3` " "module; use :data:`~sqlite3.sqlite_version` and :data:`~sqlite3." @@ -3917,27 +3709,27 @@ msgid "" "library. (Contributed by Hugo van Kemenade in :gh:`118924`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2635 +#: ../../whatsnew/3.14.rst:2540 msgid "" "Using a sequence of parameters with named placeholders now raises a :exc:" "`~sqlite3.ProgrammingError`, having been deprecated since Python 3.12. " "(Contributed by Erlend E. Aasland in :gh:`118928` and :gh:`101693`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2644 +#: ../../whatsnew/3.14.rst:2549 msgid "" "Remove the :class:`!Quoter` class from :mod:`urllib.parse`, which has been " "deprecated since Python 3.11. (Contributed by Nikita Sobolev in :gh:" "`118827`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2648 +#: ../../whatsnew/3.14.rst:2553 msgid "" "Remove the :class:`!URLopener` and :class:`!FancyURLopener` classes from :" "mod:`urllib.request`, which have been deprecated since Python 3.3." msgstr "" -#: ../../whatsnew/3.14.rst:2652 +#: ../../whatsnew/3.14.rst:2557 msgid "" "``myopener.open()`` can be replaced with :func:`~urllib.request.urlopen`. " "``myopener.retrieve()`` can be replaced with :func:`~urllib.request." @@ -3946,99 +3738,117 @@ msgid "" "(Contributed by Barney Gale in :gh:`84850`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2661 +#: ../../whatsnew/3.14.rst:2566 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.14.rst:2663 +#: ../../whatsnew/3.14.rst:2569 +msgid "New deprecations" +msgstr "" + +#: ../../whatsnew/3.14.rst:2571 +#, fuzzy +msgid "" +"Passing a complex number as the *real* or *imag* argument in the :func:" +"`complex` constructor is now deprecated; complex numbers should only be " +"passed as a single positional argument. (Contributed by Serhiy Storchaka in :" +"gh:`109218`.)" +msgstr "" +"在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" +"它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" + +#: ../../whatsnew/3.14.rst:2576 #: ../../deprecations/pending-removal-in-future.rst:7 msgid ":mod:`argparse`:" msgstr ":mod:`argparse`:" -#: ../../whatsnew/3.14.rst:2665 +#: ../../whatsnew/3.14.rst:2578 +#, fuzzy msgid "" -"Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse." -"ArgumentParser.add_argument_group` is now deprecated. (Contributed by " -"Savannah Ostrowski in :gh:`125563`.)" +"Passing the undocumented keyword argument *prefix_chars* to the :meth:" +"`~argparse.ArgumentParser.add_argument_group` method is now deprecated. " +"(Contributed by Savannah Ostrowski in :gh:`125563`.)" msgstr "" +"將未以文件記錄的關鍵字引數 *prefix_chars* 傳遞給 :meth:`~argparse." +"ArgumentParser.add_argument_group` 的做法現在已被棄用。" -#: ../../whatsnew/3.14.rst:2669 +#: ../../whatsnew/3.14.rst:2582 msgid "" -"Deprecated the :class:`argparse.FileType` type converter. Anything with " -"resource management should be done downstream after the arguments are " -"parsed. (Contributed by Serhiy Storchaka in :gh:`58032`.)" +"Deprecated the :class:`argparse.FileType` type converter. Anything relating " +"to resource management should be handled downstream, after the arguments " +"have been parsed. (Contributed by Serhiy Storchaka in :gh:`58032`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2674 +#: ../../whatsnew/3.14.rst:2587 #: ../../deprecations/pending-removal-in-3.16.rst:19 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../whatsnew/3.14.rst:2676 -#: ../../deprecations/pending-removal-in-3.16.rst:21 +#: ../../whatsnew/3.14.rst:2589 +#, fuzzy msgid "" -":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " -"Python 3.16; use :func:`inspect.iscoroutinefunction` instead. (Contributed " -"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" +"The :func:`!asyncio.iscoroutinefunction` is now deprecated and will be " +"removed in Python 3.16; use :func:`inspect.iscoroutinefunction` instead. " +"(Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)" msgstr "" ":func:`!asyncio.iscoroutinefunction` 已被棄用並將在 Python 3.16 中移除;請改" "用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" "gh:`122875` 貢獻。)" -#: ../../whatsnew/3.14.rst:2681 -#: ../../deprecations/pending-removal-in-3.16.rst:26 +#: ../../whatsnew/3.14.rst:2594 +#, fuzzy msgid "" -":mod:`asyncio` policy system is deprecated and will be removed in Python " +"The :mod:`asyncio` policy system is deprecated and will be removed in Python " "3.16. In particular, the following classes and functions are deprecated:" msgstr "" ":mod:`asyncio` 策略系統已被棄用並將在 Python 3.16 中移除。特別是以下類別和函" "式已被棄用:" -#: ../../whatsnew/3.14.rst:2684 +#: ../../whatsnew/3.14.rst:2598 #: ../../deprecations/pending-removal-in-3.16.rst:29 msgid ":class:`asyncio.AbstractEventLoopPolicy`" msgstr ":class:`asyncio.AbstractEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2685 +#: ../../whatsnew/3.14.rst:2599 #: ../../deprecations/pending-removal-in-3.16.rst:30 msgid ":class:`asyncio.DefaultEventLoopPolicy`" msgstr ":class:`asyncio.DefaultEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2686 +#: ../../whatsnew/3.14.rst:2600 #: ../../deprecations/pending-removal-in-3.16.rst:31 msgid ":class:`asyncio.WindowsSelectorEventLoopPolicy`" msgstr ":class:`asyncio.WindowsSelectorEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2687 +#: ../../whatsnew/3.14.rst:2601 #: ../../deprecations/pending-removal-in-3.16.rst:32 msgid ":class:`asyncio.WindowsProactorEventLoopPolicy`" msgstr ":class:`asyncio.WindowsProactorEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2688 +#: ../../whatsnew/3.14.rst:2602 #: ../../deprecations/pending-removal-in-3.16.rst:33 msgid ":func:`asyncio.get_event_loop_policy`" msgstr ":func:`asyncio.get_event_loop_policy`" -#: ../../whatsnew/3.14.rst:2689 +#: ../../whatsnew/3.14.rst:2603 #: ../../deprecations/pending-removal-in-3.16.rst:34 msgid ":func:`asyncio.set_event_loop_policy`" msgstr ":func:`asyncio.set_event_loop_policy`" -#: ../../whatsnew/3.14.rst:2691 -#: ../../deprecations/pending-removal-in-3.16.rst:36 +#: ../../whatsnew/3.14.rst:2605 +#, fuzzy msgid "" -"Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with " -"*loop_factory* to use the desired event loop implementation." +"Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with the " +"*loop_factory* argument to use the desired event loop implementation." msgstr "" "使用者應該使用 :func:`asyncio.run` 或 :class:`asyncio.Runner` 搭配 " "*loop_factory* 來使用所需的事件迴圈實作。" -#: ../../whatsnew/3.14.rst:2694 -#: ../../deprecations/pending-removal-in-3.16.rst:39 -msgid "For example, to use :class:`asyncio.SelectorEventLoop` on Windows::" +#: ../../whatsnew/3.14.rst:2608 +#, fuzzy +msgid "For example, to use :class:`asyncio.SelectorEventLoop` on Windows:" msgstr "例如在 Windows 上使用 :class:`asyncio.SelectorEventLoop`: ::" -#: ../../whatsnew/3.14.rst:2696 +#: ../../whatsnew/3.14.rst:2610 #: ../../deprecations/pending-removal-in-3.16.rst:41 msgid "" "import asyncio\n" @@ -4055,110 +3865,120 @@ msgstr "" "\n" "asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)" -#: ../../whatsnew/3.14.rst:2703 +#: ../../whatsnew/3.14.rst:2619 #: ../../deprecations/pending-removal-in-3.16.rst:48 msgid "(Contributed by Kumar Aditya in :gh:`127949`.)" msgstr "(由 Kumar Aditya 於 :gh:`127949` 貢獻。)" -#: ../../whatsnew/3.14.rst:2705 -msgid "" -":mod:`builtins`: Passing a complex number as the *real* or *imag* argument " -"in the :func:`complex` constructor is now deprecated; it should only be " -"passed as a single positional argument. (Contributed by Serhiy Storchaka in :" -"gh:`109218`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:2711 +#: ../../whatsnew/3.14.rst:2621 +#, fuzzy msgid "" -":mod:`codecs`: :func:`codecs.open` is now deprecated. Use :func:`open` " -"instead. (Contributed by Inada Naoki in :gh:`133036`.)" +":mod:`codecs`: The :func:`codecs.open` function is now deprecated, and will " +"be removed in a future version of Python. Use :func:`open` instead. " +"(Contributed by Inada Naoki in :gh:`133036`.)" msgstr "" +":func:`!asyncio.iscoroutinefunction` 已被棄用並將在 Python 3.16 中移除;請改" +"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" +"gh:`122875` 貢獻。)" -#: ../../whatsnew/3.14.rst:2715 +#: ../../whatsnew/3.14.rst:2627 #: ../../deprecations/pending-removal-in-3.15.rst:16 #: ../../deprecations/pending-removal-in-3.19.rst:4 msgid ":mod:`ctypes`:" msgstr ":mod:`ctypes`:" -#: ../../whatsnew/3.14.rst:2717 +#: ../../whatsnew/3.14.rst:2629 msgid "" "On non-Windows platforms, setting :attr:`.Structure._pack_` to use a MSVC-" -"compatible default memory layout is deprecated in favor of setting :attr:`." -"Structure._layout_` to ``'ms'``. (Contributed by Petr Viktorin in :gh:" -"`131747`.)" +"compatible default memory layout is now deprecated in favor of setting :attr:" +"`.Structure._layout_` to ``'ms'``, and will be removed in Python 3.19. " +"(Contributed by Petr Viktorin in :gh:`131747`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2722 +#: ../../whatsnew/3.14.rst:2634 msgid "" -"Calling :func:`ctypes.POINTER` on a string is deprecated. Use :ref:`ctypes-" -"incomplete-types` for self-referential structures. Also, the internal " -"``ctypes._pointer_type_cache`` is deprecated. See :func:`ctypes.POINTER` for " -"updated implementation details. (Contributed by Sergey Myrianov in :gh:" -"`100926`.)" +"Calling :func:`ctypes.POINTER` on a string is now deprecated. Use :ref:" +"`incomplete types ` for self-referential " +"structures. Also, the internal ``ctypes._pointer_type_cache`` is deprecated. " +"See :func:`ctypes.POINTER` for updated implementation details. (Contributed " +"by Sergey Myrianov in :gh:`100926`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2728 +#: ../../whatsnew/3.14.rst:2641 +#, fuzzy msgid "" ":mod:`functools`: Calling the Python implementation of :func:`functools." "reduce` with *function* or *sequence* as keyword arguments is now " -"deprecated. (Contributed by Kirill Podoprigora in :gh:`121676`.)" +"deprecated; the parameters will be made positional-only in Python 3.16. " +"(Contributed by Kirill Podoprigora in :gh:`121676`.)" msgstr "" +"自 Python 3.14 起,使用 *function* 或 *sequence* 關鍵字引數呼叫 :func:" +"`functools.reduce` 的 Python 實作已被棄用。" -#: ../../whatsnew/3.14.rst:2733 +#: ../../whatsnew/3.14.rst:2647 +#, fuzzy msgid "" ":mod:`logging`: Support for custom logging handlers with the *strm* argument " -"is deprecated and scheduled for removal in Python 3.16. Define handlers with " -"the *stream* argument instead. (Contributed by Mariusz Felisiak in :gh:" +"is now deprecated and scheduled for removal in Python 3.16. Define handlers " +"with the *stream* argument instead. (Contributed by Mariusz Felisiak in :gh:" "`115032`.)" msgstr "" +"對具有 *strm* 引數的自訂日誌記錄處理函式的支援已被棄用,並計劃在 Python 3.16 " +"中移除。請改用 *stream* 引數。(由 Mariusz Felisiak 於 :gh:`115032` 貢獻。)" -#: ../../whatsnew/3.14.rst:2738 +#: ../../whatsnew/3.14.rst:2653 +#, fuzzy msgid "" -":mod:`mimetypes`: Valid extensions start with a '.' or are empty for :meth:" -"`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated and will " -"raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade " -"in :gh:`75223`.)" +":mod:`mimetypes`: Valid extensions are either empty or must start with '.' " +"for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated " +"and will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van " +"Kemenade in :gh:`75223`.)" msgstr "" +"有效的副檔名以 '.' 開頭或對 :meth:`mimetypes.MimeTypes.add_type` 為空字串。未" +"加點的副檔名已被棄用,並將在 Python 3.16 中引發 :exc:`ValueError`。(由 Hugo " +"van Kemenade 於 :gh:`75223` 貢獻。)" -#: ../../whatsnew/3.14.rst:2745 +#: ../../whatsnew/3.14.rst:2660 msgid "" ":mod:`!nturl2path`: This module is now deprecated. Call :func:`urllib." "request.url2pathname` and :func:`~urllib.request.pathname2url` instead. " "(Contributed by Barney Gale in :gh:`125866`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2750 +#: ../../whatsnew/3.14.rst:2665 msgid "" -":mod:`os`: :term:`Soft deprecate ` :func:`os.popen` and :" -"func:`os.spawn* ` functions. They should no longer be used to " -"write new code. The :mod:`subprocess` module is recommended instead. " -"(Contributed by Victor Stinner in :gh:`120743`.)" +":mod:`os`: The :func:`os.popen` and :func:`os.spawn* ` functions " +"are now :term:`soft deprecated`. They should no longer be used to write new " +"code. The :mod:`subprocess` module is recommended instead. (Contributed by " +"Victor Stinner in :gh:`120743`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2756 +#: ../../whatsnew/3.14.rst:2672 msgid "" -":mod:`pathlib`: :meth:`!pathlib.PurePath.as_uri` is deprecated and will be " -"removed in Python 3.19. Use :meth:`pathlib.Path.as_uri` instead. " -"(Contributed by Barney Gale in :gh:`123599`.)" +":mod:`pathlib`: :meth:`!pathlib.PurePath.as_uri` is now deprecated and " +"scheduled for removal in Python 3.19. Use :meth:`pathlib.Path.as_uri` " +"instead. (Contributed by Barney Gale in :gh:`123599`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2761 +#: ../../whatsnew/3.14.rst:2678 msgid "" ":mod:`pdb`: The undocumented ``pdb.Pdb.curframe_locals`` attribute is now a " -"deprecated read-only property. The low overhead dynamic frame locals access " -"added in Python 3.13 by PEP 667 means the frame locals cache reference " -"previously stored in this attribute is no longer needed. Derived debuggers " -"should access ``pdb.Pdb.curframe.f_locals`` directly in Python 3.13 and " -"later versions. (Contributed by Tian Gao in :gh:`124369` and :gh:`125951`.)" +"deprecated read-only property, which will be removed in a future version of " +"Python. The low overhead dynamic frame locals access added in Python 3.13 " +"by :pep:`667` means the frame locals cache reference previously stored in " +"this attribute is no longer needed. Derived debuggers should access ``pdb." +"Pdb.curframe.f_locals`` directly in Python 3.13 and later versions. " +"(Contributed by Tian Gao in :gh:`124369` and :gh:`125951`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2769 +#: ../../whatsnew/3.14.rst:2687 msgid "" ":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " -"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +"lack of interest, scheduled for removal in Python 3.16. (Contributed by " +"Bénédikt Tran in :gh:`119698`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2773 +#: ../../whatsnew/3.14.rst:2692 msgid "" ":mod:`tkinter`: The :class:`!tkinter.Variable` methods :meth:`!" "trace_variable`, :meth:`!trace_vdelete` and :meth:`!trace_vinfo` are now " @@ -4166,13 +3986,12 @@ msgid "" "trace_info` instead. (Contributed by Serhiy Storchaka in :gh:`120220`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2780 +#: ../../whatsnew/3.14.rst:2698 msgid "" ":mod:`urllib.parse`: Accepting objects with false values (like ``0`` and " -"``[]``) except empty strings, byte-like objects and ``None`` in :mod:`urllib." -"parse` functions :func:`~urllib.parse.parse_qsl` and :func:`~urllib.parse." -"parse_qs` is now deprecated. (Contributed by Serhiy Storchaka in :gh:" -"`116897`.)" +"``[]``) except empty strings, bytes-like objects and ``None`` in :func:" +"`~urllib.parse.parse_qsl` and :func:`~urllib.parse.parse_qs` is now " +"deprecated. (Contributed by Serhiy Storchaka in :gh:`116897`.)" msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:2 @@ -4237,7 +4056,7 @@ msgstr "" "cgi` 旗標已被棄用。" #: ../../deprecations/pending-removal-in-3.15.rst:32 -#: ../../deprecations/pending-removal-in-future.rst:64 +#: ../../deprecations/pending-removal-in-future.rst:63 msgid ":mod:`importlib`:" msgstr ":mod:`importlib`:" @@ -4332,7 +4151,7 @@ msgstr "" "`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:80 -#: ../../deprecations/pending-removal-in-3.17.rst:4 +#: ../../deprecations/pending-removal-in-3.17.rst:26 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" @@ -4428,6 +4247,36 @@ msgstr "" "Python 3.13 起在 runtime 已被棄用。請使用 ``'w'`` 格式碼 (:c:type:`Py_UCS4`) " "來取代 Unicode 字元。" +#: ../../deprecations/pending-removal-in-3.16.rst:21 +msgid "" +":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " +"Python 3.16; use :func:`inspect.iscoroutinefunction` instead. (Contributed " +"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" +msgstr "" +":func:`!asyncio.iscoroutinefunction` 已被棄用並將在 Python 3.16 中移除;請改" +"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" +"gh:`122875` 貢獻。)" + +#: ../../deprecations/pending-removal-in-3.16.rst:26 +msgid "" +":mod:`asyncio` policy system is deprecated and will be removed in Python " +"3.16. In particular, the following classes and functions are deprecated:" +msgstr "" +":mod:`asyncio` 策略系統已被棄用並將在 Python 3.16 中移除。特別是以下類別和函" +"式已被棄用:" + +#: ../../deprecations/pending-removal-in-3.16.rst:36 +msgid "" +"Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with " +"*loop_factory* to use the desired event loop implementation." +msgstr "" +"使用者應該使用 :func:`asyncio.run` 或 :class:`asyncio.Runner` 搭配 " +"*loop_factory* 來使用所需的事件迴圈實作。" + +#: ../../deprecations/pending-removal-in-3.16.rst:39 +msgid "For example, to use :class:`asyncio.SelectorEventLoop` on Windows::" +msgstr "例如在 Windows 上使用 :class:`asyncio.SelectorEventLoop`: ::" + #: ../../deprecations/pending-removal-in-3.16.rst:50 #: ../../deprecations/pending-removal-in-future.rst:16 msgid ":mod:`builtins`:" @@ -4550,8 +4399,46 @@ msgstr "" msgid "Pending removal in Python 3.17" msgstr "Python 3.17 中待移除的項目" +#: ../../deprecations/pending-removal-in-3.17.rst:4 +msgid ":mod:`collections.abc`:" +msgstr ":mod:`collections.abc`:" + #: ../../deprecations/pending-removal-in-3.17.rst:6 msgid "" +":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:8 +#: ../../deprecations/pending-removal-in-3.17.rst:36 +msgid "" +"Use ``isinstance(obj, collections.abc.Buffer)`` to test if ``obj`` " +"implements the :ref:`buffer protocol ` at runtime. For use in " +"type annotations, either use :class:`~collections.abc.Buffer` or a union " +"that explicitly specifies the types your code supports (e.g., ``bytes | " +"bytearray | memoryview``)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:14 +#: ../../deprecations/pending-removal-in-3.17.rst:42 +msgid "" +":class:`!ByteString` was originally intended to be an abstract class that " +"would serve as a supertype of both :class:`bytes` and :class:`bytearray`. " +"However, since the ABC never had any methods, knowing that an object was an " +"instance of :class:`!ByteString` never actually told you anything useful " +"about the object. Other common buffer types such as :class:`memoryview` were " +"also never understood as subtypes of :class:`!ByteString` (either at runtime " +"or by static type checkers)." +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:22 +#: ../../deprecations/pending-removal-in-3.17.rst:50 +msgid "" +"See :pep:`PEP 688 <688#current-options>` for more details. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.17.rst:28 +msgid "" "Before Python 3.14, old-style unions were implemented using the private " "class ``typing._UnionGenericAlias``. This class is no longer needed for the " "implementation, but it has been retained for backward compatibility, with " @@ -4564,35 +4451,11 @@ msgstr "" "除。使用者應該改用文件中記錄的內省輔助函式,例如 :func:`typing.get_origin` " "和 :func:`typing.get_args`,或者依賴私有實作細節。" -#: ../../deprecations/pending-removal-in-3.17.rst:11 +#: ../../deprecations/pending-removal-in-3.17.rst:33 msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " -"removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :class:" -"`~collections.abc.Buffer`. For use in type annotations, prefer a union, like " -"``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by " -"Shantanu Jain in :gh:`91896`.)" -msgstr "" -"自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python " -"3.17 中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:`~" -"collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " -"bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" - -#: ../../deprecations/pending-removal-in-3.17.rst:17 -msgid ":mod:`collections.abc`:" -msgstr ":mod:`collections.abc`:" - -#: ../../deprecations/pending-removal-in-3.17.rst:19 -msgid "" -":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. " -"Prefer :class:`~collections.abc.Sequence` or :class:`~collections.abc." -"Buffer`. For use in type annotations, prefer a union, like ``bytes | " -"bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " -"Jain in :gh:`91896`.)" +"removal in Python 3.17." msgstr "" -":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 " -":class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" -"型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections.abc." -"Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" #: ../../deprecations/pending-removal-in-3.19.rst:2 msgid "Pending removal in Python 3.19" @@ -4636,10 +4499,6 @@ msgid "The :class:`argparse.FileType` type converter is deprecated." msgstr ":class:`argparse.FileType` 型別轉換器已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:18 -msgid "``bool(NotImplemented)``." -msgstr "``bool(NotImplemented)``。" - -#: ../../deprecations/pending-removal-in-future.rst:19 msgid "" "Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " "is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " @@ -4648,7 +4507,7 @@ msgstr "" "產生器:``throw(type, exc, tb)`` 和 ``athrow(type, exc, tb)`` 簽名已被棄用:" "請改用 ``throw(exc)`` 和 ``athrow(exc)``,為單引數簽名。" -#: ../../deprecations/pending-removal-in-future.rst:22 +#: ../../deprecations/pending-removal-in-future.rst:21 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -4666,7 +4525,7 @@ msgstr "" "`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版" "本中,它將被更改為語法錯誤。(:gh:`87999`)" -#: ../../deprecations/pending-removal-in-future.rst:30 +#: ../../deprecations/pending-removal-in-future.rst:29 msgid "" "Support for ``__index__()`` and ``__int__()`` method returning non-int type: " "these methods will be required to return an instance of a strict subclass " @@ -4675,7 +4534,7 @@ msgstr "" "``__index__()`` 和 ``__int__()`` 方法回傳非 int 型別的支援:這些方法將需要回" "傳 :class:`int` 的嚴格子類別實例。" -#: ../../deprecations/pending-removal-in-future.rst:33 +#: ../../deprecations/pending-removal-in-future.rst:32 msgid "" "Support for ``__float__()`` method returning a strict subclass of :class:" "`float`: these methods will be required to return an instance of :class:" @@ -4684,7 +4543,7 @@ msgstr "" "回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回" "傳 :class:`float` 的實例。" -#: ../../deprecations/pending-removal-in-future.rst:36 +#: ../../deprecations/pending-removal-in-future.rst:35 msgid "" "Support for ``__complex__()`` method returning a strict subclass of :class:" "`complex`: these methods will be required to return an instance of :class:" @@ -4693,11 +4552,11 @@ msgstr "" "回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要" "回傳 :class:`complex` 的實例。" -#: ../../deprecations/pending-removal-in-future.rst:39 +#: ../../deprecations/pending-removal-in-future.rst:38 msgid "Delegation of ``int()`` to ``__trunc__()`` method." msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" -#: ../../deprecations/pending-removal-in-future.rst:40 +#: ../../deprecations/pending-removal-in-future.rst:39 msgid "" "Passing a complex number as the *real* or *imag* argument in the :func:" "`complex` constructor is now deprecated; it should only be passed as a " @@ -4707,7 +4566,7 @@ msgstr "" "在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" "它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:45 +#: ../../deprecations/pending-removal-in-future.rst:44 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." @@ -4717,25 +4576,25 @@ msgstr "" "被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince " "Roshan 於 :gh:`103636` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:50 +#: ../../deprecations/pending-removal-in-future.rst:49 msgid "" ":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:" "`133038`)" msgstr "" ":mod:`codecs`:請改用 :func:`open` 而非 :func:`codecs.open`。(:gh:`133038`)" -#: ../../deprecations/pending-removal-in-future.rst:52 +#: ../../deprecations/pending-removal-in-future.rst:51 msgid "" ":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " "instead." msgstr "" ":attr:`codeobject.co_lnotab`:請改用 :meth:`codeobject.co_lines` 方法。" -#: ../../deprecations/pending-removal-in-future.rst:55 +#: ../../deprecations/pending-removal-in-future.rst:54 msgid ":mod:`datetime`:" msgstr ":mod:`datetime`:" -#: ../../deprecations/pending-removal-in-future.rst:57 +#: ../../deprecations/pending-removal-in-future.rst:56 msgid "" ":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." "UTC)``." @@ -4743,7 +4602,7 @@ msgstr "" ":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime." "now(tz=datetime.UTC)``。" -#: ../../deprecations/pending-removal-in-future.rst:59 +#: ../../deprecations/pending-removal-in-future.rst:58 msgid "" ":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." "fromtimestamp(timestamp, tz=datetime.UTC)``." @@ -4751,11 +4610,11 @@ msgstr "" ":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime." "fromtimestamp(timestamp, tz=datetime.UTC)``。" -#: ../../deprecations/pending-removal-in-future.rst:62 +#: ../../deprecations/pending-removal-in-future.rst:61 msgid ":mod:`gettext`: Plural value must be an integer." msgstr ":mod:`gettext`:複數值必須是整數。" -#: ../../deprecations/pending-removal-in-future.rst:66 +#: ../../deprecations/pending-removal-in-future.rst:65 msgid "" ":func:`~importlib.util.cache_from_source` *debug_override* parameter is " "deprecated: use the *optimization* parameter instead." @@ -4763,19 +4622,19 @@ msgstr "" ":func:`~importlib.util.cache_from_source` *debug_override* 參數已被棄用:請改" "用 *optimization* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:69 +#: ../../deprecations/pending-removal-in-future.rst:68 msgid ":mod:`importlib.metadata`:" msgstr ":mod:`importlib.metadata`:" -#: ../../deprecations/pending-removal-in-future.rst:71 +#: ../../deprecations/pending-removal-in-future.rst:70 msgid "``EntryPoints`` tuple interface." msgstr "``EntryPoints`` 元組介面。" -#: ../../deprecations/pending-removal-in-future.rst:72 +#: ../../deprecations/pending-removal-in-future.rst:71 msgid "Implicit ``None`` on return values." msgstr "回傳值上的隱式 ``None``。" -#: ../../deprecations/pending-removal-in-future.rst:74 +#: ../../deprecations/pending-removal-in-future.rst:73 msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." @@ -4783,19 +4642,19 @@ msgstr "" ":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" "`~logging.warning`。" -#: ../../deprecations/pending-removal-in-future.rst:77 +#: ../../deprecations/pending-removal-in-future.rst:76 msgid "" ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " "BytesIO and binary mode instead." msgstr "" ":mod:`mailbox`:已棄用 StringIO 輸入和文本模式,請改用 BytesIO 和二進位模式。" -#: ../../deprecations/pending-removal-in-future.rst:80 +#: ../../deprecations/pending-removal-in-future.rst:79 msgid "" ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." msgstr ":mod:`os`:在多執行緒行程中呼叫 :func:`os.register_at_fork`。" -#: ../../deprecations/pending-removal-in-future.rst:82 +#: ../../deprecations/pending-removal-in-future.rst:81 msgid "" ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " "deprecated, use an exception instance." @@ -4803,7 +4662,7 @@ msgstr "" ":class:`!pydoc.ErrorDuringImport`:*exc_info* 參數的元組值已被棄用,請用例外" "實例。" -#: ../../deprecations/pending-removal-in-future.rst:85 +#: ../../deprecations/pending-removal-in-future.rst:84 msgid "" ":mod:`re`: More strict rules are now applied for numerical group references " "and group names in regular expressions. Only sequence of ASCII digits is " @@ -4815,12 +4674,12 @@ msgstr "" "有 ASCII 數碼序列被接受作為數值參照。位元組模式和替換字串中的群組名稱現在只能" "包含 ASCII 字母、數碼和底線。(由 Serhiy Storchaka 於 :gh:`91760` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:92 +#: ../../deprecations/pending-removal-in-future.rst:91 msgid "" ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr ":mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!sre_parse` 模組。" -#: ../../deprecations/pending-removal-in-future.rst:94 +#: ../../deprecations/pending-removal-in-future.rst:93 msgid "" ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " "Python 3.12; use the *onexc* parameter instead." @@ -4828,15 +4687,15 @@ msgstr "" ":mod:`shutil`::func:`~shutil.rmtree` 的 *onerror* 參數在 Python 3.12 中已被" "棄用;請改用 *onexc* 參數。" -#: ../../deprecations/pending-removal-in-future.rst:97 +#: ../../deprecations/pending-removal-in-future.rst:96 msgid ":mod:`ssl` options and protocols:" msgstr ":mod:`ssl` 選項和協定:" -#: ../../deprecations/pending-removal-in-future.rst:99 +#: ../../deprecations/pending-removal-in-future.rst:98 msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:100 +#: ../../deprecations/pending-removal-in-future.rst:99 msgid "" ":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" "`!selected_npn_protocol` are deprecated: use ALPN instead." @@ -4844,51 +4703,51 @@ msgstr "" ":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" "`!selected_npn_protocol` 已被棄用:請改用 ALPN。" -#: ../../deprecations/pending-removal-in-future.rst:103 +#: ../../deprecations/pending-removal-in-future.rst:102 msgid "``ssl.OP_NO_SSL*`` options" msgstr "``ssl.OP_NO_SSL*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:104 +#: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.OP_NO_TLS*`` options" msgstr "``ssl.OP_NO_TLS*`` 選項" -#: ../../deprecations/pending-removal-in-future.rst:105 +#: ../../deprecations/pending-removal-in-future.rst:104 msgid "``ssl.PROTOCOL_SSLv3``" msgstr "``ssl.PROTOCOL_SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:106 +#: ../../deprecations/pending-removal-in-future.rst:105 msgid "``ssl.PROTOCOL_TLS``" msgstr "``ssl.PROTOCOL_TLS``" -#: ../../deprecations/pending-removal-in-future.rst:107 +#: ../../deprecations/pending-removal-in-future.rst:106 msgid "``ssl.PROTOCOL_TLSv1``" msgstr "``ssl.PROTOCOL_TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:108 +#: ../../deprecations/pending-removal-in-future.rst:107 msgid "``ssl.PROTOCOL_TLSv1_1``" msgstr "``ssl.PROTOCOL_TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:109 +#: ../../deprecations/pending-removal-in-future.rst:108 msgid "``ssl.PROTOCOL_TLSv1_2``" msgstr "``ssl.PROTOCOL_TLSv1_2``" -#: ../../deprecations/pending-removal-in-future.rst:110 +#: ../../deprecations/pending-removal-in-future.rst:109 msgid "``ssl.TLSVersion.SSLv3``" msgstr "``ssl.TLSVersion.SSLv3``" -#: ../../deprecations/pending-removal-in-future.rst:111 +#: ../../deprecations/pending-removal-in-future.rst:110 msgid "``ssl.TLSVersion.TLSv1``" msgstr "``ssl.TLSVersion.TLSv1``" -#: ../../deprecations/pending-removal-in-future.rst:112 +#: ../../deprecations/pending-removal-in-future.rst:111 msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "``ssl.TLSVersion.TLSv1_1``" -#: ../../deprecations/pending-removal-in-future.rst:114 +#: ../../deprecations/pending-removal-in-future.rst:113 msgid ":mod:`threading` methods:" msgstr ":mod:`threading` 方法:" -#: ../../deprecations/pending-removal-in-future.rst:116 +#: ../../deprecations/pending-removal-in-future.rst:115 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." @@ -4896,11 +4755,11 @@ msgstr "" ":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." "notify_all`。" -#: ../../deprecations/pending-removal-in-future.rst:117 +#: ../../deprecations/pending-removal-in-future.rst:116 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set`。" -#: ../../deprecations/pending-removal-in-future.rst:118 +#: ../../deprecations/pending-removal-in-future.rst:117 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." @@ -4908,7 +4767,7 @@ msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:120 +#: ../../deprecations/pending-removal-in-future.rst:119 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." @@ -4916,20 +4775,20 @@ msgstr "" ":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" "attr:`threading.Thread.name` 屬性。" -#: ../../deprecations/pending-removal-in-future.rst:122 +#: ../../deprecations/pending-removal-in-future.rst:121 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" ":meth:`!threading.currentThread`:請用 :meth:`threading.current_thread`。" -#: ../../deprecations/pending-removal-in-future.rst:123 +#: ../../deprecations/pending-removal-in-future.rst:122 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr ":meth:`!threading.activeCount`:請用 :meth:`threading.active_count`。" -#: ../../deprecations/pending-removal-in-future.rst:125 +#: ../../deprecations/pending-removal-in-future.rst:124 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr ":class:`typing.Text` (:gh:`92332`)。" -#: ../../deprecations/pending-removal-in-future.rst:127 +#: ../../deprecations/pending-removal-in-future.rst:126 msgid "" "The internal class ``typing._UnionGenericAlias`` is no longer used to " "implement :class:`typing.Union`. To preserve compatibility with users using " @@ -4940,7 +4799,7 @@ msgstr "" "了保持與此私有類別使用者的相容性,直到至少 Python 3.17 都將提供一個相容性 " "shim。(由 Jelle Zijlstra 於 :gh:`105499` 貢獻。)" -#: ../../deprecations/pending-removal-in-future.rst:132 +#: ../../deprecations/pending-removal-in-future.rst:131 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." @@ -4948,64 +4807,64 @@ msgstr "" ":class:`unittest.IsolatedAsyncioTestCase`:從測試案例中回傳非 ``None`` 的值已" "被棄用。" -#: ../../deprecations/pending-removal-in-future.rst:135 +#: ../../deprecations/pending-removal-in-future.rst:134 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" ":mod:`urllib.parse` 已棄用函式:請改用 :func:`~urllib.parse.urlparse`。" -#: ../../deprecations/pending-removal-in-future.rst:137 +#: ../../deprecations/pending-removal-in-future.rst:136 msgid "``splitattr()``" msgstr "``splitattr()``" -#: ../../deprecations/pending-removal-in-future.rst:138 +#: ../../deprecations/pending-removal-in-future.rst:137 msgid "``splithost()``" msgstr "``splithost()``" -#: ../../deprecations/pending-removal-in-future.rst:139 +#: ../../deprecations/pending-removal-in-future.rst:138 msgid "``splitnport()``" msgstr "``splitnport()``" -#: ../../deprecations/pending-removal-in-future.rst:140 +#: ../../deprecations/pending-removal-in-future.rst:139 msgid "``splitpasswd()``" msgstr "``splitpasswd()``" -#: ../../deprecations/pending-removal-in-future.rst:141 +#: ../../deprecations/pending-removal-in-future.rst:140 msgid "``splitport()``" msgstr "``splitport()``" -#: ../../deprecations/pending-removal-in-future.rst:142 +#: ../../deprecations/pending-removal-in-future.rst:141 msgid "``splitquery()``" msgstr "``splitquery()``" -#: ../../deprecations/pending-removal-in-future.rst:143 +#: ../../deprecations/pending-removal-in-future.rst:142 msgid "``splittag()``" msgstr "``splittag()``" -#: ../../deprecations/pending-removal-in-future.rst:144 +#: ../../deprecations/pending-removal-in-future.rst:143 msgid "``splittype()``" msgstr "``splittype()``" -#: ../../deprecations/pending-removal-in-future.rst:145 +#: ../../deprecations/pending-removal-in-future.rst:144 msgid "``splituser()``" msgstr "``splituser()``" -#: ../../deprecations/pending-removal-in-future.rst:146 +#: ../../deprecations/pending-removal-in-future.rst:145 msgid "``splitvalue()``" msgstr "``splitvalue()``" -#: ../../deprecations/pending-removal-in-future.rst:147 +#: ../../deprecations/pending-removal-in-future.rst:146 msgid "``to_bytes()``" msgstr "``to_bytes()``" -#: ../../deprecations/pending-removal-in-future.rst:149 +#: ../../deprecations/pending-removal-in-future.rst:148 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分寫入。" -#: ../../deprecations/pending-removal-in-future.rst:152 +#: ../../deprecations/pending-removal-in-future.rst:151 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -5016,7 +4875,7 @@ msgstr "" "Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " "``len(elem)`` 或 ``elem is not None`` 測試。" -#: ../../deprecations/pending-removal-in-future.rst:157 +#: ../../deprecations/pending-removal-in-future.rst:156 msgid "" ":func:`sys._clear_type_cache` is deprecated: use :func:`sys." "_clear_internal_caches` instead." @@ -5024,25 +4883,183 @@ msgstr "" ":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." "_clear_internal_caches`。" -#: ../../whatsnew/3.14.rst:2801 +#: ../../whatsnew/3.14.rst:2718 msgid "CPython bytecode changes" msgstr "CPython 位元組碼變更" -#: ../../whatsnew/3.14.rst:2803 +#: ../../whatsnew/3.14.rst:2720 +msgid "" +"Replaced the opcode :opcode:`!BINARY_SUBSCR` by the :opcode:`BINARY_OP` " +"opcode with the ``NB_SUBSCR`` oparg. (Contributed by Irit Katriel in :gh:" +"`100239`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2724 +msgid "" +"Add the :opcode:`BUILD_INTERPOLATION` and :opcode:`BUILD_TEMPLATE` opcodes " +"to construct new :class:`~string.templatelib.Interpolation` and :class:" +"`~string.templatelib.Template` instances, respectively. (Contributed by " +"Lysandros Nikolaou and others in :gh:`132661`; see also :ref:`PEP 750: " +"Template strings `)." +msgstr "" + +#: ../../whatsnew/3.14.rst:2730 +msgid "" +"Remove the :opcode:`!BUILD_CONST_KEY_MAP` opcode. Use :opcode:`BUILD_MAP` " +"instead. (Contributed by Mark Shannon in :gh:`122160`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2734 +msgid "" +"Replace the :opcode:`!LOAD_ASSERTION_ERROR` opcode with :opcode:" +"`LOAD_COMMON_CONSTANT` and add support for loading :exc:" +"`NotImplementedError`." +msgstr "" + +#: ../../whatsnew/3.14.rst:2738 +msgid "" +"Add the :opcode:`LOAD_FAST_BORROW` and :opcode:" +"`LOAD_FAST_BORROW_LOAD_FAST_BORROW` opcodes to reduce reference counting " +"overhead when the interpreter can prove that the reference in the frame " +"outlives the reference loaded onto the stack. (Contributed by Matt Page in :" +"gh:`130704`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2743 +msgid "" +"Add the :opcode:`LOAD_SMALL_INT` opcode, which pushes a small integer equal " +"to the ``oparg`` to the stack. The :opcode:`!RETURN_CONST` opcode is removed " +"as it is no longer used. (Contributed by Mark Shannon in :gh:`125837`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2748 +msgid "" +"Add the new :opcode:`LOAD_SPECIAL` instruction. Generate code for :keyword:" +"`with` and :keyword:`async with` statements using the new instruction. " +"Removed the :opcode:`!BEFORE_WITH` and :opcode:`!BEFORE_ASYNC_WITH` " +"instructions. (Contributed by Mark Shannon in :gh:`120507`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2754 +msgid "" +"Add the :opcode:`POP_ITER` opcode to support 'virtual' iterators. " +"(Contributed by Mark Shannon in :gh:`132554`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2759 +msgid "Pseudo-instructions" +msgstr "" + +#: ../../whatsnew/3.14.rst:2761 msgid "" -"Replaced the opcode ``BINARY_SUBSCR`` by :opcode:`BINARY_OP` with oparg " -"``NB_SUBSCR``. (Contributed by Irit Katriel in :gh:`100239`.)" +"Add the :opcode:`!ANNOTATIONS_PLACEHOLDER` pseudo instruction to support " +"partially executed module-level annotations with :ref:`deferred evaluation " +"of annotations `. (Contributed by Jelle " +"Zijlstra in :gh:`130907`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2808 +#: ../../whatsnew/3.14.rst:2766 +msgid "" +"Add the :opcode:`!BINARY_OP_EXTEND` pseudo instruction, which executes a " +"pair of functions (guard and specialization functions) accessed from the " +"inline cache. (Contributed by Irit Katriel in :gh:`100239`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2771 +msgid "" +"Add three specializations for :opcode:`CALL_KW`; :opcode:`!CALL_KW_PY` for " +"calls to Python functions, :opcode:`!CALL_KW_BOUND_METHOD` for calls to " +"bound methods, and :opcode:`!CALL_KW_NON_PY` for all other calls. " +"(Contributed by Mark Shannon in :gh:`118093`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2777 +msgid "" +"Add the :opcode:`JUMP_IF_TRUE` and :opcode:`JUMP_IF_FALSE` pseudo " +"instructions, conditional jumps which do not impact the stack. Replaced by " +"the sequence ``COPY 1``, ``TO_BOOL``, ``POP_JUMP_IF_TRUE/FALSE``. " +"(Contributed by Irit Katriel in :gh:`124285`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2782 +msgid "" +"Add the :opcode:`!LOAD_CONST_MORTAL` pseudo instruction. (Contributed by " +"Mark Shannon in :gh:`128685`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2785 +msgid "" +"Add the :opcode:`LOAD_CONST_IMMORTAL` pseudo instruction, which does the " +"same as :opcode:`!LOAD_CONST`, but is more efficient for immortal objects. " +"(Contributed by Mark Shannon in :gh:`125837`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2790 +msgid "" +"Add the :opcode:`NOT_TAKEN` pseudo instruction, used by :mod:`sys." +"monitoring` to record branch events (such as :monitoring-event:" +"`BRANCH_LEFT`). (Contributed by Mark Shannon in :gh:`122548`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2796 msgid "C API changes" msgstr "C API 變更" +#: ../../whatsnew/3.14.rst:2801 +msgid "Python configuration C API" +msgstr "" + +#: ../../whatsnew/3.14.rst:2803 +msgid "" +"Add a :ref:`PyInitConfig C API ` to configure the Python " +"initialization without relying on C structures and the ability to make ABI-" +"compatible changes in the future." +msgstr "" + +#: ../../whatsnew/3.14.rst:2807 +msgid "" +"Complete the :pep:`587` :ref:`PyConfig C API ` by adding :c:" +"func:`PyInitConfig_AddModule` which can be used to add a built-in extension " +"module; a feature previously referred to as the \"inittab\"." +msgstr "" + #: ../../whatsnew/3.14.rst:2811 +msgid "" +"Add :c:func:`PyConfig_Get` and :c:func:`PyConfig_Set` functions to get and " +"set the current runtime configuration." +msgstr "" + +#: ../../whatsnew/3.14.rst:2814 +msgid "" +":pep:`587` 'Python Initialization Configuration' unified all the ways to " +"configure Python's initialization. This PEP also unifies the configuration " +"of Python's preinitialization and initialization in a single API. Moreover, " +"this PEP only provides a single choice to embed Python, instead of having " +"two 'Python' and 'Isolated' choices (PEP 587), to further simplify the API." +msgstr "" + +#: ../../whatsnew/3.14.rst:2821 +msgid "" +"The lower level PEP 587 PyConfig API remains available for use cases with an " +"intentionally higher level of coupling to CPython implementation details " +"(such as emulating the full functionality of CPython's CLI, including its " +"configuration mechanisms)." +msgstr "" + +#: ../../whatsnew/3.14.rst:2826 ../../whatsnew/3.14.rst:2853 +#: ../../whatsnew/3.14.rst:2873 +msgid "(Contributed by Victor Stinner in :gh:`107954`.)" +msgstr "(由 Victor Stinner 於 :gh:`107954` 貢獻。)" + +#: ../../whatsnew/3.14.rst:2828 +msgid ":pep:`741` and :pep:`587`" +msgstr "" + +#: ../../whatsnew/3.14.rst:2832 msgid "New features in the C API" msgstr "C API 中的新功能" -#: ../../whatsnew/3.14.rst:2813 +#: ../../whatsnew/3.14.rst:2834 msgid "" "Add :c:func:`Py_PACK_VERSION` and :c:func:`Py_PACK_FULL_VERSION`, two new " "macros for bit-packing Python version numbers. This is useful for " @@ -5050,101 +5067,105 @@ msgid "" "(Contributed by Petr Viktorin in :gh:`128629`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2819 +#: ../../whatsnew/3.14.rst:2840 msgid "" "Add :c:func:`PyBytes_Join(sep, iterable) ` function, similar " "to ``sep.join(iterable)`` in Python. (Contributed by Victor Stinner in :gh:" "`121645`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2823 +#: ../../whatsnew/3.14.rst:2844 +#, fuzzy msgid "" "Add functions to manipulate the configuration of the current runtime Python " -"interpreter (:ref:`PEP 741: Python configuration C API `):" +"interpreter (:ref:`PEP 741: Python configuration C API `):" msgstr "" +"新增用於配置 Python 初始化的函式(:ref:`PEP 741:Python 配置 C API " +"`):" -#: ../../whatsnew/3.14.rst:2827 +#: ../../whatsnew/3.14.rst:2848 msgid ":c:func:`PyConfig_Get`" msgstr ":c:func:`PyConfig_Get`" -#: ../../whatsnew/3.14.rst:2828 +#: ../../whatsnew/3.14.rst:2849 msgid ":c:func:`PyConfig_GetInt`" msgstr ":c:func:`PyConfig_GetInt`" -#: ../../whatsnew/3.14.rst:2829 +#: ../../whatsnew/3.14.rst:2850 msgid ":c:func:`PyConfig_Set`" msgstr ":c:func:`PyConfig_Set`" -#: ../../whatsnew/3.14.rst:2830 +#: ../../whatsnew/3.14.rst:2851 msgid ":c:func:`PyConfig_Names`" msgstr ":c:func:`PyConfig_Names`" -#: ../../whatsnew/3.14.rst:2834 +#: ../../whatsnew/3.14.rst:2855 +#, fuzzy msgid "" "Add functions to configure Python initialization (:ref:`PEP 741: Python " -"configuration C API `):" +"configuration C API `):" msgstr "" -"新增用於配置 Python 初始化的函式(:ref:`PEP 741:Python 配置 C API `):" +"新增用於配置 Python 初始化的函式(:ref:`PEP 741:Python 配置 C API " +"`):" -#: ../../whatsnew/3.14.rst:2837 +#: ../../whatsnew/3.14.rst:2858 msgid ":c:func:`Py_InitializeFromInitConfig`" msgstr ":c:func:`Py_InitializeFromInitConfig`" -#: ../../whatsnew/3.14.rst:2838 +#: ../../whatsnew/3.14.rst:2859 msgid ":c:func:`PyInitConfig_AddModule`" msgstr ":c:func:`PyInitConfig_AddModule`" -#: ../../whatsnew/3.14.rst:2839 +#: ../../whatsnew/3.14.rst:2860 msgid ":c:func:`PyInitConfig_Create`" msgstr ":c:func:`PyInitConfig_Create`" -#: ../../whatsnew/3.14.rst:2840 +#: ../../whatsnew/3.14.rst:2861 msgid ":c:func:`PyInitConfig_Free`" msgstr ":c:func:`PyInitConfig_Free`" -#: ../../whatsnew/3.14.rst:2841 +#: ../../whatsnew/3.14.rst:2862 msgid ":c:func:`PyInitConfig_FreeStrList`" msgstr ":c:func:`PyInitConfig_FreeStrList`" -#: ../../whatsnew/3.14.rst:2842 +#: ../../whatsnew/3.14.rst:2863 msgid ":c:func:`PyInitConfig_GetError`" msgstr ":c:func:`PyInitConfig_GetError`" -#: ../../whatsnew/3.14.rst:2843 +#: ../../whatsnew/3.14.rst:2864 msgid ":c:func:`PyInitConfig_GetExitCode`" msgstr ":c:func:`PyInitConfig_GetExitCode`" -#: ../../whatsnew/3.14.rst:2844 +#: ../../whatsnew/3.14.rst:2865 msgid ":c:func:`PyInitConfig_GetInt`" msgstr ":c:func:`PyInitConfig_GetInt`" -#: ../../whatsnew/3.14.rst:2845 +#: ../../whatsnew/3.14.rst:2866 msgid ":c:func:`PyInitConfig_GetStr`" msgstr ":c:func:`PyInitConfig_GetStr`" -#: ../../whatsnew/3.14.rst:2846 +#: ../../whatsnew/3.14.rst:2867 msgid ":c:func:`PyInitConfig_GetStrList`" msgstr ":c:func:`PyInitConfig_GetStrList`" -#: ../../whatsnew/3.14.rst:2847 +#: ../../whatsnew/3.14.rst:2868 msgid ":c:func:`PyInitConfig_HasOption`" msgstr ":c:func:`PyInitConfig_HasOption`" -#: ../../whatsnew/3.14.rst:2848 +#: ../../whatsnew/3.14.rst:2869 msgid ":c:func:`PyInitConfig_SetInt`" msgstr ":c:func:`PyInitConfig_SetInt`" -#: ../../whatsnew/3.14.rst:2849 +#: ../../whatsnew/3.14.rst:2870 msgid ":c:func:`PyInitConfig_SetStr`" msgstr ":c:func:`PyInitConfig_SetStr`" -#: ../../whatsnew/3.14.rst:2850 +#: ../../whatsnew/3.14.rst:2871 msgid ":c:func:`PyInitConfig_SetStrList`" msgstr ":c:func:`PyInitConfig_SetStrList`" -#: ../../whatsnew/3.14.rst:2854 +#: ../../whatsnew/3.14.rst:2875 msgid "" "Add :c:func:`Py_fopen` function to open a file. This works similarly to the " "standard C :c:func:`!fopen` function, instead accepting a Python object for " @@ -5153,13 +5174,13 @@ msgid "" "(Contributed by Victor Stinner in :gh:`127350`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2862 +#: ../../whatsnew/3.14.rst:2883 msgid "" "Add :c:func:`Py_HashBuffer` to compute and return the hash value of a " "buffer. (Contributed by Antoine Pitrou and Victor Stinner in :gh:`122854`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2865 +#: ../../whatsnew/3.14.rst:2886 msgid "" "Add :c:func:`PyImport_ImportModuleAttr` and :c:func:" "`PyImport_ImportModuleAttrString` helper functions to import a module and " @@ -5167,20 +5188,20 @@ msgid "" "`128911`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2870 +#: ../../whatsnew/3.14.rst:2891 msgid "" "Add :c:func:`PyIter_NextItem` to replace :c:func:`PyIter_Next`, which has an " "ambiguous return value. (Contributed by Irit Katriel and Erlend Aasland in :" "gh:`105201`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2874 +#: ../../whatsnew/3.14.rst:2895 msgid "" "Add :c:func:`PyLong_GetSign` function to get the sign of :class:`int` " "objects. (Contributed by Sergey B Kirpichev in :gh:`116560`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2877 +#: ../../whatsnew/3.14.rst:2898 msgid "" "Add :c:func:`PyLong_IsPositive`, :c:func:`PyLong_IsNegative` and :c:func:" "`PyLong_IsZero` for checking if :c:type:`PyLongObject` is positive, " @@ -5188,82 +5209,82 @@ msgid "" "Kirpichev in :gh:`126061`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2882 +#: ../../whatsnew/3.14.rst:2903 msgid "" "Add new functions to convert C ```` numbers to/from Python :class:" "`int` objects:" msgstr "" -#: ../../whatsnew/3.14.rst:2885 +#: ../../whatsnew/3.14.rst:2906 msgid ":c:func:`PyLong_AsInt32`" msgstr ":c:func:`PyLong_AsInt32`" -#: ../../whatsnew/3.14.rst:2886 +#: ../../whatsnew/3.14.rst:2907 msgid ":c:func:`PyLong_AsInt64`" msgstr ":c:func:`PyLong_AsInt64`" -#: ../../whatsnew/3.14.rst:2887 +#: ../../whatsnew/3.14.rst:2908 msgid ":c:func:`PyLong_AsUInt32`" msgstr ":c:func:`PyLong_AsUInt32`" -#: ../../whatsnew/3.14.rst:2888 +#: ../../whatsnew/3.14.rst:2909 msgid ":c:func:`PyLong_AsUInt64`" msgstr ":c:func:`PyLong_AsUInt64`" -#: ../../whatsnew/3.14.rst:2889 +#: ../../whatsnew/3.14.rst:2910 msgid ":c:func:`PyLong_FromInt32`" msgstr ":c:func:`PyLong_FromInt32`" -#: ../../whatsnew/3.14.rst:2890 +#: ../../whatsnew/3.14.rst:2911 msgid ":c:func:`PyLong_FromInt64`" msgstr ":c:func:`PyLong_FromInt64`" -#: ../../whatsnew/3.14.rst:2891 +#: ../../whatsnew/3.14.rst:2912 msgid ":c:func:`PyLong_FromUInt32`" msgstr ":c:func:`PyLong_FromUInt32`" -#: ../../whatsnew/3.14.rst:2892 +#: ../../whatsnew/3.14.rst:2913 msgid ":c:func:`PyLong_FromUInt64`" msgstr ":c:func:`PyLong_FromUInt64`" -#: ../../whatsnew/3.14.rst:2894 +#: ../../whatsnew/3.14.rst:2915 msgid "(Contributed by Victor Stinner in :gh:`120389`.)" msgstr "(由 Victor Stinner 於 :gh:`120389` 貢獻。)" -#: ../../whatsnew/3.14.rst:2896 +#: ../../whatsnew/3.14.rst:2917 msgid "" "Add a new import and export API for Python :class:`int` objects (:pep:`757`):" msgstr "" -#: ../../whatsnew/3.14.rst:2899 +#: ../../whatsnew/3.14.rst:2920 msgid ":c:func:`PyLong_GetNativeLayout`" msgstr ":c:func:`PyLong_GetNativeLayout`" -#: ../../whatsnew/3.14.rst:2900 +#: ../../whatsnew/3.14.rst:2921 msgid ":c:func:`PyLong_Export`" msgstr ":c:func:`PyLong_Export`" -#: ../../whatsnew/3.14.rst:2901 +#: ../../whatsnew/3.14.rst:2922 msgid ":c:func:`PyLong_FreeExport`" msgstr ":c:func:`PyLong_FreeExport`" -#: ../../whatsnew/3.14.rst:2902 +#: ../../whatsnew/3.14.rst:2923 msgid ":c:func:`PyLongWriter_Create`" msgstr ":c:func:`PyLongWriter_Create`" -#: ../../whatsnew/3.14.rst:2903 +#: ../../whatsnew/3.14.rst:2924 msgid ":c:func:`PyLongWriter_Finish`" msgstr ":c:func:`PyLongWriter_Finish`" -#: ../../whatsnew/3.14.rst:2904 +#: ../../whatsnew/3.14.rst:2925 msgid ":c:func:`PyLongWriter_Discard`" msgstr ":c:func:`PyLongWriter_Discard`" -#: ../../whatsnew/3.14.rst:2906 +#: ../../whatsnew/3.14.rst:2927 msgid "(Contributed by Sergey B Kirpichev and Victor Stinner in :gh:`102471`.)" msgstr "(由 Sergey B Kirpichev 和 Victor Stinner 於 :gh:`102471` 貢獻。)" -#: ../../whatsnew/3.14.rst:2908 +#: ../../whatsnew/3.14.rst:2929 msgid "" "Add :c:func:`PyMonitoring_FireBranchLeftEvent` and :c:func:" "`PyMonitoring_FireBranchRightEvent` for generating :monitoring-event:" @@ -5271,13 +5292,13 @@ msgid "" "(Contributed by Mark Shannon in :gh:`122548`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2914 +#: ../../whatsnew/3.14.rst:2935 msgid "" "Add :c:func:`PyType_Freeze` function to make a type immutable. (Contributed " "by Victor Stinner in :gh:`121654`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2917 +#: ../../whatsnew/3.14.rst:2938 msgid "" "Add :c:func:`PyType_GetBaseByToken` and :c:data:`Py_tp_token` slot for " "easier superclass identification, which attempts to resolve the type " @@ -5285,110 +5306,110 @@ msgid "" "in :gh:`124153`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2922 +#: ../../whatsnew/3.14.rst:2943 msgid "" "Add a new :c:func:`PyUnicode_Equal` function to test if two strings are " "equal. The function is also added to the Limited C API. (Contributed by " "Victor Stinner in :gh:`124502`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2927 +#: ../../whatsnew/3.14.rst:2948 msgid "" "Add a new :c:type:`PyUnicodeWriter` API to create a Python :class:`str` " "object, with the following functions:" msgstr "" -#: ../../whatsnew/3.14.rst:2930 +#: ../../whatsnew/3.14.rst:2951 msgid ":c:func:`PyUnicodeWriter_Create`" msgstr ":c:func:`PyUnicodeWriter_Create`" -#: ../../whatsnew/3.14.rst:2931 +#: ../../whatsnew/3.14.rst:2952 msgid ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" msgstr ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" -#: ../../whatsnew/3.14.rst:2932 +#: ../../whatsnew/3.14.rst:2953 msgid ":c:func:`PyUnicodeWriter_Discard`" msgstr ":c:func:`PyUnicodeWriter_Discard`" -#: ../../whatsnew/3.14.rst:2933 +#: ../../whatsnew/3.14.rst:2954 msgid ":c:func:`PyUnicodeWriter_Finish`" msgstr ":c:func:`PyUnicodeWriter_Finish`" -#: ../../whatsnew/3.14.rst:2934 +#: ../../whatsnew/3.14.rst:2955 msgid ":c:func:`PyUnicodeWriter_Format`" msgstr ":c:func:`PyUnicodeWriter_Format`" -#: ../../whatsnew/3.14.rst:2935 +#: ../../whatsnew/3.14.rst:2956 msgid ":c:func:`PyUnicodeWriter_WriteASCII`" msgstr ":c:func:`PyUnicodeWriter_WriteASCII`" -#: ../../whatsnew/3.14.rst:2936 +#: ../../whatsnew/3.14.rst:2957 msgid ":c:func:`PyUnicodeWriter_WriteChar`" msgstr ":c:func:`PyUnicodeWriter_WriteChar`" -#: ../../whatsnew/3.14.rst:2937 +#: ../../whatsnew/3.14.rst:2958 msgid ":c:func:`PyUnicodeWriter_WriteRepr`" msgstr ":c:func:`PyUnicodeWriter_WriteRepr`" -#: ../../whatsnew/3.14.rst:2938 +#: ../../whatsnew/3.14.rst:2959 msgid ":c:func:`PyUnicodeWriter_WriteStr`" msgstr ":c:func:`PyUnicodeWriter_WriteStr`" -#: ../../whatsnew/3.14.rst:2939 +#: ../../whatsnew/3.14.rst:2960 msgid ":c:func:`PyUnicodeWriter_WriteSubstring`" msgstr ":c:func:`PyUnicodeWriter_WriteSubstring`" -#: ../../whatsnew/3.14.rst:2940 +#: ../../whatsnew/3.14.rst:2961 msgid ":c:func:`PyUnicodeWriter_WriteUCS4`" msgstr ":c:func:`PyUnicodeWriter_WriteUCS4`" -#: ../../whatsnew/3.14.rst:2941 +#: ../../whatsnew/3.14.rst:2962 msgid ":c:func:`PyUnicodeWriter_WriteUTF8`" msgstr ":c:func:`PyUnicodeWriter_WriteUTF8`" -#: ../../whatsnew/3.14.rst:2942 +#: ../../whatsnew/3.14.rst:2963 msgid ":c:func:`PyUnicodeWriter_WriteWideChar`" msgstr ":c:func:`PyUnicodeWriter_WriteWideChar`" -#: ../../whatsnew/3.14.rst:2944 +#: ../../whatsnew/3.14.rst:2965 msgid "(Contributed by Victor Stinner in :gh:`119182`.)" msgstr "(由 Victor Stinner 於 :gh:`119182` 貢獻。)" -#: ../../whatsnew/3.14.rst:2946 +#: ../../whatsnew/3.14.rst:2967 msgid "" "The ``k`` and ``K`` formats in :c:func:`PyArg_ParseTuple` and similar " "functions now use :meth:`~object.__index__` if available, like all other " "integer formats. (Contributed by Serhiy Storchaka in :gh:`112068`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2951 +#: ../../whatsnew/3.14.rst:2972 msgid "" "Add support for a new ``p`` format unit in :c:func:`Py_BuildValue` that " "produces a Python :class:`bool` object from a C integer. (Contributed by " "Pablo Galindo in :issue:`45325`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2955 +#: ../../whatsnew/3.14.rst:2976 msgid "" "Add :c:func:`PyUnstable_IsImmortal` for determining if an object is :term:" "`immortal`, for debugging purposes. (Contributed by Peter Bierma in :gh:" "`128509`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2959 +#: ../../whatsnew/3.14.rst:2980 msgid "" "Add :c:func:`PyUnstable_Object_EnableDeferredRefcount` for enabling deferred " "reference counting, as outlined in :pep:`703`." msgstr "" -#: ../../whatsnew/3.14.rst:2962 +#: ../../whatsnew/3.14.rst:2983 msgid "" "Add :c:func:`PyUnstable_Object_IsUniquelyReferenced` as a replacement for " "``Py_REFCNT(op) == 1`` on :term:`free threaded ` builds. " "(Contributed by Peter Bierma in :gh:`133140`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2967 +#: ../../whatsnew/3.14.rst:2988 msgid "" "Add :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary` to determine if " "an object is a unique temporary object on the interpreter's operand stack. " @@ -5397,11 +5418,11 @@ msgid "" "functions. (Contributed by Sam Gross in :gh:`133164`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2977 +#: ../../whatsnew/3.14.rst:2998 msgid "Limited C API changes" msgstr "" -#: ../../whatsnew/3.14.rst:2979 +#: ../../whatsnew/3.14.rst:3000 msgid "" "In the limited C API version 3.14 and newer, :c:func:`Py_TYPE` and :c:func:" "`Py_REFCNT` are now implemented as an opaque function call to hide " @@ -5409,7 +5430,7 @@ msgid "" "gh:`124127`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2984 +#: ../../whatsnew/3.14.rst:3005 msgid "" "Remove the :c:macro:`PySequence_Fast_GET_SIZE`, :c:macro:" "`PySequence_Fast_GET_ITEM`, and :c:macro:`PySequence_Fast_ITEMS` macros from " @@ -5417,32 +5438,32 @@ msgid "" "(Contributed by Victor Stinner in :gh:`91417`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2995 +#: ../../whatsnew/3.14.rst:3016 msgid "Removed C APIs" msgstr "被移除的 C API" -#: ../../whatsnew/3.14.rst:2997 +#: ../../whatsnew/3.14.rst:3018 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases was deprecated in Python 3.12, and now raises a :exc:`TypeError`. " "(Contributed by Nikita Sobolev in :gh:`119775`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3002 +#: ../../whatsnew/3.14.rst:3023 msgid "" "Remove ``PyDictObject.ma_version_tag`` member, which was deprecated in " "Python 3.12. Use the :c:func:`PyDict_AddWatcher` API instead. (Contributed " "by Sam Gross in :gh:`124296`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3007 +#: ../../whatsnew/3.14.rst:3028 msgid "" "Remove the private ``_Py_InitializeMain()`` function. It was a :term:" "`provisional API` added to Python 3.8 by :pep:`587`. (Contributed by Victor " "Stinner in :gh:`129033`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3011 +#: ../../whatsnew/3.14.rst:3032 msgid "" "Remove the undocumented APIs :c:macro:`!Py_C_RECURSION_LIMIT` and :c:member:" "`!PyThreadState.c_recursion_remaining`. These were added in 3.13 and have " @@ -5451,18 +5472,18 @@ msgid "" "`133079`, see also :gh:`130396`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3022 +#: ../../whatsnew/3.14.rst:3043 msgid "Deprecated C APIs" msgstr "已棄用的 C API" -#: ../../whatsnew/3.14.rst:3024 +#: ../../whatsnew/3.14.rst:3045 msgid "" "The :c:macro:`!Py_HUGE_VAL` macro is now :term:`soft deprecated`. Use :c:" "macro:`!Py_INFINITY` instead. (Contributed by Sergey B Kirpichev in :gh:" "`120026`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3028 +#: ../../whatsnew/3.14.rst:3049 msgid "" "The :c:macro:`!Py_IS_NAN`, :c:macro:`!Py_IS_INFINITY`, and :c:macro:`!" "Py_IS_FINITE` macros are now :term:`soft deprecated`. Use :c:macro:`!" @@ -5470,7 +5491,7 @@ msgid "" "file:`math.h` since C99. (Contributed by Sergey B Kirpichev in :gh:`119613`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3034 +#: ../../whatsnew/3.14.rst:3055 msgid "" "Non-tuple sequences are now deprecated as argument for the ``(items)`` " "format unit in :c:func:`PyArg_ParseTuple` and other :ref:`argument parsing " @@ -5479,14 +5500,14 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`50333`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3041 +#: ../../whatsnew/3.14.rst:3062 msgid "" "The ``_PyMonitoring_FireBranchEvent`` function is now deprecated and should " "be replaced with calls to :c:func:`PyMonitoring_FireBranchLeftEvent` and :c:" "func:`PyMonitoring_FireBranchRightEvent`." msgstr "" -#: ../../whatsnew/3.14.rst:3046 +#: ../../whatsnew/3.14.rst:3067 msgid "" "The previously undocumented function :c:func:`PySequence_In` is now :term:" "`soft deprecated`. Use :c:func:`PySequence_Contains` instead. (Contributed " @@ -6008,8 +6029,8 @@ msgid "" "(Contributed by Victor Stinner in :gh:`128863`.)" msgstr "" "可以使用 `pythoncapi-compat project `__ 來取得這些於 Python 3.13 及更早版本的新公開函式。(由 " -"Victor Stinner 在 :gh:`128863` 貢獻)" +"compat/>`__ 來取得這些於 Python 3.13 及更早版本的新公開函式。(由 Victor " +"Stinner 在 :gh:`128863` 貢獻)" #: ../../deprecations/c-api-pending-removal-in-future.rst:4 msgid "" @@ -6114,31 +6135,46 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.14.rst:3063 -msgid "Build Changes" +#: ../../whatsnew/3.14.rst:3086 +#, fuzzy +msgid "Build changes" msgstr "建置變更" -#: ../../whatsnew/3.14.rst:3065 +#: ../../whatsnew/3.14.rst:3088 +msgid "" +":pep:`776`: Emscripten is now an officially supported platform at :pep:`tier " +"3 <11#tier-3>`. As a part of this effort, more than 25 bugs in `Emscripten " +"libc`__ were fixed. Emscripten now includes support for :mod:`ctypes`, :mod:" +"`termios`, and :mod:`fcntl`, as well as experimental support for the new :" +"ref:`default interactive shell `. (Contributed by R. Hood " +"Chatham in :gh:`127146`, :gh:`127683`, and :gh:`136931`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:3098 +msgid "Official Android binary releases are now provided on python.org__." +msgstr "" + +#: ../../whatsnew/3.14.rst:3102 msgid "" "GNU Autoconf 2.72 is now required to generate :file:`configure`. " "(Contributed by Erlend Aasland in :gh:`115765`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3068 +#: ../../whatsnew/3.14.rst:3105 msgid "" "``wasm32-unknown-emscripten`` is now a :pep:`11` tier 3 platform. " "(Contributed by R. Hood Chatham in :gh:`127146`, :gh:`127683`, and :gh:" "`136931`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3071 +#: ../../whatsnew/3.14.rst:3108 msgid "" "``#pragma``-based linking with ``python3*.lib`` can now be switched off " "with :c:expr:`Py_NO_LINK_LIB`. (Contributed by Jean-Christophe Fillion-Robin " "in :gh:`82909`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3075 +#: ../../whatsnew/3.14.rst:3112 msgid "" "CPython now enables a set of recommended compiler options by default for " "improved security. Use the :option:`--disable-safety` :file:`configure` " @@ -6146,31 +6182,45 @@ msgid "" "larger set of compiler options, albeit with a performance cost." msgstr "" -#: ../../whatsnew/3.14.rst:3081 +#: ../../whatsnew/3.14.rst:3118 msgid "" "The ``WITH_FREELISTS`` macro and ``--without-freelists`` :file:`configure` " "option have been removed." msgstr "" -#: ../../whatsnew/3.14.rst:3084 +#: ../../whatsnew/3.14.rst:3121 msgid "" "The new :file:`configure` option :option:`--with-tail-call-interp` may be " "used to enable the experimental tail call interpreter. See :ref:`whatsnew314-" -"tail-call` for further details." +"tail-call-interpreter` for further details." msgstr "" -#: ../../whatsnew/3.14.rst:3088 +#: ../../whatsnew/3.14.rst:3125 msgid "" "To disable the new remote debugging support, use the :option:`--without-" "remote-debug` :file:`configure` option. This may be useful for security " "reasons." msgstr "" -#: ../../whatsnew/3.14.rst:3095 +#: ../../whatsnew/3.14.rst:3129 +msgid "" +"iOS and macOS apps can now be configured to redirect ``stdout`` and " +"``stderr`` content to the system log. (Contributed by Russell Keith-Magee " +"in :gh:`127592`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:3133 +msgid "" +"The iOS testbed is now able to stream test output while the test is running. " +"The testbed can also be used to run the test suite of projects other than " +"CPython itself. (Contributed by Russell Keith-Magee in :gh:`127592`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:3142 msgid ":file:`build-details.json`" msgstr "" -#: ../../whatsnew/3.14.rst:3097 +#: ../../whatsnew/3.14.rst:3144 msgid "" "Installations of Python now contain a new file, :file:`build-details.json`. " "This is a static JSON document containing build details for CPython, to " @@ -6178,7 +6228,7 @@ msgid "" "cases such as Python launchers, cross-compilation, and so on." msgstr "" -#: ../../whatsnew/3.14.rst:3103 +#: ../../whatsnew/3.14.rst:3150 msgid "" ":file:`build-details.json` must be installed in the platform-independent " "standard library directory. This corresponds to the :ref:`'stdlib' " @@ -6186,17 +6236,17 @@ msgid "" "by running ``sysconfig.get_path('stdlib')``." msgstr "" -#: ../../whatsnew/3.14.rst:3109 +#: ../../whatsnew/3.14.rst:3156 msgid "" ":pep:`739` -- ``build-details.json`` 1.0 -- a static description file for " "Python build details" msgstr "" -#: ../../whatsnew/3.14.rst:3115 +#: ../../whatsnew/3.14.rst:3163 msgid "Discontinuation of PGP signatures" msgstr "" -#: ../../whatsnew/3.14.rst:3117 +#: ../../whatsnew/3.14.rst:3165 msgid "" "PGP (Pretty Good Privacy) signatures will not be provided for releases of " "Python 3.14 or future versions. To verify CPython artifacts, users must use " @@ -6204,64 +6254,314 @@ msgid "" "sigstore/>`__. Releases have been signed using Sigstore_ since Python 3.11." msgstr "" -#: ../../whatsnew/3.14.rst:3123 +#: ../../whatsnew/3.14.rst:3171 msgid "This change in release process was specified in :pep:`761`." msgstr "" -#: ../../whatsnew/3.14.rst:3129 +#: ../../whatsnew/3.14.rst:3179 +msgid "Free-threaded Python is officially supported" +msgstr "" + +#: ../../whatsnew/3.14.rst:3181 +msgid "" +"The free-threaded build of Python is now supported and no longer " +"experimental. This is the start of `phase II `__ where free-threaded Python is officially supported but still " +"optional." +msgstr "" + +#: ../../whatsnew/3.14.rst:3185 +msgid "" +"The free-threading team are confident that the project is on the right path, " +"and appreciate the continued dedication from everyone working to make free-" +"threading ready for broader adoption across the Python community." +msgstr "" + +#: ../../whatsnew/3.14.rst:3189 +msgid "" +"With these recommendations and the acceptance of this PEP, the Python " +"developer community should broadly advertise that free-threading is a " +"supported Python build option now and into the future, and that it will not " +"be removed without a proper deprecation schedule." +msgstr "" + +#: ../../whatsnew/3.14.rst:3194 +msgid "" +"Any decision to transition to `phase III `__, with free-threading as the default or sole build of Python is " +"still undecided, and dependent on many factors both within CPython itself " +"and the community. This decision is for the future." +msgstr "" + +#: ../../whatsnew/3.14.rst:3201 +#, fuzzy +msgid ":pep:`779`" +msgstr ":pep:`744`" + +#: ../../whatsnew/3.14.rst:3203 +msgid "`PEP 779's acceptance `__" +msgstr "" + +#: ../../whatsnew/3.14.rst:3209 +msgid "Binary releases for the experimental just-in-time compiler" +msgstr "" + +#: ../../whatsnew/3.14.rst:3211 +msgid "" +"The official macOS and Windows release binaries now include an " +"*experimental* just-in-time (JIT) compiler. Although it is **not** " +"recommended for production use, it can be tested by setting :envvar:" +"`PYTHON_JIT=1 ` as an environment variable. Downstream source " +"builds and redistributors can use the :option:`--enable-experimental-jit=yes-" +"off` configuration option for similar behavior." +msgstr "" + +#: ../../whatsnew/3.14.rst:3218 +msgid "" +"The JIT is at an early stage and still in active development. As such, the " +"typical performance impact of enabling it can range from 10% slower to 20% " +"faster, depending on workload. To aid in testing and evaluation, a set of " +"introspection functions has been provided in the :data:`sys._jit` " +"namespace. :func:`sys._jit.is_available` can be used to determine if the " +"current executable supports JIT compilation, while :func:`sys._jit." +"is_enabled` can be used to tell if JIT compilation has been enabled for the " +"current process." +msgstr "" + +#: ../../whatsnew/3.14.rst:3226 +msgid "" +"Currently, the most significant missing functionality is that native " +"debuggers and profilers like ``gdb`` and ``perf`` are unable to unwind " +"through JIT frames (Python debuggers and profilers, like :mod:`pdb` or :mod:" +"`profile`, continue to work without modification). Free-threaded builds do " +"not support JIT compilation." +msgstr "" + +#: ../../whatsnew/3.14.rst:3231 +msgid "" +"Please report any bugs or major performance regressions that you encounter!" +msgstr "" + +#: ../../whatsnew/3.14.rst:3233 +msgid ":pep:`744`" +msgstr ":pep:`744`" + +#: ../../whatsnew/3.14.rst:3237 msgid "Porting to Python 3.14" msgstr "移植至 Python 3.14" -#: ../../whatsnew/3.14.rst:3131 +#: ../../whatsnew/3.14.rst:3239 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "本節列出了前面描述的更改以及可能需要更改程式碼的其他錯誤修復。" -#: ../../whatsnew/3.14.rst:3136 +#: ../../whatsnew/3.14.rst:3244 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.14.rst:3138 +#: ../../whatsnew/3.14.rst:3246 +msgid "" +"On Unix platforms other than macOS, *forkserver* is now the default :ref:" +"`start method ` for :mod:`multiprocessing` " +"and :class:`~concurrent.futures.ProcessPoolExecutor`, instead of *fork*." +msgstr "" + +#: ../../whatsnew/3.14.rst:3250 +msgid "" +"See :ref:`(1) ` and :ref:`(2) " +"` for details." +msgstr "" + +#: ../../whatsnew/3.14.rst:3253 +msgid "" +"If you encounter :exc:`NameError`\\s or pickling errors coming out of :mod:" +"`multiprocessing` or :mod:`concurrent.futures`, see the :ref:`forkserver " +"restrictions `." +msgstr "" + +#: ../../whatsnew/3.14.rst:3257 +msgid "" +"This change does not affect Windows or macOS, where :ref:`'spawn' " +"` remains the default start method." +msgstr "" + +#: ../../whatsnew/3.14.rst:3260 msgid "" ":class:`functools.partial` is now a method descriptor. Wrap it in :func:" "`staticmethod` if you want to preserve the old behavior. (Contributed by " "Serhiy Storchaka and Dominykas Grigonis in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3142 +#: ../../whatsnew/3.14.rst:3264 msgid "" "The :ref:`garbage collector is now incremental `, which means that the behavior of :func:`gc.collect` changes slightly:" msgstr "" -#: ../../whatsnew/3.14.rst:3149 +#: ../../whatsnew/3.14.rst:3271 msgid "" "The :func:`locale.nl_langinfo` function now temporarily sets the " "``LC_CTYPE`` locale in some cases. This temporary change affects other " "threads. (Contributed by Serhiy Storchaka in :gh:`69998`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3154 +#: ../../whatsnew/3.14.rst:3276 msgid "" ":class:`types.UnionType` is now an alias for :class:`typing.Union`, causing " "changes in some behaviors. See :ref:`above ` for " "more details. (Contributed by Jelle Zijlstra in :gh:`105499`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3159 +#: ../../whatsnew/3.14.rst:3281 msgid "" "The runtime behavior of annotations has changed in various ways; see :ref:" -"`above ` for details. While most code that interacts " -"with annotations should continue to work, some undocumented details may " -"behave differently." +"`above ` for details. While most code that " +"interacts with annotations should continue to work, some undocumented " +"details may behave differently." +msgstr "" + +#: ../../whatsnew/3.14.rst:3286 +msgid "" +"As part of making the :mod:`mimetypes` CLI public, it now exits with ``1`` " +"on failure instead of ``0`` and ``2`` on incorrect command-line parameters " +"instead of ``1``. Error messages are now printed to stderr." +msgstr "" + +#: ../../whatsnew/3.14.rst:3291 +msgid "" +"The ``\\B`` pattern in regular expression now matches the empty string when " +"given as the entire pattern, which may cause behavioural changes." +msgstr "" + +#: ../../whatsnew/3.14.rst:3294 +msgid "" +"On FreeBSD, :data:`sys.platform` no longer contains the major version number." +msgstr "" + +#: ../../whatsnew/3.14.rst:3300 +msgid "Changes in annotations (:pep:`649` and :pep:`749`)" +msgstr "" + +#: ../../whatsnew/3.14.rst:3302 +msgid "" +"This section contains guidance on changes that may be needed to annotations " +"or Python code that interacts with or introspects annotations, due to the " +"changes related to :ref:`deferred evaluation of annotations `." +msgstr "" + +#: ../../whatsnew/3.14.rst:3307 +msgid "" +"In the majority of cases, working code from older versions of Python will " +"not require any changes." +msgstr "" + +#: ../../whatsnew/3.14.rst:3312 +msgid "Implications for annotated code" +msgstr "" + +#: ../../whatsnew/3.14.rst:3314 +msgid "" +"If you define annotations in your code (for example, for use with a static " +"type checker), then this change probably does not affect you: you can keep " +"writing annotations the same way you did with previous versions of Python." +msgstr "" + +#: ../../whatsnew/3.14.rst:3318 +msgid "" +"You will likely be able to remove quoted strings in annotations, which are " +"frequently used for forward references. Similarly, if you use ``from " +"__future__ import annotations`` to avoid having to write strings in " +"annotations, you may well be able to remove that import once you support " +"only Python 3.14 and newer. However, if you rely on third-party libraries " +"that read annotations, those libraries may need changes to support unquoted " +"annotations before they work as expected." +msgstr "" + +#: ../../whatsnew/3.14.rst:3328 +msgid "Implications for readers of ``__annotations__``" msgstr "" -#: ../../whatsnew/3.14.rst:3166 +#: ../../whatsnew/3.14.rst:3330 +msgid "" +"If your code reads the :attr:`~object.__annotations__` attribute on objects, " +"you may want to make changes in order to support code that relies on " +"deferred evaluation of annotations. For example, you may want to use :func:" +"`annotationlib.get_annotations` with the :attr:`~annotationlib.Format." +"FORWARDREF` format, as the :mod:`dataclasses` module now does." +msgstr "" + +#: ../../whatsnew/3.14.rst:3337 +msgid "" +"The external :pypi:`typing_extensions` package provides partial backports of " +"some of the functionality of the :mod:`annotationlib` module, such as the :" +"class:`~annotationlib.Format` enum and the :func:`~annotationlib." +"get_annotations` function. These can be used to write cross-version code " +"that takes advantage of the new behavior in Python 3.14." +msgstr "" + +#: ../../whatsnew/3.14.rst:3346 +msgid "Related changes" +msgstr "" + +#: ../../whatsnew/3.14.rst:3348 +msgid "" +"The changes in Python 3.14 are designed to rework how :attr:`!" +"__annotations__` works at runtime while minimizing breakage to code that " +"contains annotations in source code and to code that reads :attr:`!" +"__annotations__`. However, if you rely on undocumented details of the " +"annotation behavior or on private functions in the standard library, there " +"are many ways in which your code may not work in Python 3.14. To safeguard " +"your code against future changes, only use the documented functionality of " +"the :mod:`annotationlib` module." +msgstr "" + +#: ../../whatsnew/3.14.rst:3357 +msgid "" +"In particular, do not read annotations directly from the namespace " +"dictionary attribute of type objects. Use :func:`annotationlib." +"get_annotate_from_class_namespace` during class construction and :func:" +"`annotationlib.get_annotations` afterwards." +msgstr "" + +#: ../../whatsnew/3.14.rst:3362 +msgid "" +"In previous releases, it was sometimes possible to access class annotations " +"from an instance of an annotated class. This behavior was undocumented and " +"accidental, and will no longer work in Python 3.14." +msgstr "" + +#: ../../whatsnew/3.14.rst:3368 +msgid "``from __future__ import annotations``" +msgstr "" + +#: ../../whatsnew/3.14.rst:3370 +msgid "" +"In Python 3.7, :pep:`563` introduced the ``from __future__ import " +"annotations`` :ref:`future statement `, which turns all annotations " +"into strings." +msgstr "" + +#: ../../whatsnew/3.14.rst:3373 +msgid "" +"However, this statement is now deprecated and it is expected to be removed " +"in a future version of Python. This removal will not happen until after " +"Python 3.13 reaches its end of life in 2029, being the last version of " +"Python without support for deferred evaluation of annotations." +msgstr "" + +#: ../../whatsnew/3.14.rst:3379 +msgid "" +"In Python 3.14, the behavior of code using ``from __future__ import " +"annotations`` is unchanged." +msgstr "" + +#: ../../whatsnew/3.14.rst:3384 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.14.rst:3168 +#: ../../whatsnew/3.14.rst:3386 msgid "" ":c:func:`Py_Finalize` now deletes all interned strings. This is backwards " "incompatible to any C extension that holds onto an interned string after a " @@ -6274,14 +6574,14 @@ msgid "" "`113601`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3178 +#: ../../whatsnew/3.14.rst:3396 msgid "" "The :ref:`Unicode Exception Objects ` C API now raises a :" "exc:`TypeError` if its exception argument is not a :exc:`UnicodeError` " "object. (Contributed by Bénédikt Tran in :gh:`127691`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3185 +#: ../../whatsnew/3.14.rst:3403 msgid "" "The interpreter internally avoids some reference count modifications when " "loading objects onto the operands stack by :term:`borrowing