diff --git a/c-api/frame.po b/c-api/frame.po index 1e518a36e3..1616a3cc27 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -1,7 +1,5 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # #, fuzzy msgid "" @@ -11,7 +9,8 @@ msgstr "" "POT-Creation-Date: 2024-09-23 07:52+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/c-api/init.po b/c-api/init.po index 1577394625..5809d4bf46 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. # @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-22 00:13+0000\n" +"POT-Creation-Date: 2024-11-25 00:14+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-" @@ -1439,7 +1438,7 @@ msgid "" msgstr "" #: ../../c-api/init.rst:1155 ../../c-api/init.rst:1214 -#: ../../c-api/init.rst:1496 +#: ../../c-api/init.rst:1499 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " @@ -1650,14 +1649,18 @@ msgid "" "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1338 +#: ../../c-api/init.rst:1335 +msgid "The :c:member:`PyThreadState.on_delete` callback was removed." +msgstr ":c:member:`PyThreadState.on_delete` 回呼已被移除。" + +#: ../../c-api/init.rst:1341 msgid "" "Destroy a thread state object. The global interpreter lock need not be " "held. The thread state must have been reset with a previous call to :c:func:" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1345 +#: ../../c-api/init.rst:1348 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be " @@ -1665,119 +1668,119 @@ msgid "" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1353 +#: ../../c-api/init.rst:1356 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1355 +#: ../../c-api/init.rst:1358 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1358 +#: ../../c-api/init.rst:1361 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "也請見 :c:func:`PyEval_GetFrame`。" -#: ../../c-api/init.rst:1360 ../../c-api/init.rst:1369 -#: ../../c-api/init.rst:1378 +#: ../../c-api/init.rst:1363 ../../c-api/init.rst:1372 +#: ../../c-api/init.rst:1381 msgid "*tstate* must not be ``NULL``." msgstr "*tstate* 不可為 ``NULL``。" -#: ../../c-api/init.rst:1367 +#: ../../c-api/init.rst:1370 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1376 +#: ../../c-api/init.rst:1379 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1385 +#: ../../c-api/init.rst:1388 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1387 +#: ../../c-api/init.rst:1390 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1394 +#: ../../c-api/init.rst:1397 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1397 +#: ../../c-api/init.rst:1400 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1405 +#: ../../c-api/init.rst:1408 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1407 +#: ../../c-api/init.rst:1410 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1410 ../../c-api/init.rst:1420 +#: ../../c-api/init.rst:1413 ../../c-api/init.rst:1423 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/init.rst:1417 +#: ../../c-api/init.rst:1420 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:1427 +#: ../../c-api/init.rst:1430 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:1431 +#: ../../c-api/init.rst:1434 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:1438 +#: ../../c-api/init.rst:1441 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1440 +#: ../../c-api/init.rst:1443 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1443 +#: ../../c-api/init.rst:1446 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1446 +#: ../../c-api/init.rst:1449 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1451 +#: ../../c-api/init.rst:1454 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1453 ../../c-api/init.rst:1461 +#: ../../c-api/init.rst:1456 ../../c-api/init.rst:1464 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1459 +#: ../../c-api/init.rst:1462 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1468 +#: ../../c-api/init.rst:1471 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 " @@ -1786,7 +1789,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1477 +#: ../../c-api/init.rst:1480 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. " @@ -1798,33 +1801,33 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1485 +#: ../../c-api/init.rst:1488 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1491 +#: ../../c-api/init.rst:1494 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1502 +#: ../../c-api/init.rst:1505 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:1507 +#: ../../c-api/init.rst:1510 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:1513 +#: ../../c-api/init.rst:1516 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1833,17 +1836,17 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1519 +#: ../../c-api/init.rst:1522 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:1526 +#: ../../c-api/init.rst:1529 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1528 +#: ../../c-api/init.rst:1531 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 " @@ -1851,7 +1854,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1533 +#: ../../c-api/init.rst:1536 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1862,31 +1865,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1540 +#: ../../c-api/init.rst:1543 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:1546 +#: ../../c-api/init.rst:1549 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:1552 +#: ../../c-api/init.rst:1555 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1556 +#: ../../c-api/init.rst:1559 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:1560 +#: ../../c-api/init.rst:1563 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -1894,44 +1897,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1568 +#: ../../c-api/init.rst:1571 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:1572 +#: ../../c-api/init.rst:1575 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1577 +#: ../../c-api/init.rst:1580 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:1582 +#: ../../c-api/init.rst:1585 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1587 +#: ../../c-api/init.rst:1590 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:1593 +#: ../../c-api/init.rst:1596 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:1600 +#: ../../c-api/init.rst:1603 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 " @@ -1940,37 +1943,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1607 +#: ../../c-api/init.rst:1610 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1612 +#: ../../c-api/init.rst:1615 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1619 +#: ../../c-api/init.rst:1622 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1623 +#: ../../c-api/init.rst:1626 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1627 +#: ../../c-api/init.rst:1630 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1629 +#: ../../c-api/init.rst:1632 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1643 +#: ../../c-api/init.rst:1646 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1983,13 +1986,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1653 +#: ../../c-api/init.rst:1656 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1656 +#: ../../c-api/init.rst:1659 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -2000,7 +2003,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1665 +#: ../../c-api/init.rst:1668 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -2012,13 +2015,13 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1676 +#: ../../c-api/init.rst:1679 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1679 +#: ../../c-api/init.rst:1682 msgid "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -2029,7 +2032,11 @@ msgid "" " .check_multi_interp_extensions = 1,\n" " .gil = PyInterpreterConfig_OWN_GIL,\n" "};\n" -"PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);" +"PyThreadState *tstate = NULL;\n" +"PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);\n" +"if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +"}" msgstr "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -2040,9 +2047,13 @@ msgstr "" " .check_multi_interp_extensions = 1,\n" " .gil = PyInterpreterConfig_OWN_GIL,\n" "};\n" -"PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);" +"PyThreadState *tstate = NULL;\n" +"PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);\n" +"if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +"}" -#: ../../c-api/init.rst:1690 +#: ../../c-api/init.rst:1697 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:" @@ -2050,11 +2061,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1699 +#: ../../c-api/init.rst:1706 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1701 +#: ../../c-api/init.rst:1708 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -2062,7 +2073,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1707 +#: ../../c-api/init.rst:1714 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -2074,7 +2085,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1718 +#: ../../c-api/init.rst:1725 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:" @@ -2084,7 +2095,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1738 +#: ../../c-api/init.rst:1745 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -2093,7 +2104,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1750 +#: ../../c-api/init.rst:1757 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -2103,17 +2114,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1758 +#: ../../c-api/init.rst:1765 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1763 +#: ../../c-api/init.rst:1770 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1765 +#: ../../c-api/init.rst:1772 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -2125,7 +2136,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1775 +#: ../../c-api/init.rst:1782 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2139,7 +2150,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1786 +#: ../../c-api/init.rst:1793 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2147,7 +2158,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1791 +#: ../../c-api/init.rst:1798 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2157,11 +2168,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1802 +#: ../../c-api/init.rst:1809 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1804 +#: ../../c-api/init.rst:1811 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2174,7 +2185,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1814 +#: ../../c-api/init.rst:1821 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2183,7 +2194,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1820 +#: ../../c-api/init.rst:1827 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2195,25 +2206,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1831 +#: ../../c-api/init.rst:1838 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1833 +#: ../../c-api/init.rst:1840 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:1840 +#: ../../c-api/init.rst:1847 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:1844 +#: ../../c-api/init.rst:1851 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2221,17 +2232,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1849 +#: ../../c-api/init.rst:1856 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1850 +#: ../../c-api/init.rst:1857 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1853 +#: ../../c-api/init.rst:1860 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2239,20 +2250,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1858 +#: ../../c-api/init.rst:1865 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1861 +#: ../../c-api/init.rst:1868 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1866 +#: ../../c-api/init.rst:1873 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 " @@ -2262,7 +2273,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1875 +#: ../../c-api/init.rst:1882 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 " @@ -2270,18 +2281,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1884 +#: ../../c-api/init.rst:1891 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1889 +#: ../../c-api/init.rst:1896 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:1893 +#: ../../c-api/init.rst:1900 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 " @@ -2291,7 +2302,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1903 +#: ../../c-api/init.rst:1910 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 " @@ -2303,66 +2314,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1912 +#: ../../c-api/init.rst:1919 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1912 +#: ../../c-api/init.rst:1919 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:1914 +#: ../../c-api/init.rst:1921 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1914 ../../c-api/init.rst:1919 -#: ../../c-api/init.rst:1930 +#: ../../c-api/init.rst:1921 ../../c-api/init.rst:1926 +#: ../../c-api/init.rst:1937 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1916 +#: ../../c-api/init.rst:1923 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1916 +#: ../../c-api/init.rst:1923 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1919 +#: ../../c-api/init.rst:1926 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1921 +#: ../../c-api/init.rst:1928 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1921 +#: ../../c-api/init.rst:1928 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1924 +#: ../../c-api/init.rst:1931 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1924 ../../c-api/init.rst:1926 -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1931 ../../c-api/init.rst:1933 +#: ../../c-api/init.rst:1935 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:1926 +#: ../../c-api/init.rst:1933 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1928 +#: ../../c-api/init.rst:1935 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1930 +#: ../../c-api/init.rst:1937 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1935 +#: ../../c-api/init.rst:1942 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 " @@ -2371,7 +2382,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1944 +#: ../../c-api/init.rst:1951 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 " @@ -2383,7 +2394,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1955 +#: ../../c-api/init.rst:1962 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 " @@ -2391,31 +2402,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1963 +#: ../../c-api/init.rst:1970 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:1969 +#: ../../c-api/init.rst:1976 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:1975 +#: ../../c-api/init.rst:1982 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:1981 +#: ../../c-api/init.rst:1988 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1987 +#: ../../c-api/init.rst:1994 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 " @@ -2423,7 +2434,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1995 +#: ../../c-api/init.rst:2002 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``. " @@ -2433,29 +2444,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:2002 +#: ../../c-api/init.rst:2009 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:2004 ../../c-api/init.rst:2011 -#: ../../c-api/init.rst:2030 ../../c-api/init.rst:2037 +#: ../../c-api/init.rst:2011 ../../c-api/init.rst:2018 +#: ../../c-api/init.rst:2037 ../../c-api/init.rst:2044 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:2008 +#: ../../c-api/init.rst:2015 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:2013 +#: ../../c-api/init.rst:2020 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:2021 +#: ../../c-api/init.rst:2028 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2466,28 +2477,28 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:2028 +#: ../../c-api/init.rst:2035 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:2034 +#: ../../c-api/init.rst:2041 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:2039 +#: ../../c-api/init.rst:2046 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:2045 +#: ../../c-api/init.rst:2052 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:2051 +#: ../../c-api/init.rst:2058 msgid "" "The type of the trace function registered using :c:func:" "`PyRefTracer_SetTracer`. The first parameter is a Python object that has " @@ -2497,19 +2508,19 @@ msgid "" "provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:2061 +#: ../../c-api/init.rst:2068 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:2066 +#: ../../c-api/init.rst:2073 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:2071 +#: ../../c-api/init.rst:2078 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 " @@ -2518,7 +2529,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:2077 +#: ../../c-api/init.rst:2084 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 " @@ -2526,11 +2537,11 @@ msgid "" "the tracer function is called." msgstr "" -#: ../../c-api/init.rst:2082 ../../c-api/init.rst:2093 +#: ../../c-api/init.rst:2089 ../../c-api/init.rst:2100 msgid "The GIL must be held when calling this function." msgstr "" -#: ../../c-api/init.rst:2088 +#: ../../c-api/init.rst:2095 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2538,48 +2549,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:2100 +#: ../../c-api/init.rst:2107 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2105 +#: ../../c-api/init.rst:2112 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2110 +#: ../../c-api/init.rst:2117 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2115 +#: ../../c-api/init.rst:2122 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2120 +#: ../../c-api/init.rst:2127 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2126 +#: ../../c-api/init.rst:2133 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:2132 +#: ../../c-api/init.rst:2139 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:2139 +#: ../../c-api/init.rst:2146 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2143 +#: ../../c-api/init.rst:2150 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2589,19 +2600,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2150 +#: ../../c-api/init.rst:2157 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2153 +#: ../../c-api/init.rst:2160 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:2157 +#: ../../c-api/init.rst:2164 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 " @@ -2609,22 +2620,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2165 +#: ../../c-api/init.rst:2172 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2167 +#: ../../c-api/init.rst:2174 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:2173 +#: ../../c-api/init.rst:2180 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2178 +#: ../../c-api/init.rst:2185 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 " @@ -2632,52 +2643,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2183 +#: ../../c-api/init.rst:2190 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:2189 +#: ../../c-api/init.rst:2196 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:2194 +#: ../../c-api/init.rst:2201 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2196 +#: ../../c-api/init.rst:2203 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:2203 +#: ../../c-api/init.rst:2210 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:2210 +#: ../../c-api/init.rst:2217 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:2216 +#: ../../c-api/init.rst:2223 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2221 +#: ../../c-api/init.rst:2228 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2223 +#: ../../c-api/init.rst:2230 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 " @@ -2685,13 +2696,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2231 +#: ../../c-api/init.rst:2238 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:2237 +#: ../../c-api/init.rst:2244 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 " @@ -2700,7 +2711,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2246 +#: ../../c-api/init.rst:2253 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 " @@ -2709,31 +2720,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2255 +#: ../../c-api/init.rst:2262 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:2262 +#: ../../c-api/init.rst:2269 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:2270 +#: ../../c-api/init.rst:2277 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2272 +#: ../../c-api/init.rst:2279 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2277 +#: ../../c-api/init.rst:2284 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 " @@ -2742,62 +2753,62 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2282 +#: ../../c-api/init.rst:2289 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:2293 +#: ../../c-api/init.rst:2300 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2295 +#: ../../c-api/init.rst:2302 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2299 +#: ../../c-api/init.rst:2306 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:2302 +#: ../../c-api/init.rst:2309 msgid "PyMutex mutex = {0};" msgstr "" -#: ../../c-api/init.rst:2304 +#: ../../c-api/init.rst:2311 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:2310 +#: ../../c-api/init.rst:2317 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:2318 +#: ../../c-api/init.rst:2325 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 " "temporarily release the :term:`GIL` if it is held." msgstr "" -#: ../../c-api/init.rst:2326 +#: ../../c-api/init.rst:2333 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2334 +#: ../../c-api/init.rst:2341 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2336 +#: ../../c-api/init.rst:2343 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded ` CPython. They are " @@ -2805,7 +2816,7 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2341 +#: ../../c-api/init.rst:2348 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " "sections and releasing the locks during calls to :c:func:" @@ -2815,7 +2826,7 @@ msgid "" "-- they are useful because their behavior is similar to the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:2348 +#: ../../c-api/init.rst:2355 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 " @@ -2823,7 +2834,7 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2355 +#: ../../c-api/init.rst:2362 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 " @@ -2832,11 +2843,11 @@ msgid "" "lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2361 +#: ../../c-api/init.rst:2368 msgid "Example usage::" msgstr "" -#: ../../c-api/init.rst:2363 +#: ../../c-api/init.rst:2370 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -2848,7 +2859,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/init.rst:2372 +#: ../../c-api/init.rst:2379 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 " @@ -2858,63 +2869,63 @@ msgid "" "`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2380 +#: ../../c-api/init.rst:2387 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2383 ../../c-api/init.rst:2397 -#: ../../c-api/init.rst:2412 ../../c-api/init.rst:2426 +#: ../../c-api/init.rst:2390 ../../c-api/init.rst:2404 +#: ../../c-api/init.rst:2419 ../../c-api/init.rst:2433 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2385 +#: ../../c-api/init.rst:2392 msgid "" "{\n" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" msgstr "" -#: ../../c-api/init.rst:2389 ../../c-api/init.rst:2418 +#: ../../c-api/init.rst:2396 ../../c-api/init.rst:2425 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2395 +#: ../../c-api/init.rst:2402 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2399 +#: ../../c-api/init.rst:2406 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" msgstr "" -#: ../../c-api/init.rst:2402 ../../c-api/init.rst:2431 +#: ../../c-api/init.rst:2409 ../../c-api/init.rst:2438 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2408 +#: ../../c-api/init.rst:2415 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:2414 +#: ../../c-api/init.rst:2421 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" -" PyCriticalSection_Begin2(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" +" PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" msgstr "" -#: ../../c-api/init.rst:2424 +#: ../../c-api/init.rst:2431 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2428 +#: ../../c-api/init.rst:2435 msgid "" -" PyCriticalSection_End2(&_py_cs2);\n" +" PyCriticalSection2_End(&_py_cs2);\n" "}" msgstr "" @@ -2931,19 +2942,19 @@ msgid "path (in module sys)" msgstr "path(sys 模組中)" #: ../../c-api/init.rst:350 ../../c-api/init.rst:701 ../../c-api/init.rst:1136 -#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "sys" msgstr "sys" @@ -2955,7 +2966,7 @@ msgstr "search(搜尋)" msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1695 ../../c-api/init.rst:1748 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1702 ../../c-api/init.rst:1755 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" @@ -3051,22 +3062,22 @@ msgstr "PyEval_RestoreThread()" msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1635 ../../c-api/init.rst:1730 +#: ../../c-api/init.rst:1638 ../../c-api/init.rst:1737 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1695 +#: ../../c-api/init.rst:1702 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1725 +#: ../../c-api/init.rst:1732 msgid "close (in module os)" msgstr "close(os 模組中)" diff --git a/c-api/monitoring.po b/c-api/monitoring.po index d4d8d09510..67816dfd7a 100644 --- a/c-api/monitoring.po +++ b/c-api/monitoring.po @@ -1,7 +1,5 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # #, fuzzy msgid "" @@ -11,7 +9,8 @@ msgstr "" "POT-Creation-Date: 2024-10-22 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,11 +18,11 @@ msgstr "" #: ../../c-api/monitoring.rst:6 msgid "Monitoring C API" -msgstr "" +msgstr "監控 C API" #: ../../c-api/monitoring.rst:8 msgid "Added in version 3.13." -msgstr "" +msgstr "於 3.13 版本中新增。" #: ../../c-api/monitoring.rst:10 msgid "" @@ -76,43 +75,43 @@ msgstr "" #: ../../c-api/monitoring.rst:41 msgid "See :mod:`sys.monitoring` for descriptions of the events." -msgstr "" +msgstr "關於事件的敘述請見 :mod:`sys.monitoring`。" #: ../../c-api/monitoring.rst:45 msgid "Fire a ``PY_START`` event." -msgstr "" +msgstr "發出一個 ``PY_START`` 事件。" #: ../../c-api/monitoring.rst:50 msgid "Fire a ``PY_RESUME`` event." -msgstr "" +msgstr "發出一個 ``PY_RESUME`` 事件。" #: ../../c-api/monitoring.rst:55 msgid "Fire a ``PY_RETURN`` event." -msgstr "" +msgstr "發出一個 ``PY_RETURN`` 事件。" #: ../../c-api/monitoring.rst:60 msgid "Fire a ``PY_YIELD`` event." -msgstr "" +msgstr "發出一個 ``PY_YIELD`` 事件。" #: ../../c-api/monitoring.rst:65 msgid "Fire a ``CALL`` event." -msgstr "" +msgstr "發出一個 ``CALL`` 事件。" #: ../../c-api/monitoring.rst:70 msgid "Fire a ``LINE`` event." -msgstr "" +msgstr "發出一個 ``LINE`` 事件。" #: ../../c-api/monitoring.rst:75 msgid "Fire a ``JUMP`` event." -msgstr "" +msgstr "發出一個 ``JUMP`` 事件。" #: ../../c-api/monitoring.rst:80 msgid "Fire a ``BRANCH`` event." -msgstr "" +msgstr "發出一個 ``BRANCH`` 事件。" #: ../../c-api/monitoring.rst:85 msgid "Fire a ``C_RETURN`` event." -msgstr "" +msgstr "發出一個 ``C_RETURN`` 事件。" #: ../../c-api/monitoring.rst:90 msgid "" @@ -201,7 +200,7 @@ msgstr "" #: ../../c-api/monitoring.rst:161 msgid "The macros for *event_types* are:" -msgstr "" +msgstr "*event_types* 的巨集有:" #: ../../c-api/monitoring.rst:169 msgid "Macro" @@ -209,7 +208,7 @@ msgstr "巨集" #: ../../c-api/monitoring.rst:169 msgid "Event" -msgstr "" +msgstr "事件" #: ../../c-api/monitoring.rst:171 msgid ":monitoring-event:`BRANCH`" diff --git a/c-api/time.po b/c-api/time.po index 7636335954..a3c2646b3a 100644 --- a/c-api/time.po +++ b/c-api/time.po @@ -1,7 +1,5 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # #, fuzzy msgid "" @@ -11,7 +9,8 @@ msgstr "" "POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,7 +18,7 @@ msgstr "" #: ../../c-api/time.rst:6 msgid "PyTime C API" -msgstr "" +msgstr "PyTime C API" #: ../../c-api/time.rst:10 msgid "" diff --git a/deprecations/c-api-pending-removal-in-3.14.po b/deprecations/c-api-pending-removal-in-3.14.po index aaa4c2db16..ed8747f95e 100644 --- a/deprecations/c-api-pending-removal-in-3.14.po +++ b/deprecations/c-api-pending-removal-in-3.14.po @@ -1,6 +1,5 @@ # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # msgid "" msgstr "" @@ -9,7 +8,8 @@ msgstr "" "POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/deprecations/c-api-pending-removal-in-3.15.po b/deprecations/c-api-pending-removal-in-3.15.po index e8ab611316..f828c57849 100644 --- a/deprecations/c-api-pending-removal-in-3.15.po +++ b/deprecations/c-api-pending-removal-in-3.15.po @@ -1,7 +1,5 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # msgid "" msgstr "" @@ -10,7 +8,8 @@ msgstr "" "POT-Creation-Date: 2024-10-22 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/deprecations/c-api-pending-removal-in-future.po b/deprecations/c-api-pending-removal-in-future.po index a042b964bc..49bec35846 100644 --- a/deprecations/c-api-pending-removal-in-future.po +++ b/deprecations/c-api-pending-removal-in-future.po @@ -1,7 +1,5 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # msgid "" msgstr "" @@ -10,7 +8,8 @@ msgstr "" "POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/deprecations/index.po b/deprecations/index.po index 9d2c3b3c16..b6c4ff73e5 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -1,6 +1,5 @@ # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # msgid "" msgstr "" @@ -9,7 +8,8 @@ msgstr "" "POT-Creation-Date: 2024-11-10 17:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -467,6 +467,9 @@ msgid "" "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 #: ../../deprecations/pending-removal-in-future.rst:12 @@ -1351,10 +1354,3 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-future.rst:50 msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" - -#~ msgid "" -#~ "date and datetime adapter, date and timestamp converter: see the :mod:" -#~ "`sqlite3` documentation for suggested replacement recipes." -#~ msgstr "" -#~ "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 " -#~ "(converter):請參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" diff --git a/deprecations/pending-removal-in-3.13.po b/deprecations/pending-removal-in-3.13.po index d39a172a1a..6e382beeb8 100644 --- a/deprecations/pending-removal-in-3.13.po +++ b/deprecations/pending-removal-in-3.13.po @@ -1,6 +1,5 @@ # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # msgid "" msgstr "" @@ -9,7 +8,8 @@ msgstr "" "POT-Creation-Date: 2024-09-23 07:52+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po index c471f0275a..f6e86c446f 100644 --- a/deprecations/pending-removal-in-3.14.po +++ b/deprecations/pending-removal-in-3.14.po @@ -1,6 +1,5 @@ # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # msgid "" msgstr "" @@ -9,7 +8,8 @@ msgstr "" "POT-Creation-Date: 2024-11-10 17:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index 0f21b19e13..8c048042e0 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -1,6 +1,5 @@ # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # msgid "" msgstr "" @@ -9,7 +8,8 @@ msgstr "" "POT-Creation-Date: 2024-11-05 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/deprecations/pending-removal-in-3.16.po b/deprecations/pending-removal-in-3.16.po index eec8eb350d..785fc0e03f 100644 --- a/deprecations/pending-removal-in-3.16.po +++ b/deprecations/pending-removal-in-3.16.po @@ -1,6 +1,5 @@ # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # msgid "" msgstr "" @@ -9,7 +8,8 @@ msgstr "" "POT-Creation-Date: 2024-11-10 17:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -58,6 +58,9 @@ msgid "" "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:`builtins`:" diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po index 80f5e1023a..9649475ba7 100644 --- a/deprecations/pending-removal-in-future.po +++ b/deprecations/pending-removal-in-future.po @@ -1,6 +1,6 @@ # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. +# FIRST AUTHOR , YEAR # msgid "" msgstr "" @@ -9,7 +9,8 @@ msgstr "" "POT-Creation-Date: 2024-09-23 07:52+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/howto/argparse-optparse.po b/howto/argparse-optparse.po index d54b85eb9c..39f928c87d 100644 --- a/howto/argparse-optparse.po +++ b/howto/argparse-optparse.po @@ -1,7 +1,5 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # #, fuzzy msgid "" @@ -11,7 +9,8 @@ msgstr "" "POT-Creation-Date: 2024-10-09 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,7 +18,7 @@ msgstr "" #: ../../howto/argparse-optparse.rst:7 msgid "Upgrading optparse code" -msgstr "" +msgstr "升級 optparse 程式碼" #: ../../howto/argparse-optparse.rst:9 msgid "" diff --git a/howto/descriptor.po b/howto/descriptor.po index 876ca82e89..4d1b659340 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-11-27 00:14+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -95,8 +95,8 @@ msgstr "" #: ../../howto/descriptor.rst:45 msgid "" -"The :class:`Ten` class is a descriptor whose :meth:`__get__` method always " -"returns the constant ``10``:" +"The :class:`!Ten` class is a descriptor whose :meth:`~object.__get__` method " +"always returns the constant ``10``:" msgstr "" #: ../../howto/descriptor.rst:48 @@ -214,11 +214,11 @@ msgstr "" #: ../../howto/descriptor.rst:122 msgid "" "Besides showing how descriptors can run computations, this example also " -"reveals the purpose of the parameters to :meth:`__get__`. The *self* " -"parameter is *size*, an instance of *DirectorySize*. The *obj* parameter is " -"either *g* or *s*, an instance of *Directory*. It is the *obj* parameter " -"that lets the :meth:`__get__` method learn the target directory. The " -"*objtype* parameter is the class *Directory*." +"reveals the purpose of the parameters to :meth:`~object.__get__`. The " +"*self* parameter is *size*, an instance of *DirectorySize*. The *obj* " +"parameter is either *g* or *s*, an instance of *Directory*. It is the *obj* " +"parameter that lets the :meth:`~object.__get__` method learn the target " +"directory. The *objtype* parameter is the class *Directory*." msgstr "" #: ../../howto/descriptor.rst:131 @@ -230,8 +230,8 @@ msgid "" "A popular use for descriptors is managing access to instance data. The " "descriptor is assigned to a public attribute in the class dictionary while " "the actual data is stored as a private attribute in the instance " -"dictionary. The descriptor's :meth:`__get__` and :meth:`__set__` methods " -"are triggered when the public attribute is accessed." +"dictionary. The descriptor's :meth:`~object.__get__` and :meth:`~object." +"__set__` methods are triggered when the public attribute is accessed." msgstr "" #: ../../howto/descriptor.rst:139 @@ -326,10 +326,10 @@ msgstr "" #: ../../howto/descriptor.rst:218 msgid "" -"In this example, the :class:`Person` class has two descriptor instances, " -"*name* and *age*. When the :class:`Person` class is defined, it makes a " -"callback to :meth:`__set_name__` in *LoggedAccess* so that the field names " -"can be recorded, giving each descriptor its own *public_name* and " +"In this example, the :class:`!Person` class has two descriptor instances, " +"*name* and *age*. When the :class:`!Person` class is defined, it makes a " +"callback to :meth:`~object.__set_name__` in *LoggedAccess* so that the field " +"names can be recorded, giving each descriptor its own *public_name* and " "*private_name*:" msgstr "" @@ -369,9 +369,9 @@ msgstr "" #: ../../howto/descriptor.rst:256 msgid "" -"An interactive session shows that the :class:`Person` class has called :meth:" -"`__set_name__` so that the field names would be recorded. Here we call :" -"func:`vars` to look up the descriptor without triggering it:" +"An interactive session shows that the :class:`!Person` class has called :" +"meth:`~object.__set_name__` so that the field names would be recorded. Here " +"we call :func:`vars` to look up the descriptor without triggering it:" msgstr "" #: ../../howto/descriptor.rst:260 @@ -428,16 +428,16 @@ msgstr "" #: ../../howto/descriptor.rst:297 msgid "" -"A :term:`descriptor` is what we call any object that defines :meth:" -"`__get__`, :meth:`__set__`, or :meth:`__delete__`." +"A :term:`descriptor` is what we call any object that defines :meth:`~object." +"__get__`, :meth:`~object.__set__`, or :meth:`~object.__delete__`." msgstr "" #: ../../howto/descriptor.rst:300 msgid "" -"Optionally, descriptors can have a :meth:`__set_name__` method. This is " -"only used in cases where a descriptor needs to know either the class where " -"it was created or the name of class variable it was assigned to. (This " -"method, if present, is called even if the class is not a descriptor.)" +"Optionally, descriptors can have a :meth:`~object.__set_name__` method. " +"This is only used in cases where a descriptor needs to know either the class " +"where it was created or the name of class variable it was assigned to. " +"(This method, if present, is called even if the class is not a descriptor.)" msgstr "" #: ../../howto/descriptor.rst:305 @@ -498,7 +498,7 @@ msgstr "" #: ../../howto/descriptor.rst:340 msgid "" -"This :class:`Validator` class is both an :term:`abstract base class` and a " +"This :class:`!Validator` class is both an :term:`abstract base class` and a " "managed attribute descriptor:" msgstr "" @@ -542,8 +542,8 @@ msgstr "" #: ../../howto/descriptor.rst:363 msgid "" -"Custom validators need to inherit from :class:`Validator` and must supply a :" -"meth:`validate` method to test various restrictions as needed." +"Custom validators need to inherit from :class:`!Validator` and must supply " +"a :meth:`!validate` method to test various restrictions as needed." msgstr "" #: ../../howto/descriptor.rst:368 @@ -556,19 +556,19 @@ msgstr "" #: ../../howto/descriptor.rst:372 msgid "" -":class:`OneOf` verifies that a value is one of a restricted set of options." +":class:`!OneOf` verifies that a value is one of a restricted set of options." msgstr "" #: ../../howto/descriptor.rst:374 msgid "" -":class:`Number` verifies that a value is either an :class:`int` or :class:" +":class:`!Number` verifies that a value is either an :class:`int` or :class:" "`float`. Optionally, it verifies that a value is between a given minimum or " "maximum." msgstr "" #: ../../howto/descriptor.rst:378 msgid "" -":class:`String` verifies that a value is a :class:`str`. Optionally, it " +":class:`!String` verifies that a value is a :class:`str`. Optionally, it " "validates a given minimum or maximum length. It can validate a user-defined " "`predicate `_ " "as well." @@ -716,9 +716,9 @@ msgstr "" #: ../../howto/descriptor.rst:503 msgid "" "In general, a descriptor is an attribute value that has one of the methods " -"in the descriptor protocol. Those methods are :meth:`__get__`, :meth:" -"`__set__`, and :meth:`__delete__`. If any of those methods are defined for " -"an attribute, it is said to be a :term:`descriptor`." +"in the descriptor protocol. Those methods are :meth:`~object.__get__`, :" +"meth:`~object.__set__`, and :meth:`~object.__delete__`. If any of those " +"methods are defined for an attribute, it is said to be a :term:`descriptor`." msgstr "" #: ../../howto/descriptor.rst:508 @@ -767,10 +767,10 @@ msgstr "" #: ../../howto/descriptor.rst:537 msgid "" -"If an object defines :meth:`__set__` or :meth:`__delete__`, it is considered " -"a data descriptor. Descriptors that only define :meth:`__get__` are called " -"non-data descriptors (they are often used for methods but other uses are " -"possible)." +"If an object defines :meth:`~object.__set__` or :meth:`~object.__delete__`, " +"it is considered a data descriptor. Descriptors that only define :meth:" +"`~object.__get__` are called non-data descriptors (they are often used for " +"methods but other uses are possible)." msgstr "" #: ../../howto/descriptor.rst:542 @@ -784,10 +784,10 @@ msgstr "" #: ../../howto/descriptor.rst:548 msgid "" -"To make a read-only data descriptor, define both :meth:`__get__` and :meth:" -"`__set__` with the :meth:`__set__` raising an :exc:`AttributeError` when " -"called. Defining the :meth:`__set__` method with an exception raising " -"placeholder is enough to make it a data descriptor." +"To make a read-only data descriptor, define both :meth:`~object.__get__` " +"and :meth:`~object.__set__` with the :meth:`~object.__set__` raising an :exc:" +"`AttributeError` when called. Defining the :meth:`~object.__set__` method " +"with an exception raising placeholder is enough to make it a data descriptor." msgstr "" #: ../../howto/descriptor.rst:555 @@ -828,8 +828,8 @@ msgstr "" msgid "" "Instance lookup scans through a chain of namespaces giving data descriptors " "the highest priority, followed by instance variables, then non-data " -"descriptors, then class variables, and lastly :meth:`__getattr__` if it is " -"provided." +"descriptors, then class variables, and lastly :meth:`~object.__getattr__` if " +"it is provided." msgstr "" #: ../../howto/descriptor.rst:580 @@ -875,16 +875,17 @@ msgstr "" #: ../../howto/descriptor.rst:722 msgid "" -"Note, there is no :meth:`__getattr__` hook in the :meth:`__getattribute__` " -"code. That is why calling :meth:`__getattribute__` directly or with " -"``super().__getattribute__`` will bypass :meth:`__getattr__` entirely." +"Note, there is no :meth:`~object.__getattr__` hook in the :meth:`~object." +"__getattribute__` code. That is why calling :meth:`~object." +"__getattribute__` directly or with ``super().__getattribute__`` will bypass :" +"meth:`~object.__getattr__` entirely." msgstr "" #: ../../howto/descriptor.rst:726 msgid "" "Instead, it is the dot operator and the :func:`getattr` function that are " -"responsible for invoking :meth:`__getattr__` whenever :meth:" -"`__getattribute__` raises an :exc:`AttributeError`. Their logic is " +"responsible for invoking :meth:`~object.__getattr__` whenever :meth:`~object." +"__getattribute__` raises an :exc:`AttributeError`. Their logic is " "encapsulated in a helper function:" msgstr "" @@ -914,8 +915,8 @@ msgstr "" #: ../../howto/descriptor.rst:778 msgid "" -"The logic for a dotted lookup such as ``A.x`` is in :meth:`type." -"__getattribute__`. The steps are similar to those for :meth:`object." +"The logic for a dotted lookup such as ``A.x`` is in :meth:`!type." +"__getattribute__`. The steps are similar to those for :meth:`!object." "__getattribute__` but the instance dictionary lookup is replaced by a search " "through the class's :term:`method resolution order`." msgstr "" @@ -936,8 +937,8 @@ msgstr "" #: ../../howto/descriptor.rst:792 msgid "" -"The logic for super's dotted lookup is in the :meth:`__getattribute__` " -"method for object returned by :func:`super`." +"The logic for super's dotted lookup is in the :meth:`~object." +"__getattribute__` method for object returned by :func:`super`." msgstr "" #: ../../howto/descriptor.rst:795 @@ -962,8 +963,9 @@ msgstr "" #: ../../howto/descriptor.rst:809 msgid "" -"The mechanism for descriptors is embedded in the :meth:`__getattribute__` " -"methods for :class:`object`, :class:`type`, and :func:`super`." +"The mechanism for descriptors is embedded in the :meth:`~object." +"__getattribute__` methods for :class:`object`, :class:`type`, and :func:" +"`super`." msgstr "" #: ../../howto/descriptor.rst:812 @@ -971,7 +973,7 @@ msgid "The important points to remember are:" msgstr "要記住的重點是:" #: ../../howto/descriptor.rst:814 -msgid "Descriptors are invoked by the :meth:`__getattribute__` method." +msgid "Descriptors are invoked by the :meth:`~object.__getattribute__` method." msgstr "" #: ../../howto/descriptor.rst:816 @@ -982,16 +984,16 @@ msgstr "" #: ../../howto/descriptor.rst:819 msgid "" -"Overriding :meth:`__getattribute__` prevents automatic descriptor calls " -"because all the descriptor logic is in that method." +"Overriding :meth:`~object.__getattribute__` prevents automatic descriptor " +"calls because all the descriptor logic is in that method." msgstr "" #: ../../howto/descriptor.rst:822 msgid "" -":meth:`object.__getattribute__` and :meth:`type.__getattribute__` make " -"different calls to :meth:`__get__`. The first includes the instance and may " -"include the class. The second puts in ``None`` for the instance and always " -"includes the class." +":meth:`!object.__getattribute__` and :meth:`!type.__getattribute__` make " +"different calls to :meth:`~object.__get__`. The first includes the instance " +"and may include the class. The second puts in ``None`` for the instance and " +"always includes the class." msgstr "" #: ../../howto/descriptor.rst:827 @@ -1011,9 +1013,9 @@ msgid "" "Sometimes it is desirable for a descriptor to know what class variable name " "it was assigned to. When a new class is created, the :class:`type` " "metaclass scans the dictionary of the new class. If any of the entries are " -"descriptors and if they define :meth:`__set_name__`, that method is called " -"with two arguments. The *owner* is the class where the descriptor is used, " -"and the *name* is the class variable the descriptor was assigned to." +"descriptors and if they define :meth:`~object.__set_name__`, that method is " +"called with two arguments. The *owner* is the class where the descriptor is " +"used, and the *name* is the class variable the descriptor was assigned to." msgstr "" #: ../../howto/descriptor.rst:842 @@ -1024,9 +1026,9 @@ msgstr "" #: ../../howto/descriptor.rst:845 msgid "" -"Since the update logic is in :meth:`type.__new__`, notifications only take " +"Since the update logic is in :meth:`!type.__new__`, notifications only take " "place at the time of class creation. If descriptors are added to the class " -"afterwards, :meth:`__set_name__` will need to be called manually." +"afterwards, :meth:`~object.__set_name__` will need to be called manually." msgstr "" #: ../../howto/descriptor.rst:851 @@ -1081,7 +1083,7 @@ msgstr "" #: ../../howto/descriptor.rst:876 msgid "" -"We can use the :class:`Field` class to define `models `_ that describe the schema for each table in a " "database:" msgstr "" @@ -1281,7 +1283,7 @@ msgstr "" #: ../../howto/descriptor.rst:1143 msgid "" -"Either the built-in :func:`property` or our :func:`Property` equivalent " +"Either the built-in :func:`property` or our :func:`!Property` equivalent " "would work in this example." msgstr "" @@ -1341,9 +1343,9 @@ msgstr "" #: ../../howto/descriptor.rst:1189 msgid "" "To support automatic creation of methods, functions include the :meth:" -"`__get__` method for binding methods during attribute access. This means " -"that functions are non-data descriptors that return bound methods during " -"dotted lookup from an instance. Here's how it works:" +"`~object.__get__` method for binding methods during attribute access. This " +"means that functions are non-data descriptors that return bound methods " +"during dotted lookup from an instance. Here's how it works:" msgstr "" #: ../../howto/descriptor.rst:1194 @@ -1396,7 +1398,7 @@ msgstr "" #: ../../howto/descriptor.rst:1233 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" -"`__get__`. Instead, it just returns the underlying function object::" +"`~object.__get__`. Instead, it just returns the underlying function object::" msgstr "" #: ../../howto/descriptor.rst:1236 @@ -1409,8 +1411,8 @@ msgstr "" #: ../../howto/descriptor.rst:1239 msgid "" -"Dotted access from a class calls :meth:`__get__` which just returns the " -"underlying function unchanged::" +"Dotted access from a class calls :meth:`~object.__get__` which just returns " +"the underlying function unchanged::" msgstr "" #: ../../howto/descriptor.rst:1242 @@ -1424,7 +1426,8 @@ msgstr "" #: ../../howto/descriptor.rst:1245 msgid "" "The interesting behavior occurs during dotted access from an instance. The " -"dotted lookup calls :meth:`__get__` which returns a bound method object::" +"dotted lookup calls :meth:`~object.__get__` which returns a bound method " +"object::" msgstr "" #: ../../howto/descriptor.rst:1248 @@ -1475,10 +1478,10 @@ msgstr "" #: ../../howto/descriptor.rst:1271 msgid "" -"To recap, functions have a :meth:`__get__` method so that they can be " -"converted to a method when accessed as attributes. The non-data descriptor " -"transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. Calling ``cls." -"f(*args)`` becomes ``f(*args)``." +"To recap, functions have a :meth:`~object.__get__` method so that they can " +"be converted to a method when accessed as attributes. The non-data " +"descriptor transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. " +"Calling ``cls.f(*args)`` becomes ``f(*args)``." msgstr "" #: ../../howto/descriptor.rst:1276 @@ -1913,8 +1916,8 @@ msgstr "" #: ../../howto/descriptor.rst:1670 msgid "" -"The :meth:`type.__new__` method takes care of adding member objects to class " -"variables:" +"The :meth:`!type.__new__` method takes care of adding member objects to " +"class variables:" msgstr "" #: ../../howto/descriptor.rst:1673 @@ -1972,8 +1975,8 @@ msgstr "" #: ../../howto/descriptor.rst:1721 msgid "" -"To use the simulation in a real class, just inherit from :class:`Object` and " -"set the :term:`metaclass` to :class:`Type`:" +"To use the simulation in a real class, just inherit from :class:`!Object` " +"and set the :term:`metaclass` to :class:`Type`:" msgstr "" #: ../../howto/descriptor.rst:1724 diff --git a/howto/enum.po b/howto/enum.po index c4f912e5cb..eeeae58470 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -1,17 +1,16 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-11-27 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -119,9 +118,16 @@ msgid "" ">>> isinstance(Weekday.FRIDAY, Weekday)\n" "True" msgstr "" +">>> type(Weekday.MONDAY)\n" +"\n" +">>> isinstance(Weekday.FRIDAY, Weekday)\n" +"True>>> type(Weekday.MONDAY)\n" +"\n" +">>> isinstance(Weekday.FRIDAY, Weekday)\n" +"True" #: ../../howto/enum.rst:67 -msgid "Enum members have an attribute that contains just their :attr:`name`::" +msgid "Enum members have an attribute that contains just their :attr:`!name`::" msgstr "" #: ../../howto/enum.rst:69 @@ -133,7 +139,7 @@ msgstr "" "TUESDAY" #: ../../howto/enum.rst:72 -msgid "Likewise, they have an attribute for their :attr:`value`::" +msgid "Likewise, they have an attribute for their :attr:`!value`::" msgstr "" #: ../../howto/enum.rst:75 @@ -148,25 +154,29 @@ msgstr "" msgid "" "Unlike many languages that treat enumerations solely as name/value pairs, " "Python Enums can have behavior added. For example, :class:`datetime.date` " -"has two methods for returning the weekday: :meth:`weekday` and :meth:" -"`isoweekday`. The difference is that one of them counts from 0-6 and the " -"other from 1-7. Rather than keep track of that ourselves we can add a method " -"to the :class:`Weekday` enum to extract the day from the :class:`date` " -"instance and return the matching enum member::" +"has two methods for returning the weekday: :meth:`~datetime.date.weekday` " +"and :meth:`~datetime.date.isoweekday`. The difference is that one of them " +"counts from 0-6 and the other from 1-7. Rather than keep track of that " +"ourselves we can add a method to the :class:`!Weekday` enum to extract the " +"day from the :class:`~datetime.date` instance and return the matching enum " +"member::" msgstr "" -#: ../../howto/enum.rst:86 +#: ../../howto/enum.rst:87 msgid "" "@classmethod\n" "def from_date(cls, date):\n" " return cls(date.isoweekday())" msgstr "" +"@classmethod\n" +"def from_date(cls, date):\n" +" return cls(date.isoweekday())" -#: ../../howto/enum.rst:90 -msgid "The complete :class:`Weekday` enum now looks like this::" +#: ../../howto/enum.rst:91 +msgid "The complete :class:`!Weekday` enum now looks like this::" msgstr "" -#: ../../howto/enum.rst:92 +#: ../../howto/enum.rst:93 msgid "" ">>> class Weekday(Enum):\n" "... MONDAY = 1\n" @@ -194,32 +204,32 @@ msgstr "" "... def from_date(cls, date):\n" "... return cls(date.isoweekday())" -#: ../../howto/enum.rst:105 +#: ../../howto/enum.rst:106 msgid "Now we can find out what today is! Observe::" msgstr "" -#: ../../howto/enum.rst:107 +#: ../../howto/enum.rst:108 msgid "" ">>> from datetime import date\n" ">>> Weekday.from_date(date.today()) \n" "" msgstr "" -#: ../../howto/enum.rst:111 +#: ../../howto/enum.rst:112 msgid "" "Of course, if you're reading this on some other day, you'll see that day " "instead." msgstr "" -#: ../../howto/enum.rst:113 +#: ../../howto/enum.rst:114 msgid "" -"This :class:`Weekday` enum is great if our variable only needs one day, but " +"This :class:`!Weekday` enum is great if our variable only needs one day, but " "what if we need several? Maybe we're writing a function to plot chores " "during a week, and don't want to use a :class:`list` -- we could use a " "different type of :class:`Enum`::" msgstr "" -#: ../../howto/enum.rst:118 +#: ../../howto/enum.rst:119 msgid "" ">>> from enum import Flag\n" ">>> class Weekday(Flag):\n" @@ -241,19 +251,19 @@ msgstr "" "... SATURDAY = 32\n" "... SUNDAY = 64" -#: ../../howto/enum.rst:128 +#: ../../howto/enum.rst:129 msgid "" "We've changed two things: we're inherited from :class:`Flag`, and the values " "are all powers of 2." msgstr "" -#: ../../howto/enum.rst:131 +#: ../../howto/enum.rst:132 msgid "" -"Just like the original :class:`Weekday` enum above, we can have a single " +"Just like the original :class:`!Weekday` enum above, we can have a single " "selection::" msgstr "" -#: ../../howto/enum.rst:133 +#: ../../howto/enum.rst:134 msgid "" ">>> first_week_day = Weekday.MONDAY\n" ">>> first_week_day\n" @@ -263,13 +273,13 @@ msgstr "" ">>> first_week_day\n" "" -#: ../../howto/enum.rst:137 +#: ../../howto/enum.rst:138 msgid "" "But :class:`Flag` also allows us to combine several members into a single " "variable::" msgstr "" -#: ../../howto/enum.rst:140 +#: ../../howto/enum.rst:141 msgid "" ">>> weekend = Weekday.SATURDAY | Weekday.SUNDAY\n" ">>> weekend\n" @@ -279,11 +289,11 @@ msgstr "" ">>> weekend\n" "" -#: ../../howto/enum.rst:144 +#: ../../howto/enum.rst:145 msgid "You can even iterate over a :class:`Flag` variable::" msgstr "" -#: ../../howto/enum.rst:146 +#: ../../howto/enum.rst:147 msgid "" ">>> for day in weekend:\n" "... print(day)\n" @@ -295,11 +305,11 @@ msgstr "" "Weekday.SATURDAY\n" "Weekday.SUNDAY" -#: ../../howto/enum.rst:151 +#: ../../howto/enum.rst:152 msgid "Okay, let's get some chores set up::" msgstr "" -#: ../../howto/enum.rst:153 +#: ../../howto/enum.rst:154 msgid "" ">>> chores_for_ethan = {\n" "... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday." @@ -315,11 +325,11 @@ msgstr "" "... 'answer SO questions': Weekday.SATURDAY,\n" "... }" -#: ../../howto/enum.rst:159 +#: ../../howto/enum.rst:160 msgid "And a function to display the chores for a given day::" msgstr "" -#: ../../howto/enum.rst:161 +#: ../../howto/enum.rst:162 msgid "" ">>> def show_chores(chores, day):\n" "... for chore, days in chores.items():\n" @@ -337,13 +347,13 @@ msgstr "" ">>> show_chores(chores_for_ethan, Weekday.SATURDAY)\n" "answer SO questions" -#: ../../howto/enum.rst:169 +#: ../../howto/enum.rst:170 msgid "" "In cases where the actual values of the members do not matter, you can save " "yourself some work and use :func:`auto` for the values::" msgstr "" -#: ../../howto/enum.rst:172 +#: ../../howto/enum.rst:173 msgid "" ">>> from enum import auto\n" ">>> class Weekday(Flag):\n" @@ -367,18 +377,18 @@ msgstr "" "... SUNDAY = auto()\n" "... WEEKEND = SATURDAY | SUNDAY" -#: ../../howto/enum.rst:188 +#: ../../howto/enum.rst:189 msgid "Programmatic access to enumeration members and their attributes" msgstr "" -#: ../../howto/enum.rst:190 +#: ../../howto/enum.rst:191 msgid "" "Sometimes it's useful to access members in enumerations programmatically (i." "e. situations where ``Color.RED`` won't do because the exact color is not " "known at program-writing time). ``Enum`` allows such access::" msgstr "" -#: ../../howto/enum.rst:194 +#: ../../howto/enum.rst:195 msgid "" ">>> Color(1)\n" "\n" @@ -390,11 +400,11 @@ msgstr "" ">>> Color(3)\n" "" -#: ../../howto/enum.rst:199 +#: ../../howto/enum.rst:200 msgid "If you want to access enum members by *name*, use item access::" msgstr "" -#: ../../howto/enum.rst:201 +#: ../../howto/enum.rst:202 msgid "" ">>> Color['RED']\n" "\n" @@ -406,11 +416,12 @@ msgstr "" ">>> Color['GREEN']\n" "" -#: ../../howto/enum.rst:206 -msgid "If you have an enum member and need its :attr:`name` or :attr:`value`::" +#: ../../howto/enum.rst:207 +msgid "" +"If you have an enum member and need its :attr:`!name` or :attr:`!value`::" msgstr "" -#: ../../howto/enum.rst:208 +#: ../../howto/enum.rst:209 msgid "" ">>> member = Color.RED\n" ">>> member.name\n" @@ -424,15 +435,15 @@ msgstr "" ">>> member.value\n" "1" -#: ../../howto/enum.rst:216 +#: ../../howto/enum.rst:217 msgid "Duplicating enum members and values" msgstr "" -#: ../../howto/enum.rst:218 +#: ../../howto/enum.rst:219 msgid "Having two enum members with the same name is invalid::" msgstr "" -#: ../../howto/enum.rst:220 +#: ../../howto/enum.rst:221 msgid "" ">>> class Shape(Enum):\n" "... SQUARE = 2\n" @@ -450,7 +461,7 @@ msgstr "" "...\n" "TypeError: 'SQUARE' already defined as 2" -#: ../../howto/enum.rst:228 +#: ../../howto/enum.rst:229 msgid "" "However, an enum member can have other names associated with it. Given two " "entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B`` " @@ -459,7 +470,7 @@ msgid "" "member ``A``. By-name lookup of ``B`` will also return the member ``A``::" msgstr "" -#: ../../howto/enum.rst:234 +#: ../../howto/enum.rst:235 msgid "" ">>> class Shape(Enum):\n" "... SQUARE = 2\n" @@ -487,24 +498,24 @@ msgstr "" ">>> Shape(2)\n" "" -#: ../../howto/enum.rst:249 +#: ../../howto/enum.rst:250 msgid "" "Attempting to create a member with the same name as an already defined " "attribute (another member, a method, etc.) or attempting to create an " "attribute with the same name as a member is not allowed." msgstr "" -#: ../../howto/enum.rst:255 +#: ../../howto/enum.rst:256 msgid "Ensuring unique enumeration values" msgstr "" -#: ../../howto/enum.rst:257 +#: ../../howto/enum.rst:258 msgid "" "By default, enumerations allow multiple names as aliases for the same value. " "When this behavior isn't desired, you can use the :func:`unique` decorator::" msgstr "" -#: ../../howto/enum.rst:260 +#: ../../howto/enum.rst:261 msgid "" ">>> from enum import Enum, unique\n" ">>> @unique\n" @@ -530,15 +541,15 @@ msgstr "" "...\n" "ValueError: duplicate values found in : FOUR -> THREE" -#: ../../howto/enum.rst:274 +#: ../../howto/enum.rst:275 msgid "Using automatic values" msgstr "" -#: ../../howto/enum.rst:276 +#: ../../howto/enum.rst:277 msgid "If the exact value is unimportant you can use :class:`auto`::" msgstr "" -#: ../../howto/enum.rst:278 +#: ../../howto/enum.rst:279 msgid "" ">>> from enum import Enum, auto\n" ">>> class Color(Enum):\n" @@ -558,13 +569,13 @@ msgstr "" ">>> [member.value for member in Color]\n" "[1, 2, 3]" -#: ../../howto/enum.rst:287 +#: ../../howto/enum.rst:288 msgid "" -"The values are chosen by :func:`_generate_next_value_`, which can be " +"The values are chosen by :func:`~Enum._generate_next_value_`, which can be " "overridden::" msgstr "" -#: ../../howto/enum.rst:290 +#: ../../howto/enum.rst:291 msgid "" ">>> class AutoName(Enum):\n" "... @staticmethod\n" @@ -594,20 +605,21 @@ msgstr "" ">>> [member.value for member in Ordinal]\n" "['NORTH', 'SOUTH', 'EAST', 'WEST']" -#: ../../howto/enum.rst:306 +#: ../../howto/enum.rst:307 msgid "" -"The :meth:`_generate_next_value_` method must be defined before any members." +"The :meth:`~Enum._generate_next_value_` method must be defined before any " +"members." msgstr "" -#: ../../howto/enum.rst:309 +#: ../../howto/enum.rst:310 msgid "Iteration" msgstr "" -#: ../../howto/enum.rst:311 +#: ../../howto/enum.rst:312 msgid "Iterating over the members of an enum does not provide the aliases::" msgstr "" -#: ../../howto/enum.rst:313 +#: ../../howto/enum.rst:314 msgid "" ">>> list(Shape)\n" "[, , ]\n" @@ -623,20 +635,20 @@ msgstr "" "THURSDAY: 8>, , , ]" -#: ../../howto/enum.rst:318 +#: ../../howto/enum.rst:319 msgid "" "Note that the aliases ``Shape.ALIAS_FOR_SQUARE`` and ``Weekday.WEEKEND`` " "aren't shown." msgstr "" -#: ../../howto/enum.rst:320 +#: ../../howto/enum.rst:321 msgid "" "The special attribute ``__members__`` is a read-only ordered mapping of " "names to members. It includes all names defined in the enumeration, " "including the aliases::" msgstr "" -#: ../../howto/enum.rst:324 +#: ../../howto/enum.rst:325 msgid "" ">>> for name, member in Shape.__members__.items():\n" "... name, member\n" @@ -654,13 +666,13 @@ msgstr "" "('CIRCLE', )\n" "('ALIAS_FOR_SQUARE', )" -#: ../../howto/enum.rst:332 +#: ../../howto/enum.rst:333 msgid "" "The ``__members__`` attribute can be used for detailed programmatic access " "to the enumeration members. For example, finding all the aliases::" msgstr "" -#: ../../howto/enum.rst:335 +#: ../../howto/enum.rst:336 msgid "" ">>> [name for name, member in Shape.__members__.items() if member.name != " "name]\n" @@ -670,21 +682,21 @@ msgstr "" "name]\n" "['ALIAS_FOR_SQUARE']" -#: ../../howto/enum.rst:340 +#: ../../howto/enum.rst:341 msgid "" "Aliases for flags include values with multiple flags set, such as ``3``, and " "no flags set, i.e. ``0``." msgstr "" -#: ../../howto/enum.rst:345 +#: ../../howto/enum.rst:346 msgid "Comparisons" msgstr "比較" -#: ../../howto/enum.rst:347 +#: ../../howto/enum.rst:348 msgid "Enumeration members are compared by identity::" msgstr "" -#: ../../howto/enum.rst:349 +#: ../../howto/enum.rst:350 msgid "" ">>> Color.RED is Color.RED\n" "True\n" @@ -700,13 +712,13 @@ msgstr "" ">>> Color.RED is not Color.BLUE\n" "True" -#: ../../howto/enum.rst:356 +#: ../../howto/enum.rst:357 msgid "" "Ordered comparisons between enumeration values are *not* supported. Enum " "members are not integers (but see `IntEnum`_ below)::" msgstr "" -#: ../../howto/enum.rst:359 +#: ../../howto/enum.rst:360 msgid "" ">>> Color.RED < Color.BLUE\n" "Traceback (most recent call last):\n" @@ -718,11 +730,11 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: '<' not supported between instances of 'Color' and 'Color'" -#: ../../howto/enum.rst:364 +#: ../../howto/enum.rst:365 msgid "Equality comparisons are defined though::" msgstr "" -#: ../../howto/enum.rst:366 +#: ../../howto/enum.rst:367 msgid "" ">>> Color.BLUE == Color.RED\n" "False\n" @@ -738,14 +750,14 @@ msgstr "" ">>> Color.BLUE == Color.BLUE\n" "True" -#: ../../howto/enum.rst:373 +#: ../../howto/enum.rst:374 msgid "" "Comparisons against non-enumeration values will always compare not equal " "(again, :class:`IntEnum` was explicitly designed to behave differently, see " "below)::" msgstr "" -#: ../../howto/enum.rst:377 +#: ../../howto/enum.rst:378 msgid "" ">>> Color.BLUE == 2\n" "False" @@ -753,18 +765,18 @@ msgstr "" ">>> Color.BLUE == 2\n" "False" -#: ../../howto/enum.rst:382 +#: ../../howto/enum.rst:383 msgid "" "It is possible to reload modules -- if a reloaded module contains enums, " "they will be recreated, and the new members may not compare identical/equal " "to the original members." msgstr "" -#: ../../howto/enum.rst:387 +#: ../../howto/enum.rst:388 msgid "Allowed members and attributes of enumerations" msgstr "" -#: ../../howto/enum.rst:389 +#: ../../howto/enum.rst:390 msgid "" "Most of the examples above use integers for enumeration values. Using " "integers is short and handy (and provided by default by the `Functional " @@ -773,13 +785,13 @@ msgid "" "*is* important, enumerations can have arbitrary values." msgstr "" -#: ../../howto/enum.rst:395 +#: ../../howto/enum.rst:396 msgid "" "Enumerations are Python classes, and can have methods and special methods as " "usual. If we have this enumeration::" msgstr "" -#: ../../howto/enum.rst:398 +#: ../../howto/enum.rst:399 msgid "" ">>> class Mood(Enum):\n" "... FUNKY = 1\n" @@ -799,11 +811,11 @@ msgid "" "..." msgstr "" -#: ../../howto/enum.rst:415 +#: ../../howto/enum.rst:416 msgid "Then::" msgstr "然後: ::" -#: ../../howto/enum.rst:417 +#: ../../howto/enum.rst:418 msgid "" ">>> Mood.favorite_mood()\n" "\n" @@ -819,43 +831,43 @@ msgstr "" ">>> str(Mood.FUNKY)\n" "'my custom str! 1'" -#: ../../howto/enum.rst:424 +#: ../../howto/enum.rst:425 msgid "" "The rules for what is allowed are as follows: names that start and end with " "a single underscore are reserved by enum and cannot be used; all other " "attributes defined within an enumeration will become members of this " -"enumeration, with the exception of special methods (:meth:`__str__`, :meth:" -"`__add__`, etc.), descriptors (methods are also descriptors), and variable " -"names listed in :attr:`_ignore_`." +"enumeration, with the exception of special methods (:meth:`~object." +"__str__`, :meth:`~object.__add__`, etc.), descriptors (methods are also " +"descriptors), and variable names listed in :attr:`~Enum._ignore_`." msgstr "" -#: ../../howto/enum.rst:431 +#: ../../howto/enum.rst:432 msgid "" -"Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__`, " -"any value(s) given to the enum member will be passed into those methods. See " -"`Planet`_ for an example." +"Note: if your enumeration defines :meth:`~object.__new__` and/or :meth:" +"`~object.__init__`, any value(s) given to the enum member will be passed " +"into those methods. See `Planet`_ for an example." msgstr "" -#: ../../howto/enum.rst:437 +#: ../../howto/enum.rst:438 msgid "" -"The :meth:`__new__` method, if defined, is used during creation of the Enum " -"members; it is then replaced by Enum's :meth:`__new__` which is used after " -"class creation for lookup of existing members. See :ref:`new-vs-init` for " -"more details." +"The :meth:`~object.__new__` method, if defined, is used during creation of " +"the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " +"which is used after class creation for lookup of existing members. See :ref:" +"`new-vs-init` for more details." msgstr "" -#: ../../howto/enum.rst:444 +#: ../../howto/enum.rst:445 msgid "Restricted Enum subclassing" msgstr "" -#: ../../howto/enum.rst:446 +#: ../../howto/enum.rst:447 msgid "" "A new :class:`Enum` class must have one base enum class, up to one concrete " "data type, and as many :class:`object`-based mixin classes as needed. The " "order of these base classes is::" msgstr "" -#: ../../howto/enum.rst:450 +#: ../../howto/enum.rst:451 msgid "" "class EnumName([mix-in, ...,] [data-type,] base-enum):\n" " pass" @@ -863,13 +875,13 @@ msgstr "" "class EnumName([mix-in, ...,] [data-type,] base-enum):\n" " pass" -#: ../../howto/enum.rst:453 +#: ../../howto/enum.rst:454 msgid "" "Also, subclassing an enumeration is allowed only if the enumeration does not " "define any members. So this is forbidden::" msgstr "" -#: ../../howto/enum.rst:456 +#: ../../howto/enum.rst:457 msgid "" ">>> class MoreColor(Color):\n" "... PINK = 17\n" @@ -885,11 +897,11 @@ msgstr "" "...\n" "TypeError: cannot extend " -#: ../../howto/enum.rst:463 +#: ../../howto/enum.rst:464 msgid "But this is allowed::" msgstr "但這是允許的:" -#: ../../howto/enum.rst:465 +#: ../../howto/enum.rst:466 msgid "" ">>> class Foo(Enum):\n" "... def some_behavior(self):\n" @@ -909,7 +921,7 @@ msgstr "" "... SAD = 2\n" "..." -#: ../../howto/enum.rst:474 +#: ../../howto/enum.rst:475 msgid "" "Allowing subclassing of enums that define members would lead to a violation " "of some important invariants of types and instances. On the other hand, it " @@ -917,17 +929,17 @@ msgid "" "enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" -#: ../../howto/enum.rst:483 +#: ../../howto/enum.rst:484 msgid "Dataclass support" msgstr "" -#: ../../howto/enum.rst:485 +#: ../../howto/enum.rst:486 msgid "" "When inheriting from a :class:`~dataclasses.dataclass`, the :meth:`~Enum." "__repr__` omits the inherited class' name. For example::" msgstr "" -#: ../../howto/enum.rst:488 +#: ../../howto/enum.rst:489 msgid "" ">>> from dataclasses import dataclass, field\n" ">>> @dataclass\n" @@ -957,19 +969,19 @@ msgstr "" ">>> Creature.DOG\n" "" -#: ../../howto/enum.rst:502 +#: ../../howto/enum.rst:503 msgid "" "Use the :func:`~dataclasses.dataclass` argument ``repr=False`` to use the " "standard :func:`repr`." msgstr "" -#: ../../howto/enum.rst:505 +#: ../../howto/enum.rst:506 msgid "" "Only the dataclass fields are shown in the value area, not the dataclass' " "name." msgstr "" -#: ../../howto/enum.rst:511 +#: ../../howto/enum.rst:512 msgid "" "Adding :func:`~dataclasses.dataclass` decorator to :class:`Enum` and its " "subclasses is not supported. It will not raise any errors, but it will " @@ -977,7 +989,7 @@ msgid "" "other::" msgstr "" -#: ../../howto/enum.rst:516 +#: ../../howto/enum.rst:517 msgid "" ">>> @dataclass # don't do this: it does not make any sense\n" "... class Color(Enum):\n" @@ -990,15 +1002,15 @@ msgid "" "True" msgstr "" -#: ../../howto/enum.rst:528 +#: ../../howto/enum.rst:529 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:530 +#: ../../howto/enum.rst:531 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:532 +#: ../../howto/enum.rst:533 msgid "" ">>> from test.test_enum import Fruit\n" ">>> from pickle import dumps, loads\n" @@ -1010,27 +1022,27 @@ msgstr "" ">>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))\n" "True" -#: ../../howto/enum.rst:537 +#: ../../howto/enum.rst:538 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -#: ../../howto/enum.rst:543 +#: ../../howto/enum.rst:544 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:546 +#: ../../howto/enum.rst:547 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" -"meth:`__reduce_ex__` in the enumeration class. The default method is by-" -"value, but enums with complicated values may want to use by-name::" +"meth:`~object.__reduce_ex__` in the enumeration class. The default method " +"is by-value, but enums with complicated values may want to use by-name::" msgstr "" -#: ../../howto/enum.rst:550 +#: ../../howto/enum.rst:551 msgid "" ">>> import enum\n" ">>> class MyEnum(enum.Enum):\n" @@ -1040,22 +1052,22 @@ msgstr "" ">>> class MyEnum(enum.Enum):\n" "... __reduce_ex__ = enum.pickle_by_enum_name" -#: ../../howto/enum.rst:556 +#: ../../howto/enum.rst:557 msgid "" "Using by-name for flags is not recommended, as unnamed aliases will not " "unpickle." msgstr "" -#: ../../howto/enum.rst:561 +#: ../../howto/enum.rst:562 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:563 +#: ../../howto/enum.rst:564 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:565 +#: ../../howto/enum.rst:566 msgid "" ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG')\n" ">>> Animal\n" @@ -1073,13 +1085,13 @@ msgstr "" ">>> list(Animal)\n" "[, , , ]" -#: ../../howto/enum.rst:573 +#: ../../howto/enum.rst:574 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: ../../howto/enum.rst:576 +#: ../../howto/enum.rst:577 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -1088,10 +1100,10 @@ msgid "" "enumerations; the others auto-assign increasing integers starting with 1 " "(use the ``start`` parameter to specify a different starting value). A new " "class derived from :class:`Enum` is returned. In other words, the above " -"assignment to :class:`Animal` is equivalent to::" +"assignment to :class:`!Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:585 +#: ../../howto/enum.rst:586 msgid "" ">>> class Animal(Enum):\n" "... ANT = 1\n" @@ -1107,14 +1119,14 @@ msgstr "" "... DOG = 4\n" "..." -#: ../../howto/enum.rst:592 +#: ../../howto/enum.rst:593 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -#: ../../howto/enum.rst:596 +#: ../../howto/enum.rst:597 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -1123,18 +1135,18 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:602 +#: ../../howto/enum.rst:603 msgid ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" msgstr ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" -#: ../../howto/enum.rst:606 +#: ../../howto/enum.rst:607 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: ../../howto/enum.rst:610 +#: ../../howto/enum.rst:611 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~type.__qualname__` being set to the location where pickle will be able to " @@ -1142,17 +1154,17 @@ msgid "" "SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:615 +#: ../../howto/enum.rst:616 msgid "" ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" msgstr "" ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" -#: ../../howto/enum.rst:617 +#: ../../howto/enum.rst:618 msgid "The complete signature is::" msgstr "" -#: ../../howto/enum.rst:619 +#: ../../howto/enum.rst:620 msgid "" "Enum(\n" " value='NewEnumName',\n" @@ -1174,73 +1186,73 @@ msgstr "" " start=1,\n" " )" -#: ../../howto/enum.rst:629 +#: ../../howto/enum.rst:630 msgid "*value*: What the new enum class will record as its name." msgstr "" -#: ../../howto/enum.rst:631 +#: ../../howto/enum.rst:632 msgid "" "*names*: The enum members. This can be a whitespace- or comma-separated " "string (values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../howto/enum.rst:634 +#: ../../howto/enum.rst:635 msgid "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" msgstr "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" -#: ../../howto/enum.rst:636 +#: ../../howto/enum.rst:637 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:638 +#: ../../howto/enum.rst:639 msgid "['RED', 'GREEN', 'BLUE']" msgstr "['RED', 'GREEN', 'BLUE']" -#: ../../howto/enum.rst:640 +#: ../../howto/enum.rst:641 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:642 +#: ../../howto/enum.rst:643 msgid "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" msgstr "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" -#: ../../howto/enum.rst:644 +#: ../../howto/enum.rst:645 msgid "or a mapping::" msgstr "" -#: ../../howto/enum.rst:646 +#: ../../howto/enum.rst:647 msgid "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" msgstr "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" -#: ../../howto/enum.rst:648 +#: ../../howto/enum.rst:649 msgid "*module*: name of module where new enum class can be found." msgstr "" -#: ../../howto/enum.rst:650 +#: ../../howto/enum.rst:651 msgid "*qualname*: where in module new enum class can be found." msgstr "" -#: ../../howto/enum.rst:652 +#: ../../howto/enum.rst:653 msgid "*type*: type to mix in to new enum class." msgstr "" -#: ../../howto/enum.rst:654 +#: ../../howto/enum.rst:655 msgid "*start*: number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:656 +#: ../../howto/enum.rst:657 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:661 +#: ../../howto/enum.rst:662 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:664 +#: ../../howto/enum.rst:665 msgid "IntEnum" msgstr "IntEnum" -#: ../../howto/enum.rst:666 +#: ../../howto/enum.rst:667 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -1248,7 +1260,7 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:671 +#: ../../howto/enum.rst:672 msgid "" ">>> from enum import IntEnum\n" ">>> class Shape(IntEnum):\n" @@ -1282,13 +1294,13 @@ msgstr "" ">>> Shape.CIRCLE == Request.POST\n" "True" -#: ../../howto/enum.rst:687 +#: ../../howto/enum.rst:688 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:689 +#: ../../howto/enum.rst:690 msgid "" ">>> class Shape(IntEnum):\n" "... CIRCLE = 1\n" @@ -1312,12 +1324,12 @@ msgstr "" ">>> Shape.CIRCLE == Color.RED\n" "False" -#: ../../howto/enum.rst:700 +#: ../../howto/enum.rst:701 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:702 +#: ../../howto/enum.rst:703 msgid "" ">>> int(Shape.CIRCLE)\n" "1\n" @@ -1333,11 +1345,11 @@ msgstr "" ">>> [i for i in range(Shape.SQUARE)]\n" "[0, 1]" -#: ../../howto/enum.rst:711 +#: ../../howto/enum.rst:712 msgid "StrEnum" msgstr "StrEnum" -#: ../../howto/enum.rst:713 +#: ../../howto/enum.rst:714 msgid "" "The second variation of :class:`Enum` that is provided is also a subclass " "of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " @@ -1345,11 +1357,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:722 +#: ../../howto/enum.rst:723 msgid "IntFlag" msgstr "IntFlag" -#: ../../howto/enum.rst:724 +#: ../../howto/enum.rst:725 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -1359,23 +1371,23 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:732 +#: ../../howto/enum.rst:733 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:735 +#: ../../howto/enum.rst:736 msgid "" "Bit-wise operations that result in invalid :class:`IntFlag` values will lose " "the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" -#: ../../howto/enum.rst:742 +#: ../../howto/enum.rst:743 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:744 +#: ../../howto/enum.rst:745 msgid "" ">>> from enum import IntFlag\n" ">>> class Perm(IntFlag):\n" @@ -1405,11 +1417,11 @@ msgstr "" ">>> Perm.R in RW\n" "True" -#: ../../howto/enum.rst:758 +#: ../../howto/enum.rst:759 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:760 +#: ../../howto/enum.rst:761 msgid "" ">>> class Perm(IntFlag):\n" "... R = 4\n" @@ -1437,20 +1449,20 @@ msgstr "" ">>> Perm(7)\n" "" -#: ../../howto/enum.rst:775 +#: ../../howto/enum.rst:776 msgid "" "Named combinations are considered aliases. Aliases do not show up during " "iteration, but can be returned from by-value lookups." msgstr "" -#: ../../howto/enum.rst:780 +#: ../../howto/enum.rst:781 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: ../../howto/enum.rst:783 +#: ../../howto/enum.rst:784 msgid "" ">>> Perm.R & Perm.X\n" "\n" @@ -1462,13 +1474,13 @@ msgstr "" ">>> bool(Perm.R & Perm.X)\n" "False" -#: ../../howto/enum.rst:788 +#: ../../howto/enum.rst:789 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" -#: ../../howto/enum.rst:791 +#: ../../howto/enum.rst:792 msgid "" ">>> Perm.X | 4\n" "\n" @@ -1482,13 +1494,13 @@ msgstr "" ">>> Perm.X + 8\n" "9" -#: ../../howto/enum.rst:799 +#: ../../howto/enum.rst:800 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:802 +#: ../../howto/enum.rst:803 msgid "" ">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" "True" @@ -1496,11 +1508,11 @@ msgstr "" ">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" "True" -#: ../../howto/enum.rst:805 +#: ../../howto/enum.rst:806 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:807 +#: ../../howto/enum.rst:808 msgid "" ">>> list(RW)\n" "[, ]" @@ -1508,11 +1520,11 @@ msgstr "" ">>> list(RW)\n" "[, ]" -#: ../../howto/enum.rst:814 +#: ../../howto/enum.rst:815 msgid "Flag" msgstr "Flag" -#: ../../howto/enum.rst:816 +#: ../../howto/enum.rst:817 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -1522,13 +1534,13 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:825 +#: ../../howto/enum.rst:826 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: ../../howto/enum.rst:828 +#: ../../howto/enum.rst:829 msgid "" ">>> from enum import Flag, auto\n" ">>> class Color(Flag):\n" @@ -1552,13 +1564,13 @@ msgstr "" ">>> bool(Color.RED & Color.GREEN)\n" "False" -#: ../../howto/enum.rst:839 +#: ../../howto/enum.rst:840 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags will not::" msgstr "" -#: ../../howto/enum.rst:842 +#: ../../howto/enum.rst:843 msgid "" ">>> class Color(Flag):\n" "... RED = auto()\n" @@ -1578,13 +1590,13 @@ msgstr "" ">>> Color.WHITE\n" "" -#: ../../howto/enum.rst:851 +#: ../../howto/enum.rst:852 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:854 +#: ../../howto/enum.rst:855 msgid "" ">>> class Color(Flag):\n" "... BLACK = 0\n" @@ -1608,11 +1620,11 @@ msgstr "" ">>> bool(Color.BLACK)\n" "False" -#: ../../howto/enum.rst:865 +#: ../../howto/enum.rst:866 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:867 +#: ../../howto/enum.rst:868 msgid "" ">>> purple = Color.RED | Color.BLUE\n" ">>> list(purple)\n" @@ -1622,7 +1634,7 @@ msgstr "" ">>> list(purple)\n" "[, ]" -#: ../../howto/enum.rst:875 +#: ../../howto/enum.rst:876 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -1633,17 +1645,17 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:885 +#: ../../howto/enum.rst:886 msgid "Others" msgstr "其他" -#: ../../howto/enum.rst:887 +#: ../../howto/enum.rst:888 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:890 +#: ../../howto/enum.rst:891 msgid "" "class IntEnum(int, ReprEnum): # or Enum instead of ReprEnum\n" " pass" @@ -1651,32 +1663,32 @@ msgstr "" "class IntEnum(int, ReprEnum): # 或用 Enum 取代 ReprEnum\n" " pass" -#: ../../howto/enum.rst:893 +#: ../../howto/enum.rst:894 msgid "" "This demonstrates how similar derived enumerations can be defined; for " -"example a :class:`FloatEnum` that mixes in :class:`float` instead of :class:" +"example a :class:`!FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: ../../howto/enum.rst:896 +#: ../../howto/enum.rst:897 msgid "Some rules:" msgstr "一些規則:" -#: ../../howto/enum.rst:898 +#: ../../howto/enum.rst:899 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before the :class:" "`Enum` class itself in the sequence of bases, as in the :class:`IntEnum` " "example above." msgstr "" -#: ../../howto/enum.rst:901 +#: ../../howto/enum.rst:902 msgid "" "Mix-in types must be subclassable. For example, :class:`bool` and :class:" "`range` are not subclassable and will throw an error during Enum creation if " "used as the mix-in type." msgstr "" -#: ../../howto/enum.rst:904 +#: ../../howto/enum.rst:905 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -1684,57 +1696,60 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:908 +#: ../../howto/enum.rst:909 msgid "" -"When another data type is mixed in, the :attr:`value` attribute is *not the " -"same* as the enum member itself, although it is equivalent and will compare " -"equal." +"When another data type is mixed in, the :attr:`~Enum.value` attribute is " +"*not the same* as the enum member itself, although it is equivalent and will " +"compare equal." msgstr "" -#: ../../howto/enum.rst:911 +#: ../../howto/enum.rst:912 msgid "" -"A ``data type`` is a mixin that defines :meth:`__new__`, or a :class:" +"A ``data type`` is a mixin that defines :meth:`~object.__new__`, or a :class:" "`~dataclasses.dataclass`" msgstr "" -#: ../../howto/enum.rst:913 +#: ../../howto/enum.rst:914 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" -"`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " -"``%h`` for IntEnum) treat the enum member as its mixed-in type." +"`~object.__str__` and :meth:`~object.__repr__` respectively; other codes " +"(such as ``%i`` or ``%h`` for IntEnum) treat the enum member as its mixed-in " +"type." msgstr "" -#: ../../howto/enum.rst:916 +#: ../../howto/enum.rst:917 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" -"`format` will use the enum's :meth:`__str__` method." +"`format` will use the enum's :meth:`~object.__str__` method." msgstr "" -#: ../../howto/enum.rst:921 +#: ../../howto/enum.rst:922 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" -"`__str__` method has been reset to their data types' :meth:`__str__` method." +"`~object.__str__` method has been reset to their data types' :meth:`~object." +"__str__` method." msgstr "" -#: ../../howto/enum.rst:929 -msgid "When to use :meth:`__new__` vs. :meth:`__init__`" +#: ../../howto/enum.rst:930 +msgid "When to use :meth:`~object.__new__` vs. :meth:`~object.__init__`" msgstr "" -#: ../../howto/enum.rst:931 +#: ../../howto/enum.rst:932 msgid "" -":meth:`__new__` must be used whenever you want to customize the actual value " -"of the :class:`Enum` member. Any other modifications may go in either :meth:" -"`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." +":meth:`~object.__new__` must be used whenever you want to customize the " +"actual value of the :class:`Enum` member. Any other modifications may go in " +"either :meth:`~object.__new__` or :meth:`~object.__init__`, with :meth:" +"`~object.__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:935 +#: ../../howto/enum.rst:936 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:938 +#: ../../howto/enum.rst:939 msgid "" ">>> class Coordinate(bytes, Enum):\n" "... \"\"\"\n" @@ -1759,113 +1774,114 @@ msgid "" "Coordinate.VY" msgstr "" -#: ../../howto/enum.rst:962 +#: ../../howto/enum.rst:963 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly." msgstr "" -#: ../../howto/enum.rst:967 +#: ../../howto/enum.rst:968 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:970 +#: ../../howto/enum.rst:971 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:972 +#: ../../howto/enum.rst:973 msgid "" -":attr:`__members__` is a read-only ordered mapping of ``member_name``:" -"``member`` items. It is only available on the class." +":attr:`~enum.EnumType.__members__` is a read-only ordered mapping of " +"``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:975 +#: ../../howto/enum.rst:976 msgid "" -":meth:`__new__`, if specified, must create and return the enum members; it " -"is also a very good idea to set the member's :attr:`_value_` appropriately. " -"Once all the members are created it is no longer used." +":meth:`~object.__new__`, if specified, must create and return the enum " +"members; it is also a very good idea to set the member's :attr:`~Enum." +"_value_` appropriately. Once all the members are created it is no longer " +"used." msgstr "" -#: ../../howto/enum.rst:981 +#: ../../howto/enum.rst:982 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:983 +#: ../../howto/enum.rst:984 msgid ":attr:`~Enum._name_` -- name of the member" msgstr ":attr:`~Enum._name_` -- 成員的名稱" -#: ../../howto/enum.rst:984 +#: ../../howto/enum.rst:985 msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr "" -#: ../../howto/enum.rst:985 +#: ../../howto/enum.rst:986 msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" msgstr "" -#: ../../howto/enum.rst:987 +#: ../../howto/enum.rst:988 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 " "from the final class" msgstr "" -#: ../../howto/enum.rst:990 +#: ../../howto/enum.rst:991 msgid "" ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " "an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:992 +#: ../../howto/enum.rst:993 msgid "" -":meth:`~Enum._add_alias_` -- adds a new name as an alias to an existing " +":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing " "member." msgstr "" -#: ../../howto/enum.rst:994 +#: ../../howto/enum.rst:995 msgid "" -":meth:`~Enum._add_value_alias_` -- adds a new value as an alias to an " +":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an " "existing member. See `MultiValueEnum`_ for an example." msgstr "" -#: ../../howto/enum.rst:999 +#: ../../howto/enum.rst:1000 msgid "" "For standard :class:`Enum` classes the next value chosen is the highest " "value seen incremented by one." msgstr "" -#: ../../howto/enum.rst:1002 +#: ../../howto/enum.rst:1003 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two." msgstr "" -#: ../../howto/enum.rst:1005 +#: ../../howto/enum.rst:1006 msgid "" "Prior versions would use the last seen value instead of the highest value." msgstr "" -#: ../../howto/enum.rst:1008 +#: ../../howto/enum.rst:1009 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``、``_order_``、``_generate_next_value_``" -#: ../../howto/enum.rst:1009 +#: ../../howto/enum.rst:1010 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../howto/enum.rst:1010 +#: ../../howto/enum.rst:1011 msgid "``_add_alias_``, ``_add_value_alias_``" msgstr "" -#: ../../howto/enum.rst:1012 +#: ../../howto/enum.rst:1013 msgid "" -"To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " -"can be provided. It will be checked against the actual order of the " -"enumeration and raise an error if the two do not match::" +"To help keep Python 2 / Python 3 code in sync an :attr:`~Enum._order_` " +"attribute can be provided. It will be checked against the actual order of " +"the enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:1016 +#: ../../howto/enum.rst:1017 msgid "" ">>> class Color(Enum):\n" "... _order_ = 'RED GREEN BLUE'\n" @@ -1891,27 +1907,27 @@ msgstr "" " ['RED', 'BLUE', 'GREEN']\n" " ['RED', 'GREEN', 'BLUE']" -#: ../../howto/enum.rst:1030 +#: ../../howto/enum.rst:1031 msgid "" -"In Python 2 code the :attr:`_order_` attribute is necessary as definition " -"order is lost before it can be recorded." +"In Python 2 code the :attr:`~Enum._order_` attribute is necessary as " +"definition order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:1035 +#: ../../howto/enum.rst:1036 msgid "_Private__names" msgstr "_Private__names" -#: ../../howto/enum.rst:1037 +#: ../../howto/enum.rst:1038 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:1044 +#: ../../howto/enum.rst:1045 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:1046 +#: ../../howto/enum.rst:1047 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -1921,18 +1937,18 @@ msgid "" "strongly recommended." msgstr "" -#: ../../howto/enum.rst:1057 +#: ../../howto/enum.rst:1058 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:1059 +#: ../../howto/enum.rst:1060 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:1063 +#: ../../howto/enum.rst:1064 msgid "" ">>> class MyEnum(IntEnum): # help(int) -> int(x, base=10) -> integer\n" "... example = '11', 16 # so x='11' and base=16\n" @@ -1946,11 +1962,11 @@ msgstr "" ">>> MyEnum.example.value # 且 hex(11) 為...\n" "17" -#: ../../howto/enum.rst:1071 +#: ../../howto/enum.rst:1072 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:1073 +#: ../../howto/enum.rst:1074 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -1959,7 +1975,7 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1079 +#: ../../howto/enum.rst:1080 msgid "" "def __bool__(self):\n" " return bool(self.value)" @@ -1967,22 +1983,22 @@ msgstr "" "def __bool__(self):\n" " return bool(self.value)" -#: ../../howto/enum.rst:1082 +#: ../../howto/enum.rst:1083 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1086 +#: ../../howto/enum.rst:1087 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1088 +#: ../../howto/enum.rst:1089 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1092 +#: ../../howto/enum.rst:1093 msgid "" ">>> dir(Planet) \n" "['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', " @@ -1998,17 +2014,17 @@ msgstr "" "['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', " "'surface_gravity', 'value']" -#: ../../howto/enum.rst:1099 +#: ../../howto/enum.rst:1100 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1101 +#: ../../howto/enum.rst:1102 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1104 +#: ../../howto/enum.rst:1105 msgid "" ">>> class Color(Flag):\n" "... RED = auto()\n" @@ -2024,15 +2040,15 @@ msgid "" "" msgstr "" -#: ../../howto/enum.rst:1119 +#: ../../howto/enum.rst:1120 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1121 +#: ../../howto/enum.rst:1122 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1123 +#: ../../howto/enum.rst:1124 msgid "" ">>> class Color(IntFlag):\n" "... BLACK = 0\n" @@ -2052,23 +2068,23 @@ msgstr "" "... WHITE = RED | GREEN | BLUE\n" "..." -#: ../../howto/enum.rst:1132 +#: ../../howto/enum.rst:1133 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1134 +#: ../../howto/enum.rst:1135 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1135 +#: ../../howto/enum.rst:1136 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1136 +#: ../../howto/enum.rst:1137 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1138 +#: ../../howto/enum.rst:1139 msgid "" ">>> list(Color.WHITE)\n" "[, , ]" @@ -2076,13 +2092,13 @@ msgstr "" ">>> list(Color.WHITE)\n" "[, , ]" -#: ../../howto/enum.rst:1141 +#: ../../howto/enum.rst:1142 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1144 +#: ../../howto/enum.rst:1145 msgid "" ">>> Color.BLUE\n" "\n" @@ -2096,11 +2112,11 @@ msgstr "" ">>> ~Color.BLUE\n" "" -#: ../../howto/enum.rst:1150 +#: ../../howto/enum.rst:1151 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1152 +#: ../../howto/enum.rst:1153 msgid "" ">>> (Color.RED | Color.GREEN).name\n" "'RED|GREEN'\n" @@ -2114,11 +2130,11 @@ msgid "" "True" msgstr "" -#: ../../howto/enum.rst:1163 +#: ../../howto/enum.rst:1164 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1166 msgid "" ">>> Color.RED | Color.BLUE\n" "\n" @@ -2138,13 +2154,13 @@ msgstr "" ">>> Color(0)\n" "" -#: ../../howto/enum.rst:1174 +#: ../../howto/enum.rst:1175 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1177 +#: ../../howto/enum.rst:1178 msgid "" ">>> Color.BLACK in Color.WHITE\n" "True" @@ -2152,13 +2168,13 @@ msgstr "" ">>> Color.BLACK in Color.WHITE\n" "True" -#: ../../howto/enum.rst:1180 +#: ../../howto/enum.rst:1181 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1183 +#: ../../howto/enum.rst:1184 msgid "" ">>> Color.PURPLE in Color.WHITE\n" "True\n" @@ -2172,77 +2188,78 @@ msgstr "" ">>> Color.GREEN in Color.PURPLE\n" "False" -#: ../../howto/enum.rst:1189 +#: ../../howto/enum.rst:1190 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1192 +#: ../../howto/enum.rst:1193 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1193 +#: ../../howto/enum.rst:1194 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1194 +#: ../../howto/enum.rst:1195 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1195 +#: ../../howto/enum.rst:1196 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1197 +#: ../../howto/enum.rst:1198 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1198 +#: ../../howto/enum.rst:1199 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1199 +#: ../../howto/enum.rst:1200 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1201 +#: ../../howto/enum.rst:1202 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1209 +#: ../../howto/enum.rst:1210 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1211 +#: ../../howto/enum.rst:1212 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1216 +#: ../../howto/enum.rst:1217 msgid "Enum Classes" msgstr "Enum 類別" -#: ../../howto/enum.rst:1218 +#: ../../howto/enum.rst:1219 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" -"`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " -"allow one to do things with an :class:`Enum` class that fail on a typical " -"class, such as ``list(Color)`` or ``some_enum_var in Color``. :class:" -"`EnumType` is responsible for ensuring that various other methods on the " -"final :class:`Enum` class are correct (such as :meth:`__new__`, :meth:" -"`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." +"`~object.__contains__`, :meth:`~object.__dir__`, :meth:`~object.__iter__` " +"and other methods that allow one to do things with an :class:`Enum` class " +"that fail on a typical class, such as ``list(Color)`` or ``some_enum_var in " +"Color``. :class:`EnumType` is responsible for ensuring that various other " +"methods on the final :class:`Enum` class are correct (such as :meth:`~object." +"__new__`, :meth:`~object.__getnewargs__`, :meth:`~object.__str__` and :meth:" +"`~object.__repr__`)." msgstr "" -#: ../../howto/enum.rst:1227 +#: ../../howto/enum.rst:1228 msgid "Flag Classes" msgstr "Flag 類別" -#: ../../howto/enum.rst:1229 +#: ../../howto/enum.rst:1230 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -2251,30 +2268,30 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1235 +#: ../../howto/enum.rst:1236 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1237 +#: ../../howto/enum.rst:1238 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " -"itself, and then puts a custom :meth:`__new__` in place to ensure that no " -"new ones are ever instantiated by returning only the existing member " +"itself, and then puts a custom :meth:`~object.__new__` in place to ensure " +"that no new ones are ever instantiated by returning only the existing member " "instances." msgstr "" -#: ../../howto/enum.rst:1243 +#: ../../howto/enum.rst:1244 msgid "Flag Members" msgstr "Flag 成員" -#: ../../howto/enum.rst:1245 +#: ../../howto/enum.rst:1246 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1248 +#: ../../howto/enum.rst:1249 msgid "" ">>> list(Color)\n" "[, , ]" @@ -2282,17 +2299,17 @@ msgstr "" ">>> list(Color)\n" "[, , ]" -#: ../../howto/enum.rst:1251 +#: ../../howto/enum.rst:1252 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1253 +#: ../../howto/enum.rst:1254 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1256 +#: ../../howto/enum.rst:1257 msgid "" ">>> ~Color.RED\n" "" @@ -2300,13 +2317,13 @@ msgstr "" ">>> ~Color.RED\n" "" -#: ../../howto/enum.rst:1259 +#: ../../howto/enum.rst:1260 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1262 +#: ../../howto/enum.rst:1263 msgid "" ">>> len(Color.PURPLE)\n" "2" @@ -2314,11 +2331,11 @@ msgstr "" ">>> len(Color.PURPLE)\n" "2" -#: ../../howto/enum.rst:1269 +#: ../../howto/enum.rst:1270 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1272 +#: ../../howto/enum.rst:1273 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -2326,50 +2343,50 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1279 +#: ../../howto/enum.rst:1280 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1281 +#: ../../howto/enum.rst:1282 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1284 +#: ../../howto/enum.rst:1285 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1285 +#: ../../howto/enum.rst:1286 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1286 +#: ../../howto/enum.rst:1287 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1287 +#: ../../howto/enum.rst:1288 msgid "" -"use a tuple as the value and a custom :meth:`__new__` to replace the tuple " -"with an :class:`int` value" +"use a tuple as the value and a custom :meth:`~object.__new__` to replace the " +"tuple with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1290 +#: ../../howto/enum.rst:1291 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1296 +#: ../../howto/enum.rst:1297 msgid "Using :class:`auto`" msgstr "使用 :class:`auto`" -#: ../../howto/enum.rst:1298 +#: ../../howto/enum.rst:1299 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1300 +#: ../../howto/enum.rst:1301 msgid "" ">>> class Color(Enum):\n" "... RED = auto()\n" @@ -2387,15 +2404,15 @@ msgstr "" ">>> Color.GREEN\n" "" -#: ../../howto/enum.rst:1310 +#: ../../howto/enum.rst:1311 msgid "Using :class:`object`" msgstr "使用 :class:`object`" -#: ../../howto/enum.rst:1312 +#: ../../howto/enum.rst:1313 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1314 +#: ../../howto/enum.rst:1315 msgid "" ">>> class Color(Enum):\n" "... RED = object()\n" @@ -2413,13 +2430,13 @@ msgstr "" ">>> Color.GREEN \n" ">" -#: ../../howto/enum.rst:1322 +#: ../../howto/enum.rst:1323 msgid "" "This is also a good example of why you might want to write your own :meth:" -"`__repr__`::" +"`~object.__repr__`::" msgstr "" -#: ../../howto/enum.rst:1325 +#: ../../howto/enum.rst:1326 msgid "" ">>> class Color(Enum):\n" "... RED = object()\n" @@ -2441,15 +2458,15 @@ msgstr "" ">>> Color.GREEN\n" "" -#: ../../howto/enum.rst:1338 +#: ../../howto/enum.rst:1339 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1340 +#: ../../howto/enum.rst:1341 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1342 +#: ../../howto/enum.rst:1343 msgid "" ">>> class Color(Enum):\n" "... RED = 'stop'\n" @@ -2467,15 +2484,15 @@ msgstr "" ">>> Color.GREEN\n" "" -#: ../../howto/enum.rst:1352 -msgid "Using a custom :meth:`__new__`" +#: ../../howto/enum.rst:1353 +msgid "Using a custom :meth:`~object.__new__`" msgstr "" -#: ../../howto/enum.rst:1354 -msgid "Using an auto-numbering :meth:`__new__` would look like::" +#: ../../howto/enum.rst:1355 +msgid "Using an auto-numbering :meth:`~object.__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1356 +#: ../../howto/enum.rst:1357 msgid "" ">>> class AutoNumber(Enum):\n" "... def __new__(cls):\n" @@ -2507,13 +2524,13 @@ msgstr "" ">>> Color.GREEN\n" "" -#: ../../howto/enum.rst:1371 +#: ../../howto/enum.rst:1372 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1373 +#: ../../howto/enum.rst:1374 msgid "" ">>> class AutoNumber(Enum):\n" "... def __new__(cls, *args): # this is the only change from above\n" @@ -2524,13 +2541,13 @@ msgid "" "..." msgstr "" -#: ../../howto/enum.rst:1381 +#: ../../howto/enum.rst:1382 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1384 +#: ../../howto/enum.rst:1385 msgid "" ">>> class Swatch(AutoNumber):\n" "... def __init__(self, pantone='unknown'):\n" @@ -2547,35 +2564,35 @@ msgid "" "'unknown'" msgstr "" -#: ../../howto/enum.rst:1400 +#: ../../howto/enum.rst:1401 msgid "" -"The :meth:`__new__` method, if defined, is used during creation of the Enum " -"members; it is then replaced by Enum's :meth:`__new__` which is used after " -"class creation for lookup of existing members." +"The :meth:`~object.__new__` method, if defined, is used during creation of " +"the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " +"which is used after class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1406 +#: ../../howto/enum.rst:1407 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly -- e.g.::" msgstr "" -#: ../../howto/enum.rst:1409 +#: ../../howto/enum.rst:1410 msgid "obj = int.__new__(cls, value)" msgstr "obj = int.__new__(cls, value)" -#: ../../howto/enum.rst:1413 +#: ../../howto/enum.rst:1414 msgid "OrderedEnum" msgstr "OrderedEnum" -#: ../../howto/enum.rst:1415 +#: ../../howto/enum.rst:1416 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1419 +#: ../../howto/enum.rst:1420 msgid "" ">>> class OrderedEnum(Enum):\n" "... def __ge__(self, other):\n" @@ -2633,17 +2650,17 @@ msgstr "" ">>> Grade.C < Grade.A\n" "True" -#: ../../howto/enum.rst:1449 +#: ../../howto/enum.rst:1450 msgid "DuplicateFreeEnum" msgstr "DuplicateFreeEnum" -#: ../../howto/enum.rst:1451 +#: ../../howto/enum.rst:1452 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1454 +#: ../../howto/enum.rst:1455 msgid "" ">>> class DuplicateFreeEnum(Enum):\n" "... def __init__(self, *args):\n" @@ -2667,22 +2684,22 @@ msgid "" "ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'" msgstr "" -#: ../../howto/enum.rst:1476 +#: ../../howto/enum.rst:1477 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1482 +#: ../../howto/enum.rst:1483 msgid "MultiValueEnum" msgstr "MultiValueEnum" -#: ../../howto/enum.rst:1484 +#: ../../howto/enum.rst:1485 msgid "Supports having more than one value per member::" msgstr "" -#: ../../howto/enum.rst:1486 +#: ../../howto/enum.rst:1487 msgid "" ">>> class MultiValueEnum(Enum):\n" "... def __new__(cls, value, *values):\n" @@ -2702,17 +2719,17 @@ msgid "" "" msgstr "" -#: ../../howto/enum.rst:1505 +#: ../../howto/enum.rst:1506 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1507 +#: ../../howto/enum.rst:1508 msgid "" -"If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " -"member will be passed to those methods::" +"If :meth:`~object.__new__` or :meth:`~object.__init__` is defined, the value " +"of the enum member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1510 +#: ../../howto/enum.rst:1511 msgid "" ">>> class Planet(Enum):\n" "... MERCURY = (3.303e+23, 2.4397e6)\n" @@ -2738,15 +2755,15 @@ msgid "" "9.802652743337129" msgstr "" -#: ../../howto/enum.rst:1536 +#: ../../howto/enum.rst:1537 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1538 -msgid "An example to show the :attr:`_ignore_` attribute in use::" +#: ../../howto/enum.rst:1539 +msgid "An example to show the :attr:`~Enum._ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1540 +#: ../../howto/enum.rst:1541 msgid "" ">>> from datetime import timedelta\n" ">>> class Period(timedelta, Enum):\n" @@ -2764,11 +2781,11 @@ msgid "" "timedelta(days=366)>]" msgstr "" -#: ../../howto/enum.rst:1557 +#: ../../howto/enum.rst:1558 msgid "Subclassing EnumType" msgstr "子類別化 EnumType" -#: ../../howto/enum.rst:1559 +#: ../../howto/enum.rst:1560 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/howto/free-threading-extensions.po b/howto/free-threading-extensions.po index 988740ef1d..83e6596e5d 100644 --- a/howto/free-threading-extensions.po +++ b/howto/free-threading-extensions.po @@ -1,7 +1,5 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # #, fuzzy msgid "" @@ -11,7 +9,8 @@ msgstr "" "POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po index 519f70b2e5..d2f09a2deb 100644 --- a/howto/free-threading-python.po +++ b/howto/free-threading-python.po @@ -11,7 +11,8 @@ msgstr "" "POT-Creation-Date: 2024-10-04 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index b77676fcb3..9399fe584b 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -11,7 +11,8 @@ msgstr "" "POT-Creation-Date: 2024-09-03 11:11+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/howto/mro.po b/howto/mro.po index ac73681c25..4b1860b886 100644 --- a/howto/mro.po +++ b/howto/mro.po @@ -10,7 +10,8 @@ msgstr "" "POT-Creation-Date: 2024-09-27 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/howto/timerfd.po b/howto/timerfd.po index dd737358de..cb0dfd1ced 100644 --- a/howto/timerfd.po +++ b/howto/timerfd.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -11,7 +10,8 @@ msgstr "" "POT-Creation-Date: 2024-09-23 07:52+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/library/aifc.po b/library/aifc.po new file mode 100644 index 0000000000..2cfcb0d41f --- /dev/null +++ b/library/aifc.po @@ -0,0 +1,39 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/aifc.rst:2 +msgid ":mod:`!aifc` --- Read and write AIFF and AIFC files" +msgstr ":mod:`!aifc` --- 讀寫 AIFF 與 AIFC 檔案" + +#: ../../library/aifc.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/aifc.rst:14 +msgid "" +"The last version of Python that provided the :mod:`!aifc` module was `Python " +"3.12 `_." +msgstr "" +"最後提供 :mod:`!aifc` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/argparse.po b/library/argparse.po index 8898a13b96..4bdf1f6631 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-31 00:13+0000\n" +"POT-Creation-Date: 2024-11-23 00:14+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1289,14 +1289,16 @@ msgstr "" msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " -"and :meth:`!format_usage` methods." +"and :meth:`!format_usage` methods. You can also register custom actions " +"using the :meth:`~ArgumentParser.register` method and reference them by " +"their registered name." msgstr "" -#: ../../library/argparse.rst:757 +#: ../../library/argparse.rst:758 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:759 +#: ../../library/argparse.rst:760 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1317,15 +1319,15 @@ msgid "" "Namespace(bar='1', foo='2')" msgstr "" -#: ../../library/argparse.rst:777 +#: ../../library/argparse.rst:778 msgid "For more details, see :class:`Action`." msgstr "更多詳情請見 :class:`Action`。" -#: ../../library/argparse.rst:783 +#: ../../library/argparse.rst:784 msgid "nargs" msgstr "nargs" -#: ../../library/argparse.rst:785 +#: ../../library/argparse.rst:786 msgid "" ":class:`ArgumentParser` objects usually associate a single command-line " "argument with a single action to be taken. The ``nargs`` keyword argument " @@ -1334,13 +1336,13 @@ msgid "" "are:" msgstr "" -#: ../../library/argparse.rst:790 +#: ../../library/argparse.rst:791 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:793 +#: ../../library/argparse.rst:794 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1354,13 +1356,13 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:799 +#: ../../library/argparse.rst:800 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:804 +#: ../../library/argparse.rst:805 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1370,7 +1372,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:811 +#: ../../library/argparse.rst:812 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1392,13 +1394,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:821 +#: ../../library/argparse.rst:822 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:824 +#: ../../library/argparse.rst:825 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" @@ -1424,7 +1426,7 @@ msgstr "" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>,\n" " outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:838 +#: ../../library/argparse.rst:839 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1432,7 +1434,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:843 +#: ../../library/argparse.rst:844 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1448,14 +1450,14 @@ msgstr "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:852 +#: ../../library/argparse.rst:853 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " "least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:856 +#: ../../library/argparse.rst:857 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1473,7 +1475,7 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:864 +#: ../../library/argparse.rst:865 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1482,11 +1484,11 @@ msgid "" "``'store_const'``) set ``nargs=0``." msgstr "" -#: ../../library/argparse.rst:874 +#: ../../library/argparse.rst:875 msgid "const" msgstr "" -#: ../../library/argparse.rst:876 +#: ../../library/argparse.rst:877 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1494,7 +1496,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:880 +#: ../../library/argparse.rst:881 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1504,7 +1506,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:888 +#: ../../library/argparse.rst:889 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1514,17 +1516,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:895 +#: ../../library/argparse.rst:896 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:902 +#: ../../library/argparse.rst:903 msgid "default" msgstr "" -#: ../../library/argparse.rst:904 +#: ../../library/argparse.rst:905 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1534,7 +1536,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:911 +#: ../../library/argparse.rst:912 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1550,13 +1552,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:918 +#: ../../library/argparse.rst:919 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not overwrite it::" msgstr "" -#: ../../library/argparse.rst:921 +#: ../../library/argparse.rst:922 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1568,7 +1570,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:926 +#: ../../library/argparse.rst:927 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -1576,7 +1578,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:931 +#: ../../library/argparse.rst:932 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -1590,13 +1592,13 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:937 +#: ../../library/argparse.rst:938 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:940 +#: ../../library/argparse.rst:941 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -1612,20 +1614,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:947 +#: ../../library/argparse.rst:948 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" -#: ../../library/argparse.rst:951 +#: ../../library/argparse.rst:952 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:954 +#: ../../library/argparse.rst:955 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -1641,11 +1643,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:965 +#: ../../library/argparse.rst:966 msgid "type" msgstr "" -#: ../../library/argparse.rst:967 +#: ../../library/argparse.rst:968 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -1654,25 +1656,26 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:973 +#: ../../library/argparse.rst:974 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:976 +#: ../../library/argparse.rst:977 msgid "" -"The argument to ``type`` can be any callable that accepts a single string. " -"If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" +"The argument to ``type`` can be a callable that accepts a single string or " +"the name of a registered type (see :meth:`~ArgumentParser.register`) If the " +"function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" "`ValueError`, the exception is caught and a nicely formatted error message " -"is displayed. No other exception types are handled." +"is displayed. Other exception types are not handled." msgstr "" -#: ../../library/argparse.rst:981 +#: ../../library/argparse.rst:983 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:983 +#: ../../library/argparse.rst:985 msgid "" "import argparse\n" "import pathlib\n" @@ -1698,11 +1701,11 @@ msgstr "" "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:996 +#: ../../library/argparse.rst:998 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:998 +#: ../../library/argparse.rst:1000 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -1720,14 +1723,14 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1008 +#: ../../library/argparse.rst:1010 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1012 +#: ../../library/argparse.rst:1014 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -1735,7 +1738,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1017 +#: ../../library/argparse.rst:1019 msgid "" "For example, JSON or YAML conversions have complex error cases that require " "better reporting than can be given by the ``type`` keyword. A :exc:`~json." @@ -1743,7 +1746,7 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1022 +#: ../../library/argparse.rst:1024 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " @@ -1753,17 +1756,17 @@ msgid "" "files." msgstr "" -#: ../../library/argparse.rst:1029 +#: ../../library/argparse.rst:1031 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1036 +#: ../../library/argparse.rst:1038 msgid "choices" msgstr "" -#: ../../library/argparse.rst:1038 +#: ../../library/argparse.rst:1040 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -1772,7 +1775,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1044 +#: ../../library/argparse.rst:1046 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -1792,26 +1795,26 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1053 +#: ../../library/argparse.rst:1055 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " "sequence should match the type_ specified." msgstr "" -#: ../../library/argparse.rst:1057 +#: ../../library/argparse.rst:1059 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1060 +#: ../../library/argparse.rst:1062 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1063 +#: ../../library/argparse.rst:1065 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -1819,11 +1822,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1072 +#: ../../library/argparse.rst:1074 msgid "required" msgstr "" -#: ../../library/argparse.rst:1074 +#: ../../library/argparse.rst:1076 msgid "" "In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -1831,7 +1834,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1079 +#: ../../library/argparse.rst:1081 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -1849,24 +1852,24 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1087 +#: ../../library/argparse.rst:1089 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1093 +#: ../../library/argparse.rst:1095 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1100 +#: ../../library/argparse.rst:1102 msgid "help" msgstr "幫助" -#: ../../library/argparse.rst:1102 +#: ../../library/argparse.rst:1104 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -1874,7 +1877,7 @@ msgid "" "each argument." msgstr "" -#: ../../library/argparse.rst:1107 +#: ../../library/argparse.rst:1109 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -1883,7 +1886,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1112 +#: ../../library/argparse.rst:1114 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -1909,19 +1912,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1124 +#: ../../library/argparse.rst:1126 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1127 +#: ../../library/argparse.rst:1129 msgid "" ":mod:`!argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1130 +#: ../../library/argparse.rst:1132 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -1939,11 +1942,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1142 +#: ../../library/argparse.rst:1144 msgid "metavar" msgstr "metavar" -#: ../../library/argparse.rst:1144 +#: ../../library/argparse.rst:1146 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, :class:`!ArgumentParser` " @@ -1955,7 +1958,7 @@ msgid "" "command-line argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1153 +#: ../../library/argparse.rst:1155 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -1987,11 +1990,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1168 +#: ../../library/argparse.rst:1170 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1170 +#: ../../library/argparse.rst:1172 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2023,21 +2026,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1185 +#: ../../library/argparse.rst:1187 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1189 +#: ../../library/argparse.rst:1191 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1193 +#: ../../library/argparse.rst:1195 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2061,11 +2064,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1208 +#: ../../library/argparse.rst:1210 msgid "dest" msgstr "dest" -#: ../../library/argparse.rst:1210 +#: ../../library/argparse.rst:1212 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2075,7 +2078,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1217 +#: ../../library/argparse.rst:1219 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2087,7 +2090,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1222 +#: ../../library/argparse.rst:1224 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2099,7 +2102,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1231 +#: ../../library/argparse.rst:1233 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2117,11 +2120,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1239 +#: ../../library/argparse.rst:1241 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1241 +#: ../../library/argparse.rst:1243 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2133,11 +2136,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1250 +#: ../../library/argparse.rst:1252 msgid "deprecated" msgstr "" -#: ../../library/argparse.rst:1252 +#: ../../library/argparse.rst:1254 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2148,7 +2151,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1262 +#: ../../library/argparse.rst:1264 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='snake.py')\n" @@ -2168,11 +2171,11 @@ msgstr "" "snake.py: warning: option '--legs' is deprecated\n" "Namespace(legs=4)" -#: ../../library/argparse.rst:1275 +#: ../../library/argparse.rst:1277 msgid "Action classes" msgstr "" -#: ../../library/argparse.rst:1277 +#: ../../library/argparse.rst:1279 msgid "" ":class:`!Action` classes implement the Action API, a callable which returns " "a callable which processes arguments from the command-line. Any object which " @@ -2180,7 +2183,7 @@ msgid "" "`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1286 +#: ../../library/argparse.rst:1288 msgid "" ":class:`!Action` objects are used by an :class:`ArgumentParser` to represent " "the information needed to parse a single argument from one or more strings " @@ -2189,7 +2192,7 @@ msgid "" "`ArgumentParser.add_argument` except for the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1292 +#: ../../library/argparse.rst:1294 msgid "" "Instances of :class:`!Action` (or return value of any callable to the " "``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" @@ -2198,46 +2201,46 @@ msgid "" "is to call :meth:`!Action.__init__`." msgstr "" -#: ../../library/argparse.rst:1300 +#: ../../library/argparse.rst:1302 msgid "" ":class:`!Action` instances should be callable, so subclasses must override " "the :meth:`!__call__` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1303 +#: ../../library/argparse.rst:1305 msgid "" "*parser* - The :class:`ArgumentParser` object which contains this action." msgstr "" -#: ../../library/argparse.rst:1305 +#: ../../library/argparse.rst:1307 msgid "" "*namespace* - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1309 +#: ../../library/argparse.rst:1311 msgid "" "*values* - The associated command-line arguments, with any type conversions " "applied. Type conversions are specified with the type_ keyword argument to :" "meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1313 +#: ../../library/argparse.rst:1315 msgid "" "*option_string* - The option string that was used to invoke this action. The " "``option_string`` argument is optional, and will be absent if the action is " "associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1317 +#: ../../library/argparse.rst:1319 msgid "" "The :meth:`!__call__` method may perform arbitrary actions, but will " "typically set attributes on the ``namespace`` based on ``dest`` and " "``values``." msgstr "" -#: ../../library/argparse.rst:1322 +#: ../../library/argparse.rst:1324 msgid "" ":class:`!Action` subclasses can define a :meth:`!format_usage` method that " "takes no argument and return a string which will be used when printing the " @@ -2245,47 +2248,47 @@ msgid "" "will be used." msgstr "" -#: ../../library/argparse.rst:1328 +#: ../../library/argparse.rst:1330 msgid "The parse_args() method" msgstr "parse_args() 方法" -#: ../../library/argparse.rst:1332 +#: ../../library/argparse.rst:1334 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1335 +#: ../../library/argparse.rst:1337 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:`!" "add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1339 +#: ../../library/argparse.rst:1341 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1342 +#: ../../library/argparse.rst:1344 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1347 +#: ../../library/argparse.rst:1349 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1349 +#: ../../library/argparse.rst:1351 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1353 +#: ../../library/argparse.rst:1355 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2303,14 +2306,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1361 +#: ../../library/argparse.rst:1363 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1365 +#: ../../library/argparse.rst:1367 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2318,13 +2321,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1368 +#: ../../library/argparse.rst:1370 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1371 +#: ../../library/argparse.rst:1373 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2332,13 +2335,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1374 +#: ../../library/argparse.rst:1376 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1377 +#: ../../library/argparse.rst:1379 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2354,11 +2357,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1386 +#: ../../library/argparse.rst:1388 msgid "Invalid arguments" msgstr "無效引數" -#: ../../library/argparse.rst:1388 +#: ../../library/argparse.rst:1390 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2366,7 +2369,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1393 +#: ../../library/argparse.rst:1395 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2388,11 +2391,11 @@ msgid "" "PROG: error: extra arguments found: badger" msgstr "" -#: ../../library/argparse.rst:1414 +#: ../../library/argparse.rst:1416 msgid "Arguments containing ``-``" msgstr "包含 ``-`` 的引數" -#: ../../library/argparse.rst:1416 +#: ../../library/argparse.rst:1418 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2404,7 +2407,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1424 +#: ../../library/argparse.rst:1426 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2437,7 +2440,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1454 +#: ../../library/argparse.rst:1456 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2445,7 +2448,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1459 +#: ../../library/argparse.rst:1461 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2453,24 +2456,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1462 +#: ../../library/argparse.rst:1464 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: ../../library/argparse.rst:1468 +#: ../../library/argparse.rst:1470 msgid "Argument abbreviations (prefix matching)" msgstr "" -#: ../../library/argparse.rst:1470 +#: ../../library/argparse.rst:1472 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1474 +#: ../../library/argparse.rst:1476 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2494,17 +2497,17 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1485 +#: ../../library/argparse.rst:1487 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1491 +#: ../../library/argparse.rst:1493 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1493 +#: ../../library/argparse.rst:1495 msgid "" "Sometimes it may be useful to have an :class:`ArgumentParser` parse " "arguments other than those of :data:`sys.argv`. This can be accomplished by " @@ -2512,7 +2515,7 @@ msgid "" "useful for testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1498 +#: ../../library/argparse.rst:1500 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -2538,24 +2541,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1513 +#: ../../library/argparse.rst:1515 msgid "The Namespace object" msgstr "命名空間物件" -#: ../../library/argparse.rst:1517 +#: ../../library/argparse.rst:1519 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1520 +#: ../../library/argparse.rst:1522 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1524 +#: ../../library/argparse.rst:1526 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2569,14 +2572,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1530 +#: ../../library/argparse.rst:1532 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1534 +#: ../../library/argparse.rst:1536 msgid "" ">>> class C:\n" "... pass\n" @@ -2598,15 +2601,15 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1546 +#: ../../library/argparse.rst:1548 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1549 +#: ../../library/argparse.rst:1551 msgid "Sub-commands" msgstr "" -#: ../../library/argparse.rst:1556 +#: ../../library/argparse.rst:1558 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " @@ -2621,69 +2624,69 @@ msgid "" "returns an :class:`!ArgumentParser` object that can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1568 +#: ../../library/argparse.rst:1570 msgid "Description of parameters:" msgstr "參數的解釋:" -#: ../../library/argparse.rst:1570 +#: ../../library/argparse.rst:1572 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1574 +#: ../../library/argparse.rst:1576 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1577 +#: ../../library/argparse.rst:1579 msgid "" "*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1581 +#: ../../library/argparse.rst:1583 msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. :class:`ArgumentParser`)" msgstr "" -#: ../../library/argparse.rst:1584 +#: ../../library/argparse.rst:1586 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1587 +#: ../../library/argparse.rst:1589 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1590 +#: ../../library/argparse.rst:1592 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1593 +#: ../../library/argparse.rst:1595 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1595 +#: ../../library/argparse.rst:1597 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1598 +#: ../../library/argparse.rst:1600 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1600 +#: ../../library/argparse.rst:1602 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -2706,7 +2709,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1619 +#: ../../library/argparse.rst:1621 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -2716,7 +2719,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1626 +#: ../../library/argparse.rst:1628 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -2725,7 +2728,7 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1634 +#: ../../library/argparse.rst:1636 msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" @@ -2783,14 +2786,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1662 +#: ../../library/argparse.rst:1664 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1666 +#: ../../library/argparse.rst:1668 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -2826,7 +2829,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1683 +#: ../../library/argparse.rst:1685 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -2834,7 +2837,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1688 +#: ../../library/argparse.rst:1690 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -2850,13 +2853,13 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1695 +#: ../../library/argparse.rst:1697 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1709 +#: ../../library/argparse.rst:1711 msgid "" "One particularly effective way of handling subcommands is to combine the use " "of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " @@ -2864,7 +2867,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1714 +#: ../../library/argparse.rst:1716 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -2899,7 +2902,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1746 +#: ../../library/argparse.rst:1748 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -2909,7 +2912,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1753 +#: ../../library/argparse.rst:1755 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -2929,15 +2932,15 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1762 +#: ../../library/argparse.rst:1764 msgid "New *required* keyword-only parameter." msgstr "" -#: ../../library/argparse.rst:1767 +#: ../../library/argparse.rst:1769 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1771 +#: ../../library/argparse.rst:1773 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -2946,7 +2949,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1777 +#: ../../library/argparse.rst:1779 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -2964,14 +2967,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1783 +#: ../../library/argparse.rst:1785 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1787 +#: ../../library/argparse.rst:1789 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -2983,15 +2986,15 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1792 +#: ../../library/argparse.rst:1794 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1797 +#: ../../library/argparse.rst:1799 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1802 +#: ../../library/argparse.rst:1804 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3000,7 +3003,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:1808 +#: ../../library/argparse.rst:1810 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3024,7 +3027,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:1819 +#: ../../library/argparse.rst:1821 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3035,7 +3038,7 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:1827 +#: ../../library/argparse.rst:1829 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3073,7 +3076,7 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1845 +#: ../../library/argparse.rst:1847 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " @@ -3082,13 +3085,13 @@ msgid "" "rather than the entire parser." msgstr "" -#: ../../library/argparse.rst:1850 +#: ../../library/argparse.rst:1852 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1853 +#: ../../library/argparse.rst:1855 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -3096,18 +3099,18 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:1861 +#: ../../library/argparse.rst:1863 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1865 +#: ../../library/argparse.rst:1867 msgid "" "Create a mutually exclusive group. :mod:`!argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:1869 +#: ../../library/argparse.rst:1871 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3133,14 +3136,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:1881 +#: ../../library/argparse.rst:1883 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:1885 +#: ../../library/argparse.rst:1887 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3158,7 +3161,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:1893 +#: ../../library/argparse.rst:1895 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3166,7 +3169,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:1899 +#: ../../library/argparse.rst:1901 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3202,7 +3205,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1916 +#: ../../library/argparse.rst:1918 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -3210,11 +3213,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:1924 +#: ../../library/argparse.rst:1926 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:1928 +#: ../../library/argparse.rst:1930 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3223,7 +3226,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:1934 +#: ../../library/argparse.rst:1936 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3237,12 +3240,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:1940 +#: ../../library/argparse.rst:1942 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:1942 +#: ../../library/argparse.rst:1944 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3256,20 +3259,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:1948 +#: ../../library/argparse.rst:1950 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:1954 +#: ../../library/argparse.rst:1956 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:1958 +#: ../../library/argparse.rst:1960 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3281,54 +3284,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:1965 +#: ../../library/argparse.rst:1967 msgid "Printing help" msgstr "印出幫助訊息" -#: ../../library/argparse.rst:1967 +#: ../../library/argparse.rst:1969 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:1973 +#: ../../library/argparse.rst:1975 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:1979 +#: ../../library/argparse.rst:1981 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:1983 +#: ../../library/argparse.rst:1985 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:1988 +#: ../../library/argparse.rst:1990 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:1993 +#: ../../library/argparse.rst:1995 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:1998 +#: ../../library/argparse.rst:2000 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2002 +#: ../../library/argparse.rst:2004 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -3339,7 +3342,7 @@ msgid "" "remaining argument strings." msgstr "" -#: ../../library/argparse.rst:2011 +#: ../../library/argparse.rst:2013 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3353,7 +3356,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2018 +#: ../../library/argparse.rst:2020 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3361,11 +3364,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2025 +#: ../../library/argparse.rst:2027 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2029 +#: ../../library/argparse.rst:2031 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3373,20 +3376,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2034 +#: ../../library/argparse.rst:2036 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2038 +#: ../../library/argparse.rst:2040 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2041 +#: ../../library/argparse.rst:2043 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3396,18 +3399,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2047 +#: ../../library/argparse.rst:2049 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2051 +#: ../../library/argparse.rst:2053 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2055 +#: ../../library/argparse.rst:2057 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3421,17 +3424,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2063 +#: ../../library/argparse.rst:2065 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2068 +#: ../../library/argparse.rst:2070 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2073 +#: ../../library/argparse.rst:2075 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3439,7 +3442,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2078 +#: ../../library/argparse.rst:2080 msgid "" "These parsers do not support all the :mod:`!argparse` features, and will " "raise exceptions if unsupported features are used. In particular, " @@ -3447,7 +3450,7 @@ msgid "" "positionals are not supported." msgstr "" -#: ../../library/argparse.rst:2083 +#: ../../library/argparse.rst:2085 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3455,7 +3458,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2089 +#: ../../library/argparse.rst:2091 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3475,7 +3478,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2098 +#: ../../library/argparse.rst:2100 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3483,42 +3486,83 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2107 +#: ../../library/argparse.rst:2109 +msgid "Registering custom types or actions" +msgstr "" + +#: ../../library/argparse.rst:2113 +msgid "" +"Sometimes it's desirable to use a custom string in error messages to provide " +"more user-friendly output. In these cases, :meth:`!register` can be used to " +"register custom actions or types with a parser and allow you to reference " +"the type by their registered name instead of their callable name." +msgstr "" + +#: ../../library/argparse.rst:2118 +msgid "" +"The :meth:`!register` method accepts three arguments - a *registry_name*, " +"specifying the internal registry where the object will be stored (e.g., " +"``action``, ``type``), *value*, which is the key under which the object will " +"be registered, and object, the callable to be registered." +msgstr "" + +#: ../../library/argparse.rst:2123 +msgid "" +"The following example shows how to register a custom type with a parser::" +msgstr "" + +#: ../../library/argparse.rst:2125 +msgid "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.register('type', 'hexadecimal integer', lambda s: int(s, 16))\n" +">>> parser.add_argument('--foo', type='hexadecimal integer')\n" +"_StoreAction(option_strings=['--foo'], dest='foo', nargs=None, const=None, " +"default=None, type='hexadecimal integer', choices=None, required=False, " +"help=None, metavar=None, deprecated=False)\n" +">>> parser.parse_args(['--foo', '0xFA'])\n" +"Namespace(foo=250)\n" +">>> parser.parse_args(['--foo', '1.2'])\n" +"usage: PROG [-h] [--foo FOO]\n" +"PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" +msgstr "" + +#: ../../library/argparse.rst:2137 msgid "Exceptions" msgstr "例外" -#: ../../library/argparse.rst:2111 +#: ../../library/argparse.rst:2141 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2113 +#: ../../library/argparse.rst:2143 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2118 +#: ../../library/argparse.rst:2148 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:2122 +#: ../../library/argparse.rst:2152 msgid "Guides and Tutorials" msgstr "" -#: ../../library/argparse.rst:802 +#: ../../library/argparse.rst:803 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:802 ../../library/argparse.rst:836 -#: ../../library/argparse.rst:850 +#: ../../library/argparse.rst:803 ../../library/argparse.rst:837 +#: ../../library/argparse.rst:851 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:836 +#: ../../library/argparse.rst:837 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:850 +#: ../../library/argparse.rst:851 msgid "+ (plus)" msgstr "+ (加號)" diff --git a/library/asynchat.po b/library/asynchat.po new file mode 100644 index 0000000000..cd03892c96 --- /dev/null +++ b/library/asynchat.po @@ -0,0 +1,43 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/asynchat.rst:2 +msgid ":mod:`!asynchat` --- Asynchronous socket command/response handler" +msgstr ":mod:`!asynchat` --- 非同步 socket 指令/回應處理函式" + +#: ../../library/asynchat.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being deprecated in " +"Python 3.6. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.6 中被棄用,並\\ :" +"ref:`已在 Python 3.12 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/asynchat.rst:14 +msgid "Applications should use the :mod:`asyncio` module instead." +msgstr "應用程式應改用 :mod:`asyncio` 模組。" + +#: ../../library/asynchat.rst:16 +msgid "" +"The last version of Python that provided the :mod:`!asynchat` module was " +"`Python 3.11 `_." +msgstr "" +"最後提供 :mod:`!asynchat` 模組的 Python 版本是 `Python 3.11 `_。" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 8cb8efab1e..dba9cad94d 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2024-11-12 00:13+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1228,9 +1228,8 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:744 -#, fuzzy msgid "Added the *keep_alive* parameter." -msgstr "加入 *name* 參數。" +msgstr "加入 *keep_alive* 參數。" #: ../../library/asyncio-eventloop.rst:746 msgid "" @@ -1314,9 +1313,8 @@ msgstr "" "個 :class:`~pathlib.Path` 物件。" #: ../../library/asyncio-eventloop.rst:819 -#, fuzzy msgid "Added the *cleanup_socket* parameter." -msgstr "加入 *context* 參數。" +msgstr "加入 *cleanup_socket* 參數。" #: ../../library/asyncio-eventloop.rst:826 msgid "Wrap an already accepted connection into a transport/protocol pair." @@ -2506,9 +2504,8 @@ msgstr "" "躍連線)。" #: ../../library/asyncio-eventloop.rst:1657 -#, fuzzy msgid "Close all existing incoming client connections." -msgstr "代表現有傳入用戶端連線的 sockets 仍然保持開啟。" +msgstr "關閉所有現有的傳入客戶端連線。" #: ../../library/asyncio-eventloop.rst:1659 msgid "" @@ -2633,18 +2630,14 @@ msgstr "" "`ProactorEventLoop`。" #: ../../library/asyncio-eventloop.rst:1759 -#, fuzzy msgid "By default asyncio is configured to use :class:`EventLoop`." -msgstr "" -"預設情況下,asyncio 配置為在 Unix 上使用 :class:`SelectorEventLoop`,在 " -"Windows 上使用 :class:`ProactorEventLoop`。" +msgstr "預設情況下,asyncio 被配置為要使用 :class:`EventLoop`。" #: ../../library/asyncio-eventloop.rst:1764 -#, fuzzy msgid "" "A subclass of :class:`AbstractEventLoop` based on the :mod:`selectors` " "module." -msgstr "基於 :mod:`selectors` 模組的事件迴圈。" +msgstr "基於 :mod:`selectors` 模組的一個 :class:`AbstractEventLoop` 子類別。" #: ../../library/asyncio-eventloop.rst:1767 msgid "" @@ -2678,19 +2671,20 @@ msgstr "" "asyncio.set_event_loop_policy(MyPolicy())" #: ../../library/asyncio-eventloop.rst:1787 -#, fuzzy msgid "" "A subclass of :class:`AbstractEventLoop` for Windows that uses \"I/O " "Completion Ports\" (IOCP)." -msgstr "用於 Windows 的事件迴圈,使用\"I/O 完成埠\"(IOCP)。" +msgstr "" +"用於 Windows 的 :class:`AbstractEventLoop` 子類別,使用「I/O 完成埠 (IOCP, I/" +"O Completion Ports)」。" #: ../../library/asyncio-eventloop.rst:1793 msgid "" -"`MSDN documentation on I/O Completion Ports `_." +"`MSDN documentation on I/O Completion Ports `_." msgstr "" -"`I/O 完成埠(I/O Completion Ports)的 MSDN 文件 `_。" +"`I/O 完成埠的 MSDN 文件 `_。" #: ../../library/asyncio-eventloop.rst:1798 msgid "" @@ -2699,13 +2693,12 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:1801 -#, fuzzy msgid "" "It is an alias to :class:`SelectorEventLoop` on Unix and :class:" "`ProactorEventLoop` on Windows." msgstr "" -"預設情況下,asyncio 配置為在 Unix 上使用 :class:`SelectorEventLoop`,在 " -"Windows 上使用 :class:`ProactorEventLoop`。" +"在 Unix 上是 :class:`SelectorEventLoop` 的別名,在 Windows 上是 :class:" +"`ProactorEventLoop` 的別名。" #: ../../library/asyncio-eventloop.rst:1807 msgid "Abstract base class for asyncio-compliant event loops." diff --git a/library/asyncio-extending.po b/library/asyncio-extending.po index 506947aa5f..f7a1ab412f 100644 --- a/library/asyncio-extending.po +++ b/library/asyncio-extending.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -11,7 +10,8 @@ msgstr "" "POT-Creation-Date: 2023-07-29 10:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 0dd0adb9cc..4030cbdb6e 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -11,7 +10,8 @@ msgstr "" "POT-Creation-Date: 2024-09-23 07:52+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 667acc44fd..f4ca808ca4 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2024-11-25 00:14+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:415 +#: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:419 msgid "" "import asyncio\n" "\n" @@ -110,7 +110,7 @@ msgstr "" "回傳的 *reader* 和 *writer* 物件是 :class:`StreamReader` 和 :class:" "`StreamWriter` 類別的實例。" -#: ../../library/asyncio-stream.rst:64 ../../library/asyncio-stream.rst:109 +#: ../../library/asyncio-stream.rst:64 ../../library/asyncio-stream.rst:110 msgid "" "*limit* determines the buffer size limit used by the returned :class:" "`StreamReader` instance. By default the *limit* is set to 64 KiB." @@ -124,7 +124,7 @@ msgid "" "create_connection`." msgstr "其餘的引數會直接傳遞到 :meth:`loop.create_connection`。" -#: ../../library/asyncio-stream.rst:73 ../../library/asyncio-stream.rst:147 +#: ../../library/asyncio-stream.rst:73 ../../library/asyncio-stream.rst:151 msgid "" "The *sock* argument transfers ownership of the socket to the :class:" "`StreamWriter` created. To close the socket, call its :meth:`~asyncio." @@ -139,22 +139,22 @@ msgstr "新增 *ssl_handshake_timeout* 參數。" msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "新增 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-stream.rst:83 ../../library/asyncio-stream.rst:125 -#: ../../library/asyncio-stream.rst:157 ../../library/asyncio-stream.rst:187 +#: ../../library/asyncio-stream.rst:83 ../../library/asyncio-stream.rst:126 +#: ../../library/asyncio-stream.rst:161 ../../library/asyncio-stream.rst:191 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-stream.rst:86 ../../library/asyncio-stream.rst:128 -#: ../../library/asyncio-stream.rst:160 ../../library/asyncio-stream.rst:190 -#: ../../library/asyncio-stream.rst:383 +#: ../../library/asyncio-stream.rst:86 ../../library/asyncio-stream.rst:129 +#: ../../library/asyncio-stream.rst:164 ../../library/asyncio-stream.rst:194 +#: ../../library/asyncio-stream.rst:387 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "新增 *ssl_shutdown_timeout* 參數。" -#: ../../library/asyncio-stream.rst:98 +#: ../../library/asyncio-stream.rst:99 msgid "Start a socket server." msgstr "啟動 socket 伺服器。" -#: ../../library/asyncio-stream.rst:100 +#: ../../library/asyncio-stream.rst:101 msgid "" "The *client_connected_cb* callback is called whenever a new client " "connection is established. It receives a ``(reader, writer)`` pair as two " @@ -165,7 +165,7 @@ msgstr "" "式會接收到一對引數 ``(reader, writer)``,分別為 :class:`StreamReader` 和 :" "class:`StreamWriter` 的實例。" -#: ../../library/asyncio-stream.rst:105 +#: ../../library/asyncio-stream.rst:106 msgid "" "*client_connected_cb* can be a plain callable or a :ref:`coroutine function " "`; if it is a coroutine function, it will be automatically " @@ -175,43 +175,47 @@ msgstr "" "ref:`協程函式 `;如果它是一個協程函式,它將自動作為 :class:`Task` " "來被排程。" -#: ../../library/asyncio-stream.rst:113 +#: ../../library/asyncio-stream.rst:114 msgid "" "The rest of the arguments are passed directly to :meth:`loop.create_server`." msgstr "剩下的引數將會直接傳遞給 :meth:`loop.create_server`。" -#: ../../library/asyncio-stream.rst:118 ../../library/asyncio-stream.rst:177 +#: ../../library/asyncio-stream.rst:119 ../../library/asyncio-stream.rst:181 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: ../../library/asyncio-stream.rst:122 +#: ../../library/asyncio-stream.rst:123 msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters." msgstr "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。" -#: ../../library/asyncio-stream.rst:133 +#: ../../library/asyncio-stream.rst:132 +msgid "Added the *keep_alive* parameter." +msgstr "新增 *keep_alive* 參數。" + +#: ../../library/asyncio-stream.rst:137 msgid "Unix Sockets" msgstr "Unix Sockets" -#: ../../library/asyncio-stream.rst:138 +#: ../../library/asyncio-stream.rst:142 msgid "" "Establish a Unix socket connection and return a pair of ``(reader, writer)``." msgstr "建立一個 Unix socket 連線並回傳一對 ``(reader, writer)``。" -#: ../../library/asyncio-stream.rst:141 +#: ../../library/asyncio-stream.rst:145 msgid "Similar to :func:`open_connection` but operates on Unix sockets." msgstr "與 :func:`open_connection` 相似,但是是操作 Unix sockets。" -#: ../../library/asyncio-stream.rst:143 +#: ../../library/asyncio-stream.rst:147 msgid "See also the documentation of :meth:`loop.create_unix_connection`." msgstr "另請參閱 :meth:`loop.create_unix_connection` 文件。" -#: ../../library/asyncio-stream.rst:151 ../../library/asyncio-stream.rst:181 +#: ../../library/asyncio-stream.rst:155 ../../library/asyncio-stream.rst:185 msgid "Availability" msgstr "" -#: ../../library/asyncio-stream.rst:153 +#: ../../library/asyncio-stream.rst:157 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`" @@ -219,19 +223,19 @@ msgstr "" "新增 *ssl_handshake_timeout* 參數。*path* 參數現在可以是個 :term:`path-like " "object`" -#: ../../library/asyncio-stream.rst:169 +#: ../../library/asyncio-stream.rst:173 msgid "Start a Unix socket server." msgstr "啟動一個 Unix socket 伺服器。" -#: ../../library/asyncio-stream.rst:171 +#: ../../library/asyncio-stream.rst:175 msgid "Similar to :func:`start_server` but works with Unix sockets." msgstr "與 :func:`start_server` 相似,但會是操作 Unix sockets。" -#: ../../library/asyncio-stream.rst:173 +#: ../../library/asyncio-stream.rst:177 msgid "See also the documentation of :meth:`loop.create_unix_server`." msgstr "另請參閱 :meth:`loop.create_unix_server` 文件。" -#: ../../library/asyncio-stream.rst:183 +#: ../../library/asyncio-stream.rst:187 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :term:`path-like object`." @@ -239,11 +243,11 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。*path* 參數現在可以是" "個 :term:`path-like object`。" -#: ../../library/asyncio-stream.rst:195 +#: ../../library/asyncio-stream.rst:199 msgid "StreamReader" msgstr "StreamReader" -#: ../../library/asyncio-stream.rst:199 +#: ../../library/asyncio-stream.rst:203 msgid "" "Represents a reader object that provides APIs to read data from the IO " "stream. As an :term:`asynchronous iterable`, the object supports the :" @@ -252,7 +256,7 @@ msgstr "" "表示一個有提供 API 來從 IO 串流中讀取資料的 reader 物件。作為一個 :term:" "`asynchronous iterable`,此物件支援 :keyword:`async for` 陳述式。" -#: ../../library/asyncio-stream.rst:203 +#: ../../library/asyncio-stream.rst:207 msgid "" "It is not recommended to instantiate *StreamReader* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -260,15 +264,15 @@ msgstr "" "不建議直接實例化 *StreamReader* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:209 +#: ../../library/asyncio-stream.rst:213 msgid "Acknowledge the EOF." msgstr "" -#: ../../library/asyncio-stream.rst:213 +#: ../../library/asyncio-stream.rst:217 msgid "Read up to *n* bytes from the stream." msgstr "從串流中讀取至多 *n* 個位元組的資料。" -#: ../../library/asyncio-stream.rst:215 +#: ../../library/asyncio-stream.rst:219 msgid "" "If *n* is not provided or set to ``-1``, read until EOF, then return all " "read :class:`bytes`. If EOF was received and the internal buffer is empty, " @@ -278,39 +282,39 @@ msgstr "" "的 :class:`bytes`。讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物" "件。" -#: ../../library/asyncio-stream.rst:220 +#: ../../library/asyncio-stream.rst:224 msgid "If *n* is ``0``, return an empty ``bytes`` object immediately." msgstr "如果 *n* 為 ``0``,則立即回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:222 +#: ../../library/asyncio-stream.rst:226 msgid "" "If *n* is positive, return at most *n* available ``bytes`` as soon as at " "least 1 byte is available in the internal buffer. If EOF is received before " "any byte is read, return an empty ``bytes`` object." msgstr "" -#: ../../library/asyncio-stream.rst:229 +#: ../../library/asyncio-stream.rst:233 msgid "" "Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." msgstr "讀取一行,其中\"行\"指的是以 ``\\n`` 結尾的位元組序列。" -#: ../../library/asyncio-stream.rst:232 +#: ../../library/asyncio-stream.rst:236 msgid "" "If EOF is received and ``\\n`` was not found, the method returns partially " "read data." msgstr "如果讀取到 EOF 而沒有找到 ``\\n``,該方法會回傳部分的已讀取資料。" -#: ../../library/asyncio-stream.rst:235 +#: ../../library/asyncio-stream.rst:239 msgid "" "If EOF is received and the internal buffer is empty, return an empty " "``bytes`` object." msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:240 +#: ../../library/asyncio-stream.rst:244 msgid "Read exactly *n* bytes." msgstr "讀取剛好 *n* 個位元組。" -#: ../../library/asyncio-stream.rst:242 +#: ../../library/asyncio-stream.rst:246 msgid "" "Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be " "read. Use the :attr:`IncompleteReadError.partial` attribute to get the " @@ -320,11 +324,11 @@ msgstr "" "`IncompleteReadError`。使用 :attr:`IncompleteReadError.partial` 屬性來獲取串" "流結束前已讀取的部分資料。" -#: ../../library/asyncio-stream.rst:248 +#: ../../library/asyncio-stream.rst:252 msgid "Read data from the stream until *separator* is found." msgstr "從串流中持續讀取資料直到出現 *separator*。" -#: ../../library/asyncio-stream.rst:250 +#: ../../library/asyncio-stream.rst:254 msgid "" "On success, the data and separator will be removed from the internal buffer " "(consumed). Returned data will include the separator at the end." @@ -332,7 +336,7 @@ msgstr "" "成功後,資料和 separator(分隔符號)會從內部緩衝區中刪除(或者說是被消費掉 " "(consumed))。回傳的資料在末尾會有一個 separator。" -#: ../../library/asyncio-stream.rst:254 +#: ../../library/asyncio-stream.rst:258 msgid "" "If the amount of data read exceeds the configured stream limit, a :exc:" "`LimitOverrunError` exception is raised, and the data is left in the " @@ -341,7 +345,7 @@ msgstr "" "如果讀取的資料量超過了設定的串流限制,將會引發 :exc:`LimitOverrunError` 例" "外,資料將被留在內部緩衝區中,並可以再次被讀取。" -#: ../../library/asyncio-stream.rst:258 +#: ../../library/asyncio-stream.rst:262 msgid "" "If EOF is reached before the complete separator is found, an :exc:" "`IncompleteReadError` exception is raised, and the internal buffer is " @@ -352,7 +356,7 @@ msgstr "" "`IncompleteReadError` 例外,且內部緩衝區會被重置。:attr:`IncompleteReadError." "partial` 屬性可能包含一部分的 separator。" -#: ../../library/asyncio-stream.rst:263 +#: ../../library/asyncio-stream.rst:267 msgid "" "The *separator* may also be a tuple of separators. In this case the return " "value will be the shortest possible that has any separator as the suffix. " @@ -360,24 +364,24 @@ msgid "" "separator is considered to be the one that matched." msgstr "" -#: ../../library/asyncio-stream.rst:273 +#: ../../library/asyncio-stream.rst:277 msgid "The *separator* parameter may now be a :class:`tuple` of separators." -msgstr "" +msgstr "現在 *separator* 參數可以是一個分隔符號的 :class:`tuple`。" -#: ../../library/asyncio-stream.rst:278 +#: ../../library/asyncio-stream.rst:282 msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." msgstr "如果緩衝區是空的且 :meth:`feed_eof` 曾被呼叫則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:283 +#: ../../library/asyncio-stream.rst:287 msgid "StreamWriter" msgstr "StreamWriter" -#: ../../library/asyncio-stream.rst:287 +#: ../../library/asyncio-stream.rst:291 msgid "" "Represents a writer object that provides APIs to write data to the IO stream." msgstr "表示一個有提供 API 來將資料寫入 IO 串流的 writer 物件。" -#: ../../library/asyncio-stream.rst:290 +#: ../../library/asyncio-stream.rst:294 msgid "" "It is not recommended to instantiate *StreamWriter* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -385,7 +389,7 @@ msgstr "" "不建議直接實例化 *StreamWriter* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:296 +#: ../../library/asyncio-stream.rst:300 msgid "" "The method attempts to write the *data* to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -394,11 +398,11 @@ msgstr "" "此方法會嘗試立即將 *data* 寫入到底層的 socket。如果失敗,資料會被放到內部寫入" "緩衝中排隊等待 (queue),直到它可被發送。" -#: ../../library/asyncio-stream.rst:300 ../../library/asyncio-stream.rst:312 +#: ../../library/asyncio-stream.rst:304 ../../library/asyncio-stream.rst:316 msgid "The method should be used along with the ``drain()`` method::" msgstr "此方法應當與 ``drain()`` 方法一起使用: ::" -#: ../../library/asyncio-stream.rst:302 +#: ../../library/asyncio-stream.rst:306 msgid "" "stream.write(data)\n" "await stream.drain()" @@ -406,7 +410,7 @@ msgstr "" "stream.write(data)\n" "await stream.drain()" -#: ../../library/asyncio-stream.rst:307 +#: ../../library/asyncio-stream.rst:311 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 " @@ -415,7 +419,7 @@ msgstr "" "此方法會立即嘗試將一個位元組 list(或任何可疊代物件 (iterable))寫入到底層的 " "socket。如果失敗,資料會被放到內部寫入緩衝中排隊等待,直到它可被發送。" -#: ../../library/asyncio-stream.rst:314 +#: ../../library/asyncio-stream.rst:318 msgid "" "stream.writelines(lines)\n" "await stream.drain()" @@ -423,17 +427,17 @@ msgstr "" "stream.writelines(lines)\n" "await stream.drain()" -#: ../../library/asyncio-stream.rst:319 +#: ../../library/asyncio-stream.rst:323 msgid "The method closes the stream and the underlying socket." msgstr "此方法會關閉串流以及底層的 socket。" -#: ../../library/asyncio-stream.rst:321 +#: ../../library/asyncio-stream.rst:325 msgid "" "The method should be used, though not mandatory, along with the " "``wait_closed()`` method::" msgstr "此方法應與 ``wait_closed()`` 方法一起使用,但並非強制: ::" -#: ../../library/asyncio-stream.rst:324 +#: ../../library/asyncio-stream.rst:328 msgid "" "stream.close()\n" "await stream.wait_closed()" @@ -441,7 +445,7 @@ msgstr "" "stream.close()\n" "await stream.wait_closed()" -#: ../../library/asyncio-stream.rst:329 +#: ../../library/asyncio-stream.rst:333 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." @@ -449,26 +453,26 @@ msgstr "" "如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 " "``False``。" -#: ../../library/asyncio-stream.rst:334 +#: ../../library/asyncio-stream.rst:338 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。" -#: ../../library/asyncio-stream.rst:339 +#: ../../library/asyncio-stream.rst:343 msgid "Return the underlying asyncio transport." msgstr "回傳底層的 asyncio 傳輸。" -#: ../../library/asyncio-stream.rst:343 +#: ../../library/asyncio-stream.rst:347 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。" -#: ../../library/asyncio-stream.rst:348 +#: ../../library/asyncio-stream.rst:352 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "等待直到可以繼續寫入到串流。範例: ::" -#: ../../library/asyncio-stream.rst:351 +#: ../../library/asyncio-stream.rst:355 msgid "" "writer.write(data)\n" "await writer.drain()" @@ -476,7 +480,7 @@ msgstr "" "writer.write(data)\n" "await writer.drain()" -#: ../../library/asyncio-stream.rst:354 +#: ../../library/asyncio-stream.rst:358 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()* " @@ -488,48 +492,48 @@ msgstr "" "(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low " "watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。" -#: ../../library/asyncio-stream.rst:364 +#: ../../library/asyncio-stream.rst:368 msgid "Upgrade an existing stream-based connection to TLS." -msgstr "" +msgstr "將現有的基於串流的連線升級到 TLS。" -#: ../../library/asyncio-stream.rst:366 +#: ../../library/asyncio-stream.rst:370 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-stream.rst:368 +#: ../../library/asyncio-stream.rst:372 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." -msgstr "" +msgstr "*sslcontext*:一個 :class:`~ssl.SSLContext` 的已配置實例。" -#: ../../library/asyncio-stream.rst:370 +#: ../../library/asyncio-stream.rst:374 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." -msgstr "" +msgstr "*server_hostname*:設定或覆寫將會被目標伺服器憑證比對的主機名稱。" -#: ../../library/asyncio-stream.rst:373 +#: ../../library/asyncio-stream.rst:377 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:377 +#: ../../library/asyncio-stream.rst:381 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:389 +#: ../../library/asyncio-stream.rst:393 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:396 +#: ../../library/asyncio-stream.rst:400 msgid "Wait until the stream is closed." msgstr "等待直到串流被關閉。" -#: ../../library/asyncio-stream.rst:398 +#: ../../library/asyncio-stream.rst:402 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 " @@ -538,19 +542,19 @@ msgstr "" "應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉,以確保在" "這之前(例如在程式退出前)所有資料都已經被清空" -#: ../../library/asyncio-stream.rst:406 +#: ../../library/asyncio-stream.rst:410 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-stream.rst:411 +#: ../../library/asyncio-stream.rst:415 msgid "TCP echo client using streams" msgstr "使用串流的 TCP echo 客戶端" -#: ../../library/asyncio-stream.rst:413 +#: ../../library/asyncio-stream.rst:417 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端: ::" -#: ../../library/asyncio-stream.rst:437 +#: ../../library/asyncio-stream.rst:441 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" @@ -559,15 +563,15 @@ msgstr "" "使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 " "`\\ 範例。" -#: ../../library/asyncio-stream.rst:444 +#: ../../library/asyncio-stream.rst:448 msgid "TCP echo server using streams" msgstr "使用串流的 TCP echo 伺服器" -#: ../../library/asyncio-stream.rst:446 +#: ../../library/asyncio-stream.rst:450 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式: ::" -#: ../../library/asyncio-stream.rst:448 +#: ../../library/asyncio-stream.rst:452 msgid "" "import asyncio\n" "\n" @@ -627,7 +631,7 @@ msgstr "" "\n" "asyncio.run(main())" -#: ../../library/asyncio-stream.rst:480 +#: ../../library/asyncio-stream.rst:484 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." @@ -636,16 +640,16 @@ msgstr "" "使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 " "` 範例。" -#: ../../library/asyncio-stream.rst:485 +#: ../../library/asyncio-stream.rst:489 msgid "Get HTTP headers" msgstr "獲取 HTTP 標頭" -#: ../../library/asyncio-stream.rst:487 +#: ../../library/asyncio-stream.rst:491 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "查詢自命令列傳入之 URL 所帶有 HTTP 標頭的簡單範例: ::" -#: ../../library/asyncio-stream.rst:489 +#: ../../library/asyncio-stream.rst:493 msgid "" "import asyncio\n" "import urllib.parse\n" @@ -684,34 +688,34 @@ msgid "" "asyncio.run(print_http_headers(url))" msgstr "" -#: ../../library/asyncio-stream.rst:526 +#: ../../library/asyncio-stream.rst:530 msgid "Usage::" msgstr "用法: ::" -#: ../../library/asyncio-stream.rst:528 +#: ../../library/asyncio-stream.rst:532 msgid "python example.py http://example.com/path/page.html" msgstr "python example.py http://example.com/path/page.html" -#: ../../library/asyncio-stream.rst:530 +#: ../../library/asyncio-stream.rst:534 msgid "or with HTTPS::" msgstr "或使用 HTTPS: ::" -#: ../../library/asyncio-stream.rst:532 +#: ../../library/asyncio-stream.rst:536 msgid "python example.py https://example.com/path/page.html" msgstr "python example.py https://example.com/path/page.html" -#: ../../library/asyncio-stream.rst:538 +#: ../../library/asyncio-stream.rst:542 msgid "Register an open socket to wait for data using streams" msgstr "註冊一個使用串流來等待資料的開放 socket" -#: ../../library/asyncio-stream.rst:540 +#: ../../library/asyncio-stream.rst:544 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" msgstr "" "等待直到 socket 透過使用 :func:`open_connection` 函式接收到資料的協程: ::" -#: ../../library/asyncio-stream.rst:543 +#: ../../library/asyncio-stream.rst:547 msgid "" "import asyncio\n" "import socket\n" @@ -744,7 +748,7 @@ msgid "" "asyncio.run(wait_for_data())" msgstr "" -#: ../../library/asyncio-stream.rst:575 +#: ../../library/asyncio-stream.rst:579 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " @@ -754,7 +758,7 @@ msgstr "" "`\\ 範例中,有使用了低階協定以及 :meth:" "`loop.create_connection` 方法。" -#: ../../library/asyncio-stream.rst:579 +#: ../../library/asyncio-stream.rst:583 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index ffee4a801a..f7068e20fe 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. # @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-11-30 00:14+0000\n" "PO-Revision-Date: 2022-02-09 19:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -340,13 +339,12 @@ msgstr "" "``True``。" #: ../../library/asyncio-sync.rst:219 -#, fuzzy msgid "" "Wake up *n* tasks (1 by default) waiting on this condition. If fewer than " "*n* tasks are waiting they are all awakened." msgstr "" -"喚醒至多 *n* 個正在等待此條件的任務(預設為 1),如果沒有正在等待的任務則此方" -"法為空操作 (no-op)。" +"喚醒至多 *n* 個正在等待此條件的任務(預設為 1),如果少於 *n* 個任務則全部被" +"喚醒。" #: ../../library/asyncio-sync.rst:222 ../../library/asyncio-sync.rst:237 msgid "" @@ -402,8 +400,9 @@ msgstr "" #: ../../library/asyncio-sync.rst:260 msgid "" "Note that a task *may* return from this call spuriously, which is why the " -"caller should always re-check the state and be prepared to :meth:`wait` " -"again. For this reason, you may prefer to use :meth:`wait_for` instead." +"caller should always re-check the state and be prepared to :meth:`~Condition." +"wait` again. For this reason, you may prefer to use :meth:`~Condition." +"wait_for` instead." msgstr "" #: ../../library/asyncio-sync.rst:267 @@ -411,14 +410,14 @@ msgid "Wait until a predicate becomes *true*." msgstr "持續等待直到謂語 (predicate) 成為 *true*。" #: ../../library/asyncio-sync.rst:269 -#, fuzzy msgid "" "The predicate must be a callable which result will be interpreted as a " -"boolean value. The method will repeatedly :meth:`wait` until the predicate " -"evaluates to *true*. The final value is the return value." +"boolean value. The method will repeatedly :meth:`~Condition.wait` until the " +"predicate evaluates to *true*. The final value is the return value." msgstr "" -"謂語必須是一個結果可被直譯為一個 boolean 值的可呼叫物件 (callable)。最終值為" -"回傳值。" +"謂語必須是一個結果可被直譯為一個 boolean 值的可呼叫物件 (callable)。此方法會" +"重複地 :meth:`~Condition.wait` 直到謂語求值結果為 *true*。最終的值即為回傳" +"值。" #: ../../library/asyncio-sync.rst:276 msgid "Semaphore" @@ -643,8 +642,9 @@ msgstr "" #: ../../library/asyncio-sync.rst:436 msgid "" "Put the barrier into a broken state. This causes any active or future calls " -"to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use this for " -"example if one of the tasks needs to abort, to avoid infinite waiting tasks." +"to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`. Use " +"this for example if one of the tasks needs to abort, to avoid infinite " +"waiting tasks." msgstr "" #: ../../library/asyncio-sync.rst:443 diff --git a/library/asyncore.po b/library/asyncore.po new file mode 100644 index 0000000000..98419d8bc4 --- /dev/null +++ b/library/asyncore.po @@ -0,0 +1,43 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/asyncore.rst:2 +msgid ":mod:`!asyncore` --- Asynchronous socket handler" +msgstr ":mod:`!asyncore` --- 非同步 socket 處理函式" + +#: ../../library/asyncore.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being deprecated in " +"Python 3.6. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.6 中被棄用,並\\ :" +"ref:`已在 Python 3.12 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/asyncore.rst:14 +msgid "Applications should use the :mod:`asyncio` module instead." +msgstr "應用程式應改用 :mod:`asyncio` 模組。" + +#: ../../library/asyncore.rst:16 +msgid "" +"The last version of Python that provided the :mod:`!asyncore` module was " +"`Python 3.11 `_." +msgstr "" +"最後提供 :mod:`!asyncore` 模組的 Python 版本是 `Python 3.11 `_。" diff --git a/library/audioop.po b/library/audioop.po new file mode 100644 index 0000000000..7e17882da9 --- /dev/null +++ b/library/audioop.po @@ -0,0 +1,39 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/audioop.rst:2 +msgid ":mod:`!audioop` --- Manipulate raw audio data" +msgstr ":mod:`!audioop` --- 操作原始聲音檔案" + +#: ../../library/audioop.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/audioop.rst:14 +msgid "" +"The last version of Python that provided the :mod:`!audioop` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!audioop` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/cgi.po b/library/cgi.po new file mode 100644 index 0000000000..5333d176a0 --- /dev/null +++ b/library/cgi.po @@ -0,0 +1,48 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/cgi.rst:2 +msgid ":mod:`!cgi` --- Common Gateway Interface support" +msgstr ":mod:`!cgi` --- 通用閘道器介面支援" + +#: ../../library/cgi.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/cgi.rst:14 +msgid "" +"A fork of the module on PyPI can be used instead: :pypi:`legacy-cgi`. This " +"is a copy of the cgi module, no longer maintained or supported by the core " +"Python team." +msgstr "" +"可以改用 PyPI 上的模組 fork::pypi:`legacy-cgi`。這是 cgi 模組的一個副本,不" +"再由 Python 核心團隊維護或支援。" + +#: ../../library/cgi.rst:18 +msgid "" +"The last version of Python that provided the :mod:`!cgi` module was `Python " +"3.12 `_." +msgstr "" +"最後提供 :mod:`!cgi` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/cgitb.po b/library/cgitb.po new file mode 100644 index 0000000000..bc357c01ba --- /dev/null +++ b/library/cgitb.po @@ -0,0 +1,48 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/cgitb.rst:2 +msgid ":mod:`!cgitb` --- Traceback manager for CGI scripts" +msgstr ":mod:`!cgitb` --- CGI 腳本的回溯管理器 (traceback manager)" + +#: ../../library/cgitb.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/cgitb.rst:14 +msgid "" +"A fork of the module on PyPI can now be used instead: :pypi:`legacy-cgi`. " +"This is a copy of the cgi module, no longer maintained or supported by the " +"core Python team." +msgstr "" +"可以改用 PyPI 上的模組 fork::pypi:`legacy-cgi`。這是 cgi 模組的一個複本,不" +"再由 Python 核心團隊維護或支援。" + +#: ../../library/cgitb.rst:18 +msgid "" +"The last version of Python that provided the :mod:`!cgitb` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!cgitb` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/chunk.po b/library/chunk.po new file mode 100644 index 0000000000..981361eca2 --- /dev/null +++ b/library/chunk.po @@ -0,0 +1,39 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/chunk.rst:2 +msgid ":mod:`!chunk` --- Read IFF chunked data" +msgstr ":mod:`!chunk` --- 讀取 IFF 分塊資料" + +#: ../../library/chunk.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/chunk.rst:14 +msgid "" +"The last version of Python that provided the :mod:`!chunk` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!chunk` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/crypt.po b/library/crypt.po new file mode 100644 index 0000000000..c8e1251bc0 --- /dev/null +++ b/library/crypt.po @@ -0,0 +1,50 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/crypt.rst:2 +msgid ":mod:`!crypt` --- Function to check Unix passwords" +msgstr ":mod:`!crypt` --- 用於檢查 Unix 密碼的函式" + +#: ../../library/crypt.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/crypt.rst:14 +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." +msgstr "" +"應用程式可以改用標準函式庫中的 :mod:`hashlib` 模組。其他可能的替代方案是 " +"PyPI 上的第三方庫::pypi:`legacycrypt`、:pypi:`bcrypt`、:pypi:`argon2-cffi` " +"或 :pypi:`passlib`。這些函式庫並不受 Python 核心團隊支援或維護。" + +#: ../../library/crypt.rst:19 +msgid "" +"The last version of Python that provided the :mod:`!crypt` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!crypt` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/crypto.po b/library/crypto.po index fcccdac384..acdd2c02bf 100644 --- a/library/crypto.po +++ b/library/crypto.po @@ -24,14 +24,13 @@ msgid "Cryptographic Services" msgstr "加密服務" #: ../../library/crypto.rst:9 -#, fuzzy msgid "" "The modules described in this chapter implement various algorithms of a " "cryptographic nature. They are available at the discretion of the " "installation. Here's an overview:" msgstr "" -"本章所描述的模組 (module) 實作了多種加密演算法。它們可以在安裝時選擇是否一同" -"安裝。在 Unix 系統上,:mod:`crypt` 模組也有機會能夠被使用。以下為概述:" +"本章所描述的模組實作了多種加密演算法。它們可以在安裝時選擇是否一同安裝。以下" +"為概述:" #: ../../library/crypto.rst:7 msgid "cryptography" diff --git a/library/ctypes.po b/library/ctypes.po index 1ecac422b6..233c1e14ac 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-29 00:13+0000\n" +"POT-Creation-Date: 2024-11-23 00:14+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-" @@ -376,7 +376,7 @@ msgid "" "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2213 +#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2242 msgid "Fundamental data types" msgstr "" @@ -2497,7 +2497,7 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1316 ../../library/ctypes.rst:1987 +#: ../../library/ctypes.rst:1316 ../../library/ctypes.rst:2002 msgid "The exact functionality is system dependent." msgstr "" @@ -2615,8 +2615,8 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1411 -#: ../../library/ctypes.rst:1422 ../../library/ctypes.rst:1439 +#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1413 +#: ../../library/ctypes.rst:1426 ../../library/ctypes.rst:1444 msgid "The *name* parameter can now be a :term:`path-like object`." msgstr "" @@ -2628,34 +2628,44 @@ msgstr "" #: ../../library/ctypes.rst:1398 msgid "" -"Windows only: Instances of this class represent loaded shared libraries, " -"functions in these libraries use the ``stdcall`` calling convention, and are " -"assumed to return the windows specific :class:`HRESULT` code. :class:" -"`HRESULT` values contain information specifying whether the function call " -"failed or succeeded, together with additional error code. If the return " -"value signals a failure, an :class:`OSError` is automatically raised." +"Instances of this class represent loaded shared libraries, functions in " +"these libraries use the ``stdcall`` calling convention, and are assumed to " +"return the windows specific :class:`HRESULT` code. :class:`HRESULT` values " +"contain information specifying whether the function call failed or " +"succeeded, together with additional error code. If the return value signals " +"a failure, an :class:`OSError` is automatically raised." msgstr "" -#: ../../library/ctypes.rst:1405 +#: ../../library/ctypes.rst:1405 ../../library/ctypes.rst:1422 +#: ../../library/ctypes.rst:1566 ../../library/ctypes.rst:1574 +#: ../../library/ctypes.rst:1751 ../../library/ctypes.rst:1982 +#: ../../library/ctypes.rst:1991 ../../library/ctypes.rst:2016 +#: ../../library/ctypes.rst:2025 ../../library/ctypes.rst:2034 +#: ../../library/ctypes.rst:2049 ../../library/ctypes.rst:2106 +#: ../../library/ctypes.rst:2134 ../../library/ctypes.rst:2478 +msgid "Availability" +msgstr "" + +#: ../../library/ctypes.rst:1407 msgid "" ":exc:`WindowsError` used to be raised, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/ctypes.rst:1416 +#: ../../library/ctypes.rst:1418 msgid "" -"Windows only: Instances of this class represent loaded shared libraries, " -"functions in these libraries use the ``stdcall`` calling convention, and are " -"assumed to return :c:expr:`int` by default." +"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:1424 +#: ../../library/ctypes.rst:1429 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1430 +#: ../../library/ctypes.rst:1435 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 " @@ -2663,11 +2673,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1435 +#: ../../library/ctypes.rst:1440 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1441 +#: ../../library/ctypes.rst:1446 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 " @@ -2677,7 +2687,7 @@ msgid "" "the process, and to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1448 +#: ../../library/ctypes.rst:1453 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 " @@ -2685,7 +2695,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1453 +#: ../../library/ctypes.rst:1458 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:" @@ -2695,14 +2705,14 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1460 +#: ../../library/ctypes.rst:1465 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:1464 +#: ../../library/ctypes.rst:1469 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 :" @@ -2711,7 +2721,7 @@ msgid "" "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1470 +#: ../../library/ctypes.rst:1475 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 " @@ -2721,29 +2731,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1477 +#: ../../library/ctypes.rst:1482 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1484 +#: ../../library/ctypes.rst:1489 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:1491 +#: ../../library/ctypes.rst:1496 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:1498 +#: ../../library/ctypes.rst:1503 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:1501 +#: ../../library/ctypes.rst:1506 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 " @@ -2752,7 +2762,7 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1507 +#: ../../library/ctypes.rst:1512 msgid "" ">>> from ctypes import CDLL\n" ">>> libc = CDLL(\"libc.so.6\") # On Linux\n" @@ -2768,21 +2778,21 @@ msgstr "" ">>> libc['time'] == libc['time']\n" "False" -#: ../../library/ctypes.rst:1514 +#: ../../library/ctypes.rst:1519 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1520 +#: ../../library/ctypes.rst:1525 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1525 +#: ../../library/ctypes.rst:1530 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1527 +#: ../../library/ctypes.rst:1532 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -2790,13 +2800,13 @@ msgid "" "library as attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1535 +#: ../../library/ctypes.rst:1540 msgid "" "Class which loads shared libraries. *dlltype* should be one of the :class:" "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" -#: ../../library/ctypes.rst:1538 +#: ../../library/ctypes.rst:1543 msgid "" ":meth:`!__getattr__` has special behavior: It allows loading a shared " "library by accessing it as attribute of a library loader instance. The " @@ -2804,39 +2814,39 @@ msgid "" "each time." msgstr "" -#: ../../library/ctypes.rst:1544 +#: ../../library/ctypes.rst:1549 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:1548 +#: ../../library/ctypes.rst:1553 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1553 +#: ../../library/ctypes.rst:1558 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1559 -msgid "Windows only: Creates :class:`WinDLL` instances." +#: ../../library/ctypes.rst:1564 +msgid "Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1565 -msgid "Windows only: Creates :class:`OleDLL` instances." +#: ../../library/ctypes.rst:1572 +msgid "Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1571 +#: ../../library/ctypes.rst:1580 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1574 +#: ../../library/ctypes.rst:1583 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1580 +#: ../../library/ctypes.rst:1589 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:" @@ -2844,32 +2854,32 @@ msgid "" "correct :attr:`!restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1585 ../../library/ctypes.rst:1587 +#: ../../library/ctypes.rst:1594 ../../library/ctypes.rst:1596 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:1591 ../../library/ctypes.rst:1593 +#: ../../library/ctypes.rst:1600 ../../library/ctypes.rst:1602 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1597 ../../library/ctypes.rst:1599 +#: ../../library/ctypes.rst:1606 ../../library/ctypes.rst:1608 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:1606 +#: ../../library/ctypes.rst:1615 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1608 +#: ../../library/ctypes.rst:1617 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -2878,13 +2888,13 @@ msgid "" "library loader." msgstr "" -#: ../../library/ctypes.rst:1613 +#: ../../library/ctypes.rst:1622 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:1616 +#: ../../library/ctypes.rst:1625 msgid "" ">>> import ctypes\n" ">>> lib = ctypes.CDLL(None)\n" @@ -2894,29 +2904,29 @@ msgid "" "False" msgstr "" -#: ../../library/ctypes.rst:1627 +#: ../../library/ctypes.rst:1636 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1629 +#: ../../library/ctypes.rst:1638 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1632 +#: ../../library/ctypes.rst:1641 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1637 +#: ../../library/ctypes.rst:1646 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:1640 +#: ../../library/ctypes.rst:1649 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 " @@ -2926,7 +2936,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1649 +#: ../../library/ctypes.rst:1658 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -2935,7 +2945,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1655 +#: ../../library/ctypes.rst:1664 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` " @@ -2945,7 +2955,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1662 +#: ../../library/ctypes.rst:1671 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 " @@ -2953,44 +2963,44 @@ msgid "" "defining adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1669 +#: ../../library/ctypes.rst:1678 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:1676 +#: ../../library/ctypes.rst:1685 msgid "" "*result* is what the foreign function returns, as specified by the :attr:`!" "restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1679 +#: ../../library/ctypes.rst:1688 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:1683 +#: ../../library/ctypes.rst:1692 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:1687 +#: ../../library/ctypes.rst:1696 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:1694 +#: ../../library/ctypes.rst:1703 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1698 ../../library/ctypes.rst:1700 +#: ../../library/ctypes.rst:1707 ../../library/ctypes.rst:1709 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 " @@ -2999,18 +3009,18 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1706 ../../library/ctypes.rst:1708 +#: ../../library/ctypes.rst:1715 ../../library/ctypes.rst:1717 msgid "" "Some ways to invoke foreign function calls may raise an auditing event " "``ctypes.call_function`` with arguments ``function pointer`` and " "``arguments``." msgstr "" -#: ../../library/ctypes.rst:1714 +#: ../../library/ctypes.rst:1723 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1716 +#: ../../library/ctypes.rst:1725 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -3021,7 +3031,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1727 +#: ../../library/ctypes.rst:1736 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -3030,37 +3040,37 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1737 +#: ../../library/ctypes.rst:1746 msgid "" -"Windows only: The returned function prototype creates functions that use the " -"``stdcall`` calling convention. The function will release the GIL during " -"the call. *use_errno* and *use_last_error* have the same meaning as above." +"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:1745 +#: ../../library/ctypes.rst:1756 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:1748 +#: ../../library/ctypes.rst:1759 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:1755 +#: ../../library/ctypes.rst:1766 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: ../../library/ctypes.rst:1762 +#: ../../library/ctypes.rst:1773 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: ../../library/ctypes.rst:1769 +#: ../../library/ctypes.rst:1780 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 " @@ -3068,7 +3078,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: ../../library/ctypes.rst:1779 +#: ../../library/ctypes.rst:1790 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* " @@ -3076,79 +3086,79 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: ../../library/ctypes.rst:1784 +#: ../../library/ctypes.rst:1795 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:1788 +#: ../../library/ctypes.rst:1799 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: ../../library/ctypes.rst:1791 +#: ../../library/ctypes.rst:1802 msgid "" "*paramflags* must be a tuple of the same length as :attr:`~_CFuncPtr." "argtypes`." msgstr "" -#: ../../library/ctypes.rst:1793 +#: ../../library/ctypes.rst:1804 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:1796 +#: ../../library/ctypes.rst:1807 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: ../../library/ctypes.rst:1799 +#: ../../library/ctypes.rst:1810 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1800 +#: ../../library/ctypes.rst:1811 msgid "Specifies an input parameter to the function." msgstr "" -#: ../../library/ctypes.rst:1802 +#: ../../library/ctypes.rst:1813 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1803 +#: ../../library/ctypes.rst:1814 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: ../../library/ctypes.rst:1805 +#: ../../library/ctypes.rst:1816 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1806 +#: ../../library/ctypes.rst:1817 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: ../../library/ctypes.rst:1808 +#: ../../library/ctypes.rst:1819 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:1811 +#: ../../library/ctypes.rst:1822 msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1814 +#: ../../library/ctypes.rst:1825 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:1818 +#: ../../library/ctypes.rst:1829 msgid "" "WINUSERAPI int WINAPI\n" "MessageBoxW(\n" @@ -3164,11 +3174,11 @@ msgstr "" " LPCWSTR lpCaption,\n" " UINT uType);" -#: ../../library/ctypes.rst:1825 ../../library/ctypes.rst:1848 +#: ../../library/ctypes.rst:1836 ../../library/ctypes.rst:1859 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1827 +#: ../../library/ctypes.rst:1838 msgid "" ">>> from ctypes import c_int, WINFUNCTYPE, windll\n" ">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" @@ -3184,11 +3194,11 @@ msgstr "" "\"Hello from ctypes\"), (1, \"flags\", 0)\n" ">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" -#: ../../library/ctypes.rst:1833 +#: ../../library/ctypes.rst:1844 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1835 +#: ../../library/ctypes.rst:1846 msgid "" ">>> MessageBox()\n" ">>> MessageBox(text=\"Spam, spam, spam\")\n" @@ -3198,7 +3208,7 @@ msgstr "" ">>> MessageBox(text=\"Spam, spam, spam\")\n" ">>> MessageBox(flags=2, text=\"foo bar\")" -#: ../../library/ctypes.rst:1839 +#: ../../library/ctypes.rst:1850 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -3206,7 +3216,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1843 +#: ../../library/ctypes.rst:1854 msgid "" "WINUSERAPI BOOL WINAPI\n" "GetWindowRect(\n" @@ -3218,7 +3228,7 @@ msgstr "" " HWND hWnd,\n" " LPRECT lpRect);" -#: ../../library/ctypes.rst:1850 +#: ../../library/ctypes.rst:1861 msgid "" ">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" ">>> from ctypes.wintypes import BOOL, HWND, RECT\n" @@ -3236,7 +3246,7 @@ msgstr "" "paramflags)\n" ">>>" -#: ../../library/ctypes.rst:1857 +#: ../../library/ctypes.rst:1868 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -3244,7 +3254,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1862 +#: ../../library/ctypes.rst:1873 msgid "" "Output parameters can be combined with the :attr:`~_CFuncPtr.errcheck` " "protocol to do further output processing and error checking. The win32 " @@ -3253,7 +3263,7 @@ msgid "" "exception when the api call failed::" msgstr "" -#: ../../library/ctypes.rst:1867 +#: ../../library/ctypes.rst:1878 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3271,7 +3281,7 @@ msgstr "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" -#: ../../library/ctypes.rst:1875 +#: ../../library/ctypes.rst:1886 msgid "" "If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it " "receives unchanged, :mod:`ctypes` continues the normal processing it does on " @@ -3280,7 +3290,7 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1881 +#: ../../library/ctypes.rst:1892 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -3300,17 +3310,17 @@ msgstr "" ">>> GetWindowRect.errcheck = errcheck\n" ">>>" -#: ../../library/ctypes.rst:1894 +#: ../../library/ctypes.rst:1905 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1898 +#: ../../library/ctypes.rst:1909 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1901 +#: ../../library/ctypes.rst:1912 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -3318,34 +3328,34 @@ msgstr "" "引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." "addressof``。" -#: ../../library/ctypes.rst:1906 +#: ../../library/ctypes.rst:1917 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1912 +#: ../../library/ctypes.rst:1923 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:1916 +#: ../../library/ctypes.rst:1927 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1918 +#: ../../library/ctypes.rst:1929 msgid "(((char *)&obj) + offset)" msgstr "(((char *)&obj) + offset)" -#: ../../library/ctypes.rst:1920 +#: ../../library/ctypes.rst:1931 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:1926 +#: ../../library/ctypes.rst:1937 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* " @@ -3353,19 +3363,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1934 +#: ../../library/ctypes.rst:1945 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1937 +#: ../../library/ctypes.rst:1948 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a bytes object which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1940 +#: ../../library/ctypes.rst:1951 msgid "" "If a bytes object is specified as first argument, the buffer is made one " "item larger than its length so that the last element in the array is a NUL " @@ -3374,7 +3384,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1945 +#: ../../library/ctypes.rst:1956 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -3382,19 +3392,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:1950 +#: ../../library/ctypes.rst:1961 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1953 +#: ../../library/ctypes.rst:1964 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a string which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1956 +#: ../../library/ctypes.rst:1967 msgid "" "If a string is specified as first argument, the buffer is made one item " "larger than the length of the string so that the last element in the array " @@ -3403,7 +3413,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1962 +#: ../../library/ctypes.rst:1973 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -3411,21 +3421,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:1967 +#: ../../library/ctypes.rst:1978 msgid "" -"Windows only: This function is a hook which allows implementing in-process " -"COM servers with ctypes. It is called from the DllCanUnloadNow function " -"that the _ctypes extension dll exports." +"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:1974 +#: ../../library/ctypes.rst:1987 msgid "" -"Windows only: This function is a hook which allows implementing in-process " -"COM servers with ctypes. It is called from the DllGetClassObject function " -"that the ``_ctypes`` extension dll exports." +"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:1982 +#: ../../library/ctypes.rst:1997 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 " @@ -3433,94 +3443,94 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1993 +#: ../../library/ctypes.rst:2008 msgid "" -"Windows only: return the filename of the VC runtime library used by Python, " -"and by the extension modules. If the name of the library cannot be " -"determined, ``None`` is returned." +"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:1997 +#: ../../library/ctypes.rst:2012 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:2004 +#: ../../library/ctypes.rst:2021 msgid "" -"Windows only: Returns a textual description of the error code *code*. If no " -"error code is specified, the last error code is used by calling the Windows " -"api function GetLastError." +"Returns a textual description of the error code *code*. If no error code is " +"specified, the last error code is used by calling the Windows api function " +"GetLastError." msgstr "" -#: ../../library/ctypes.rst:2011 +#: ../../library/ctypes.rst:2030 msgid "" -"Windows only: Returns the last error code set by Windows in the calling " -"thread. This function calls the Windows ``GetLastError()`` function " -"directly, it does not return the ctypes-private copy of the error code." +"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:2017 +#: ../../library/ctypes.rst:2039 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2020 +#: ../../library/ctypes.rst:2042 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:2024 +#: ../../library/ctypes.rst:2046 msgid "" -"Windows only: returns the current value of the ctypes-private copy of the " -"system :data:`!LastError` variable in the calling thread." +"Returns the current value of the ctypes-private copy of the system :data:`!" +"LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2027 +#: ../../library/ctypes.rst:2051 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:2031 +#: ../../library/ctypes.rst:2056 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:2038 +#: ../../library/ctypes.rst:2063 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:2045 +#: ../../library/ctypes.rst:2070 msgid "" "Create and return a new ctypes pointer type. Pointer types are cached and " "reused internally, so calling this function repeatedly is cheap. *type* must " "be a ctypes type." msgstr "" -#: ../../library/ctypes.rst:2052 +#: ../../library/ctypes.rst:2077 msgid "" "Create a new pointer instance, pointing to *obj*. The returned object is of " "the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2055 +#: ../../library/ctypes.rst:2080 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:2061 +#: ../../library/ctypes.rst:2086 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 " @@ -3528,13 +3538,13 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2069 +#: ../../library/ctypes.rst:2094 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:2072 +#: ../../library/ctypes.rst:2097 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -3542,14 +3552,14 @@ msgstr "" "引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_errno``。" -#: ../../library/ctypes.rst:2077 +#: ../../library/ctypes.rst:2102 msgid "" -"Windows only: set the current value of the ctypes-private copy of the " -"system :data:`!LastError` variable in the calling thread to *value* and " -"return the previous value." +"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:2081 +#: ../../library/ctypes.rst:2108 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -3557,19 +3567,19 @@ msgstr "" "引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_last_error``。" -#: ../../library/ctypes.rst:2086 +#: ../../library/ctypes.rst:2113 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:2092 +#: ../../library/ctypes.rst:2119 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:2096 +#: ../../library/ctypes.rst:2123 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``ptr``, ``size``." @@ -3577,29 +3587,28 @@ msgstr "" "引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` ``ctypes." "string_at``。" -#: ../../library/ctypes.rst:2101 +#: ../../library/ctypes.rst:2128 msgid "" -"Windows only: this function is probably the worst-named thing in ctypes. It " -"creates an instance of :exc:`OSError`. If *code* is not specified, " -"``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." +"This function is probably the worst-named thing in ctypes. It creates an " +"instance of :exc:`OSError`. If *code* is not specified, ``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:2107 +#: ../../library/ctypes.rst:2136 msgid "" "An instance of :exc:`WindowsError` used to be created, which is now an alias " "of :exc:`OSError`." msgstr "" -#: ../../library/ctypes.rst:2114 +#: ../../library/ctypes.rst:2143 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:2119 +#: ../../library/ctypes.rst:2148 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``ptr``, ``size``." @@ -3607,11 +3616,11 @@ msgstr "" "引發一個附帶引數 ``ptr``、``size`` 的\\ :ref:`稽核事件 ` ``ctypes." "wstring_at``。" -#: ../../library/ctypes.rst:2125 +#: ../../library/ctypes.rst:2154 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2130 +#: ../../library/ctypes.rst:2159 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 " @@ -3621,13 +3630,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2137 +#: ../../library/ctypes.rst:2166 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:2142 +#: ../../library/ctypes.rst:2171 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -3636,7 +3645,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2148 ../../library/ctypes.rst:2158 +#: ../../library/ctypes.rst:2177 ../../library/ctypes.rst:2187 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -3644,7 +3653,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2152 +#: ../../library/ctypes.rst:2181 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -3652,19 +3661,19 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2162 +#: ../../library/ctypes.rst:2191 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2165 ../../library/ctypes.rst:2167 +#: ../../library/ctypes.rst:2194 ../../library/ctypes.rst:2196 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2173 +#: ../../library/ctypes.rst:2202 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 " @@ -3672,25 +3681,25 @@ msgid "" "object that can be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2178 +#: ../../library/ctypes.rst:2207 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:2184 +#: ../../library/ctypes.rst:2213 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:2188 +#: ../../library/ctypes.rst:2217 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2192 +#: ../../library/ctypes.rst:2221 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:" @@ -3698,13 +3707,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2199 +#: ../../library/ctypes.rst:2228 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2204 +#: ../../library/ctypes.rst:2233 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. " @@ -3712,7 +3721,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2217 +#: ../../library/ctypes.rst:2246 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 " @@ -3721,11 +3730,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2223 +#: ../../library/ctypes.rst:2252 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2227 +#: ../../library/ctypes.rst:2256 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 " @@ -3733,7 +3742,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2232 +#: ../../library/ctypes.rst:2261 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -3741,7 +3750,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2238 +#: ../../library/ctypes.rst:2267 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -3751,7 +3760,7 @@ msgid "" "instance." msgstr "" -#: ../../library/ctypes.rst:2246 +#: ../../library/ctypes.rst:2275 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 " @@ -3759,25 +3768,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2251 +#: ../../library/ctypes.rst:2280 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2255 +#: ../../library/ctypes.rst:2284 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:2262 +#: ../../library/ctypes.rst:2291 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:2269 +#: ../../library/ctypes.rst:2298 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 " @@ -3785,182 +3794,182 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2277 +#: ../../library/ctypes.rst:2306 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2283 +#: ../../library/ctypes.rst:2312 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:2289 +#: ../../library/ctypes.rst:2318 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2295 +#: ../../library/ctypes.rst:2324 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:2302 +#: ../../library/ctypes.rst:2331 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2308 +#: ../../library/ctypes.rst:2337 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2314 +#: ../../library/ctypes.rst:2343 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2320 +#: ../../library/ctypes.rst:2349 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2326 +#: ../../library/ctypes.rst:2355 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:2332 +#: ../../library/ctypes.rst:2361 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:2338 +#: ../../library/ctypes.rst:2367 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:2344 +#: ../../library/ctypes.rst:2373 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2349 +#: ../../library/ctypes.rst:2378 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2356 +#: ../../library/ctypes.rst:2385 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2363 +#: ../../library/ctypes.rst:2392 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:2370 +#: ../../library/ctypes.rst:2399 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:2377 +#: ../../library/ctypes.rst:2406 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2383 +#: ../../library/ctypes.rst:2412 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2389 +#: ../../library/ctypes.rst:2418 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2395 +#: ../../library/ctypes.rst:2424 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2401 +#: ../../library/ctypes.rst:2430 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:2407 +#: ../../library/ctypes.rst:2436 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:2413 +#: ../../library/ctypes.rst:2442 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:2419 +#: ../../library/ctypes.rst:2448 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:2425 +#: ../../library/ctypes.rst:2454 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:2432 +#: ../../library/ctypes.rst:2461 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:2439 +#: ../../library/ctypes.rst:2468 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:2446 +#: ../../library/ctypes.rst:2475 msgid "" -"Windows only: Represents a :c:type:`!HRESULT` value, which contains success " -"or error information for a function or method call." +"Represents a :c:type:`!HRESULT` value, which contains success or error " +"information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2452 +#: ../../library/ctypes.rst:2483 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2455 +#: ../../library/ctypes.rst:2486 msgid "" "The :mod:`!ctypes.wintypes` module provides quite some other Windows " "specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" @@ -3968,41 +3977,41 @@ msgid "" "are also defined." msgstr "" -#: ../../library/ctypes.rst:2463 +#: ../../library/ctypes.rst:2494 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2468 +#: ../../library/ctypes.rst:2499 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2473 +#: ../../library/ctypes.rst:2504 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2479 +#: ../../library/ctypes.rst:2510 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2485 +#: ../../library/ctypes.rst:2516 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2490 +#: ../../library/ctypes.rst:2521 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2492 +#: ../../library/ctypes.rst:2523 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:2498 +#: ../../library/ctypes.rst:2529 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2500 +#: ../../library/ctypes.rst:2531 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:" @@ -4010,34 +4019,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2508 +#: ../../library/ctypes.rst:2539 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:2512 +#: ../../library/ctypes.rst:2543 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:2516 +#: ../../library/ctypes.rst:2547 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:2519 +#: ../../library/ctypes.rst:2550 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:2523 +#: ../../library/ctypes.rst:2554 msgid "" "class List(Structure):\n" " pass\n" @@ -4051,7 +4060,7 @@ msgstr "" " ...\n" " ]" -#: ../../library/ctypes.rst:2529 +#: ../../library/ctypes.rst:2560 msgid "" "The :attr:`_fields_` class variable must, however, be defined before the " "type is first used (an instance is created, :func:`sizeof` is called on it, " @@ -4059,14 +4068,14 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2534 +#: ../../library/ctypes.rst:2565 msgid "" "It is possible to define sub-subclasses of structure types, they inherit the " "fields of the base class plus the :attr:`_fields_` defined in the sub-" "subclass, if any." msgstr "" -#: ../../library/ctypes.rst:2541 +#: ../../library/ctypes.rst:2572 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" @@ -4074,21 +4083,21 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2549 +#: ../../library/ctypes.rst:2580 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." msgstr "" -#: ../../library/ctypes.rst:2557 +#: ../../library/ctypes.rst:2588 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2561 +#: ../../library/ctypes.rst:2592 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 " @@ -4096,11 +4105,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2566 +#: ../../library/ctypes.rst:2597 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2568 +#: ../../library/ctypes.rst:2599 msgid "" "class _U(Union):\n" " _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" @@ -4122,7 +4131,7 @@ msgstr "" " _fields_ = [(\"u\", _U),\n" " (\"vt\", VARTYPE)]" -#: ../../library/ctypes.rst:2579 +#: ../../library/ctypes.rst:2610 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 " @@ -4132,7 +4141,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2586 +#: ../../library/ctypes.rst:2617 msgid "" "td = TYPEDESC()\n" "td.vt = VT_PTR\n" @@ -4144,7 +4153,7 @@ msgstr "" "td.lptdesc = POINTER(some_type)\n" "td.u.lptdesc = POINTER(some_type)" -#: ../../library/ctypes.rst:2591 +#: ../../library/ctypes.rst:2622 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:" @@ -4152,7 +4161,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2596 +#: ../../library/ctypes.rst:2627 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -4162,15 +4171,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2607 +#: ../../library/ctypes.rst:2638 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2611 +#: ../../library/ctypes.rst:2642 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2613 +#: ../../library/ctypes.rst:2644 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 " @@ -4180,46 +4189,46 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2623 +#: ../../library/ctypes.rst:2654 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:2630 +#: ../../library/ctypes.rst:2661 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2633 +#: ../../library/ctypes.rst:2664 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2638 +#: ../../library/ctypes.rst:2669 msgid "" "Create an array. Equivalent to ``type * length``, where *type* is a :mod:" "`ctypes` data type and *length* an integer." msgstr "" -#: ../../library/ctypes.rst:2642 +#: ../../library/ctypes.rst:2673 msgid "" "This function is :term:`soft deprecated` in favor of multiplication. There " "are no plans to remove it." msgstr "" -#: ../../library/ctypes.rst:2648 +#: ../../library/ctypes.rst:2679 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2650 +#: ../../library/ctypes.rst:2681 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:2654 +#: ../../library/ctypes.rst:2685 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 :" @@ -4228,11 +4237,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2664 +#: ../../library/ctypes.rst:2695 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2668 +#: ../../library/ctypes.rst:2699 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/distutils.po b/library/distutils.po new file mode 100644 index 0000000000..5705c4cc8a --- /dev/null +++ b/library/distutils.po @@ -0,0 +1,41 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/distutils.rst:2 +msgid ":mod:`!distutils` --- Building and installing Python modules" +msgstr ":mod:`!distutils` --- 建置與安裝 Python 模組" + +#: ../../library/distutils.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being " +"deprecated in Python 3.10. The removal was decided in :pep:`632`, which has " +"`migration advice `_." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.10 中被棄用,並\\ :" +"ref:`已在 Python 3.12 中被移除 `。它的移除是" +"在 :pep:`632` 中決定的,該 PEP 附有\\ `遷移建議 `_。" + +#: ../../library/distutils.rst:16 +msgid "" +"The last version of Python that provided the :mod:`!distutils` module was " +"`Python 3.11 `_." +msgstr "" +"最後提供 :mod:`!distutils` 模組的 Python 版本是 `Python 3.11 `_。" diff --git a/library/imghdr.po b/library/imghdr.po new file mode 100644 index 0000000000..3f80af2be5 --- /dev/null +++ b/library/imghdr.po @@ -0,0 +1,48 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/imghdr.rst:2 +msgid ":mod:`!imghdr` --- Determine the type of an image" +msgstr ":mod:`imghdr` --- 判定圖片種類" + +#: ../../library/imghdr.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/imghdr.rst:14 +msgid "" +"Possible replacements are third-party libraries from PyPI: :pypi:" +"`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`. These are not " +"supported or maintained by the Python core team." +msgstr "" +"可能的替代方案是 PyPI 上的第三方函式庫::pypi:`filetype`、:pypi:`puremagic` " +"或 :pypi:`python-magic`。它們並不受 Python 核心團隊支援或維護。" + +#: ../../library/imghdr.rst:18 +msgid "" +"The last version of Python that provided the :mod:`!imghdr` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!imghdr` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/imp.po b/library/imp.po new file mode 100644 index 0000000000..e90534acb9 --- /dev/null +++ b/library/imp.po @@ -0,0 +1,46 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/imp.rst:2 +msgid ":mod:`!imp` --- Access the import internals" +msgstr ":mod:`!imp` --- 存取引入系統內層" + +#: ../../library/imp.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being deprecated in " +"Python 3.4." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.4 中被棄用,並\\ :" +"ref:`已在 Python 3.12 中被移除 `。" + +#: ../../library/imp.rst:14 +msgid "" +"The :ref:`removal notice ` includes guidance for " +"migrating code from :mod:`!imp` to :mod:`importlib`." +msgstr "" +"其\\ :ref:`移除通知 `\\ 包含了從 :mod:`!imp` 遷移" +"至 :mod:`importlib` 的指引。" + +#: ../../library/imp.rst:17 +msgid "" +"The last version of Python that provided the :mod:`!imp` module was `Python " +"3.11 `_." +msgstr "" +"最後提供 :mod:`!imp` 模組的 Python 版本是 `Python 3.11 `_。" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 19f0cfe625..3f925524cf 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-31 00:13+0000\n" +"POT-Creation-Date: 2024-11-23 00:14+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-" @@ -202,9 +202,9 @@ msgstr "" #: ../../library/importlib.metadata.rst:136 msgid "" -"Also provides a ``.groups`` attribute that reports all identifed entry point " -"groups, and a ``.names`` attribute that reports all identified entry point " -"names." +"Also provides a ``.groups`` attribute that reports all identified entry " +"point groups, and a ``.names`` attribute that reports all identified entry " +"point names." msgstr "" #: ../../library/importlib.metadata.rst:142 diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index 5439f00156..f000c0ec12 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -11,7 +10,8 @@ msgstr "" "POT-Creation-Date: 2024-09-03 11:11+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/library/importlib.resources.po b/library/importlib.resources.po index 01d3b9aa4c..8263a1f83d 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -11,7 +10,8 @@ msgstr "" "POT-Creation-Date: 2024-09-23 07:52+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/importlib.resources.rst:2 msgid "" ":mod:`!importlib.resources` -- Package resource reading, opening and access" -msgstr "" +msgstr ":mod:`!importlib.resources` -- 套件資源的讀取、開啟與存取" #: ../../library/importlib.resources.rst:7 msgid "**Source code:** :source:`Lib/importlib/resources/__init__.py`" @@ -179,6 +179,8 @@ msgid "" "importlib.resources.read_binary(my_module, \"pics/painting.png\")\n" "importlib.resources.read_binary(my_module, \"pics\", \"painting.png\")" 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 msgid "" @@ -192,6 +194,8 @@ msgid "" "importlib.resources.read_text(my_module, \"info\", \"chapter1.txt\",\n" " encoding='utf-8')" msgstr "" +"importlib.resources.read_text(my_module, \"info\", \"chapter1.txt\",\n" +" encoding='utf-8')" #: ../../library/importlib.resources.rst:139 msgid "Open the named resource for binary reading." @@ -224,9 +228,8 @@ msgid "This function is roughly equivalent to::" msgstr "" #: ../../library/importlib.resources.rst:149 -#, fuzzy msgid "files(anchor).joinpath(*path_names).open('rb')" -msgstr "files(package).joinpath(resource).open('rb')" +msgstr "files(anchor).joinpath(*path_names).open('rb')" #: ../../library/importlib.resources.rst:151 #: ../../library/importlib.resources.rst:191 @@ -263,9 +266,8 @@ msgid "" msgstr "" #: ../../library/importlib.resources.rst:173 -#, fuzzy msgid "files(anchor).joinpath(*path_names).open('r', encoding=encoding)" -msgstr "files(package).joinpath(resource).open('r', encoding=encoding)" +msgstr "files(anchor).joinpath(*path_names).open('r', encoding=encoding)" #: ../../library/importlib.resources.rst:175 #: ../../library/importlib.resources.rst:212 @@ -280,9 +282,8 @@ msgid "Read and return the contents of the named resource as :class:`bytes`." msgstr "" #: ../../library/importlib.resources.rst:189 -#, fuzzy msgid "files(anchor).joinpath(*path_names).read_bytes()" -msgstr "files(package).joinpath(resource).read_bytes()" +msgstr "files(anchor).joinpath(*path_names).read_bytes()" #: ../../library/importlib.resources.rst:197 msgid "" @@ -291,9 +292,8 @@ msgid "" msgstr "" #: ../../library/importlib.resources.rst:210 -#, fuzzy msgid "files(anchor).joinpath(*path_names).read_text(encoding=encoding)" -msgstr "files(package).joinpath(resource).read_text(encoding=encoding)" +msgstr "files(anchor).joinpath(*path_names).read_text(encoding=encoding)" #: ../../library/importlib.resources.rst:219 msgid "" @@ -319,11 +319,12 @@ msgid "" "with importlib.resources.path(anchor, \"resource.txt\") as fspath:\n" " result = fspath.stat()" msgstr "" +"with importlib.resources.path(anchor, \"resource.txt\") as fspath:\n" +" result = fspath.stat()" #: ../../library/importlib.resources.rst:237 -#, fuzzy msgid "as_file(files(anchor).joinpath(*path_names))" -msgstr "as_file(files(package).joinpath(resource))" +msgstr "as_file(files(anchor).joinpath(*path_names))" #: ../../library/importlib.resources.rst:246 msgid "" @@ -332,9 +333,8 @@ msgid "" msgstr "" #: ../../library/importlib.resources.rst:254 -#, fuzzy msgid "files(anchor).joinpath(*path_names).is_file()" -msgstr "files(package).joinpath(resource).is_file()" +msgstr "files(anchor).joinpath(*path_names).is_file()" #: ../../library/importlib.resources.rst:262 msgid "" @@ -345,19 +345,15 @@ msgid "" msgstr "" #: ../../library/importlib.resources.rst:272 -#, fuzzy msgid "" "for resource in files(anchor).joinpath(*path_names).iterdir():\n" " yield resource.name" msgstr "" -"(resource.name for resource in files(package).iterdir() if resource." -"is_file())" +"for resource in files(anchor).joinpath(*path_names).iterdir():\n" +" yield resource.name" #: ../../library/importlib.resources.rst:275 msgid "" "Prefer ``iterdir()`` as above, which offers more control over the results " "and richer functionality." msgstr "" - -#~ msgid "Deprecated functions" -#~ msgstr "已棄用函式" diff --git a/library/locale.po b/library/locale.po index 6a5c230140..edd5415af8 100644 --- a/library/locale.po +++ b/library/locale.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. # @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-22 00:13+0000\n" +"POT-Creation-Date: 2024-11-22 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -431,10 +430,12 @@ msgid "" msgstr "" #: ../../library/locale.rst:284 -msgid "Get a string that represents the era used in the current locale." +msgid "" +"Get a string which describes how years are counted and displayed for each " +"era in a locale." msgstr "" -#: ../../library/locale.rst:286 +#: ../../library/locale.rst:287 msgid "" "Most locales do not define this value. An example of a locale which does " "define this value is the Japanese one. In Japan, the traditional " @@ -442,47 +443,48 @@ msgid "" "then-emperor's reign." msgstr "" -#: ../../library/locale.rst:291 +#: ../../library/locale.rst:292 msgid "" "Normally it should not be necessary to use this value directly. Specifying " "the ``E`` modifier in their format strings causes the :func:`time.strftime` " -"function to use this information. The format of the returned string is not " -"specified, and therefore you should not assume knowledge of it on different " -"systems." +"function to use this information. The format of the returned string is " +"specified in *The Open Group Base Specifications Issue 8*, paragraph " +"`7.3.5.2 LC_TIME C-Language Access `_." msgstr "" -#: ../../library/locale.rst:299 +#: ../../library/locale.rst:301 msgid "" "Get a format string for :func:`time.strftime` to represent date and time in " "a locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:304 +#: ../../library/locale.rst:306 msgid "" "Get a format string for :func:`time.strftime` to represent a date in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:309 +#: ../../library/locale.rst:311 msgid "" "Get a format string for :func:`time.strftime` to represent a time in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:314 +#: ../../library/locale.rst:316 msgid "" "Get a string consisting of up to 100 semicolon-separated symbols used to " "represent the values 0 to 99 in a locale-specific way. In most locales this " "is an empty string." msgstr "" -#: ../../library/locale.rst:321 +#: ../../library/locale.rst:323 msgid "" "Tries to determine the default locale settings and returns them as a tuple " "of the form ``(language code, encoding)``." msgstr "" -#: ../../library/locale.rst:324 +#: ../../library/locale.rst:326 msgid "" "According to POSIX, a program which has not called ``setlocale(LC_ALL, '')`` " "runs using the portable ``'C'`` locale. Calling ``setlocale(LC_ALL, '')`` " @@ -491,7 +493,7 @@ msgid "" "emulate the behavior in the way described above." msgstr "" -#: ../../library/locale.rst:330 +#: ../../library/locale.rst:332 msgid "" "To maintain compatibility with other platforms, not only the :envvar:`LANG` " "variable is tested, but a list of variables given as envvars parameter. The " @@ -501,21 +503,21 @@ msgid "" "``'LC_CTYPE'``, ``'LANG'`` and ``'LANGUAGE'``, in that order." msgstr "" -#: ../../library/locale.rst:337 ../../library/locale.rst:350 +#: ../../library/locale.rst:339 ../../library/locale.rst:352 msgid "" "Except for the code ``'C'``, the language code corresponds to :rfc:`1766`. " "*language code* and *encoding* may be ``None`` if their values cannot be " "determined." msgstr "" -#: ../../library/locale.rst:346 +#: ../../library/locale.rst:348 msgid "" "Returns the current setting for the given locale category as sequence " "containing *language code*, *encoding*. *category* may be one of the :const:" "`!LC_\\*` values except :const:`LC_ALL`. It defaults to :const:`LC_CTYPE`." msgstr "" -#: ../../library/locale.rst:357 +#: ../../library/locale.rst:359 msgid "" "Return the :term:`locale encoding` used for text data, according to user " "preferences. User preferences are expressed differently on different " @@ -523,72 +525,72 @@ msgid "" "this function only returns a guess." msgstr "" -#: ../../library/locale.rst:362 +#: ../../library/locale.rst:364 msgid "" "On some systems, it is necessary to invoke :func:`setlocale` to obtain the " "user preferences, so this function is not thread-safe. If invoking setlocale " "is not necessary or desired, *do_setlocale* should be set to ``False``." msgstr "" -#: ../../library/locale.rst:366 +#: ../../library/locale.rst:368 msgid "" "On Android or if the :ref:`Python UTF-8 Mode ` is enabled, always " "return ``'utf-8'``, the :term:`locale encoding` and the *do_setlocale* " "argument are ignored." msgstr "" -#: ../../library/locale.rst:370 ../../library/locale.rst:388 +#: ../../library/locale.rst:372 ../../library/locale.rst:390 msgid "" "The :ref:`Python preinitialization ` configures the LC_CTYPE " "locale. See also the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../library/locale.rst:373 +#: ../../library/locale.rst:375 msgid "" "The function now always returns ``\"utf-8\"`` on Android or if the :ref:" "`Python UTF-8 Mode ` is enabled." msgstr "" -#: ../../library/locale.rst:380 +#: ../../library/locale.rst:382 msgid "Get the current :term:`locale encoding`:" msgstr "" -#: ../../library/locale.rst:382 +#: ../../library/locale.rst:384 msgid "On Android and VxWorks, return ``\"utf-8\"``." msgstr "" -#: ../../library/locale.rst:383 +#: ../../library/locale.rst:385 msgid "" "On Unix, return the encoding of the current :data:`LC_CTYPE` locale. Return " "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string: for " "example, if the current LC_CTYPE locale is not supported." msgstr "" -#: ../../library/locale.rst:386 +#: ../../library/locale.rst:388 msgid "On Windows, return the ANSI code page." msgstr "" -#: ../../library/locale.rst:391 +#: ../../library/locale.rst:393 msgid "" "This function is similar to :func:`getpreferredencoding(False) " "` except this function ignores the :ref:`Python UTF-8 " "Mode `." msgstr "" -#: ../../library/locale.rst:400 +#: ../../library/locale.rst:402 msgid "" "Returns a normalized locale code for the given locale name. The returned " "locale code is formatted for use with :func:`setlocale`. If normalization " "fails, the original name is returned unchanged." msgstr "" -#: ../../library/locale.rst:404 +#: ../../library/locale.rst:406 msgid "" "If the given encoding is not known, the function defaults to the default " "encoding for the locale code just like :func:`setlocale`." msgstr "" -#: ../../library/locale.rst:410 +#: ../../library/locale.rst:412 msgid "" "Compares two strings according to the current :const:`LC_COLLATE` setting. " "As any other compare function, returns a negative, or a positive value, or " @@ -596,7 +598,7 @@ msgid "" "is equal to it." msgstr "" -#: ../../library/locale.rst:418 +#: ../../library/locale.rst:420 msgid "" "Transforms a string to one that can be used in locale-aware comparisons. " "For example, ``strxfrm(s1) < strxfrm(s2)`` is equivalent to ``strcoll(s1, " @@ -604,7 +606,7 @@ msgid "" "repeatedly, e.g. when collating a sequence of strings." msgstr "" -#: ../../library/locale.rst:427 +#: ../../library/locale.rst:429 msgid "" "Formats a number *val* according to the current :const:`LC_NUMERIC` setting. " "The format follows the conventions of the ``%`` operator. For floating-" @@ -612,29 +614,29 @@ msgid "" "is ``True``, also takes the grouping into account." msgstr "" -#: ../../library/locale.rst:432 +#: ../../library/locale.rst:434 msgid "" "If *monetary* is true, the conversion uses monetary thousands separator and " "grouping strings." msgstr "" -#: ../../library/locale.rst:435 +#: ../../library/locale.rst:437 msgid "" "Processes formatting specifiers as in ``format % val``, but takes the " "current locale settings into account." msgstr "" -#: ../../library/locale.rst:438 +#: ../../library/locale.rst:440 msgid "The *monetary* keyword parameter was added." msgstr "" -#: ../../library/locale.rst:444 +#: ../../library/locale.rst:446 msgid "" "Formats a number *val* according to the current :const:`LC_MONETARY` " "settings." msgstr "" -#: ../../library/locale.rst:446 +#: ../../library/locale.rst:448 msgid "" "The returned string includes the currency symbol if *symbol* is true, which " "is the default. If *grouping* is ``True`` (which is not the default), " @@ -642,43 +644,43 @@ msgid "" "not the default), the international currency symbol is used." msgstr "" -#: ../../library/locale.rst:453 +#: ../../library/locale.rst:455 msgid "" "This function will not work with the 'C' locale, so you have to set a locale " "via :func:`setlocale` first." msgstr "" -#: ../../library/locale.rst:459 +#: ../../library/locale.rst:461 msgid "" "Formats a floating-point number using the same format as the built-in " "function ``str(float)``, but takes the decimal point into account." msgstr "" -#: ../../library/locale.rst:465 +#: ../../library/locale.rst:467 msgid "" "Converts a string into a normalized number string, following the :const:" "`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:473 +#: ../../library/locale.rst:475 msgid "" "Converts a normalized number string into a formatted string following the :" "const:`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:481 +#: ../../library/locale.rst:483 msgid "" "Converts a string to a number, following the :const:`LC_NUMERIC` settings, " "by calling *func* on the result of calling :func:`delocalize` on *string*." msgstr "" -#: ../../library/locale.rst:487 +#: ../../library/locale.rst:489 msgid "" "Converts a string to an integer, following the :const:`LC_NUMERIC` " "conventions." msgstr "" -#: ../../library/locale.rst:492 +#: ../../library/locale.rst:494 msgid "" "Locale category for the character type functions. Most importantly, this " "category defines the text encoding, i.e. how bytes are interpreted as " @@ -688,32 +690,32 @@ msgid "" "SSH connections." msgstr "" -#: ../../library/locale.rst:499 +#: ../../library/locale.rst:501 msgid "" "Python doesn't internally use locale-dependent character transformation " "functions from ``ctype.h``. Instead, an internal ``pyctype.h`` provides " "locale-independent equivalents like :c:macro:`!Py_TOLOWER`." msgstr "" -#: ../../library/locale.rst:506 +#: ../../library/locale.rst:508 msgid "" "Locale category for sorting strings. The functions :func:`strcoll` and :" "func:`strxfrm` of the :mod:`locale` module are affected." msgstr "" -#: ../../library/locale.rst:512 +#: ../../library/locale.rst:514 msgid "" "Locale category for the formatting of time. The function :func:`time." "strftime` follows these conventions." msgstr "" -#: ../../library/locale.rst:518 +#: ../../library/locale.rst:520 msgid "" "Locale category for formatting of monetary values. The available options " "are available from the :func:`localeconv` function." msgstr "" -#: ../../library/locale.rst:524 +#: ../../library/locale.rst:526 msgid "" "Locale category for message display. Python currently does not support " "application specific locale-aware messages. Messages displayed by the " @@ -721,13 +723,13 @@ msgid "" "affected by this category." msgstr "" -#: ../../library/locale.rst:529 +#: ../../library/locale.rst:531 msgid "" "This value may not be available on operating systems not conforming to the " "POSIX standard, most notably Windows." msgstr "" -#: ../../library/locale.rst:535 +#: ../../library/locale.rst:537 msgid "" "Locale category for formatting numbers. The functions :func:" "`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:" @@ -735,7 +737,7 @@ msgid "" "operations are not affected." msgstr "" -#: ../../library/locale.rst:543 +#: ../../library/locale.rst:545 msgid "" "Combination of all locale settings. If this flag is used when the locale is " "changed, setting the locale for all categories is attempted. If that fails " @@ -745,17 +747,17 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:552 +#: ../../library/locale.rst:554 msgid "" "This is a symbolic constant used for different values returned by :func:" "`localeconv`." msgstr "" -#: ../../library/locale.rst:556 +#: ../../library/locale.rst:558 msgid "Example::" msgstr "範例: ::" -#: ../../library/locale.rst:558 +#: ../../library/locale.rst:560 msgid "" ">>> import locale\n" ">>> loc = locale.getlocale() # get current locale\n" @@ -768,11 +770,11 @@ msgid "" ">>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale" msgstr "" -#: ../../library/locale.rst:569 +#: ../../library/locale.rst:571 msgid "Background, details, hints, tips and caveats" msgstr "" -#: ../../library/locale.rst:571 +#: ../../library/locale.rst:573 msgid "" "The C standard defines the locale as a program-wide property that may be " "relatively expensive to change. On top of that, some implementations are " @@ -780,7 +782,7 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: ../../library/locale.rst:576 +#: ../../library/locale.rst:578 msgid "" "Initially, when a program is started, the locale is the ``C`` locale, no " "matter what the user's preferred locale is. There is one exception: the :" @@ -790,7 +792,7 @@ msgid "" "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: ../../library/locale.rst:583 +#: ../../library/locale.rst:585 msgid "" "It is generally a bad idea to call :func:`setlocale` in some library " "routine, since as a side effect it affects the entire program. Saving and " @@ -798,7 +800,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: ../../library/locale.rst:588 +#: ../../library/locale.rst:590 msgid "" "If, when coding a module for general use, you need a locale independent " "version of an operation that is affected by the locale (such as certain " @@ -809,14 +811,14 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:595 +#: ../../library/locale.rst:597 msgid "" "The only way to perform numeric operations according to the locale is to use " "the special functions defined by this module: :func:`atof`, :func:`atoi`, :" "func:`format_string`, :func:`.str`." msgstr "" -#: ../../library/locale.rst:599 +#: ../../library/locale.rst:601 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -827,11 +829,11 @@ msgid "" "whitespace." msgstr "" -#: ../../library/locale.rst:610 +#: ../../library/locale.rst:612 msgid "For extension writers and programs that embed Python" msgstr "" -#: ../../library/locale.rst:612 +#: ../../library/locale.rst:614 msgid "" "Extension modules should never call :func:`setlocale`, except to find out " "what the current locale is. But since the return value can only be used " @@ -839,7 +841,7 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: ../../library/locale.rst:617 +#: ../../library/locale.rst:619 msgid "" "When Python code uses the :mod:`locale` module to change the locale, this " "also affects the embedding application. If the embedding application " @@ -849,11 +851,11 @@ msgid "" "accessible as a shared library." msgstr "" -#: ../../library/locale.rst:628 +#: ../../library/locale.rst:630 msgid "Access to message catalogs" msgstr "" -#: ../../library/locale.rst:637 +#: ../../library/locale.rst:639 msgid "" "The locale module exposes the C library's gettext interface on systems that " "provide this interface. It consists of the functions :func:`gettext`, :func:" @@ -864,7 +866,7 @@ msgid "" "locating message catalogs." msgstr "" -#: ../../library/locale.rst:644 +#: ../../library/locale.rst:646 msgid "" "Python applications should normally find no need to invoke these functions, " "and should use :mod:`gettext` instead. A known exception to this rule are " diff --git a/library/mailcap.po b/library/mailcap.po new file mode 100644 index 0000000000..cfbe289d7a --- /dev/null +++ b/library/mailcap.po @@ -0,0 +1,39 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/mailcap.rst:2 +msgid ":mod:`!mailcap` --- Mailcap file handling" +msgstr ":mod:`!mailcap` --- Mailcap 檔案處理" + +#: ../../library/mailcap.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/mailcap.rst:14 +msgid "" +"The last version of Python that provided the :mod:`!mailcap` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!mailcap` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/marshal.po b/library/marshal.po index 472d892438..03ab684ed4 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -73,7 +73,6 @@ msgstr "" "unmarshal 來自不受信任的或來源未經驗證的資料。" #: ../../library/marshal.rst:43 -#, fuzzy msgid "" "Not all Python object types are supported; in general, only objects whose " "value is independent from a particular invocation of Python can be written " @@ -91,11 +90,11 @@ msgstr "" "特定 Python 調用 (invocation) 的物件。下列型別是有支援的:布林 (boolean)、整" "數、浮點數 (floating-point number)、複數、字串、位元組串 (bytes)、位元組陣列 " "(bytearray)、元組 (tuple)、list、集合 (set)、凍結集合 (frozenset)、" -"dictionary 和程式碼物件,需要了解的一點是元組、list、集合、凍結集合和 " -"dictionary 只在其所包含的值也屬於這些型別時才會支援。單例 (singleton) 物件 :" -"const:`None`、:const:`Ellipsis` 和 :exc:`StopIteration` 也可以被 marshal 和 " -"unmarshal。對於 *version* 低於 3 的格式,遞迴 list、集合和 dictionary 無法被" -"寫入(見下文)。" +"dictionary 和程式碼物件(如 *allow_code* 為 true),需要了解的一點是元組、" +"list、集合、凍結集合和 dictionary 只在其所包含的值也屬於這些型別時才會支援。" +"單例 (singleton) 物件 :const:`None`、:const:`Ellipsis` 和 :exc:" +"`StopIteration` 也可以被 marshal 和 unmarshal。對於 *version* 低於 3 的格式," +"遞迴 list、集合和 dictionary 無法被寫入(見下文)。" #: ../../library/marshal.rst:56 msgid "" @@ -117,7 +116,6 @@ msgstr "" "file`。" #: ../../library/marshal.rst:67 -#, fuzzy msgid "" "If the value has (or contains an object that has) an unsupported type, a :" "exc:`ValueError` exception is raised --- but garbage data will also be " @@ -127,7 +125,8 @@ msgid "" msgstr "" "如果值具有(或其所包含的物件具有)不支援的型別,則會引發 :exc:`ValueError` 例" "外 --- 但是垃圾資料 (garbage data) 也將寫入檔案,物件也無法正確地透過 :func:" -"`load` 重新讀取。" +"`load` 重新讀取。:ref:`程式碼物件 `\\ 只有在 *allow_code* 為 " +"true 時才會支援。" #: ../../library/marshal.rst:72 msgid "" @@ -146,10 +145,9 @@ msgstr "" #: ../../library/marshal.rst:77 ../../library/marshal.rst:101 #: ../../library/marshal.rst:117 ../../library/marshal.rst:135 msgid "Added the *allow_code* parameter." -msgstr "" +msgstr "新增 *allow_code* 參數。" #: ../../library/marshal.rst:83 -#, fuzzy msgid "" "Read one value from the open file and return it. If no valid value is read " "(e.g. because the data has a different Python version's incompatible marshal " @@ -159,7 +157,8 @@ msgid "" msgstr "" "從開啟的檔案讀取一個值並回傳。如果讀不到有效的值(例如,由於資料為不同 " "Python 版本的不相容 marshal 格式),則會引發 :exc:`EOFError`、:exc:" -"`ValueError` 或 :exc:`TypeError`。檔案必須為可讀取的 :term:`binary file`。" +"`ValueError` 或 :exc:`TypeError`。:ref:`程式碼物件 `\\ 只有在 " +"*allow_code* 為 true 時才會支援。檔案必須為可讀取的 :term:`binary file`。" #: ../../library/marshal.rst:89 msgid "" @@ -184,7 +183,6 @@ msgstr "" "載入操作引發單個 ``marshal.load`` 事件。" #: ../../library/marshal.rst:107 -#, fuzzy msgid "" "Return the bytes object that would be written to a file by ``dump(value, " "file)``. The value must be a supported type. Raise a :exc:`ValueError` " @@ -194,7 +192,8 @@ msgid "" msgstr "" "回傳將透過 ``dump(value, file)`` 來被寫入一個檔案的位元組串物件,其值必須是有" "支援的型別,如果值(或其包含的任一物件)為不支援的型別則會引發 :exc:" -"`ValueError`。" +"`ValueError`。:ref:`程式碼物件 `\\ 只有在 *allow_code* 為 true " +"時才會支援。" #: ../../library/marshal.rst:112 msgid "" @@ -203,7 +202,6 @@ msgid "" msgstr "*version* 引數指明 ``dumps`` 應當使用的資料型別(見下文)。" #: ../../library/marshal.rst:123 -#, fuzzy msgid "" "Convert the :term:`bytes-like object` to a value. If no valid value is " "found, raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. :ref:" @@ -211,8 +209,9 @@ msgid "" "Extra bytes in the input are ignored." msgstr "" "將 :term:`bytes-like object` 轉換為一個值。如果找不到有效的值,則會引發 :exc:" -"`EOFError`、:exc:`ValueError` 或 :exc:`TypeError`。輸入中額外的位元組串會被忽" -"略。" +"`EOFError`、:exc:`ValueError` 或 :exc:`TypeError`。:ref:`程式碼物件 `\\ 只有在 *allow_code* 為 true 時才會支援。輸入中額外的位元組串會被" +"忽略。" #: ../../library/marshal.rst:128 msgid "" diff --git a/library/math.po b/library/math.po index 84d6d52e0d..8280532b1a 100644 --- a/library/math.po +++ b/library/math.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-05 00:13+0000\n" +"POT-Creation-Date: 2024-11-20 00:14+0000\n" "PO-Revision-Date: 2024-04-26 15:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,566 +51,568 @@ msgid "" msgstr "此模組提供下列函式。除非特意註明,否則回傳值皆為浮點數。" #: ../../library/math.rst:30 -msgid "**Number-theoretic and representation functions**" -msgstr "**數論與表現函式**" +msgid "**Number-theoretic functions**" +msgstr "**數論函式**" #: ../../library/math.rst:32 -msgid ":func:`ceil(x) `" -msgstr ":func:`ceil(x) `" - -#: ../../library/math.rst:32 -msgid "Ceiling of *x*, the smallest integer greater than or equal to *x*" -msgstr "" - -#: ../../library/math.rst:33 msgid ":func:`comb(n, k) `" msgstr ":func:`comb(n, k) `" -#: ../../library/math.rst:33 +#: ../../library/math.rst:32 msgid "" "Number of ways to choose *k* items from *n* items without repetition and " "without order" msgstr "從 *n* 個物品中不重複且不考慮排序地取出 *k* 個物品的方法數。" +#: ../../library/math.rst:33 +msgid ":func:`factorial(n) `" +msgstr ":func:`factorial(n) `" + +#: ../../library/math.rst:33 +msgid "*n* factorial" +msgstr "" + #: ../../library/math.rst:34 -msgid ":func:`copysign(x, y) `" -msgstr ":func:`copysign(x, y) `" +msgid ":func:`gcd(*integers) `" +msgstr ":func:`gcd(*integers) `" #: ../../library/math.rst:34 -msgid "Magnitude (absolute value) of *x* with the sign of *y*" +msgid "Greatest common divisor of the integer arguments" msgstr "" #: ../../library/math.rst:35 -msgid ":func:`fabs(x) `" -msgstr ":func:`fabs(x) `" +msgid ":func:`isqrt(n) `" +msgstr ":func:`isqrt(n) `" #: ../../library/math.rst:35 -msgid "Absolute value of *x*" -msgstr "*x* 的絕對值。" +msgid "Integer square root of a nonnegative integer *n*" +msgstr "" #: ../../library/math.rst:36 -msgid ":func:`factorial(n) `" -msgstr ":func:`factorial(n) `" +msgid ":func:`lcm(*integers) `" +msgstr ":func:`lcm(*integers) `" #: ../../library/math.rst:36 -msgid "*n* factorial" +msgid "Least common multiple of the integer arguments" msgstr "" #: ../../library/math.rst:37 -msgid ":func:`floor (x) `" -msgstr ":func:`floor (x) `" +msgid ":func:`perm(n, k) `" +msgstr ":func:`perm(n, k) `" #: ../../library/math.rst:37 -msgid "Floor of *x*, the largest integer less than or equal to *x*" -msgstr "" - -#: ../../library/math.rst:38 -msgid ":func:`fma(x, y, z) `" -msgstr ":func:`fma(x, y, z) `" - -#: ../../library/math.rst:38 -msgid "Fused multiply-add operation: ``(x * y) + z``" -msgstr "" - -#: ../../library/math.rst:39 -msgid ":func:`fmod(x, y) `" -msgstr ":func:`fmod(x, y) `" +msgid "" +"Number of ways to choose *k* items from *n* items without repetition and " +"with order" +msgstr "從 *n* 個物品中不重複但考慮排序地取出 *k* 個物品的方法數。" #: ../../library/math.rst:39 -msgid "Remainder of division ``x / y``" -msgstr "" - -#: ../../library/math.rst:40 -msgid ":func:`frexp(x) `" -msgstr ":func:`frexp(x) `" - -#: ../../library/math.rst:40 -msgid "Mantissa and exponent of *x*" +msgid "**Floating point arithmetic**" msgstr "" #: ../../library/math.rst:41 -msgid ":func:`fsum(iterable) `" -msgstr ":func:`fsum(iterable) `" +msgid ":func:`ceil(x) `" +msgstr ":func:`ceil(x) `" #: ../../library/math.rst:41 -msgid "Sum of values in the input *iterable*" +msgid "Ceiling of *x*, the smallest integer greater than or equal to *x*" msgstr "" #: ../../library/math.rst:42 -msgid ":func:`gcd(*integers) `" -msgstr ":func:`gcd(*integers) `" +msgid ":func:`fabs(x) `" +msgstr ":func:`fabs(x) `" #: ../../library/math.rst:42 -msgid "Greatest common divisor of the integer arguments" -msgstr "" +msgid "Absolute value of *x*" +msgstr "*x* 的絕對值。" #: ../../library/math.rst:43 -msgid ":func:`isclose(a, b, rel_tol, abs_tol) `" -msgstr ":func:`isclose(a, b, rel_tol, abs_tol) `" +msgid ":func:`floor(x) `" +msgstr ":func:`floor(x) `" #: ../../library/math.rst:43 -msgid "Check if the values *a* and *b* are close to each other" +msgid "Floor of *x*, the largest integer less than or equal to *x*" msgstr "" #: ../../library/math.rst:44 -msgid ":func:`isfinite(x) `" -msgstr ":func:`isfinite(x) `" +msgid ":func:`fma(x, y, z) `" +msgstr ":func:`fma(x, y, z) `" #: ../../library/math.rst:44 -msgid "Check if *x* is neither an infinity nor a NaN" +msgid "Fused multiply-add operation: ``(x * y) + z``" msgstr "" #: ../../library/math.rst:45 -msgid ":func:`isinf(x) `" -msgstr ":func:`isinf(x) `" +msgid ":func:`fmod(x, y) `" +msgstr ":func:`fmod(x, y) `" #: ../../library/math.rst:45 -msgid "Check if *x* is a positive or negative infinity" +msgid "Remainder of division ``x / y``" msgstr "" #: ../../library/math.rst:46 -msgid ":func:`isnan(x) `" -msgstr ":func:`isnan(x) `" +msgid ":func:`modf(x) `" +msgstr ":func:`modf(x) `" #: ../../library/math.rst:46 -msgid "Check if *x* is a NaN (not a number)" +msgid "Fractional and integer parts of *x*" msgstr "" #: ../../library/math.rst:47 -msgid ":func:`isqrt(n) `" -msgstr ":func:`isqrt(n) `" +msgid ":func:`remainder(x, y) `" +msgstr ":func:`remainder(x, y) `" #: ../../library/math.rst:47 -msgid "Integer square root of a nonnegative integer *n*" +msgid "Remainder of *x* with respect to *y*" msgstr "" #: ../../library/math.rst:48 -msgid ":func:`lcm(*integers) `" -msgstr ":func:`lcm(*integers) `" +msgid ":func:`trunc(x) `" +msgstr ":func:`trunc(x) `" #: ../../library/math.rst:48 -msgid "Least common multiple of the integer arguments" -msgstr "" - -#: ../../library/math.rst:49 -msgid ":func:`ldexp(x, i) `" -msgstr ":func:`ldexp(x, i) `" - -#: ../../library/math.rst:49 -msgid "``x * (2**i)``, inverse of function :func:`frexp`" +msgid "Integer part of *x*" msgstr "" #: ../../library/math.rst:50 -msgid ":func:`modf(x) `" -msgstr ":func:`modf(x) `" - -#: ../../library/math.rst:50 -msgid "Fractional and integer parts of *x*" -msgstr "" - -#: ../../library/math.rst:51 -msgid ":func:`nextafter(x, y, steps) `" -msgstr ":func:`nextafter(x, y, steps) `" - -#: ../../library/math.rst:51 -msgid "Floating-point value *steps* steps after *x* towards *y*" -msgstr "" +msgid "**Floating point manipulation functions**" +msgstr "**浮點數操作函式**" #: ../../library/math.rst:52 -msgid ":func:`perm(n, k) `" -msgstr ":func:`perm(n, k) `" +msgid ":func:`copysign(x, y) `" +msgstr ":func:`copysign(x, y) `" #: ../../library/math.rst:52 -msgid "" -"Number of ways to choose *k* items from *n* items without repetition and " -"with order" -msgstr "從 *n* 個物品中不重複但考慮排序地取出 *k* 個物品的方法數。" +msgid "Magnitude (absolute value) of *x* with the sign of *y*" +msgstr "" #: ../../library/math.rst:53 -msgid ":func:`prod(iterable, start) `" -msgstr ":func:`prod(iterable, start) `" +msgid ":func:`frexp(x) `" +msgstr ":func:`frexp(x) `" #: ../../library/math.rst:53 -msgid "Product of elements in the input *iterable* with a *start* value" +msgid "Mantissa and exponent of *x*" msgstr "" #: ../../library/math.rst:54 -msgid ":func:`remainder(x, y) `" -msgstr ":func:`remainder(x, y) `" +msgid ":func:`isclose(a, b, rel_tol, abs_tol) `" +msgstr ":func:`isclose(a, b, rel_tol, abs_tol) `" #: ../../library/math.rst:54 -msgid "Remainder of *x* with respect to *y*" +msgid "Check if the values *a* and *b* are close to each other" msgstr "" #: ../../library/math.rst:55 -msgid ":func:`sumprod(p, q) `" -msgstr ":func:`sumprod(p, q) `" +msgid ":func:`isfinite(x) `" +msgstr ":func:`isfinite(x) `" #: ../../library/math.rst:55 -msgid "Sum of products from two iterables *p* and *q*" +msgid "Check if *x* is neither an infinity nor a NaN" msgstr "" #: ../../library/math.rst:56 -msgid ":func:`trunc(x) `" -msgstr ":func:`trunc(x) `" +msgid ":func:`isinf(x) `" +msgstr ":func:`isinf(x) `" #: ../../library/math.rst:56 -msgid "Integer part of *x*" +msgid "Check if *x* is a positive or negative infinity" msgstr "" #: ../../library/math.rst:57 +msgid ":func:`isnan(x) `" +msgstr ":func:`isnan(x) `" + +#: ../../library/math.rst:57 +msgid "Check if *x* is a NaN (not a number)" +msgstr "" + +#: ../../library/math.rst:58 +msgid ":func:`ldexp(x, i) `" +msgstr ":func:`ldexp(x, i) `" + +#: ../../library/math.rst:58 +msgid "``x * (2**i)``, inverse of function :func:`frexp`" +msgstr "" + +#: ../../library/math.rst:59 +msgid ":func:`nextafter(x, y, steps) `" +msgstr ":func:`nextafter(x, y, steps) `" + +#: ../../library/math.rst:59 +msgid "Floating-point value *steps* steps after *x* towards *y*" +msgstr "" + +#: ../../library/math.rst:60 msgid ":func:`ulp(x) `" msgstr ":func:`ulp(x) `" -#: ../../library/math.rst:57 +#: ../../library/math.rst:60 msgid "Value of the least significant bit of *x*" msgstr "" -#: ../../library/math.rst:59 -msgid "**Power and logarithmic functions**" +#: ../../library/math.rst:62 +msgid "**Power, exponential and logarithmic functions**" msgstr "" -#: ../../library/math.rst:61 +#: ../../library/math.rst:64 msgid ":func:`cbrt(x) `" msgstr ":func:`cbrt(x) `" -#: ../../library/math.rst:61 +#: ../../library/math.rst:64 msgid "Cube root of *x*" msgstr "" -#: ../../library/math.rst:62 +#: ../../library/math.rst:65 msgid ":func:`exp(x) `" msgstr ":func:`exp(x) `" -#: ../../library/math.rst:62 +#: ../../library/math.rst:65 msgid "*e* raised to the power *x*" msgstr "" -#: ../../library/math.rst:63 +#: ../../library/math.rst:66 msgid ":func:`exp2(x) `" msgstr ":func:`exp2(x) `" -#: ../../library/math.rst:63 +#: ../../library/math.rst:66 msgid "*2* raised to the power *x*" msgstr "" -#: ../../library/math.rst:64 +#: ../../library/math.rst:67 msgid ":func:`expm1(x) `" msgstr ":func:`expm1(x) `" -#: ../../library/math.rst:64 +#: ../../library/math.rst:67 msgid "*e* raised to the power *x*, minus 1" msgstr "" -#: ../../library/math.rst:65 +#: ../../library/math.rst:68 msgid ":func:`log(x, base) `" msgstr ":func:`log(x, base) `" -#: ../../library/math.rst:65 +#: ../../library/math.rst:68 msgid "Logarithm of *x* to the given base (*e* by default)" msgstr "" -#: ../../library/math.rst:66 +#: ../../library/math.rst:69 msgid ":func:`log1p(x) `" msgstr ":func:`log1p(x) `" -#: ../../library/math.rst:66 +#: ../../library/math.rst:69 msgid "Natural logarithm of *1+x* (base *e*)" msgstr "" -#: ../../library/math.rst:67 +#: ../../library/math.rst:70 msgid ":func:`log2(x) `" msgstr ":func:`log2(x) `" -#: ../../library/math.rst:67 +#: ../../library/math.rst:70 msgid "Base-2 logarithm of *x*" msgstr "" -#: ../../library/math.rst:68 +#: ../../library/math.rst:71 msgid ":func:`log10(x) `" msgstr ":func:`log10(x) `" -#: ../../library/math.rst:68 +#: ../../library/math.rst:71 msgid "Base-10 logarithm of *x*" msgstr "" -#: ../../library/math.rst:69 +#: ../../library/math.rst:72 msgid ":func:`pow(x, y) `" msgstr ":func:`pow(x, y) `" -#: ../../library/math.rst:69 +#: ../../library/math.rst:72 msgid "*x* raised to the power *y*" msgstr "" -#: ../../library/math.rst:70 +#: ../../library/math.rst:73 msgid ":func:`sqrt(x) `" msgstr ":func:`sqrt(x) `" -#: ../../library/math.rst:70 +#: ../../library/math.rst:73 msgid "Square root of *x*" msgstr "*x* 的平方根" -#: ../../library/math.rst:72 +#: ../../library/math.rst:75 +msgid "**Summation and product functions**" +msgstr "" + +#: ../../library/math.rst:77 +msgid ":func:`dist(p, q) `" +msgstr ":func:`dist(p, q) `" + +#: ../../library/math.rst:77 +msgid "" +"Euclidean distance between two points *p* and *q* given as an iterable of " +"coordinates" +msgstr "" + +#: ../../library/math.rst:78 +msgid ":func:`fsum(iterable) `" +msgstr ":func:`fsum(iterable) `" + +#: ../../library/math.rst:78 +msgid "Sum of values in the input *iterable*" +msgstr "" + +#: ../../library/math.rst:79 +msgid ":func:`hypot(*coordinates) `" +msgstr ":func:`hypot(*coordinates) `" + +#: ../../library/math.rst:79 +msgid "Euclidean norm of an iterable of coordinates" +msgstr "" + +#: ../../library/math.rst:80 +msgid ":func:`prod(iterable, start) `" +msgstr ":func:`prod(iterable, start) `" + +#: ../../library/math.rst:80 +msgid "Product of elements in the input *iterable* with a *start* value" +msgstr "" + +#: ../../library/math.rst:81 +msgid ":func:`sumprod(p, q) `" +msgstr ":func:`sumprod(p, q) `" + +#: ../../library/math.rst:81 +msgid "Sum of products from two iterables *p* and *q*" +msgstr "" + +#: ../../library/math.rst:83 +msgid "**Angular conversion**" +msgstr "" + +#: ../../library/math.rst:85 +msgid ":func:`degrees(x) `" +msgstr ":func:`degrees(x) `" + +#: ../../library/math.rst:85 +msgid "Convert angle *x* from radians to degrees" +msgstr "" + +#: ../../library/math.rst:86 +msgid ":func:`radians(x) `" +msgstr ":func:`radians(x) `" + +#: ../../library/math.rst:86 +msgid "Convert angle *x* from degrees to radians" +msgstr "" + +#: ../../library/math.rst:88 msgid "**Trigonometric functions**" msgstr "" -#: ../../library/math.rst:74 +#: ../../library/math.rst:90 msgid ":func:`acos(x) `" msgstr ":func:`acos(x) `" -#: ../../library/math.rst:74 +#: ../../library/math.rst:90 msgid "Arc cosine of *x*" msgstr "" -#: ../../library/math.rst:75 +#: ../../library/math.rst:91 msgid ":func:`asin(x) `" msgstr ":func:`asin(x) `" -#: ../../library/math.rst:75 +#: ../../library/math.rst:91 msgid "Arc sine of *x*" msgstr "" -#: ../../library/math.rst:76 +#: ../../library/math.rst:92 msgid ":func:`atan(x) `" msgstr ":func:`atan(x) `" -#: ../../library/math.rst:76 +#: ../../library/math.rst:92 msgid "Arc tangent of *x*" msgstr "" -#: ../../library/math.rst:77 +#: ../../library/math.rst:93 msgid ":func:`atan2(y, x) `" msgstr ":func:`atan2(y, x) `" -#: ../../library/math.rst:77 +#: ../../library/math.rst:93 msgid "``atan(y / x)``" msgstr "``atan(y / x)``" -#: ../../library/math.rst:78 +#: ../../library/math.rst:94 msgid ":func:`cos(x) `" msgstr ":func:`cos(x) `" -#: ../../library/math.rst:78 +#: ../../library/math.rst:94 msgid "Cosine of *x*" msgstr "" -#: ../../library/math.rst:79 -msgid ":func:`dist(p, q) `" -msgstr ":func:`dist(p, q) `" - -#: ../../library/math.rst:79 -msgid "" -"Euclidean distance between two points *p* and *q* given as an iterable of " -"coordinates" -msgstr "" - -#: ../../library/math.rst:80 -msgid ":func:`hypot(*coordinates) `" -msgstr ":func:`hypot(*coordinates) `" - -#: ../../library/math.rst:80 -msgid "Euclidean norm of an iterable of coordinates" -msgstr "" - -#: ../../library/math.rst:81 +#: ../../library/math.rst:95 msgid ":func:`sin(x) `" msgstr ":func:`sin(x) `" -#: ../../library/math.rst:81 +#: ../../library/math.rst:95 msgid "Sine of *x*" msgstr "" -#: ../../library/math.rst:82 +#: ../../library/math.rst:96 msgid ":func:`tan(x) `" msgstr ":func:`tan(x) `" -#: ../../library/math.rst:82 +#: ../../library/math.rst:96 msgid "Tangent of *x*" msgstr "" -#: ../../library/math.rst:84 -msgid "**Angular conversion**" -msgstr "" - -#: ../../library/math.rst:86 -msgid ":func:`degrees(x) `" -msgstr ":func:`degrees(x) `" - -#: ../../library/math.rst:86 -msgid "Convert angle *x* from radians to degrees" -msgstr "" - -#: ../../library/math.rst:87 -msgid ":func:`radians(x) `" -msgstr ":func:`radians(x) `" - -#: ../../library/math.rst:87 -msgid "Convert angle *x* from degrees to radians" -msgstr "" - -#: ../../library/math.rst:89 +#: ../../library/math.rst:98 msgid "**Hyperbolic functions**" msgstr "" -#: ../../library/math.rst:91 +#: ../../library/math.rst:100 msgid ":func:`acosh(x) `" msgstr ":func:`acosh(x) `" -#: ../../library/math.rst:91 +#: ../../library/math.rst:100 msgid "Inverse hyperbolic cosine of *x*" msgstr "" -#: ../../library/math.rst:92 +#: ../../library/math.rst:101 msgid ":func:`asinh(x) `" msgstr ":func:`asinh(x) `" -#: ../../library/math.rst:92 +#: ../../library/math.rst:101 msgid "Inverse hyperbolic sine of *x*" msgstr "" -#: ../../library/math.rst:93 +#: ../../library/math.rst:102 msgid ":func:`atanh(x) `" msgstr ":func:`atanh(x) `" -#: ../../library/math.rst:93 +#: ../../library/math.rst:102 msgid "Inverse hyperbolic tangent of *x*" msgstr "" -#: ../../library/math.rst:94 +#: ../../library/math.rst:103 msgid ":func:`cosh(x) `" msgstr ":func:`cosh(x) `" -#: ../../library/math.rst:94 +#: ../../library/math.rst:103 msgid "Hyperbolic cosine of *x*" msgstr "" -#: ../../library/math.rst:95 +#: ../../library/math.rst:104 msgid ":func:`sinh(x) `" msgstr ":func:`sinh(x) `" -#: ../../library/math.rst:95 +#: ../../library/math.rst:104 msgid "Hyperbolic sine of *x*" msgstr "" -#: ../../library/math.rst:96 +#: ../../library/math.rst:105 msgid ":func:`tanh(x) `" msgstr ":func:`tanh(x) `" -#: ../../library/math.rst:96 +#: ../../library/math.rst:105 msgid "Hyperbolic tangent of *x*" msgstr "" -#: ../../library/math.rst:98 +#: ../../library/math.rst:107 msgid "**Special functions**" msgstr "" -#: ../../library/math.rst:100 +#: ../../library/math.rst:109 msgid ":func:`erf(x) `" msgstr ":func:`erf(x) `" -#: ../../library/math.rst:100 +#: ../../library/math.rst:109 msgid "`Error function `_ at *x*" msgstr "" -#: ../../library/math.rst:101 +#: ../../library/math.rst:110 msgid ":func:`erfc(x) `" msgstr ":func:`erfc(x) `" -#: ../../library/math.rst:101 +#: ../../library/math.rst:110 msgid "" "`Complementary error function `_ at *x*" msgstr "" -#: ../../library/math.rst:102 +#: ../../library/math.rst:111 msgid ":func:`gamma(x) `" msgstr ":func:`gamma(x) `" -#: ../../library/math.rst:102 +#: ../../library/math.rst:111 msgid "`Gamma function `_ at *x*" msgstr "" -#: ../../library/math.rst:103 +#: ../../library/math.rst:112 msgid ":func:`lgamma(x) `" msgstr ":func:`lgamma(x) `" -#: ../../library/math.rst:103 +#: ../../library/math.rst:112 msgid "" "Natural logarithm of the absolute value of the `Gamma function `_ at *x*" msgstr "" -#: ../../library/math.rst:105 +#: ../../library/math.rst:114 msgid "**Constants**" msgstr "**常數**" -#: ../../library/math.rst:107 +#: ../../library/math.rst:116 msgid ":data:`pi`" msgstr ":data:`pi`" -#: ../../library/math.rst:107 +#: ../../library/math.rst:116 msgid "*π* = 3.141592..." msgstr "*π* = 3.141592..." -#: ../../library/math.rst:108 +#: ../../library/math.rst:117 msgid ":data:`e`" msgstr ":data:`e`" -#: ../../library/math.rst:108 +#: ../../library/math.rst:117 msgid "*e* = 2.718281..." msgstr "*e* = 2.718281..." -#: ../../library/math.rst:109 +#: ../../library/math.rst:118 msgid ":data:`tau`" msgstr ":data:`tau`" -#: ../../library/math.rst:109 +#: ../../library/math.rst:118 msgid "*τ* = 2\\ *π* = 6.283185..." msgstr "*τ* = 2\\ *π* = 6.283185..." -#: ../../library/math.rst:110 +#: ../../library/math.rst:119 msgid ":data:`inf`" msgstr ":data:`inf`" -#: ../../library/math.rst:110 +#: ../../library/math.rst:119 msgid "Positive infinity" msgstr "正無限大" -#: ../../library/math.rst:111 +#: ../../library/math.rst:120 msgid ":data:`nan`" msgstr ":data:`nan`" -#: ../../library/math.rst:111 +#: ../../library/math.rst:120 msgid "\"Not a number\" (NaN)" msgstr "" -#: ../../library/math.rst:116 -msgid "Number-theoretic and representation functions" -msgstr "數論與表現函式" - -#: ../../library/math.rst:120 -msgid "" -"Return the ceiling of *x*, the smallest integer greater than or equal to " -"*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ `, which should return an :class:`~numbers.Integral` value." -msgstr "" -"回傳 *x* 經上取整的值,即大於或等於 *x* 的最小整數。若 *x* 並非浮點數,此函式" -"將委派給 :meth:`x.__ceil__ `,並回傳 :class:`~numbers." -"Integral` 型別的值。" +#: ../../library/math.rst:125 +msgid "Number-theoretic functions" +msgstr "數論函式" -#: ../../library/math.rst:127 +#: ../../library/math.rst:129 msgid "" "Return the number of ways to choose *k* items from *n* items without " "repetition and without order." msgstr "回傳從 *n* 個物品中不重複且不考慮排序地取出 *k* 個物品的方法數。" -#: ../../library/math.rst:130 +#: ../../library/math.rst:132 msgid "" "Evaluates to ``n! / (k! * (n - k)!)`` when ``k <= n`` and evaluates to zero " "when ``k > n``." msgstr "當 ``k <= n`` 時其值為 ``n! / (k! * (n - k)!)``,否則其值為 ``0``。" -#: ../../library/math.rst:133 +#: ../../library/math.rst:135 msgid "" "Also called the binomial coefficient because it is equivalent to the " "coefficient of k-th term in polynomial expansion of ``(1 + x)ⁿ``." @@ -618,7 +620,7 @@ msgstr "" "因為此值等同於 ``(1 + x)ⁿ`` 進行多項式展開後第 k 項的係數,所以又稱為二項式係" "數。" -#: ../../library/math.rst:137 ../../library/math.rst:362 +#: ../../library/math.rst:139 ../../library/math.rst:205 msgid "" "Raises :exc:`TypeError` if either of the arguments are not integers. Raises :" "exc:`ValueError` if either of the arguments are negative." @@ -626,32 +628,104 @@ msgstr "" "當任一參數非整數型別時會引發 :exc:`TypeError`。當任一參數為負數時會引發 :exc:" "`ValueError`。" -#: ../../library/math.rst:145 -msgid "" -"Return a float with the magnitude (absolute value) of *x* but the sign of " -"*y*. On platforms that support signed zeros, ``copysign(1.0, -0.0)`` " -"returns *-1.0*." -msgstr "" -"回傳與 *x* 相同長度(絕對值)且與 *y* 同號的浮點數。在支援帶符號零的平臺上," -"``copysign(1.0, -0.0)`` 回傳 *-1.0*。" - -#: ../../library/math.rst:152 -msgid "Return the absolute value of *x*." -msgstr "回傳 *x* 的絕對值。" - -#: ../../library/math.rst:157 +#: ../../library/math.rst:147 msgid "" "Return *n* factorial as an integer. Raises :exc:`ValueError` if *n* is not " "integral or is negative." msgstr "" "以整數回傳 *n* 的階乘。若 *n* 非整數型別或其值為負會引發 :exc:`ValueError`。" -#: ../../library/math.rst:160 -#, fuzzy +#: ../../library/math.rst:150 msgid "Floats with integral values (like ``5.0``) are no longer accepted." -msgstr "允許傳入其值為整數的浮點數(如:``5.0``)已被棄用。" +msgstr "其值為整數的浮點數(如:``5.0``)已不再被接受。" + +#: ../../library/math.rst:156 +msgid "" +"Return the greatest common divisor of the specified integer arguments. If " +"any of the arguments is nonzero, then the returned value is the largest " +"positive integer that is a divisor of all arguments. If all arguments are " +"zero, then the returned value is ``0``. ``gcd()`` without arguments returns " +"``0``." +msgstr "" +"回傳指定整數引數的最大公因數。若存在任一非零引數,回傳值為所有引數共有因數中" +"最大的正整數。若所有引數皆為零,則回傳值為 ``0``。``gcd()`` 若未傳入任何引數" +"也將回傳 ``0``。" + +#: ../../library/math.rst:164 +msgid "" +"Added support for an arbitrary number of arguments. Formerly, only two " +"arguments were supported." +msgstr "新增支援任意數量的引數。先前僅支援兩個引數。" + +#: ../../library/math.rst:171 +msgid "" +"Return the integer square root of the nonnegative integer *n*. This is the " +"floor of the exact square root of *n*, or equivalently the greatest integer " +"*a* such that *a*\\ ² |nbsp| ≤ |nbsp| *n*." +msgstr "" +"回傳非負整數 *n* 的整數平方根。此值為 *n* 精確平方根經下取整的值,亦等同於滿" +"足 *a*\\ ² |nbsp| ≤ |nbsp| *n* 的最大整數值 *a*。" + +#: ../../library/math.rst:175 +msgid "" +"For some applications, it may be more convenient to have the least integer " +"*a* such that *n* |nbsp| ≤ |nbsp| *a*\\ ², or in other words the ceiling of " +"the exact square root of *n*. For positive *n*, this can be computed using " +"``a = 1 + isqrt(n - 1)``." +msgstr "" +"於有些應用程式中,取得滿足 *n* |nbsp| ≤ |nbsp| *a*\\ ² 的最小整數值 *a* ── 或" +"者說 *n* 精確平方根經上取整的值 ── 會更加方便。對正數 *n*,此值可使用 ``a = " +"1 + isqrt(n - 1)`` 計算。" + +#: ../../library/math.rst:185 +msgid "" +"Return the least common multiple of the specified integer arguments. If all " +"arguments are nonzero, then the returned value is the smallest positive " +"integer that is a multiple of all arguments. If any of the arguments is " +"zero, then the returned value is ``0``. ``lcm()`` without arguments returns " +"``1``." +msgstr "" +"回傳指定整數引數的最小公倍數。若所有引數值皆非零,回傳值為所有引數共有倍數中" +"最小的正整數。若存在任一引數值為零,則回傳值為 ``0``。``lcm()`` 若未傳入任何" +"引數將回傳 ``1``。" + +#: ../../library/math.rst:196 +msgid "" +"Return the number of ways to choose *k* items from *n* items without " +"repetition and with order." +msgstr "" + +#: ../../library/math.rst:199 +msgid "" +"Evaluates to ``n! / (n - k)!`` when ``k <= n`` and evaluates to zero when " +"``k > n``." +msgstr "" + +#: ../../library/math.rst:202 +msgid "" +"If *k* is not specified or is ``None``, then *k* defaults to *n* and the " +"function returns ``n!``." +msgstr "" + +#: ../../library/math.rst:212 +msgid "Floating point arithmetic" +msgstr "" + +#: ../../library/math.rst:216 +msgid "" +"Return the ceiling of *x*, the smallest integer greater than or equal to " +"*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ `, which should return an :class:`~numbers.Integral` value." +msgstr "" +"回傳 *x* 經上取整的值,即大於或等於 *x* 的最小整數。若 *x* 並非浮點數,此函式" +"將委派給 :meth:`x.__ceil__ `,並回傳 :class:`~numbers." +"Integral` 型別的值。" + +#: ../../library/math.rst:223 +msgid "Return the absolute value of *x*." +msgstr "回傳 *x* 的絕對值。" -#: ../../library/math.rst:166 +#: ../../library/math.rst:228 msgid "" "Return the floor of *x*, the largest integer less than or equal to *x*. If " "*x* is not a float, delegates to :meth:`x.__floor__ `, " @@ -661,7 +735,7 @@ msgstr "" "將委派給 :meth:`x.__floor__ `,並回傳 :class:`~numbers." "Integral` 型別的值。" -#: ../../library/math.rst:173 +#: ../../library/math.rst:235 msgid "" "Fused multiply-add operation. Return ``(x * y) + z``, computed as though " "with infinite precision and range followed by a single round to the " @@ -669,7 +743,7 @@ msgid "" "direct expression ``(x * y) + z``." msgstr "" -#: ../../library/math.rst:178 +#: ../../library/math.rst:240 msgid "" "This function follows the specification of the fusedMultiplyAdd operation " "described in the IEEE 754 standard. The standard leaves one case " @@ -678,7 +752,7 @@ msgid "" "not raise any exception." msgstr "" -#: ../../library/math.rst:189 +#: ../../library/math.rst:251 msgid "" "Return ``fmod(x, y)``, as defined by the platform C library. Note that the " "Python expression ``x % y`` may not return the same result. The intent of " @@ -702,72 +776,101 @@ msgstr "" "示成浮點數,並會四捨五入為出乎意料的 ``1e100``。因此,處理浮點數時通常會選擇" "函式 :func:`fmod`,而處理整數時會選擇 Python 運算式 ``x % y``。" -#: ../../library/math.rst:204 +#: ../../library/math.rst:266 msgid "" -"Return the mantissa and exponent of *x* as the pair ``(m, e)``. *m* is a " -"float and *e* is an integer such that ``x == m * 2**e`` exactly. If *x* is " -"zero, returns ``(0.0, 0)``, otherwise ``0.5 <= abs(m) < 1``. This is used " -"to \"pick apart\" the internal representation of a float in a portable way." +"Return the fractional and integer parts of *x*. Both results carry the sign " +"of *x* and are floats." msgstr "" -"以 ``(m, e)`` 對的格式回傳 *x* 的尾數 *m* 及指數 *e*。*m* 是浮點數而 *e* 是整" -"數,且兩者精確地使 ``x == m * 2**e``。若 *x* 為零,回傳 ``(0.0, 0)``,否則令 " -"``0.5 <= abs(m) < 1``。此函式用於以可攜的方式「分割」浮點數內部表示法。" -#: ../../library/math.rst:212 +#: ../../library/math.rst:269 msgid "" -"Return an accurate floating-point sum of values in the iterable. Avoids " -"loss of precision by tracking multiple intermediate partial sums." +"Note that :func:`modf` has a different call/return pattern than its C " +"equivalents: it takes a single argument and return a pair of values, rather " +"than returning its second return value through an 'output parameter' (there " +"is no such thing in Python)." msgstr "" -"回傳可疊代物件(iterable)中所有值的精確浮點數和。透過追蹤過程中多個部分和" -"(partial sum)以避免精確度損失。" -#: ../../library/math.rst:215 +#: ../../library/math.rst:277 msgid "" -"The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the " -"typical case where the rounding mode is half-even. On some non-Windows " -"builds, the underlying C library uses extended precision addition and may " -"occasionally double-round an intermediate sum causing it to be off in its " -"least significant bit." +"Return the IEEE 754-style remainder of *x* with respect to *y*. For finite " +"*x* and finite nonzero *y*, this is the difference ``x - n*y``, where ``n`` " +"is the closest integer to the exact value of the quotient ``x / y``. If " +"``x / y`` is exactly halfway between two consecutive integers, the nearest " +"*even* integer is used for ``n``. The remainder ``r = remainder(x, y)`` " +"thus always satisfies ``abs(r) <= 0.5 * abs(y)``." msgstr "" -"此演算法準確性奠基於保證 IEEE-754 浮點標準及典型奇進偶捨(half-even)模式。於" -"有些非 Windows 平台建置時,底層 C 函式庫使用延伸精度加法運算,而可能導致對過" -"程中同一部分和重複捨入,並使其最低有效位不如預期。" -#: ../../library/math.rst:221 +#: ../../library/math.rst:284 msgid "" -"For further discussion and two alternative approaches, see the `ASPN " -"cookbook recipes for accurate floating-point summation `_\\." +"Special cases follow IEEE 754: in particular, ``remainder(x, math.inf)`` is " +"*x* for any finite *x*, and ``remainder(x, 0)`` and ``remainder(math.inf, " +"x)`` raise :exc:`ValueError` for any non-NaN *x*. If the result of the " +"remainder operation is zero, that zero will have the same sign as *x*." msgstr "" -"更深入的討論及兩種替代做法請參閱 `ASPN cookbook recipes 精準的浮點數總和 " -"`_。" -#: ../../library/math.rst:228 +#: ../../library/math.rst:290 msgid "" -"Return the greatest common divisor of the specified integer arguments. If " -"any of the arguments is nonzero, then the returned value is the largest " -"positive integer that is a divisor of all arguments. If all arguments are " -"zero, then the returned value is ``0``. ``gcd()`` without arguments returns " -"``0``." +"On platforms using IEEE 754 binary floating point, the result of this " +"operation is always exactly representable: no rounding error is introduced." msgstr "" -"回傳指定整數引數的最大公因數。若存在任一非零引數,回傳值為所有引數共有因數中" -"最大的正整數。若所有引數皆為零,則回傳值為 ``0``。``gcd()`` 若未傳入任何引數" -"也將回傳 ``0``。" -#: ../../library/math.rst:236 +#: ../../library/math.rst:298 msgid "" -"Added support for an arbitrary number of arguments. Formerly, only two " -"arguments were supported." -msgstr "新增支援任意數量的引數。先前僅支援兩個引數。" +"Return *x* with the fractional part removed, leaving the integer part. This " +"rounds toward 0: ``trunc()`` is equivalent to :func:`floor` for positive " +"*x*, and equivalent to :func:`ceil` for negative *x*. If *x* is not a float, " +"delegates to :meth:`x.__trunc__ `, which should return an :" +"class:`~numbers.Integral` value." +msgstr "" + +#: ../../library/math.rst:305 +msgid "" +"For the :func:`ceil`, :func:`floor`, and :func:`modf` functions, note that " +"*all* floating-point numbers of sufficiently large magnitude are exact " +"integers. Python floats typically carry no more than 53 bits of precision " +"(the same as the platform C double type), in which case any float *x* with " +"``abs(x) >= 2**52`` necessarily has no fractional bits." +msgstr "" + +#: ../../library/math.rst:313 +msgid "Floating point manipulation functions" +msgstr "" + +#: ../../library/math.rst:317 +msgid "" +"Return a float with the magnitude (absolute value) of *x* but the sign of " +"*y*. On platforms that support signed zeros, ``copysign(1.0, -0.0)`` " +"returns *-1.0*." +msgstr "" +"回傳與 *x* 相同長度(絕對值)且與 *y* 同號的浮點數。在支援帶符號零的平臺上," +"``copysign(1.0, -0.0)`` 回傳 *-1.0*。" + +#: ../../library/math.rst:324 +msgid "" +"Return the mantissa and exponent of *x* as the pair ``(m, e)``. *m* is a " +"float and *e* is an integer such that ``x == m * 2**e`` exactly. If *x* is " +"zero, returns ``(0.0, 0)``, otherwise ``0.5 <= abs(m) < 1``. This is used " +"to \"pick apart\" the internal representation of a float in a portable way." +msgstr "" +"以 ``(m, e)`` 對的格式回傳 *x* 的尾數 *m* 及指數 *e*。*m* 是浮點數而 *e* 是整" +"數,且兩者精確地使 ``x == m * 2**e``。若 *x* 為零,回傳 ``(0.0, 0)``,否則令 " +"``0.5 <= abs(m) < 1``。此函式用於以可攜的方式「分割」浮點數內部表示法。" + +#: ../../library/math.rst:329 +msgid "" +"Note that :func:`frexp` has a different call/return pattern than its C " +"equivalents: it takes a single argument and return a pair of values, rather " +"than returning its second return value through an 'output parameter' (there " +"is no such thing in Python)." +msgstr "" -#: ../../library/math.rst:243 +#: ../../library/math.rst:336 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." msgstr "若 *a* 及 *b* 兩值足夠接近便回傳 ``True``,否則回傳 ``False``。" -#: ../../library/math.rst:246 +#: ../../library/math.rst:339 msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances. If no errors occur, the result will " @@ -776,7 +879,7 @@ msgstr "" "兩數是否足夠接近取決於給定的絕對及相對容許偏差 (tolerance)。如果沒有錯誤發" "生,結果將為:``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``。" -#: ../../library/math.rst:250 +#: ../../library/math.rst:343 msgid "" "*rel_tol* is the relative tolerance -- it is the maximum allowed difference " "between *a* and *b*, relative to the larger absolute value of *a* or *b*. " @@ -790,7 +893,7 @@ msgstr "" "設值為 ``1e-09``,該值可確保兩數於大約 9 個十進數位內相同。*rel_tol* 須不為負" "且小於 ``1.0``。" -#: ../../library/math.rst:257 +#: ../../library/math.rst:350 msgid "" "*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be " "nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed " @@ -799,7 +902,7 @@ msgid "" "to the call." msgstr "" -#: ../../library/math.rst:263 +#: ../../library/math.rst:356 msgid "" "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " "handled according to IEEE rules. Specifically, ``NaN`` is not considered " @@ -810,11 +913,11 @@ msgstr "" "處理。更明確地說,``NaN`` 不會與包含自身在內的任何數字足夠接近,而 ``inf`` " "及 ``-inf`` 皆只與自身接近。" -#: ../../library/math.rst:272 +#: ../../library/math.rst:365 msgid ":pep:`485` -- A function for testing approximate equality" msgstr ":pep:`485` ── 用於測試近似相等的函式" -#: ../../library/math.rst:277 +#: ../../library/math.rst:370 msgid "" "Return ``True`` if *x* is neither an infinity nor a NaN, and ``False`` " "otherwise. (Note that ``0.0`` *is* considered finite.)" @@ -822,269 +925,128 @@ msgstr "" "若 *x* 不是無限值或 ``NaN`` 便回傳 ``True``,否則回傳 ``False``。(注意 " "``0.0`` 被視為有限數。)" -#: ../../library/math.rst:285 -msgid "" -"Return ``True`` if *x* is a positive or negative infinity, and ``False`` " -"otherwise." -msgstr "若 *x* 是正無限值或負無限值便回傳 ``True``,否則回傳 ``False``。" - -#: ../../library/math.rst:291 -msgid "" -"Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise." -msgstr "" -"若 *x* 是 ``NaN`` ── 即非數字(NaN, not a number)── 便回傳 ``True``,否則回" -"傳 ``False``。" - -#: ../../library/math.rst:296 -msgid "" -"Return the integer square root of the nonnegative integer *n*. This is the " -"floor of the exact square root of *n*, or equivalently the greatest integer " -"*a* such that *a*\\ ² |nbsp| ≤ |nbsp| *n*." -msgstr "" -"回傳非負整數 *n* 的整數平方根。此值為 *n* 精確平方根經下取整的值,亦等同於滿" -"足 *a*\\ ² |nbsp| ≤ |nbsp| *n* 的最大整數值 *a*。" - -#: ../../library/math.rst:300 +#: ../../library/math.rst:378 msgid "" -"For some applications, it may be more convenient to have the least integer " -"*a* such that *n* |nbsp| ≤ |nbsp| *a*\\ ², or in other words the ceiling of " -"the exact square root of *n*. For positive *n*, this can be computed using " -"``a = 1 + isqrt(n - 1)``." -msgstr "" -"於有些應用程式中,取得滿足 *n* |nbsp| ≤ |nbsp| *a*\\ ² 的最小整數值 *a* ── 或" -"者說 *n* 精確平方根經上取整的值 ── 會更加方便。對正數 *n*,此值可使用 ``a = " -"1 + isqrt(n - 1)`` 計算。" +"Return ``True`` if *x* is a positive or negative infinity, and ``False`` " +"otherwise." +msgstr "若 *x* 是正無限值或負無限值便回傳 ``True``,否則回傳 ``False``。" -#: ../../library/math.rst:310 +#: ../../library/math.rst:384 msgid "" -"Return the least common multiple of the specified integer arguments. If all " -"arguments are nonzero, then the returned value is the smallest positive " -"integer that is a multiple of all arguments. If any of the arguments is " -"zero, then the returned value is ``0``. ``lcm()`` without arguments returns " -"``1``." +"Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise." msgstr "" -"回傳指定整數引數的最小公倍數。若所有引數值皆非零,回傳值為所有引數共有倍數中" -"最小的正整數。若存在任一引數值為零,則回傳值為 ``0``。``lcm()`` 若未傳入任何" -"引數將回傳 ``1``。" +"若 *x* 是 ``NaN`` ── 即非數字(NaN, not a number)── 便回傳 ``True``,否則回" +"傳 ``False``。" -#: ../../library/math.rst:321 +#: ../../library/math.rst:389 msgid "" "Return ``x * (2**i)``. This is essentially the inverse of function :func:" "`frexp`." msgstr "回傳 ``x * (2**i)``。此函式本質上為 :func:`frexp` 的反函式。" -#: ../../library/math.rst:327 -msgid "" -"Return the fractional and integer parts of *x*. Both results carry the sign " -"of *x* and are floats." -msgstr "" - -#: ../../library/math.rst:333 +#: ../../library/math.rst:395 msgid "Return the floating-point value *steps* steps after *x* towards *y*." msgstr "" -#: ../../library/math.rst:335 +#: ../../library/math.rst:397 msgid "If *x* is equal to *y*, return *y*, unless *steps* is zero." msgstr "" -#: ../../library/math.rst:337 +#: ../../library/math.rst:399 msgid "Examples:" msgstr "範例:" -#: ../../library/math.rst:339 +#: ../../library/math.rst:401 msgid "``math.nextafter(x, math.inf)`` goes up: towards positive infinity." msgstr "" -#: ../../library/math.rst:340 +#: ../../library/math.rst:402 msgid "``math.nextafter(x, -math.inf)`` goes down: towards minus infinity." msgstr "" -#: ../../library/math.rst:341 +#: ../../library/math.rst:403 msgid "``math.nextafter(x, 0.0)`` goes towards zero." msgstr "" -#: ../../library/math.rst:342 +#: ../../library/math.rst:404 msgid "``math.nextafter(x, math.copysign(math.inf, x))`` goes away from zero." msgstr "" -#: ../../library/math.rst:344 +#: ../../library/math.rst:406 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/math.rst:348 +#: ../../library/math.rst:410 msgid "Added the *steps* argument." msgstr "新增 *steps* 引數。" -#: ../../library/math.rst:353 -msgid "" -"Return the number of ways to choose *k* items from *n* items without " -"repetition and with order." -msgstr "" - -#: ../../library/math.rst:356 -msgid "" -"Evaluates to ``n! / (n - k)!`` when ``k <= n`` and evaluates to zero when " -"``k > n``." -msgstr "" - -#: ../../library/math.rst:359 -msgid "" -"If *k* is not specified or is ``None``, then *k* defaults to *n* and the " -"function returns ``n!``." -msgstr "" - -#: ../../library/math.rst:370 -msgid "" -"Calculate the product of all the elements in the input *iterable*. The " -"default *start* value for the product is ``1``." -msgstr "" - -#: ../../library/math.rst:373 -msgid "" -"When the iterable is empty, return the start value. This function is " -"intended specifically for use with numeric values and may reject non-numeric " -"types." -msgstr "" - -#: ../../library/math.rst:382 -msgid "" -"Return the IEEE 754-style remainder of *x* with respect to *y*. For finite " -"*x* and finite nonzero *y*, this is the difference ``x - n*y``, where ``n`` " -"is the closest integer to the exact value of the quotient ``x / y``. If " -"``x / y`` is exactly halfway between two consecutive integers, the nearest " -"*even* integer is used for ``n``. The remainder ``r = remainder(x, y)`` " -"thus always satisfies ``abs(r) <= 0.5 * abs(y)``." -msgstr "" - -#: ../../library/math.rst:389 -msgid "" -"Special cases follow IEEE 754: in particular, ``remainder(x, math.inf)`` is " -"*x* for any finite *x*, and ``remainder(x, 0)`` and ``remainder(math.inf, " -"x)`` raise :exc:`ValueError` for any non-NaN *x*. If the result of the " -"remainder operation is zero, that zero will have the same sign as *x*." -msgstr "" - -#: ../../library/math.rst:395 -msgid "" -"On platforms using IEEE 754 binary floating point, the result of this " -"operation is always exactly representable: no rounding error is introduced." -msgstr "" - -#: ../../library/math.rst:403 -msgid "Return the sum of products of values from two iterables *p* and *q*." -msgstr "" - -#: ../../library/math.rst:405 -msgid "Raises :exc:`ValueError` if the inputs do not have the same length." -msgstr "" - -#: ../../library/math.rst:407 ../../library/math.rst:602 -msgid "Roughly equivalent to::" -msgstr "" - -#: ../../library/math.rst:409 -msgid "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" -msgstr "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" - -#: ../../library/math.rst:411 -msgid "" -"For float and mixed int/float inputs, the intermediate products and sums are " -"computed with extended precision." -msgstr "" - -#: ../../library/math.rst:419 -msgid "" -"Return *x* with the fractional part removed, leaving the integer part. This " -"rounds toward 0: ``trunc()`` is equivalent to :func:`floor` for positive " -"*x*, and equivalent to :func:`ceil` for negative *x*. If *x* is not a float, " -"delegates to :meth:`x.__trunc__ `, which should return an :" -"class:`~numbers.Integral` value." -msgstr "" - -#: ../../library/math.rst:427 +#: ../../library/math.rst:416 msgid "Return the value of the least significant bit of the float *x*:" msgstr "" -#: ../../library/math.rst:429 +#: ../../library/math.rst:418 msgid "If *x* is a NaN (not a number), return *x*." msgstr "" -#: ../../library/math.rst:430 +#: ../../library/math.rst:419 msgid "If *x* is negative, return ``ulp(-x)``." msgstr "若 *x* 為負值,回傳 ``ulp(-x)``。" -#: ../../library/math.rst:431 +#: ../../library/math.rst:420 msgid "If *x* is a positive infinity, return *x*." msgstr "若 *x* 為正無限值,回傳 *x*。" -#: ../../library/math.rst:432 +#: ../../library/math.rst:421 msgid "" "If *x* is equal to zero, return the smallest positive *denormalized* " "representable float (smaller than the minimum positive *normalized* float, :" "data:`sys.float_info.min `)." msgstr "" -#: ../../library/math.rst:435 +#: ../../library/math.rst:424 msgid "" "If *x* is equal to the largest positive representable float, return the " "value of the least significant bit of *x*, such that the first float smaller " "than *x* is ``x - ulp(x)``." msgstr "" -#: ../../library/math.rst:438 +#: ../../library/math.rst:427 msgid "" "Otherwise (*x* is a positive finite number), return the value of the least " "significant bit of *x*, such that the first float bigger than *x* is ``x + " "ulp(x)``." msgstr "" -#: ../../library/math.rst:442 +#: ../../library/math.rst:431 msgid "ULP stands for \"Unit in the Last Place\"." msgstr "" -#: ../../library/math.rst:444 +#: ../../library/math.rst:433 msgid "" "See also :func:`math.nextafter` and :data:`sys.float_info.epsilon `." msgstr "" -#: ../../library/math.rst:450 -msgid "" -"Note that :func:`frexp` and :func:`modf` have a different call/return " -"pattern than their C equivalents: they take a single argument and return a " -"pair of values, rather than returning their second return value through an " -"'output parameter' (there is no such thing in Python)." -msgstr "" - -#: ../../library/math.rst:455 -msgid "" -"For the :func:`ceil`, :func:`floor`, and :func:`modf` functions, note that " -"*all* floating-point numbers of sufficiently large magnitude are exact " -"integers. Python floats typically carry no more than 53 bits of precision " -"(the same as the platform C double type), in which case any float *x* with " -"``abs(x) >= 2**52`` necessarily has no fractional bits." -msgstr "" - -#: ../../library/math.rst:463 -msgid "Power and logarithmic functions" +#: ../../library/math.rst:440 +msgid "Power, exponential and logarithmic functions" msgstr "" -#: ../../library/math.rst:467 +#: ../../library/math.rst:444 msgid "Return the cube root of *x*." msgstr "" -#: ../../library/math.rst:474 +#: ../../library/math.rst:451 msgid "" "Return *e* raised to the power *x*, where *e* = 2.718281... is the base of " "natural logarithms. This is usually more accurate than ``math.e ** x`` or " "``pow(math.e, x)``." msgstr "" -#: ../../library/math.rst:481 +#: ../../library/math.rst:458 msgid "Return *2* raised to the power *x*." msgstr "" -#: ../../library/math.rst:488 +#: ../../library/math.rst:465 msgid "" "Return *e* raised to the power *x*, minus 1. Here *e* is the base of " "natural logarithms. For small floats *x*, the subtraction in ``exp(x) - 1`` " @@ -1093,41 +1055,41 @@ msgid "" "compute this quantity to full precision:" msgstr "" -#: ../../library/math.rst:505 +#: ../../library/math.rst:482 msgid "With one argument, return the natural logarithm of *x* (to base *e*)." msgstr "" -#: ../../library/math.rst:507 +#: ../../library/math.rst:484 msgid "" "With two arguments, return the logarithm of *x* to the given *base*, " "calculated as ``log(x)/log(base)``." msgstr "" -#: ../../library/math.rst:513 +#: ../../library/math.rst:490 msgid "" "Return the natural logarithm of *1+x* (base *e*). The result is calculated " "in a way which is accurate for *x* near zero." msgstr "" -#: ../../library/math.rst:519 +#: ../../library/math.rst:496 msgid "" "Return the base-2 logarithm of *x*. This is usually more accurate than " "``log(x, 2)``." msgstr "" -#: ../../library/math.rst:526 +#: ../../library/math.rst:503 msgid "" ":meth:`int.bit_length` returns the number of bits necessary to represent an " "integer in binary, excluding the sign and leading zeros." msgstr "" -#: ../../library/math.rst:532 +#: ../../library/math.rst:509 msgid "" "Return the base-10 logarithm of *x*. This is usually more accurate than " "``log(x, 10)``." msgstr "" -#: ../../library/math.rst:538 +#: ../../library/math.rst:515 msgid "" "Return *x* raised to the power *y*. Exceptional cases follow the IEEE 754 " "standard as far as possible. In particular, ``pow(1.0, x)`` and ``pow(x, " @@ -1136,178 +1098,247 @@ msgid "" "y)`` is undefined, and raises :exc:`ValueError`." msgstr "" -#: ../../library/math.rst:545 +#: ../../library/math.rst:522 msgid "" "Unlike the built-in ``**`` operator, :func:`math.pow` converts both its " "arguments to type :class:`float`. Use ``**`` or the built-in :func:`pow` " "function for computing exact integer powers." msgstr "" -#: ../../library/math.rst:549 +#: ../../library/math.rst:526 msgid "" "The special cases ``pow(0.0, -inf)`` and ``pow(-0.0, -inf)`` were changed to " "return ``inf`` instead of raising :exc:`ValueError`, for consistency with " "IEEE 754." msgstr "" -#: ../../library/math.rst:557 +#: ../../library/math.rst:534 msgid "Return the square root of *x*." msgstr "" -#: ../../library/math.rst:561 -msgid "Trigonometric functions" +#: ../../library/math.rst:538 +msgid "Summation and product functions" msgstr "" -#: ../../library/math.rst:565 +#: ../../library/math.rst:542 msgid "" -"Return the arc cosine of *x*, in radians. The result is between ``0`` and " -"``pi``." +"Return the Euclidean distance between two points *p* and *q*, each given as " +"a sequence (or iterable) of coordinates. The two points must have the same " +"dimension." msgstr "" -#: ../../library/math.rst:571 -msgid "" -"Return the arc sine of *x*, in radians. The result is between ``-pi/2`` and " -"``pi/2``." +#: ../../library/math.rst:546 ../../library/math.rst:607 +msgid "Roughly equivalent to::" msgstr "" -#: ../../library/math.rst:577 -msgid "" -"Return the arc tangent of *x*, in radians. The result is between ``-pi/2`` " -"and ``pi/2``." -msgstr "" +#: ../../library/math.rst:548 +msgid "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" +msgstr "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" -#: ../../library/math.rst:583 +#: ../../library/math.rst:555 msgid "" -"Return ``atan(y / x)``, in radians. The result is between ``-pi`` and " -"``pi``. The vector in the plane from the origin to point ``(x, y)`` makes " -"this angle with the positive X axis. The point of :func:`atan2` is that the " -"signs of both inputs are known to it, so it can compute the correct quadrant " -"for the angle. For example, ``atan(1)`` and ``atan2(1, 1)`` are both " -"``pi/4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." +"Return an accurate floating-point sum of values in the iterable. Avoids " +"loss of precision by tracking multiple intermediate partial sums." msgstr "" +"回傳可疊代物件(iterable)中所有值的精確浮點數和。透過追蹤過程中多個部分和" +"(partial sum)以避免精確度損失。" -#: ../../library/math.rst:593 -msgid "Return the cosine of *x* radians." +#: ../../library/math.rst:558 +msgid "" +"The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the " +"typical case where the rounding mode is half-even. On some non-Windows " +"builds, the underlying C library uses extended precision addition and may " +"occasionally double-round an intermediate sum causing it to be off in its " +"least significant bit." msgstr "" +"此演算法準確性奠基於保證 IEEE-754 浮點標準及典型奇進偶捨(half-even)模式。於" +"有些非 Windows 平台建置時,底層 C 函式庫使用延伸精度加法運算,而可能導致對過" +"程中同一部分和重複捨入,並使其最低有效位不如預期。" -#: ../../library/math.rst:598 +#: ../../library/math.rst:564 msgid "" -"Return the Euclidean distance between two points *p* and *q*, each given as " -"a sequence (or iterable) of coordinates. The two points must have the same " -"dimension." +"For further discussion and two alternative approaches, see the `ASPN " +"cookbook recipes for accurate floating-point summation `_\\." msgstr "" +"更深入的討論及兩種替代做法請參閱 `ASPN cookbook recipes 精準的浮點數總和 " +"`_。" -#: ../../library/math.rst:604 -msgid "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" -msgstr "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" - -#: ../../library/math.rst:611 +#: ../../library/math.rst:571 msgid "" "Return the Euclidean norm, ``sqrt(sum(x**2 for x in coordinates))``. This is " "the length of the vector from the origin to the point given by the " "coordinates." msgstr "" -#: ../../library/math.rst:615 +#: ../../library/math.rst:575 msgid "" "For a two dimensional point ``(x, y)``, this is equivalent to computing the " "hypotenuse of a right triangle using the Pythagorean theorem, ``sqrt(x*x + " "y*y)``." msgstr "" -#: ../../library/math.rst:619 +#: ../../library/math.rst:579 msgid "" "Added support for n-dimensional points. Formerly, only the two dimensional " "case was supported." msgstr "" -#: ../../library/math.rst:623 +#: ../../library/math.rst:583 msgid "" "Improved the algorithm's accuracy so that the maximum error is under 1 ulp " "(unit in the last place). More typically, the result is almost always " "correctly rounded to within 1/2 ulp." msgstr "" -#: ../../library/math.rst:631 -msgid "Return the sine of *x* radians." +#: ../../library/math.rst:591 +msgid "" +"Calculate the product of all the elements in the input *iterable*. The " +"default *start* value for the product is ``1``." msgstr "" -#: ../../library/math.rst:636 -msgid "Return the tangent of *x* radians." +#: ../../library/math.rst:594 +msgid "" +"When the iterable is empty, return the start value. This function is " +"intended specifically for use with numeric values and may reject non-numeric " +"types." +msgstr "" + +#: ../../library/math.rst:603 +msgid "Return the sum of products of values from two iterables *p* and *q*." +msgstr "" + +#: ../../library/math.rst:605 +msgid "Raises :exc:`ValueError` if the inputs do not have the same length." +msgstr "" + +#: ../../library/math.rst:609 +msgid "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" +msgstr "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" + +#: ../../library/math.rst:611 +msgid "" +"For float and mixed int/float inputs, the intermediate products and sums are " +"computed with extended precision." msgstr "" -#: ../../library/math.rst:640 +#: ../../library/math.rst:618 msgid "Angular conversion" msgstr "" -#: ../../library/math.rst:644 +#: ../../library/math.rst:622 msgid "Convert angle *x* from radians to degrees." msgstr "" -#: ../../library/math.rst:649 +#: ../../library/math.rst:627 msgid "Convert angle *x* from degrees to radians." msgstr "" +#: ../../library/math.rst:631 +msgid "Trigonometric functions" +msgstr "" + +#: ../../library/math.rst:635 +msgid "" +"Return the arc cosine of *x*, in radians. The result is between ``0`` and " +"``pi``." +msgstr "" + +#: ../../library/math.rst:641 +msgid "" +"Return the arc sine of *x*, in radians. The result is between ``-pi/2`` and " +"``pi/2``." +msgstr "" + +#: ../../library/math.rst:647 +msgid "" +"Return the arc tangent of *x*, in radians. The result is between ``-pi/2`` " +"and ``pi/2``." +msgstr "" + #: ../../library/math.rst:653 +msgid "" +"Return ``atan(y / x)``, in radians. The result is between ``-pi`` and " +"``pi``. The vector in the plane from the origin to point ``(x, y)`` makes " +"this angle with the positive X axis. The point of :func:`atan2` is that the " +"signs of both inputs are known to it, so it can compute the correct quadrant " +"for the angle. For example, ``atan(1)`` and ``atan2(1, 1)`` are both " +"``pi/4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." +msgstr "" + +#: ../../library/math.rst:663 +msgid "Return the cosine of *x* radians." +msgstr "" + +#: ../../library/math.rst:668 +msgid "Return the sine of *x* radians." +msgstr "" + +#: ../../library/math.rst:673 +msgid "Return the tangent of *x* radians." +msgstr "" + +#: ../../library/math.rst:677 msgid "Hyperbolic functions" msgstr "" -#: ../../library/math.rst:655 +#: ../../library/math.rst:679 msgid "" "`Hyperbolic functions `_ " "are analogs of trigonometric functions that are based on hyperbolas instead " "of circles." msgstr "" -#: ../../library/math.rst:661 +#: ../../library/math.rst:685 msgid "Return the inverse hyperbolic cosine of *x*." msgstr "" -#: ../../library/math.rst:666 +#: ../../library/math.rst:690 msgid "Return the inverse hyperbolic sine of *x*." msgstr "" -#: ../../library/math.rst:671 +#: ../../library/math.rst:695 msgid "Return the inverse hyperbolic tangent of *x*." msgstr "" -#: ../../library/math.rst:676 +#: ../../library/math.rst:700 msgid "Return the hyperbolic cosine of *x*." msgstr "" -#: ../../library/math.rst:681 +#: ../../library/math.rst:705 msgid "Return the hyperbolic sine of *x*." msgstr "" -#: ../../library/math.rst:686 +#: ../../library/math.rst:710 msgid "Return the hyperbolic tangent of *x*." msgstr "" -#: ../../library/math.rst:690 +#: ../../library/math.rst:714 msgid "Special functions" msgstr "特殊函式" -#: ../../library/math.rst:694 +#: ../../library/math.rst:718 msgid "" "Return the `error function `_ " "at *x*." msgstr "" -#: ../../library/math.rst:697 +#: ../../library/math.rst:721 msgid "" "The :func:`erf` function can be used to compute traditional statistical " "functions such as the `cumulative standard normal distribution `_::" msgstr "" -#: ../../library/math.rst:701 +#: ../../library/math.rst:725 msgid "" "def phi(x):\n" " 'Cumulative distribution function for the standard normal distribution'\n" " return (1.0 + erf(x / sqrt(2.0))) / 2.0" msgstr "" -#: ../../library/math.rst:710 +#: ../../library/math.rst:734 msgid "" "Return the complementary error function at *x*. The `complementary error " "function `_ is defined as " @@ -1316,31 +1347,31 @@ msgid "" "Loss_of_significance>`_\\." msgstr "" -#: ../../library/math.rst:721 +#: ../../library/math.rst:745 msgid "" "Return the `Gamma function `_ " "at *x*." msgstr "" -#: ../../library/math.rst:729 +#: ../../library/math.rst:753 msgid "" "Return the natural logarithm of the absolute value of the Gamma function at " "*x*." msgstr "" -#: ../../library/math.rst:736 +#: ../../library/math.rst:760 msgid "Constants" msgstr "常數" -#: ../../library/math.rst:740 +#: ../../library/math.rst:764 msgid "The mathematical constant *π* = 3.141592..., to available precision." msgstr "" -#: ../../library/math.rst:745 +#: ../../library/math.rst:769 msgid "The mathematical constant *e* = 2.718281..., to available precision." msgstr "" -#: ../../library/math.rst:750 +#: ../../library/math.rst:774 msgid "" "The mathematical constant *τ* = 6.283185..., to available precision. Tau is " "a circle constant equal to 2\\ *π*, the ratio of a circle's circumference to " @@ -1349,13 +1380,13 @@ msgid "" "celebrating `Tau day `_ by eating twice as much pie!" msgstr "" -#: ../../library/math.rst:761 +#: ../../library/math.rst:785 msgid "" "A floating-point positive infinity. (For negative infinity, use ``-math." "inf``.) Equivalent to the output of ``float('inf')``." msgstr "" -#: ../../library/math.rst:769 +#: ../../library/math.rst:793 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to the output of " "``float('nan')``. Due to the requirements of the `IEEE-754 standard \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/msilib.rst:2 +msgid ":mod:`!msilib` --- Read and write Microsoft Installer files" +msgstr ":mod:`!msilib` --- 讀寫 Microsoft Installer 檔案" + +#: ../../library/msilib.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/msilib.rst:14 +msgid "" +"The last version of Python that provided the :mod:`!msilib` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!msilib` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index da2a98eeaa..810572ad3d 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2024-11-23 00:14+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-" @@ -496,7 +496,7 @@ msgstr "" #: ../../library/multiprocessing.rst:285 msgid "" -"The :meth:`~Connection.send` method serializes the the object and :meth:" +"The :meth:`~Connection.send` method serializes the object and :meth:" "`~Connection.recv` re-creates the object." msgstr "" @@ -1325,9 +1325,9 @@ msgstr "" #: ../../library/multiprocessing.rst:822 msgid "" -"The :meth:`~multiprocessing.Connection.send` method serializes the the " -"object using :mod:`pickle` and the :meth:`~multiprocessing.Connection.recv` " -"re-creates the object." +"The :meth:`~multiprocessing.Connection.send` method serializes the object " +"using :mod:`pickle` and the :meth:`~multiprocessing.Connection.recv` re-" +"creates the object." msgstr "" #: ../../library/multiprocessing.rst:827 diff --git a/library/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index 78ad49ee37..a9244ed858 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -148,7 +148,7 @@ msgstr "" #: ../../library/multiprocessing.shared_memory.rst:91 msgid "Added the *track* parameter." -msgstr "" +msgstr "新增 *track* 參數。" #: ../../library/multiprocessing.shared_memory.rst:96 msgid "" diff --git a/library/nis.po b/library/nis.po new file mode 100644 index 0000000000..e2e5bb1c79 --- /dev/null +++ b/library/nis.po @@ -0,0 +1,39 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/nis.rst:2 +msgid ":mod:`!nis` --- Interface to Sun’s NIS (Yellow Pages)" +msgstr ":mod:`!nis` --- Sun NIS (Yellow Pages) 介面" + +#: ../../library/nis.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/nis.rst:14 +msgid "" +"The last version of Python that provided the :mod:`!nis` module was `Python " +"3.12 `_." +msgstr "" +"最後提供 :mod:`!nis` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/nntplib.po b/library/nntplib.po new file mode 100644 index 0000000000..e90544691c --- /dev/null +++ b/library/nntplib.po @@ -0,0 +1,39 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/nntplib.rst:2 +msgid ":mod:`!nntplib` --- NNTP protocol client" +msgstr ":mod:`!nntplib` --- NNTP 協定客戶端" + +#: ../../library/nntplib.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/nntplib.rst:14 +msgid "" +"The last version of Python that provided the :mod:`!nntplib` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!nntplib` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/ossaudiodev.po b/library/ossaudiodev.po new file mode 100644 index 0000000000..6154c77b2e --- /dev/null +++ b/library/ossaudiodev.po @@ -0,0 +1,39 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/ossaudiodev.rst:2 +msgid ":mod:`!ossaudiodev` --- Access to OSS-compatible audio devices" +msgstr ":mod:`!ossaudiodev` --- 對 OSS 相容聲音裝置的存取" + +#: ../../library/ossaudiodev.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/ossaudiodev.rst:14 +msgid "" +"The last version of Python that provided the :mod:`!ossaudiodev` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!ossaudiodev` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/pickle.po b/library/pickle.po index 370cbe643d..4846877e33 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -240,8 +240,8 @@ msgid "" "Python programs may not be able to reconstruct pickled Python objects." msgstr "" ":mod:`pickle` 使用的資料格式是針對 Python 而設計的。好處是他不會受到外部標準" -"(像是 JSON,無法紀錄指標共用)的限制;不過這也代表其他不是 " -"Python 的程式可能無法重建 pickle 封裝的 Python 物件。" +"(像是 JSON,無法紀錄指標共用)的限制;不過這也代表其他不是 Python 的程式可能" +"無法重建 pickle 封裝的 Python 物件。" #: ../../library/pickle.rst:131 msgid "" @@ -267,8 +267,8 @@ msgid "" "The higher the protocol used, the more recent the version of Python needed " "to read the pickle produced." msgstr "" -"截至目前為止,共有六種不同版本的協定可用於封裝 pickle。數字越大版本代表你需" -"要使用越新的 Python 版本來拆封相應的 pickle 封裝。" +"截至目前為止,共有六種不同版本的協定可用於封裝 pickle。數字越大版本代表你需要" +"使用越新的 Python 版本來拆封相應的 pickle 封裝。" #: ../../library/pickle.rst:143 msgid "" @@ -411,8 +411,8 @@ msgid "" "Write the pickled representation of the object *obj* to the open :term:`file " "object` *file*. This is equivalent to ``Pickler(file, protocol).dump(obj)``." msgstr "" -"將被封裝成 pickle 形式的物件 *obj* 寫入到已開啟的\\ :term:`file object` *file*。" -"這等效於\\ ``Pickler(file, protocol).dump(obj)``。" +"將被封裝成 pickle 形式的物件 *obj* 寫入到已開啟的\\ :term:`file object` " +"*file*。這等效於\\ ``Pickler(file, protocol).dump(obj)``。" #: ../../library/pickle.rst:222 msgid "" @@ -432,7 +432,8 @@ msgid "" "Return the pickled representation of the object *obj* as a :class:`bytes` " "object, instead of writing it to a file." msgstr "" -"將被封裝為 pickle 形式的物件 *obj* 以 :class:`bytes` 類別回傳,而非寫入進檔案。" +"將被封裝為 pickle 形式的物件 *obj* 以 :class:`bytes` 類別回傳,而非寫入進檔" +"案。" #: ../../library/pickle.rst:233 msgid "" @@ -640,8 +641,7 @@ msgstr "關於細節與用法範例請見 :ref:`pickle-persistent`。" msgid "" "Add the default implementation of this method in the C implementation of :" "class:`!Pickler`." -msgstr "" -"在 C 的 class:`!Pickler` 實作中的增加了這個方法的預設實作。" +msgstr "在 C 的 :class:`!Pickler` 實作中的增加了這個方法的預設實作。" # SkyLull: [T] # dispatch table -> 調度表 @@ -1105,7 +1105,7 @@ msgid "" "``args`` which will be passed to the :meth:`__new__` method upon unpickling." msgstr "" "此方法與 :meth:`__getnewargs_ex__` 的目的一樣,但僅支援位置參數。它必須回傳一" -"個由傳入引數所組成的元組(tuple)``args``,這些引數會在拆封時傳遞給 :meth:" +"個由傳入引數所組成的元組(tuple)\\ ``args``,這些引數會在拆封時傳遞給 :meth:" "`__new__` 方法。" #: ../../library/pickle.rst:610 @@ -1318,8 +1318,8 @@ msgstr "" "可選項。一個用來提供連續項目的疊代器(而非序列)。這些項目將個別透過 ``obj." "append(item)`` 方法或成批次地透過 ``obj.extend(list_of_items)`` 方法被附加到" "物件中。主要用於串列(list)子類別,但只要其他類別具有相應的 :ref:`append 和 " -"extend 方法 `\\ 以及相同的函式簽章(signature)就也可以使用。 " -"(是否會調用 :meth:`!append` 或 :meth:`!extend` 方法將取決於所選用的 " +"extend 方法 `\\ 以及相同的函式簽章(signature)就也可以使" +"用。 (是否會調用 :meth:`!append` 或 :meth:`!extend` 方法將取決於所選用的 " "pickle 協定版本以及要附加的項目數量,因此必須同時支援這兩種方法。)" #: ../../library/pickle.rst:725 diff --git a/library/pipes.po b/library/pipes.po new file mode 100644 index 0000000000..5abbbde3db --- /dev/null +++ b/library/pipes.po @@ -0,0 +1,43 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/pipes.rst:2 +msgid ":mod:`!pipes` --- Interface to shell pipelines" +msgstr ":mod:`!pipes` --- shell pipelines 介面" + +#: ../../library/pipes.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/pipes.rst:14 +msgid "Applications should use the :mod:`subprocess` module instead." +msgstr "應用程式應改用 :mod:`subprocess` 模組。" + +#: ../../library/pipes.rst:16 +msgid "" +"The last version of Python that provided the :mod:`!pipes` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!pipes` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/pprint.po b/library/pprint.po index ce89afcb1b..4af5384160 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-11-15 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-" @@ -68,11 +68,11 @@ msgstr "" #: ../../library/pprint.rst:0 msgid "Parameters" -msgstr "" +msgstr "參數" #: ../../library/pprint.rst:46 msgid "The object to be printed." -msgstr "" +msgstr "將被印出的物件。" #: ../../library/pprint.rst:49 msgid "" @@ -164,7 +164,7 @@ msgstr "PrettyPrinter 物件" #: ../../library/pprint.rst:160 msgid "Construct a :class:`PrettyPrinter` instance." -msgstr "" +msgstr "建立一個 :class:`PrettyPrinter` 實例。" #: ../../library/pprint.rst:162 msgid "" @@ -190,7 +190,7 @@ msgstr "" #: ../../library/pprint.rst:202 msgid ":class:`PrettyPrinter` instances have the following methods:" -msgstr "" +msgstr ":class:`PrettyPrinter` 實例有以下方法:" #: ../../library/pprint.rst:207 msgid "" @@ -266,13 +266,13 @@ msgid "" ">>> import json\n" ">>> import pprint\n" ">>> from urllib.request import urlopen\n" -">>> with urlopen('https://pypi.org/pypi/sampleproject/json') as resp:\n" +">>> with urlopen('https://pypi.org/pypi/sampleproject/1.2.0/json') as resp:\n" "... project_info = json.load(resp)['info']" msgstr "" ">>> import json\n" ">>> import pprint\n" ">>> from urllib.request import urlopen\n" -">>> with urlopen('https://pypi.org/pypi/sampleproject/json') as resp:\n" +">>> with urlopen('https://pypi.org/pypi/sampleproject/1.2.0/json') as resp:\n" "... project_info = json.load(resp)['info']" #: ../../library/pprint.rst:273 diff --git a/library/removed.po b/library/removed.po new file mode 100644 index 0000000000..c13cb4637f --- /dev/null +++ b/library/removed.po @@ -0,0 +1,28 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/removed.rst:7 +msgid "Removed Modules" +msgstr "已移除的模組" + +#: ../../library/removed.rst:9 +msgid "" +"The modules described in this chapter have been removed from the Python " +"standard library. They are documented here to help people find replacements." +msgstr "" +"本章描述的模組已從 Python 標準函式庫中移除。這裡提供文件以協助尋找替代方案。" diff --git a/library/shutil.po b/library/shutil.po index 496e83ef0e..633b582f04 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2024-11-23 00:14+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-" @@ -568,9 +568,8 @@ msgstr "" "` ``shutil.chown``。" #: ../../library/shutil.rst:440 -#, fuzzy msgid "Added *dir_fd* and *follow_symlinks* parameters." -msgstr "新增 *follow_symlinks* 引數。" +msgstr "新增 *dir_fd* 和 *follow_symlinks* 參數。" #: ../../library/shutil.rst:446 msgid "" @@ -630,6 +629,8 @@ msgid "" ">> shutil.which(\"C:\\\\Python33\\\\python\")\n" "'C:\\\\Python33\\\\python.EXE'" msgstr "" +">> shutil.which(\"C:\\\\Python33\\\\python\")\n" +"'C:\\\\Python33\\\\python.EXE'" #: ../../library/shutil.rst:481 msgid "" @@ -648,25 +649,18 @@ msgid "" "now be found." msgstr "" -#: ../../library/shutil.rst:494 -msgid "" -"On Windows, if *mode* includes ``os.X_OK``, executables with an extension in " -"``PATHEXT`` will be preferred over executables without a matching extension. " -"This brings behavior closer to that of Python 3.11." -msgstr "" - -#: ../../library/shutil.rst:502 +#: ../../library/shutil.rst:496 msgid "" "This exception collects exceptions that are raised during a multi-file " "operation. For :func:`copytree`, the exception argument is a list of 3-" "tuples (*srcname*, *dstname*, *exception*)." msgstr "" -#: ../../library/shutil.rst:509 +#: ../../library/shutil.rst:503 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:511 +#: ../../library/shutil.rst:505 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -676,37 +670,37 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:519 +#: ../../library/shutil.rst:513 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:521 +#: ../../library/shutil.rst:515 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:523 +#: ../../library/shutil.rst:517 msgid "" "On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB " "instead of 64 KiB) and a :func:`memoryview`-based variant of :func:`shutil." "copyfileobj` is used." msgstr "" -#: ../../library/shutil.rst:527 +#: ../../library/shutil.rst:521 msgid "" "If the fast-copy operation fails and no data was written in the destination " "file then shutil will silently fallback on using less efficient :func:" "`copyfileobj` function internally." msgstr "" -#: ../../library/shutil.rst:536 +#: ../../library/shutil.rst:530 msgid "copytree example" -msgstr "" +msgstr "copytree 範例" -#: ../../library/shutil.rst:538 +#: ../../library/shutil.rst:532 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:540 +#: ../../library/shutil.rst:534 msgid "" "from shutil import copytree, ignore_patterns\n" "\n" @@ -716,17 +710,17 @@ msgstr "" "\n" "copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*'))" -#: ../../library/shutil.rst:544 +#: ../../library/shutil.rst:538 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:547 +#: ../../library/shutil.rst:541 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:549 +#: ../../library/shutil.rst:543 msgid "" "from shutil import copytree\n" "import logging\n" @@ -738,11 +732,11 @@ msgid "" "copytree(source, destination, ignore=_logpath)" msgstr "" -#: ../../library/shutil.rst:562 +#: ../../library/shutil.rst:556 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:564 +#: ../../library/shutil.rst:558 msgid "" "This example shows how to remove a directory tree on Windows where some of " "the files have their read-only bit set. It uses the onexc callback to clear " @@ -750,7 +744,7 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:569 +#: ../../library/shutil.rst:563 msgid "" "import os, stat\n" "import shutil\n" @@ -763,31 +757,31 @@ msgid "" "shutil.rmtree(directory, onexc=remove_readonly)" msgstr "" -#: ../../library/shutil.rst:582 +#: ../../library/shutil.rst:576 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:586 +#: ../../library/shutil.rst:580 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:590 +#: ../../library/shutil.rst:584 msgid "" "High-level utilities to create and read compressed and archived files are " "also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules." msgstr "" -#: ../../library/shutil.rst:595 +#: ../../library/shutil.rst:589 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:597 +#: ../../library/shutil.rst:591 msgid "" "*base_name* is the name of the file to create, including the path, minus any " "format-specific extension." msgstr "" -#: ../../library/shutil.rst:600 +#: ../../library/shutil.rst:594 msgid "" "*format* is the archive format: one of \"zip\" (if the :mod:`zlib` module is " "available), \"tar\", \"gztar\" (if the :mod:`zlib` module is available), " @@ -795,14 +789,14 @@ msgid "" "`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:605 +#: ../../library/shutil.rst:599 msgid "" "*root_dir* is a directory that will be the root directory of the archive, " "all paths in the archive will be relative to it; for example, we typically " "chdir into *root_dir* before creating the archive." msgstr "" -#: ../../library/shutil.rst:609 +#: ../../library/shutil.rst:603 msgid "" "*base_dir* is the directory where we start archiving from; i.e. *base_dir* " "will be the common prefix of all files and directories in the archive. " @@ -810,33 +804,33 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:615 +#: ../../library/shutil.rst:609 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:617 +#: ../../library/shutil.rst:611 msgid "" "If *dry_run* is true, no archive is created, but the operations that would " "be executed are logged to *logger*." msgstr "" -#: ../../library/shutil.rst:620 +#: ../../library/shutil.rst:614 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:623 +#: ../../library/shutil.rst:617 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:626 +#: ../../library/shutil.rst:620 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:628 +#: ../../library/shutil.rst:622 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." @@ -844,7 +838,7 @@ msgstr "" "引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的\\ :" "ref:`稽核事件 ` ``shutil.make_archive``。" -#: ../../library/shutil.rst:632 +#: ../../library/shutil.rst:626 msgid "" "This function is not thread-safe when custom archivers registered with :func:" "`register_archive_format` do not support the *root_dir* argument. In this " @@ -852,60 +846,60 @@ msgid "" "*root_dir* to perform archiving." msgstr "" -#: ../../library/shutil.rst:638 +#: ../../library/shutil.rst:632 msgid "" "The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU " "format for archives created with ``format=\"tar\"``." msgstr "" -#: ../../library/shutil.rst:642 +#: ../../library/shutil.rst:636 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: ../../library/shutil.rst:648 +#: ../../library/shutil.rst:642 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:651 ../../library/shutil.rst:762 +#: ../../library/shutil.rst:645 ../../library/shutil.rst:756 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:653 +#: ../../library/shutil.rst:647 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:654 +#: ../../library/shutil.rst:648 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:655 ../../library/shutil.rst:767 +#: ../../library/shutil.rst:649 ../../library/shutil.rst:761 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:656 ../../library/shutil.rst:768 +#: ../../library/shutil.rst:650 ../../library/shutil.rst:762 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:657 ../../library/shutil.rst:769 +#: ../../library/shutil.rst:651 ../../library/shutil.rst:763 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:659 +#: ../../library/shutil.rst:653 msgid "" "You can register new formats or provide your own archiver for any existing " "formats, by using :func:`register_archive_format`." msgstr "" -#: ../../library/shutil.rst:665 +#: ../../library/shutil.rst:659 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:667 +#: ../../library/shutil.rst:661 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive the *base_name* of the file to create, followed by the " @@ -914,7 +908,7 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:673 +#: ../../library/shutil.rst:667 msgid "" "If *function* has the custom attribute ``function.supports_root_dir`` set to " "``True``, the *root_dir* argument is passed as a keyword argument. Otherwise " @@ -923,37 +917,37 @@ msgid "" "not thread-safe." msgstr "" -#: ../../library/shutil.rst:679 +#: ../../library/shutil.rst:673 msgid "" "If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be " "used as extra keywords arguments when the archiver callable is used." msgstr "" -#: ../../library/shutil.rst:682 +#: ../../library/shutil.rst:676 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:685 +#: ../../library/shutil.rst:679 msgid "Added support for functions supporting the *root_dir* argument." msgstr "" -#: ../../library/shutil.rst:691 +#: ../../library/shutil.rst:685 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:696 +#: ../../library/shutil.rst:690 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:698 +#: ../../library/shutil.rst:692 msgid "" "*extract_dir* is the name of the target directory where the archive is " "unpacked. If not provided, the current working directory is used." msgstr "" -#: ../../library/shutil.rst:701 +#: ../../library/shutil.rst:695 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " "\"bztar\", or \"xztar\". Or any other format registered with :func:" @@ -962,7 +956,7 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:708 +#: ../../library/shutil.rst:702 msgid "" "The keyword-only *filter* argument is passed to the underlying unpacking " "function. For zip files, *filter* is not accepted. For tar files, it is " @@ -972,7 +966,7 @@ msgid "" "Python 3.14." msgstr "" -#: ../../library/shutil.rst:716 +#: ../../library/shutil.rst:710 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." @@ -980,7 +974,7 @@ msgstr "" "引發一個附帶引數 ``filename``、``extract_dir``、``format`` 的\\ :ref:`稽核事" "件 ` ``shutil.unpack_archive``。" -#: ../../library/shutil.rst:720 +#: ../../library/shutil.rst:714 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -988,91 +982,91 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: ../../library/shutil.rst:725 +#: ../../library/shutil.rst:719 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:728 +#: ../../library/shutil.rst:722 msgid "Added the *filter* argument." msgstr "新增 *filter* 引數。" -#: ../../library/shutil.rst:733 +#: ../../library/shutil.rst:727 msgid "" "Registers an unpack format. *name* is the name of the format and " "*extensions* is a list of extensions corresponding to the format, like ``." "zip`` for Zip files." msgstr "" -#: ../../library/shutil.rst:737 +#: ../../library/shutil.rst:731 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: ../../library/shutil.rst:740 +#: ../../library/shutil.rst:734 msgid "the path of the archive, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:741 +#: ../../library/shutil.rst:735 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:742 +#: ../../library/shutil.rst:736 msgid "" "possibly a *filter* keyword argument, if it was given to :func:" "`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:744 +#: ../../library/shutil.rst:738 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:747 +#: ../../library/shutil.rst:741 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:753 +#: ../../library/shutil.rst:747 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:758 +#: ../../library/shutil.rst:752 msgid "" "Return a list of all registered formats for unpacking. Each element of the " "returned sequence is a tuple ``(name, extensions, description)``." msgstr "" -#: ../../library/shutil.rst:764 +#: ../../library/shutil.rst:758 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:766 +#: ../../library/shutil.rst:760 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:771 +#: ../../library/shutil.rst:765 msgid "" "You can register new formats or provide your own unpacker for any existing " "formats, by using :func:`register_unpack_format`." msgstr "" -#: ../../library/shutil.rst:778 +#: ../../library/shutil.rst:772 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:780 +#: ../../library/shutil.rst:774 msgid "" "In this example, we create a gzip'ed tar-file archive containing all files " "found in the :file:`.ssh` directory of the user::" msgstr "" -#: ../../library/shutil.rst:783 +#: ../../library/shutil.rst:777 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1082,11 +1076,11 @@ msgid "" "'/Users/tarek/myarchive.tar.gz'" msgstr "" -#: ../../library/shutil.rst:790 +#: ../../library/shutil.rst:784 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:792 +#: ../../library/shutil.rst:786 msgid "" "$ tar -tzvf /Users/tarek/myarchive.tar.gz\n" "drwx------ tarek/staff 0 2010-02-01 16:23:40 ./\n" @@ -1108,18 +1102,18 @@ msgstr "" "-rw-r--r-- tarek/staff 397 2008-06-09 13:26:54 ./id_rsa.pub\n" "-rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts" -#: ../../library/shutil.rst:808 +#: ../../library/shutil.rst:802 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:810 +#: ../../library/shutil.rst:804 msgid "" "In this example, similar to the `one above `_, we " "show how to use :func:`make_archive`, but this time with the usage of " "*base_dir*. We now have the following directory structure:" msgstr "" -#: ../../library/shutil.rst:814 +#: ../../library/shutil.rst:808 msgid "" "$ tree tmp\n" "tmp\n" @@ -1137,13 +1131,13 @@ msgstr "" " └── please_add.txt\n" " └── do_not_add.txt" -#: ../../library/shutil.rst:824 +#: ../../library/shutil.rst:818 msgid "" "In the final archive, :file:`please_add.txt` should be included, but :file:" "`do_not_add.txt` should not. Therefore we use the following::" msgstr "" -#: ../../library/shutil.rst:827 +#: ../../library/shutil.rst:821 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1167,11 +1161,11 @@ msgstr "" "... )\n" "'/Users/tarek/my_archive.tar'" -#: ../../library/shutil.rst:838 +#: ../../library/shutil.rst:832 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:840 +#: ../../library/shutil.rst:834 msgid "" "$ python -m tarfile -l /Users/tarek/myarchive.tar\n" "structure/content/\n" @@ -1181,29 +1175,29 @@ msgstr "" "structure/content/\n" "structure/content/please_add.txt" -#: ../../library/shutil.rst:848 +#: ../../library/shutil.rst:842 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:852 +#: ../../library/shutil.rst:846 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:854 +#: ../../library/shutil.rst:848 msgid "" "For each of the two dimensions, the environment variable, ``COLUMNS`` and " "``LINES`` respectively, is checked. If the variable is defined and the value " "is a positive integer, it is used." msgstr "" -#: ../../library/shutil.rst:858 +#: ../../library/shutil.rst:852 msgid "" "When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the " "terminal connected to :data:`sys.__stdout__` is queried by invoking :func:" "`os.get_terminal_size`." msgstr "" -#: ../../library/shutil.rst:862 +#: ../../library/shutil.rst:856 msgid "" "If the terminal size cannot be successfully queried, either because the " "system doesn't support querying, or because we are not connected to a " @@ -1212,17 +1206,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:868 +#: ../../library/shutil.rst:862 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:870 +#: ../../library/shutil.rst:864 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:875 +#: ../../library/shutil.rst:869 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/library/smtpd.po b/library/smtpd.po new file mode 100644 index 0000000000..1bd616eb4c --- /dev/null +++ b/library/smtpd.po @@ -0,0 +1,47 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/smtpd.rst:2 +msgid ":mod:`!smtpd` --- SMTP Server" +msgstr ":mod:`!smtpd` --- SMTP 伺服器" + +#: ../../library/smtpd.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.12 ` after being deprecated in " +"Python 3.6. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.6 中被棄用,並\\ :" +"ref:`已在 Python 3.12 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/smtpd.rst:14 +msgid "" +"A possible replacement is the third-party :pypi:`aiosmtpd` library. This " +"library is not maintained or supported by the Python core team." +msgstr "" +"一個可能的替代方案是第三方 :pypi:`aiosmtpd` 函式庫。這個函式庫並不是由 " +"Python 核心團隊維護或支援。" + +#: ../../library/smtpd.rst:17 +msgid "" +"The last version of Python that provided the :mod:`!smtpd` module was " +"`Python 3.11 `_." +msgstr "" +"最後提供 :mod:`!smtpd` 模組的 Python 版本是 `Python 3.11 `_。" diff --git a/library/sndhdr.po b/library/sndhdr.po new file mode 100644 index 0000000000..1f2b9ff476 --- /dev/null +++ b/library/sndhdr.po @@ -0,0 +1,48 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/sndhdr.rst:2 +msgid ":mod:`!sndhdr` --- Determine type of sound file" +msgstr ":mod:`!sndhdr` --- 判定聲音檔案的種類" + +#: ../../library/sndhdr.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/sndhdr.rst:14 +msgid "" +"Possible replacements are third-party modules from PyPI: :pypi:`filetype`, :" +"pypi:`puremagic`, or :pypi:`python-magic`. These are not supported or " +"maintained by the Python core team." +msgstr "" +"可能的替代方案是 PyPI 上的第三方模組::pypi:`filetype`、:pypi:`puremagic` " +"或 :pypi:`python-magic`。它們並不受 Python 核心團隊支援或維護。" + +#: ../../library/sndhdr.rst:18 +msgid "" +"The last version of Python that provided the :mod:`!sndhdr` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!sndhdr` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/socket.po b/library/socket.po index 16a36ca0b5..c7e95f09c9 100644 --- a/library/socket.po +++ b/library/socket.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2024-11-23 00:14+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,22 +51,22 @@ msgstr "" #: ../../library/socket.rst:658 ../../library/socket.rst:667 #: ../../library/socket.rst:684 ../../library/socket.rst:699 #: ../../library/socket.rst:709 ../../library/socket.rst:898 -#: ../../library/socket.rst:994 ../../library/socket.rst:1010 -#: ../../library/socket.rst:1023 ../../library/socket.rst:1038 -#: ../../library/socket.rst:1055 ../../library/socket.rst:1066 -#: ../../library/socket.rst:1077 ../../library/socket.rst:1088 -#: ../../library/socket.rst:1177 ../../library/socket.rst:1197 -#: ../../library/socket.rst:1223 ../../library/socket.rst:1246 -#: ../../library/socket.rst:1275 ../../library/socket.rst:1286 -#: ../../library/socket.rst:1313 ../../library/socket.rst:1330 -#: ../../library/socket.rst:1347 ../../library/socket.rst:1361 -#: ../../library/socket.rst:1412 ../../library/socket.rst:1459 -#: ../../library/socket.rst:1473 ../../library/socket.rst:1493 -#: ../../library/socket.rst:1540 ../../library/socket.rst:1585 -#: ../../library/socket.rst:1715 ../../library/socket.rst:1759 -#: ../../library/socket.rst:1867 ../../library/socket.rst:1885 -#: ../../library/socket.rst:1969 ../../library/socket.rst:1979 -#: ../../library/socket.rst:1991 ../../includes/wasm-notavail.rst:3 +#: ../../library/socket.rst:1023 ../../library/socket.rst:1039 +#: ../../library/socket.rst:1052 ../../library/socket.rst:1067 +#: ../../library/socket.rst:1084 ../../library/socket.rst:1095 +#: ../../library/socket.rst:1106 ../../library/socket.rst:1117 +#: ../../library/socket.rst:1206 ../../library/socket.rst:1226 +#: ../../library/socket.rst:1252 ../../library/socket.rst:1275 +#: ../../library/socket.rst:1304 ../../library/socket.rst:1315 +#: ../../library/socket.rst:1342 ../../library/socket.rst:1359 +#: ../../library/socket.rst:1376 ../../library/socket.rst:1390 +#: ../../library/socket.rst:1441 ../../library/socket.rst:1488 +#: ../../library/socket.rst:1502 ../../library/socket.rst:1522 +#: ../../library/socket.rst:1569 ../../library/socket.rst:1614 +#: ../../library/socket.rst:1744 ../../library/socket.rst:1788 +#: ../../library/socket.rst:1896 ../../library/socket.rst:1914 +#: ../../library/socket.rst:1998 ../../library/socket.rst:2008 +#: ../../library/socket.rst:2020 ../../includes/wasm-notavail.rst:3 msgid "Availability" msgstr "" @@ -139,8 +139,8 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: ../../library/socket.rst:66 ../../library/socket.rst:1160 -#: ../../library/socket.rst:1202 ../../library/socket.rst:1963 +#: ../../library/socket.rst:66 ../../library/socket.rst:1189 +#: ../../library/socket.rst:1231 ../../library/socket.rst:1992 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -736,7 +736,7 @@ msgid "" "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: ../../library/socket.rst:579 ../../library/socket.rst:1575 +#: ../../library/socket.rst:579 ../../library/socket.rst:1604 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "加入 ``SIO_LOOPBACK_FAST_PATH``。" @@ -849,7 +849,7 @@ msgid "" msgstr "" #: ../../library/socket.rst:741 ../../library/socket.rst:887 -#: ../../library/socket.rst:1394 ../../library/socket.rst:1488 +#: ../../library/socket.rst:1423 ../../library/socket.rst:1517 msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" @@ -1078,6 +1078,11 @@ msgstr "" #: ../../library/socket.rst:925 msgid "" +"This function wraps the C function ``getaddrinfo`` of the underlying system." +msgstr "" + +#: ../../library/socket.rst:927 +msgid "" "Translate the *host*/*port* argument into a sequence of 5-tuples that " "contain all the necessary arguments for creating a socket connected to that " "service. *host* is a domain name, a string representation of an IPv4/v6 " @@ -1086,26 +1091,31 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" -#: ../../library/socket.rst:932 +#: ../../library/socket.rst:934 msgid "" "The *family*, *type* and *proto* arguments can be optionally specified in " -"order to narrow the list of addresses returned. Passing zero as a value for " -"each of these arguments selects the full range of results. The *flags* " -"argument can be one or several of the ``AI_*`` constants, and will influence " -"how results are computed and returned. For example, :const:`AI_NUMERICHOST` " -"will disable domain name resolution and will raise an error if *host* is a " -"domain name." +"order to provide options and limit the list of addresses returned. Pass " +"their default values (:data:`AF_UNSPEC`, 0, and 0, respectively) to not " +"limit the results. See the note below for details." msgstr "" -#: ../../library/socket.rst:940 +#: ../../library/socket.rst:939 +msgid "" +"The *flags* argument can be one or several of the ``AI_*`` constants, and " +"will influence how results are computed and returned. For example, :const:" +"`AI_NUMERICHOST` will disable domain name resolution and will raise an error " +"if *host* is a domain name." +msgstr "" + +#: ../../library/socket.rst:944 msgid "The function returns a list of 5-tuples with the following structure:" msgstr "" -#: ../../library/socket.rst:942 +#: ../../library/socket.rst:946 msgid "``(family, type, proto, canonname, sockaddr)``" msgstr "``(family, type, proto, canonname, sockaddr)``" -#: ../../library/socket.rst:944 +#: ../../library/socket.rst:948 msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " "be passed to the :func:`~socket.socket` function. *canonname* will be a " @@ -1117,7 +1127,39 @@ msgid "" "`AF_INET6`), and is meant to be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:954 +#: ../../library/socket.rst:960 +msgid "" +"If you intend to use results from :func:`!getaddrinfo` to create a socket " +"(rather than, for example, retrieve *canonname*), consider limiting the " +"results by *type* (e.g. :data:`SOCK_STREAM` or :data:`SOCK_DGRAM`) and/or " +"*proto* (e.g. :data:`IPPROTO_TCP` or :data:`IPPROTO_UDP`) that your " +"application can handle." +msgstr "" + +#: ../../library/socket.rst:966 +msgid "" +"The behavior with default values of *family*, *type*, *proto* and *flags* is " +"system-specific." +msgstr "" + +#: ../../library/socket.rst:969 +msgid "" +"Many systems (for example, most Linux configurations) will return a sorted " +"list of all matching addresses. These addresses should generally be tried in " +"order until a connection succeeds (possibly tried in parallel, for example, " +"using a `Happy Eyeballs`_ algorithm). In these cases, limiting the *type* " +"and/or *proto* can help eliminate unsuccessful or unusable connection " +"attempts." +msgstr "" + +#: ../../library/socket.rst:976 +msgid "" +"Some systems will, however, only return a single address. (For example, this " +"was reported on Solaris and AIX configurations.) On these systems, limiting " +"the *type* and/or *proto* helps ensure that this address is usable." +msgstr "" + +#: ../../library/socket.rst:981 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." @@ -1125,14 +1167,14 @@ msgstr "" "引發一個附帶引數 ``host``、``port``、``family``、``type``、``protocol`` 的" "\\ :ref:`稽核事件 ` ``socket.getaddrinfo``。" -#: ../../library/socket.rst:956 +#: ../../library/socket.rst:983 msgid "" "The following example fetches address information for a hypothetical TCP " "connection to ``example.org`` on port 80 (results may differ on your system " "if IPv6 isn't enabled)::" msgstr "" -#: ../../library/socket.rst:960 +#: ../../library/socket.rst:987 msgid "" ">>> socket.getaddrinfo(\"example.org\", 80, proto=socket.IPPROTO_TCP)\n" "[(socket.AF_INET6, socket.SOCK_STREAM,\n" @@ -1146,17 +1188,17 @@ msgstr "" " (socket.AF_INET, socket.SOCK_STREAM,\n" " 6, '', ('93.184.216.34', 80))]" -#: ../../library/socket.rst:966 +#: ../../library/socket.rst:993 msgid "parameters can now be passed using keyword arguments." msgstr "" -#: ../../library/socket.rst:969 +#: ../../library/socket.rst:996 msgid "" "for IPv6 multicast addresses, string representing an address will not " "contain ``%scope_id`` part." msgstr "" -#: ../../library/socket.rst:975 +#: ../../library/socket.rst:1004 msgid "" "Return a fully qualified domain name for *name*. If *name* is omitted or " "empty, it is interpreted as the local host. To find the fully qualified " @@ -1167,7 +1209,7 @@ msgid "" "``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." msgstr "" -#: ../../library/socket.rst:986 +#: ../../library/socket.rst:1015 msgid "" "Translate a host name to IPv4 address format. The IPv4 address is returned " "as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " @@ -1177,7 +1219,7 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:992 ../../library/socket.rst:1008 +#: ../../library/socket.rst:1021 ../../library/socket.rst:1037 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." @@ -1185,7 +1227,7 @@ msgstr "" "引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyname``。" -#: ../../library/socket.rst:999 +#: ../../library/socket.rst:1028 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a 3-" "tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " @@ -1197,26 +1239,26 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:1015 +#: ../../library/socket.rst:1044 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:1018 +#: ../../library/socket.rst:1047 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``socket.gethostname``。" -#: ../../library/socket.rst:1020 +#: ../../library/socket.rst:1049 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: ../../library/socket.rst:1028 +#: ../../library/socket.rst:1057 msgid "" "Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1227,7 +1269,7 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:1036 +#: ../../library/socket.rst:1065 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." @@ -1235,7 +1277,7 @@ msgstr "" "引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyaddr``。" -#: ../../library/socket.rst:1043 +#: ../../library/socket.rst:1072 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully " @@ -1243,18 +1285,18 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: ../../library/socket.rst:1048 +#: ../../library/socket.rst:1077 msgid "" "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* " "contains meaningful *scope_id*. Usually this happens for multicast addresses." msgstr "" -#: ../../library/socket.rst:1051 +#: ../../library/socket.rst:1080 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:1053 +#: ../../library/socket.rst:1082 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." @@ -1262,7 +1304,7 @@ msgstr "" "引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` ``socket." "getnameinfo``。" -#: ../../library/socket.rst:1060 +#: ../../library/socket.rst:1089 msgid "" "Translate an internet protocol name (for example, ``'icmp'``) to a constant " "suitable for passing as the (optional) third argument to the :func:`~socket." @@ -1271,14 +1313,14 @@ msgid "" "is chosen automatically if the protocol is omitted or zero." msgstr "" -#: ../../library/socket.rst:1071 +#: ../../library/socket.rst:1100 msgid "" "Translate an internet service name and protocol name to a port number for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1075 +#: ../../library/socket.rst:1104 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." @@ -1286,14 +1328,14 @@ msgstr "" "引發一個附帶引數 ``sockaddr``、``protocolname`` 的\\ :ref:`稽核事件 " "` ``socket.getservbyname``。" -#: ../../library/socket.rst:1082 +#: ../../library/socket.rst:1111 msgid "" "Translate an internet port number and protocol name to a service name for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1086 +#: ../../library/socket.rst:1115 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." @@ -1301,40 +1343,40 @@ msgstr "" "引發一個附帶引數 ``port``、``protocolname`` 的\\ :ref:`稽核事件 ` " "``socket.getservbyport``。" -#: ../../library/socket.rst:1093 +#: ../../library/socket.rst:1122 msgid "" "Convert 32-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1100 +#: ../../library/socket.rst:1129 msgid "" "Convert 16-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1104 ../../library/socket.rst:1122 +#: ../../library/socket.rst:1133 ../../library/socket.rst:1151 msgid "" "Raises :exc:`OverflowError` if *x* does not fit in a 16-bit unsigned integer." msgstr "" -#: ../../library/socket.rst:1111 +#: ../../library/socket.rst:1140 msgid "" "Convert 32-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1118 +#: ../../library/socket.rst:1147 msgid "" "Convert 16-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1129 +#: ../../library/socket.rst:1158 msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " @@ -1343,26 +1385,26 @@ msgid "" "which is the C type for the 32-bit packed binary this function returns." msgstr "" -#: ../../library/socket.rst:1135 +#: ../../library/socket.rst:1164 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -#: ../../library/socket.rst:1138 +#: ../../library/socket.rst:1167 msgid "" "If the IPv4 address string passed to this function is invalid, :exc:" "`OSError` will be raised. Note that exactly what is valid depends on the " "underlying C implementation of :c:func:`inet_aton`." msgstr "" -#: ../../library/socket.rst:1142 +#: ../../library/socket.rst:1171 msgid "" ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " "used instead for IPv4/v6 dual stack support." msgstr "" -#: ../../library/socket.rst:1148 +#: ../../library/socket.rst:1177 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1372,7 +1414,7 @@ msgid "" "argument." msgstr "" -#: ../../library/socket.rst:1155 +#: ../../library/socket.rst:1184 msgid "" "If the byte sequence passed to this function is not exactly 4 bytes in " "length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " @@ -1380,7 +1422,7 @@ msgid "" "support." msgstr "" -#: ../../library/socket.rst:1166 +#: ../../library/socket.rst:1195 msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " @@ -1388,7 +1430,7 @@ msgid "" "`inet_aton`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1171 +#: ../../library/socket.rst:1200 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" @@ -1397,11 +1439,11 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:1179 ../../library/socket.rst:1199 +#: ../../library/socket.rst:1208 ../../library/socket.rst:1228 msgid "Windows support added" msgstr "" -#: ../../library/socket.rst:1185 +#: ../../library/socket.rst:1214 msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " @@ -1410,7 +1452,7 @@ msgid "" "(similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1192 +#: ../../library/socket.rst:1221 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " @@ -1418,7 +1460,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: ../../library/socket.rst:1214 +#: ../../library/socket.rst:1243 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1429,12 +1471,12 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1225 ../../library/socket.rst:1717 -#: ../../library/socket.rst:1761 ../../library/socket.rst:1869 +#: ../../library/socket.rst:1254 ../../library/socket.rst:1746 +#: ../../library/socket.rst:1790 ../../library/socket.rst:1898 msgid "Most Unix platforms." msgstr "" -#: ../../library/socket.rst:1232 +#: ../../library/socket.rst:1261 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1444,7 +1486,7 @@ msgid "" "values." msgstr "" -#: ../../library/socket.rst:1240 +#: ../../library/socket.rst:1269 msgid "" "Note that some systems might support ancillary data without providing this " "function. Also note that setting the buffer size using the results of this " @@ -1452,31 +1494,31 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: ../../library/socket.rst:1248 +#: ../../library/socket.rst:1277 msgid "most Unix platforms." msgstr "" -#: ../../library/socket.rst:1255 +#: ../../library/socket.rst:1284 msgid "" "Return the default timeout in seconds (float) for new socket objects. A " "value of ``None`` indicates that new socket objects have no timeout. When " "the socket module is first imported, the default is ``None``." msgstr "" -#: ../../library/socket.rst:1262 +#: ../../library/socket.rst:1291 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " "socket module is first imported, the default is ``None``. See :meth:" "`~socket.settimeout` for possible values and their respective meanings." msgstr "" -#: ../../library/socket.rst:1270 +#: ../../library/socket.rst:1299 msgid "" "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " "you don't have enough rights." msgstr "" -#: ../../library/socket.rst:1273 +#: ../../library/socket.rst:1302 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." @@ -1484,102 +1526,102 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1282 +#: ../../library/socket.rst:1311 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1290 ../../library/socket.rst:1317 -#: ../../library/socket.rst:1334 +#: ../../library/socket.rst:1319 ../../library/socket.rst:1346 +#: ../../library/socket.rst:1363 msgid "Windows support was added." msgstr "增加對 Windows 的支援。" -#: ../../library/socket.rst:1295 +#: ../../library/socket.rst:1324 msgid "" "On Windows network interfaces have different names in different contexts " "(all names are examples):" msgstr "" -#: ../../library/socket.rst:1298 +#: ../../library/socket.rst:1327 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgstr "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" -#: ../../library/socket.rst:1299 +#: ../../library/socket.rst:1328 msgid "name: ``ethernet_32770``" msgstr "" -#: ../../library/socket.rst:1300 +#: ../../library/socket.rst:1329 msgid "friendly name: ``vEthernet (nat)``" msgstr "" -#: ../../library/socket.rst:1301 +#: ../../library/socket.rst:1330 msgid "description: ``Hyper-V Virtual Ethernet Adapter``" msgstr "" -#: ../../library/socket.rst:1303 +#: ../../library/socket.rst:1332 msgid "" "This function returns names of the second form from the list, " "``ethernet_32770`` in this example case." msgstr "" -#: ../../library/socket.rst:1309 +#: ../../library/socket.rst:1338 msgid "" "Return a network interface index number corresponding to an interface name. :" "exc:`OSError` if no interface with the given name exists." msgstr "" -#: ../../library/socket.rst:1321 ../../library/socket.rst:1338 +#: ../../library/socket.rst:1350 ../../library/socket.rst:1367 msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" -#: ../../library/socket.rst:1326 +#: ../../library/socket.rst:1355 msgid "" "Return a network interface name corresponding to an interface index number. :" "exc:`OSError` if no interface with the given index exists." msgstr "" -#: ../../library/socket.rst:1343 +#: ../../library/socket.rst:1372 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " "*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" "`~socket.sendmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1349 ../../library/socket.rst:1363 +#: ../../library/socket.rst:1378 ../../library/socket.rst:1392 msgid "" "Unix platforms supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` " "mechanism." msgstr "" -#: ../../library/socket.rst:1357 +#: ../../library/socket.rst:1386 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " "*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`~socket." "recvmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1370 +#: ../../library/socket.rst:1399 msgid "Any truncated integers at the end of the list of file descriptors." msgstr "" -#: ../../library/socket.rst:1376 +#: ../../library/socket.rst:1405 msgid "Socket Objects" msgstr "Socket 物件" -#: ../../library/socket.rst:1378 +#: ../../library/socket.rst:1407 msgid "" "Socket objects have the following methods. Except for :meth:`~socket." "makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" -#: ../../library/socket.rst:1382 +#: ../../library/socket.rst:1411 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`~socket.close`." msgstr "" -#: ../../library/socket.rst:1389 +#: ../../library/socket.rst:1418 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value is a pair ``(conn, address)`` where *conn* " @@ -1588,27 +1630,27 @@ msgid "" "connection." msgstr "" -#: ../../library/socket.rst:1396 ../../library/socket.rst:1490 +#: ../../library/socket.rst:1425 ../../library/socket.rst:1519 msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1399 ../../library/socket.rst:1630 -#: ../../library/socket.rst:1644 ../../library/socket.rst:1721 -#: ../../library/socket.rst:1794 ../../library/socket.rst:1813 -#: ../../library/socket.rst:1830 ../../library/socket.rst:1875 +#: ../../library/socket.rst:1428 ../../library/socket.rst:1659 +#: ../../library/socket.rst:1673 ../../library/socket.rst:1750 +#: ../../library/socket.rst:1823 ../../library/socket.rst:1842 +#: ../../library/socket.rst:1859 ../../library/socket.rst:1904 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" "`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1407 +#: ../../library/socket.rst:1436 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1410 +#: ../../library/socket.rst:1439 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." @@ -1616,7 +1658,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.bind``。" -#: ../../library/socket.rst:1417 +#: ../../library/socket.rst:1446 msgid "" "Mark the socket closed. The underlying system resource (e.g. a file " "descriptor) is also closed when all file objects from :meth:`makefile` are " @@ -1625,33 +1667,33 @@ msgid "" "flushed)." msgstr "" -#: ../../library/socket.rst:1423 +#: ../../library/socket.rst:1452 msgid "" "Sockets are automatically closed when they are garbage-collected, but it is " "recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " "statement around them." msgstr "" -#: ../../library/socket.rst:1427 +#: ../../library/socket.rst:1456 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`close` call is made." msgstr "" -#: ../../library/socket.rst:1433 +#: ../../library/socket.rst:1462 msgid "" ":meth:`close` releases the resource associated with a connection but does " "not necessarily close the connection immediately. If you want to close the " "connection in a timely fashion, call :meth:`shutdown` before :meth:`close`." msgstr "" -#: ../../library/socket.rst:1441 +#: ../../library/socket.rst:1470 msgid "" "Connect to a remote socket at *address*. (The format of *address* depends on " "the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1444 +#: ../../library/socket.rst:1473 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`TimeoutError` on timeout, if the " @@ -1661,7 +1703,7 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1451 ../../library/socket.rst:1471 +#: ../../library/socket.rst:1480 ../../library/socket.rst:1500 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." @@ -1669,7 +1711,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.connect``。" -#: ../../library/socket.rst:1453 +#: ../../library/socket.rst:1482 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1677,7 +1719,7 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1464 +#: ../../library/socket.rst:1493 msgid "" "Like ``connect(address)``, but return an error indicator instead of raising " "an exception for errors returned by the C-level :c:func:`connect` call " @@ -1687,38 +1729,38 @@ msgid "" "asynchronous connects." msgstr "" -#: ../../library/socket.rst:1477 +#: ../../library/socket.rst:1506 msgid "" "Put the socket object into closed state without actually closing the " "underlying file descriptor. The file descriptor is returned, and can be " "reused for other purposes." msgstr "" -#: ../../library/socket.rst:1486 +#: ../../library/socket.rst:1515 msgid "Duplicate the socket." msgstr "" -#: ../../library/socket.rst:1498 +#: ../../library/socket.rst:1527 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -#: ../../library/socket.rst:1501 +#: ../../library/socket.rst:1530 msgid "" "Under Windows the small integer returned by this method cannot be used where " "a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " "have this limitation." msgstr "" -#: ../../library/socket.rst:1507 +#: ../../library/socket.rst:1536 msgid "" "Get the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle: ``True`` if the socket can be inherited in " "child processes, ``False`` if it cannot." msgstr "" -#: ../../library/socket.rst:1516 +#: ../../library/socket.rst:1545 msgid "" "Return the remote address to which the socket is connected. This is useful " "to find out the port number of a remote IPv4/v6 socket, for instance. (The " @@ -1726,14 +1768,14 @@ msgid "" "above.) On some systems this function is not supported." msgstr "" -#: ../../library/socket.rst:1524 +#: ../../library/socket.rst:1553 msgid "" "Return the socket's own address. This is useful to find out the port number " "of an IPv4/v6 socket, for instance. (The format of the address returned " "depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1531 +#: ../../library/socket.rst:1560 msgid "" "Return the value of the given socket option (see the Unix man page :manpage:" "`getsockopt(2)`). The needed symbolic constants (:ref:`SO_\\* etc. `_ for more information." msgstr "" -#: ../../library/socket.rst:1569 +#: ../../library/socket.rst:1598 msgid "" "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " "functions may be used; they accept a socket object as their first argument." msgstr "" -#: ../../library/socket.rst:1572 +#: ../../library/socket.rst:1601 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: ../../library/socket.rst:1580 +#: ../../library/socket.rst:1609 msgid "" "Enable a server to accept connections. If *backlog* is specified, it must " "be at least 0 (if it is lower, it is set to 0); it specifies the number of " @@ -1797,11 +1839,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: ../../library/socket.rst:1587 +#: ../../library/socket.rst:1616 msgid "The *backlog* parameter is now optional." msgstr "" -#: ../../library/socket.rst:1596 +#: ../../library/socket.rst:1625 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1810,28 +1852,28 @@ msgid "" "``'b'``, or a combination of those." msgstr "" -#: ../../library/socket.rst:1602 +#: ../../library/socket.rst:1631 msgid "" "The socket must be in blocking mode; it can have a timeout, but the file " "object's internal buffer may end up in an inconsistent state if a timeout " "occurs." msgstr "" -#: ../../library/socket.rst:1606 +#: ../../library/socket.rst:1635 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " "original socket unless all other file objects have been closed and :meth:" "`socket.close` has been called on the socket object." msgstr "" -#: ../../library/socket.rst:1612 +#: ../../library/socket.rst:1641 msgid "" "On Windows, the file-like object created by :meth:`makefile` cannot be used " "where a file object with a file descriptor is expected, such as the stream " "arguments of :meth:`subprocess.Popen`." msgstr "" -#: ../../library/socket.rst:1619 +#: ../../library/socket.rst:1648 msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " @@ -1841,13 +1883,13 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1627 +#: ../../library/socket.rst:1656 msgid "" "For best match with hardware and network realities, the value of *bufsize* " "should be a relatively small power of 2, for example, 4096." msgstr "" -#: ../../library/socket.rst:1638 +#: ../../library/socket.rst:1667 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1857,14 +1899,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1649 +#: ../../library/socket.rst:1678 msgid "" "For multicast IPv6 address, first item of *address* does not contain " "``%scope_id`` part anymore. In order to get full IPv6 address use :func:" "`getnameinfo`." msgstr "" -#: ../../library/socket.rst:1656 +#: ../../library/socket.rst:1685 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1875,7 +1917,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1666 +#: ../../library/socket.rst:1695 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1890,7 +1932,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1680 +#: ../../library/socket.rst:1709 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " @@ -1903,7 +1945,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1691 +#: ../../library/socket.rst:1720 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " @@ -1912,7 +1954,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1698 +#: ../../library/socket.rst:1727 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1921,7 +1963,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1704 +#: ../../library/socket.rst:1733 msgid "" "import socket, array\n" "\n" @@ -1938,7 +1980,7 @@ msgid "" " return msg, list(fds)" msgstr "" -#: ../../library/socket.rst:1729 +#: ../../library/socket.rst:1758 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -1951,7 +1993,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1740 +#: ../../library/socket.rst:1769 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -1959,11 +2001,11 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1745 +#: ../../library/socket.rst:1774 msgid "Example::" msgstr "範例: ::" -#: ../../library/socket.rst:1747 +#: ../../library/socket.rst:1776 msgid "" ">>> import socket\n" ">>> s1, s2 = socket.socketpair()\n" @@ -1989,7 +2031,7 @@ msgstr "" ">>> [b1, b2, b3]\n" "[bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')]" -#: ../../library/socket.rst:1768 +#: ../../library/socket.rst:1797 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -1999,7 +2041,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1778 +#: ../../library/socket.rst:1807 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -2008,7 +2050,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1787 +#: ../../library/socket.rst:1816 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -2018,7 +2060,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1802 +#: ../../library/socket.rst:1831 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -2028,13 +2070,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1809 +#: ../../library/socket.rst:1838 msgid "" "The socket timeout is no longer reset each time data is sent successfully. " "The socket timeout is now the maximum total duration to send all data." msgstr "" -#: ../../library/socket.rst:1822 +#: ../../library/socket.rst:1851 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -2043,7 +2085,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1828 +#: ../../library/socket.rst:1857 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -2051,7 +2093,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendto``。" -#: ../../library/socket.rst:1838 +#: ../../library/socket.rst:1867 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " @@ -2071,14 +2113,14 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1858 +#: ../../library/socket.rst:1887 msgid "" "The following function sends the list of file descriptors *fds* over an :" "const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1862 +#: ../../library/socket.rst:1891 msgid "" "import socket, array\n" "\n" @@ -2092,7 +2134,7 @@ msgstr "" " return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array." "array(\"i\", fds))])" -#: ../../library/socket.rst:1871 +#: ../../library/socket.rst:1900 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." @@ -2100,14 +2142,14 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendmsg``。" -#: ../../library/socket.rst:1882 +#: ../../library/socket.rst:1911 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: ../../library/socket.rst:1891 +#: ../../library/socket.rst:1920 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -2121,38 +2163,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1907 +#: ../../library/socket.rst:1936 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1915 +#: ../../library/socket.rst:1944 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: ../../library/socket.rst:1918 +#: ../../library/socket.rst:1947 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1920 +#: ../../library/socket.rst:1949 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "``sock.setblocking(True)`` 等價於 ``sock.settimeout(None)``" -#: ../../library/socket.rst:1922 +#: ../../library/socket.rst:1951 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" -#: ../../library/socket.rst:1924 +#: ../../library/socket.rst:1953 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1931 +#: ../../library/socket.rst:1960 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating-point number expressing seconds, or ``None``. If a non-" @@ -2162,19 +2204,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1938 +#: ../../library/socket.rst:1967 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1940 +#: ../../library/socket.rst:1969 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1953 +#: ../../library/socket.rst:1982 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in this module " @@ -2187,11 +2229,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1966 +#: ../../library/socket.rst:1995 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:1974 +#: ../../library/socket.rst:2003 msgid "" "Shut down one or both halves of the connection. If *how* is :const:" "`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " @@ -2199,7 +2241,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:1984 +#: ../../library/socket.rst:2013 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " @@ -2210,48 +2252,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:1996 +#: ../../library/socket.rst:2025 msgid "" "Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: ../../library/socket.rst:1999 +#: ../../library/socket.rst:2028 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:2005 +#: ../../library/socket.rst:2034 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:2010 +#: ../../library/socket.rst:2039 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:2015 +#: ../../library/socket.rst:2044 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:2022 +#: ../../library/socket.rst:2051 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:2024 +#: ../../library/socket.rst:2053 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:2028 +#: ../../library/socket.rst:2057 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:2031 +#: ../../library/socket.rst:2060 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2259,14 +2301,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:2036 +#: ../../library/socket.rst:2065 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:2041 +#: ../../library/socket.rst:2070 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2275,11 +2317,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno` of a socket." msgstr "" -#: ../../library/socket.rst:2048 +#: ../../library/socket.rst:2077 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:2050 +#: ../../library/socket.rst:2079 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2289,24 +2331,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:2058 +#: ../../library/socket.rst:2087 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:2060 +#: ../../library/socket.rst:2089 msgid "" "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" "meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " "depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:2064 +#: ../../library/socket.rst:2093 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:2067 +#: ../../library/socket.rst:2096 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2314,11 +2356,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:2076 +#: ../../library/socket.rst:2105 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:2078 +#: ../../library/socket.rst:2107 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " @@ -2331,11 +2373,11 @@ msgid "" "on the new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:2088 +#: ../../library/socket.rst:2117 msgid "The first two examples support IPv4 only. ::" msgstr "前兩個範例只支援 IPv4: ::" -#: ../../library/socket.rst:2090 +#: ../../library/socket.rst:2119 msgid "" "# Echo server program\n" "import socket\n" @@ -2354,7 +2396,7 @@ msgid "" " conn.sendall(data)" msgstr "" -#: ../../library/socket.rst:2108 +#: ../../library/socket.rst:2137 msgid "" "# Echo client program\n" "import socket\n" @@ -2368,7 +2410,7 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2119 +#: ../../library/socket.rst:2148 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2378,7 +2420,7 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2126 +#: ../../library/socket.rst:2155 msgid "" "# Echo server program\n" "import socket\n" @@ -2415,7 +2457,7 @@ msgid "" " conn.send(data)" msgstr "" -#: ../../library/socket.rst:2162 +#: ../../library/socket.rst:2191 msgid "" "# Echo client program\n" "import socket\n" @@ -2448,14 +2490,14 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2191 +#: ../../library/socket.rst:2220 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:2195 +#: ../../library/socket.rst:2224 msgid "" "import socket\n" "\n" @@ -2479,29 +2521,29 @@ msgid "" "s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)" msgstr "" -#: ../../library/socket.rst:2216 +#: ../../library/socket.rst:2245 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:2220 +#: ../../library/socket.rst:2249 msgid "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" msgstr "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" -#: ../../library/socket.rst:2222 +#: ../../library/socket.rst:2251 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:2226 +#: ../../library/socket.rst:2255 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2228 +#: ../../library/socket.rst:2257 msgid "" "import socket\n" "import struct\n" @@ -2543,29 +2585,29 @@ msgid "" " print('Error sending CAN frame')" msgstr "" -#: ../../library/socket.rst:2266 +#: ../../library/socket.rst:2295 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2269 +#: ../../library/socket.rst:2298 msgid "OSError: [Errno 98] Address already in use" msgstr "OSError: [Errno 98] Address already in use" -#: ../../library/socket.rst:2271 +#: ../../library/socket.rst:2300 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2274 +#: ../../library/socket.rst:2303 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2277 +#: ../../library/socket.rst:2306 msgid "" "s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" @@ -2575,30 +2617,30 @@ msgstr "" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" "s.bind((HOST, PORT))" -#: ../../library/socket.rst:2281 +#: ../../library/socket.rst:2310 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2287 +#: ../../library/socket.rst:2316 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2289 +#: ../../library/socket.rst:2318 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2291 +#: ../../library/socket.rst:2320 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2294 +#: ../../library/socket.rst:2323 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " @@ -2617,18 +2659,18 @@ msgstr "object(物件)" msgid "socket" msgstr "socket" -#: ../../library/socket.rst:1594 +#: ../../library/socket.rst:1623 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/socket.rst:1594 +#: ../../library/socket.rst:1623 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:1951 +#: ../../library/socket.rst:1980 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:1951 +#: ../../library/socket.rst:1980 msgid "struct" msgstr "struct" diff --git a/library/spwd.po b/library/spwd.po new file mode 100644 index 0000000000..adcb3a7591 --- /dev/null +++ b/library/spwd.po @@ -0,0 +1,47 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/spwd.rst:2 +msgid ":mod:`!spwd` --- The shadow password database" +msgstr ":mod:`!spwd` --- shadow 密碼資料庫" + +#: ../../library/spwd.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/spwd.rst:14 +msgid "" +"A possible replacement is the third-party library :pypi:`python-pam`. This " +"library is not supported or maintained by the Python core team." +msgstr "" +"可能的替代方案是 PyPI 上的第三方函式庫::pypi:`python-pam`。這並不受 Python " +"核心團隊支援或維護。" + +#: ../../library/spwd.rst:17 +msgid "" +"The last version of Python that provided the :mod:`!spwd` module was `Python " +"3.12 `_." +msgstr "" +"最後提供 :mod:`!spwd` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/sqlite3.po b/library/sqlite3.po index 7d1f66f4ea..509dad97ff 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -720,11 +720,11 @@ msgstr "" #: ../../library/sqlite3.rst:529 msgid "SQLite threading mode" -msgstr "" +msgstr "SQLite 執行緒模式" #: ../../library/sqlite3.rst:529 msgid ":pep:`threadsafety <0249#threadsafety>`" -msgstr "" +msgstr ":pep:`執行緒安全 <0249#threadsafety>`" #: ../../library/sqlite3.rst:529 msgid "`SQLITE_THREADSAFE`_" diff --git a/library/stdtypes.po b/library/stdtypes.po index 7421a5e216..332f14e2f5 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -6861,9 +6861,10 @@ msgid "" msgstr "" "``GenericAlias`` 物件通常是透過\\ :ref:`下標 (subscripting) ` " "一個類別來建立的。它們最常與\\ :ref:`容器類別 ` 一起使用,像" -"是 :class:`list` 或 :class:`dict`。例如 ``list[int]`` 是一個``GenericAlias`` " -"物件,它是透過使用引數 :class:`int` 來下標 ``list`` 類別而建立的。" -"``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使用。" +"是 :class:`list` 或 :class:`dict`。例如 ``list[int]`` 是一個 " +"``GenericAlias`` 物件,它是透過使用引數 :class:`int` 來下標 ``list`` 類別而建" +"立的。``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使" +"用。" #: ../../library/stdtypes.rst:4928 msgid "" diff --git a/library/sunau.po b/library/sunau.po new file mode 100644 index 0000000000..b980962514 --- /dev/null +++ b/library/sunau.po @@ -0,0 +1,40 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/sunau.rst:2 +msgid ":mod:`!sunau` --- Read and write Sun AU files" +msgstr ":mod:`!sunau` --- 讀寫 Sun AU 檔案" + +#: ../../library/sunau.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/sunau.rst:14 +msgid "" +"The last version of Python that provided the :mod:`!sunau` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!sunau` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/sys.po b/library/sys.po index 096b946f75..0cafa0cde7 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2024-11-13 00:13+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,10 +44,10 @@ msgstr "" #: ../../library/sys.rst:25 ../../library/sys.rst:299 ../../library/sys.rst:369 #: ../../library/sys.rst:760 ../../library/sys.rst:778 -#: ../../library/sys.rst:991 ../../library/sys.rst:1490 -#: ../../library/sys.rst:1731 ../../library/sys.rst:1746 -#: ../../library/sys.rst:1754 ../../library/sys.rst:1770 -#: ../../library/sys.rst:2014 +#: ../../library/sys.rst:1020 ../../library/sys.rst:1519 +#: ../../library/sys.rst:1760 ../../library/sys.rst:1775 +#: ../../library/sys.rst:1783 ../../library/sys.rst:1799 +#: ../../library/sys.rst:2043 msgid "Availability" msgstr "" @@ -1177,15 +1177,48 @@ msgstr "" "引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." "_getframemodulename``。" +#: ../../library/sys.rst:925 +msgid "" +"This function only exists if CPython was built using the specialized " +"configure option :option:`--with-trace-refs`. It is intended only for " +"debugging garbage-collection issues." +msgstr "" + #: ../../library/sys.rst:929 +msgid "" +"Return a list of up to *limit* dynamically allocated Python objects. If " +"*type* is given, only objects of that exact type (not subtypes) are included." +msgstr "" + +#: ../../library/sys.rst:933 +msgid "" +"Objects from the list are not safe to use. Specifically, the result will " +"include objects from all interpreters that share their object allocator " +"state (that is, ones created with :c:member:`PyInterpreterConfig." +"use_main_obmalloc` set to 1 or using :c:func:`Py_NewInterpreter`, and the :" +"ref:`main interpreter `). Mixing objects from " +"different interpreters may lead to crashes or other unexpected behavior." +msgstr "" + +#: ../../library/sys.rst:944 +msgid "" +"This function should be used for specialized purposes only. It is not " +"guaranteed to exist in all implementations of Python." +msgstr "" + +#: ../../library/sys.rst:949 +msgid "The result may include objects from other interpreters." +msgstr "" + +#: ../../library/sys.rst:958 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:938 +#: ../../library/sys.rst:967 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:942 +#: ../../library/sys.rst:971 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1193,7 +1226,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:950 +#: ../../library/sys.rst:979 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1205,54 +1238,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:961 +#: ../../library/sys.rst:990 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" -#: ../../library/sys.rst:963 +#: ../../library/sys.rst:992 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:966 +#: ../../library/sys.rst:995 msgid "Constant" msgstr "" -#: ../../library/sys.rst:966 +#: ../../library/sys.rst:995 msgid "Meaning" msgstr "含義" -#: ../../library/sys.rst:968 +#: ../../library/sys.rst:997 msgid "``1`` (VER_NT_WORKSTATION)" msgstr "``1`` (VER_NT_WORKSTATION)" -#: ../../library/sys.rst:968 +#: ../../library/sys.rst:997 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:970 +#: ../../library/sys.rst:999 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" -#: ../../library/sys.rst:970 +#: ../../library/sys.rst:999 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:973 +#: ../../library/sys.rst:1002 msgid "``3`` (VER_NT_SERVER)" msgstr "``3`` (VER_NT_SERVER)" -#: ../../library/sys.rst:973 +#: ../../library/sys.rst:1002 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:977 +#: ../../library/sys.rst:1006 msgid "" "This function wraps the Win32 :c:func:`!GetVersionEx` function; see the " "Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:981 +#: ../../library/sys.rst:1010 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1260,24 +1293,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:987 +#: ../../library/sys.rst:1016 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:993 +#: ../../library/sys.rst:1022 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:997 +#: ../../library/sys.rst:1026 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:1003 +#: ../../library/sys.rst:1032 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1287,71 +1320,71 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:1010 +#: ../../library/sys.rst:1039 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`。" -#: ../../library/sys.rst:1014 ../../library/sys.rst:1702 +#: ../../library/sys.rst:1043 ../../library/sys.rst:1731 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:1020 +#: ../../library/sys.rst:1049 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:1026 ../../library/sys.rst:1723 +#: ../../library/sys.rst:1055 ../../library/sys.rst:1752 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:1032 +#: ../../library/sys.rst:1061 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:1038 +#: ../../library/sys.rst:1067 msgid "The width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:1042 +#: ../../library/sys.rst:1071 msgid "The prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:1046 +#: ../../library/sys.rst:1075 msgid "The hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:1050 +#: ../../library/sys.rst:1079 msgid "(This attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:1054 +#: ../../library/sys.rst:1083 msgid "The multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:1058 +#: ../../library/sys.rst:1087 msgid "The name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:1062 +#: ../../library/sys.rst:1091 msgid "The internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1066 +#: ../../library/sys.rst:1095 msgid "The size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1070 +#: ../../library/sys.rst:1099 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*、*hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:1076 +#: ../../library/sys.rst:1105 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1359,7 +1392,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:1080 +#: ../../library/sys.rst:1109 msgid "" "if sys.hexversion >= 0x010502F0:\n" " # use some advanced feature\n" @@ -1369,7 +1402,7 @@ msgid "" " ..." msgstr "" -#: ../../library/sys.rst:1087 +#: ../../library/sys.rst:1116 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1377,25 +1410,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:1092 +#: ../../library/sys.rst:1121 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1097 +#: ../../library/sys.rst:1126 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:1101 +#: ../../library/sys.rst:1130 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:1105 +#: ../../library/sys.rst:1134 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1407,13 +1440,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1115 +#: ../../library/sys.rst:1144 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1118 +#: ../../library/sys.rst:1147 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1422,7 +1455,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1125 +#: ../../library/sys.rst:1154 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1432,41 +1465,41 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1165 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1141 +#: ../../library/sys.rst:1170 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1146 +#: ../../library/sys.rst:1175 msgid "" "The number of bits held in each digit. Python integers are stored internally " "in base ``2**int_info.bits_per_digit``." msgstr "" -#: ../../library/sys.rst:1151 +#: ../../library/sys.rst:1180 msgid "The size in bytes of the C type used to represent a digit." msgstr "" -#: ../../library/sys.rst:1155 +#: ../../library/sys.rst:1184 msgid "" "The default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1160 +#: ../../library/sys.rst:1189 msgid "" "The minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1167 +#: ../../library/sys.rst:1196 msgid "" "Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info." "str_digits_check_threshold`." @@ -1474,7 +1507,7 @@ msgstr "" "新增 :attr:`~int_info.default_max_str_digits` 和 :attr:`~int_info." "str_digits_check_threshold`。" -#: ../../library/sys.rst:1173 +#: ../../library/sys.rst:1202 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1179 ../../library/sys.rst:1181 +#: ../../library/sys.rst:1208 ../../library/sys.rst:1210 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1190 +#: ../../library/sys.rst:1219 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1501,29 +1534,29 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1198 +#: ../../library/sys.rst:1227 msgid "" "Interned strings are not :term:`immortal`; you must keep a reference to the " "return value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1204 +#: ../../library/sys.rst:1233 msgid "" "Return :const:`True` if the :term:`GIL` is enabled and :const:`False` if it " "is disabled." msgstr "" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1241 msgid "" "Return :const:`True` if the main Python interpreter is :term:`shutting down " "`. Return :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1215 +#: ../../library/sys.rst:1244 msgid "See also the :exc:`PythonFinalizationError` exception." msgstr "" -#: ../../library/sys.rst:1221 +#: ../../library/sys.rst:1250 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1534,44 +1567,44 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1233 +#: ../../library/sys.rst:1262 msgid "" "Return :const:`True` if the given string is \"interned\", :const:`False` " "otherwise." msgstr "" -#: ../../library/sys.rst:1240 +#: ../../library/sys.rst:1269 msgid "It is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:1247 +#: ../../library/sys.rst:1276 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" -#: ../../library/sys.rst:1253 +#: ../../library/sys.rst:1282 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1260 +#: ../../library/sys.rst:1289 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1263 +#: ../../library/sys.rst:1292 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1271 +#: ../../library/sys.rst:1300 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1584,40 +1617,40 @@ msgid "" "``None`` if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1313 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1285 +#: ../../library/sys.rst:1314 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1287 +#: ../../library/sys.rst:1316 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1288 +#: ../../library/sys.rst:1317 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1294 +#: ../../library/sys.rst:1323 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`." msgstr "" -#: ../../library/sys.rst:1299 +#: ../../library/sys.rst:1328 msgid "" "Removed the fallback that looked for a :meth:`!find_module` method if a :" "data:`meta_path` entry didn't have a :meth:`~importlib.abc.MetaPathFinder." "find_spec` method." msgstr "" -#: ../../library/sys.rst:1305 +#: ../../library/sys.rst:1334 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1629,13 +1662,13 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1317 +#: ../../library/sys.rst:1346 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1320 +#: ../../library/sys.rst:1349 msgid "" "The elements of :data:`sys.orig_argv` are the arguments to the Python " "interpreter, while the elements of :data:`sys.argv` are the arguments to the " @@ -1643,68 +1676,68 @@ msgid "" "in :data:`sys.orig_argv` and missing from :data:`sys.argv`." msgstr "" -#: ../../library/sys.rst:1332 +#: ../../library/sys.rst:1361 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1336 +#: ../../library/sys.rst:1365 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1340 +#: ../../library/sys.rst:1369 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1342 +#: ../../library/sys.rst:1371 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1344 +#: ../../library/sys.rst:1373 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1347 +#: ../../library/sys.rst:1376 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1350 +#: ../../library/sys.rst:1379 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1356 +#: ../../library/sys.rst:1385 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1361 +#: ../../library/sys.rst:1390 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1365 ../../library/sys.rst:1376 +#: ../../library/sys.rst:1394 ../../library/sys.rst:1405 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1370 +#: ../../library/sys.rst:1399 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1712,91 +1745,91 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1381 +#: ../../library/sys.rst:1410 msgid "A string containing a platform identifier. Known values are:" msgstr "" -#: ../../library/sys.rst:1384 +#: ../../library/sys.rst:1413 msgid "System" msgstr "" -#: ../../library/sys.rst:1384 +#: ../../library/sys.rst:1413 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1386 +#: ../../library/sys.rst:1415 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1386 +#: ../../library/sys.rst:1415 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1387 +#: ../../library/sys.rst:1416 msgid "Android" msgstr "Android" -#: ../../library/sys.rst:1387 +#: ../../library/sys.rst:1416 msgid "``'android'``" msgstr "``'android'``" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1417 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1417 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1418 msgid "iOS" msgstr "iOS" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1418 msgid "``'ios'``" msgstr "``'ios'``" -#: ../../library/sys.rst:1390 +#: ../../library/sys.rst:1419 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1390 +#: ../../library/sys.rst:1419 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1420 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1420 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1392 +#: ../../library/sys.rst:1421 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1392 +#: ../../library/sys.rst:1421 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1422 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1422 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1394 +#: ../../library/sys.rst:1423 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1394 +#: ../../library/sys.rst:1423 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1397 +#: ../../library/sys.rst:1426 msgid "" "On Unix systems not listed in the table, the value is the lowercased OS name " "as returned by ``uname -s``, with the first part of the version as returned " @@ -1805,81 +1838,81 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1403 +#: ../../library/sys.rst:1432 msgid "" "if sys.platform.startswith('freebsd'):\n" " # FreeBSD-specific code here..." msgstr "" -#: ../../library/sys.rst:1406 +#: ../../library/sys.rst:1435 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``." msgstr "" -#: ../../library/sys.rst:1410 +#: ../../library/sys.rst:1439 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``." msgstr "" -#: ../../library/sys.rst:1414 +#: ../../library/sys.rst:1443 msgid "" "On Android, :data:`sys.platform` now returns ``'android'`` rather than " "``'linux'``." msgstr "" -#: ../../library/sys.rst:1420 +#: ../../library/sys.rst:1449 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1452 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1429 +#: ../../library/sys.rst:1458 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1432 +#: ../../library/sys.rst:1461 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1436 +#: ../../library/sys.rst:1465 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1438 +#: ../../library/sys.rst:1467 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1441 +#: ../../library/sys.rst:1470 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1443 +#: ../../library/sys.rst:1472 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1451 +#: ../../library/sys.rst:1480 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1888,14 +1921,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1457 +#: ../../library/sys.rst:1486 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1472 +#: ../../library/sys.rst:1501 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1905,7 +1938,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1482 +#: ../../library/sys.rst:1511 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1916,14 +1949,14 @@ msgid "" "g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1494 +#: ../../library/sys.rst:1523 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1506 +#: ../../library/sys.rst:1535 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1938,14 +1971,14 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1518 +#: ../../library/sys.rst:1547 msgid "" "The same tracing mechanism is used for :func:`!setprofile` as :func:" "`settrace`. To trace calls with :func:`!setprofile` inside a tracing " "function (e.g. in a debugger breakpoint), see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1522 +#: ../../library/sys.rst:1551 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1953,71 +1986,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1527 ../../library/sys.rst:1614 +#: ../../library/sys.rst:1556 ../../library/sys.rst:1643 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1529 ../../library/sys.rst:1616 +#: ../../library/sys.rst:1558 ../../library/sys.rst:1645 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1530 +#: ../../library/sys.rst:1559 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1533 ../../library/sys.rst:1631 +#: ../../library/sys.rst:1562 ../../library/sys.rst:1660 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1534 +#: ../../library/sys.rst:1563 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1538 +#: ../../library/sys.rst:1567 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1539 +#: ../../library/sys.rst:1568 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1542 +#: ../../library/sys.rst:1571 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1543 +#: ../../library/sys.rst:1572 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1574 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1546 +#: ../../library/sys.rst:1575 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1548 +#: ../../library/sys.rst:1577 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1553 +#: ../../library/sys.rst:1582 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1557 +#: ../../library/sys.rst:1586 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -2025,19 +2058,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1562 +#: ../../library/sys.rst:1591 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1565 +#: ../../library/sys.rst:1594 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1572 +#: ../../library/sys.rst:1601 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2048,7 +2081,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1589 +#: ../../library/sys.rst:1618 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -2057,7 +2090,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1594 +#: ../../library/sys.rst:1623 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2065,7 +2098,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1599 +#: ../../library/sys.rst:1628 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2073,36 +2106,36 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1604 +#: ../../library/sys.rst:1633 msgid "" "The local trace function should return a reference to itself, or to another " "function which would then be used as the local trace function for the scope." msgstr "" -#: ../../library/sys.rst:1607 +#: ../../library/sys.rst:1636 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1611 +#: ../../library/sys.rst:1640 msgid "" "Tracing is disabled while calling the trace function (e.g. a function set " "by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1617 +#: ../../library/sys.rst:1646 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1621 +#: ../../library/sys.rst:1650 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1622 +#: ../../library/sys.rst:1651 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2112,7 +2145,7 @@ msgid "" "to :const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1632 +#: ../../library/sys.rst:1661 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2120,22 +2153,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1666 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1638 +#: ../../library/sys.rst:1667 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1642 +#: ../../library/sys.rst:1671 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1643 +#: ../../library/sys.rst:1672 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2145,13 +2178,13 @@ msgid "" "objects>`." msgstr "" -#: ../../library/sys.rst:1650 +#: ../../library/sys.rst:1679 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1653 +#: ../../library/sys.rst:1682 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2165,17 +2198,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1664 +#: ../../library/sys.rst:1693 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1666 +#: ../../library/sys.rst:1695 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.settrace``。" -#: ../../library/sys.rst:1670 +#: ../../library/sys.rst:1699 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2183,13 +2216,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1677 +#: ../../library/sys.rst:1706 msgid "" "``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:" "`~frame.f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1682 +#: ../../library/sys.rst:1711 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2198,7 +2231,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1688 +#: ../../library/sys.rst:1717 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2206,7 +2239,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1690 +#: ../../library/sys.rst:1719 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2214,20 +2247,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1692 +#: ../../library/sys.rst:1721 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1695 +#: ../../library/sys.rst:1724 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1707 +#: ../../library/sys.rst:1736 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2236,111 +2269,111 @@ msgid "" "disabled, ``cr_origin`` will be ``None``." msgstr "" -#: ../../library/sys.rst:1714 +#: ../../library/sys.rst:1743 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1718 +#: ../../library/sys.rst:1747 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1728 +#: ../../library/sys.rst:1757 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1737 +#: ../../library/sys.rst:1766 msgid ":ref:`perf_profiling`" msgstr ":ref:`perf_profiling`" -#: ../../library/sys.rst:1738 +#: ../../library/sys.rst:1767 msgid "https://perf.wiki.kernel.org" msgstr "https://perf.wiki.kernel.org" -#: ../../library/sys.rst:1742 +#: ../../library/sys.rst:1771 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1744 +#: ../../library/sys.rst:1773 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1752 +#: ../../library/sys.rst:1781 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1760 +#: ../../library/sys.rst:1789 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1764 +#: ../../library/sys.rst:1793 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1767 +#: ../../library/sys.rst:1796 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1773 +#: ../../library/sys.rst:1802 msgid "" "Changing the filesystem encoding after Python startup is risky because the " "old fsencoding or paths encoded by the old fsencoding may be cached " "somewhere. Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." msgstr "" -#: ../../library/sys.rst:1777 +#: ../../library/sys.rst:1806 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`。" -#: ../../library/sys.rst:1780 +#: ../../library/sys.rst:1809 msgid "Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." msgstr "" -#: ../../library/sys.rst:1787 +#: ../../library/sys.rst:1816 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1790 +#: ../../library/sys.rst:1819 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1792 +#: ../../library/sys.rst:1821 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1794 +#: ../../library/sys.rst:1823 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1796 +#: ../../library/sys.rst:1825 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1800 +#: ../../library/sys.rst:1829 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1803 +#: ../../library/sys.rst:1832 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2351,14 +2384,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1812 +#: ../../library/sys.rst:1841 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1817 +#: ../../library/sys.rst:1846 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2367,7 +2400,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1824 +#: ../../library/sys.rst:1853 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2376,19 +2409,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1830 +#: ../../library/sys.rst:1859 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1836 +#: ../../library/sys.rst:1865 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1840 +#: ../../library/sys.rst:1869 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2396,7 +2429,7 @@ msgid "" "support the :attr:`!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1850 +#: ../../library/sys.rst:1879 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2404,7 +2437,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1855 +#: ../../library/sys.rst:1884 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2412,7 +2445,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1861 +#: ../../library/sys.rst:1890 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2420,12 +2453,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1869 +#: ../../library/sys.rst:1898 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1871 +#: ../../library/sys.rst:1900 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2433,7 +2466,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1876 +#: ../../library/sys.rst:1905 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2441,60 +2474,60 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1881 +#: ../../library/sys.rst:1910 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1888 +#: ../../library/sys.rst:1917 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1893 +#: ../../library/sys.rst:1922 msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1895 +#: ../../library/sys.rst:1924 msgid "``\"nt\"``: Windows threads" msgstr "``\"nt\"``: Windows 執行緒" -#: ../../library/sys.rst:1896 +#: ../../library/sys.rst:1925 msgid "``\"pthread\"``: POSIX threads" msgstr "``\"pthread\"``: POSIX 執行緒" -#: ../../library/sys.rst:1897 +#: ../../library/sys.rst:1926 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1899 +#: ../../library/sys.rst:1928 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1903 +#: ../../library/sys.rst:1932 msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1905 +#: ../../library/sys.rst:1934 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1906 +#: ../../library/sys.rst:1935 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1907 +#: ../../library/sys.rst:1936 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1911 +#: ../../library/sys.rst:1940 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: ../../library/sys.rst:1919 +#: ../../library/sys.rst:1948 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2503,73 +2536,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1927 +#: ../../library/sys.rst:1956 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1929 +#: ../../library/sys.rst:1958 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1933 +#: ../../library/sys.rst:1962 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1935 +#: ../../library/sys.rst:1964 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1936 +#: ../../library/sys.rst:1965 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1937 +#: ../../library/sys.rst:1966 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1938 +#: ../../library/sys.rst:1967 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1939 +#: ../../library/sys.rst:1968 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1941 +#: ../../library/sys.rst:1970 msgid "" "The default hook formats :attr:`!err_msg` and :attr:`!object` as: " "``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" "attr:`!err_msg` is ``None``." msgstr "" -#: ../../library/sys.rst:1945 +#: ../../library/sys.rst:1974 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1950 +#: ../../library/sys.rst:1979 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1954 +#: ../../library/sys.rst:1983 msgid "" "Storing :attr:`!exc_value` using a custom hook can create a reference cycle. " "It should be cleared explicitly to break the reference cycle when the " "exception is no longer needed." msgstr "" -#: ../../library/sys.rst:1958 +#: ../../library/sys.rst:1987 msgid "" "Storing :attr:`!object` using a custom hook can resurrect it if it is set to " "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1962 ../../library/sys.rst:1964 +#: ../../library/sys.rst:1991 ../../library/sys.rst:1993 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2577,7 +2610,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1973 +#: ../../library/sys.rst:2002 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2586,13 +2619,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1982 +#: ../../library/sys.rst:2011 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1988 +#: ../../library/sys.rst:2017 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2603,18 +2636,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1996 +#: ../../library/sys.rst:2025 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:2001 +#: ../../library/sys.rst:2030 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:2008 +#: ../../library/sys.rst:2037 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2623,20 +2656,20 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:2020 +#: ../../library/sys.rst:2049 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: ../../library/sys.rst:2026 +#: ../../library/sys.rst:2055 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:2030 +#: ../../library/sys.rst:2059 msgid "" "$ ./python -Xa=b -Xc\n" "Python 3.2a3+ (py3k, Oct 16 2010, 20:14:50)\n" @@ -2656,18 +2689,18 @@ msgstr "" ">>> sys._xoptions\n" "{'a': 'b', 'c': True}" -#: ../../library/sys.rst:2042 +#: ../../library/sys.rst:2071 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:2050 +#: ../../library/sys.rst:2079 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:2051 +#: ../../library/sys.rst:2080 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2688,50 +2721,50 @@ msgstr "object(物件)" msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:925 ../../library/sys.rst:1502 +#: ../../library/sys.rst:954 ../../library/sys.rst:1531 msgid "profile function" msgstr "" -#: ../../library/sys.rst:925 ../../library/sys.rst:1502 +#: ../../library/sys.rst:954 ../../library/sys.rst:1531 msgid "profiler" msgstr "" -#: ../../library/sys.rst:934 ../../library/sys.rst:1585 +#: ../../library/sys.rst:963 ../../library/sys.rst:1614 msgid "trace function" msgstr "" -#: ../../library/sys.rst:934 ../../library/sys.rst:1585 +#: ../../library/sys.rst:963 ../../library/sys.rst:1614 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1330 +#: ../../library/sys.rst:1359 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1330 +#: ../../library/sys.rst:1359 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1330 +#: ../../library/sys.rst:1359 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1466 +#: ../../library/sys.rst:1495 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1466 +#: ../../library/sys.rst:1495 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1466 +#: ../../library/sys.rst:1495 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1466 +#: ../../library/sys.rst:1495 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1466 +#: ../../library/sys.rst:1495 msgid "..." msgstr "..." diff --git a/library/sys_path_init.po b/library/sys_path_init.po index 4e699203ea..060912a646 100644 --- a/library/sys_path_init.po +++ b/library/sys_path_init.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -11,7 +10,8 @@ msgstr "" "POT-Creation-Date: 2024-09-23 07:52+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,7 +19,7 @@ msgstr "" #: ../../library/sys_path_init.rst:4 msgid "The initialization of the :data:`sys.path` module search path" -msgstr "" +msgstr ":data:`sys.path` 模組搜尋路徑的初始化" #: ../../library/sys_path_init.rst:6 msgid "" @@ -110,7 +110,7 @@ msgstr "" #: ../../library/sys_path_init.rst:64 msgid "Virtual environments" -msgstr "" +msgstr "虛擬環境" #: ../../library/sys_path_init.rst:66 msgid "" @@ -133,7 +133,7 @@ msgstr "" #: ../../library/sys_path_init.rst:77 msgid "_pth files" -msgstr "" +msgstr "_pth 檔案" #: ../../library/sys_path_init.rst:79 msgid "" @@ -176,8 +176,8 @@ msgstr "" #: ../../library/sys_path_init.rst:106 msgid ":ref:`windows_finding_modules` for detailed Windows notes." -msgstr "" +msgstr ":ref:`windows_finding_modules` 有關於 Windows 的詳細資訊。" #: ../../library/sys_path_init.rst:107 msgid ":ref:`using-on-unix` for Unix details." -msgstr "" +msgstr ":ref:`using-on-unix` 有關於 Unix 的詳細資訊。" diff --git a/library/telnetlib.po b/library/telnetlib.po new file mode 100644 index 0000000000..cd0b4c26d3 --- /dev/null +++ b/library/telnetlib.po @@ -0,0 +1,48 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 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-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/telnetlib.rst:2 +msgid ":mod:`!telnetlib` --- Telnet client" +msgstr ":mod:`!telnetlib` --- Telnet 客戶端" + +#: ../../library/telnetlib.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 `。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/telnetlib.rst:14 +msgid "" +"Possible replacements are third-party libraries from PyPI: :pypi:" +"`telnetlib3` or :pypi:`Exscript`. These are not supported or maintained by " +"the Python core team." +msgstr "" +"可能的替代方案是 PyPI 上的第三方函式庫::pypi:`telnetlib3` 或 :pypi:" +"`Exscript`。它們並不受 Python 核心團隊支援或維護。" + +#: ../../library/telnetlib.rst:18 +msgid "" +"The last version of Python that provided the :mod:`!telnetlib` module was " +"`Python 3.12 `_." +msgstr "" +"最後提供 :mod:`!telnetlib` 模組的 Python 版本是 `Python 3.12 `_。" diff --git a/library/time.po b/library/time.po index 8b595a42b9..db6badd4c8 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-01 00:15+0000\n" +"POT-Creation-Date: 2024-11-12 00:13+0000\n" "PO-Revision-Date: 2024-11-20 15:25+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -614,14 +614,14 @@ msgid "" "time slice to any other thread that is ready to run. If there are no other " "threads ready to run, the function returns immediately, and the thread " "continues execution. On Windows 8.1 and newer the implementation uses a " -"`high-resolution timer `_ which provides resolution of 100 " +"`high-resolution timer `_ which provides resolution of 100 " "nanoseconds. If *secs* is zero, ``Sleep(0)`` is used." msgstr "" "在 Windows 上,如果 *secs* 為零,則執行緒將其剩餘的時間片段讓給任何準備運行的" "其他執行緒。如果沒有其他執行緒準備運行,該函式將立即回傳,而執行緒會繼續執" "行。在 Windows 8.1 及更新的版本中,此實作使用\\ `高解析度計時器 `_,其解析度為 100 奈秒。如果 *secs* 為零,則使用 ``Sleep(0)``。" #: ../../library/time.rst:396 diff --git a/library/typing.po b/library/typing.po index 2c5d63c990..909335de57 100644 --- a/library/typing.po +++ b/library/typing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-30 09:19+0000\n" +"POT-Creation-Date: 2024-11-11 06:16+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-" @@ -2788,13 +2788,14 @@ msgstr "" #: ../../library/typing.rst:1729 msgid "" -"This syntax can also be used to create bound and constrained type variables::" +"This syntax can also be used to create bounded and constrained type " +"variables::" msgstr "" #: ../../library/typing.rst:1732 msgid "" -"class StrSequence[S: str]: # S is a TypeVar bound to str\n" -" ...\n" +"class StrSequence[S: str]: # S is a TypeVar with a `str` upper bound;\n" +" ... # we can say that S is \"bounded by `str`\"\n" "\n" "\n" "class StrOrBytesSequence[A: (str, bytes)]: # A is a TypeVar constrained to " @@ -2843,8 +2844,8 @@ msgstr "" #: ../../library/typing.rst:1766 msgid "" -"Note that type variables can be *bound*, *constrained*, or neither, but " -"cannot be both bound *and* constrained." +"Note that type variables can be *bounded*, *constrained*, or neither, but " +"cannot be both bounded *and* constrained." msgstr "" #: ../../library/typing.rst:1769 @@ -2859,9 +2860,9 @@ msgstr "" #: ../../library/typing.rst:1777 msgid "" -"Bound type variables and constrained type variables have different semantics " -"in several important ways. Using a *bound* type variable means that the " -"``TypeVar`` will be solved using the most specific type possible::" +"Bounded type variables and constrained type variables have different " +"semantics in several important ways. Using a *bounded* type variable means " +"that the ``TypeVar`` will be solved using the most specific type possible::" msgstr "" #: ../../library/typing.rst:1781 @@ -2880,8 +2881,8 @@ msgstr "" #: ../../library/typing.rst:1792 msgid "" -"Type variables can be bound to concrete types, abstract types (ABCs or " -"protocols), and even unions of types::" +"The upper bound of a type variable can be a concrete type, abstract type " +"(ABC or Protocol), or even a union of types::" msgstr "" #: ../../library/typing.rst:1795 @@ -2936,7 +2937,7 @@ msgid "" msgstr "" #: ../../library/typing.rst:1837 -msgid "The bound of the type variable, if any." +msgid "The upper bound of the type variable, if any." msgstr "" #: ../../library/typing.rst:1841 @@ -3249,8 +3250,8 @@ msgstr "" #: ../../library/typing.rst:2062 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " -"use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " -"causes two problems:" +"use a :class:`TypeVar` with upper bound ``Callable[..., Any]``. However " +"this causes two problems:" msgstr "" #: ../../library/typing.rst:2066 diff --git a/library/urllib.parse.po b/library/urllib.parse.po index d522fd40ff..d8aa51ce60 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-11-16 00:16+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-" @@ -190,22 +190,22 @@ msgid "" msgstr "" #: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:310 -#: ../../library/urllib.parse.rst:423 +#: ../../library/urllib.parse.rst:432 msgid "Attribute" msgstr "屬性" #: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:310 -#: ../../library/urllib.parse.rst:423 +#: ../../library/urllib.parse.rst:432 msgid "Index" msgstr "" #: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:310 -#: ../../library/urllib.parse.rst:423 +#: ../../library/urllib.parse.rst:432 msgid "Value" msgstr "" #: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:310 -#: ../../library/urllib.parse.rst:423 +#: ../../library/urllib.parse.rst:432 msgid "Value if not present" msgstr "" @@ -214,7 +214,7 @@ msgid ":attr:`scheme`" msgstr ":attr:`scheme`" #: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:312 -#: ../../library/urllib.parse.rst:425 +#: ../../library/urllib.parse.rst:434 msgid "0" msgstr "0" @@ -231,7 +231,7 @@ msgid ":attr:`netloc`" msgstr ":attr:`netloc`" #: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:314 -#: ../../library/urllib.parse.rst:427 +#: ../../library/urllib.parse.rst:436 msgid "1" msgstr "1" @@ -243,8 +243,8 @@ msgstr "" #: ../../library/urllib.parse.rst:129 ../../library/urllib.parse.rst:132 #: ../../library/urllib.parse.rst:134 ../../library/urllib.parse.rst:314 #: ../../library/urllib.parse.rst:316 ../../library/urllib.parse.rst:318 -#: ../../library/urllib.parse.rst:320 ../../library/urllib.parse.rst:425 -#: ../../library/urllib.parse.rst:427 +#: ../../library/urllib.parse.rst:320 ../../library/urllib.parse.rst:434 +#: ../../library/urllib.parse.rst:436 msgid "empty string" msgstr "" @@ -285,7 +285,7 @@ msgid "Query component" msgstr "" #: ../../library/urllib.parse.rst:134 ../../library/urllib.parse.rst:320 -#: ../../library/urllib.parse.rst:427 +#: ../../library/urllib.parse.rst:436 msgid ":attr:`fragment`" msgstr ":attr:`fragment`" @@ -294,7 +294,7 @@ msgid "5" msgstr "5" #: ../../library/urllib.parse.rst:134 ../../library/urllib.parse.rst:320 -#: ../../library/urllib.parse.rst:427 +#: ../../library/urllib.parse.rst:436 msgid "Fragment identifier" msgstr "" @@ -523,7 +523,7 @@ msgid "" msgstr "" "(addressing scheme, network location, path, query, fragment identifier)." -#: ../../library/urllib.parse.rst:306 ../../library/urllib.parse.rst:419 +#: ../../library/urllib.parse.rst:306 ../../library/urllib.parse.rst:428 msgid "" "The return value is a :term:`named tuple`, its items can be accessed by " "index or as named attributes:" @@ -597,11 +597,20 @@ msgid "" "and :func:`urlunsplit`, removing possible *scheme* and *netloc* parts." msgstr "" -#: ../../library/urllib.parse.rst:409 +#: ../../library/urllib.parse.rst:408 +msgid "" +"Because an absolute URL may be passed as the ``url`` parameter, it is " +"generally **not secure** to use ``urljoin`` with an attacker-controlled " +"``url``. For example in, ``urljoin(\"https://website.com/users/\", " +"username)``, if ``username`` can contain an absolute URL, the result of " +"``urljoin`` will be the absolute URL." +msgstr "" + +#: ../../library/urllib.parse.rst:418 msgid "Behavior updated to match the semantics defined in :rfc:`3986`." msgstr "" -#: ../../library/urllib.parse.rst:414 +#: ../../library/urllib.parse.rst:423 msgid "" "If *url* contains a fragment identifier, return a modified version of *url* " "with no fragment identifier, and the fragment identifier as a separate " @@ -609,25 +618,25 @@ msgid "" "unmodified and an empty string." msgstr "" -#: ../../library/urllib.parse.rst:425 +#: ../../library/urllib.parse.rst:434 msgid ":attr:`url`" msgstr ":attr:`url`" -#: ../../library/urllib.parse.rst:425 +#: ../../library/urllib.parse.rst:434 msgid "URL with no fragment" msgstr "" -#: ../../library/urllib.parse.rst:430 +#: ../../library/urllib.parse.rst:439 msgid "" "See section :ref:`urlparse-result-object` for more information on the result " "object." msgstr "" -#: ../../library/urllib.parse.rst:433 +#: ../../library/urllib.parse.rst:442 msgid "Result is a structured object rather than a simple 2-tuple." msgstr "" -#: ../../library/urllib.parse.rst:438 +#: ../../library/urllib.parse.rst:447 msgid "" "Extract the url from a wrapped URL (that is, a string formatted as ````, ````, ``URL:scheme://host/path`` " @@ -635,11 +644,11 @@ msgid "" "without changes." msgstr "" -#: ../../library/urllib.parse.rst:446 +#: ../../library/urllib.parse.rst:455 msgid "URL parsing security" msgstr "" -#: ../../library/urllib.parse.rst:448 +#: ../../library/urllib.parse.rst:457 msgid "" "The :func:`urlsplit` and :func:`urlparse` APIs do not perform **validation** " "of inputs. They may not raise errors on inputs that other applications " @@ -648,14 +657,14 @@ msgid "" "rather than purity." msgstr "" -#: ../../library/urllib.parse.rst:454 +#: ../../library/urllib.parse.rst:463 msgid "" "Instead of raising an exception on unusual input, they may instead return " "some component parts as empty strings. Or components may contain more than " "perhaps they should." msgstr "" -#: ../../library/urllib.parse.rst:458 +#: ../../library/urllib.parse.rst:467 msgid "" "We recommend that users of these APIs where the values may be used anywhere " "with security implications code defensively. Do some verification within " @@ -664,7 +673,7 @@ msgid "" "that ``hostname``? etc." msgstr "" -#: ../../library/urllib.parse.rst:464 +#: ../../library/urllib.parse.rst:473 msgid "" "What constitutes a URL is not universally well defined. Different " "applications have different needs and desired constraints. For instance the " @@ -676,11 +685,11 @@ msgid "" "API behavior changes." msgstr "" -#: ../../library/urllib.parse.rst:475 +#: ../../library/urllib.parse.rst:484 msgid "Parsing ASCII Encoded Bytes" msgstr "" -#: ../../library/urllib.parse.rst:477 +#: ../../library/urllib.parse.rst:486 msgid "" "The URL parsing functions were originally designed to operate on character " "strings only. In practice, it is useful to be able to manipulate properly " @@ -689,14 +698,14 @@ msgid "" "`bytearray` objects in addition to :class:`str` objects." msgstr "" -#: ../../library/urllib.parse.rst:483 +#: ../../library/urllib.parse.rst:492 msgid "" "If :class:`str` data is passed in, the result will also contain only :class:" "`str` data. If :class:`bytes` or :class:`bytearray` data is passed in, the " "result will contain only :class:`bytes` data." msgstr "" -#: ../../library/urllib.parse.rst:487 +#: ../../library/urllib.parse.rst:496 msgid "" "Attempting to mix :class:`str` data with :class:`bytes` or :class:" "`bytearray` in a single function call will result in a :exc:`TypeError` " @@ -704,7 +713,7 @@ msgid "" "trigger :exc:`UnicodeDecodeError`." msgstr "" -#: ../../library/urllib.parse.rst:492 +#: ../../library/urllib.parse.rst:501 msgid "" "To support easier conversion of result objects between :class:`str` and :" "class:`bytes`, all return values from URL parsing functions provide either " @@ -717,14 +726,14 @@ msgid "" "`str` data (for :meth:`decode` methods)." msgstr "" -#: ../../library/urllib.parse.rst:503 +#: ../../library/urllib.parse.rst:512 msgid "" "Applications that need to operate on potentially improperly quoted URLs that " "may contain non-ASCII data will need to do their own decoding from bytes to " "characters before invoking the URL parsing methods." msgstr "" -#: ../../library/urllib.parse.rst:507 +#: ../../library/urllib.parse.rst:516 msgid "" "The behaviour described in this section applies only to the URL parsing " "functions. The URL quoting functions use their own rules when producing or " @@ -732,15 +741,15 @@ msgid "" "URL quoting functions." msgstr "" -#: ../../library/urllib.parse.rst:512 +#: ../../library/urllib.parse.rst:521 msgid "URL parsing functions now accept ASCII encoded byte sequences" msgstr "" -#: ../../library/urllib.parse.rst:519 +#: ../../library/urllib.parse.rst:528 msgid "Structured Parse Results" msgstr "" -#: ../../library/urllib.parse.rst:521 +#: ../../library/urllib.parse.rst:530 msgid "" "The result objects from the :func:`urlparse`, :func:`urlsplit` and :func:" "`urldefrag` functions are subclasses of the :class:`tuple` type. These " @@ -749,7 +758,7 @@ msgid "" "section, as well as an additional method:" msgstr "" -#: ../../library/urllib.parse.rst:529 +#: ../../library/urllib.parse.rst:538 msgid "" "Return the re-combined version of the original URL as a string. This may " "differ from the original URL in that the scheme may be normalized to lower " @@ -757,72 +766,72 @@ msgid "" "queries, and fragment identifiers will be removed." msgstr "" -#: ../../library/urllib.parse.rst:534 +#: ../../library/urllib.parse.rst:543 msgid "" "For :func:`urldefrag` results, only empty fragment identifiers will be " "removed. For :func:`urlsplit` and :func:`urlparse` results, all noted " "changes will be made to the URL returned by this method." msgstr "" -#: ../../library/urllib.parse.rst:538 +#: ../../library/urllib.parse.rst:547 msgid "" "The result of this method remains unchanged if passed back through the " "original parsing function:" msgstr "" -#: ../../library/urllib.parse.rst:551 +#: ../../library/urllib.parse.rst:560 msgid "" "The following classes provide the implementations of the structured parse " "results when operating on :class:`str` objects:" msgstr "" -#: ../../library/urllib.parse.rst:556 +#: ../../library/urllib.parse.rst:565 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`DefragResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:564 +#: ../../library/urllib.parse.rst:573 msgid "" "Concrete class for :func:`urlparse` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`ParseResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:570 +#: ../../library/urllib.parse.rst:579 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`SplitResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:575 +#: ../../library/urllib.parse.rst:584 msgid "" "The following classes provide the implementations of the parse results when " "operating on :class:`bytes` or :class:`bytearray` objects:" msgstr "" -#: ../../library/urllib.parse.rst:580 +#: ../../library/urllib.parse.rst:589 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`DefragResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:588 +#: ../../library/urllib.parse.rst:597 msgid "" "Concrete class for :func:`urlparse` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`ParseResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:596 +#: ../../library/urllib.parse.rst:605 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`SplitResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:604 +#: ../../library/urllib.parse.rst:613 msgid "URL Quoting" msgstr "" -#: ../../library/urllib.parse.rst:606 +#: ../../library/urllib.parse.rst:615 msgid "" "The URL quoting functions focus on taking program data and making it safe " "for use as URL components by quoting special characters and appropriately " @@ -831,7 +840,7 @@ msgid "" "isn't already covered by the URL parsing functions above." msgstr "" -#: ../../library/urllib.parse.rst:614 +#: ../../library/urllib.parse.rst:623 msgid "" "Replace special characters in *string* using the :samp:`%{xx}` escape. " "Letters, digits, and the characters ``'_.-~'`` are never quoted. By default, " @@ -840,18 +849,18 @@ msgid "" "not be quoted --- its default value is ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:620 ../../library/urllib.parse.rst:666 -#: ../../library/urllib.parse.rst:695 +#: ../../library/urllib.parse.rst:629 ../../library/urllib.parse.rst:675 +#: ../../library/urllib.parse.rst:704 msgid "*string* may be either a :class:`str` or a :class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:622 +#: ../../library/urllib.parse.rst:631 msgid "" "Moved from :rfc:`2396` to :rfc:`3986` for quoting URL strings. \"~\" is now " "included in the set of unreserved characters." msgstr "" -#: ../../library/urllib.parse.rst:626 +#: ../../library/urllib.parse.rst:635 msgid "" "The optional *encoding* and *errors* parameters specify how to deal with non-" "ASCII characters, as accepted by the :meth:`str.encode` method. *encoding* " @@ -861,17 +870,17 @@ msgid "" "`TypeError` is raised." msgstr "" -#: ../../library/urllib.parse.rst:634 +#: ../../library/urllib.parse.rst:643 msgid "" "Note that ``quote(string, safe, encoding, errors)`` is equivalent to " "``quote_from_bytes(string.encode(encoding, errors), safe)``." msgstr "" -#: ../../library/urllib.parse.rst:637 +#: ../../library/urllib.parse.rst:646 msgid "Example: ``quote('/El Niño/')`` yields ``'/El%20Ni%C3%B1o/'``." msgstr "" -#: ../../library/urllib.parse.rst:642 +#: ../../library/urllib.parse.rst:651 msgid "" "Like :func:`quote`, but also replace spaces with plus signs, as required for " "quoting HTML form values when building up a query string to go into a URL. " @@ -879,21 +888,21 @@ msgid "" "*safe*. It also does not have *safe* default to ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:647 +#: ../../library/urllib.parse.rst:656 msgid "Example: ``quote_plus('/El Niño/')`` yields ``'%2FEl+Ni%C3%B1o%2F'``." msgstr "" -#: ../../library/urllib.parse.rst:652 +#: ../../library/urllib.parse.rst:661 msgid "" "Like :func:`quote`, but accepts a :class:`bytes` object rather than a :class:" "`str`, and does not perform string-to-bytes encoding." msgstr "" -#: ../../library/urllib.parse.rst:655 +#: ../../library/urllib.parse.rst:664 msgid "Example: ``quote_from_bytes(b'a&\\xef')`` yields ``'a%26%EF'``." msgstr "" -#: ../../library/urllib.parse.rst:661 +#: ../../library/urllib.parse.rst:670 msgid "" "Replace :samp:`%{xx}` escapes with their single-character equivalent. The " "optional *encoding* and *errors* parameters specify how to decode percent-" @@ -901,52 +910,52 @@ msgid "" "decode` method." msgstr "" -#: ../../library/urllib.parse.rst:668 +#: ../../library/urllib.parse.rst:677 msgid "" "*encoding* defaults to ``'utf-8'``. *errors* defaults to ``'replace'``, " "meaning invalid sequences are replaced by a placeholder character." msgstr "" -#: ../../library/urllib.parse.rst:672 +#: ../../library/urllib.parse.rst:681 msgid "Example: ``unquote('/El%20Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:674 +#: ../../library/urllib.parse.rst:683 msgid "" "*string* parameter supports bytes and str objects (previously only str)." msgstr "" -#: ../../library/urllib.parse.rst:682 +#: ../../library/urllib.parse.rst:691 msgid "" "Like :func:`unquote`, but also replace plus signs with spaces, as required " "for unquoting HTML form values." msgstr "" -#: ../../library/urllib.parse.rst:685 +#: ../../library/urllib.parse.rst:694 msgid "*string* must be a :class:`str`." msgstr "" -#: ../../library/urllib.parse.rst:687 +#: ../../library/urllib.parse.rst:696 msgid "Example: ``unquote_plus('/El+Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:692 +#: ../../library/urllib.parse.rst:701 msgid "" "Replace :samp:`%{xx}` escapes with their single-octet equivalent, and return " "a :class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:697 +#: ../../library/urllib.parse.rst:706 msgid "" "If it is a :class:`str`, unescaped non-ASCII characters in *string* are " "encoded into UTF-8 bytes." msgstr "" -#: ../../library/urllib.parse.rst:700 +#: ../../library/urllib.parse.rst:709 msgid "Example: ``unquote_to_bytes('a%26%EF')`` yields ``b'a&\\xef'``." msgstr "" -#: ../../library/urllib.parse.rst:706 +#: ../../library/urllib.parse.rst:715 msgid "" "Convert a mapping object or a sequence of two-element tuples, which may " "contain :class:`str` or :class:`bytes` objects, to a percent-encoded ASCII " @@ -955,7 +964,7 @@ msgid "" "be encoded to bytes, otherwise it would result in a :exc:`TypeError`." msgstr "" -#: ../../library/urllib.parse.rst:713 +#: ../../library/urllib.parse.rst:722 msgid "" "The resulting string is a series of ``key=value`` pairs separated by ``'&'`` " "characters, where both *key* and *value* are quoted using the *quote_via* " @@ -968,7 +977,7 @@ msgid "" "``quote`` and specify a value for *safe*." msgstr "" -#: ../../library/urllib.parse.rst:723 +#: ../../library/urllib.parse.rst:732 msgid "" "When a sequence of two-element tuples is used as the *query* argument, the " "first element of each tuple is a key and the second is a value. The value " @@ -979,49 +988,49 @@ msgid "" "order of parameter tuples in the sequence." msgstr "" -#: ../../library/urllib.parse.rst:731 +#: ../../library/urllib.parse.rst:740 msgid "" "The *safe*, *encoding*, and *errors* parameters are passed down to " "*quote_via* (the *encoding* and *errors* parameters are only passed when a " "query element is a :class:`str`)." msgstr "" -#: ../../library/urllib.parse.rst:735 +#: ../../library/urllib.parse.rst:744 msgid "" "To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are " "provided in this module to parse query strings into Python data structures." msgstr "" -#: ../../library/urllib.parse.rst:738 +#: ../../library/urllib.parse.rst:747 msgid "" "Refer to :ref:`urllib examples ` to find out how the :func:" "`urllib.parse.urlencode` method can be used for generating the query string " "of a URL or data for a POST request." msgstr "" -#: ../../library/urllib.parse.rst:742 +#: ../../library/urllib.parse.rst:751 msgid "*query* supports bytes and string objects." msgstr "" -#: ../../library/urllib.parse.rst:745 +#: ../../library/urllib.parse.rst:754 msgid "Added the *quote_via* parameter." msgstr "新增 *quote_via* 參數。" -#: ../../library/urllib.parse.rst:751 +#: ../../library/urllib.parse.rst:760 msgid "`WHATWG`_ - URL Living standard" msgstr "" -#: ../../library/urllib.parse.rst:752 +#: ../../library/urllib.parse.rst:761 msgid "" "Working Group for the URL Standard that defines URLs, domains, IP addresses, " "the application/x-www-form-urlencoded format, and their API." msgstr "" -#: ../../library/urllib.parse.rst:755 +#: ../../library/urllib.parse.rst:764 msgid ":rfc:`3986` - Uniform Resource Identifiers" msgstr "" -#: ../../library/urllib.parse.rst:756 +#: ../../library/urllib.parse.rst:765 msgid "" "This is the current standard (STD66). Any changes to urllib.parse module " "should conform to this. Certain deviations could be observed, which are " @@ -1029,49 +1038,49 @@ msgid "" "requirements as commonly observed in major browsers." msgstr "" -#: ../../library/urllib.parse.rst:761 +#: ../../library/urllib.parse.rst:770 msgid ":rfc:`2732` - Format for Literal IPv6 Addresses in URL's." msgstr "" -#: ../../library/urllib.parse.rst:762 +#: ../../library/urllib.parse.rst:771 msgid "This specifies the parsing requirements of IPv6 URLs." msgstr "" -#: ../../library/urllib.parse.rst:764 +#: ../../library/urllib.parse.rst:773 msgid ":rfc:`2396` - Uniform Resource Identifiers (URI): Generic Syntax" msgstr "" -#: ../../library/urllib.parse.rst:765 +#: ../../library/urllib.parse.rst:774 msgid "" "Document describing the generic syntactic requirements for both Uniform " "Resource Names (URNs) and Uniform Resource Locators (URLs)." msgstr "" -#: ../../library/urllib.parse.rst:768 +#: ../../library/urllib.parse.rst:777 msgid ":rfc:`2368` - The mailto URL scheme." msgstr "" -#: ../../library/urllib.parse.rst:769 +#: ../../library/urllib.parse.rst:778 msgid "Parsing requirements for mailto URL schemes." msgstr "" -#: ../../library/urllib.parse.rst:771 +#: ../../library/urllib.parse.rst:780 msgid ":rfc:`1808` - Relative Uniform Resource Locators" msgstr "" ":rfc:`1808` - 相對的統一資源定位器 (Relative Uniform Resource Locators)" -#: ../../library/urllib.parse.rst:772 +#: ../../library/urllib.parse.rst:781 msgid "" "This Request For Comments includes the rules for joining an absolute and a " "relative URL, including a fair number of \"Abnormal Examples\" which govern " "the treatment of border cases." msgstr "" -#: ../../library/urllib.parse.rst:776 +#: ../../library/urllib.parse.rst:785 msgid ":rfc:`1738` - Uniform Resource Locators (URL)" msgstr ":rfc:`1738` - 統一資源定位器 (URL, Uniform Resource Locators)" -#: ../../library/urllib.parse.rst:777 +#: ../../library/urllib.parse.rst:786 msgid "This specifies the formal syntax and semantics of absolute URLs." msgstr "" diff --git a/library/urllib.request.po b/library/urllib.request.po index aa86249d18..e18223387e 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-11 00:13+0000\n" +"POT-Creation-Date: 2024-11-25 00:14+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -290,27 +290,46 @@ msgstr "" #: ../../library/urllib.request.rst:152 msgid "" -"Convert the pathname *path* from the local syntax for a path to the form " -"used in the path component of a URL. This does not produce a complete URL. " -"The return value will already be quoted using the :func:`~urllib.parse." -"quote` function." +"Convert the given local path to a ``file:`` URL. This function uses :func:" +"`~urllib.parse.quote` function to encode the path. For historical reasons, " +"the return value omits the ``file:`` scheme prefix. This example shows the " +"function being used on Windows::" msgstr "" -"將路徑名 *path* 從路徑的本地語法 (local syntax) 轉換為 URL 中的 path " -"component(路徑元件)格式。本函式並不會產生完整的 URL。回傳值將使用 :func:" -"`~urllib.parse.quote` 函式先進行編碼過。" -#: ../../library/urllib.request.rst:159 +#: ../../library/urllib.request.rst:157 msgid "" -"Convert the path component *path* from a percent-encoded URL to the local " -"syntax for a path. This does not accept a complete URL. This function " -"uses :func:`~urllib.parse.unquote` to decode *path*." +">>> from urllib.request import pathname2url\n" +">>> path = 'C:\\\\Program Files'\n" +">>> 'file:' + pathname2url(path)\n" +"'file:///C:/Program%20Files'" msgstr "" -"將一個用 \"%\" 編碼過的 URL path component *path* 轉換為路徑的本地語法 " -"(local syntax)。本函式並不接受完整的 URL。本函式使用 :func:`~urllib.parse." -"unquote` 來將 *path* 解碼。" +">>> from urllib.request import pathname2url\n" +">>> path = 'C:\\\\Program Files'\n" +">>> 'file:' + pathname2url(path)\n" +"'file:///C:/Program%20Files'" #: ../../library/urllib.request.rst:165 msgid "" +"Convert the given ``file:`` URL to a local path. This function uses :func:" +"`~urllib.parse.unquote` to decode the URL. For historical reasons, the given " +"value *must* omit the ``file:`` scheme prefix. This example shows the " +"function being used on Windows::" +msgstr "" + +#: ../../library/urllib.request.rst:170 +msgid "" +">>> from urllib.request import url2pathname\n" +">>> url = 'file:///C:/Program%20Files'\n" +">>> url2pathname(url.removeprefix('file:'))\n" +"'C:\\\\Program Files'" +msgstr "" +">>> from urllib.request import url2pathname\n" +">>> url = 'file:///C:/Program%20Files'\n" +">>> url2pathname(url.removeprefix('file:'))\n" +"'C:\\\\Program Files'" + +#: ../../library/urllib.request.rst:177 +msgid "" "This helper function returns a dictionary of scheme to proxy server URL " "mappings. It scans the environment for variables named ``_proxy``, " "in a case insensitive approach, for all operating systems first, and when it " @@ -324,7 +343,7 @@ msgstr "" "Configuration) 或是 Windows 系統中的 Windows Systems Registry 尋找代理服務設" "定。如果大小寫的環境變數同時存在且值有不同,小寫的環境變數會被選用。" -#: ../../library/urllib.request.rst:175 +#: ../../library/urllib.request.rst:187 msgid "" "If the environment variable ``REQUEST_METHOD`` is set, which usually " "indicates your script is running in a CGI environment, the environment " @@ -341,19 +360,19 @@ msgstr "" "``ProxyHandler``,亦或是確認變數名稱是小寫的(或至少 ``_proxy`` 後綴是小寫" "的)。" -#: ../../library/urllib.request.rst:184 +#: ../../library/urllib.request.rst:196 msgid "The following classes are provided:" msgstr "提供了以下的 classes:" -#: ../../library/urllib.request.rst:188 +#: ../../library/urllib.request.rst:200 msgid "This class is an abstraction of a URL request." msgstr "這個 class 是一個 URL 請求的抽象 class。" -#: ../../library/urllib.request.rst:190 +#: ../../library/urllib.request.rst:202 msgid "*url* should be a string containing a valid, properly encoded URL." msgstr "*url* 是一個包含有效且適當編碼的 URL 字串。" -#: ../../library/urllib.request.rst:192 +#: ../../library/urllib.request.rst:204 msgid "" "*data* must be an object specifying additional data to send to the server, " "or ``None`` if no such data is needed. Currently HTTP requests are the only " @@ -374,7 +393,7 @@ msgstr "" "``Transfer-Encoding: chunked`` 則會被用來傳送檔案或是其它可疊代物件 " "(iterables)。" -#: ../../library/urllib.request.rst:202 +#: ../../library/urllib.request.rst:214 msgid "" "For an HTTP POST request method, *data* should be a buffer in the standard :" "mimetype:`application/x-www-form-urlencoded` format. The :func:`urllib." @@ -387,7 +406,7 @@ msgstr "" "個 mapping 或是 sequence(序列)的 2-tuples,並回傳一個對應格式的 ASCII 字" "串。在被作為 *data* 參數前它應該被編碼成位元組串。" -#: ../../library/urllib.request.rst:208 +#: ../../library/urllib.request.rst:220 msgid "" "*headers* should be a dictionary, and will be treated as if :meth:" "`add_header` was called with each key and value as arguments. This is often " @@ -408,7 +427,7 @@ msgstr "" "(在 Python 2.6 上)。所有 header 的鍵都會以 camel case(駝峰式大小寫)來傳" "送。" -#: ../../library/urllib.request.rst:219 +#: ../../library/urllib.request.rst:231 msgid "" "An appropriate ``Content-Type`` header should be included if the *data* " "argument is present. If this header has not been provided and *data* is not " @@ -419,14 +438,14 @@ msgstr "" "個 header 沒有被提供且 *data* 也不為 ``None`` 時,預設值 ``Content-Type: " "application/x-www-form-urlencoded`` 會被新增至請求中。" -#: ../../library/urllib.request.rst:224 +#: ../../library/urllib.request.rst:236 msgid "" "The next two arguments are only of interest for correct handling of third-" "party HTTP cookies:" msgstr "" "接下來的兩個引數的介紹提供給那些有興趣正確處理第三方 HTTP cookies 的使用者:" -#: ../../library/urllib.request.rst:227 +#: ../../library/urllib.request.rst:239 msgid "" "*origin_req_host* should be the request-host of the origin transaction, as " "defined by :rfc:`2965`. It defaults to ``http.cookiejar." @@ -440,7 +459,7 @@ msgstr "" "起的原始請求的主機名稱或是 IP 位址。例如當請求是要求一個 HTML 文件中的一個影" "像,則這個屬性應為請求包含影像頁面的請求主機。" -#: ../../library/urllib.request.rst:235 +#: ../../library/urllib.request.rst:247 msgid "" "*unverifiable* should indicate whether the request is unverifiable, as " "defined by :rfc:`2965`. It defaults to ``False``. An unverifiable request " @@ -453,7 +472,7 @@ msgstr "" "URL,例如一個對於 HTML 文件中的影像所做的請求,而使用者沒有機會去批准是否能自" "動擷取影像,則這個值應該為 true。" -#: ../../library/urllib.request.rst:242 +#: ../../library/urllib.request.rst:254 msgid "" "*method* should be a string that indicates the HTTP request method that will " "be used (e.g. ``'HEAD'``). If provided, its value is stored in the :attr:" @@ -468,7 +487,7 @@ msgstr "" "Subclasses 可以透過設置其 :attr:`~Request.method` 屬性來設定不一樣的預設請求" "方法。" -#: ../../library/urllib.request.rst:250 +#: ../../library/urllib.request.rst:262 msgid "" "The request will not work as expected if the data object is unable to " "deliver its content more than once (e.g. a file or an iterable that can " @@ -482,15 +501,15 @@ msgstr "" "新嘗試傳送,則該請求不會正常運作。*data* 會接在 headers 之後被送至 HTTP 伺服" "器。此函式庫沒有支援 100-continue expectation。" -#: ../../library/urllib.request.rst:257 +#: ../../library/urllib.request.rst:269 msgid ":attr:`Request.method` argument is added to the Request class." msgstr "新增 :attr:`Request.method` 引數到 Request class。" -#: ../../library/urllib.request.rst:260 +#: ../../library/urllib.request.rst:272 msgid "Default :attr:`Request.method` may be indicated at the class level." msgstr "能夠在 class 中設置預設的 :attr:`Request.method`。" -#: ../../library/urllib.request.rst:263 +#: ../../library/urllib.request.rst:275 msgid "" "Do not raise an error if the ``Content-Length`` has not been provided and " "*data* is neither ``None`` nor a bytes object. Fall back to use chunked " @@ -500,34 +519,34 @@ msgstr "" "串物件,則不會觸發錯誤,並 fall back(後備)使用分塊傳輸編碼 (chunked " "transfer encoding)。" -#: ../../library/urllib.request.rst:270 +#: ../../library/urllib.request.rst:282 msgid "" "The :class:`OpenerDirector` class opens URLs via :class:`BaseHandler`\\ s " "chained together. It manages the chaining of handlers, and recovery from " "errors." msgstr "" -#: ../../library/urllib.request.rst:276 +#: ../../library/urllib.request.rst:288 msgid "" "This is the base class for all registered handlers --- and handles only the " "simple mechanics of registration." msgstr "" -#: ../../library/urllib.request.rst:282 +#: ../../library/urllib.request.rst:294 msgid "" "A class which defines a default handler for HTTP error responses; all " "responses are turned into :exc:`~urllib.error.HTTPError` exceptions." msgstr "" -#: ../../library/urllib.request.rst:288 +#: ../../library/urllib.request.rst:300 msgid "A class to handle redirections." msgstr "" -#: ../../library/urllib.request.rst:293 +#: ../../library/urllib.request.rst:305 msgid "A class to handle HTTP Cookies." msgstr "" -#: ../../library/urllib.request.rst:298 +#: ../../library/urllib.request.rst:310 msgid "" "Cause requests to go through a proxy. If *proxies* is given, it must be a " "dictionary mapping protocol names to URLs of proxies. The default is to read " @@ -538,11 +557,11 @@ msgid "" "Configuration Framework." msgstr "" -#: ../../library/urllib.request.rst:306 +#: ../../library/urllib.request.rst:318 msgid "To disable autodetected proxy pass an empty dictionary." msgstr "" -#: ../../library/urllib.request.rst:308 +#: ../../library/urllib.request.rst:320 msgid "" "The :envvar:`no_proxy` environment variable can be used to specify hosts " "which shouldn't be reached via proxy; if set, it should be a comma-separated " @@ -550,24 +569,24 @@ msgid "" "``cern.ch,ncsa.uiuc.edu,some.host:8080``." msgstr "" -#: ../../library/urllib.request.rst:315 +#: ../../library/urllib.request.rst:327 msgid "" "``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see " "the documentation on :func:`~urllib.request.getproxies`." msgstr "" -#: ../../library/urllib.request.rst:321 +#: ../../library/urllib.request.rst:333 msgid "Keep a database of ``(realm, uri) -> (user, password)`` mappings." msgstr "" -#: ../../library/urllib.request.rst:326 +#: ../../library/urllib.request.rst:338 msgid "" "Keep a database of ``(realm, uri) -> (user, password)`` mappings. A realm " "of ``None`` is considered a catch-all realm, which is searched if no other " "realm fits." msgstr "" -#: ../../library/urllib.request.rst:333 +#: ../../library/urllib.request.rst:345 msgid "" "A variant of :class:`HTTPPasswordMgrWithDefaultRealm` that also has a " "database of ``uri -> is_authenticated`` mappings. Can be used by a " @@ -575,7 +594,7 @@ msgid "" "immediately instead of waiting for a ``401`` response first." msgstr "" -#: ../../library/urllib.request.rst:343 +#: ../../library/urllib.request.rst:355 msgid "" "This is a mixin class that helps with HTTP authentication, both to the " "remote host and to a proxy. *password_mgr*, if given, should be something " @@ -594,11 +613,11 @@ msgid "" "will automatically include the authentication credentials." msgstr "" -#: ../../library/urllib.request.rst:360 +#: ../../library/urllib.request.rst:372 msgid "Added ``is_authenticated`` support." msgstr "新增 ``is_authenticated`` 的支援。" -#: ../../library/urllib.request.rst:366 +#: ../../library/urllib.request.rst:378 msgid "" "Handle authentication with the remote host. *password_mgr*, if given, should " "be something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -607,7 +626,7 @@ msgid "" "presented with a wrong Authentication scheme." msgstr "" -#: ../../library/urllib.request.rst:375 ../../library/urllib.request.rst:409 +#: ../../library/urllib.request.rst:387 ../../library/urllib.request.rst:421 msgid "" "Handle authentication with the proxy. *password_mgr*, if given, should be " "something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -615,7 +634,7 @@ msgid "" "be supported." msgstr "" -#: ../../library/urllib.request.rst:383 +#: ../../library/urllib.request.rst:395 msgid "" "This is a mixin class that helps with HTTP authentication, both to the " "remote host and to a proxy. *password_mgr*, if given, should be something " @@ -623,7 +642,7 @@ msgid "" "`http-password-mgr` for information on the interface that must be supported." msgstr "" -#: ../../library/urllib.request.rst:392 +#: ../../library/urllib.request.rst:404 msgid "" "Handle authentication with the remote host. *password_mgr*, if given, should " "be something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -636,108 +655,108 @@ msgid "" "Digest or Basic." msgstr "" -#: ../../library/urllib.request.rst:402 +#: ../../library/urllib.request.rst:414 msgid "Raise :exc:`ValueError` on unsupported Authentication Scheme." msgstr "" -#: ../../library/urllib.request.rst:417 +#: ../../library/urllib.request.rst:429 msgid "A class to handle opening of HTTP URLs." msgstr "" -#: ../../library/urllib.request.rst:422 +#: ../../library/urllib.request.rst:434 msgid "" "A class to handle opening of HTTPS URLs. *context* and *check_hostname* " "have the same meaning as in :class:`http.client.HTTPSConnection`." msgstr "" -#: ../../library/urllib.request.rst:425 +#: ../../library/urllib.request.rst:437 msgid "*context* and *check_hostname* were added." msgstr "新增 *context* 與 *check_hostname*。" -#: ../../library/urllib.request.rst:431 +#: ../../library/urllib.request.rst:443 msgid "Open local files." msgstr "" -#: ../../library/urllib.request.rst:435 +#: ../../library/urllib.request.rst:447 msgid "Open data URLs." msgstr "" -#: ../../library/urllib.request.rst:441 +#: ../../library/urllib.request.rst:453 msgid "Open FTP URLs." -msgstr "" +msgstr "打開 FTP URLs。" -#: ../../library/urllib.request.rst:446 +#: ../../library/urllib.request.rst:458 msgid "" "Open FTP URLs, keeping a cache of open FTP connections to minimize delays." msgstr "" -#: ../../library/urllib.request.rst:451 +#: ../../library/urllib.request.rst:463 msgid "A catch-all class to handle unknown URLs." msgstr "" -#: ../../library/urllib.request.rst:456 ../../library/urllib.request.rst:1162 +#: ../../library/urllib.request.rst:468 ../../library/urllib.request.rst:1174 msgid "Process HTTP error responses." msgstr "" -#: ../../library/urllib.request.rst:462 +#: ../../library/urllib.request.rst:474 msgid "Request Objects" -msgstr "" +msgstr "Request 物件" -#: ../../library/urllib.request.rst:464 +#: ../../library/urllib.request.rst:476 msgid "" "The following methods describe :class:`Request`'s public interface, and so " "all may be overridden in subclasses. It also defines several public " "attributes that can be used by clients to inspect the parsed request." msgstr "" -#: ../../library/urllib.request.rst:471 +#: ../../library/urllib.request.rst:483 msgid "The original URL passed to the constructor." msgstr "" -#: ../../library/urllib.request.rst:475 +#: ../../library/urllib.request.rst:487 msgid "" "Request.full_url is a property with setter, getter and a deleter. Getting :" "attr:`~Request.full_url` returns the original request URL with the fragment, " "if it was present." msgstr "" -#: ../../library/urllib.request.rst:481 +#: ../../library/urllib.request.rst:493 msgid "The URI scheme." msgstr "" -#: ../../library/urllib.request.rst:485 +#: ../../library/urllib.request.rst:497 msgid "" "The URI authority, typically a host, but may also contain a port separated " "by a colon." msgstr "" -#: ../../library/urllib.request.rst:490 +#: ../../library/urllib.request.rst:502 msgid "The original host for the request, without port." msgstr "" -#: ../../library/urllib.request.rst:494 +#: ../../library/urllib.request.rst:506 msgid "" "The URI path. If the :class:`Request` uses a proxy, then selector will be " "the full URL that is passed to the proxy." msgstr "" -#: ../../library/urllib.request.rst:499 +#: ../../library/urllib.request.rst:511 msgid "The entity body for the request, or ``None`` if not specified." msgstr "" -#: ../../library/urllib.request.rst:501 +#: ../../library/urllib.request.rst:513 msgid "" "Changing value of :attr:`Request.data` now deletes \"Content-Length\" header " "if it was previously set or calculated." msgstr "" -#: ../../library/urllib.request.rst:507 +#: ../../library/urllib.request.rst:519 msgid "" "boolean, indicates whether the request is unverifiable as defined by :rfc:" "`2965`." msgstr "" -#: ../../library/urllib.request.rst:512 +#: ../../library/urllib.request.rst:524 msgid "" "The HTTP request method to use. By default its value is :const:`None`, " "which means that :meth:`~Request.get_method` will do its normal computation " @@ -748,13 +767,13 @@ msgid "" "argument." msgstr "" -#: ../../library/urllib.request.rst:522 +#: ../../library/urllib.request.rst:534 msgid "" "A default value can now be set in subclasses; previously it could only be " "set via the constructor argument." msgstr "" -#: ../../library/urllib.request.rst:529 +#: ../../library/urllib.request.rst:541 msgid "" "Return a string indicating the HTTP request method. If :attr:`Request." "method` is not ``None``, return its value, otherwise return ``'GET'`` if :" @@ -762,11 +781,11 @@ msgid "" "meaningful for HTTP requests." msgstr "" -#: ../../library/urllib.request.rst:534 +#: ../../library/urllib.request.rst:546 msgid "get_method now looks at the value of :attr:`Request.method`." msgstr "" -#: ../../library/urllib.request.rst:540 +#: ../../library/urllib.request.rst:552 msgid "" "Add another header to the request. Headers are currently ignored by all " "handlers except HTTP handlers, where they are added to the list of headers " @@ -778,64 +797,64 @@ msgid "" "headers added using this method are also added to redirected requests." msgstr "" -#: ../../library/urllib.request.rst:552 +#: ../../library/urllib.request.rst:564 msgid "Add a header that will not be added to a redirected request." msgstr "" -#: ../../library/urllib.request.rst:557 +#: ../../library/urllib.request.rst:569 msgid "" "Return whether the instance has the named header (checks both regular and " "unredirected)." msgstr "" -#: ../../library/urllib.request.rst:563 +#: ../../library/urllib.request.rst:575 msgid "" "Remove named header from the request instance (both from regular and " "unredirected headers)." msgstr "" -#: ../../library/urllib.request.rst:571 +#: ../../library/urllib.request.rst:583 msgid "Return the URL given in the constructor." msgstr "" -#: ../../library/urllib.request.rst:575 +#: ../../library/urllib.request.rst:587 msgid "Returns :attr:`Request.full_url`" -msgstr "" +msgstr "回傳 :attr:`Request.full_url`" -#: ../../library/urllib.request.rst:580 +#: ../../library/urllib.request.rst:592 msgid "" "Prepare the request by connecting to a proxy server. The *host* and *type* " "will replace those of the instance, and the instance's selector will be the " "original URL given in the constructor." msgstr "" -#: ../../library/urllib.request.rst:587 +#: ../../library/urllib.request.rst:599 msgid "" "Return the value of the given header. If the header is not present, return " "the default value." msgstr "" -#: ../../library/urllib.request.rst:593 +#: ../../library/urllib.request.rst:605 msgid "" "Return a list of tuples (header_name, header_value) of the Request headers." msgstr "" -#: ../../library/urllib.request.rst:595 +#: ../../library/urllib.request.rst:607 msgid "" "The request methods add_data, has_data, get_data, get_type, get_host, " "get_selector, get_origin_req_host and is_unverifiable that were deprecated " "since 3.3 have been removed." msgstr "" -#: ../../library/urllib.request.rst:604 +#: ../../library/urllib.request.rst:616 msgid "OpenerDirector Objects" msgstr "OpenerDirector 物件" -#: ../../library/urllib.request.rst:606 +#: ../../library/urllib.request.rst:618 msgid ":class:`OpenerDirector` instances have the following methods:" -msgstr "" +msgstr ":class:`OpenerDirector` 物件有以下的方法:" -#: ../../library/urllib.request.rst:611 +#: ../../library/urllib.request.rst:623 msgid "" "*handler* should be an instance of :class:`BaseHandler`. The following " "methods are searched, and added to the possible chains (note that HTTP " @@ -846,53 +865,53 @@ msgid "" "`http_error_404` would handle HTTP 404 errors." msgstr "" -#: ../../library/urllib.request.rst:619 +#: ../../library/urllib.request.rst:631 msgid "" ":meth:`!_open` --- signal that the handler knows how to open " "*protocol* URLs." msgstr "" -#: ../../library/urllib.request.rst:622 +#: ../../library/urllib.request.rst:634 msgid "See |protocol_open|_ for more information." msgstr "更多資訊請見 |protocol_open|_。" -#: ../../library/urllib.request.rst:624 +#: ../../library/urllib.request.rst:636 msgid "" ":meth:`!http_error_\\` --- signal that the handler knows how to " "handle HTTP errors with HTTP error code *type*." msgstr "" -#: ../../library/urllib.request.rst:627 +#: ../../library/urllib.request.rst:639 msgid "See |http_error_nnn|_ for more information." msgstr "更多資訊請見 |http_error_nnn|_。" -#: ../../library/urllib.request.rst:629 +#: ../../library/urllib.request.rst:641 msgid "" ":meth:`!_error` --- signal that the handler knows how to handle " "errors from (non-\\ ``http``) *protocol*." msgstr "" -#: ../../library/urllib.request.rst:632 +#: ../../library/urllib.request.rst:644 msgid "" ":meth:`!_request` --- signal that the handler knows how to pre-" "process *protocol* requests." msgstr "" -#: ../../library/urllib.request.rst:635 +#: ../../library/urllib.request.rst:647 msgid "See |protocol_request|_ for more information." msgstr "更多資訊請見 |protocol_request|_。" -#: ../../library/urllib.request.rst:637 +#: ../../library/urllib.request.rst:649 msgid "" ":meth:`!_response` --- signal that the handler knows how to post-" "process *protocol* responses." msgstr "" -#: ../../library/urllib.request.rst:640 +#: ../../library/urllib.request.rst:652 msgid "See |protocol_response|_ for more information." msgstr "更多資訊請見 |protocol_response|_。" -#: ../../library/urllib.request.rst:649 +#: ../../library/urllib.request.rst:661 msgid "" "Open the given *url* (which can be a request object or a string), optionally " "passing the given *data*. Arguments, return values and exceptions raised are " @@ -904,7 +923,7 @@ msgid "" "HTTP, HTTPS and FTP connections." msgstr "" -#: ../../library/urllib.request.rst:661 +#: ../../library/urllib.request.rst:673 msgid "" "Handle an error of the given protocol. This will call the registered error " "handlers for the given protocol with the given arguments (which are protocol " @@ -913,28 +932,28 @@ msgid "" "http_error_\\` methods of the handler classes." msgstr "" -#: ../../library/urllib.request.rst:667 +#: ../../library/urllib.request.rst:679 msgid "" "Return values and exceptions raised are the same as those of :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:669 +#: ../../library/urllib.request.rst:681 msgid "OpenerDirector objects open URLs in three stages:" msgstr "" -#: ../../library/urllib.request.rst:671 +#: ../../library/urllib.request.rst:683 msgid "" "The order in which these methods are called within each stage is determined " "by sorting the handler instances." msgstr "" -#: ../../library/urllib.request.rst:674 +#: ../../library/urllib.request.rst:686 msgid "" "Every handler with a method named like :meth:`!_request` has that " "method called to pre-process the request." msgstr "" -#: ../../library/urllib.request.rst:677 +#: ../../library/urllib.request.rst:689 msgid "" "Handlers with a method named like :meth:`!_open` are called to " "handle the request. This stage ends when a handler either returns a non-\\ :" @@ -942,7 +961,7 @@ msgid "" "`~urllib.error.URLError`). Exceptions are allowed to propagate." msgstr "" -#: ../../library/urllib.request.rst:682 +#: ../../library/urllib.request.rst:694 msgid "" "In fact, the above algorithm is first tried for methods named :meth:" "`~BaseHandler.default_open`. If all such methods return :const:`None`, the " @@ -951,64 +970,64 @@ msgid "" "named :meth:`~BaseHandler.unknown_open`." msgstr "" -#: ../../library/urllib.request.rst:688 +#: ../../library/urllib.request.rst:700 msgid "" "Note that the implementation of these methods may involve calls of the " "parent :class:`OpenerDirector` instance's :meth:`~OpenerDirector.open` and :" "meth:`~OpenerDirector.error` methods." msgstr "" -#: ../../library/urllib.request.rst:692 +#: ../../library/urllib.request.rst:704 msgid "" "Every handler with a method named like :meth:`!_response` has that " "method called to post-process the response." msgstr "" -#: ../../library/urllib.request.rst:699 +#: ../../library/urllib.request.rst:711 msgid "BaseHandler Objects" msgstr "BaseHandler 物件" -#: ../../library/urllib.request.rst:701 +#: ../../library/urllib.request.rst:713 msgid "" ":class:`BaseHandler` objects provide a couple of methods that are directly " "useful, and others that are meant to be used by derived classes. These are " "intended for direct use:" msgstr "" -#: ../../library/urllib.request.rst:708 +#: ../../library/urllib.request.rst:720 msgid "Add a director as parent." msgstr "" -#: ../../library/urllib.request.rst:713 +#: ../../library/urllib.request.rst:725 msgid "Remove any parents." msgstr "" -#: ../../library/urllib.request.rst:715 +#: ../../library/urllib.request.rst:727 msgid "" "The following attribute and methods should only be used by classes derived " "from :class:`BaseHandler`." msgstr "" -#: ../../library/urllib.request.rst:720 +#: ../../library/urllib.request.rst:732 msgid "" "The convention has been adopted that subclasses defining :meth:`!" "_request` or :meth:`!_response` methods are named :class:" "`!\\*Processor`; all others are named :class:`!\\*Handler`." msgstr "" -#: ../../library/urllib.request.rst:727 +#: ../../library/urllib.request.rst:739 msgid "" "A valid :class:`OpenerDirector`, which can be used to open using a different " "protocol, or handle errors." msgstr "" -#: ../../library/urllib.request.rst:733 +#: ../../library/urllib.request.rst:745 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to catch all URLs." msgstr "" -#: ../../library/urllib.request.rst:736 +#: ../../library/urllib.request.rst:748 msgid "" "This method, if implemented, will be called by the parent :class:" "`OpenerDirector`. It should return a file-like object as described in the " @@ -1018,38 +1037,38 @@ msgid "" "`MemoryError` should not be mapped to :exc:`~urllib.error.URLError`)." msgstr "" -#: ../../library/urllib.request.rst:743 +#: ../../library/urllib.request.rst:755 msgid "This method will be called before any protocol-specific open method." msgstr "" -#: ../../library/urllib.request.rst:750 +#: ../../library/urllib.request.rst:762 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to handle URLs with the given protocol." msgstr "" -#: ../../library/urllib.request.rst:753 +#: ../../library/urllib.request.rst:765 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. Return values should be the same as for :meth:" "`~BaseHandler.default_open`." msgstr "" -#: ../../library/urllib.request.rst:759 +#: ../../library/urllib.request.rst:771 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to catch all URLs with no specific registered handler " "to open it." msgstr "" -#: ../../library/urllib.request.rst:763 +#: ../../library/urllib.request.rst:775 msgid "" "This method, if implemented, will be called by the :attr:`parent` :class:" "`OpenerDirector`. Return values should be the same as for :meth:" "`default_open`." msgstr "" -#: ../../library/urllib.request.rst:770 +#: ../../library/urllib.request.rst:782 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "override it if they intend to provide a catch-all for otherwise unhandled " @@ -1058,7 +1077,7 @@ msgid "" "other circumstances." msgstr "" -#: ../../library/urllib.request.rst:775 +#: ../../library/urllib.request.rst:787 msgid "" "*req* will be a :class:`Request` object, *fp* will be a file-like object " "with the HTTP error body, *code* will be the three-digit code of the error, " @@ -1066,49 +1085,49 @@ msgid "" "mapping object with the headers of the error." msgstr "" -#: ../../library/urllib.request.rst:780 +#: ../../library/urllib.request.rst:792 msgid "" "Return values and exceptions raised should be the same as those of :func:" "`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:787 +#: ../../library/urllib.request.rst:799 msgid "" "*nnn* should be a three-digit HTTP error code. This method is also not " "defined in :class:`BaseHandler`, but will be called, if it exists, on an " "instance of a subclass, when an HTTP error with code *nnn* occurs." msgstr "" -#: ../../library/urllib.request.rst:791 +#: ../../library/urllib.request.rst:803 msgid "Subclasses should override this method to handle specific HTTP errors." msgstr "" -#: ../../library/urllib.request.rst:793 +#: ../../library/urllib.request.rst:805 msgid "" "Arguments, return values and exceptions raised should be the same as for :" "meth:`~BaseHandler.http_error_default`." msgstr "" -#: ../../library/urllib.request.rst:801 +#: ../../library/urllib.request.rst:813 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to pre-process requests of the given protocol." msgstr "" -#: ../../library/urllib.request.rst:804 +#: ../../library/urllib.request.rst:816 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. *req* will be a :class:`Request` object. The return value " "should be a :class:`Request` object." msgstr "" -#: ../../library/urllib.request.rst:813 +#: ../../library/urllib.request.rst:825 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to post-process responses of the given protocol." msgstr "" -#: ../../library/urllib.request.rst:816 +#: ../../library/urllib.request.rst:828 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. *req* will be a :class:`Request` object. *response* will " @@ -1117,25 +1136,25 @@ msgid "" "return value of :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:826 +#: ../../library/urllib.request.rst:838 msgid "HTTPRedirectHandler Objects" msgstr "HTTPRedirectHandler 物件" -#: ../../library/urllib.request.rst:830 +#: ../../library/urllib.request.rst:842 msgid "" "Some HTTP redirections require action from this module's client code. If " "this is the case, :exc:`~urllib.error.HTTPError` is raised. See :rfc:`2616` " "for details of the precise meanings of the various redirection codes." msgstr "" -#: ../../library/urllib.request.rst:834 +#: ../../library/urllib.request.rst:846 msgid "" "An :exc:`~urllib.error.HTTPError` exception raised as a security " "consideration if the HTTPRedirectHandler is presented with a redirected URL " "which is not an HTTP, HTTPS or FTP URL." msgstr "" -#: ../../library/urllib.request.rst:841 +#: ../../library/urllib.request.rst:853 msgid "" "Return a :class:`Request` or ``None`` in response to a redirect. This is " "called by the default implementations of the :meth:`!http_error_30\\*` " @@ -1146,7 +1165,7 @@ msgid "" "URL, or return ``None`` if you can't but another handler might." msgstr "" -#: ../../library/urllib.request.rst:851 +#: ../../library/urllib.request.rst:863 msgid "" "The default implementation of this method does not strictly follow :rfc:" "`2616`, which says that 301 and 302 responses to ``POST`` requests must not " @@ -1155,54 +1174,54 @@ msgid "" "POST to a ``GET``, and the default implementation reproduces this behavior." msgstr "" -#: ../../library/urllib.request.rst:860 +#: ../../library/urllib.request.rst:872 msgid "" "Redirect to the ``Location:`` or ``URI:`` URL. This method is called by the " "parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' " "response." msgstr "" -#: ../../library/urllib.request.rst:866 +#: ../../library/urllib.request.rst:878 msgid "" "The same as :meth:`http_error_301`, but called for the 'found' response." msgstr "" -#: ../../library/urllib.request.rst:871 +#: ../../library/urllib.request.rst:883 msgid "" "The same as :meth:`http_error_301`, but called for the 'see other' response." msgstr "" -#: ../../library/urllib.request.rst:876 +#: ../../library/urllib.request.rst:888 msgid "" "The same as :meth:`http_error_301`, but called for the 'temporary redirect' " "response. It does not allow changing the request method from ``POST`` to " "``GET``." msgstr "" -#: ../../library/urllib.request.rst:883 +#: ../../library/urllib.request.rst:895 msgid "" "The same as :meth:`http_error_301`, but called for the 'permanent redirect' " "response. It does not allow changing the request method from ``POST`` to " "``GET``." msgstr "" -#: ../../library/urllib.request.rst:893 +#: ../../library/urllib.request.rst:905 msgid "HTTPCookieProcessor Objects" msgstr "HTTPCookieProcessor 物件" -#: ../../library/urllib.request.rst:895 +#: ../../library/urllib.request.rst:907 msgid ":class:`HTTPCookieProcessor` instances have one attribute:" msgstr "" -#: ../../library/urllib.request.rst:899 +#: ../../library/urllib.request.rst:911 msgid "The :class:`http.cookiejar.CookieJar` in which cookies are stored." msgstr "" -#: ../../library/urllib.request.rst:905 +#: ../../library/urllib.request.rst:917 msgid "ProxyHandler Objects" msgstr "ProxyHandler 物件" -#: ../../library/urllib.request.rst:911 +#: ../../library/urllib.request.rst:923 msgid "" "The :class:`ProxyHandler` will have a method :meth:`!_open` for " "every *protocol* which has a proxy in the *proxies* dictionary given in the " @@ -1211,17 +1230,17 @@ msgid "" "actually execute the protocol." msgstr "" -#: ../../library/urllib.request.rst:921 +#: ../../library/urllib.request.rst:933 msgid "HTTPPasswordMgr Objects" msgstr "HTTPPasswordMgr 物件" -#: ../../library/urllib.request.rst:923 +#: ../../library/urllib.request.rst:935 msgid "" "These methods are available on :class:`HTTPPasswordMgr` and :class:" "`HTTPPasswordMgrWithDefaultRealm` objects." msgstr "" -#: ../../library/urllib.request.rst:929 +#: ../../library/urllib.request.rst:941 msgid "" "*uri* can be either a single URI, or a sequence of URIs. *realm*, *user* and " "*passwd* must be strings. This causes ``(user, passwd)`` to be used as " @@ -1229,30 +1248,30 @@ msgid "" "of the given URIs is given." msgstr "" -#: ../../library/urllib.request.rst:937 +#: ../../library/urllib.request.rst:949 msgid "" "Get user/password for given realm and URI, if any. This method will return " "``(None, None)`` if there is no matching user/password." msgstr "" -#: ../../library/urllib.request.rst:940 +#: ../../library/urllib.request.rst:952 msgid "" "For :class:`HTTPPasswordMgrWithDefaultRealm` objects, the realm ``None`` " "will be searched if the given *realm* has no matching user/password." msgstr "" -#: ../../library/urllib.request.rst:947 +#: ../../library/urllib.request.rst:959 msgid "HTTPPasswordMgrWithPriorAuth Objects" msgstr "HTTPPasswordMgrWithPriorAuth 物件" -#: ../../library/urllib.request.rst:949 +#: ../../library/urllib.request.rst:961 msgid "" "This password manager extends :class:`HTTPPasswordMgrWithDefaultRealm` to " "support tracking URIs for which authentication credentials should always be " "sent." msgstr "" -#: ../../library/urllib.request.rst:956 +#: ../../library/urllib.request.rst:968 msgid "" "*realm*, *uri*, *user*, *passwd* are as for :meth:`HTTPPasswordMgr." "add_password`. *is_authenticated* sets the initial value of the " @@ -1260,25 +1279,25 @@ msgid "" "*is_authenticated* is specified as ``True``, *realm* is ignored." msgstr "" -#: ../../library/urllib.request.rst:964 +#: ../../library/urllib.request.rst:976 msgid "Same as for :class:`HTTPPasswordMgrWithDefaultRealm` objects" msgstr "" -#: ../../library/urllib.request.rst:970 +#: ../../library/urllib.request.rst:982 msgid "" "Update the ``is_authenticated`` flag for the given *uri* or list of URIs." msgstr "" -#: ../../library/urllib.request.rst:976 +#: ../../library/urllib.request.rst:988 msgid "" "Returns the current state of the ``is_authenticated`` flag for the given URI." msgstr "" -#: ../../library/urllib.request.rst:983 +#: ../../library/urllib.request.rst:995 msgid "AbstractBasicAuthHandler Objects" msgstr "AbstractBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:988 +#: ../../library/urllib.request.rst:1000 msgid "" "Handle an authentication request by getting a user/password pair, and re-" "trying the request. *authreq* should be the name of the header where the " @@ -1287,7 +1306,7 @@ msgid "" "`Request` object, and *headers* should be the error headers." msgstr "" -#: ../../library/urllib.request.rst:994 +#: ../../library/urllib.request.rst:1006 msgid "" "*host* is either an authority (e.g. ``\"python.org\"``) or a URL containing " "an authority component (e.g. ``\"http://python.org/\"``). In either case, " @@ -1295,24 +1314,24 @@ msgid "" "and ``\"python.org:80\"`` are fine, ``\"joe:password@python.org\"`` is not)." msgstr "" -#: ../../library/urllib.request.rst:1003 +#: ../../library/urllib.request.rst:1015 msgid "HTTPBasicAuthHandler Objects" msgstr "HTTPBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:1008 ../../library/urllib.request.rst:1019 -#: ../../library/urllib.request.rst:1044 ../../library/urllib.request.rst:1055 +#: ../../library/urllib.request.rst:1020 ../../library/urllib.request.rst:1031 +#: ../../library/urllib.request.rst:1056 ../../library/urllib.request.rst:1067 msgid "Retry the request with authentication information, if available." msgstr "" -#: ../../library/urllib.request.rst:1014 +#: ../../library/urllib.request.rst:1026 msgid "ProxyBasicAuthHandler Objects" msgstr "ProxyBasicAuthHandler 物件" -#: ../../library/urllib.request.rst:1025 +#: ../../library/urllib.request.rst:1037 msgid "AbstractDigestAuthHandler Objects" msgstr "AbstractDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1030 +#: ../../library/urllib.request.rst:1042 msgid "" "*authreq* should be the name of the header where the information about the " "realm is included in the request, *host* should be the host to authenticate " @@ -1320,55 +1339,55 @@ msgid "" "should be the error headers." msgstr "" -#: ../../library/urllib.request.rst:1039 +#: ../../library/urllib.request.rst:1051 msgid "HTTPDigestAuthHandler Objects" msgstr "HTTPDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1050 +#: ../../library/urllib.request.rst:1062 msgid "ProxyDigestAuthHandler Objects" msgstr "ProxyDigestAuthHandler 物件" -#: ../../library/urllib.request.rst:1061 +#: ../../library/urllib.request.rst:1073 msgid "HTTPHandler Objects" msgstr "HTTPHandler 物件" -#: ../../library/urllib.request.rst:1066 +#: ../../library/urllib.request.rst:1078 msgid "" "Send an HTTP request, which can be either GET or POST, depending on ``req." "has_data()``." msgstr "" -#: ../../library/urllib.request.rst:1073 +#: ../../library/urllib.request.rst:1085 msgid "HTTPSHandler Objects" msgstr "HTTPSHandler 物件" -#: ../../library/urllib.request.rst:1078 +#: ../../library/urllib.request.rst:1090 msgid "" "Send an HTTPS request, which can be either GET or POST, depending on ``req." "has_data()``." msgstr "" -#: ../../library/urllib.request.rst:1085 +#: ../../library/urllib.request.rst:1097 msgid "FileHandler Objects" msgstr "FileHandler 物件" -#: ../../library/urllib.request.rst:1090 +#: ../../library/urllib.request.rst:1102 msgid "" "Open the file locally, if there is no host name, or the host name is " "``'localhost'``." msgstr "" -#: ../../library/urllib.request.rst:1093 +#: ../../library/urllib.request.rst:1105 msgid "" "This method is applicable only for local hostnames. When a remote hostname " "is given, a :exc:`~urllib.error.URLError` is raised." msgstr "" -#: ../../library/urllib.request.rst:1101 +#: ../../library/urllib.request.rst:1113 msgid "DataHandler Objects" msgstr "DataHandler 物件" -#: ../../library/urllib.request.rst:1105 +#: ../../library/urllib.request.rst:1117 msgid "" "Read a data URL. This kind of URL contains the content encoded in the URL " "itself. The data URL syntax is specified in :rfc:`2397`. This implementation " @@ -1378,51 +1397,51 @@ msgid "" "implementation will raise a :exc:`ValueError` in that case." msgstr "" -#: ../../library/urllib.request.rst:1116 +#: ../../library/urllib.request.rst:1128 msgid "FTPHandler Objects" msgstr "FTPHandler 物件" -#: ../../library/urllib.request.rst:1121 +#: ../../library/urllib.request.rst:1133 msgid "" "Open the FTP file indicated by *req*. The login is always done with empty " "username and password." msgstr "" -#: ../../library/urllib.request.rst:1128 +#: ../../library/urllib.request.rst:1140 msgid "CacheFTPHandler Objects" msgstr "CacheFTPHandler 物件" -#: ../../library/urllib.request.rst:1130 +#: ../../library/urllib.request.rst:1142 msgid "" ":class:`CacheFTPHandler` objects are :class:`FTPHandler` objects with the " "following additional methods:" msgstr "" -#: ../../library/urllib.request.rst:1136 +#: ../../library/urllib.request.rst:1148 msgid "Set timeout of connections to *t* seconds." msgstr "" -#: ../../library/urllib.request.rst:1141 +#: ../../library/urllib.request.rst:1153 msgid "Set maximum number of cached connections to *m*." msgstr "" -#: ../../library/urllib.request.rst:1147 +#: ../../library/urllib.request.rst:1159 msgid "UnknownHandler Objects" msgstr "UnknownHandler 物件" -#: ../../library/urllib.request.rst:1152 +#: ../../library/urllib.request.rst:1164 msgid "Raise a :exc:`~urllib.error.URLError` exception." msgstr "" -#: ../../library/urllib.request.rst:1158 +#: ../../library/urllib.request.rst:1170 msgid "HTTPErrorProcessor Objects" msgstr "HTTPErrorProcessor 物件" -#: ../../library/urllib.request.rst:1164 +#: ../../library/urllib.request.rst:1176 msgid "For 200 error codes, the response object is returned immediately." msgstr "" -#: ../../library/urllib.request.rst:1166 +#: ../../library/urllib.request.rst:1178 msgid "" "For non-200 error codes, this simply passes the job on to the :meth:`!" "http_error_\\` handler methods, via :meth:`OpenerDirector.error`. " @@ -1430,31 +1449,31 @@ msgid "" "error.HTTPError` if no other handler handles the error." msgstr "" -#: ../../library/urllib.request.rst:1174 +#: ../../library/urllib.request.rst:1186 msgid "Process HTTPS error responses." msgstr "" -#: ../../library/urllib.request.rst:1176 +#: ../../library/urllib.request.rst:1188 msgid "The behavior is same as :meth:`http_response`." msgstr "" -#: ../../library/urllib.request.rst:1182 +#: ../../library/urllib.request.rst:1194 msgid "Examples" msgstr "範例" -#: ../../library/urllib.request.rst:1184 +#: ../../library/urllib.request.rst:1196 msgid "" "In addition to the examples below, more examples are given in :ref:`urllib-" "howto`." msgstr "" -#: ../../library/urllib.request.rst:1187 +#: ../../library/urllib.request.rst:1199 msgid "" "This example gets the python.org main page and displays the first 300 bytes " "of it. ::" msgstr "" -#: ../../library/urllib.request.rst:1190 +#: ../../library/urllib.request.rst:1202 msgid "" ">>> import urllib.request\n" ">>> with urllib.request.urlopen('http://www.python.org/') as f:\n" @@ -1480,7 +1499,7 @@ msgstr "" ">\\n\n" "Python Programming '" -#: ../../library/urllib.request.rst:1200 +#: ../../library/urllib.request.rst:1212 msgid "" "Note that urlopen returns a bytes object. This is because there is no way " "for urlopen to automatically determine the encoding of the byte stream it " @@ -1489,20 +1508,20 @@ msgid "" "appropriate encoding." msgstr "" -#: ../../library/urllib.request.rst:1206 +#: ../../library/urllib.request.rst:1218 msgid "" "The following W3C document, https://www.w3.org/International/O-charset\\ , " "lists the various ways in which an (X)HTML or an XML document could have " "specified its encoding information." msgstr "" -#: ../../library/urllib.request.rst:1210 +#: ../../library/urllib.request.rst:1222 msgid "" "As the python.org website uses *utf-8* encoding as specified in its meta " "tag, we will use the same for decoding the bytes object. ::" msgstr "" -#: ../../library/urllib.request.rst:1213 +#: ../../library/urllib.request.rst:1225 msgid "" ">>> with urllib.request.urlopen('http://www.python.org/') as f:\n" "... print(f.read(100).decode('utf-8'))\n" @@ -1516,13 +1535,13 @@ msgstr "" "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" "\"http://www.w3.org/TR/xhtml1/DTD/xhtm" -#: ../../library/urllib.request.rst:1219 +#: ../../library/urllib.request.rst:1231 msgid "" "It is also possible to achieve the same result without using the :term:" "`context manager` approach. ::" msgstr "" -#: ../../library/urllib.request.rst:1222 +#: ../../library/urllib.request.rst:1234 msgid "" ">>> import urllib.request\n" ">>> f = urllib.request.urlopen('http://www.python.org/')\n" @@ -1536,14 +1555,14 @@ msgstr "" "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" "\"http://www.w3.org/TR/xhtml1/DTD/xhtm" -#: ../../library/urllib.request.rst:1228 +#: ../../library/urllib.request.rst:1240 msgid "" "In the following example, we are sending a data-stream to the stdin of a CGI " "and reading the data it returns to us. Note that this example will only work " "when the Python installation supports SSL. ::" msgstr "" -#: ../../library/urllib.request.rst:1232 +#: ../../library/urllib.request.rst:1244 msgid "" ">>> import urllib.request\n" ">>> req = urllib.request.Request(url='https://localhost/cgi-bin/test.cgi',\n" @@ -1554,11 +1573,11 @@ msgid "" "Got Data: \"This data is passed to stdin of the CGI\"" msgstr "" -#: ../../library/urllib.request.rst:1240 +#: ../../library/urllib.request.rst:1252 msgid "The code for the sample CGI used in the above example is::" msgstr "" -#: ../../library/urllib.request.rst:1242 +#: ../../library/urllib.request.rst:1254 msgid "" "#!/usr/bin/env python\n" "import sys\n" @@ -1570,11 +1589,11 @@ msgstr "" "data = sys.stdin.read()\n" "print('Content-type: text/plain\\n\\nGot Data: \"%s\"' % data)" -#: ../../library/urllib.request.rst:1247 +#: ../../library/urllib.request.rst:1259 msgid "Here is an example of doing a ``PUT`` request using :class:`Request`::" msgstr "" -#: ../../library/urllib.request.rst:1249 +#: ../../library/urllib.request.rst:1261 msgid "" "import urllib.request\n" "DATA = b'some data'\n" @@ -1594,11 +1613,11 @@ msgstr "" "print(f.status)\n" "print(f.reason)" -#: ../../library/urllib.request.rst:1257 +#: ../../library/urllib.request.rst:1269 msgid "Use of Basic HTTP Authentication::" msgstr "" -#: ../../library/urllib.request.rst:1259 +#: ../../library/urllib.request.rst:1271 msgid "" "import urllib.request\n" "# Create an OpenerDirector with support for Basic HTTP Authentication...\n" @@ -1613,7 +1632,7 @@ msgid "" "urllib.request.urlopen('http://www.example.com/login.html')" msgstr "" -#: ../../library/urllib.request.rst:1271 +#: ../../library/urllib.request.rst:1283 msgid "" ":func:`build_opener` provides many handlers by default, including a :class:" "`ProxyHandler`. By default, :class:`ProxyHandler` uses the environment " @@ -1622,14 +1641,14 @@ msgid "" "read to obtain the HTTP proxy's URL." msgstr "" -#: ../../library/urllib.request.rst:1277 +#: ../../library/urllib.request.rst:1289 msgid "" "This example replaces the default :class:`ProxyHandler` with one that uses " "programmatically supplied proxy URLs, and adds proxy authorization support " "with :class:`ProxyBasicAuthHandler`. ::" msgstr "" -#: ../../library/urllib.request.rst:1281 +#: ../../library/urllib.request.rst:1293 msgid "" "proxy_handler = urllib.request.ProxyHandler({'http': 'http://www.example." "com:3128/'})\n" @@ -1649,15 +1668,15 @@ msgstr "" "# 這次我們直接使用它而不安裝 OpenerDirector:\n" "opener.open('http://www.example.com/login.html')" -#: ../../library/urllib.request.rst:1289 +#: ../../library/urllib.request.rst:1301 msgid "Adding HTTP headers:" msgstr "" -#: ../../library/urllib.request.rst:1291 +#: ../../library/urllib.request.rst:1303 msgid "Use the *headers* argument to the :class:`Request` constructor, or::" msgstr "" -#: ../../library/urllib.request.rst:1293 +#: ../../library/urllib.request.rst:1305 msgid "" "import urllib.request\n" "req = urllib.request.Request('http://www.example.com/')\n" @@ -1673,13 +1692,13 @@ msgstr "" "req.add_header('User-Agent', 'urllib-example/0.1 (Contact: . . .)')\n" "r = urllib.request.urlopen(req)" -#: ../../library/urllib.request.rst:1300 +#: ../../library/urllib.request.rst:1312 msgid "" ":class:`OpenerDirector` automatically adds a :mailheader:`User-Agent` header " "to every :class:`Request`. To change this::" msgstr "" -#: ../../library/urllib.request.rst:1303 +#: ../../library/urllib.request.rst:1315 msgid "" "import urllib.request\n" "opener = urllib.request.build_opener()\n" @@ -1691,20 +1710,20 @@ msgstr "" "opener.addheaders = [('User-agent', 'Mozilla/5.0')]\n" "opener.open('http://www.example.com/')" -#: ../../library/urllib.request.rst:1308 +#: ../../library/urllib.request.rst:1320 msgid "" "Also, remember that a few standard headers (:mailheader:`Content-Length`, :" "mailheader:`Content-Type` and :mailheader:`Host`) are added when the :class:" "`Request` is passed to :func:`urlopen` (or :meth:`OpenerDirector.open`)." msgstr "" -#: ../../library/urllib.request.rst:1315 +#: ../../library/urllib.request.rst:1327 msgid "" "Here is an example session that uses the ``GET`` method to retrieve a URL " "containing parameters::" msgstr "" -#: ../../library/urllib.request.rst:1318 +#: ../../library/urllib.request.rst:1330 msgid "" ">>> import urllib.request\n" ">>> import urllib.parse\n" @@ -1722,14 +1741,14 @@ msgstr "" "... print(f.read().decode('utf-8'))\n" "..." -#: ../../library/urllib.request.rst:1326 +#: ../../library/urllib.request.rst:1338 msgid "" "The following example uses the ``POST`` method instead. Note that params " "output from urlencode is encoded to bytes before it is sent to urlopen as " "data::" msgstr "" -#: ../../library/urllib.request.rst:1329 +#: ../../library/urllib.request.rst:1341 msgid "" ">>> import urllib.request\n" ">>> import urllib.parse\n" @@ -1749,13 +1768,13 @@ msgstr "" "... print(f.read().decode('utf-8'))\n" "..." -#: ../../library/urllib.request.rst:1337 +#: ../../library/urllib.request.rst:1349 msgid "" "The following example uses an explicitly specified HTTP proxy, overriding " "environment settings::" msgstr "" -#: ../../library/urllib.request.rst:1340 +#: ../../library/urllib.request.rst:1352 msgid "" ">>> import urllib.request\n" ">>> proxies = {'http': 'http://proxy.example.com:8080/'}\n" @@ -1771,13 +1790,13 @@ msgstr "" "... f.read().decode('utf-8')\n" "..." -#: ../../library/urllib.request.rst:1347 +#: ../../library/urllib.request.rst:1359 msgid "" "The following example uses no proxies at all, overriding environment " "settings::" msgstr "" -#: ../../library/urllib.request.rst:1349 +#: ../../library/urllib.request.rst:1361 msgid "" ">>> import urllib.request\n" ">>> opener = urllib.request.FancyURLopener({})\n" @@ -1791,18 +1810,18 @@ msgstr "" "... f.read().decode('utf-8')\n" "..." -#: ../../library/urllib.request.rst:1357 +#: ../../library/urllib.request.rst:1369 msgid "Legacy interface" msgstr "" -#: ../../library/urllib.request.rst:1359 +#: ../../library/urllib.request.rst:1371 msgid "" "The following functions and classes are ported from the Python 2 module " "``urllib`` (as opposed to ``urllib2``). They might become deprecated at " "some point in the future." msgstr "" -#: ../../library/urllib.request.rst:1365 +#: ../../library/urllib.request.rst:1377 msgid "" "Copy a network object denoted by a URL to a local file. If the URL points to " "a local file, the object will not be copied unless filename is supplied. " @@ -1812,7 +1831,7 @@ msgid "" "a remote object). Exceptions are the same as for :func:`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:1372 +#: ../../library/urllib.request.rst:1384 msgid "" "The second argument, if present, specifies the file location to copy to (if " "absent, the location will be a tempfile with a generated name). The third " @@ -1824,11 +1843,11 @@ msgid "" "file size in response to a retrieval request." msgstr "" -#: ../../library/urllib.request.rst:1381 +#: ../../library/urllib.request.rst:1393 msgid "The following example illustrates the most common usage scenario::" msgstr "" -#: ../../library/urllib.request.rst:1383 +#: ../../library/urllib.request.rst:1395 msgid "" ">>> import urllib.request\n" ">>> local_filename, headers = urllib.request.urlretrieve('http://python." @@ -1842,7 +1861,7 @@ msgstr "" ">>> html = open(local_filename)\n" ">>> html.close()" -#: ../../library/urllib.request.rst:1388 +#: ../../library/urllib.request.rst:1400 msgid "" "If the *url* uses the :file:`http:` scheme identifier, the optional *data* " "argument may be given to specify a ``POST`` request (normally the request " @@ -1851,7 +1870,7 @@ msgid "" "parse.urlencode` function." msgstr "" -#: ../../library/urllib.request.rst:1394 +#: ../../library/urllib.request.rst:1406 msgid "" ":func:`urlretrieve` will raise :exc:`~urllib.error.ContentTooShortError` " "when it detects that the amount of data available was less than the " @@ -1859,40 +1878,40 @@ msgid "" "This can occur, for example, when the download is interrupted." msgstr "" -#: ../../library/urllib.request.rst:1399 +#: ../../library/urllib.request.rst:1411 msgid "" "The *Content-Length* is treated as a lower bound: if there's more data to " "read, urlretrieve reads more data, but if less data is available, it raises " "the exception." msgstr "" -#: ../../library/urllib.request.rst:1403 +#: ../../library/urllib.request.rst:1415 msgid "" "You can still retrieve the downloaded data in this case, it is stored in " "the :attr:`!content` attribute of the exception instance." msgstr "" -#: ../../library/urllib.request.rst:1406 +#: ../../library/urllib.request.rst:1418 msgid "" "If no *Content-Length* header was supplied, urlretrieve can not check the " "size of the data it has downloaded, and just returns it. In this case you " "just have to assume that the download was successful." msgstr "" -#: ../../library/urllib.request.rst:1412 +#: ../../library/urllib.request.rst:1424 msgid "" "Cleans up temporary files that may have been left behind by previous calls " "to :func:`urlretrieve`." msgstr "" -#: ../../library/urllib.request.rst:1419 +#: ../../library/urllib.request.rst:1431 msgid "" "Base class for opening and reading URLs. Unless you need to support opening " "objects using schemes other than :file:`http:`, :file:`ftp:`, or :file:`file:" "`, you probably want to use :class:`FancyURLopener`." msgstr "" -#: ../../library/urllib.request.rst:1423 +#: ../../library/urllib.request.rst:1435 msgid "" "By default, the :class:`URLopener` class sends a :mailheader:`User-Agent` " "header of ``urllib/VVV``, where *VVV* is the :mod:`urllib` version number. " @@ -1902,7 +1921,7 @@ msgid "" "subclass definition." msgstr "" -#: ../../library/urllib.request.rst:1429 +#: ../../library/urllib.request.rst:1441 msgid "" "The optional *proxies* parameter should be a dictionary mapping scheme names " "to proxy URLs, where an empty dictionary turns proxies off completely. Its " @@ -1910,7 +1929,7 @@ msgid "" "be used if present, as discussed in the definition of :func:`urlopen`, above." msgstr "" -#: ../../library/urllib.request.rst:1434 +#: ../../library/urllib.request.rst:1446 msgid "" "Additional keyword parameters, collected in *x509*, may be used for " "authentication of the client when using the :file:`https:` scheme. The " @@ -1918,13 +1937,13 @@ msgid "" "certificate; both are needed to support client authentication." msgstr "" -#: ../../library/urllib.request.rst:1439 +#: ../../library/urllib.request.rst:1451 msgid "" ":class:`URLopener` objects will raise an :exc:`OSError` exception if the " "server returns an error code." msgstr "" -#: ../../library/urllib.request.rst:1444 +#: ../../library/urllib.request.rst:1456 msgid "" "Open *fullurl* using the appropriate protocol. This method sets up cache " "and proxy information, then calls the appropriate open method with its input " @@ -1933,15 +1952,15 @@ msgid "" "`urlopen`." msgstr "" -#: ../../library/urllib.request.rst:1450 +#: ../../library/urllib.request.rst:1462 msgid "This method always quotes *fullurl* using :func:`~urllib.parse.quote`." msgstr "" -#: ../../library/urllib.request.rst:1454 +#: ../../library/urllib.request.rst:1466 msgid "Overridable interface to open unknown URL types." msgstr "" -#: ../../library/urllib.request.rst:1459 +#: ../../library/urllib.request.rst:1471 msgid "" "Retrieves the contents of *url* and places it in *filename*. The return " "value is a tuple consisting of a local filename and either an :class:`email." @@ -1958,7 +1977,7 @@ msgid "" "*reporthook* is ignored for local URLs." msgstr "" -#: ../../library/urllib.request.rst:1472 +#: ../../library/urllib.request.rst:1484 msgid "" "If the *url* uses the :file:`http:` scheme identifier, the optional *data* " "argument may be given to specify a ``POST`` request (normally the request " @@ -1967,7 +1986,7 @@ msgid "" "urlencode` function." msgstr "" -#: ../../library/urllib.request.rst:1481 +#: ../../library/urllib.request.rst:1493 msgid "" "Variable that specifies the user agent of the opener object. To get :mod:" "`urllib` to tell servers that it is a particular user agent, set this in a " @@ -1975,7 +1994,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/urllib.request.rst:1491 +#: ../../library/urllib.request.rst:1503 msgid "" ":class:`FancyURLopener` subclasses :class:`URLopener` providing default " "handling for the following HTTP response codes: 301, 302, 303, 307 and 401. " @@ -1986,14 +2005,14 @@ msgid "" "defaults to 10." msgstr "" -#: ../../library/urllib.request.rst:1498 +#: ../../library/urllib.request.rst:1510 msgid "" "For all other response codes, the method :meth:`~BaseHandler." "http_error_default` is called which you can override in subclasses to handle " "the error appropriately." msgstr "" -#: ../../library/urllib.request.rst:1503 +#: ../../library/urllib.request.rst:1515 msgid "" "According to the letter of :rfc:`2616`, 301 and 302 responses to POST " "requests must not be automatically redirected without confirmation by the " @@ -2002,13 +2021,13 @@ msgid "" "behaviour." msgstr "" -#: ../../library/urllib.request.rst:1508 +#: ../../library/urllib.request.rst:1520 msgid "" "The parameters to the constructor are the same as those for :class:" "`URLopener`." msgstr "" -#: ../../library/urllib.request.rst:1512 +#: ../../library/urllib.request.rst:1524 msgid "" "When performing basic authentication, a :class:`FancyURLopener` instance " "calls its :meth:`prompt_user_passwd` method. The default implementation " @@ -2017,59 +2036,59 @@ msgid "" "needed." msgstr "" -#: ../../library/urllib.request.rst:1517 +#: ../../library/urllib.request.rst:1529 msgid "" "The :class:`FancyURLopener` class offers one additional method that should " "be overloaded to provide the appropriate behavior:" msgstr "" -#: ../../library/urllib.request.rst:1522 +#: ../../library/urllib.request.rst:1534 msgid "" "Return information needed to authenticate the user at the given host in the " "specified security realm. The return value should be a tuple, ``(user, " "password)``, which can be used for basic authentication." msgstr "" -#: ../../library/urllib.request.rst:1526 +#: ../../library/urllib.request.rst:1538 msgid "" "The implementation prompts for this information on the terminal; an " "application should override this method to use an appropriate interaction " "model in the local environment." msgstr "" -#: ../../library/urllib.request.rst:1532 +#: ../../library/urllib.request.rst:1544 msgid ":mod:`urllib.request` Restrictions" msgstr "" -#: ../../library/urllib.request.rst:1538 +#: ../../library/urllib.request.rst:1550 msgid "" "Currently, only the following protocols are supported: HTTP (versions 0.9 " "and 1.0), FTP, local files, and data URLs." msgstr "" -#: ../../library/urllib.request.rst:1541 +#: ../../library/urllib.request.rst:1553 msgid "Added support for data URLs." msgstr "" -#: ../../library/urllib.request.rst:1543 +#: ../../library/urllib.request.rst:1555 msgid "" "The caching feature of :func:`urlretrieve` has been disabled until someone " "finds the time to hack proper processing of Expiration time headers." msgstr "" -#: ../../library/urllib.request.rst:1546 +#: ../../library/urllib.request.rst:1558 msgid "" "There should be a function to query whether a particular URL is in the cache." msgstr "" -#: ../../library/urllib.request.rst:1548 +#: ../../library/urllib.request.rst:1560 msgid "" "For backward compatibility, if a URL appears to point to a local file but " "the file can't be opened, the URL is re-interpreted using the FTP protocol. " "This can sometimes cause confusing error messages." msgstr "" -#: ../../library/urllib.request.rst:1552 +#: ../../library/urllib.request.rst:1564 msgid "" "The :func:`urlopen` and :func:`urlretrieve` functions can cause arbitrarily " "long delays while waiting for a network connection to be set up. This means " @@ -2077,7 +2096,7 @@ msgid "" "functions without using threads." msgstr "" -#: ../../library/urllib.request.rst:1561 +#: ../../library/urllib.request.rst:1573 msgid "" "The data returned by :func:`urlopen` or :func:`urlretrieve` is the raw data " "returned by the server. This may be binary data (such as an image), plain " @@ -2087,7 +2106,7 @@ msgid "" "module :mod:`html.parser` to parse it." msgstr "" -#: ../../library/urllib.request.rst:1570 +#: ../../library/urllib.request.rst:1582 msgid "" "The code handling the FTP protocol cannot differentiate between a file and a " "directory. This can lead to unexpected behavior when attempting to read a " @@ -2105,11 +2124,11 @@ msgid "" "meet your needs." msgstr "" -#: ../../library/urllib.request.rst:1587 +#: ../../library/urllib.request.rst:1599 msgid ":mod:`urllib.response` --- Response classes used by urllib" msgstr "" -#: ../../library/urllib.request.rst:1592 +#: ../../library/urllib.request.rst:1604 msgid "" "The :mod:`urllib.response` module defines functions and classes which define " "a minimal file-like interface, including ``read()`` and ``readline()``. " @@ -2118,46 +2137,46 @@ msgid "" "addinfourl` instance:" msgstr "" -#: ../../library/urllib.request.rst:1601 +#: ../../library/urllib.request.rst:1613 msgid "" "URL of the resource retrieved, commonly used to determine if a redirect was " "followed." msgstr "" -#: ../../library/urllib.request.rst:1605 +#: ../../library/urllib.request.rst:1617 msgid "" "Returns the headers of the response in the form of an :class:`~email.message." "EmailMessage` instance." msgstr "" -#: ../../library/urllib.request.rst:1611 +#: ../../library/urllib.request.rst:1623 msgid "Status code returned by server." msgstr "" -#: ../../library/urllib.request.rst:1615 +#: ../../library/urllib.request.rst:1627 msgid "Deprecated in favor of :attr:`~addinfourl.url`." msgstr "" -#: ../../library/urllib.request.rst:1620 +#: ../../library/urllib.request.rst:1632 msgid "Deprecated in favor of :attr:`~addinfourl.headers`." msgstr "" -#: ../../library/urllib.request.rst:1625 ../../library/urllib.request.rst:1630 +#: ../../library/urllib.request.rst:1637 ../../library/urllib.request.rst:1642 msgid "Deprecated in favor of :attr:`~addinfourl.status`." msgstr "" -#: ../../library/urllib.request.rst:1534 ../../library/urllib.request.rst:1557 +#: ../../library/urllib.request.rst:1546 ../../library/urllib.request.rst:1569 msgid "HTTP" msgstr "HTTP" -#: ../../library/urllib.request.rst:1534 ../../library/urllib.request.rst:1557 +#: ../../library/urllib.request.rst:1546 ../../library/urllib.request.rst:1569 msgid "protocol" msgstr "protocol(協定)" -#: ../../library/urllib.request.rst:1534 ../../library/urllib.request.rst:1568 +#: ../../library/urllib.request.rst:1546 ../../library/urllib.request.rst:1580 msgid "FTP" msgstr "FTP" -#: ../../library/urllib.request.rst:1557 +#: ../../library/urllib.request.rst:1569 msgid "HTML" msgstr "HTML" diff --git a/library/uu.po b/library/uu.po new file mode 100644 index 0000000000..574b21d479 --- /dev/null +++ b/library/uu.po @@ -0,0 +1,39 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 00:15+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/uu.rst:2 +msgid ":mod:`!uu` --- Encode and decode uuencode files" +msgstr ":mod:`!uu` --- uuencode 檔案的編碼與解碼" + +#: ../../library/uu.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 <whatsnew313-pep594>` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 <whatsnew313-pep594>`。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/uu.rst:14 +msgid "" +"The last version of Python that provided the :mod:`!uu` module was `Python " +"3.12 <https://docs.python.org/3.12/library/uu.html>`_." +msgstr "" +"最後提供 :mod:`!uu` 模組的 Python 版本是 `Python 3.12 <https://docs.python." +"org/3.12/library/uu.html>`_。" diff --git a/library/xdrlib.po b/library/xdrlib.po new file mode 100644 index 0000000000..383e29047e --- /dev/null +++ b/library/xdrlib.po @@ -0,0 +1,40 @@ +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-18 00:15+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/xdrlib.rst:2 +msgid ":mod:`!xdrlib` --- Encode and decode XDR data" +msgstr ":mod:`!xdrlib` --- XDR 資料的編碼與解碼" + +#: ../../library/xdrlib.rst:10 +msgid "" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 <whatsnew313-pep594>` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." +msgstr "" +"這個模組已不再是 Python 標準函式庫的一部分。它在 Python 3.11 中被棄用,並\\ :" +"ref:`已在 Python 3.13 中被移除 <whatsnew313-pep594>`。它的移除是在 :pep:" +"`594` 中決定的。" + +#: ../../library/xdrlib.rst:14 +msgid "" +"The last version of Python that provided the :mod:`!xdrlib` module was " +"`Python 3.12 <https://docs.python.org/3.12/library/xdrlib.html>`_." +msgstr "" +"最後提供 :mod:`!xdrlib` 模組的 Python 版本是 `Python 3.12 <https://docs." +"python.org/3.12/library/xdrlib.html>`_。" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index db077dfd9a..6c12ef1f85 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-11-12 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -90,7 +90,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:84 msgid "The :keyword:`!if` statement" -msgstr "" +msgstr ":keyword:`!if` 陳述式" #: ../../reference/compound_stmts.rst:92 msgid "The :keyword:`if` statement is used for conditional execution:" @@ -108,7 +108,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:109 msgid "The :keyword:`!while` statement" -msgstr "" +msgstr ":keyword:`!while` 陳述式" #: ../../reference/compound_stmts.rst:117 msgid "" @@ -134,7 +134,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:142 msgid "The :keyword:`!for` statement" -msgstr "" +msgstr ":keyword:`!for` 陳述式" #: ../../reference/compound_stmts.rst:153 msgid "" @@ -193,7 +193,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:205 msgid "The :keyword:`!try` statement" -msgstr "" +msgstr ":keyword:`!try` 陳述式" #: ../../reference/compound_stmts.rst:215 msgid "" @@ -210,7 +210,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:239 msgid ":keyword:`!except` clause" -msgstr "" +msgstr ":keyword:`!except` 子句" #: ../../reference/compound_stmts.rst:241 msgid "" @@ -433,7 +433,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:399 msgid ":keyword:`!else` clause" -msgstr "" +msgstr ":keyword:`!else` 子句" #: ../../reference/compound_stmts.rst:401 msgid "" @@ -446,7 +446,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:413 msgid ":keyword:`!finally` clause" -msgstr "" +msgstr ":keyword:`!finally` 子句" #: ../../reference/compound_stmts.rst:415 msgid "" @@ -532,7 +532,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:469 msgid "The :keyword:`!with` statement" -msgstr "" +msgstr ":keyword:`!with` 陳述式" #: ../../reference/compound_stmts.rst:478 msgid "" @@ -610,10 +610,10 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:526 -#: ../../reference/compound_stmts.rst:1547 -#: ../../reference/compound_stmts.rst:1588 +#: ../../reference/compound_stmts.rst:1544 +#: ../../reference/compound_stmts.rst:1585 msgid "The following code::" -msgstr "" +msgstr "以下程式碼: ::" #: ../../reference/compound_stmts.rst:528 msgid "" @@ -624,10 +624,10 @@ msgstr "" " SUITE" #: ../../reference/compound_stmts.rst:531 -#: ../../reference/compound_stmts.rst:556 -#: ../../reference/compound_stmts.rst:1593 +#: ../../reference/compound_stmts.rst:553 +#: ../../reference/compound_stmts.rst:1590 msgid "is semantically equivalent to::" -msgstr "" +msgstr "在語義上等同於: ::" #: ../../reference/compound_stmts.rst:533 msgid "" @@ -635,43 +635,37 @@ msgid "" "enter = type(manager).__enter__\n" "exit = type(manager).__exit__\n" "value = enter(manager)\n" -"hit_except = False\n" "\n" "try:\n" " TARGET = value\n" " SUITE\n" "except:\n" -" hit_except = True\n" " if not exit(manager, *sys.exc_info()):\n" " raise\n" -"finally:\n" -" if not hit_except:\n" -" exit(manager, None, None, None)" +"else:\n" +" exit(manager, None, None, None)" msgstr "" "manager = (EXPRESSION)\n" "enter = type(manager).__enter__\n" "exit = type(manager).__exit__\n" "value = enter(manager)\n" -"hit_except = False\n" "\n" "try:\n" " TARGET = value\n" " SUITE\n" "except:\n" -" hit_except = True\n" " if not exit(manager, *sys.exc_info()):\n" " raise\n" -"finally:\n" -" if not hit_except:\n" -" exit(manager, None, None, None)" +"else:\n" +" exit(manager, None, None, None)" -#: ../../reference/compound_stmts.rst:550 +#: ../../reference/compound_stmts.rst:547 msgid "" "With more than one item, the context managers are processed as if multiple :" "keyword:`with` statements were nested::" msgstr "" -#: ../../reference/compound_stmts.rst:553 +#: ../../reference/compound_stmts.rst:550 msgid "" "with A() as a, B() as b:\n" " SUITE" @@ -679,7 +673,7 @@ msgstr "" "with A() as a, B() as b:\n" " SUITE" -#: ../../reference/compound_stmts.rst:558 +#: ../../reference/compound_stmts.rst:555 msgid "" "with A() as a:\n" " with B() as b:\n" @@ -689,13 +683,13 @@ msgstr "" " with B() as b:\n" " SUITE" -#: ../../reference/compound_stmts.rst:562 +#: ../../reference/compound_stmts.rst:559 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:565 +#: ../../reference/compound_stmts.rst:562 msgid "" "with (\n" " A() as a,\n" @@ -709,88 +703,88 @@ msgstr "" "):\n" " SUITE" -#: ../../reference/compound_stmts.rst:571 +#: ../../reference/compound_stmts.rst:568 msgid "Support for multiple context expressions." msgstr "" -#: ../../reference/compound_stmts.rst:574 +#: ../../reference/compound_stmts.rst:571 msgid "" "Support for using grouping parentheses to break the statement in multiple " "lines." msgstr "" -#: ../../reference/compound_stmts.rst:579 +#: ../../reference/compound_stmts.rst:576 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/compound_stmts.rst:580 +#: ../../reference/compound_stmts.rst:577 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/compound_stmts.rst:586 +#: ../../reference/compound_stmts.rst:583 msgid "The :keyword:`!match` statement" -msgstr "" +msgstr ":keyword:`!match` 陳述式" -#: ../../reference/compound_stmts.rst:600 +#: ../../reference/compound_stmts.rst:597 msgid "The match statement is used for pattern matching. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:609 +#: ../../reference/compound_stmts.rst:606 msgid "" "This section uses single quotes to denote :ref:`soft keywords <soft-" "keywords>`." msgstr "" -#: ../../reference/compound_stmts.rst:612 +#: ../../reference/compound_stmts.rst:609 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:616 +#: ../../reference/compound_stmts.rst:613 msgid "A match success or failure (also termed a pattern success or failure)." msgstr "" -#: ../../reference/compound_stmts.rst:618 +#: ../../reference/compound_stmts.rst:615 msgid "" "Possible binding of matched values to a name. The prerequisites for this " "are further discussed below." msgstr "" -#: ../../reference/compound_stmts.rst:621 +#: ../../reference/compound_stmts.rst:618 msgid "" "The ``match`` and ``case`` keywords are :ref:`soft keywords <soft-keywords>`." msgstr "" -#: ../../reference/compound_stmts.rst:625 -#: ../../reference/compound_stmts.rst:1182 +#: ../../reference/compound_stmts.rst:622 +#: ../../reference/compound_stmts.rst:1179 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../reference/compound_stmts.rst:626 -#: ../../reference/compound_stmts.rst:1183 +#: ../../reference/compound_stmts.rst:623 +#: ../../reference/compound_stmts.rst:1180 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" msgstr "" -#: ../../reference/compound_stmts.rst:630 +#: ../../reference/compound_stmts.rst:627 msgid "Overview" msgstr "" -#: ../../reference/compound_stmts.rst:632 +#: ../../reference/compound_stmts.rst:629 msgid "Here's an overview of the logical flow of a match statement:" msgstr "" -#: ../../reference/compound_stmts.rst:635 +#: ../../reference/compound_stmts.rst:632 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 <typesseq-tuple>`." msgstr "" -#: ../../reference/compound_stmts.rst:639 +#: ../../reference/compound_stmts.rst:636 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 " @@ -800,7 +794,7 @@ msgid "" "outlive the executed block and can be used after the match statement**." msgstr "" -#: ../../reference/compound_stmts.rst:648 +#: ../../reference/compound_stmts.rst:645 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 " @@ -809,38 +803,38 @@ msgid "" "made to allow different implementations to add optimizations." msgstr "" -#: ../../reference/compound_stmts.rst:655 +#: ../../reference/compound_stmts.rst:652 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:658 +#: ../../reference/compound_stmts.rst:655 msgid "" "If the guard evaluates as true or is missing, the ``block`` inside " "``case_block`` is executed." msgstr "" -#: ../../reference/compound_stmts.rst:661 +#: ../../reference/compound_stmts.rst:658 msgid "Otherwise, the next ``case_block`` is attempted as described above." msgstr "" -#: ../../reference/compound_stmts.rst:663 +#: ../../reference/compound_stmts.rst:660 msgid "If there are no further case blocks, the match statement is completed." msgstr "" -#: ../../reference/compound_stmts.rst:667 +#: ../../reference/compound_stmts.rst:664 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:671 +#: ../../reference/compound_stmts.rst:668 msgid "A sample match statement::" msgstr "" -#: ../../reference/compound_stmts.rst:673 +#: ../../reference/compound_stmts.rst:670 msgid "" ">>> flag = False\n" ">>> match (100, 200):\n" @@ -856,56 +850,56 @@ msgid "" "Case 3, y: 200" msgstr "" -#: ../../reference/compound_stmts.rst:687 +#: ../../reference/compound_stmts.rst:684 msgid "" "In this case, ``if flag`` is a guard. Read more about that in the next " "section." msgstr "" -#: ../../reference/compound_stmts.rst:690 +#: ../../reference/compound_stmts.rst:687 msgid "Guards" msgstr "" -#: ../../reference/compound_stmts.rst:697 +#: ../../reference/compound_stmts.rst:694 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:702 +#: ../../reference/compound_stmts.rst:699 msgid "The logical flow of a ``case`` block with a ``guard`` follows:" msgstr "" -#: ../../reference/compound_stmts.rst:704 +#: ../../reference/compound_stmts.rst:701 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:708 +#: ../../reference/compound_stmts.rst:705 msgid "If the pattern succeeded, evaluate the ``guard``." msgstr "" -#: ../../reference/compound_stmts.rst:710 +#: ../../reference/compound_stmts.rst:707 msgid "" "If the ``guard`` condition evaluates as true, the case block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:713 +#: ../../reference/compound_stmts.rst:710 msgid "" "If the ``guard`` condition evaluates as false, the case block is not " "selected." msgstr "" -#: ../../reference/compound_stmts.rst:716 +#: ../../reference/compound_stmts.rst:713 msgid "" "If the ``guard`` raises an exception during evaluation, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:719 +#: ../../reference/compound_stmts.rst:716 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 " @@ -914,17 +908,17 @@ msgid "" "block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:729 +#: ../../reference/compound_stmts.rst:726 msgid "Irrefutable Case Blocks" msgstr "" -#: ../../reference/compound_stmts.rst:733 +#: ../../reference/compound_stmts.rst:730 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:736 +#: ../../reference/compound_stmts.rst:733 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 " @@ -932,47 +926,47 @@ msgid "" "irrefutable:" msgstr "" -#: ../../reference/compound_stmts.rst:741 +#: ../../reference/compound_stmts.rst:738 msgid ":ref:`as-patterns` whose left-hand side is irrefutable" msgstr "" -#: ../../reference/compound_stmts.rst:743 +#: ../../reference/compound_stmts.rst:740 msgid ":ref:`or-patterns` containing at least one irrefutable pattern" msgstr "" -#: ../../reference/compound_stmts.rst:745 +#: ../../reference/compound_stmts.rst:742 msgid ":ref:`capture-patterns`" msgstr ":ref:`capture-patterns`" -#: ../../reference/compound_stmts.rst:747 +#: ../../reference/compound_stmts.rst:744 msgid ":ref:`wildcard-patterns`" msgstr ":ref:`wildcard-patterns`" -#: ../../reference/compound_stmts.rst:749 +#: ../../reference/compound_stmts.rst:746 msgid "parenthesized irrefutable patterns" msgstr "" -#: ../../reference/compound_stmts.rst:753 +#: ../../reference/compound_stmts.rst:750 msgid "Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:760 +#: ../../reference/compound_stmts.rst:757 msgid "This section uses grammar notations beyond standard EBNF:" msgstr "" -#: ../../reference/compound_stmts.rst:762 +#: ../../reference/compound_stmts.rst:759 msgid "the notation ``SEP.RULE+`` is shorthand for ``RULE (SEP RULE)*``" msgstr "" -#: ../../reference/compound_stmts.rst:764 +#: ../../reference/compound_stmts.rst:761 msgid "the notation ``!RULE`` is shorthand for a negative lookahead assertion" msgstr "" -#: ../../reference/compound_stmts.rst:767 +#: ../../reference/compound_stmts.rst:764 msgid "The top-level syntax for ``patterns`` is:" msgstr "" -#: ../../reference/compound_stmts.rst:781 +#: ../../reference/compound_stmts.rst:778 msgid "" "The descriptions below will include a description \"in simple terms\" of " "what a pattern does for illustration purposes (credits to Raymond Hettinger " @@ -982,70 +976,70 @@ msgid "" "forms." msgstr "" -#: ../../reference/compound_stmts.rst:791 +#: ../../reference/compound_stmts.rst:788 msgid "OR Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:793 +#: ../../reference/compound_stmts.rst:790 msgid "" "An OR pattern is two or more patterns separated by vertical bars ``|``. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:799 +#: ../../reference/compound_stmts.rst:796 msgid "" "Only the final subpattern may be :ref:`irrefutable <irrefutable_case>`, and " "each subpattern must bind the same set of names to avoid ambiguity." msgstr "" -#: ../../reference/compound_stmts.rst:802 +#: ../../reference/compound_stmts.rst:799 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:806 +#: ../../reference/compound_stmts.rst:803 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:812 +#: ../../reference/compound_stmts.rst:809 msgid "AS Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:814 +#: ../../reference/compound_stmts.rst:811 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:820 +#: ../../reference/compound_stmts.rst:817 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:824 +#: ../../reference/compound_stmts.rst:821 msgid "" "In simple terms ``P as NAME`` will match with ``P``, and on success it will " "set ``NAME = <subject>``." msgstr "" -#: ../../reference/compound_stmts.rst:831 +#: ../../reference/compound_stmts.rst:828 msgid "Literal Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:833 +#: ../../reference/compound_stmts.rst:830 msgid "" "A literal pattern corresponds to most :ref:`literals <literals>` in Python. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:846 +#: ../../reference/compound_stmts.rst:843 msgid "" "The rule ``strings`` and the token ``NUMBER`` are defined in the :doc:" "`standard Python grammar <./grammar>`. Triple-quoted strings are " @@ -1053,42 +1047,42 @@ msgid "" "are not supported." msgstr "" -#: ../../reference/compound_stmts.rst:851 +#: ../../reference/compound_stmts.rst:848 msgid "" "The forms ``signed_number '+' NUMBER`` and ``signed_number '-' NUMBER`` are " "for expressing :ref:`complex numbers <imaginary>`; they require a real " "number on the left and an imaginary number on the right. E.g. ``3 + 4j``." msgstr "" -#: ../../reference/compound_stmts.rst:855 +#: ../../reference/compound_stmts.rst:852 msgid "" "In simple terms, ``LITERAL`` will succeed only if ``<subject> == LITERAL``. " "For the singletons ``None``, ``True`` and ``False``, the :keyword:`is` " "operator is used." msgstr "" -#: ../../reference/compound_stmts.rst:861 +#: ../../reference/compound_stmts.rst:858 msgid "Capture Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:863 +#: ../../reference/compound_stmts.rst:860 msgid "A capture pattern binds the subject value to a name. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:869 +#: ../../reference/compound_stmts.rst:866 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:873 +#: ../../reference/compound_stmts.rst:870 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:876 +#: ../../reference/compound_stmts.rst:873 msgid "" "Capture patterns always succeed. The binding follows scoping rules " "established by the assignment expression operator in :pep:`572`; the name " @@ -1096,55 +1090,55 @@ msgid "" "there's an applicable :keyword:`global` or :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/compound_stmts.rst:881 +#: ../../reference/compound_stmts.rst:878 msgid "" "In simple terms ``NAME`` will always succeed and it will set ``NAME = " "<subject>``." msgstr "" -#: ../../reference/compound_stmts.rst:886 +#: ../../reference/compound_stmts.rst:883 msgid "Wildcard Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:888 +#: ../../reference/compound_stmts.rst:885 msgid "" "A wildcard pattern always succeeds (matches anything) and binds no name. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:894 +#: ../../reference/compound_stmts.rst:891 msgid "" "``_`` is a :ref:`soft keyword <soft-keywords>` 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:898 +#: ../../reference/compound_stmts.rst:895 msgid "In simple terms, ``_`` will always succeed." msgstr "" -#: ../../reference/compound_stmts.rst:903 +#: ../../reference/compound_stmts.rst:900 msgid "Value Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:905 +#: ../../reference/compound_stmts.rst:902 msgid "A value pattern represents a named value in Python. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:913 +#: ../../reference/compound_stmts.rst:910 msgid "" "The dotted name in the pattern is looked up using standard Python :ref:`name " "resolution rules <resolve_names>`. The pattern succeeds if the value found " "compares equal to the subject value (using the ``==`` equality operator)." msgstr "" -#: ../../reference/compound_stmts.rst:918 +#: ../../reference/compound_stmts.rst:915 msgid "" "In simple terms ``NAME1.NAME2`` will succeed only if ``<subject> == NAME1." "NAME2``" msgstr "" -#: ../../reference/compound_stmts.rst:922 +#: ../../reference/compound_stmts.rst:919 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 " @@ -1152,44 +1146,44 @@ msgid "" "given match statement." msgstr "" -#: ../../reference/compound_stmts.rst:930 +#: ../../reference/compound_stmts.rst:927 msgid "Group Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:932 +#: ../../reference/compound_stmts.rst:929 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:939 +#: ../../reference/compound_stmts.rst:936 msgid "In simple terms ``(P)`` has the same effect as ``P``." msgstr "" -#: ../../reference/compound_stmts.rst:944 +#: ../../reference/compound_stmts.rst:941 msgid "Sequence Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:946 +#: ../../reference/compound_stmts.rst:943 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:957 +#: ../../reference/compound_stmts.rst:954 msgid "" "There is no difference if parentheses or square brackets are used for " "sequence patterns (i.e. ``(...)`` vs ``[...]`` )." msgstr "" -#: ../../reference/compound_stmts.rst:961 +#: ../../reference/compound_stmts.rst:958 msgid "" "A single pattern enclosed in parentheses without a trailing comma (e.g. ``(3 " "| 4)``) is a :ref:`group pattern <group-patterns>`. While a single pattern " "enclosed in square brackets (e.g. ``[3 | 4]``) is still a sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:966 +#: ../../reference/compound_stmts.rst:963 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 " @@ -1197,40 +1191,40 @@ msgid "" "variable-length sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:971 +#: ../../reference/compound_stmts.rst:968 msgid "" "The following is the logical flow for matching a sequence pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:974 +#: ../../reference/compound_stmts.rst:971 msgid "" "If the subject value is not a sequence [#]_, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:977 +#: ../../reference/compound_stmts.rst:974 msgid "" "If the subject value is an instance of ``str``, ``bytes`` or ``bytearray`` " "the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:980 +#: ../../reference/compound_stmts.rst:977 msgid "" "The subsequent steps depend on whether the sequence pattern is fixed or " "variable-length." msgstr "" -#: ../../reference/compound_stmts.rst:983 +#: ../../reference/compound_stmts.rst:980 msgid "If the sequence pattern is fixed-length:" msgstr "" -#: ../../reference/compound_stmts.rst:985 +#: ../../reference/compound_stmts.rst:982 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:988 +#: ../../reference/compound_stmts.rst:985 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 " @@ -1238,118 +1232,118 @@ msgid "" "corresponding item, the sequence pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:993 +#: ../../reference/compound_stmts.rst:990 msgid "Otherwise, if the sequence pattern is variable-length:" msgstr "" -#: ../../reference/compound_stmts.rst:995 +#: ../../reference/compound_stmts.rst:992 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:998 +#: ../../reference/compound_stmts.rst:995 msgid "" "The leading non-star subpatterns are matched to their corresponding items as " "for fixed-length sequences." msgstr "" -#: ../../reference/compound_stmts.rst:1001 +#: ../../reference/compound_stmts.rst:998 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:1005 +#: ../../reference/compound_stmts.rst:1002 msgid "" "Remaining non-star subpatterns are matched to their corresponding subject " "items, as for a fixed-length sequence." msgstr "" -#: ../../reference/compound_stmts.rst:1008 +#: ../../reference/compound_stmts.rst:1005 msgid "" "The length of the subject sequence is obtained via :func:`len` (i.e. via " "the :meth:`__len__` protocol). This length may be cached by the interpreter " "in a similar manner as :ref:`value patterns <value-patterns>`." msgstr "" -#: ../../reference/compound_stmts.rst:1014 +#: ../../reference/compound_stmts.rst:1011 msgid "" "In simple terms ``[P1, P2, P3,`` ... ``, P<N>]`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1017 +#: ../../reference/compound_stmts.rst:1014 msgid "check ``<subject>`` is a sequence" msgstr "" -#: ../../reference/compound_stmts.rst:1018 +#: ../../reference/compound_stmts.rst:1015 msgid "``len(subject) == <N>``" msgstr "``len(subject) == <N>``" -#: ../../reference/compound_stmts.rst:1019 +#: ../../reference/compound_stmts.rst:1016 msgid "" "``P1`` matches ``<subject>[0]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1020 +#: ../../reference/compound_stmts.rst:1017 msgid "" "``P2`` matches ``<subject>[1]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1021 +#: ../../reference/compound_stmts.rst:1018 msgid "... and so on for the corresponding pattern/element." msgstr "" -#: ../../reference/compound_stmts.rst:1026 +#: ../../reference/compound_stmts.rst:1023 msgid "Mapping Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1028 +#: ../../reference/compound_stmts.rst:1025 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:1039 +#: ../../reference/compound_stmts.rst:1036 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:1042 +#: ../../reference/compound_stmts.rst:1039 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:1046 +#: ../../reference/compound_stmts.rst:1043 msgid "" "The following is the logical flow for matching a mapping pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1049 +#: ../../reference/compound_stmts.rst:1046 msgid "If the subject value is not a mapping [#]_,the mapping pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1051 +#: ../../reference/compound_stmts.rst:1048 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:1055 +#: ../../reference/compound_stmts.rst:1052 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:1059 +#: ../../reference/compound_stmts.rst:1056 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 " @@ -1357,256 +1351,256 @@ msgid "" "`~object.__getitem__`." msgstr "" -#: ../../reference/compound_stmts.rst:1064 +#: ../../reference/compound_stmts.rst:1061 msgid "" "In simple terms ``{KEY1: P1, KEY2: P2, ... }`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1067 +#: ../../reference/compound_stmts.rst:1064 msgid "check ``<subject>`` is a mapping" msgstr "" -#: ../../reference/compound_stmts.rst:1068 +#: ../../reference/compound_stmts.rst:1065 msgid "``KEY1 in <subject>``" msgstr "``KEY1 in <subject>``" -#: ../../reference/compound_stmts.rst:1069 +#: ../../reference/compound_stmts.rst:1066 msgid "``P1`` matches ``<subject>[KEY1]``" msgstr "" -#: ../../reference/compound_stmts.rst:1070 +#: ../../reference/compound_stmts.rst:1067 msgid "... and so on for the corresponding KEY/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1076 +#: ../../reference/compound_stmts.rst:1073 msgid "Class Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1078 +#: ../../reference/compound_stmts.rst:1075 msgid "" "A class pattern represents a class and its positional and keyword arguments " "(if any). Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1089 +#: ../../reference/compound_stmts.rst:1086 msgid "The same keyword should not be repeated in class patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1091 +#: ../../reference/compound_stmts.rst:1088 msgid "" "The following is the logical flow for matching a class pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1094 +#: ../../reference/compound_stmts.rst:1091 msgid "" "If ``name_or_attr`` is not an instance of the builtin :class:`type` , raise :" "exc:`TypeError`." msgstr "" -#: ../../reference/compound_stmts.rst:1097 +#: ../../reference/compound_stmts.rst:1094 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:1100 +#: ../../reference/compound_stmts.rst:1097 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:1104 +#: ../../reference/compound_stmts.rst:1101 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:1108 +#: ../../reference/compound_stmts.rst:1105 msgid "" "If only keyword patterns are present, they are processed as follows, one by " "one:" msgstr "" -#: ../../reference/compound_stmts.rst:1111 +#: ../../reference/compound_stmts.rst:1108 msgid "I. The keyword is looked up as an attribute on the subject." msgstr "" -#: ../../reference/compound_stmts.rst:1113 +#: ../../reference/compound_stmts.rst:1110 msgid "" "If this raises an exception other than :exc:`AttributeError`, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1116 +#: ../../reference/compound_stmts.rst:1113 msgid "If this raises :exc:`AttributeError`, the class pattern has failed." msgstr "" -#: ../../reference/compound_stmts.rst:1118 +#: ../../reference/compound_stmts.rst:1115 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:1123 +#: ../../reference/compound_stmts.rst:1120 msgid "II. If all keyword patterns succeed, the class pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1125 +#: ../../reference/compound_stmts.rst:1122 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:1129 +#: ../../reference/compound_stmts.rst:1126 msgid "" "I. The equivalent of ``getattr(cls, \"__match_args__\", ())`` is called." msgstr "" -#: ../../reference/compound_stmts.rst:1131 +#: ../../reference/compound_stmts.rst:1128 msgid "If this raises an exception, the exception bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1133 +#: ../../reference/compound_stmts.rst:1130 msgid "" "If the returned value is not a tuple, the conversion fails and :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1136 +#: ../../reference/compound_stmts.rst:1133 msgid "" "If there are more positional patterns than ``len(cls.__match_args__)``, :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1139 +#: ../../reference/compound_stmts.rst:1136 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:1143 +#: ../../reference/compound_stmts.rst:1140 msgid "If there are duplicate keywords, :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1145 +#: ../../reference/compound_stmts.rst:1142 msgid ":ref:`class-pattern-matching`" msgstr ":ref:`class-pattern-matching`" -#: ../../reference/compound_stmts.rst:1147 +#: ../../reference/compound_stmts.rst:1144 msgid "" "II. Once all positional patterns have been converted to keyword patterns," msgstr "" -#: ../../reference/compound_stmts.rst:1148 +#: ../../reference/compound_stmts.rst:1145 msgid "the match proceeds as if there were only keyword patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1150 +#: ../../reference/compound_stmts.rst:1147 msgid "" "For the following built-in types the handling of positional subpatterns is " "different:" msgstr "" -#: ../../reference/compound_stmts.rst:1153 +#: ../../reference/compound_stmts.rst:1150 msgid ":class:`bool`" msgstr ":class:`bool`" -#: ../../reference/compound_stmts.rst:1154 +#: ../../reference/compound_stmts.rst:1151 msgid ":class:`bytearray`" msgstr ":class:`bytearray`" -#: ../../reference/compound_stmts.rst:1155 +#: ../../reference/compound_stmts.rst:1152 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../reference/compound_stmts.rst:1156 +#: ../../reference/compound_stmts.rst:1153 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../reference/compound_stmts.rst:1157 +#: ../../reference/compound_stmts.rst:1154 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../reference/compound_stmts.rst:1158 +#: ../../reference/compound_stmts.rst:1155 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../reference/compound_stmts.rst:1159 +#: ../../reference/compound_stmts.rst:1156 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../reference/compound_stmts.rst:1160 -#: ../../reference/compound_stmts.rst:1878 +#: ../../reference/compound_stmts.rst:1157 +#: ../../reference/compound_stmts.rst:1875 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../reference/compound_stmts.rst:1161 +#: ../../reference/compound_stmts.rst:1158 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../reference/compound_stmts.rst:1162 +#: ../../reference/compound_stmts.rst:1159 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../reference/compound_stmts.rst:1163 -#: ../../reference/compound_stmts.rst:1881 +#: ../../reference/compound_stmts.rst:1160 +#: ../../reference/compound_stmts.rst:1878 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../reference/compound_stmts.rst:1165 +#: ../../reference/compound_stmts.rst:1162 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:1169 +#: ../../reference/compound_stmts.rst:1166 msgid "" "In simple terms ``CLS(P1, attr=P2)`` matches only if the following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1171 +#: ../../reference/compound_stmts.rst:1168 msgid "``isinstance(<subject>, CLS)``" msgstr "``isinstance(<subject>, CLS)``" -#: ../../reference/compound_stmts.rst:1172 +#: ../../reference/compound_stmts.rst:1169 msgid "convert ``P1`` to a keyword pattern using ``CLS.__match_args__``" msgstr "" -#: ../../reference/compound_stmts.rst:1173 +#: ../../reference/compound_stmts.rst:1170 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1172 msgid "``hasattr(<subject>, \"attr\")``" msgstr "``hasattr(<subject>, \"attr\")``" -#: ../../reference/compound_stmts.rst:1176 +#: ../../reference/compound_stmts.rst:1173 msgid "``P2`` matches ``<subject>.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1178 +#: ../../reference/compound_stmts.rst:1175 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1193 +#: ../../reference/compound_stmts.rst:1190 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1208 +#: ../../reference/compound_stmts.rst:1205 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1228 +#: ../../reference/compound_stmts.rst:1225 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 " @@ -1615,13 +1609,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1234 +#: ../../reference/compound_stmts.rst:1231 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1240 +#: ../../reference/compound_stmts.rst:1237 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1632,7 +1626,7 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1247 +#: ../../reference/compound_stmts.rst:1244 msgid "" "@f1(arg)\n" "@f2\n" @@ -1642,12 +1636,12 @@ msgstr "" "@f2\n" "def func(): pass" -#: ../../reference/compound_stmts.rst:1251 -#: ../../reference/compound_stmts.rst:1446 +#: ../../reference/compound_stmts.rst:1248 +#: ../../reference/compound_stmts.rst:1443 msgid "is roughly equivalent to ::" msgstr "大致等價於: ::" -#: ../../reference/compound_stmts.rst:1253 +#: ../../reference/compound_stmts.rst:1250 msgid "" "def func(): pass\n" "func = f1(arg)(f2(func))" @@ -1655,20 +1649,20 @@ msgstr "" "def func(): pass\n" "func = f1(arg)(f2(func))" -#: ../../reference/compound_stmts.rst:1256 +#: ../../reference/compound_stmts.rst:1253 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1258 +#: ../../reference/compound_stmts.rst:1255 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:1263 +#: ../../reference/compound_stmts.rst:1260 msgid "" "A list of :ref:`type parameters <type-params>` may be given in square " "brackets between the function's name and the opening parenthesis for its " @@ -1678,12 +1672,12 @@ msgid "" "functions` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1270 -#: ../../reference/compound_stmts.rst:1465 +#: ../../reference/compound_stmts.rst:1267 +#: ../../reference/compound_stmts.rst:1462 msgid "Type parameter lists are new in Python 3.12." msgstr "" -#: ../../reference/compound_stmts.rst:1278 +#: ../../reference/compound_stmts.rst:1275 msgid "" "When one or more :term:`parameters <parameter>` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1694,7 +1688,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1286 +#: ../../reference/compound_stmts.rst:1283 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1707,7 +1701,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1296 +#: ../../reference/compound_stmts.rst:1293 msgid "" "def whats_on_the_telly(penguin=None):\n" " if penguin is None:\n" @@ -1716,7 +1710,7 @@ msgid "" " return penguin" msgstr "" -#: ../../reference/compound_stmts.rst:1307 +#: ../../reference/compound_stmts.rst:1304 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1732,13 +1726,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1319 +#: ../../reference/compound_stmts.rst:1316 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1328 +#: ../../reference/compound_stmts.rst:1325 msgid "" "Parameters may have an :term:`annotation <function annotation>` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1757,13 +1751,13 @@ msgid "" "in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1342 +#: ../../reference/compound_stmts.rst:1339 msgid "" "Parameters of the form \"``*identifier``\" may have an annotation \"``: " "*expression``\". See :pep:`646`." msgstr "" -#: ../../reference/compound_stmts.rst:1348 +#: ../../reference/compound_stmts.rst:1345 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1775,7 +1769,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1356 +#: ../../reference/compound_stmts.rst:1353 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1784,61 +1778,61 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1364 +#: ../../reference/compound_stmts.rst:1361 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1362 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1367 +#: ../../reference/compound_stmts.rst:1364 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1368 +#: ../../reference/compound_stmts.rst:1365 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1370 +#: ../../reference/compound_stmts.rst:1367 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1371 +#: ../../reference/compound_stmts.rst:1368 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables." msgstr "" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1371 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1375 +#: ../../reference/compound_stmts.rst:1372 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:1378 +#: ../../reference/compound_stmts.rst:1375 msgid ":pep:`318` - Decorators for Functions and Methods" msgstr "" -#: ../../reference/compound_stmts.rst:1379 +#: ../../reference/compound_stmts.rst:1376 msgid "" "Function and method decorators were introduced. Class decorators were " "introduced in :pep:`3129`." msgstr "" -#: ../../reference/compound_stmts.rst:1385 +#: ../../reference/compound_stmts.rst:1382 msgid "Class definitions" msgstr "類別定義" -#: ../../reference/compound_stmts.rst:1400 +#: ../../reference/compound_stmts.rst:1397 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1407 +#: ../../reference/compound_stmts.rst:1404 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1847,7 +1841,7 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1413 +#: ../../reference/compound_stmts.rst:1410 msgid "" "class Foo:\n" " pass" @@ -1855,11 +1849,11 @@ msgstr "" "class Foo:\n" " pass" -#: ../../reference/compound_stmts.rst:1416 +#: ../../reference/compound_stmts.rst:1413 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1418 +#: ../../reference/compound_stmts.rst:1415 msgid "" "class Foo(object):\n" " pass" @@ -1867,7 +1861,7 @@ msgstr "" "class Foo(object):\n" " pass" -#: ../../reference/compound_stmts.rst:1421 +#: ../../reference/compound_stmts.rst:1418 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 " @@ -1879,7 +1873,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1430 +#: ../../reference/compound_stmts.rst:1427 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 " @@ -1887,17 +1881,17 @@ msgid "" "using the definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1435 +#: ../../reference/compound_stmts.rst:1432 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "<metaclasses>`." msgstr "" -#: ../../reference/compound_stmts.rst:1440 +#: ../../reference/compound_stmts.rst:1437 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1442 +#: ../../reference/compound_stmts.rst:1439 msgid "" "@f1(arg)\n" "@f2\n" @@ -1907,7 +1901,7 @@ msgstr "" "@f2\n" "class Foo: pass" -#: ../../reference/compound_stmts.rst:1448 +#: ../../reference/compound_stmts.rst:1445 msgid "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" @@ -1915,20 +1909,20 @@ msgstr "" "class Foo: pass\n" "Foo = f1(arg)(f2(Foo))" -#: ../../reference/compound_stmts.rst:1451 +#: ../../reference/compound_stmts.rst:1448 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:1454 +#: ../../reference/compound_stmts.rst:1451 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:1459 +#: ../../reference/compound_stmts.rst:1456 msgid "" "A list of :ref:`type parameters <type-params>` may be given in square " "brackets immediately after the class's name. This indicates to static type " @@ -1937,7 +1931,7 @@ msgid "" "`generic-classes` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1468 +#: ../../reference/compound_stmts.rst:1465 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1950,35 +1944,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1480 +#: ../../reference/compound_stmts.rst:1477 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1481 +#: ../../reference/compound_stmts.rst:1478 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:1485 +#: ../../reference/compound_stmts.rst:1482 msgid ":pep:`3129` - Class Decorators" msgstr ":pep:`3129` - 類別裝飾器" -#: ../../reference/compound_stmts.rst:1486 +#: ../../reference/compound_stmts.rst:1483 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1493 +#: ../../reference/compound_stmts.rst:1490 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1501 +#: ../../reference/compound_stmts.rst:1498 msgid "Coroutine function definition" msgstr "協程函式定義" -#: ../../reference/compound_stmts.rst:1511 +#: ../../reference/compound_stmts.rst:1508 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1986,23 +1980,23 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1515 +#: ../../reference/compound_stmts.rst:1512 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:1518 +#: ../../reference/compound_stmts.rst:1515 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1521 +#: ../../reference/compound_stmts.rst:1518 msgid "An example of a coroutine function::" msgstr "一個協程函式範例: ::" -#: ../../reference/compound_stmts.rst:1523 +#: ../../reference/compound_stmts.rst:1520 msgid "" "async def func(param1, param2):\n" " do_stuff()\n" @@ -2012,30 +2006,30 @@ msgstr "" " do_stuff()\n" " await some_coroutine()" -#: ../../reference/compound_stmts.rst:1527 +#: ../../reference/compound_stmts.rst:1524 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:1535 +#: ../../reference/compound_stmts.rst:1532 msgid "The :keyword:`!async for` statement" msgstr ":keyword:`!async for` 陳述式" -#: ../../reference/compound_stmts.rst:1540 +#: ../../reference/compound_stmts.rst:1537 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:1544 +#: ../../reference/compound_stmts.rst:1541 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1549 +#: ../../reference/compound_stmts.rst:1546 msgid "" "async for TARGET in ITER:\n" " SUITE\n" @@ -2047,11 +2041,11 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1554 +#: ../../reference/compound_stmts.rst:1551 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1556 +#: ../../reference/compound_stmts.rst:1553 msgid "" "iter = (ITER)\n" "iter = type(iter).__aiter__(iter)\n" @@ -2081,28 +2075,28 @@ msgstr "" "else:\n" " SUITE2" -#: ../../reference/compound_stmts.rst:1570 +#: ../../reference/compound_stmts.rst:1567 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`。" -#: ../../reference/compound_stmts.rst:1572 +#: ../../reference/compound_stmts.rst:1569 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1580 +#: ../../reference/compound_stmts.rst:1577 msgid "The :keyword:`!async with` statement" msgstr ":keyword:`!async with` 陳述式" -#: ../../reference/compound_stmts.rst:1585 +#: ../../reference/compound_stmts.rst:1582 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:1590 +#: ../../reference/compound_stmts.rst:1587 msgid "" "async with EXPRESSION as TARGET:\n" " SUITE" @@ -2110,7 +2104,7 @@ msgstr "" "async with EXPRESSION as TARGET:\n" " SUITE" -#: ../../reference/compound_stmts.rst:1595 +#: ../../reference/compound_stmts.rst:1592 msgid "" "manager = (EXPRESSION)\n" "aenter = type(manager).__aenter__\n" @@ -2146,44 +2140,44 @@ msgstr "" " if not hit_except:\n" " await aexit(manager, None, None, None)" -#: ../../reference/compound_stmts.rst:1612 +#: ../../reference/compound_stmts.rst:1609 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`。" -#: ../../reference/compound_stmts.rst:1614 +#: ../../reference/compound_stmts.rst:1611 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1619 +#: ../../reference/compound_stmts.rst:1616 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1620 +#: ../../reference/compound_stmts.rst:1617 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1626 +#: ../../reference/compound_stmts.rst:1623 msgid "Type parameter lists" msgstr "" -#: ../../reference/compound_stmts.rst:1630 +#: ../../reference/compound_stmts.rst:1627 msgid "Support for default values was added (see :pep:`696`)." msgstr "" -#: ../../reference/compound_stmts.rst:1643 +#: ../../reference/compound_stmts.rst:1640 msgid "" ":ref:`Functions <def>` (including :ref:`coroutines <async def>`), :ref:" "`classes <class>` and :ref:`type aliases <type>` may contain a type " "parameter list::" msgstr "" -#: ../../reference/compound_stmts.rst:1647 +#: ../../reference/compound_stmts.rst:1644 msgid "" "def max[T](args: list[T]) -> T:\n" " ...\n" @@ -2215,7 +2209,7 @@ msgstr "" "\n" "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1662 +#: ../../reference/compound_stmts.rst:1659 msgid "" "Semantically, this indicates that the function, class, or type alias is " "generic over a type variable. This information is primarily used by static " @@ -2223,7 +2217,7 @@ msgid "" "generic counterparts." msgstr "" -#: ../../reference/compound_stmts.rst:1667 +#: ../../reference/compound_stmts.rst:1664 msgid "" "Type parameters are declared in square brackets (``[]``) immediately after " "the name of the function, class, or type alias. The type parameters are " @@ -2235,36 +2229,36 @@ msgid "" "wraps the creation of the generic object." msgstr "" -#: ../../reference/compound_stmts.rst:1676 +#: ../../reference/compound_stmts.rst:1673 msgid "" "Generic functions, classes, and type aliases have a :attr:`~definition." "__type_params__` attribute listing their type parameters." msgstr "" -#: ../../reference/compound_stmts.rst:1679 +#: ../../reference/compound_stmts.rst:1676 msgid "Type parameters come in three kinds:" msgstr "" -#: ../../reference/compound_stmts.rst:1681 +#: ../../reference/compound_stmts.rst:1678 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:1683 +#: ../../reference/compound_stmts.rst:1680 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:1686 +#: ../../reference/compound_stmts.rst:1683 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:1689 +#: ../../reference/compound_stmts.rst:1686 msgid "" ":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " "with a colon (``:``) followed by an expression. A single expression after " @@ -2276,7 +2270,7 @@ msgid "" "variables can only take on one of the types in the list of constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1698 +#: ../../reference/compound_stmts.rst:1695 msgid "" "For :data:`!typing.TypeVar`\\ s declared using the type parameter list " "syntax, the bound and constraints are not evaluated when the generic object " @@ -2286,13 +2280,13 @@ msgid "" "<annotation-scopes>`." msgstr "" -#: ../../reference/compound_stmts.rst:1704 +#: ../../reference/compound_stmts.rst:1701 msgid "" ":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " "bounds or constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1707 +#: ../../reference/compound_stmts.rst:1704 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 " @@ -2305,13 +2299,13 @@ msgid "" "attribute is set to the special sentinel object :data:`typing.NoDefault`." msgstr "" -#: ../../reference/compound_stmts.rst:1717 +#: ../../reference/compound_stmts.rst:1714 msgid "" "The following example indicates the full set of allowed type parameter " "declarations::" msgstr "" -#: ../../reference/compound_stmts.rst:1719 +#: ../../reference/compound_stmts.rst:1716 msgid "" "def overly_generic[\n" " SimpleTypeVar,\n" @@ -2343,24 +2337,24 @@ msgstr "" " *e: SimpleTypeVarTuple,\n" "): ..." -#: ../../reference/compound_stmts.rst:1737 +#: ../../reference/compound_stmts.rst:1734 msgid "Generic functions" msgstr "" -#: ../../reference/compound_stmts.rst:1739 +#: ../../reference/compound_stmts.rst:1736 msgid "Generic functions are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1741 +#: ../../reference/compound_stmts.rst:1738 msgid "def func[T](arg: T): ..." msgstr "def func[T](arg: T): ..." -#: ../../reference/compound_stmts.rst:1743 -#: ../../reference/compound_stmts.rst:1803 +#: ../../reference/compound_stmts.rst:1740 +#: ../../reference/compound_stmts.rst:1800 msgid "This syntax is equivalent to::" msgstr "語法大致等價於: ::" -#: ../../reference/compound_stmts.rst:1745 +#: ../../reference/compound_stmts.rst:1742 msgid "" "annotation-def TYPE_PARAMS_OF_func():\n" " T = typing.TypeVar(\"T\")\n" @@ -2376,7 +2370,7 @@ msgstr "" " return func\n" "func = TYPE_PARAMS_OF_func()" -#: ../../reference/compound_stmts.rst:1752 +#: ../../reference/compound_stmts.rst:1749 msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope <annotation-" "scopes>`, which is not actually bound to any name at runtime. (One other " @@ -2385,20 +2379,20 @@ msgid "" "data:`typing.TypeVar` directly.)" msgstr "" -#: ../../reference/compound_stmts.rst:1758 +#: ../../reference/compound_stmts.rst:1755 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:1762 +#: ../../reference/compound_stmts.rst:1759 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:1765 +#: ../../reference/compound_stmts.rst:1762 msgid "" "@decorator\n" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" @@ -2408,13 +2402,13 @@ msgstr "" "def func[T: int, *Ts, **P](*args: *Ts, arg: Callable[P, T] = some_default):\n" " ..." -#: ../../reference/compound_stmts.rst:1769 +#: ../../reference/compound_stmts.rst:1766 msgid "" "Except for the :ref:`lazy evaluation <lazy-evaluation>` of the :class:" "`~typing.TypeVar` bound, this is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1772 +#: ../../reference/compound_stmts.rst:1769 msgid "" "DEFAULT_OF_arg = some_default\n" "\n" @@ -2436,25 +2430,25 @@ msgid "" "func = decorator(TYPE_PARAMS_OF_func())" msgstr "" -#: ../../reference/compound_stmts.rst:1791 +#: ../../reference/compound_stmts.rst:1788 msgid "" "The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " "runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1797 +#: ../../reference/compound_stmts.rst:1794 msgid "Generic classes" msgstr "" -#: ../../reference/compound_stmts.rst:1799 +#: ../../reference/compound_stmts.rst:1796 msgid "Generic classes are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1801 +#: ../../reference/compound_stmts.rst:1798 msgid "class Bag[T]: ..." msgstr "class Bag[T]: ..." -#: ../../reference/compound_stmts.rst:1805 +#: ../../reference/compound_stmts.rst:1802 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2472,14 +2466,14 @@ msgstr "" " return Bag\n" "Bag = TYPE_PARAMS_OF_Bag()" -#: ../../reference/compound_stmts.rst:1813 +#: ../../reference/compound_stmts.rst:1810 msgid "" "Here again ``annotation-def`` (not a real keyword) indicates an :ref:" "`annotation scope <annotation-scopes>`, and the name ``TYPE_PARAMS_OF_Bag`` " "is not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1817 +#: ../../reference/compound_stmts.rst:1814 msgid "" "Generic classes implicitly inherit from :data:`typing.Generic`. The base " "classes and keyword arguments of generic classes are evaluated within the " @@ -2487,7 +2481,7 @@ msgid "" "that scope. This is illustrated by this example::" msgstr "" -#: ../../reference/compound_stmts.rst:1823 +#: ../../reference/compound_stmts.rst:1820 msgid "" "@decorator\n" "class Bag(Base[T], arg=T): ..." @@ -2495,11 +2489,11 @@ msgstr "" "@decorator\n" "class Bag(Base[T], arg=T): ..." -#: ../../reference/compound_stmts.rst:1826 +#: ../../reference/compound_stmts.rst:1823 msgid "This is equivalent to::" msgstr "這等價於: ::" -#: ../../reference/compound_stmts.rst:1828 +#: ../../reference/compound_stmts.rst:1825 msgid "" "annotation-def TYPE_PARAMS_OF_Bag():\n" " T = typing.TypeVar(\"T\")\n" @@ -2517,27 +2511,27 @@ msgstr "" " return Bag\n" "Bag = decorator(TYPE_PARAMS_OF_Bag())" -#: ../../reference/compound_stmts.rst:1839 +#: ../../reference/compound_stmts.rst:1836 msgid "Generic type aliases" msgstr "" -#: ../../reference/compound_stmts.rst:1841 +#: ../../reference/compound_stmts.rst:1838 msgid "" "The :keyword:`type` statement can also be used to create a generic type " "alias::" msgstr "" -#: ../../reference/compound_stmts.rst:1843 +#: ../../reference/compound_stmts.rst:1840 msgid "type ListOrSet[T] = list[T] | set[T]" msgstr "type ListOrSet[T] = list[T] | set[T]" -#: ../../reference/compound_stmts.rst:1845 +#: ../../reference/compound_stmts.rst:1842 msgid "" "Except for the :ref:`lazy evaluation <lazy-evaluation>` of the value, this " "is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1848 +#: ../../reference/compound_stmts.rst:1845 msgid "" "annotation-def TYPE_PARAMS_OF_ListOrSet():\n" " T = typing.TypeVar(\"T\")\n" @@ -2550,105 +2544,105 @@ msgid "" "ListOrSet = TYPE_PARAMS_OF_ListOrSet()" msgstr "" -#: ../../reference/compound_stmts.rst:1857 +#: ../../reference/compound_stmts.rst:1854 msgid "" "Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " "scope <annotation-scopes>`. The capitalized names like " "``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1862 +#: ../../reference/compound_stmts.rst:1859 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1863 +#: ../../reference/compound_stmts.rst:1860 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:1867 +#: ../../reference/compound_stmts.rst:1864 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1869 +#: ../../reference/compound_stmts.rst:1866 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1870 +#: ../../reference/compound_stmts.rst:1867 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1871 +#: ../../reference/compound_stmts.rst:1868 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1872 -#: ../../reference/compound_stmts.rst:1891 +#: ../../reference/compound_stmts.rst:1869 +#: ../../reference/compound_stmts.rst:1888 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1874 +#: ../../reference/compound_stmts.rst:1871 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1876 +#: ../../reference/compound_stmts.rst:1873 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1877 +#: ../../reference/compound_stmts.rst:1874 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1879 +#: ../../reference/compound_stmts.rst:1876 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1880 +#: ../../reference/compound_stmts.rst:1877 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1883 +#: ../../reference/compound_stmts.rst:1880 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1886 +#: ../../reference/compound_stmts.rst:1883 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1888 +#: ../../reference/compound_stmts.rst:1885 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1889 +#: ../../reference/compound_stmts.rst:1886 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1890 +#: ../../reference/compound_stmts.rst:1887 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1893 +#: ../../reference/compound_stmts.rst:1890 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1896 +#: ../../reference/compound_stmts.rst:1893 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:1900 +#: ../../reference/compound_stmts.rst:1897 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 " @@ -2668,12 +2662,12 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:390 #: ../../reference/compound_stmts.rst:437 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:588 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 -#: ../../reference/compound_stmts.rst:1497 -#: ../../reference/compound_stmts.rst:1531 -#: ../../reference/compound_stmts.rst:1576 +#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1528 +#: ../../reference/compound_stmts.rst:1573 msgid "statement" msgstr "statement(陳述式)" @@ -2709,7 +2703,7 @@ msgstr "" msgid "else" msgstr "else" -#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:86 ../../reference/compound_stmts.rst:585 msgid "if" msgstr "if" @@ -2720,8 +2714,8 @@ msgstr "if" #: ../../reference/compound_stmts.rst:390 #: ../../reference/compound_stmts.rst:408 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:588 -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:1504 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2733,10 +2727,10 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:588 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1323 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1320 +#: ../../reference/compound_stmts.rst:1384 msgid ": (colon)" msgstr ": (冒號)" @@ -2744,9 +2738,9 @@ msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:588 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:585 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -2791,8 +2785,8 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:298 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "object" msgstr "object(物件)" @@ -2824,7 +2818,7 @@ msgstr "finally" #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:265 #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:585 msgid "as" msgstr "as" @@ -2862,199 +2856,199 @@ msgid "with statement" msgstr "with statement(with 陳述式)" #: ../../reference/compound_stmts.rst:471 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid ", (comma)" msgstr ", (逗號)" -#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:585 msgid "match" msgstr "match" -#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:585 msgid "case" msgstr "case" -#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:585 msgid "pattern matching" msgstr "pattern matching(模式匹配)" -#: ../../reference/compound_stmts.rst:588 +#: ../../reference/compound_stmts.rst:585 msgid "match statement" msgstr "match statement(匹配陳述式)" -#: ../../reference/compound_stmts.rst:692 +#: ../../reference/compound_stmts.rst:689 msgid "guard" msgstr "guard" -#: ../../reference/compound_stmts.rst:731 +#: ../../reference/compound_stmts.rst:728 msgid "irrefutable case block" msgstr "" -#: ../../reference/compound_stmts.rst:731 +#: ../../reference/compound_stmts.rst:728 msgid "case block" msgstr "" -#: ../../reference/compound_stmts.rst:755 +#: ../../reference/compound_stmts.rst:752 msgid "! patterns" msgstr "" -#: ../../reference/compound_stmts.rst:755 +#: ../../reference/compound_stmts.rst:752 msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" msgstr "" -#: ../../reference/compound_stmts.rst:1186 -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1183 +#: ../../reference/compound_stmts.rst:1270 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/compound_stmts.rst:1186 -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1237 -#: ../../reference/compound_stmts.rst:1273 -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1183 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1234 +#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1299 msgid "function definition" msgstr "function definition(函式定義)" -#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1192 msgid "def" msgstr "def" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1320 msgid "function" msgstr "function (函式)" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "definition" msgstr "definition(定義)" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "name" msgstr "name(名稱)" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "binding" msgstr "binding(綁定)" -#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1192 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/compound_stmts.rst:1195 -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1384 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../reference/compound_stmts.rst:1195 +#: ../../reference/compound_stmts.rst:1192 msgid "parameter list" msgstr "parameter list(參數列表)" -#: ../../reference/compound_stmts.rst:1237 -#: ../../reference/compound_stmts.rst:1437 +#: ../../reference/compound_stmts.rst:1234 +#: ../../reference/compound_stmts.rst:1434 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1270 msgid "default" msgstr "default(預設)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1270 msgid "value" msgstr "value(值)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1270 msgid "argument" msgstr "argument(引數)" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1270 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1299 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1299 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1299 msgid "**" msgstr "**" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1320 msgid "annotations" msgstr "annotations(註釋)" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1320 msgid "->" msgstr "->" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1320 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../reference/compound_stmts.rst:1346 +#: ../../reference/compound_stmts.rst:1343 msgid "lambda" msgstr "lambda" -#: ../../reference/compound_stmts.rst:1346 +#: ../../reference/compound_stmts.rst:1343 msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "execution" msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1387 -#: ../../reference/compound_stmts.rst:1437 +#: ../../reference/compound_stmts.rst:1384 +#: ../../reference/compound_stmts.rst:1434 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1384 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1497 +#: ../../reference/compound_stmts.rst:1494 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1504 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1507 +#: ../../reference/compound_stmts.rst:1504 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1531 +#: ../../reference/compound_stmts.rst:1528 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1576 +#: ../../reference/compound_stmts.rst:1573 msgid "async with" msgstr "async with" -#: ../../reference/compound_stmts.rst:1633 +#: ../../reference/compound_stmts.rst:1630 msgid "type parameters" msgstr "type parameter(型別參數)" diff --git a/reference/expressions.po b/reference/expressions.po index a6d34f67a1..32ca7edb29 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-08 03:35+0000\n" +"POT-Creation-Date: 2024-11-15 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1280,76 +1280,78 @@ msgid "" "The first thing the code block will do is bind the formal parameters to the " "arguments; this is described in section :ref:`function`. When the code " "block executes a :keyword:`return` statement, this specifies the return " -"value of the function call." +"value of the function call. If execution reaches the end of the code block " +"without executing a :keyword:`return` statement, the return value is " +"``None``." msgstr "" -#: ../../reference/expressions.rst:1161 +#: ../../reference/expressions.rst:1162 msgid "a built-in function or method:" msgstr "" -#: ../../reference/expressions.rst:1172 +#: ../../reference/expressions.rst:1173 msgid "" "The result is up to the interpreter; see :ref:`built-in-funcs` for the " "descriptions of built-in functions and methods." msgstr "" -#: ../../reference/expressions.rst:1175 +#: ../../reference/expressions.rst:1176 msgid "a class object:" msgstr "" -#: ../../reference/expressions.rst:1180 +#: ../../reference/expressions.rst:1181 msgid "A new instance of that class is returned." msgstr "" -#: ../../reference/expressions.rst:1182 +#: ../../reference/expressions.rst:1183 msgid "a class instance method:" msgstr "" -#: ../../reference/expressions.rst:1188 +#: ../../reference/expressions.rst:1189 msgid "" "The corresponding user-defined function is called, with an argument list " "that is one longer than the argument list of the call: the instance becomes " "the first argument." msgstr "" -#: ../../reference/expressions.rst:1192 +#: ../../reference/expressions.rst:1193 msgid "a class instance:" msgstr "" -#: ../../reference/expressions.rst:1197 +#: ../../reference/expressions.rst:1198 msgid "" "The class must define a :meth:`~object.__call__` method; the effect is then " "the same as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1205 ../../reference/expressions.rst:2006 +#: ../../reference/expressions.rst:1206 ../../reference/expressions.rst:2007 msgid "Await expression" msgstr "" -#: ../../reference/expressions.rst:1207 +#: ../../reference/expressions.rst:1208 msgid "" "Suspend the execution of :term:`coroutine` on an :term:`awaitable` object. " "Can only be used inside a :term:`coroutine function`." msgstr "" -#: ../../reference/expressions.rst:1219 +#: ../../reference/expressions.rst:1220 msgid "The power operator" msgstr "" -#: ../../reference/expressions.rst:1225 +#: ../../reference/expressions.rst:1226 msgid "" "The power operator binds more tightly than unary operators on its left; it " "binds less tightly than unary operators on its right. The syntax is:" msgstr "" -#: ../../reference/expressions.rst:1231 +#: ../../reference/expressions.rst:1232 msgid "" "Thus, in an unparenthesized sequence of power and unary operators, the " "operators are evaluated from right to left (this does not constrain the " "evaluation order for the operands): ``-1**2`` results in ``-1``." msgstr "" -#: ../../reference/expressions.rst:1235 +#: ../../reference/expressions.rst:1236 msgid "" "The power operator has the same semantics as the built-in :func:`pow` " "function, when called with two arguments: it yields its left argument raised " @@ -1357,7 +1359,7 @@ msgid "" "converted to a common type, and the result is of that type." msgstr "" -#: ../../reference/expressions.rst:1240 +#: ../../reference/expressions.rst:1241 msgid "" "For int operands, the result has the same type as the operands unless the " "second argument is negative; in that case, all arguments are converted to " @@ -1365,41 +1367,41 @@ msgid "" "``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../reference/expressions.rst:1245 +#: ../../reference/expressions.rst:1246 msgid "" "Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`. " "Raising a negative number to a fractional power results in a :class:" "`complex` number. (In earlier versions it raised a :exc:`ValueError`.)" msgstr "" -#: ../../reference/expressions.rst:1249 +#: ../../reference/expressions.rst:1250 msgid "" "This operation can be customized using the special :meth:`~object.__pow__` " "and :meth:`~object.__rpow__` methods." msgstr "" -#: ../../reference/expressions.rst:1255 +#: ../../reference/expressions.rst:1256 msgid "Unary arithmetic and bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1261 +#: ../../reference/expressions.rst:1262 msgid "All unary arithmetic and bitwise operations have the same priority:" msgstr "" -#: ../../reference/expressions.rst:1272 +#: ../../reference/expressions.rst:1273 msgid "" "The unary ``-`` (minus) operator yields the negation of its numeric " "argument; the operation can be overridden with the :meth:`~object.__neg__` " "special method." msgstr "" -#: ../../reference/expressions.rst:1280 +#: ../../reference/expressions.rst:1281 msgid "" "The unary ``+`` (plus) operator yields its numeric argument unchanged; the " "operation can be overridden with the :meth:`~object.__pos__` special method." msgstr "" -#: ../../reference/expressions.rst:1287 +#: ../../reference/expressions.rst:1288 msgid "" "The unary ``~`` (invert) operator yields the bitwise inversion of its " "integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. " @@ -1407,17 +1409,17 @@ msgid "" "meth:`~object.__invert__` special method." msgstr "" -#: ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1297 msgid "" "In all three cases, if the argument does not have the proper type, a :exc:" "`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1303 +#: ../../reference/expressions.rst:1304 msgid "Binary arithmetic operations" msgstr "" -#: ../../reference/expressions.rst:1307 +#: ../../reference/expressions.rst:1308 msgid "" "The binary arithmetic operations have the conventional priority levels. " "Note that some of these operations also apply to certain non-numeric types. " @@ -1425,7 +1427,7 @@ msgid "" "multiplicative operators and one for additive operators:" msgstr "" -#: ../../reference/expressions.rst:1322 +#: ../../reference/expressions.rst:1323 msgid "" "The ``*`` (multiplication) operator yields the product of its arguments. " "The arguments must either both be numbers, or one argument must be an " @@ -1435,25 +1437,25 @@ msgid "" "an empty sequence." msgstr "" -#: ../../reference/expressions.rst:1328 +#: ../../reference/expressions.rst:1329 msgid "" "This operation can be customized using the special :meth:`~object.__mul__` " "and :meth:`~object.__rmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1335 +#: ../../reference/expressions.rst:1336 msgid "" "The ``@`` (at) operator is intended to be used for matrix multiplication. " "No builtin Python types implement this operator." msgstr "" -#: ../../reference/expressions.rst:1338 +#: ../../reference/expressions.rst:1339 msgid "" "This operation can be customized using the special :meth:`~object." "__matmul__` and :meth:`~object.__rmatmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1349 +#: ../../reference/expressions.rst:1350 msgid "" "The ``/`` (division) and ``//`` (floor division) operators yield the " "quotient of their arguments. The numeric arguments are first converted to a " @@ -1463,7 +1465,7 @@ msgid "" "the :exc:`ZeroDivisionError` exception." msgstr "" -#: ../../reference/expressions.rst:1356 +#: ../../reference/expressions.rst:1357 msgid "" "The division operation can be customized using the special :meth:`~object." "__truediv__` and :meth:`~object.__rtruediv__` methods. The floor division " @@ -1471,7 +1473,7 @@ msgid "" "and :meth:`~object.__rfloordiv__` methods." msgstr "" -#: ../../reference/expressions.rst:1365 +#: ../../reference/expressions.rst:1366 msgid "" "The ``%`` (modulo) operator yields the remainder from the division of the " "first argument by the second. The numeric arguments are first converted to " @@ -1483,7 +1485,7 @@ msgid "" "absolute value of the second operand [#]_." msgstr "" -#: ../../reference/expressions.rst:1374 +#: ../../reference/expressions.rst:1375 msgid "" "The floor division and modulo operators are connected by the following " "identity: ``x == (x//y)*y + (x%y)``. Floor division and modulo are also " @@ -1491,7 +1493,7 @@ msgid "" "y, x%y)``. [#]_." msgstr "" -#: ../../reference/expressions.rst:1379 +#: ../../reference/expressions.rst:1380 msgid "" "In addition to performing the modulo operation on numbers, the ``%`` " "operator is also overloaded by string objects to perform old-style string " @@ -1500,20 +1502,20 @@ msgid "" "formatting`." msgstr "" -#: ../../reference/expressions.rst:1384 +#: ../../reference/expressions.rst:1385 msgid "" "The *modulo* operation can be customized using the special :meth:`~object." "__mod__` and :meth:`~object.__rmod__` methods." msgstr "" -#: ../../reference/expressions.rst:1387 +#: ../../reference/expressions.rst:1388 msgid "" "The floor division operator, the modulo operator, and the :func:`divmod` " "function are not defined for complex numbers. Instead, convert to a " "floating-point number using the :func:`abs` function if appropriate." msgstr "" -#: ../../reference/expressions.rst:1396 +#: ../../reference/expressions.rst:1397 msgid "" "The ``+`` (addition) operator yields the sum of its arguments. The " "arguments must either both be numbers or both be sequences of the same " @@ -1521,40 +1523,40 @@ msgid "" "then added together. In the latter case, the sequences are concatenated." msgstr "" -#: ../../reference/expressions.rst:1401 +#: ../../reference/expressions.rst:1402 msgid "" "This operation can be customized using the special :meth:`~object.__add__` " "and :meth:`~object.__radd__` methods." msgstr "" -#: ../../reference/expressions.rst:1409 +#: ../../reference/expressions.rst:1410 msgid "" "The ``-`` (subtraction) operator yields the difference of its arguments. " "The numeric arguments are first converted to a common type." msgstr "" -#: ../../reference/expressions.rst:1412 +#: ../../reference/expressions.rst:1413 msgid "" "This operation can be customized using the special :meth:`~object.__sub__` " "and :meth:`~object.__rsub__` methods." msgstr "" -#: ../../reference/expressions.rst:1419 +#: ../../reference/expressions.rst:1420 msgid "Shifting operations" msgstr "" -#: ../../reference/expressions.rst:1426 +#: ../../reference/expressions.rst:1427 msgid "" "The shifting operations have lower priority than the arithmetic operations:" msgstr "" -#: ../../reference/expressions.rst:1431 +#: ../../reference/expressions.rst:1432 msgid "" "These operators accept integers as arguments. They shift the first argument " "to the left or right by the number of bits given by the second argument." msgstr "" -#: ../../reference/expressions.rst:1434 +#: ../../reference/expressions.rst:1435 msgid "" "The left shift operation can be customized using the special :meth:`~object." "__lshift__` and :meth:`~object.__rlshift__` methods. The right shift " @@ -1562,46 +1564,46 @@ msgid "" "and :meth:`~object.__rrshift__` methods." msgstr "" -#: ../../reference/expressions.rst:1441 +#: ../../reference/expressions.rst:1442 msgid "" "A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A " "left shift by *n* bits is defined as multiplication with ``pow(2,n)``." msgstr "" -#: ../../reference/expressions.rst:1448 +#: ../../reference/expressions.rst:1449 msgid "Binary bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1452 +#: ../../reference/expressions.rst:1453 msgid "Each of the three bitwise operations has a different priority level:" msgstr "" -#: ../../reference/expressions.rst:1463 +#: ../../reference/expressions.rst:1464 msgid "" "The ``&`` operator yields the bitwise AND of its arguments, which must be " "integers or one of them must be a custom object overriding :meth:`~object." "__and__` or :meth:`~object.__rand__` special methods." msgstr "" -#: ../../reference/expressions.rst:1472 +#: ../../reference/expressions.rst:1473 msgid "" "The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, " "which must be integers or one of them must be a custom object overriding :" "meth:`~object.__xor__` or :meth:`~object.__rxor__` special methods." msgstr "" -#: ../../reference/expressions.rst:1481 +#: ../../reference/expressions.rst:1482 msgid "" "The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which " "must be integers or one of them must be a custom object overriding :meth:" "`~object.__or__` or :meth:`~object.__ror__` special methods." msgstr "" -#: ../../reference/expressions.rst:1489 +#: ../../reference/expressions.rst:1490 msgid "Comparisons" msgstr "" -#: ../../reference/expressions.rst:1501 +#: ../../reference/expressions.rst:1502 msgid "" "Unlike C, all comparison operations in Python have the same priority, which " "is lower than that of any arithmetic, shifting or bitwise operation. Also " @@ -1609,14 +1611,14 @@ msgid "" "conventional in mathematics:" msgstr "" -#: ../../reference/expressions.rst:1511 +#: ../../reference/expressions.rst:1512 msgid "" "Comparisons yield boolean values: ``True`` or ``False``. Custom :dfn:`rich " "comparison methods` may return non-boolean values. In this case Python will " "call :func:`bool` on such value in boolean contexts." msgstr "" -#: ../../reference/expressions.rst:1517 +#: ../../reference/expressions.rst:1518 msgid "" "Comparisons can be chained arbitrarily, e.g., ``x < y <= z`` is equivalent " "to ``x < y and y <= z``, except that ``y`` is evaluated only once (but in " @@ -1624,7 +1626,7 @@ msgid "" "false)." msgstr "" -#: ../../reference/expressions.rst:1521 +#: ../../reference/expressions.rst:1522 msgid "" "Formally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*, " "*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y opN " @@ -1632,24 +1634,24 @@ msgid "" "each expression is evaluated at most once." msgstr "" -#: ../../reference/expressions.rst:1526 +#: ../../reference/expressions.rst:1527 msgid "" "Note that ``a op1 b op2 c`` doesn't imply any kind of comparison between *a* " "and *c*, so that, e.g., ``x < y > z`` is perfectly legal (though perhaps not " "pretty)." msgstr "" -#: ../../reference/expressions.rst:1533 +#: ../../reference/expressions.rst:1534 msgid "Value comparisons" msgstr "" -#: ../../reference/expressions.rst:1535 +#: ../../reference/expressions.rst:1536 msgid "" "The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the " "values of two objects. The objects do not need to have the same type." msgstr "" -#: ../../reference/expressions.rst:1538 +#: ../../reference/expressions.rst:1539 msgid "" "Chapter :ref:`objects` states that objects have a value (in addition to type " "and identity). The value of an object is a rather abstract notion in " @@ -1661,7 +1663,7 @@ msgid "" "indirectly, by means of their comparison implementation." msgstr "" -#: ../../reference/expressions.rst:1547 +#: ../../reference/expressions.rst:1548 msgid "" "Because all types are (direct or indirect) subtypes of :class:`object`, they " "inherit the default comparison behavior from :class:`object`. Types can " @@ -1669,7 +1671,7 @@ msgid "" "methods` like :meth:`~object.__lt__`, described in :ref:`customization`." msgstr "" -#: ../../reference/expressions.rst:1553 +#: ../../reference/expressions.rst:1554 msgid "" "The default behavior for equality comparison (``==`` and ``!=``) is based on " "the identity of the objects. Hence, equality comparison of instances with " @@ -1679,14 +1681,14 @@ msgid "" "``x is y`` implies ``x == y``)." msgstr "" -#: ../../reference/expressions.rst:1560 +#: ../../reference/expressions.rst:1561 msgid "" "A default order comparison (``<``, ``>``, ``<=``, and ``>=``) is not " "provided; an attempt raises :exc:`TypeError`. A motivation for this default " "behavior is the lack of a similar invariant as for equality." msgstr "" -#: ../../reference/expressions.rst:1564 +#: ../../reference/expressions.rst:1565 msgid "" "The behavior of the default equality comparison, that instances with " "different identities are always unequal, may be in contrast to what types " @@ -1695,13 +1697,13 @@ msgid "" "in fact, a number of built-in types have done that." msgstr "" -#: ../../reference/expressions.rst:1570 +#: ../../reference/expressions.rst:1571 msgid "" "The following list describes the comparison behavior of the most important " "built-in types." msgstr "" -#: ../../reference/expressions.rst:1573 +#: ../../reference/expressions.rst:1574 msgid "" "Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard " "library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can " @@ -1711,7 +1713,7 @@ msgid "" "of precision." msgstr "" -#: ../../reference/expressions.rst:1580 +#: ../../reference/expressions.rst:1581 msgid "" "The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are " "special. Any ordered comparison of a number to a not-a-number value is " @@ -1721,32 +1723,32 @@ msgid "" "is compliant with IEEE 754." msgstr "" -#: ../../reference/expressions.rst:1587 +#: ../../reference/expressions.rst:1588 msgid "" "``None`` and :data:`NotImplemented` are singletons. :PEP:`8` advises that " "comparisons for singletons should always be done with ``is`` or ``is not``, " "never the equality operators." msgstr "" -#: ../../reference/expressions.rst:1591 +#: ../../reference/expressions.rst:1592 msgid "" "Binary sequences (instances of :class:`bytes` or :class:`bytearray`) can be " "compared within and across their types. They compare lexicographically " "using the numeric values of their elements." msgstr "" -#: ../../reference/expressions.rst:1595 +#: ../../reference/expressions.rst:1596 msgid "" "Strings (instances of :class:`str`) compare lexicographically using the " "numerical Unicode code points (the result of the built-in function :func:" "`ord`) of their characters. [#]_" msgstr "" -#: ../../reference/expressions.rst:1599 +#: ../../reference/expressions.rst:1600 msgid "Strings and binary sequences cannot be directly compared." msgstr "" -#: ../../reference/expressions.rst:1601 +#: ../../reference/expressions.rst:1602 msgid "" "Sequences (instances of :class:`tuple`, :class:`list`, or :class:`range`) " "can be compared only within each of their types, with the restriction that " @@ -1755,7 +1757,7 @@ msgid "" "raises :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1607 +#: ../../reference/expressions.rst:1608 msgid "" "Sequences compare lexicographically using comparison of corresponding " "elements. The built-in containers typically assume identical objects are " @@ -1763,19 +1765,19 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" -#: ../../reference/expressions.rst:1612 +#: ../../reference/expressions.rst:1613 msgid "" "Lexicographical comparison between built-in collections works as follows:" msgstr "" -#: ../../reference/expressions.rst:1614 +#: ../../reference/expressions.rst:1615 msgid "" "For two collections to compare equal, they must be of the same type, have " "the same length, and each pair of corresponding elements must compare equal " "(for example, ``[1,2] == (1,2)`` is false because the type is not the same)." msgstr "" -#: ../../reference/expressions.rst:1619 +#: ../../reference/expressions.rst:1620 msgid "" "Collections that support order comparison are ordered the same as their " "first unequal elements (for example, ``[1,2,x] <= [1,2,y]`` has the same " @@ -1784,25 +1786,25 @@ msgid "" "true)." msgstr "" -#: ../../reference/expressions.rst:1625 +#: ../../reference/expressions.rst:1626 msgid "" "Mappings (instances of :class:`dict`) compare equal if and only if they have " "equal ``(key, value)`` pairs. Equality comparison of the keys and values " "enforces reflexivity." msgstr "" -#: ../../reference/expressions.rst:1629 +#: ../../reference/expressions.rst:1630 msgid "" "Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1631 +#: ../../reference/expressions.rst:1632 msgid "" "Sets (instances of :class:`set` or :class:`frozenset`) can be compared " "within and across their types." msgstr "" -#: ../../reference/expressions.rst:1634 +#: ../../reference/expressions.rst:1635 msgid "" "They define order comparison operators to mean subset and superset tests. " "Those relations do not define total orderings (for example, the two sets " @@ -1813,110 +1815,110 @@ msgid "" "sets as inputs)." msgstr "" -#: ../../reference/expressions.rst:1642 +#: ../../reference/expressions.rst:1643 msgid "Comparison of sets enforces reflexivity of its elements." msgstr "" -#: ../../reference/expressions.rst:1644 +#: ../../reference/expressions.rst:1645 msgid "" "Most other built-in types have no comparison methods implemented, so they " "inherit the default comparison behavior." msgstr "" -#: ../../reference/expressions.rst:1647 +#: ../../reference/expressions.rst:1648 msgid "" "User-defined classes that customize their comparison behavior should follow " "some consistency rules, if possible:" msgstr "" -#: ../../reference/expressions.rst:1650 +#: ../../reference/expressions.rst:1651 msgid "" "Equality comparison should be reflexive. In other words, identical objects " "should compare equal:" msgstr "" -#: ../../reference/expressions.rst:1653 +#: ../../reference/expressions.rst:1654 msgid "``x is y`` implies ``x == y``" msgstr "" -#: ../../reference/expressions.rst:1655 +#: ../../reference/expressions.rst:1656 msgid "" "Comparison should be symmetric. In other words, the following expressions " "should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1658 +#: ../../reference/expressions.rst:1659 msgid "``x == y`` and ``y == x``" msgstr "``x == y`` 和 ``y == x``" -#: ../../reference/expressions.rst:1660 +#: ../../reference/expressions.rst:1661 msgid "``x != y`` and ``y != x``" msgstr "``x != y`` 和 ``y != x``" -#: ../../reference/expressions.rst:1662 +#: ../../reference/expressions.rst:1663 msgid "``x < y`` and ``y > x``" msgstr "``x < y`` 和 ``y > x``" -#: ../../reference/expressions.rst:1664 +#: ../../reference/expressions.rst:1665 msgid "``x <= y`` and ``y >= x``" msgstr "``x <= y`` 和 ``y >= x``" -#: ../../reference/expressions.rst:1666 +#: ../../reference/expressions.rst:1667 msgid "" "Comparison should be transitive. The following (non-exhaustive) examples " "illustrate that:" msgstr "" -#: ../../reference/expressions.rst:1669 +#: ../../reference/expressions.rst:1670 msgid "``x > y and y > z`` implies ``x > z``" msgstr "``x > y and y > z`` 暗示了 ``x > z``" -#: ../../reference/expressions.rst:1671 +#: ../../reference/expressions.rst:1672 msgid "``x < y and y <= z`` implies ``x < z``" msgstr "``x < y and y <= z`` 暗示了 ``x < z``" -#: ../../reference/expressions.rst:1673 +#: ../../reference/expressions.rst:1674 msgid "" "Inverse comparison should result in the boolean negation. In other words, " "the following expressions should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1676 +#: ../../reference/expressions.rst:1677 msgid "``x == y`` and ``not x != y``" msgstr "``x == y`` 和 ``not x != y``" -#: ../../reference/expressions.rst:1678 +#: ../../reference/expressions.rst:1679 msgid "``x < y`` and ``not x >= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1680 +#: ../../reference/expressions.rst:1681 msgid "``x > y`` and ``not x <= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1682 +#: ../../reference/expressions.rst:1683 msgid "" "The last two expressions apply to totally ordered collections (e.g. to " "sequences, but not to sets or mappings). See also the :func:`~functools." "total_ordering` decorator." msgstr "" -#: ../../reference/expressions.rst:1686 +#: ../../reference/expressions.rst:1687 msgid "" "The :func:`hash` result should be consistent with equality. Objects that are " "equal should either have the same hash value, or be marked as unhashable." msgstr "" -#: ../../reference/expressions.rst:1690 +#: ../../reference/expressions.rst:1691 msgid "" "Python does not enforce these consistency rules. In fact, the not-a-number " "values are an example for not following these rules." msgstr "" -#: ../../reference/expressions.rst:1699 +#: ../../reference/expressions.rst:1700 msgid "Membership test operations" msgstr "" -#: ../../reference/expressions.rst:1701 +#: ../../reference/expressions.rst:1702 msgid "" "The operators :keyword:`in` and :keyword:`not in` test for membership. ``x " "in s`` evaluates to ``True`` if *x* is a member of *s*, and ``False`` " @@ -1927,7 +1929,7 @@ msgid "" "expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``." msgstr "" -#: ../../reference/expressions.rst:1709 +#: ../../reference/expressions.rst:1710 msgid "" "For the string and bytes types, ``x in y`` is ``True`` if and only if *x* is " "a substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty " @@ -1935,14 +1937,14 @@ msgid "" "``\"\" in \"abc\"`` will return ``True``." msgstr "" -#: ../../reference/expressions.rst:1714 +#: ../../reference/expressions.rst:1715 msgid "" "For user-defined classes which define the :meth:`~object.__contains__` " "method, ``x in y`` returns ``True`` if ``y.__contains__(x)`` returns a true " "value, and ``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1718 +#: ../../reference/expressions.rst:1719 msgid "" "For user-defined classes which do not define :meth:`~object.__contains__` " "but do define :meth:`~object.__iter__`, ``x in y`` is ``True`` if some value " @@ -1951,7 +1953,7 @@ msgid "" "it is as if :keyword:`in` raised that exception." msgstr "" -#: ../../reference/expressions.rst:1724 +#: ../../reference/expressions.rst:1725 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" "`~object.__getitem__`, ``x in y`` is ``True`` if and only if there is a non-" @@ -1960,17 +1962,17 @@ msgid "" "exception is raised, it is as if :keyword:`in` raised that exception)." msgstr "" -#: ../../reference/expressions.rst:1736 +#: ../../reference/expressions.rst:1737 msgid "" "The operator :keyword:`not in` is defined to have the inverse truth value " "of :keyword:`in`." msgstr "" -#: ../../reference/expressions.rst:1749 +#: ../../reference/expressions.rst:1750 msgid "Identity comparisons" msgstr "" -#: ../../reference/expressions.rst:1751 +#: ../../reference/expressions.rst:1752 msgid "" "The operators :keyword:`is` and :keyword:`is not` test for an object's " "identity: ``x is y`` is true if and only if *x* and *y* are the same " @@ -1978,11 +1980,11 @@ msgid "" "``x is not y`` yields the inverse truth value. [#]_" msgstr "" -#: ../../reference/expressions.rst:1763 +#: ../../reference/expressions.rst:1764 msgid "Boolean operations" msgstr "" -#: ../../reference/expressions.rst:1774 +#: ../../reference/expressions.rst:1775 msgid "" "In the context of Boolean operations, and also when expressions are used by " "control flow statements, the following values are interpreted as false: " @@ -1993,25 +1995,25 @@ msgid "" "__bool__` method." msgstr "" -#: ../../reference/expressions.rst:1783 +#: ../../reference/expressions.rst:1784 msgid "" "The operator :keyword:`not` yields ``True`` if its argument is false, " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1788 +#: ../../reference/expressions.rst:1789 msgid "" "The expression ``x and y`` first evaluates *x*; if *x* is false, its value " "is returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1793 +#: ../../reference/expressions.rst:1794 msgid "" "The expression ``x or y`` first evaluates *x*; if *x* is true, its value is " "returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1796 +#: ../../reference/expressions.rst:1797 msgid "" "Note that neither :keyword:`and` nor :keyword:`or` restrict the value and " "type they return to ``False`` and ``True``, but rather return the last " @@ -2022,11 +2024,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1815 +#: ../../reference/expressions.rst:1816 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1820 +#: ../../reference/expressions.rst:1821 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -2034,11 +2036,11 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1825 +#: ../../reference/expressions.rst:1826 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1827 +#: ../../reference/expressions.rst:1828 msgid "" "if matching := pattern.search(data):\n" " do_something(matching)" @@ -2046,11 +2048,11 @@ msgstr "" "if matching := pattern.search(data):\n" " do_something(matching)" -#: ../../reference/expressions.rst:1832 +#: ../../reference/expressions.rst:1833 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1834 +#: ../../reference/expressions.rst:1835 msgid "" "while chunk := file.read(9000):\n" " process(chunk)" @@ -2058,7 +2060,7 @@ msgstr "" "while chunk := file.read(9000):\n" " process(chunk)" -#: ../../reference/expressions.rst:1839 +#: ../../reference/expressions.rst:1840 msgid "" "Assignment expressions must be surrounded by parentheses when used as " "expression statements and when used as sub-expressions in slicing, " @@ -2068,36 +2070,36 @@ msgid "" "and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1847 +#: ../../reference/expressions.rst:1848 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1855 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1866 +#: ../../reference/expressions.rst:1867 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1869 +#: ../../reference/expressions.rst:1870 msgid "" "The expression ``x if C else y`` first evaluates the condition, *C* rather " "than *x*. If *C* is true, *x* is evaluated and its value is returned; " "otherwise, *y* is evaluated and its value is returned." msgstr "" -#: ../../reference/expressions.rst:1873 +#: ../../reference/expressions.rst:1874 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1881 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1891 +#: ../../reference/expressions.rst:1892 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -2105,7 +2107,7 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1895 +#: ../../reference/expressions.rst:1896 msgid "" "def <lambda>(parameters):\n" " return expression" @@ -2113,25 +2115,25 @@ msgstr "" "def <lambda>(parameters):\n" " return expression" -#: ../../reference/expressions.rst:1900 +#: ../../reference/expressions.rst:1901 msgid "" "See section :ref:`function` for the syntax of parameter lists. Note that " "functions created with lambda expressions cannot contain statements or " "annotations." msgstr "" -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1909 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1924 +#: ../../reference/expressions.rst:1925 msgid "" "Except when part of a list or set display, an expression list containing at " "least one comma yields a tuple. The length of the tuple is the number of " "expressions in the list. The expressions are evaluated from left to right." msgstr "" -#: ../../reference/expressions.rst:1933 +#: ../../reference/expressions.rst:1934 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -2139,16 +2141,16 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1938 +#: ../../reference/expressions.rst:1939 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:1942 msgid "Any item in an expression list may be starred. See :pep:`646`." msgstr "" -#: ../../reference/expressions.rst:1946 +#: ../../reference/expressions.rst:1947 msgid "" "A trailing comma is required only to create a one-item tuple, such as ``1," "``; it is optional in all other cases. A single expression without a " @@ -2157,24 +2159,24 @@ msgid "" "``()``.)" msgstr "" -#: ../../reference/expressions.rst:1957 +#: ../../reference/expressions.rst:1958 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1961 +#: ../../reference/expressions.rst:1962 msgid "" "Python evaluates expressions from left to right. Notice that while " "evaluating an assignment, the right-hand side is evaluated before the left-" "hand side." msgstr "" -#: ../../reference/expressions.rst:1964 +#: ../../reference/expressions.rst:1965 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1967 +#: ../../reference/expressions.rst:1968 msgid "" "expr1, expr2, expr3, expr4\n" "(expr1, expr2, expr3, expr4)\n" @@ -2190,11 +2192,11 @@ msgstr "" "expr1(expr2, expr3, *expr4, **expr5)\n" "expr3, expr4 = expr1, expr2" -#: ../../reference/expressions.rst:1978 +#: ../../reference/expressions.rst:1979 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1983 +#: ../../reference/expressions.rst:1984 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -2204,176 +2206,176 @@ msgid "" "group from right to left)." msgstr "" -#: ../../reference/expressions.rst:1989 +#: ../../reference/expressions.rst:1990 msgid "" "Note that comparisons, membership tests, and identity tests, all have the " "same precedence and have a left-to-right chaining feature as described in " "the :ref:`comparisons` section." msgstr "" -#: ../../reference/expressions.rst:1995 +#: ../../reference/expressions.rst:1996 msgid "Operator" msgstr "運算子" -#: ../../reference/expressions.rst:1995 +#: ../../reference/expressions.rst:1996 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1997 +#: ../../reference/expressions.rst:1998 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1999 +#: ../../reference/expressions.rst:2000 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1997 +#: ../../reference/expressions.rst:1998 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:2003 +#: ../../reference/expressions.rst:2004 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:2003 +#: ../../reference/expressions.rst:2004 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:2006 +#: ../../reference/expressions.rst:2007 msgid ":keyword:`await x <await>`" msgstr ":keyword:`await x <await>`" -#: ../../reference/expressions.rst:2008 +#: ../../reference/expressions.rst:2009 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:2008 +#: ../../reference/expressions.rst:2009 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:2010 +#: ../../reference/expressions.rst:2011 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:2010 +#: ../../reference/expressions.rst:2011 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:2012 +#: ../../reference/expressions.rst:2013 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:2012 +#: ../../reference/expressions.rst:2013 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:2016 +#: ../../reference/expressions.rst:2017 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:2016 +#: ../../reference/expressions.rst:2017 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:2018 +#: ../../reference/expressions.rst:2019 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:2018 +#: ../../reference/expressions.rst:2019 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:2021 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:2021 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2023 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2023 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:2024 +#: ../../reference/expressions.rst:2025 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:2024 +#: ../../reference/expressions.rst:2025 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:2026 +#: ../../reference/expressions.rst:2027 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:2026 +#: ../../reference/expressions.rst:2027 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:2030 +#: ../../reference/expressions.rst:2031 msgid ":keyword:`not x <not>`" msgstr ":keyword:`not x <not>`" -#: ../../reference/expressions.rst:2030 +#: ../../reference/expressions.rst:2031 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:2032 +#: ../../reference/expressions.rst:2033 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:2032 +#: ../../reference/expressions.rst:2033 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:2034 +#: ../../reference/expressions.rst:2035 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:2034 +#: ../../reference/expressions.rst:2035 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:2036 +#: ../../reference/expressions.rst:2037 msgid ":keyword:`if <if_expr>` -- :keyword:`!else`" msgstr ":keyword:`if <if_expr>` -- :keyword:`!else`" -#: ../../reference/expressions.rst:2036 +#: ../../reference/expressions.rst:2037 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:2038 +#: ../../reference/expressions.rst:2039 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:2038 +#: ../../reference/expressions.rst:2039 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:2040 +#: ../../reference/expressions.rst:2041 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:2040 +#: ../../reference/expressions.rst:2041 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:2045 +#: ../../reference/expressions.rst:2046 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:2046 +#: ../../reference/expressions.rst:2047 msgid "" "While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be " "true numerically due to roundoff. For example, and assuming a platform on " @@ -2385,7 +2387,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:2055 +#: ../../reference/expressions.rst:2056 msgid "" "If x is very close to an exact integer multiple of y, it's possible for ``x//" "y`` to be one larger than ``(x-x%y)//y`` due to rounding. In such cases, " @@ -2393,7 +2395,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:2060 +#: ../../reference/expressions.rst:2061 msgid "" "The Unicode standard distinguishes between :dfn:`code points` (e.g. U+0041) " "and :dfn:`abstract characters` (e.g. \"LATIN CAPITAL LETTER A\"). While most " @@ -2407,7 +2409,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:2071 +#: ../../reference/expressions.rst:2072 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2415,13 +2417,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:2076 +#: ../../reference/expressions.rst:2077 msgid "" "To compare strings at the level of abstract characters (that is, in a way " "intuitive to humans), use :func:`unicodedata.normalize`." msgstr "" -#: ../../reference/expressions.rst:2079 +#: ../../reference/expressions.rst:2080 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2429,22 +2431,22 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:2084 +#: ../../reference/expressions.rst:2085 msgid "" "The power operator ``**`` binds less tightly than an arithmetic or bitwise " "unary operator on its right, that is, ``2**-1`` is ``0.5``." msgstr "" -#: ../../reference/expressions.rst:2087 +#: ../../reference/expressions.rst:2088 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." msgstr "" #: ../../reference/expressions.rst:8 ../../reference/expressions.rst:393 -#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1765 -#: ../../reference/expressions.rst:1805 ../../reference/expressions.rst:1856 -#: ../../reference/expressions.rst:1882 ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1766 +#: ../../reference/expressions.rst:1806 ../../reference/expressions.rst:1857 +#: ../../reference/expressions.rst:1883 ../../reference/expressions.rst:1911 msgid "expression" msgstr "" @@ -2452,8 +2454,8 @@ msgstr "" msgid "BNF" msgstr "BNF" -#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1257 -#: ../../reference/expressions.rst:1305 +#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1258 +#: ../../reference/expressions.rst:1306 msgid "arithmetic" msgstr "" @@ -2476,8 +2478,8 @@ msgstr "" #: ../../reference/expressions.rst:74 ../../reference/expressions.rst:569 #: ../../reference/expressions.rst:624 ../../reference/expressions.rst:753 #: ../../reference/expressions.rst:805 ../../reference/expressions.rst:851 -#: ../../reference/expressions.rst:1294 ../../reference/expressions.rst:1343 -#: ../../reference/expressions.rst:1439 +#: ../../reference/expressions.rst:1295 ../../reference/expressions.rst:1344 +#: ../../reference/expressions.rst:1440 msgid "exception" msgstr "" @@ -2519,9 +2521,9 @@ msgstr "type(型別)" #: ../../reference/expressions.rst:557 ../../reference/expressions.rst:743 #: ../../reference/expressions.rst:851 ../../reference/expressions.rst:880 #: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1001 -#: ../../reference/expressions.rst:1149 ../../reference/expressions.rst:1162 -#: ../../reference/expressions.rst:1176 ../../reference/expressions.rst:1183 -#: ../../reference/expressions.rst:1730 ../../reference/expressions.rst:1922 +#: ../../reference/expressions.rst:1149 ../../reference/expressions.rst:1163 +#: ../../reference/expressions.rst:1177 ../../reference/expressions.rst:1184 +#: ../../reference/expressions.rst:1731 ../../reference/expressions.rst:1923 msgid "object" msgstr "object(物件)" @@ -2543,18 +2545,18 @@ msgid "empty" msgstr "" #: ../../reference/expressions.rst:175 ../../reference/expressions.rst:880 -#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1922 +#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1923 msgid "tuple" msgstr "" -#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1944 +#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1945 msgid "comma" msgstr "" #: ../../reference/expressions.rst:181 ../../reference/expressions.rst:275 #: ../../reference/expressions.rst:301 ../../reference/expressions.rst:329 #: ../../reference/expressions.rst:951 ../../reference/expressions.rst:1001 -#: ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:1911 msgid ", (comma)" msgstr ", (逗號)" @@ -2571,7 +2573,7 @@ msgstr "for" msgid "in comprehensions" msgstr "於 comprehensions(綜合運算)" -#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1857 msgid "if" msgstr "if" @@ -2579,13 +2581,13 @@ msgstr "if" msgid "async for" msgstr "async for" -#: ../../reference/expressions.rst:241 ../../reference/expressions.rst:1201 +#: ../../reference/expressions.rst:241 ../../reference/expressions.rst:1202 msgid "await" msgstr "await" #: ../../reference/expressions.rst:275 ../../reference/expressions.rst:851 #: ../../reference/expressions.rst:880 ../../reference/expressions.rst:957 -#: ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:1911 msgid "list" msgstr "list(串列)" @@ -2603,7 +2605,7 @@ msgid "list expression" msgstr "list expression(串列運算式)" #: ../../reference/expressions.rst:275 ../../reference/expressions.rst:301 -#: ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:1911 msgid "expression list" msgstr "expression list(運算式串列)" @@ -2641,7 +2643,7 @@ msgid "dictionary expression" msgstr "dictionary expression(字典運算式)" #: ../../reference/expressions.rst:329 ../../reference/expressions.rst:951 -#: ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1883 msgid ": (colon)" msgstr ": (冒號)" @@ -2654,12 +2656,12 @@ msgid "in dictionary displays" msgstr "於字典顯示" #: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1084 -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1930 msgid "unpacking" msgstr "unpacking(解包)" #: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1114 -#: ../../reference/expressions.rst:1221 +#: ../../reference/expressions.rst:1222 msgid "**" msgstr "**" @@ -2676,7 +2678,7 @@ msgstr "generator(產生器)" msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1201 +#: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1202 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2689,7 +2691,7 @@ msgid "from" msgstr "from" #: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1149 -#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1163 ../../reference/expressions.rst:1883 msgid "function" msgstr "function (函式)" @@ -2754,7 +2756,7 @@ msgid "subscription" msgstr "subscription(下標)" #: ../../reference/expressions.rst:880 ../../reference/expressions.rst:957 -#: ../../reference/expressions.rst:1730 +#: ../../reference/expressions.rst:1731 msgid "sequence" msgstr "sequence(序列)" @@ -2800,8 +2802,8 @@ msgid "callable" msgstr "callable(可呼叫物件)" #: ../../reference/expressions.rst:1001 ../../reference/expressions.rst:1149 -#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1176 -#: ../../reference/expressions.rst:1183 ../../reference/expressions.rst:1193 +#: ../../reference/expressions.rst:1163 ../../reference/expressions.rst:1177 +#: ../../reference/expressions.rst:1184 ../../reference/expressions.rst:1194 msgid "call" msgstr "call(呼叫)" @@ -2830,8 +2832,8 @@ msgstr "於函式呼叫中" msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/expressions.rst:1084 ../../reference/expressions.rst:1318 -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1084 ../../reference/expressions.rst:1319 +#: ../../reference/expressions.rst:1930 msgid "* (asterisk)" msgstr "* (星號)" @@ -2843,366 +2845,366 @@ msgstr "user-defined(使用者定義)" msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/expressions.rst:1162 +#: ../../reference/expressions.rst:1163 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../reference/expressions.rst:1162 +#: ../../reference/expressions.rst:1163 msgid "method" msgstr "method(方法)" -#: ../../reference/expressions.rst:1162 +#: ../../reference/expressions.rst:1163 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/expressions.rst:1176 +#: ../../reference/expressions.rst:1177 msgid "class" msgstr "class(類別)" -#: ../../reference/expressions.rst:1176 +#: ../../reference/expressions.rst:1177 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/expressions.rst:1183 +#: ../../reference/expressions.rst:1184 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/expressions.rst:1183 ../../reference/expressions.rst:1193 +#: ../../reference/expressions.rst:1184 ../../reference/expressions.rst:1194 msgid "instance" msgstr "instance(實例)" -#: ../../reference/expressions.rst:1193 +#: ../../reference/expressions.rst:1194 msgid "__call__() (object method)" msgstr "__call__() (物件方法)" -#: ../../reference/expressions.rst:1221 +#: ../../reference/expressions.rst:1222 msgid "power" msgstr "power(次方)" -#: ../../reference/expressions.rst:1221 ../../reference/expressions.rst:1257 -#: ../../reference/expressions.rst:1305 ../../reference/expressions.rst:1421 -#: ../../reference/expressions.rst:1450 ../../reference/expressions.rst:1765 +#: ../../reference/expressions.rst:1222 ../../reference/expressions.rst:1258 +#: ../../reference/expressions.rst:1306 ../../reference/expressions.rst:1422 +#: ../../reference/expressions.rst:1451 ../../reference/expressions.rst:1766 msgid "operation" msgstr "operation(操作)" -#: ../../reference/expressions.rst:1221 ../../reference/expressions.rst:1266 -#: ../../reference/expressions.rst:1275 ../../reference/expressions.rst:1283 -#: ../../reference/expressions.rst:1318 ../../reference/expressions.rst:1331 -#: ../../reference/expressions.rst:1343 ../../reference/expressions.rst:1361 -#: ../../reference/expressions.rst:1391 ../../reference/expressions.rst:1404 -#: ../../reference/expressions.rst:1421 ../../reference/expressions.rst:1459 -#: ../../reference/expressions.rst:1467 ../../reference/expressions.rst:1476 -#: ../../reference/expressions.rst:1491 ../../reference/expressions.rst:1730 -#: ../../reference/expressions.rst:1739 ../../reference/expressions.rst:1781 -#: ../../reference/expressions.rst:1786 ../../reference/expressions.rst:1791 -#: ../../reference/expressions.rst:1856 ../../reference/expressions.rst:1980 +#: ../../reference/expressions.rst:1222 ../../reference/expressions.rst:1267 +#: ../../reference/expressions.rst:1276 ../../reference/expressions.rst:1284 +#: ../../reference/expressions.rst:1319 ../../reference/expressions.rst:1332 +#: ../../reference/expressions.rst:1344 ../../reference/expressions.rst:1362 +#: ../../reference/expressions.rst:1392 ../../reference/expressions.rst:1405 +#: ../../reference/expressions.rst:1422 ../../reference/expressions.rst:1460 +#: ../../reference/expressions.rst:1468 ../../reference/expressions.rst:1477 +#: ../../reference/expressions.rst:1492 ../../reference/expressions.rst:1731 +#: ../../reference/expressions.rst:1740 ../../reference/expressions.rst:1782 +#: ../../reference/expressions.rst:1787 ../../reference/expressions.rst:1792 +#: ../../reference/expressions.rst:1857 ../../reference/expressions.rst:1981 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/expressions.rst:1257 +#: ../../reference/expressions.rst:1258 msgid "unary" msgstr "unary(一元)" -#: ../../reference/expressions.rst:1257 ../../reference/expressions.rst:1450 -#: ../../reference/expressions.rst:1459 ../../reference/expressions.rst:1467 -#: ../../reference/expressions.rst:1476 +#: ../../reference/expressions.rst:1258 ../../reference/expressions.rst:1451 +#: ../../reference/expressions.rst:1460 ../../reference/expressions.rst:1468 +#: ../../reference/expressions.rst:1477 msgid "bitwise" msgstr "bitwise(位元)" -#: ../../reference/expressions.rst:1266 +#: ../../reference/expressions.rst:1267 msgid "negation" msgstr "negation(否定)" -#: ../../reference/expressions.rst:1266 +#: ../../reference/expressions.rst:1267 msgid "minus" msgstr "minus(減)" -#: ../../reference/expressions.rst:1266 ../../reference/expressions.rst:1404 +#: ../../reference/expressions.rst:1267 ../../reference/expressions.rst:1405 msgid "- (minus)" msgstr "- (減號)" -#: ../../reference/expressions.rst:1266 ../../reference/expressions.rst:1275 +#: ../../reference/expressions.rst:1267 ../../reference/expressions.rst:1276 msgid "unary operator" msgstr "unary operator(一元運算子)" -#: ../../reference/expressions.rst:1275 +#: ../../reference/expressions.rst:1276 msgid "plus" msgstr "plus(加)" -#: ../../reference/expressions.rst:1275 ../../reference/expressions.rst:1391 +#: ../../reference/expressions.rst:1276 ../../reference/expressions.rst:1392 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../reference/expressions.rst:1283 +#: ../../reference/expressions.rst:1284 msgid "inversion" msgstr "inversion(反轉)" -#: ../../reference/expressions.rst:1283 +#: ../../reference/expressions.rst:1284 msgid "~ (tilde)" msgstr "~ (波浪號)" -#: ../../reference/expressions.rst:1294 +#: ../../reference/expressions.rst:1295 msgid "TypeError" msgstr "TypeError" -#: ../../reference/expressions.rst:1305 ../../reference/expressions.rst:1450 +#: ../../reference/expressions.rst:1306 ../../reference/expressions.rst:1451 msgid "binary" msgstr "binary(二進位)" -#: ../../reference/expressions.rst:1318 +#: ../../reference/expressions.rst:1319 msgid "multiplication" msgstr "multiplication(乘)" -#: ../../reference/expressions.rst:1331 +#: ../../reference/expressions.rst:1332 msgid "matrix multiplication" msgstr "matrix multiplication(矩陣乘法)" -#: ../../reference/expressions.rst:1331 +#: ../../reference/expressions.rst:1332 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/expressions.rst:1343 +#: ../../reference/expressions.rst:1344 msgid "ZeroDivisionError" msgstr "ZeroDivisionError" -#: ../../reference/expressions.rst:1343 +#: ../../reference/expressions.rst:1344 msgid "division" msgstr "division(除)" -#: ../../reference/expressions.rst:1343 +#: ../../reference/expressions.rst:1344 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/expressions.rst:1343 +#: ../../reference/expressions.rst:1344 msgid "//" msgstr "//" -#: ../../reference/expressions.rst:1361 +#: ../../reference/expressions.rst:1362 msgid "modulo" msgstr "modulo(餘數)" -#: ../../reference/expressions.rst:1361 +#: ../../reference/expressions.rst:1362 msgid "% (percent)" msgstr "% (百分號)" -#: ../../reference/expressions.rst:1391 +#: ../../reference/expressions.rst:1392 msgid "addition" msgstr "addition(加)" -#: ../../reference/expressions.rst:1391 ../../reference/expressions.rst:1404 +#: ../../reference/expressions.rst:1392 ../../reference/expressions.rst:1405 msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../reference/expressions.rst:1404 +#: ../../reference/expressions.rst:1405 msgid "subtraction" msgstr "subtraction(減)" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "shifting" msgstr "shifting(移動)" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid "<<" msgstr "<<" -#: ../../reference/expressions.rst:1421 +#: ../../reference/expressions.rst:1422 msgid ">>" msgstr ">>" -#: ../../reference/expressions.rst:1439 +#: ../../reference/expressions.rst:1440 msgid "ValueError" msgstr "ValueError" -#: ../../reference/expressions.rst:1459 ../../reference/expressions.rst:1786 +#: ../../reference/expressions.rst:1460 ../../reference/expressions.rst:1787 msgid "and" msgstr "and" -#: ../../reference/expressions.rst:1459 +#: ../../reference/expressions.rst:1460 msgid "& (ampersand)" msgstr "& (和號)" -#: ../../reference/expressions.rst:1467 +#: ../../reference/expressions.rst:1468 msgid "xor" msgstr "xor" -#: ../../reference/expressions.rst:1467 +#: ../../reference/expressions.rst:1468 msgid "exclusive" msgstr "exclusive(排外)" -#: ../../reference/expressions.rst:1467 ../../reference/expressions.rst:1476 -#: ../../reference/expressions.rst:1791 +#: ../../reference/expressions.rst:1468 ../../reference/expressions.rst:1477 +#: ../../reference/expressions.rst:1792 msgid "or" msgstr "or" -#: ../../reference/expressions.rst:1467 +#: ../../reference/expressions.rst:1468 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../reference/expressions.rst:1476 +#: ../../reference/expressions.rst:1477 msgid "inclusive" msgstr "inclusive(包含)" -#: ../../reference/expressions.rst:1476 +#: ../../reference/expressions.rst:1477 msgid "| (vertical bar)" msgstr "| (垂直線)" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "comparison" msgstr "comparison(比較)" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "C" msgstr "C" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "language" msgstr "language(語言)" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "< (less)" msgstr "< (小於)" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "> (greater)" msgstr "> (大於)" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "<=" msgstr "<=" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid ">=" msgstr ">=" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "==" msgstr "==" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1492 msgid "!=" msgstr "!=" -#: ../../reference/expressions.rst:1515 +#: ../../reference/expressions.rst:1516 msgid "chaining" msgstr "chaining(鏈接)" -#: ../../reference/expressions.rst:1515 +#: ../../reference/expressions.rst:1516 msgid "comparisons" msgstr "comparisons(比較)" -#: ../../reference/expressions.rst:1730 +#: ../../reference/expressions.rst:1731 msgid "in" msgstr "in" -#: ../../reference/expressions.rst:1730 +#: ../../reference/expressions.rst:1731 msgid "not in" msgstr "not in" -#: ../../reference/expressions.rst:1730 +#: ../../reference/expressions.rst:1731 msgid "membership" msgstr "membership(成員)" -#: ../../reference/expressions.rst:1730 ../../reference/expressions.rst:1739 +#: ../../reference/expressions.rst:1731 ../../reference/expressions.rst:1740 msgid "test" msgstr "test(測試)" -#: ../../reference/expressions.rst:1739 +#: ../../reference/expressions.rst:1740 msgid "is" msgstr "is" -#: ../../reference/expressions.rst:1739 +#: ../../reference/expressions.rst:1740 msgid "is not" msgstr "is not" -#: ../../reference/expressions.rst:1739 +#: ../../reference/expressions.rst:1740 msgid "identity" msgstr "identity" -#: ../../reference/expressions.rst:1765 +#: ../../reference/expressions.rst:1766 msgid "Conditional" msgstr "Conditional(條件式)" -#: ../../reference/expressions.rst:1765 +#: ../../reference/expressions.rst:1766 msgid "Boolean" msgstr "Boolean(布林)" -#: ../../reference/expressions.rst:1781 +#: ../../reference/expressions.rst:1782 msgid "not" msgstr "not" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1806 msgid ":= (colon equals)" msgstr ":= (冒號等於)" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1806 msgid "assignment expression" msgstr "assignment expression(賦值運算式)" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1806 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1806 msgid "named expression" msgstr "named expression(附名運算式)" -#: ../../reference/expressions.rst:1805 +#: ../../reference/expressions.rst:1806 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:1857 msgid "conditional" msgstr "conditional(條件式)" -#: ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:1857 msgid "ternary" msgstr "ternary(三元)" -#: ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:1857 msgid "conditional expression" msgstr "conditional expression(條件運算式)" -#: ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:1857 msgid "else" msgstr "else" -#: ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1883 msgid "lambda" msgstr "lambda" -#: ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1883 msgid "form" msgstr "form" -#: ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1883 msgid "anonymous" msgstr "anonymous(匿名)" -#: ../../reference/expressions.rst:1882 +#: ../../reference/expressions.rst:1883 msgid "lambda expression" msgstr "lambda expression(lambda 運算式)" -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1930 msgid "iterable" msgstr "iterable(可疊代)" -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1930 msgid "in expression lists" msgstr "於 expression list(運算式串列)" -#: ../../reference/expressions.rst:1944 +#: ../../reference/expressions.rst:1945 msgid "trailing" msgstr "trailing" -#: ../../reference/expressions.rst:1959 +#: ../../reference/expressions.rst:1960 msgid "evaluation" msgstr "evaluation" -#: ../../reference/expressions.rst:1959 +#: ../../reference/expressions.rst:1960 msgid "order" msgstr "order(順序)" -#: ../../reference/expressions.rst:1980 +#: ../../reference/expressions.rst:1981 msgid "precedence" msgstr "precedence(優先順序)" diff --git a/reference/import.po b/reference/import.po index b78211cdd6..54ab4c6fff 100644 --- a/reference/import.po +++ b/reference/import.po @@ -956,8 +956,8 @@ msgid "" msgstr "" "鑑於 Python 相似的名稱繫結規則,這可能看起來有些出人意料,但這實際上是引入系" "統的一個基本特性。不變的是如果你擁有 ``sys.modules['spam']`` 和 ``sys." -"modules['spam.foo']``(就像上述引入後那樣),那麼後者必須作為前者的 ``foo`` " -"屬性出現。" +"modules['spam.foo']``\\ (就像上述引入後那樣),那麼後者必須作為前者的 " +"``foo`` 屬性出現。" #: ../../reference/import.rst:519 msgid "Module specs" diff --git a/tutorial/errors.po b/tutorial/errors.po index 37d81af4bb..bd14d08027 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-27 00:14+0000\n" +"POT-Creation-Date: 2024-11-26 00:14+0000\n" "PO-Revision-Date: 2022-10-24 14:54+0800\n" "Last-Translator: Steven Hsu <hsuhaochun@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -63,17 +63,17 @@ msgstr "" #: ../../tutorial/errors.rst:26 msgid "" -"The parser repeats the offending line and displays little 'arrow's pointing " -"at the token in the line where the error was detected. The error may be " -"caused by the absence of a token *before* the indicated token. In the " -"example, the error is detected at the function :func:`print`, since a colon " -"(``':'``) is missing before it. File name and line number are printed so " -"you know where to look in case the input came from a script." +"The parser repeats the offending line and displays little arrows pointing at " +"the token in the line where the error was detected. The error may be caused " +"by the absence of a token *before* the indicated token. In the example, the " +"error is detected at the function :func:`print`, since a colon (``':'``) is " +"missing before it. File name and line number are printed so you know where " +"to look in case the input came from a script." msgstr "" -"剖析器 (parser) 會重複犯錯的那一行,並用一個小「箭頭」指向該行檢測到的第一個" -"錯誤點。錯誤是由箭頭\\ *之前*\\ 的標記 (token) 導致的。此例中,錯誤是在 :" -"func:`print` 函式中被檢測到,因為在它前面少了一個冒號 (``':'``)。檔案名稱和列" -"號會被印出來,所以如果訊息是來自腳本時,就可以知道去哪裡找問題。" +"剖析器 (parser) 會重複犯錯的那一行,並用一個小箭頭指向該行檢測到的第一個錯誤" +"點。錯誤是由箭頭\\ *之前*\\ 的標記 (token) 導致的。此例中,錯誤是在 :func:" +"`print` 函式中被檢測到,因為在它前面少了一個冒號 (``':'``)。檔案名稱和列號會" +"被印出來,所以如果訊息是來自腳本時,就可以知道去哪裡找問題。" #: ../../tutorial/errors.rst:37 msgid "Exceptions" @@ -273,7 +273,6 @@ msgstr "" "... pass" #: ../../tutorial/errors.rst:128 -#, fuzzy msgid "" "A class in an :keyword:`except` clause matches exceptions which are " "instances of the class itself or one of its derived classes (but not the " @@ -281,10 +280,9 @@ msgid "" "match instances of its base classes). For example, the following code will " "print B, C, D in that order::" msgstr "" -"一個在 :keyword:`except` 子句中的 class(類別)和一個例外是可相容的,只要它與" -"例外是同一個 class 或是為其 base class(基底類別);反之則無法成立——列出 " -"derived class (衍生類別)的 *except 子句*\\ 並不能與 base class 相容。例如," -"以下程式碼會依序印出 B、C、D: ::" +":keyword:`except` 子句中的一個類別符合該類別本身或它的衍生類別的例外(但不是" +"反過來 -- 列出一個衍生類別的 *except 子句*\\ 不會符合它的基底類別的例外)。例" +"如,以下程式碼會按照 B、C、D 的順序印出: ::" #: ../../tutorial/errors.rst:133 msgid "" diff --git a/using/android.po b/using/android.po index dbb98acccb..24f937b566 100644 --- a/using/android.po +++ b/using/android.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. @@ -11,7 +10,8 @@ msgstr "" "POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,7 +19,7 @@ msgstr "" #: ../../using/android.rst:5 msgid "Using Python on Android" -msgstr "" +msgstr "在 Android 上使用 Python" #: ../../using/android.rst:7 msgid "" @@ -56,7 +56,7 @@ msgstr "" #: ../../using/android.rst:28 msgid "Adding Python to an Android app" -msgstr "" +msgstr "將 Python 加入 Android 應用程式" #: ../../using/android.rst:30 msgid "" @@ -68,24 +68,25 @@ msgstr "" #: ../../using/android.rst:34 msgid "" "`Briefcase <https://briefcase.readthedocs.io>`__, from the BeeWare project" -msgstr "" +msgstr "`Briefcase <https://briefcase.readthedocs.io>`__,由 BeeWare 專案提供" #: ../../using/android.rst:35 msgid "`Buildozer <https://buildozer.readthedocs.io>`__, from the Kivy project" -msgstr "" +msgstr "`Buildozer <https://buildozer.readthedocs.io>`__,由 Kivy 專案提供" #: ../../using/android.rst:36 msgid "`Chaquopy <https://chaquo.com/chaquopy>`__" -msgstr "" +msgstr "`Chaquopy <https://chaquo.com/chaquopy>`__" #: ../../using/android.rst:37 msgid "" "`pyqtdeploy <https://www.riverbankcomputing.com/static/Docs/pyqtdeploy/>`__" msgstr "" +"`pyqtdeploy <https://www.riverbankcomputing.com/static/Docs/pyqtdeploy/>`__" #: ../../using/android.rst:38 msgid "`Termux <https://termux.dev/en/>`__" -msgstr "" +msgstr "`Termux <https://termux.dev/en/>`__" #: ../../using/android.rst:40 msgid "" @@ -116,7 +117,7 @@ msgstr "``libpython*.*.so``" #: ../../using/android.rst:53 msgid "``lib*_python.so`` (external libraries such as OpenSSL)" -msgstr "" +msgstr "``lib*_python.so``\\ (外部函式庫,例如 OpenSSL)" #: ../../using/android.rst:55 msgid "In your assets:" @@ -124,11 +125,11 @@ msgstr "" #: ../../using/android.rst:57 msgid "``python*.*`` (the Python standard library)" -msgstr "" +msgstr "``python*.*``\\ (Python 標準函式庫)" #: ../../using/android.rst:58 msgid "``python*.*/site-packages`` (your own Python code)" -msgstr "" +msgstr "``python*.*/site-packages``\\ (你自己的 Python 程式碼)" #: ../../using/android.rst:60 msgid "" diff --git a/using/configure.po b/using/configure.po index 080a472bd9..caaba60971 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-15 00:14+0000\n" +"POT-Creation-Date: 2024-11-13 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -379,7 +379,7 @@ msgid "" "cleared." msgstr "" -#: ../../using/configure.rst:236 ../../using/configure.rst:708 +#: ../../using/configure.rst:236 ../../using/configure.rst:721 msgid "Effects:" msgstr "效果:" @@ -555,217 +555,247 @@ msgid "See :ref:`whatsnew313-free-threaded-cpython` for more detail." msgstr "" #: ../../using/configure.rst:308 -msgid "Path to ``pkg-config`` utility." +msgid "" +"Indicate how to integrate the :ref:`JIT compiler <whatsnew313-jit-compiler>`." +msgstr "" + +#: ../../using/configure.rst:310 +msgid "``no`` - build the interpreter without the JIT." +msgstr "" + +#: ../../using/configure.rst:311 +msgid "``yes`` - build the interpreter with the JIT." +msgstr "" + +#: ../../using/configure.rst:312 +msgid "" +"``yes-off`` - build the interpreter with the JIT but disable it by default." msgstr "" #: ../../using/configure.rst:313 +msgid "" +"``interpreter`` - build the interpreter without the JIT, but with the tier 2 " +"enabled interpreter." +msgstr "" + +#: ../../using/configure.rst:315 +msgid "" +"By convention, ``--enable-experimental-jit`` is a shorthand for ``--enable-" +"experimental-jit=yes``." +msgstr "" + +#: ../../using/configure.rst:321 +msgid "Path to ``pkg-config`` utility." +msgstr "" + +#: ../../using/configure.rst:326 #, fuzzy msgid "``pkg-config`` options." msgstr "設定選項" -#: ../../using/configure.rst:317 +#: ../../using/configure.rst:330 #, fuzzy msgid "C compiler options" msgstr "C 編譯器指令。" -#: ../../using/configure.rst:321 ../../using/configure.rst:1228 +#: ../../using/configure.rst:334 ../../using/configure.rst:1241 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:325 ../../using/configure.rst:1240 +#: ../../using/configure.rst:338 ../../using/configure.rst:1253 msgid "C compiler flags." msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:329 +#: ../../using/configure.rst:342 #, fuzzy msgid "C preprocessor command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:333 +#: ../../using/configure.rst:346 msgid "C preprocessor flags, e.g. :samp:`-I{include_dir}`." msgstr "" -#: ../../using/configure.rst:337 ../../using/configure.rst:779 +#: ../../using/configure.rst:350 ../../using/configure.rst:792 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:341 +#: ../../using/configure.rst:354 msgid "Linker flags, e.g. :samp:`-L{library_directory}`." msgstr "" -#: ../../using/configure.rst:345 +#: ../../using/configure.rst:358 msgid "Libraries to pass to the linker, e.g. :samp:`-l{library}`." msgstr "" -#: ../../using/configure.rst:349 +#: ../../using/configure.rst:362 msgid "Name for machine-dependent library files." msgstr "" -#: ../../using/configure.rst:353 +#: ../../using/configure.rst:366 msgid "Options for third-party dependencies" msgstr "" -#: ../../using/configure.rst:360 +#: ../../using/configure.rst:373 msgid "" "C compiler and linker flags to link Python to ``libbz2``, used by :mod:`bz2` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:366 +#: ../../using/configure.rst:379 msgid "" "C compiler and linker flags for ``libncurses`` or ``libncursesw``, used by :" "mod:`curses` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:372 +#: ../../using/configure.rst:385 msgid "C compiler and linker flags for ``gdbm``." msgstr "" -#: ../../using/configure.rst:377 +#: ../../using/configure.rst:390 msgid "" "C compiler and linker flags for ``libb2`` (:ref:`BLAKE2 <hashlib-blake2>`), " "used by :mod:`hashlib` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:383 +#: ../../using/configure.rst:396 msgid "" "C compiler and linker flags for ``libedit``, used by :mod:`readline` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:389 +#: ../../using/configure.rst:402 msgid "" "C compiler and linker flags for ``libffi``, used by :mod:`ctypes` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:395 +#: ../../using/configure.rst:408 msgid "" "C compiler and linker flags for ``libmpdec``, used by :mod:`decimal` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:400 +#: ../../using/configure.rst:413 msgid "" "These environment variables have no effect unless :option:`--with-system-" "libmpdec` is specified." msgstr "" -#: ../../using/configure.rst:406 +#: ../../using/configure.rst:419 msgid "" "C compiler and linker flags for ``liblzma``, used by :mod:`lzma` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:412 +#: ../../using/configure.rst:425 msgid "" "C compiler and linker flags for ``libreadline``, used by :mod:`readline` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:418 +#: ../../using/configure.rst:431 msgid "" "C compiler and linker flags for ``libsqlite3``, used by :mod:`sqlite3` " "module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:424 +#: ../../using/configure.rst:437 msgid "" "C compiler and linker flags for ``libuuid``, used by :mod:`uuid` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:430 +#: ../../using/configure.rst:443 msgid "C compiler and linker flags for PANEL, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:432 +#: ../../using/configure.rst:445 msgid "" "C compiler and linker flags for ``libpanel`` or ``libpanelw``, used by :mod:" "`curses.panel` module, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:438 +#: ../../using/configure.rst:451 msgid "C compiler and linker flags for TCLTK, overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:443 +#: ../../using/configure.rst:456 msgid "" "C compiler and linker flags for ``libzlib``, used by :mod:`gzip` module, " "overriding ``pkg-config``." msgstr "" -#: ../../using/configure.rst:448 +#: ../../using/configure.rst:461 msgid "WebAssembly Options" msgstr "WebAssembly 選項" -#: ../../using/configure.rst:452 +#: ../../using/configure.rst:465 msgid "Set build flavor for ``wasm32-emscripten``." msgstr "" -#: ../../using/configure.rst:454 +#: ../../using/configure.rst:467 msgid "``browser`` (default): preload minimal stdlib, default MEMFS." msgstr "" -#: ../../using/configure.rst:455 +#: ../../using/configure.rst:468 msgid "``node``: NODERAWFS and pthread support." msgstr "``node``:對 NODERAWFS 和 pthread 支援。" -#: ../../using/configure.rst:461 +#: ../../using/configure.rst:474 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:463 +#: ../../using/configure.rst:476 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:470 +#: ../../using/configure.rst:483 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:476 +#: ../../using/configure.rst:489 msgid "Install Options" msgstr "安裝選項" -#: ../../using/configure.rst:480 +#: ../../using/configure.rst:493 msgid "" "Install architecture-independent files in PREFIX. On Unix, it defaults to :" "file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:483 +#: ../../using/configure.rst:496 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.prefix` 取得。" -#: ../../using/configure.rst:485 +#: ../../using/configure.rst:498 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:490 +#: ../../using/configure.rst:503 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:492 +#: ../../using/configure.rst:505 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "這個值可以在 runtime 使用 :data:`sys.exec_prefix` 取得" -#: ../../using/configure.rst:496 +#: ../../using/configure.rst:509 msgid "" "Don't build nor install test modules, like the :mod:`test` package or the :" "mod:`!_testcapi` extension module (built and installed by default)." msgstr "" -#: ../../using/configure.rst:503 +#: ../../using/configure.rst:516 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "選擇在 Python 安裝時執行的 :mod:`ensurepip` 命令:" -#: ../../using/configure.rst:505 +#: ../../using/configure.rst:518 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." @@ -773,45 +803,45 @@ msgstr "" "``upgrade`` (預設):執行 ``python -m ensurepip --altinstall --upgrade`` 命" "令。" -#: ../../using/configure.rst:507 +#: ../../using/configure.rst:520 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "``install``:執行 ``python -m ensurepip --altinstall`` 命令;" -#: ../../using/configure.rst:508 +#: ../../using/configure.rst:521 msgid "``no``: don't run ensurepip;" msgstr "``no``:不要執行 ensurepip;" -#: ../../using/configure.rst:514 +#: ../../using/configure.rst:527 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:516 +#: ../../using/configure.rst:529 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:522 +#: ../../using/configure.rst:535 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:525 +#: ../../using/configure.rst:538 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:528 +#: ../../using/configure.rst:541 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:534 +#: ../../using/configure.rst:547 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 " @@ -820,58 +850,58 @@ msgid "" "profile-instr-unprofiled`` to :envvar:`CFLAGS`." msgstr "" -#: ../../using/configure.rst:543 +#: ../../using/configure.rst:556 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "在 GCC 上使用 ``-fno-semantic-interposition``。" -#: ../../using/configure.rst:548 +#: ../../using/configure.rst:561 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:551 +#: ../../using/configure.rst:564 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "預設值:``-m test --pgo --timeout=$(TESTTIMEOUT)``。" -#: ../../using/configure.rst:555 +#: ../../using/configure.rst:568 msgid "Task failure is no longer ignored silently." msgstr "" -#: ../../using/configure.rst:560 +#: ../../using/configure.rst:573 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:562 +#: ../../using/configure.rst:575 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:567 +#: ../../using/configure.rst:580 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:570 +#: ../../using/configure.rst:583 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" -#: ../../using/configure.rst:575 +#: ../../using/configure.rst:588 msgid "" "Enable usage of the `BOLT post-link binary optimizer <https://github.com/" "llvm/llvm-project/tree/main/bolt>`_ (disabled by default)." msgstr "" -#: ../../using/configure.rst:579 +#: ../../using/configure.rst:592 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:583 +#: ../../using/configure.rst:596 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 " @@ -882,7 +912,7 @@ msgid "" "encouraged." msgstr "" -#: ../../using/configure.rst:591 +#: ../../using/configure.rst:604 msgid "" "The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" "program:`configure` variables can be defined to override the default set of " @@ -890,116 +920,116 @@ msgid "" "binaries, respectively." msgstr "" -#: ../../using/configure.rst:600 +#: ../../using/configure.rst:613 msgid "" "Arguments to ``llvm-bolt`` when creating a `BOLT optimized binary <https://" "github.com/facebookarchive/BOLT>`_." msgstr "" -#: ../../using/configure.rst:607 +#: ../../using/configure.rst:620 msgid "Arguments to ``llvm-bolt`` when instrumenting binaries." msgstr "" -#: ../../using/configure.rst:613 +#: ../../using/configure.rst:626 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:618 +#: ../../using/configure.rst:631 msgid "" "Disable the fast :ref:`mimalloc <mimalloc>` allocator (enabled by default)." msgstr "" -#: ../../using/configure.rst:621 ../../using/configure.rst:628 +#: ../../using/configure.rst:634 ../../using/configure.rst:641 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:625 +#: ../../using/configure.rst:638 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc <pymalloc>` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:632 +#: ../../using/configure.rst:645 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:635 +#: ../../using/configure.rst:648 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "不要定義 ``WITH_DOC_STRINGS`` 巨集。" -#: ../../using/configure.rst:637 +#: ../../using/configure.rst:650 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "請見 ``PyDoc_STRVAR()`` 巨集。" -#: ../../using/configure.rst:641 +#: ../../using/configure.rst:654 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:645 +#: ../../using/configure.rst:658 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" -#: ../../using/configure.rst:652 +#: ../../using/configure.rst:665 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:654 +#: ../../using/configure.rst:667 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:657 +#: ../../using/configure.rst:670 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:659 +#: ../../using/configure.rst:672 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:661 +#: ../../using/configure.rst:674 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "新增 ``d`` 到 :data:`sys.abiflags`。" -#: ../../using/configure.rst:662 +#: ../../using/configure.rst:675 msgid "Add :func:`!sys.gettotalrefcount` function." msgstr "新增 :func:`!sys.gettotalrefcount` 函式。" -#: ../../using/configure.rst:663 +#: ../../using/configure.rst:676 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" -#: ../../using/configure.rst:664 +#: ../../using/configure.rst:677 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" -#: ../../using/configure.rst:666 +#: ../../using/configure.rst:679 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:668 +#: ../../using/configure.rst:681 msgid "" "Install :ref:`debug hooks on memory allocators <default-memory-allocators>` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:670 +#: ../../using/configure.rst:683 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" -#: ../../using/configure.rst:671 +#: ../../using/configure.rst:684 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -1007,387 +1037,388 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:676 +#: ../../using/configure.rst:689 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:677 +#: ../../using/configure.rst:690 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:679 +#: ../../using/configure.rst:692 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:681 +#: ../../using/configure.rst:694 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:682 +#: ../../using/configure.rst:695 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:684 +#: ../../using/configure.rst:697 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:687 +#: ../../using/configure.rst:700 msgid "" "See also the :ref:`Python Development Mode <devmode>` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:690 +#: ../../using/configure.rst:703 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)." msgstr "" -#: ../../using/configure.rst:697 +#: ../../using/configure.rst:710 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:701 +#: ../../using/configure.rst:714 msgid "" ":ref:`Build Python in debug mode <debug-build>`: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:706 +#: ../../using/configure.rst:719 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:710 +#: ../../using/configure.rst:723 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" -#: ../../using/configure.rst:711 -msgid "Add :func:`!sys.getobjects` function." +#: ../../using/configure.rst:724 +#, fuzzy +msgid "Add :func:`sys.getobjects` function." msgstr "新增 :func:`!sys.getobjects` 函式。" -#: ../../using/configure.rst:712 +#: ../../using/configure.rst:725 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" -#: ../../using/configure.rst:714 +#: ../../using/configure.rst:727 msgid "" "The :envvar:`PYTHONDUMPREFS` environment variable can be used to dump " "objects and reference counts still alive at Python exit." msgstr "" -#: ../../using/configure.rst:717 +#: ../../using/configure.rst:730 msgid ":ref:`Statically allocated objects <static-types>` are not traced." msgstr "" -#: ../../using/configure.rst:721 +#: ../../using/configure.rst:734 msgid "" "This build is now ABI compatible with release build and :ref:`debug build " "<debug-build>`." msgstr "" -#: ../../using/configure.rst:727 +#: ../../using/configure.rst:740 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:730 +#: ../../using/configure.rst:743 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:733 +#: ../../using/configure.rst:746 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build <debug-" "build>`) which also enables assertions." msgstr "" -#: ../../using/configure.rst:740 +#: ../../using/configure.rst:753 msgid "Enable Valgrind support (default is no)." msgstr "啟用 Valgrind 支援(預設不啟用)。" -#: ../../using/configure.rst:744 +#: ../../using/configure.rst:757 msgid "Enable DTrace support (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:746 +#: ../../using/configure.rst:759 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap <instrumentation>`." msgstr "" -#: ../../using/configure.rst:753 +#: ../../using/configure.rst:766 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:759 +#: ../../using/configure.rst:772 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:765 +#: ../../using/configure.rst:778 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:772 +#: ../../using/configure.rst:785 #, fuzzy msgid "Enable ThreadSanitizer data race detector, ``tsan`` (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:783 +#: ../../using/configure.rst:796 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:787 +#: ../../using/configure.rst:800 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:794 +#: ../../using/configure.rst:807 msgid "Libraries options" msgstr "函式庫選項" -#: ../../using/configure.rst:798 +#: ../../using/configure.rst:811 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:802 +#: ../../using/configure.rst:815 msgid "" "Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:807 +#: ../../using/configure.rst:820 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdecimal`` " "library, see the :mod:`decimal` module (default is yes)." msgstr "" -#: ../../using/configure.rst:812 +#: ../../using/configure.rst:825 msgid "Default to using the installed ``mpdecimal`` library." msgstr "" -#: ../../using/configure.rst:815 +#: ../../using/configure.rst:828 msgid "" "A copy of the ``mpdecimal`` library sources will no longer be distributed " "with Python 3.15." msgstr "" -#: ../../using/configure.rst:819 +#: ../../using/configure.rst:832 msgid ":option:`LIBMPDEC_CFLAGS` and :option:`LIBMPDEC_LIBS`." msgstr "" -#: ../../using/configure.rst:823 +#: ../../using/configure.rst:836 msgid "Designate a backend library for the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:825 +#: ../../using/configure.rst:838 msgid "readline: Use readline as the backend." msgstr "" -#: ../../using/configure.rst:826 +#: ../../using/configure.rst:839 msgid "editline: Use editline as the backend." msgstr "" -#: ../../using/configure.rst:832 +#: ../../using/configure.rst:845 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" -#: ../../using/configure.rst:834 +#: ../../using/configure.rst:847 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" -#: ../../using/configure.rst:840 +#: ../../using/configure.rst:853 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:844 +#: ../../using/configure.rst:857 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:848 +#: ../../using/configure.rst:861 msgid "Root of the OpenSSL directory." msgstr "" -#: ../../using/configure.rst:854 +#: ../../using/configure.rst:867 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:856 +#: ../../using/configure.rst:869 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:857 +#: ../../using/configure.rst:870 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:859 +#: ../../using/configure.rst:872 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:865 +#: ../../using/configure.rst:878 msgid "Security Options" msgstr "" -#: ../../using/configure.rst:869 +#: ../../using/configure.rst:882 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:871 +#: ../../using/configure.rst:884 msgid "``siphash13`` (default);" msgstr "" -#: ../../using/configure.rst:872 +#: ../../using/configure.rst:885 msgid "``siphash24``;" msgstr "``siphash24``;" -#: ../../using/configure.rst:873 +#: ../../using/configure.rst:886 msgid "``fnv``." msgstr "``fnv``。" -#: ../../using/configure.rst:877 +#: ../../using/configure.rst:890 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:882 +#: ../../using/configure.rst:895 msgid "Built-in hash modules:" msgstr "內建雜湊模組:" -#: ../../using/configure.rst:884 +#: ../../using/configure.rst:897 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:885 +#: ../../using/configure.rst:898 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:886 +#: ../../using/configure.rst:899 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:887 +#: ../../using/configure.rst:900 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:888 +#: ../../using/configure.rst:901 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:889 +#: ../../using/configure.rst:902 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:895 +#: ../../using/configure.rst:908 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:897 +#: ../../using/configure.rst:910 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:898 +#: ../../using/configure.rst:911 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:899 +#: ../../using/configure.rst:912 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:901 +#: ../../using/configure.rst:914 msgid "See the :mod:`ssl` module." msgstr "請見 :mod:`ssl` 模組。" -#: ../../using/configure.rst:907 +#: ../../using/configure.rst:920 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:911 +#: ../../using/configure.rst:924 msgid "macOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:913 +#: ../../using/configure.rst:926 #, fuzzy msgid "See :source:`Mac/README.rst`." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:918 +#: ../../using/configure.rst:931 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:924 +#: ../../using/configure.rst:937 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:929 +#: ../../using/configure.rst:942 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:932 +#: ../../using/configure.rst:945 msgid "Options:" msgstr "選項:" -#: ../../using/configure.rst:934 +#: ../../using/configure.rst:947 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:935 +#: ../../using/configure.rst:948 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:936 +#: ../../using/configure.rst:949 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:937 +#: ../../using/configure.rst:950 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:938 +#: ../../using/configure.rst:951 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:939 +#: ../../using/configure.rst:952 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:940 +#: ../../using/configure.rst:953 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:941 +#: ../../using/configure.rst:954 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:945 +#: ../../using/configure.rst:958 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:951 +#: ../../using/configure.rst:964 msgid "" "The Python standard library contains strings that are known to trigger " "automated inspection tool errors when submitted for distribution by the " @@ -1396,31 +1427,31 @@ msgid "" "can also be specified. This option is disabled by default." msgstr "" -#: ../../using/configure.rst:960 +#: ../../using/configure.rst:973 #, fuzzy msgid "iOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:962 +#: ../../using/configure.rst:975 #, fuzzy msgid "See :source:`iOS/README.rst`." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:966 +#: ../../using/configure.rst:979 msgid "" "Create a Python.framework. Unlike macOS, the *INSTALLDIR* argument " "specifying the installation path is mandatory." msgstr "" -#: ../../using/configure.rst:971 +#: ../../using/configure.rst:984 msgid "Specify the name for the framework (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:975 +#: ../../using/configure.rst:988 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:977 +#: ../../using/configure.rst:990 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 " @@ -1428,28 +1459,28 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:984 +#: ../../using/configure.rst:997 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:988 +#: ../../using/configure.rst:1001 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:992 +#: ../../using/configure.rst:1005 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:998 +#: ../../using/configure.rst:1011 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:1000 +#: ../../using/configure.rst:1013 msgid "Example *config.site* file:" msgstr "" -#: ../../using/configure.rst:1002 +#: ../../using/configure.rst:1015 msgid "" "# config.site-aarch64\n" "ac_cv_buggy_getaddrinfo=no\n" @@ -1461,15 +1492,15 @@ msgstr "" "ac_cv_file__dev_ptmx=yes\n" "ac_cv_file__dev_ptc=no" -#: ../../using/configure.rst:1011 +#: ../../using/configure.rst:1024 msgid "Program to run CPython for the host platform for cross-compilation." msgstr "" -#: ../../using/configure.rst:1016 +#: ../../using/configure.rst:1029 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:1018 +#: ../../using/configure.rst:1031 msgid "" "CONFIG_SITE=config.site-aarch64 ../configure \\\n" " --build=x86_64-pc-linux-gnu \\\n" @@ -1481,64 +1512,64 @@ msgstr "" " --host=aarch64-unknown-linux-gnu \\\n" " --with-build-python=../x86_64/python" -#: ../../using/configure.rst:1025 +#: ../../using/configure.rst:1038 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:1028 +#: ../../using/configure.rst:1041 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:1030 +#: ../../using/configure.rst:1043 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:1031 +#: ../../using/configure.rst:1044 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:1032 +#: ../../using/configure.rst:1045 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:1033 +#: ../../using/configure.rst:1046 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:1037 +#: ../../using/configure.rst:1050 msgid "Main build steps" msgstr "主要建置步驟" -#: ../../using/configure.rst:1039 +#: ../../using/configure.rst:1052 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:1040 +#: ../../using/configure.rst:1053 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:1041 +#: ../../using/configure.rst:1054 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:1043 +#: ../../using/configure.rst:1056 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:1046 +#: ../../using/configure.rst:1059 msgid "Main Makefile targets" msgstr "主要 Makefile 目標" -#: ../../using/configure.rst:1049 +#: ../../using/configure.rst:1062 msgid "make" msgstr "" -#: ../../using/configure.rst:1051 +#: ../../using/configure.rst:1064 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 " @@ -1549,20 +1580,20 @@ msgid "" "all`` will build. The three choices are:" msgstr "" -#: ../../using/configure.rst:1060 +#: ../../using/configure.rst:1073 msgid "``profile-opt`` (configured with ``--enable-optimizations``)" msgstr "" -#: ../../using/configure.rst:1061 +#: ../../using/configure.rst:1074 msgid "``build_wasm`` (configured with ``--with-emscripten-target``)" msgstr "" -#: ../../using/configure.rst:1062 +#: ../../using/configure.rst:1075 msgid "" "``build_all`` (configured without explicitly using either of the others)" msgstr "" -#: ../../using/configure.rst:1064 +#: ../../using/configure.rst:1077 msgid "" "Depending on the most recent source file changes, Make will rebuild any " "targets (object files and executables) deemed out-of-date, including running " @@ -1575,11 +1606,11 @@ msgid "" "problems, at the expense of longer build times." msgstr "" -#: ../../using/configure.rst:1077 +#: ../../using/configure.rst:1090 msgid "make platform" msgstr "" -#: ../../using/configure.rst:1079 +#: ../../using/configure.rst:1092 msgid "" "Build the ``python`` program, but don't build the standard library extension " "modules. This generates a file named ``platform`` which contains a single " @@ -1587,82 +1618,82 @@ msgid "" "arm64-3.12`` or ``linux-x86_64-3.13``." msgstr "" -#: ../../using/configure.rst:1086 +#: ../../using/configure.rst:1099 msgid "make profile-opt" msgstr "" -#: ../../using/configure.rst:1088 +#: ../../using/configure.rst:1101 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:1096 +#: ../../using/configure.rst:1109 msgid "make clean" msgstr "" -#: ../../using/configure.rst:1098 +#: ../../using/configure.rst:1111 msgid "Remove built files." msgstr "" -#: ../../using/configure.rst:1102 +#: ../../using/configure.rst:1115 msgid "make distclean" msgstr "" -#: ../../using/configure.rst:1104 +#: ../../using/configure.rst:1117 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:1110 +#: ../../using/configure.rst:1123 msgid "make install" msgstr "" -#: ../../using/configure.rst:1112 +#: ../../using/configure.rst:1125 msgid "Build the ``all`` target and install Python." msgstr "" -#: ../../using/configure.rst:1116 +#: ../../using/configure.rst:1129 msgid "make test" msgstr "" -#: ../../using/configure.rst:1118 +#: ../../using/configure.rst:1131 msgid "" "Build the ``all`` target and run the Python test suite with the ``--fast-" "ci`` option. Variables:" msgstr "" -#: ../../using/configure.rst:1121 +#: ../../using/configure.rst:1134 msgid "``TESTOPTS``: additional regrtest command-line options." msgstr "" -#: ../../using/configure.rst:1122 +#: ../../using/configure.rst:1135 msgid "``TESTPYTHONOPTS``: additional Python command-line options." msgstr "" -#: ../../using/configure.rst:1123 +#: ../../using/configure.rst:1136 msgid "``TESTTIMEOUT``: timeout in seconds (default: 10 minutes)." msgstr "" -#: ../../using/configure.rst:1127 +#: ../../using/configure.rst:1140 #, fuzzy msgid "make buildbottest" msgstr "主要建置步驟" -#: ../../using/configure.rst:1129 +#: ../../using/configure.rst:1142 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:1134 +#: ../../using/configure.rst:1147 msgid "make regen-all" msgstr "" -#: ../../using/configure.rst:1136 +#: ../../using/configure.rst:1149 msgid "" "Regenerate (almost) all generated files. These include (but are not limited " "to) bytecode cases, and parser generator file. ``make regen-stdlib-module-" @@ -1670,18 +1701,18 @@ msgid "" "files <#generated-files>`_." msgstr "" -#: ../../using/configure.rst:1143 +#: ../../using/configure.rst:1156 msgid "C extensions" msgstr "C 擴充模組" -#: ../../using/configure.rst:1145 +#: ../../using/configure.rst:1158 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:1149 +#: ../../using/configure.rst:1162 msgid "" ">>> import sys\n" ">>> sys\n" @@ -1692,14 +1723,14 @@ msgid "" "AttributeError: module 'sys' has no attribute '__file__'" msgstr "" -#: ../../using/configure.rst:1159 +#: ../../using/configure.rst:1172 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:1163 +#: ../../using/configure.rst:1176 msgid "" ">>> import _asyncio\n" ">>> _asyncio\n" @@ -1715,7 +1746,7 @@ msgstr "" ">>> _asyncio.__file__\n" "'/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'" -#: ../../using/configure.rst:1171 +#: ../../using/configure.rst:1184 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-" @@ -1723,304 +1754,304 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:1175 +#: ../../using/configure.rst:1188 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:" msgstr "" -#: ../../using/configure.rst:1179 +#: ../../using/configure.rst:1192 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" -#: ../../using/configure.rst:1180 +#: ../../using/configure.rst:1193 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" -#: ../../using/configure.rst:1182 +#: ../../using/configure.rst:1195 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:1188 +#: ../../using/configure.rst:1201 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:1190 +#: ../../using/configure.rst:1203 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:1194 +#: ../../using/configure.rst:1207 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:1198 +#: ../../using/configure.rst:1211 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1204 +#: ../../using/configure.rst:1217 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:1207 ../../using/configure.rst:1397 +#: ../../using/configure.rst:1220 ../../using/configure.rst:1410 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:1217 +#: ../../using/configure.rst:1230 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1219 +#: ../../using/configure.rst:1232 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:1224 +#: ../../using/configure.rst:1237 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:1230 +#: ../../using/configure.rst:1243 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:1234 +#: ../../using/configure.rst:1247 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:1236 +#: ../../using/configure.rst:1249 msgid "Example: ``g++ -pthread``." msgstr "範例:``g++ -pthread``。" -#: ../../using/configure.rst:1244 +#: ../../using/configure.rst:1257 msgid "" ":envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C " "extensions. Use it when a compiler flag should *not* be part of :envvar:" "`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1248 +#: ../../using/configure.rst:1261 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1250 +#: ../../using/configure.rst:1263 msgid "" "the compiler flag ``-I`` (for setting the search path for include files). " "The ``-I`` flags are processed from left to right, and any flags in :envvar:" "`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." msgstr "" -#: ../../using/configure.rst:1255 +#: ../../using/configure.rst:1268 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:1263 +#: ../../using/configure.rst:1276 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:1270 +#: ../../using/configure.rst:1283 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:1274 +#: ../../using/configure.rst:1287 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1281 +#: ../../using/configure.rst:1294 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1288 +#: ../../using/configure.rst:1301 msgid "Base compiler flags." msgstr "基本編譯器旗標。" -#: ../../using/configure.rst:1292 +#: ../../using/configure.rst:1305 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:1296 +#: ../../using/configure.rst:1309 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:1302 +#: ../../using/configure.rst:1315 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:1304 +#: ../../using/configure.rst:1317 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:1308 +#: ../../using/configure.rst:1321 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1310 +#: ../../using/configure.rst:1323 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:1315 +#: ../../using/configure.rst:1328 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:1319 +#: ../../using/configure.rst:1332 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:1325 +#: ../../using/configure.rst:1338 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1327 +#: ../../using/configure.rst:1340 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:1333 +#: ../../using/configure.rst:1346 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:1339 +#: ../../using/configure.rst:1352 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:1342 +#: ../../using/configure.rst:1355 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:1348 +#: ../../using/configure.rst:1361 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:1350 +#: ../../using/configure.rst:1363 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:1354 +#: ../../using/configure.rst:1367 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:1358 +#: ../../using/configure.rst:1371 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:1360 +#: ../../using/configure.rst:1373 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:1364 +#: ../../using/configure.rst:1377 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:1366 +#: ../../using/configure.rst:1379 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:1374 +#: ../../using/configure.rst:1387 msgid "" ":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" "`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of :envvar:" "`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:1378 +#: ../../using/configure.rst:1391 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:1380 +#: ../../using/configure.rst:1393 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" -#: ../../using/configure.rst:1387 +#: ../../using/configure.rst:1400 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:1394 +#: ../../using/configure.rst:1407 msgid "" "Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " "nonstandard directory *lib_dir*." msgstr "" -#: ../../using/configure.rst:1403 +#: ../../using/configure.rst:1416 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:1406 +#: ../../using/configure.rst:1419 msgid "Example: ``-lrt``." msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:1410 +#: ../../using/configure.rst:1423 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:1412 +#: ../../using/configure.rst:1425 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:1416 +#: ../../using/configure.rst:1429 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:1418 +#: ../../using/configure.rst:1431 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:1422 +#: ../../using/configure.rst:1435 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1426 +#: ../../using/configure.rst:1439 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1432 +#: ../../using/configure.rst:1445 msgid "Linker flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:1438 +#: ../../using/configure.rst:1451 msgid "Footnotes" msgstr "註腳" -#: ../../using/configure.rst:1439 +#: ../../using/configure.rst:1452 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 080e6a1879..1f1bd2a519 100644 --- a/using/ios.po +++ b/using/ios.po @@ -10,7 +10,8 @@ msgstr "" "POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -372,6 +373,18 @@ msgid "" "\"$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" #: ../../using/ios.rst:233 msgid "" diff --git a/using/windows.po b/using/windows.po index 8ff3e1e9ed..6b1c4c3ad0 100644 --- a/using/windows.po +++ b/using/windows.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-22 00:13+0000\n" +"POT-Creation-Date: 2024-11-12 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -895,7 +895,7 @@ msgid "" "For more detail on the technical basis for these limitations, please consult " "Microsoft's documentation on packaged full-trust apps, currently available " "at `docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-" -"scenes <https://docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-" +"scenes <https://learn.microsoft.com/windows/msix/desktop/desktop-to-uwp-" "behind-the-scenes>`_" msgstr "" @@ -1027,7 +1027,7 @@ msgstr "" #: ../../using/windows.rst:537 msgid "" "The embedded distribution does not include the `Microsoft C Runtime <https://" -"docs.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist#visual-" +"learn.microsoft.com/cpp/windows/latest-supported-vc-redist#visual-" "studio-2015-2017-2019-and-2022>`_ and it is the responsibility of the " "application installer to provide this. The runtime may have already been " "installed on a user's system previously or automatically via Windows Update, " @@ -1257,11 +1257,9 @@ msgstr "" #: ../../using/windows.rst:681 msgid "" -"https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" -"variables" +"https://learn.microsoft.com/windows/win32/procthread/environment-variables" msgstr "" -"https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" -"variables" +"https://learn.microsoft.com/windows/win32/procthread/environment-variables" #: ../../using/windows.rst:682 msgid "Overview of environment variables on Windows" @@ -1269,11 +1267,11 @@ msgstr "Windows 上的環境變數概要" #: ../../using/windows.rst:684 msgid "" -"https://docs.microsoft.com/en-us/windows-server/administration/windows-" -"commands/set_1" +"https://learn.microsoft.com/windows-server/administration/windows-commands/" +"set_1" msgstr "" -"https://docs.microsoft.com/en-us/windows-server/administration/windows-" -"commands/set_1" +"https://learn.microsoft.com/windows-server/administration/windows-commands/" +"set_1" #: ../../using/windows.rst:685 msgid "The ``set`` command, for temporarily modifying environment variables" @@ -1281,11 +1279,11 @@ msgstr "" #: ../../using/windows.rst:687 msgid "" -"https://docs.microsoft.com/en-us/windows-server/administration/windows-" -"commands/setx" +"https://learn.microsoft.com/windows-server/administration/windows-commands/" +"setx" msgstr "" -"https://docs.microsoft.com/en-us/windows-server/administration/windows-" -"commands/setx" +"https://learn.microsoft.com/windows-server/administration/windows-commands/" +"setx" #: ../../using/windows.rst:688 msgid "The ``setx`` command, for permanently modifying environment variables" @@ -2270,7 +2268,7 @@ msgstr "" #: ../../using/windows.rst:1292 msgid "" -"`Component Object Model <https://docs.microsoft.com/en-us/windows/win32/com/" +"`Component Object Model <https://learn.microsoft.com/windows/win32/com/" "component-object-model--com--portal>`_ (COM)" msgstr "" @@ -2288,7 +2286,7 @@ msgstr "事件日誌(Event log)" #: ../../using/windows.rst:1298 msgid "" -"`Microsoft Foundation Classes <https://docs.microsoft.com/en-us/cpp/mfc/mfc-" +"`Microsoft Foundation Classes <https://learn.microsoft.com/cpp/mfc/mfc-" "desktop-applications>`_ (MFC) user interfaces" msgstr "" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 5a4af094ce..b0f93a3c71 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-10 17:21+0000\n" +"POT-Creation-Date: 2024-11-18 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -265,7 +265,7 @@ msgstr "" "`unittest.TestCase` 的\\ `方法別名 <unittest-TestCase-removed-aliases_>`_\\ " "已被刪除。" -#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1826 +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1832 msgid "New Features" msgstr "新增功能" @@ -1251,7 +1251,7 @@ msgid "" "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1530 +#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1536 msgid "sqlite3" msgstr "sqlite3" @@ -1326,7 +1326,7 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1725 +#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1731 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 " @@ -1498,7 +1498,7 @@ msgid "" "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1576 msgid "unittest" msgstr "unittest" @@ -1706,7 +1706,7 @@ msgid "" "demos>`_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2128 +#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2134 msgid "Deprecated" msgstr "已棄用" @@ -1906,6 +1906,9 @@ msgid "" "are deprecated and will be removed in Python 3.14; use :func:`importlib.util." "find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" +":mod:`pkgutil`::func:`pkgutil.find_loader` 和 :func:`pkgutil.get_loader` 已" +"被棄用並將在 Python 3.14 中移除;請改用 :func:`importlib.util.find_spec`。" +"(由 Nikita Sobolev 於 :gh:`97850` 中貢獻。)" #: ../../whatsnew/3.12.rst:1237 msgid "" @@ -1986,6 +1989,9 @@ msgid "" "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" +":mod:`sys`::data:`sys.last_type`、:data:`sys.last_value` 和 :data:`sys." +"last_traceback` 欄位已被棄用。請改用 :data:`sys.last_exc`。(由 Irit Katriel " +"於 :gh:`102778` 中貢獻。)" #: ../../whatsnew/3.12.rst:1286 msgid "" @@ -2587,6 +2593,9 @@ msgid "" "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 #: ../../deprecations/pending-removal-in-future.rst:12 @@ -3063,32 +3072,32 @@ msgstr "" ":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport." "zipimporter.exec_module`。" -#: ../../whatsnew/3.12.rst:1345 ../../whatsnew/3.12.rst:2223 +#: ../../whatsnew/3.12.rst:1347 ../../whatsnew/3.12.rst:2229 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1348 +#: ../../whatsnew/3.12.rst:1350 msgid "asynchat and asyncore" msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1352 msgid "" "These two modules have been removed according to the schedule in :pep:`594`, " "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1357 +#: ../../whatsnew/3.12.rst:1359 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.12.rst:1359 +#: ../../whatsnew/3.12.rst:1361 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1362 +#: ../../whatsnew/3.12.rst:1364 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." @@ -3096,23 +3105,23 @@ msgstr "" ":class:`configparser.ParsingError` 不再具有 ``filename`` 屬性或引數。請改用 " "``source`` 屬性和引數。" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1366 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1368 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1374 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.12.rst:1372 +#: ../../whatsnew/3.12.rst:1376 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -3121,17 +3130,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1379 +#: ../../whatsnew/3.12.rst:1383 msgid "ensurepip" msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1385 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1388 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -3139,7 +3148,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1394 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -3149,25 +3158,25 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1401 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1404 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1406 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1407 +#: ../../whatsnew/3.12.rst:1411 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1409 +#: ../../whatsnew/3.12.rst:1413 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" @@ -3175,11 +3184,11 @@ msgstr "" "移除 :mod:`ftplib` 的 ``FTP_TLS.ssl_version`` 類別屬性:請改用 *context* 參" "數。(由 Victor Stinner 於 :gh:`94172` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1414 +#: ../../whatsnew/3.12.rst:1418 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.12.rst:1416 +#: ../../whatsnew/3.12.rst:1420 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -3188,11 +3197,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1423 +#: ../../whatsnew/3.12.rst:1427 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1425 +#: ../../whatsnew/3.12.rst:1429 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 " @@ -3201,17 +3210,17 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1432 ../../whatsnew/3.12.rst:1459 +#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1465 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1438 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "現已完成清理 :mod:`importlib` 中許多過去已經棄用的東西:" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1441 msgid "" "References to, and support for :meth:`!module_repr` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" @@ -3219,134 +3228,134 @@ msgstr "" "對 :meth:`!module_repr` 的參照和支援已刪除。(由 Barry Warsaw 在 :gh:`97850` " "中貢獻。)" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1444 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1448 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1447 +#: ../../whatsnew/3.12.rst:1451 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1451 ../../whatsnew/3.12.rst:1459 +#: ../../whatsnew/3.12.rst:1457 ../../whatsnew/3.12.rst:1465 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1453 +#: ../../whatsnew/3.12.rst:1459 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1456 +#: ../../whatsnew/3.12.rst:1462 msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:1467 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:1467 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "將 ``None`` 插入 ``sys.path_importer_cache``" -#: ../../whatsnew/3.12.rst:1462 +#: ../../whatsnew/3.12.rst:1468 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1462 +#: ../../whatsnew/3.12.rst:1468 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1469 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1469 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1470 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1470 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1471 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1471 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1472 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1472 msgid ":attr:`sys.implementation.cache_tag <sys.implementation>`" msgstr ":attr:`sys.implementation.cache_tag <sys.implementation>`" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1473 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1473 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1474 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1474 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1475 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1475 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1476 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1476 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1471 +#: ../../whatsnew/3.12.rst:1477 msgid "``imp.load_source()``" msgstr "``imp.load_source()``" -#: ../../whatsnew/3.12.rst:1471 +#: ../../whatsnew/3.12.rst:1477 msgid "*See below*" msgstr "*見下文*" -#: ../../whatsnew/3.12.rst:1474 +#: ../../whatsnew/3.12.rst:1480 msgid "Replace ``imp.load_source()`` with::" msgstr "用以下取代 ``imp.load_source()``: ::" -#: ../../whatsnew/3.12.rst:1476 +#: ../../whatsnew/3.12.rst:1482 msgid "" "import importlib.util\n" "import importlib.machinery\n" @@ -3363,37 +3372,37 @@ msgid "" " return module" msgstr "" -#: ../../whatsnew/3.12.rst:1489 +#: ../../whatsnew/3.12.rst:1495 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "移除 :mod:`!imp` 函式和屬性、沒有替代方案:" -#: ../../whatsnew/3.12.rst:1491 +#: ../../whatsnew/3.12.rst:1497 msgid "Undocumented functions:" msgstr "未以文件記錄的函式:" -#: ../../whatsnew/3.12.rst:1493 +#: ../../whatsnew/3.12.rst:1499 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1494 +#: ../../whatsnew/3.12.rst:1500 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1495 +#: ../../whatsnew/3.12.rst:1501 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1496 +#: ../../whatsnew/3.12.rst:1502 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1498 +#: ../../whatsnew/3.12.rst:1504 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:1500 +#: ../../whatsnew/3.12.rst:1506 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " @@ -3403,11 +3412,11 @@ msgstr "" "``PY_COMPILED``、``C_EXTENSION``、``PY_RESOURCE``、``PKG_DIRECTORY``、" "``C_BUILTIN``、``PY_FROZEN``、``PY_CODERESOURCE``、``IMP_HOOK``。" -#: ../../whatsnew/3.12.rst:1505 +#: ../../whatsnew/3.12.rst:1511 msgid "io" msgstr "io" -#: ../../whatsnew/3.12.rst:1507 +#: ../../whatsnew/3.12.rst:1513 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." @@ -3416,22 +3425,22 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1520 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.12.rst:1516 +#: ../../whatsnew/3.12.rst:1522 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:1521 +#: ../../whatsnew/3.12.rst:1527 msgid "smtpd" msgstr "smtpd" -#: ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1529 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:" @@ -3439,27 +3448,27 @@ msgid "" "(Contributed by Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1532 +#: ../../whatsnew/3.12.rst:1538 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1535 +#: ../../whatsnew/3.12.rst:1541 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1536 +#: ../../whatsnew/3.12.rst:1542 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1538 +#: ../../whatsnew/3.12.rst:1544 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:1541 +#: ../../whatsnew/3.12.rst:1547 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 " @@ -3467,22 +3476,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1546 +#: ../../whatsnew/3.12.rst:1552 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1549 +#: ../../whatsnew/3.12.rst:1555 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1557 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:1555 +#: ../../whatsnew/3.12.rst:1561 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 " @@ -3490,7 +3499,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1561 +#: ../../whatsnew/3.12.rst:1567 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." @@ -3501,189 +3510,189 @@ msgid "" "`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1572 +#: ../../whatsnew/3.12.rst:1578 msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "移除許多 :mod:`unittest` 中被棄用已久的功能:" -#: ../../whatsnew/3.12.rst:1576 +#: ../../whatsnew/3.12.rst:1582 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "許多 :class:`~unittest.TestCase` 方法別名:" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1585 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1585 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1585 msgid "Deprecated in" msgstr "已棄用於" -#: ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1587 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1581 ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1587 ../../whatsnew/3.12.rst:1594 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1581 ../../whatsnew/3.12.rst:1582 -#: ../../whatsnew/3.12.rst:1583 ../../whatsnew/3.12.rst:1584 -#: ../../whatsnew/3.12.rst:1585 ../../whatsnew/3.12.rst:1586 -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1587 ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1589 ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1591 ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1593 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1588 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1588 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1583 +#: ../../whatsnew/3.12.rst:1589 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1583 ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1589 ../../whatsnew/3.12.rst:1595 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1590 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1584 ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1590 ../../whatsnew/3.12.rst:1596 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1591 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1585 ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1591 ../../whatsnew/3.12.rst:1597 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1592 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1586 ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1592 ../../whatsnew/3.12.rst:1598 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1593 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1593 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1594 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1588 ../../whatsnew/3.12.rst:1589 -#: ../../whatsnew/3.12.rst:1590 ../../whatsnew/3.12.rst:1591 -#: ../../whatsnew/3.12.rst:1592 ../../whatsnew/3.12.rst:1593 -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1594 ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1596 ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1598 ../../whatsnew/3.12.rst:1599 +#: ../../whatsnew/3.12.rst:1600 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1595 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1596 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1597 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1598 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1599 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1599 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1600 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1600 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1601 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1601 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1601 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1598 +#: ../../whatsnew/3.12.rst:1604 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1607 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1604 +#: ../../whatsnew/3.12.rst:1610 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule <unittest.TestLoader." "loadTestsFromModule>` parameter *use_load_tests* (deprecated and ignored " "since Python 3.5)." msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1614 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1611 +#: ../../whatsnew/3.12.rst:1617 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1614 +#: ../../whatsnew/3.12.rst:1620 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1616 +#: ../../whatsnew/3.12.rst:1622 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:1621 +#: ../../whatsnew/3.12.rst:1627 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1623 +#: ../../whatsnew/3.12.rst:1629 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -3692,22 +3701,22 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1630 +#: ../../whatsnew/3.12.rst:1636 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1632 +#: ../../whatsnew/3.12.rst:1638 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:1638 +#: ../../whatsnew/3.12.rst:1644 msgid "Others" msgstr "其他" -#: ../../whatsnew/3.12.rst:1640 +#: ../../whatsnew/3.12.rst:1646 msgid "" "Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" "file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint <https://github." @@ -3715,7 +3724,7 @@ msgid "" "`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1651 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -3725,7 +3734,7 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1653 +#: ../../whatsnew/3.12.rst:1659 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" @@ -3733,7 +3742,7 @@ msgstr "" "移除數個標準函式庫模組與測試中的 ``Jython`` 相容性修補程式。(由 Nikita " "Sobolev 於 :gh:`99482` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1662 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" @@ -3741,21 +3750,21 @@ msgstr "" "移除 :mod:`ctypes` 模組中的 ``_use_broken_old_ctypes_structure_semantics_`` " "旗標。(由 Nikita Sobolev 於 :gh:`99285` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1664 ../../whatsnew/3.12.rst:1988 +#: ../../whatsnew/3.12.rst:1670 ../../whatsnew/3.12.rst:1994 msgid "Porting to Python 3.12" msgstr "移植至 Python 3.12" -#: ../../whatsnew/3.12.rst:1666 +#: ../../whatsnew/3.12.rst:1672 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1670 +#: ../../whatsnew/3.12.rst:1676 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.12.rst:1672 +#: ../../whatsnew/3.12.rst:1678 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -3764,7 +3773,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1679 +#: ../../whatsnew/3.12.rst:1685 msgid "" "Remove ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -3776,7 +3785,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1693 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -3786,21 +3795,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1693 +#: ../../whatsnew/3.12.rst:1699 msgid "" "Remove the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based :pypi:" "`aiosmtpd` PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1703 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1708 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -3808,7 +3817,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1707 +#: ../../whatsnew/3.12.rst:1713 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -3820,7 +3829,7 @@ msgid "" "(Contributed by Donghee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1722 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -3832,14 +3841,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1729 +#: ../../whatsnew/3.12.rst:1735 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1734 +#: ../../whatsnew/3.12.rst:1740 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -3851,15 +3860,15 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1743 +#: ../../whatsnew/3.12.rst:1749 msgid "1,0-1,18: STRING 'f\"start {1+1} end\"'" msgstr "1,0-1,18: STRING 'f\"start {1+1} end\"'" -#: ../../whatsnew/3.12.rst:1745 +#: ../../whatsnew/3.12.rst:1751 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1747 +#: ../../whatsnew/3.12.rst:1753 msgid "" "1,0-1,2: FSTRING_START 'f\"'\n" "1,2-1,8: FSTRING_MIDDLE 'start '\n" @@ -3881,54 +3890,54 @@ msgstr "" "1,13-1,17: FSTRING_MIDDLE ' end'\n" "1,17-1,18: FSTRING_END '\"'" -#: ../../whatsnew/3.12.rst:1757 +#: ../../whatsnew/3.12.rst:1763 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1760 +#: ../../whatsnew/3.12.rst:1766 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1763 +#: ../../whatsnew/3.12.rst:1769 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1766 +#: ../../whatsnew/3.12.rst:1772 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1769 +#: ../../whatsnew/3.12.rst:1775 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1772 +#: ../../whatsnew/3.12.rst:1778 msgid "" "The :mod:`threading` module now expects the :mod:`!_thread` module to have " "an ``_is_main_interpreter`` attribute. It is a function with no arguments " "that returns ``True`` if the current interpreter is the main interpreter." msgstr "" -#: ../../whatsnew/3.12.rst:1777 +#: ../../whatsnew/3.12.rst:1783 msgid "" "Any library or application that provides a custom ``_thread`` module should " "provide ``_is_main_interpreter()``. (See :gh:`112826`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1782 +#: ../../whatsnew/3.12.rst:1788 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1790 msgid "" "Python no longer uses :file:`setup.py` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -3937,21 +3946,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1790 +#: ../../whatsnew/3.12.rst:1796 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1795 +#: ../../whatsnew/3.12.rst:1801 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Donghee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1799 +#: ../../whatsnew/3.12.rst:1805 msgid "" "Add ``COMPILEALL_OPTS`` variable in :file:`Makefile` to override :mod:" "`compileall` options (default: ``-j0``) in ``make install``. Also merged the " @@ -3960,46 +3969,46 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1805 +#: ../../whatsnew/3.12.rst:1811 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1807 +#: ../../whatsnew/3.12.rst:1813 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1808 +#: ../../whatsnew/3.12.rst:1814 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1809 +#: ../../whatsnew/3.12.rst:1815 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1811 +#: ../../whatsnew/3.12.rst:1817 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1813 +#: ../../whatsnew/3.12.rst:1819 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1815 +#: ../../whatsnew/3.12.rst:1821 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1819 +#: ../../whatsnew/3.12.rst:1825 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1823 +#: ../../whatsnew/3.12.rst:1829 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.12.rst:1830 +#: ../../whatsnew/3.12.rst:1836 msgid "" ":pep:`697`: Introduce the :ref:`Unstable C API tier <unstable-c-api>`, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -4007,15 +4016,15 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1836 +#: ../../whatsnew/3.12.rst:1842 msgid "Code object constructors:" msgstr "程式碼物件建構函式:" -#: ../../whatsnew/3.12.rst:1838 +#: ../../whatsnew/3.12.rst:1844 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "``PyUnstable_Code_New()``\\ (自 ``PyCode_New`` 重新命名)" -#: ../../whatsnew/3.12.rst:1839 +#: ../../whatsnew/3.12.rst:1845 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" @@ -4023,11 +4032,11 @@ msgstr "" "``PyUnstable_Code_NewWithPosOnlyArgs()``\\ (自 " "``PyCode_NewWithPosOnlyArgs`` 重新命名)" -#: ../../whatsnew/3.12.rst:1841 +#: ../../whatsnew/3.12.rst:1847 msgid "Extra storage for code objects (:pep:`523`):" msgstr "程式碼物件的額外儲存 (:pep:`523`):" -#: ../../whatsnew/3.12.rst:1843 +#: ../../whatsnew/3.12.rst:1849 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" @@ -4035,31 +4044,31 @@ msgstr "" "``PyUnstable_Eval_RequestCodeExtraIndex()``\\ (自 " "``_PyEval_RequestCodeExtraIndex`` 重新命名)" -#: ../../whatsnew/3.12.rst:1844 +#: ../../whatsnew/3.12.rst:1850 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "``PyUnstable_Code_GetExtra()``\\ (自 ``_PyCode_GetExtra`` 重新命名)" -#: ../../whatsnew/3.12.rst:1845 +#: ../../whatsnew/3.12.rst:1851 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "``PyUnstable_Code_SetExtra()``\\ (自 ``_PyCode_SetExtra`` 重新命名)" -#: ../../whatsnew/3.12.rst:1847 +#: ../../whatsnew/3.12.rst:1853 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "原始名稱將可繼續使用,直到相應的 API 發生變更。" -#: ../../whatsnew/3.12.rst:1850 +#: ../../whatsnew/3.12.rst:1856 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1852 +#: ../../whatsnew/3.12.rst:1858 msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1855 +#: ../../whatsnew/3.12.rst:1861 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." @@ -4067,30 +4076,30 @@ msgstr "" ":c:member:`PyType_Spec.basicsize` 可以為零或負數來指定繼承或擴充基底類別大" "小。" -#: ../../whatsnew/3.12.rst:1857 +#: ../../whatsnew/3.12.rst:1863 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1859 +#: ../../whatsnew/3.12.rst:1865 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:1862 +#: ../../whatsnew/3.12.rst:1868 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "<PyMemberDef>` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1865 +#: ../../whatsnew/3.12.rst:1871 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1867 +#: ../../whatsnew/3.12.rst:1873 msgid "" "Add the new :ref:`limited C API <limited-c-api>` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -4098,29 +4107,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1872 +#: ../../whatsnew/3.12.rst:1878 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol <vectorcall>` was added to the :ref:`Limited API <stable>`:" msgstr "" -#: ../../whatsnew/3.12.rst:1876 +#: ../../whatsnew/3.12.rst:1882 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -#: ../../whatsnew/3.12.rst:1877 +#: ../../whatsnew/3.12.rst:1883 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1878 +#: ../../whatsnew/3.12.rst:1884 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1879 +#: ../../whatsnew/3.12.rst:1885 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1881 +#: ../../whatsnew/3.12.rst:1887 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 " @@ -4131,7 +4140,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1889 +#: ../../whatsnew/3.12.rst:1895 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -4139,32 +4148,32 @@ msgid "" "bookkeeping, using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1894 +#: ../../whatsnew/3.12.rst:1900 msgid "" "API for performing calls using :ref:`the vectorcall protocol <vectorcall>` " "was added to the :ref:`Limited API <stable>`:" msgstr "" -#: ../../whatsnew/3.12.rst:1898 +#: ../../whatsnew/3.12.rst:1904 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1899 +#: ../../whatsnew/3.12.rst:1905 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1900 +#: ../../whatsnew/3.12.rst:1906 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:1902 +#: ../../whatsnew/3.12.rst:1908 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API <stable>`. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1906 +#: ../../whatsnew/3.12.rst:1912 msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -4172,14 +4181,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1912 +#: ../../whatsnew/3.12.rst:1918 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:1916 +#: ../../whatsnew/3.12.rst:1922 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -4188,28 +4197,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1922 +#: ../../whatsnew/3.12.rst:1928 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:1926 +#: ../../whatsnew/3.12.rst:1932 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:1931 +#: ../../whatsnew/3.12.rst:1937 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:1935 +#: ../../whatsnew/3.12.rst:1941 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -4219,14 +4228,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:1949 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:1947 +#: ../../whatsnew/3.12.rst:1953 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -4234,71 +4243,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1952 +#: ../../whatsnew/3.12.rst:1958 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:1958 +#: ../../whatsnew/3.12.rst:1964 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:1961 +#: ../../whatsnew/3.12.rst:1967 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "``_Py_IMMORTAL_REFCNT``:定義物件的參照計數" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:1968 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1969 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:1970 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "``PyObject_HEAD_INIT`` 這現在將初始化參照計數" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:1971 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "``_Py_IMMORTAL_REFCNT``\\ (與 ``Py_BUILD_CORE`` 一起使用時)。" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:1972 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1973 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1974 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1975 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:1976 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "``sys.getunicodeinternedsize`` 這會回傳 unicode 的總數" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:1977 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:1974 +#: ../../whatsnew/3.12.rst:1980 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:1982 msgid "" ":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" "c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " @@ -4306,27 +4315,27 @@ msgid "" "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1982 +#: ../../whatsnew/3.12.rst:1988 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:1990 +#: ../../whatsnew/3.12.rst:1996 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:1993 +#: ../../whatsnew/3.12.rst:1999 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:1997 +#: ../../whatsnew/3.12.rst:2003 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 " @@ -4335,7 +4344,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:2004 +#: ../../whatsnew/3.12.rst:2010 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 " @@ -4343,13 +4352,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:2009 +#: ../../whatsnew/3.12.rst:2015 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:2013 +#: ../../whatsnew/3.12.rst:2019 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 " @@ -4358,7 +4367,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2019 +#: ../../whatsnew/3.12.rst:2025 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -4367,13 +4376,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2025 +#: ../../whatsnew/3.12.rst:2031 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:2029 +#: ../../whatsnew/3.12.rst:2035 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:" @@ -4387,7 +4396,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:2041 +#: ../../whatsnew/3.12.rst:2047 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -4395,7 +4404,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2046 +#: ../../whatsnew/3.12.rst:2052 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 " @@ -4403,7 +4412,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2051 +#: ../../whatsnew/3.12.rst:2057 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 " @@ -4411,7 +4420,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2056 +#: ../../whatsnew/3.12.rst:2062 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 " @@ -4419,25 +4428,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:2061 +#: ../../whatsnew/3.12.rst:2067 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:2064 +#: ../../whatsnew/3.12.rst:2070 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:2065 +#: ../../whatsnew/3.12.rst:2071 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:2066 +#: ../../whatsnew/3.12.rst:2072 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:2068 +#: ../../whatsnew/3.12.rst:2074 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 " @@ -4445,14 +4454,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:2073 +#: ../../whatsnew/3.12.rst:2079 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:2077 +#: ../../whatsnew/3.12.rst:2083 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -4461,17 +4470,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:2084 +#: ../../whatsnew/3.12.rst:2090 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:2086 +#: ../../whatsnew/3.12.rst:2092 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:2088 +#: ../../whatsnew/3.12.rst:2094 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -4479,20 +4488,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2093 +#: ../../whatsnew/3.12.rst:2099 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling <call>` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:2097 +#: ../../whatsnew/3.12.rst:2103 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:2100 +#: ../../whatsnew/3.12.rst:2106 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters <sub-interpreter-support>`. This is " @@ -4500,14 +4509,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2105 +#: ../../whatsnew/3.12.rst:2111 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:2109 +#: ../../whatsnew/3.12.rst:2115 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -4518,15 +4527,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2117 +#: ../../whatsnew/3.12.rst:2123 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2118 +#: ../../whatsnew/3.12.rst:2124 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2120 +#: ../../whatsnew/3.12.rst:2126 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 " @@ -4535,7 +4544,7 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2130 +#: ../../whatsnew/3.12.rst:2136 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -4544,76 +4553,76 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:2135 +#: ../../whatsnew/3.12.rst:2141 msgid "Deprecate global configuration variable:" msgstr "棄用全域配置變數:" -#: ../../whatsnew/3.12.rst:2137 +#: ../../whatsnew/3.12.rst:2143 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:2138 +#: ../../whatsnew/3.12.rst:2144 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr ":c:var:`Py_VerboseFlag`: 請改用 :c:member:`PyConfig.verbose`" -#: ../../whatsnew/3.12.rst:2139 +#: ../../whatsnew/3.12.rst:2145 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr ":c:var:`Py_QuietFlag`: 請改用 :c:member:`PyConfig.quiet`" -#: ../../whatsnew/3.12.rst:2140 +#: ../../whatsnew/3.12.rst:2146 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr ":c:var:`Py_InteractiveFlag`: 請改用 :c:member:`PyConfig.interactive`" -#: ../../whatsnew/3.12.rst:2141 +#: ../../whatsnew/3.12.rst:2147 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr ":c:var:`Py_InspectFlag`: 請改用 :c:member:`PyConfig.inspect`" -#: ../../whatsnew/3.12.rst:2142 +#: ../../whatsnew/3.12.rst:2148 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:2143 +#: ../../whatsnew/3.12.rst:2149 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:2144 +#: ../../whatsnew/3.12.rst:2150 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:2145 +#: ../../whatsnew/3.12.rst:2151 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:2146 +#: ../../whatsnew/3.12.rst:2152 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:2147 +#: ../../whatsnew/3.12.rst:2153 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:2148 +#: ../../whatsnew/3.12.rst:2154 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:2149 +#: ../../whatsnew/3.12.rst:2155 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:2150 +#: ../../whatsnew/3.12.rst:2156 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" @@ -4621,11 +4630,11 @@ msgstr "" ":c:var:`Py_HashRandomizationFlag`: 請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`" -#: ../../whatsnew/3.12.rst:2152 +#: ../../whatsnew/3.12.rst:2158 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" -#: ../../whatsnew/3.12.rst:2153 +#: ../../whatsnew/3.12.rst:2159 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" @@ -4633,7 +4642,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" -#: ../../whatsnew/3.12.rst:2154 +#: ../../whatsnew/3.12.rst:2160 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" @@ -4641,7 +4650,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." "legacy_windows_stdio`" -#: ../../whatsnew/3.12.rst:2155 +#: ../../whatsnew/3.12.rst:2161 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -4649,7 +4658,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2156 +#: ../../whatsnew/3.12.rst:2162 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -4657,7 +4666,7 @@ msgstr "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2157 +#: ../../whatsnew/3.12.rst:2163 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" @@ -4665,7 +4674,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." "filesystem_errors`" -#: ../../whatsnew/3.12.rst:2158 +#: ../../whatsnew/3.12.rst:2164 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" @@ -4673,7 +4682,7 @@ msgstr "" ":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" "func:`Py_PreInitialize`)" -#: ../../whatsnew/3.12.rst:2160 +#: ../../whatsnew/3.12.rst:2166 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" @@ -4681,25 +4690,25 @@ msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2164 +#: ../../whatsnew/3.12.rst:2170 msgid "" "Creating :c:data:`immutable types <Py_TPFLAGS_IMMUTABLETYPE>` with mutable " "bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2167 +#: ../../whatsnew/3.12.rst:2173 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:2170 +#: ../../whatsnew/3.12.rst:2176 msgid "" "Its contents are now available just by including :file:`Python.h`, with a " "``Py`` prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2173 +#: ../../whatsnew/3.12.rst:2179 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" @@ -4707,13 +4716,13 @@ msgstr "" ":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" "`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2175 +#: ../../whatsnew/3.12.rst:2181 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2177 +#: ../../whatsnew/3.12.rst:2183 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" @@ -4721,23 +4730,23 @@ msgstr "" ":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" "`Py_AUDIT_READ`\\ (先前全大寫)旗標" -#: ../../whatsnew/3.12.rst:2180 +#: ../../whatsnew/3.12.rst:2186 msgid "Several items are not exposed from :file:`Python.h`:" msgstr "數個項目不再從 :file:`Python.h` 中公開:" -#: ../../whatsnew/3.12.rst:2182 +#: ../../whatsnew/3.12.rst:2188 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:2183 +#: ../../whatsnew/3.12.rst:2189 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr ":c:macro:`T_NONE`\\ (先前未記錄於文件上,且相當古怪)" -#: ../../whatsnew/3.12.rst:2184 +#: ../../whatsnew/3.12.rst:2190 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" -#: ../../whatsnew/3.12.rst:2185 +#: ../../whatsnew/3.12.rst:2191 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." @@ -4745,33 +4754,33 @@ msgstr "" "``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" "`Py_AUDIT_READ`。" -#: ../../whatsnew/3.12.rst:2187 +#: ../../whatsnew/3.12.rst:2193 msgid "" "In some configurations, ``<stddef.h>`` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2190 +#: ../../whatsnew/3.12.rst:2196 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:2195 +#: ../../whatsnew/3.12.rst:2201 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2198 +#: ../../whatsnew/3.12.rst:2204 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:2203 +#: ../../whatsnew/3.12.rst:2209 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." @@ -4779,7 +4788,7 @@ msgstr "" ":c:func:`!PyErr_Display` 已棄用,請改用 :c:func:`PyErr_DisplayException`。" "(由 Irit Katriel 於 :gh:`102755` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2206 +#: ../../whatsnew/3.12.rst:2212 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" @@ -4787,7 +4796,7 @@ msgstr "" "``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " "Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2209 +#: ../../whatsnew/3.12.rst:2215 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" @@ -5189,54 +5198,54 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.12.rst:2225 +#: ../../whatsnew/3.12.rst:2231 msgid "" "Remove the :file:`token.h` header file. There was never any public tokenizer " "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2230 +#: ../../whatsnew/3.12.rst:2236 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2232 +#: ../../whatsnew/3.12.rst:2238 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2233 +#: ../../whatsnew/3.12.rst:2239 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2234 +#: ../../whatsnew/3.12.rst:2240 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2235 +#: ../../whatsnew/3.12.rst:2241 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2236 +#: ../../whatsnew/3.12.rst:2242 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2237 +#: ../../whatsnew/3.12.rst:2243 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2238 +#: ../../whatsnew/3.12.rst:2244 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2239 +#: ../../whatsnew/3.12.rst:2245 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2240 +#: ../../whatsnew/3.12.rst:2246 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2242 +#: ../../whatsnew/3.12.rst:2248 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index bbc57bb4aa..5e82698d42 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-10 17:21+0000\n" +"POT-Creation-Date: 2024-11-15 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -345,7 +345,7 @@ msgid "" "years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1968 +#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1970 msgid "New Features" msgstr "新增功能" @@ -484,7 +484,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:294 msgid "(Contributed by Shantanu Jain in :gh:`95754`.)" -msgstr "" +msgstr "(由 Shantanu Jain 在 :gh:`95754` 中貢獻。)" #: ../../whatsnew/3.13.rst:296 msgid "" @@ -813,7 +813,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:524 msgid "(Contributed by Inada Naoki in :gh:`81283`.)" -msgstr "" +msgstr "(由 Inada Naoki 在 :gh:`81283` 中貢獻。)" #: ../../whatsnew/3.13.rst:526 msgid "" @@ -832,7 +832,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:536 msgid "(Contributed by Jelle Zijlstra in :gh:`109118` and :gh:`118160`.)" -msgstr "" +msgstr "(由 Jelle Zijlstra 在 :gh:`109118` 和 :gh:`118160` 中貢獻。)" #: ../../whatsnew/3.13.rst:538 msgid "" @@ -937,13 +937,15 @@ msgstr ":class:`subprocess.Popen`" #: ../../whatsnew/3.13.rst:598 msgid "(Contributed by Victor Stinner in :gh:`114570`.)" -msgstr "" +msgstr "(由 Victor Stinner 在 :gh:`114570` 中貢獻。)" #: ../../whatsnew/3.13.rst:600 msgid "" "Allow the *count* argument of :meth:`str.replace` to be a keyword. " "(Contributed by Hugo van Kemenade in :gh:`106487`.)" msgstr "" +"允許 :meth:`str.replace` 的 *count* 引數為關鍵字。(由 Hugo van Kemenade 在 :" +"gh:`106487` 中貢獻。)" #: ../../whatsnew/3.13.rst:603 msgid "" @@ -1172,7 +1174,7 @@ msgstr "" msgid "concurrent.futures" msgstr "concurrent.futures" -#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1612 +#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1614 msgid "configparser" msgstr "configparser" @@ -1632,7 +1634,7 @@ msgid "" "file is not accessible. (Contributed by Moonsik Park in :gh:`82367`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1091 ../../whatsnew/3.13.rst:1652 +#: ../../whatsnew/3.13.rst:1091 ../../whatsnew/3.13.rst:1654 msgid "pathlib" msgstr "pathlib" @@ -1746,7 +1748,7 @@ msgid "" "Kemenade in :gh:`118131`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1168 ../../whatsnew/3.13.rst:1660 +#: ../../whatsnew/3.13.rst:1168 ../../whatsnew/3.13.rst:1662 msgid "re" msgstr "re" @@ -1827,7 +1829,7 @@ msgstr "" #: ../../whatsnew/3.13.rst:1223 msgid "(Contributed by William Woodruff in :gh:`112389`.)" -msgstr "" +msgstr "(由 William Woodruff 在 :gh:`112389` 中貢獻。)" #: ../../whatsnew/3.13.rst:1227 msgid "statistics" @@ -1877,7 +1879,7 @@ msgid "" "`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1264 +#: ../../whatsnew/3.13.rst:1264 ../../whatsnew/3.13.rst:2717 msgid "sys" msgstr "sys" @@ -2027,7 +2029,7 @@ msgid "" "`108191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1375 ../../whatsnew/3.13.rst:1685 +#: ../../whatsnew/3.13.rst:1375 ../../whatsnew/3.13.rst:1687 msgid "typing" msgstr "typing" @@ -2138,7 +2140,7 @@ msgstr ":meth:`!xml.sax.expatreader.ExpatParser.flush`" #: ../../whatsnew/3.13.rst:1445 msgid "(Contributed by Sebastian Pipping in :gh:`115623`.)" -msgstr "" +msgstr "(由 Sebastian Pipping 在 :gh:`115623` 中貢獻。)" #: ../../whatsnew/3.13.rst:1447 msgid "" @@ -2325,60 +2327,62 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:1569 -msgid ":mod:`!pipes`: Use the :mod:`subprocess` module instead." +msgid "" +":mod:`!pipes`: Use the :mod:`subprocess` module instead. Use :func:`shlex." +"quote` to replace the undocumented ``pipes.quote`` function." msgstr "" -#: ../../whatsnew/3.13.rst:1571 +#: ../../whatsnew/3.13.rst:1573 msgid "" ":mod:`!sndhdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements." msgstr "" -#: ../../whatsnew/3.13.rst:1574 +#: ../../whatsnew/3.13.rst:1576 msgid ":mod:`!spwd`: Use the :pypi:`python-pam` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1576 +#: ../../whatsnew/3.13.rst:1578 msgid ":mod:`!sunau`" msgstr ":mod:`!sunau`" -#: ../../whatsnew/3.13.rst:1577 +#: ../../whatsnew/3.13.rst:1579 msgid "" ":mod:`!telnetlib`, Use the :pypi:`telnetlib3` or :pypi:`Exscript` libraries " "from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1579 +#: ../../whatsnew/3.13.rst:1581 msgid "" ":mod:`!uu`: Use the :mod:`base64` module instead, as a modern alternative." msgstr "" -#: ../../whatsnew/3.13.rst:1581 +#: ../../whatsnew/3.13.rst:1583 msgid ":mod:`!xdrlib`" msgstr ":mod:`!xdrlib`" -#: ../../whatsnew/3.13.rst:1583 +#: ../../whatsnew/3.13.rst:1585 msgid "" "(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1587 +#: ../../whatsnew/3.13.rst:1589 msgid "2to3" msgstr "2to3" -#: ../../whatsnew/3.13.rst:1589 +#: ../../whatsnew/3.13.rst:1591 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:1595 +#: ../../whatsnew/3.13.rst:1597 msgid "builtins" msgstr "builtins" -#: ../../whatsnew/3.13.rst:1597 +#: ../../whatsnew/3.13.rst:1599 msgid "" "Remove support for chained :class:`classmethod` descriptors (introduced in :" "gh:`63272`). These can no longer be used to wrap other descriptors, such as :" @@ -2388,47 +2392,47 @@ msgid "" "(Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1606 +#: ../../whatsnew/3.13.rst:1608 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:1614 +#: ../../whatsnew/3.13.rst:1616 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:1621 +#: ../../whatsnew/3.13.rst:1623 msgid "importlib.metadata" msgstr "importlib.metadata" -#: ../../whatsnew/3.13.rst:1623 +#: ../../whatsnew/3.13.rst:1625 msgid "" "Remove deprecated subscript (:meth:`~object.__getitem__`) access for :ref:" "`EntryPoint <entry-points>` objects. (Contributed by Jason R. Coombs in :gh:" "`113175`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1629 +#: ../../whatsnew/3.13.rst:1631 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.13.rst:1631 +#: ../../whatsnew/3.13.rst:1633 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:1637 +#: ../../whatsnew/3.13.rst:1639 msgid "opcode" msgstr "opcode" -#: ../../whatsnew/3.13.rst:1639 +#: ../../whatsnew/3.13.rst:1641 msgid "" "Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!_opcode." "ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " @@ -2436,7 +2440,7 @@ msgid "" "Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1644 +#: ../../whatsnew/3.13.rst:1646 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 " @@ -2444,43 +2448,43 @@ msgid "" "be used externally. (Contributed by Irit Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1654 +#: ../../whatsnew/3.13.rst:1656 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:1662 +#: ../../whatsnew/3.13.rst:1664 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:1668 +#: ../../whatsnew/3.13.rst:1670 msgid "tkinter.tix" msgstr "tkinter.tix" -#: ../../whatsnew/3.13.rst:1670 +#: ../../whatsnew/3.13.rst:1672 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:1676 +#: ../../whatsnew/3.13.rst:1678 msgid "turtle" msgstr "turtle" -#: ../../whatsnew/3.13.rst:1678 +#: ../../whatsnew/3.13.rst:1680 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:1687 +#: ../../whatsnew/3.13.rst:1689 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 " @@ -2488,66 +2492,66 @@ msgid "" "`92871`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1693 +#: ../../whatsnew/3.13.rst:1695 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:1699 +#: ../../whatsnew/3.13.rst:1701 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.13.rst:1701 +#: ../../whatsnew/3.13.rst:1703 msgid "" "Remove the following :mod:`unittest` functions, deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:1703 +#: ../../whatsnew/3.13.rst:1705 msgid ":func:`!unittest.findTestCases`" msgstr ":func:`!unittest.findTestCases`" -#: ../../whatsnew/3.13.rst:1704 +#: ../../whatsnew/3.13.rst:1706 msgid ":func:`!unittest.makeSuite`" msgstr ":func:`!unittest.makeSuite`" -#: ../../whatsnew/3.13.rst:1705 +#: ../../whatsnew/3.13.rst:1707 msgid ":func:`!unittest.getTestCaseNames`" msgstr ":func:`!unittest.getTestCaseNames`" -#: ../../whatsnew/3.13.rst:1707 +#: ../../whatsnew/3.13.rst:1709 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.13.rst:1709 +#: ../../whatsnew/3.13.rst:1711 msgid ":meth:`~unittest.TestLoader.loadTestsFromModule`" msgstr ":meth:`~unittest.TestLoader.loadTestsFromModule`" -#: ../../whatsnew/3.13.rst:1710 +#: ../../whatsnew/3.13.rst:1712 msgid ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" msgstr ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" -#: ../../whatsnew/3.13.rst:1711 +#: ../../whatsnew/3.13.rst:1713 msgid ":meth:`~unittest.TestLoader.getTestCaseNames`" msgstr ":meth:`~unittest.TestLoader.getTestCaseNames`" -#: ../../whatsnew/3.13.rst:1713 +#: ../../whatsnew/3.13.rst:1715 msgid "(Contributed by Hugo van Kemenade in :gh:`104835`.)" -msgstr "" +msgstr "(由 Hugo van Kemenade 在 :gh:`104835` 中貢獻。)" -#: ../../whatsnew/3.13.rst:1715 +#: ../../whatsnew/3.13.rst:1717 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:1721 +#: ../../whatsnew/3.13.rst:1723 msgid "urllib" msgstr "urllib" -#: ../../whatsnew/3.13.rst:1723 +#: ../../whatsnew/3.13.rst:1725 msgid "" "Remove the *cafile*, *capath*, and *cadefault* parameters of the :func:" "`urllib.request.urlopen` function, deprecated in Python 3.6. Use the " @@ -2558,33 +2562,33 @@ msgid "" "Victor Stinner in :gh:`105382`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1734 +#: ../../whatsnew/3.13.rst:1736 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.13.rst:1736 +#: ../../whatsnew/3.13.rst:1738 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:1741 +#: ../../whatsnew/3.13.rst:1743 msgid "" "Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use the :" "attr:`MacOSXOSAScript.name <webbrowser.controller.name>` attribute instead. " "(Contributed by Nikita Sobolev in :gh:`105546`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1748 +#: ../../whatsnew/3.13.rst:1750 msgid "New Deprecations" msgstr "" -#: ../../whatsnew/3.13.rst:1750 +#: ../../whatsnew/3.13.rst:1752 msgid ":ref:`User-defined functions <user-defined-funcs>`:" msgstr "" -#: ../../whatsnew/3.13.rst:1752 +#: ../../whatsnew/3.13.rst:1754 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 " @@ -2592,12 +2596,12 @@ msgid "" "coroutine. (Contributed by Irit Katriel in :gh:`81137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1758 +#: ../../whatsnew/3.13.rst:1760 #: ../../deprecations/pending-removal-in-3.16.rst:11 msgid ":mod:`array`:" msgstr ":mod:`array`:" -#: ../../whatsnew/3.13.rst:1760 +#: ../../whatsnew/3.13.rst:1762 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 " @@ -2606,50 +2610,50 @@ msgid "" "`80480`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1767 +#: ../../whatsnew/3.13.rst:1769 #: ../../deprecations/pending-removal-in-3.15.rst:16 msgid ":mod:`ctypes`:" msgstr ":mod:`ctypes`:" -#: ../../whatsnew/3.13.rst:1769 +#: ../../whatsnew/3.13.rst:1771 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:1773 +#: ../../whatsnew/3.13.rst:1775 msgid "" ":term:`Soft-deprecate <soft deprecated>` the :func:`~ctypes.ARRAY` function " "in favour of ``type * length`` multiplication. (Contributed by Victor " "Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1777 +#: ../../whatsnew/3.13.rst:1779 msgid ":mod:`decimal`:" msgstr ":mod:`decimal`:" -#: ../../whatsnew/3.13.rst:1779 +#: ../../whatsnew/3.13.rst:1781 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:1784 +#: ../../whatsnew/3.13.rst:1786 msgid ":mod:`dis`:" msgstr ":mod:`dis`:" -#: ../../whatsnew/3.13.rst:1786 +#: ../../whatsnew/3.13.rst:1788 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:1790 +#: ../../whatsnew/3.13.rst:1792 msgid ":mod:`getopt` and :mod:`optparse`:" msgstr ":mod:`getopt` 和 :mod:`optparse`:" -#: ../../whatsnew/3.13.rst:1792 +#: ../../whatsnew/3.13.rst:1794 msgid "" "Both modules are now :term:`soft deprecated`, with :mod:`argparse` preferred " "for new projects. This is a new soft-deprecation for the :mod:`!getopt` " @@ -2657,22 +2661,22 @@ msgid "" "deprecated. (Contributed by Victor Stinner in :gh:`106535`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1798 +#: ../../whatsnew/3.13.rst:1800 msgid ":mod:`gettext`:" msgstr ":mod:`gettext`:" -#: ../../whatsnew/3.13.rst:1800 +#: ../../whatsnew/3.13.rst:1802 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:1805 +#: ../../whatsnew/3.13.rst:1807 msgid ":mod:`glob`:" msgstr ":mod:`glob`:" -#: ../../whatsnew/3.13.rst:1807 +#: ../../whatsnew/3.13.rst:1809 msgid "" "Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" "func:`~glob.glob` and pass a :term:`path-like object` specifying the root " @@ -2680,12 +2684,12 @@ msgid "" "in :gh:`117337`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1812 +#: ../../whatsnew/3.13.rst:1814 #: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr ":mod:`http.server`:" -#: ../../whatsnew/3.13.rst:1814 +#: ../../whatsnew/3.13.rst:1816 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 " @@ -2694,29 +2698,29 @@ msgid "" "by Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1821 +#: ../../whatsnew/3.13.rst:1823 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:1826 +#: ../../whatsnew/3.13.rst:1828 msgid ":mod:`mimetypes`:" msgstr ":mod:`mimetypes`:" -#: ../../whatsnew/3.13.rst:1828 +#: ../../whatsnew/3.13.rst:1830 msgid "" ":term:`Soft-deprecate <soft deprecated>` 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:1833 +#: ../../whatsnew/3.13.rst:1835 msgid ":mod:`re`:" msgstr ":mod:`re`:" -#: ../../whatsnew/3.13.rst:1835 +#: ../../whatsnew/3.13.rst:1837 msgid "" "Deprecate passing the optional *maxsplit*, *count*, or *flags* arguments as " "positional arguments to the module-level :func:`~re.split`, :func:`~re.sub`, " @@ -2725,46 +2729,46 @@ msgid "" "by Serhiy Storchaka in :gh:`56166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1842 +#: ../../whatsnew/3.13.rst:1844 #: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" msgstr ":mod:`pathlib`:" -#: ../../whatsnew/3.13.rst:1844 +#: ../../whatsnew/3.13.rst:1846 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:1849 +#: ../../whatsnew/3.13.rst:1851 #: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" msgstr ":mod:`platform`:" -#: ../../whatsnew/3.13.rst:1851 +#: ../../whatsnew/3.13.rst:1853 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:1857 +#: ../../whatsnew/3.13.rst:1859 msgid ":mod:`pydoc`:" msgstr ":mod:`pydoc`:" -#: ../../whatsnew/3.13.rst:1859 +#: ../../whatsnew/3.13.rst:1861 msgid "" "Deprecate the undocumented :func:`!ispackage` function. (Contributed by " "Zackery Spytz in :gh:`64020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1862 +#: ../../whatsnew/3.13.rst:1864 #: ../../deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../whatsnew/3.13.rst:1864 +#: ../../whatsnew/3.13.rst:1866 msgid "" "Deprecate passing more than one positional argument to the :func:`~sqlite3." "connect` function and the :class:`~sqlite3.Connection` constructor. The " @@ -2772,7 +2776,7 @@ msgid "" "by Erlend E. Aasland in :gh:`107948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1870 +#: ../../whatsnew/3.13.rst:1872 msgid "" "Deprecate passing name, number of arguments, and the callable as keyword " "arguments for :meth:`.Connection.create_function` and :meth:`.Connection." @@ -2780,7 +2784,7 @@ msgid "" "3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1876 +#: ../../whatsnew/3.13.rst:1878 msgid "" "Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." "Connection.set_authorizer`, :meth:`~sqlite3.Connection." @@ -2790,46 +2794,46 @@ msgid "" "`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1884 +#: ../../whatsnew/3.13.rst:1886 #: ../../deprecations/pending-removal-in-3.16.rst:47 msgid ":mod:`sys`:" msgstr ":mod:`sys`:" -#: ../../whatsnew/3.13.rst:1886 +#: ../../whatsnew/3.13.rst:1888 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:1891 +#: ../../whatsnew/3.13.rst:1893 #: ../../deprecations/pending-removal-in-3.16.rst:53 msgid ":mod:`tarfile`:" msgstr ":mod:`tarfile`:" -#: ../../whatsnew/3.13.rst:1893 +#: ../../whatsnew/3.13.rst:1895 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:1897 +#: ../../whatsnew/3.13.rst:1899 msgid ":mod:`traceback`:" msgstr ":mod:`traceback`:" -#: ../../whatsnew/3.13.rst:1899 +#: ../../whatsnew/3.13.rst:1901 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:1903 +#: ../../whatsnew/3.13.rst:1905 #: ../../deprecations/pending-removal-in-3.15.rst:71 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" -#: ../../whatsnew/3.13.rst:1905 +#: ../../whatsnew/3.13.rst:1907 msgid "" "Deprecate the undocumented keyword argument syntax for creating :class:" "`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " @@ -2837,7 +2841,7 @@ msgid "" "functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1912 +#: ../../whatsnew/3.13.rst:1914 msgid "" "Deprecate omitting the *fields* parameter when creating a :class:`~typing." "NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " @@ -2849,7 +2853,7 @@ msgid "" "Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1922 +#: ../../whatsnew/3.13.rst:1924 msgid "" "Deprecate the :func:`typing.no_type_check_decorator` decorator function, to " "be removed in in Python 3.15. After eight years in the :mod:`typing` module, " @@ -2857,7 +2861,7 @@ msgid "" "Waygood in :gh:`106309`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1928 +#: ../../whatsnew/3.13.rst:1930 msgid "" "Deprecate :data:`typing.AnyStr`. In Python 3.16, it will be removed from " "``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted at " @@ -2866,12 +2870,12 @@ msgid "" "(Contributed by Michael The in :gh:`107116`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1936 +#: ../../whatsnew/3.13.rst:1938 #: ../../deprecations/pending-removal-in-3.15.rst:84 msgid ":mod:`wave`:" msgstr ":mod:`wave`:" -#: ../../whatsnew/3.13.rst:1938 +#: ../../whatsnew/3.13.rst:1940 msgid "" "Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" "`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" @@ -3295,6 +3299,9 @@ msgid "" "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 #: ../../deprecations/pending-removal-in-future.rst:12 @@ -3773,11 +3780,11 @@ msgstr "" ":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport." "zipimporter.exec_module`。" -#: ../../whatsnew/3.13.rst:1955 +#: ../../whatsnew/3.13.rst:1957 msgid "CPython Bytecode Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1957 +#: ../../whatsnew/3.13.rst:1959 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 " @@ -3786,97 +3793,97 @@ msgid "" "`111354`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1965 +#: ../../whatsnew/3.13.rst:1967 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.13.rst:1970 +#: ../../whatsnew/3.13.rst:1972 msgid "" "Add the :ref:`PyMonitoring C API <c-api-monitoring>` for generating :pep:" "`669` monitoring events:" msgstr "" -#: ../../whatsnew/3.13.rst:1973 +#: ../../whatsnew/3.13.rst:1975 msgid ":c:type:`PyMonitoringState`" msgstr ":c:type:`PyMonitoringState`" -#: ../../whatsnew/3.13.rst:1974 +#: ../../whatsnew/3.13.rst:1976 msgid ":c:func:`PyMonitoring_FirePyStartEvent`" msgstr ":c:func:`PyMonitoring_FirePyStartEvent`" -#: ../../whatsnew/3.13.rst:1975 +#: ../../whatsnew/3.13.rst:1977 msgid ":c:func:`PyMonitoring_FirePyResumeEvent`" msgstr ":c:func:`PyMonitoring_FirePyResumeEvent`" -#: ../../whatsnew/3.13.rst:1976 +#: ../../whatsnew/3.13.rst:1978 msgid ":c:func:`PyMonitoring_FirePyReturnEvent`" msgstr ":c:func:`PyMonitoring_FirePyReturnEvent`" -#: ../../whatsnew/3.13.rst:1977 +#: ../../whatsnew/3.13.rst:1979 msgid ":c:func:`PyMonitoring_FirePyYieldEvent`" msgstr ":c:func:`PyMonitoring_FirePyYieldEvent`" -#: ../../whatsnew/3.13.rst:1978 +#: ../../whatsnew/3.13.rst:1980 msgid ":c:func:`PyMonitoring_FireCallEvent`" msgstr ":c:func:`PyMonitoring_FireCallEvent`" -#: ../../whatsnew/3.13.rst:1979 +#: ../../whatsnew/3.13.rst:1981 msgid ":c:func:`PyMonitoring_FireLineEvent`" msgstr ":c:func:`PyMonitoring_FireLineEvent`" -#: ../../whatsnew/3.13.rst:1980 +#: ../../whatsnew/3.13.rst:1982 msgid ":c:func:`PyMonitoring_FireJumpEvent`" msgstr ":c:func:`PyMonitoring_FireJumpEvent`" -#: ../../whatsnew/3.13.rst:1981 +#: ../../whatsnew/3.13.rst:1983 msgid ":c:func:`PyMonitoring_FireBranchEvent`" msgstr ":c:func:`PyMonitoring_FireBranchEvent`" -#: ../../whatsnew/3.13.rst:1982 +#: ../../whatsnew/3.13.rst:1984 msgid ":c:func:`PyMonitoring_FireCReturnEvent`" msgstr ":c:func:`PyMonitoring_FireCReturnEvent`" -#: ../../whatsnew/3.13.rst:1983 +#: ../../whatsnew/3.13.rst:1985 msgid ":c:func:`PyMonitoring_FirePyThrowEvent`" msgstr ":c:func:`PyMonitoring_FirePyThrowEvent`" -#: ../../whatsnew/3.13.rst:1984 +#: ../../whatsnew/3.13.rst:1986 msgid ":c:func:`PyMonitoring_FireRaiseEvent`" msgstr ":c:func:`PyMonitoring_FireRaiseEvent`" -#: ../../whatsnew/3.13.rst:1985 +#: ../../whatsnew/3.13.rst:1987 msgid ":c:func:`PyMonitoring_FireCRaiseEvent`" msgstr ":c:func:`PyMonitoring_FireCRaiseEvent`" -#: ../../whatsnew/3.13.rst:1986 +#: ../../whatsnew/3.13.rst:1988 msgid ":c:func:`PyMonitoring_FireReraiseEvent`" msgstr ":c:func:`PyMonitoring_FireReraiseEvent`" -#: ../../whatsnew/3.13.rst:1987 +#: ../../whatsnew/3.13.rst:1989 msgid ":c:func:`PyMonitoring_FireExceptionHandledEvent`" msgstr ":c:func:`PyMonitoring_FireExceptionHandledEvent`" -#: ../../whatsnew/3.13.rst:1988 +#: ../../whatsnew/3.13.rst:1990 msgid ":c:func:`PyMonitoring_FirePyUnwindEvent`" msgstr ":c:func:`PyMonitoring_FirePyUnwindEvent`" -#: ../../whatsnew/3.13.rst:1989 +#: ../../whatsnew/3.13.rst:1991 msgid ":c:func:`PyMonitoring_FireStopIterationEvent`" msgstr ":c:func:`PyMonitoring_FireStopIterationEvent`" -#: ../../whatsnew/3.13.rst:1990 +#: ../../whatsnew/3.13.rst:1992 msgid ":c:func:`PyMonitoring_EnterScope`" msgstr ":c:func:`PyMonitoring_EnterScope`" -#: ../../whatsnew/3.13.rst:1991 +#: ../../whatsnew/3.13.rst:1993 msgid ":c:func:`PyMonitoring_ExitScope`" msgstr ":c:func:`PyMonitoring_ExitScope`" -#: ../../whatsnew/3.13.rst:1993 +#: ../../whatsnew/3.13.rst:1995 msgid "(Contributed by Irit Katriel in :gh:`111997`)." msgstr "" -#: ../../whatsnew/3.13.rst:1995 +#: ../../whatsnew/3.13.rst:1997 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:" @@ -3884,52 +3891,52 @@ msgid "" "operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2001 +#: ../../whatsnew/3.13.rst:2003 msgid "" "Add the :ref:`PyTime C API <c-api-time>` to provide access to system clocks:" msgstr "" -#: ../../whatsnew/3.13.rst:2003 +#: ../../whatsnew/3.13.rst:2005 msgid ":c:type:`PyTime_t`." msgstr ":c:type:`PyTime_t`。" -#: ../../whatsnew/3.13.rst:2004 +#: ../../whatsnew/3.13.rst:2006 msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX`." msgstr "" -#: ../../whatsnew/3.13.rst:2005 +#: ../../whatsnew/3.13.rst:2007 msgid ":c:func:`PyTime_AsSecondsDouble`." msgstr ":c:func:`PyTime_AsSecondsDouble`。" -#: ../../whatsnew/3.13.rst:2006 +#: ../../whatsnew/3.13.rst:2008 msgid ":c:func:`PyTime_Monotonic`." msgstr ":c:func:`PyTime_Monotonic`。" -#: ../../whatsnew/3.13.rst:2007 +#: ../../whatsnew/3.13.rst:2009 msgid ":c:func:`PyTime_MonotonicRaw`." msgstr ":c:func:`PyTime_MonotonicRaw`。" -#: ../../whatsnew/3.13.rst:2008 +#: ../../whatsnew/3.13.rst:2010 msgid ":c:func:`PyTime_PerfCounter`." msgstr ":c:func:`PyTime_PerfCounter`。" -#: ../../whatsnew/3.13.rst:2009 +#: ../../whatsnew/3.13.rst:2011 msgid ":c:func:`PyTime_PerfCounterRaw`." msgstr ":c:func:`PyTime_PerfCounterRaw`。" -#: ../../whatsnew/3.13.rst:2010 +#: ../../whatsnew/3.13.rst:2012 msgid ":c:func:`PyTime_Time`." msgstr ":c:func:`PyTime_Time`。" -#: ../../whatsnew/3.13.rst:2011 +#: ../../whatsnew/3.13.rst:2013 msgid ":c:func:`PyTime_TimeRaw`." msgstr ":c:func:`PyTime_TimeRaw`。" -#: ../../whatsnew/3.13.rst:2013 +#: ../../whatsnew/3.13.rst:2015 msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" -msgstr "" +msgstr "(由 Victor Stinner 和 Petr Viktorin 在 :gh:`110850` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2015 +#: ../../whatsnew/3.13.rst:2017 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*` " @@ -3937,7 +3944,7 @@ msgid "" "by Victor Stinner in :gh:`108314`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2021 +#: ../../whatsnew/3.13.rst:2023 msgid "" "Add the :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " "functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " @@ -3947,7 +3954,7 @@ msgid "" "`106004`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2029 +#: ../../whatsnew/3.13.rst:2031 msgid "" "Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" "c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " @@ -3956,7 +3963,7 @@ msgid "" "dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2037 +#: ../../whatsnew/3.13.rst:2039 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 " @@ -3965,7 +3972,7 @@ msgid "" "Victor Stinner in :gh:`111262`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2044 +#: ../../whatsnew/3.13.rst:2046 msgid "" "Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" "`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" @@ -3976,7 +3983,7 @@ msgid "" "gh:`106307`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2054 +#: ../../whatsnew/3.13.rst:2056 msgid "" "Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" "`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" @@ -3987,37 +3994,37 @@ msgid "" "Serhiy Storchaka in :gh:`106521`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2064 +#: ../../whatsnew/3.13.rst:2066 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:2069 +#: ../../whatsnew/3.13.rst:2071 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 <whatsnew313-locals-semantics>`:" msgstr "" -#: ../../whatsnew/3.13.rst:2073 +#: ../../whatsnew/3.13.rst:2075 msgid ":c:func:`PyEval_GetFrameBuiltins` replaces :c:func:`PyEval_GetBuiltins`" msgstr ":c:func:`PyEval_GetFrameBuiltins` 取代 :c:func:`PyEval_GetBuiltins`" -#: ../../whatsnew/3.13.rst:2074 +#: ../../whatsnew/3.13.rst:2076 msgid ":c:func:`PyEval_GetFrameGlobals` replaces :c:func:`PyEval_GetGlobals`" msgstr ":c:func:`PyEval_GetFrameGlobals` 取代 :c:func:`PyEval_GetGlobals`" -#: ../../whatsnew/3.13.rst:2075 +#: ../../whatsnew/3.13.rst:2077 msgid ":c:func:`PyEval_GetFrameLocals` replaces :c:func:`PyEval_GetLocals`" msgstr ":c:func:`PyEval_GetFrameLocals` 取代 :c:func:`PyEval_GetLocals`" -#: ../../whatsnew/3.13.rst:2077 +#: ../../whatsnew/3.13.rst:2079 msgid "(Contributed by Mark Shannon and Tian Gao in :gh:`74929`.)" -msgstr "" +msgstr "(由 Mark Shannon 和 Tian Gao 在 :gh:`74929` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2079 +#: ../../whatsnew/3.13.rst:2081 msgid "" "Add the :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` " "functions to get :term:`strong <strong reference>` or :term:`borrowed " @@ -4026,7 +4033,7 @@ msgid "" "constant zero. (Contributed by Victor Stinner in :gh:`115754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2086 +#: ../../whatsnew/3.13.rst:2088 msgid "" "Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" "func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " @@ -4034,35 +4041,35 @@ msgid "" "`105922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2091 +#: ../../whatsnew/3.13.rst:2093 msgid "" "Add the :c:func:`Py_IsFinalizing` function to check whether the main Python " "interpreter is :term:`shutting down <interpreter shutdown>`. (Contributed by " "Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2096 +#: ../../whatsnew/3.13.rst:2098 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:2101 +#: ../../whatsnew/3.13.rst:2103 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:2105 +#: ../../whatsnew/3.13.rst:2107 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:2110 +#: ../../whatsnew/3.13.rst:2112 msgid "" "Add the :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes`, " "and :c:func:`PyLong_FromUnsignedNativeBytes` functions to simplify " @@ -4070,27 +4077,27 @@ msgid "" "(Contributed by Steve Dower in :gh:`111140`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2116 +#: ../../whatsnew/3.13.rst:2118 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:2121 +#: ../../whatsnew/3.13.rst:2123 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:2125 +#: ../../whatsnew/3.13.rst:2127 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:2128 +#: ../../whatsnew/3.13.rst:2130 msgid "" "Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" "`PyObject_ClearManagedDict` functions. which must be called by the traverse " @@ -4099,7 +4106,7 @@ msgid "" "with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2136 +#: ../../whatsnew/3.13.rst:2138 msgid "" "Add the :c:func:`PyRefTracer_SetTracer` and :c:func:`PyRefTracer_GetTracer` " "functions, which enable tracking object creation and destruction in the same " @@ -4107,14 +4114,14 @@ msgid "" "in :gh:`93502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2142 +#: ../../whatsnew/3.13.rst:2144 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:2147 +#: ../../whatsnew/3.13.rst:2149 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 " @@ -4122,7 +4129,7 @@ msgid "" "result is ``NULL``. (Contributed by Victor Stinner in :gh:`108867`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2153 +#: ../../whatsnew/3.13.rst:2155 msgid "" "Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " "fully qualified name. The module name is prepended if :attr:`type." @@ -4130,14 +4137,14 @@ msgid "" "``'__main__'``. (Contributed by Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2159 +#: ../../whatsnew/3.13.rst:2161 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:2164 +#: ../../whatsnew/3.13.rst:2166 msgid "" "Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" "`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" @@ -4146,7 +4153,7 @@ msgid "" "Storchaka in :gh:`110289`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2171 +#: ../../whatsnew/3.13.rst:2173 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 " @@ -4154,47 +4161,47 @@ msgid "" "`105927`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2177 +#: ../../whatsnew/3.13.rst:2179 msgid "Add fixed variants of functions which silently ignore errors:" msgstr "" -#: ../../whatsnew/3.13.rst:2179 +#: ../../whatsnew/3.13.rst:2181 msgid "" ":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." msgstr "" -#: ../../whatsnew/3.13.rst:2180 +#: ../../whatsnew/3.13.rst:2182 msgid "" ":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" "`PyObject_HasAttrString`." msgstr "" -#: ../../whatsnew/3.13.rst:2182 +#: ../../whatsnew/3.13.rst:2184 msgid "" ":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." msgstr "" -#: ../../whatsnew/3.13.rst:2183 +#: ../../whatsnew/3.13.rst:2185 msgid "" ":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" "`PyMapping_HasKeyString`." msgstr "" -#: ../../whatsnew/3.13.rst:2186 +#: ../../whatsnew/3.13.rst:2188 msgid "" "The new functions return ``-1`` for errors and the standard ``1`` for true " "and ``0`` for false." msgstr "" -#: ../../whatsnew/3.13.rst:2189 +#: ../../whatsnew/3.13.rst:2191 msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" -msgstr "" +msgstr "(由 Serhiy Storchaka 在 :gh:`108511` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2193 +#: ../../whatsnew/3.13.rst:2195 msgid "Changed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2195 +#: ../../whatsnew/3.13.rst:2197 msgid "" "The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" "func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " @@ -4207,20 +4214,20 @@ msgid "" "`65210`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2207 +#: ../../whatsnew/3.13.rst:2209 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " "parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2211 +#: ../../whatsnew/3.13.rst:2213 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:2215 +#: ../../whatsnew/3.13.rst:2217 msgid "" "The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" "`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" @@ -4231,35 +4238,35 @@ msgid "" "documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2224 +#: ../../whatsnew/3.13.rst:2226 msgid "" "Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" "`PyUnicode_FromFormat`:" msgstr "" -#: ../../whatsnew/3.13.rst:2227 +#: ../../whatsnew/3.13.rst:2229 msgid "``%T``: Get the fully qualified name of an object type" msgstr "" -#: ../../whatsnew/3.13.rst:2228 +#: ../../whatsnew/3.13.rst:2230 msgid "``%#T``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2229 +#: ../../whatsnew/3.13.rst:2231 msgid "``%N``: Get the fully qualified name of a type" msgstr "" -#: ../../whatsnew/3.13.rst:2230 +#: ../../whatsnew/3.13.rst:2232 msgid "``%#N``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2232 +#: ../../whatsnew/3.13.rst:2234 msgid "" "See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" "`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2235 +#: ../../whatsnew/3.13.rst:2237 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 " @@ -4268,7 +4275,7 @@ msgid "" "`104922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2241 +#: ../../whatsnew/3.13.rst:2243 msgid "" "If Python is built in :ref:`debug mode <debug-build>` or :option:`with " "assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" @@ -4276,60 +4283,61 @@ msgid "" "(Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2249 +#: ../../whatsnew/3.13.rst:2251 msgid "Limited C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2251 +#: ../../whatsnew/3.13.rst:2253 msgid "The following functions are now included in the Limited C API:" msgstr "" -#: ../../whatsnew/3.13.rst:2253 +#: ../../whatsnew/3.13.rst:2255 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../whatsnew/3.13.rst:2254 +#: ../../whatsnew/3.13.rst:2256 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../whatsnew/3.13.rst:2255 +#: ../../whatsnew/3.13.rst:2257 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../whatsnew/3.13.rst:2256 +#: ../../whatsnew/3.13.rst:2258 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../whatsnew/3.13.rst:2257 +#: ../../whatsnew/3.13.rst:2259 msgid ":c:func:`PySys_Audit`" msgstr ":c:func:`PySys_Audit`" -#: ../../whatsnew/3.13.rst:2258 +#: ../../whatsnew/3.13.rst:2260 msgid ":c:func:`PySys_AuditTuple`" msgstr ":c:func:`PySys_AuditTuple`" -#: ../../whatsnew/3.13.rst:2259 +#: ../../whatsnew/3.13.rst:2261 msgid ":c:func:`PyType_GetModuleByDef`" msgstr ":c:func:`PyType_GetModuleByDef`" -#: ../../whatsnew/3.13.rst:2261 +#: ../../whatsnew/3.13.rst:2263 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:2263 +#: ../../whatsnew/3.13.rst:2265 msgid "" "Python built with :option:`--with-trace-refs` (tracing references) now " "supports the :ref:`Limited API <limited-c-api>`. (Contributed by Victor " "Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2269 +#: ../../whatsnew/3.13.rst:2271 msgid "Removed C APIs" -msgstr "" +msgstr "移除的 C API" -#: ../../whatsnew/3.13.rst:2271 +#: ../../whatsnew/3.13.rst:2273 msgid "" "Remove several functions, macros, variables, etc with names prefixed by " "``_Py`` or ``_PY`` (which are considered private). If your project is " @@ -4339,13 +4347,13 @@ msgid "" "Victor Stinner. (Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2279 +#: ../../whatsnew/3.13.rst:2281 msgid "" "Remove old buffer protocols deprecated in Python 3.0. Use :ref:" "`bufferobjects` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2282 +#: ../../whatsnew/3.13.rst:2284 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " "test whether the object supports the buffer protocol. Note that :c:func:" @@ -4354,13 +4362,15 @@ msgid "" "example of :c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../whatsnew/3.13.rst:2290 +#: ../../whatsnew/3.13.rst:2292 msgid "" ":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" "func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" msgstr "" +":c:func:`!PyObject_AsCharBuffer`、:c:func:`!PyObject_AsReadBuffer`:請改用 :" +"c:func:`PyObject_GetBuffer` 和 :c:func:`PyBuffer_Release`。" -#: ../../whatsnew/3.13.rst:2293 +#: ../../whatsnew/3.13.rst:2295 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) < 0) {\n" @@ -4371,13 +4381,15 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2303 +#: ../../whatsnew/3.13.rst:2305 msgid "" ":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" "func:`PyBuffer_Release` instead:" msgstr "" +":c:func:`!PyObject_AsWriteBuffer`:請改用 :c:func:`PyObject_GetBuffer` 和 :c:" +"func:`PyBuffer_Release`。" -#: ../../whatsnew/3.13.rst:2306 +#: ../../whatsnew/3.13.rst:2308 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_WRITABLE) < 0) {\n" @@ -4387,21 +4399,23 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2315 +#: ../../whatsnew/3.13.rst:2317 msgid "(Contributed by Inada Naoki in :gh:`85275`.)" -msgstr "" +msgstr "(由 Inada Naoki 貢獻於 :gh:`85275`。)" -#: ../../whatsnew/3.13.rst:2317 +#: ../../whatsnew/3.13.rst:2319 msgid "Remove various functions deprecated in Python 3.9:" msgstr "" -#: ../../whatsnew/3.13.rst:2319 +#: ../../whatsnew/3.13.rst:2321 msgid "" ":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" "c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." msgstr "" +":c:func:`!PyEval_CallObject`、:c:func:`!PyEval_CallObjectWithKeywords`:請改" +"用 :c:func:`PyObject_CallNoArgs` 或 :c:func:`PyObject_Call`。" -#: ../../whatsnew/3.13.rst:2324 +#: ../../whatsnew/3.13.rst:2326 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 " @@ -4412,107 +4426,124 @@ msgid "" "`PyTuple_New(0) <PyTuple_New>`." msgstr "" -#: ../../whatsnew/3.13.rst:2334 +#: ../../whatsnew/3.13.rst:2336 msgid "" ":c:func:`!PyEval_CallFunction`: Use :c:func:`PyObject_CallFunction` instead." msgstr "" +":c:func:`!PyEval_CallFunction`:請改用 :c:func:`PyObject_CallFunction`。" -#: ../../whatsnew/3.13.rst:2336 +#: ../../whatsnew/3.13.rst:2338 msgid "" ":c:func:`!PyEval_CallMethod`: Use :c:func:`PyObject_CallMethod` instead." -msgstr "" +msgstr ":c:func:`!PyEval_CallMethod`:請改用 :c:func:`PyObject_CallMethod`。" -#: ../../whatsnew/3.13.rst:2338 +#: ../../whatsnew/3.13.rst:2340 msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." -msgstr "" +msgstr ":c:func:`!PyCFunction_Call`:請改用 :c:func:`PyCFunction_Call`。" -#: ../../whatsnew/3.13.rst:2341 +#: ../../whatsnew/3.13.rst:2343 msgid "(Contributed by Victor Stinner in :gh:`105107`.)" -msgstr "" +msgstr "(由 Victor Stinner 貢獻於 :gh:`105107`。)" -#: ../../whatsnew/3.13.rst:2343 +#: ../../whatsnew/3.13.rst:2345 msgid "" "Remove the following old functions to configure the Python initialization, " "deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:2346 +#: ../../whatsnew/3.13.rst:2348 msgid "" ":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." msgstr "" +":c:func:`!PySys_AddWarnOptionUnicode`:請改用 :c:member:`PyConfig." +"warnoptions`。" -#: ../../whatsnew/3.13.rst:2348 +#: ../../whatsnew/3.13.rst:2350 msgid "" ":c:func:`!PySys_AddWarnOption`: Use :c:member:`PyConfig.warnoptions` instead." msgstr "" +":c:func:`!PySys_AddWarnOption`:請改用 :c:member:`PyConfig.warnoptions`。" -#: ../../whatsnew/3.13.rst:2350 +#: ../../whatsnew/3.13.rst:2352 msgid ":c:func:`!PySys_AddXOption`: Use :c:member:`PyConfig.xoptions` instead." -msgstr "" +msgstr ":c:func:`!PySys_AddXOption`:請改用 :c:member:`PyConfig.xoptions`。" -#: ../../whatsnew/3.13.rst:2352 +#: ../../whatsnew/3.13.rst:2354 msgid "" ":c:func:`!PySys_HasWarnOptions`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" +":c:func:`!PySys_HasWarnOptions`:請改用 :c:member:`PyConfig.xoptions`。" -#: ../../whatsnew/3.13.rst:2354 +#: ../../whatsnew/3.13.rst:2356 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:2356 +#: ../../whatsnew/3.13.rst:2358 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:2358 +#: ../../whatsnew/3.13.rst:2360 msgid "" ":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." "stdio_encoding` instead, and set also maybe :c:member:`PyConfig." "legacy_windows_stdio` (on Windows)." msgstr "" +":c:func:`!Py_SetStandardStreamEncoding`:請改用 :c:member:`PyConfig." +"stdio_encoding` 並設定可能的 :c:member:`PyConfig.legacy_windows_stdio`\\ " +"(在 Windows 上)。" -#: ../../whatsnew/3.13.rst:2361 +#: ../../whatsnew/3.13.rst:2363 msgid "" ":c:func:`!_Py_SetProgramFullPath`: Set :c:member:`PyConfig.executable` " "instead." msgstr "" +":c:func:`!_Py_SetProgramFullPath`:請改用 :c:member:`PyConfig.executable`。" -#: ../../whatsnew/3.13.rst:2364 +#: ../../whatsnew/3.13.rst:2366 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration <init-config>` instead (:pep:`587`), added to Python 3.8. " "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" +"請改用 :ref:`Python 初始化設定 <init-config>`\\ 的新 :c:type:`PyConfig` API " +"(:pep:`587`),這是在 Python 3.8 中新增的。(由 Victor Stinner 於 :gh:" +"`105145` 貢獻。)" -#: ../../whatsnew/3.13.rst:2368 +#: ../../whatsnew/3.13.rst:2370 msgid "" "Remove :c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_ReleaseLock` " "functions, deprecated in Python 3.2. They didn't update the current thread " "state. They can be replaced with:" msgstr "" +"移除 :c:func:`!PyEval_AcquireLock` 和 :c:func:`!PyEval_ReleaseLock` 函式,這" +"些函式在 Python 3.2 中已被廢棄。它們不會更新目前的執行緒狀態。可以用以下函式" +"取代:" -#: ../../whatsnew/3.13.rst:2373 +#: ../../whatsnew/3.13.rst:2375 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`;" msgstr ":c:func:`PyEval_SaveThread` 和 :c:func:`PyEval_RestoreThread`;" -#: ../../whatsnew/3.13.rst:2374 +#: ../../whatsnew/3.13.rst:2376 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:2375 +#: ../../whatsnew/3.13.rst:2377 msgid "or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`." msgstr "或 :c:func:`PyGILState_Ensure` 與 :c:func:`PyGILState_Release`。" -#: ../../whatsnew/3.13.rst:2377 +#: ../../whatsnew/3.13.rst:2379 msgid "(Contributed by Victor Stinner in :gh:`105182`.)" -msgstr "" +msgstr "(由 Victor Stinner 貢獻於 :gh:`105182`。)" -#: ../../whatsnew/3.13.rst:2379 +#: ../../whatsnew/3.13.rst:2381 msgid "" "Remove the :c:func:`!PyEval_ThreadsInitialized` function, deprecated in " "Python 3.9. Since Python 3.7, :c:func:`!Py_Initialize` always creates the " @@ -4521,7 +4552,7 @@ msgid "" "Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2386 +#: ../../whatsnew/3.13.rst:2388 msgid "" "Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" "`PyInterpreterState_Get()` which was kept for backward compatibility with " @@ -4530,26 +4561,28 @@ msgid "" "Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2393 +#: ../../whatsnew/3.13.rst:2395 msgid "" "Remove the private :c:func:`!_PyObject_FastCall` function: use :c:func:`!" "PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " "(Contributed by Victor Stinner in :gh:`106023`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2398 +#: ../../whatsnew/3.13.rst:2400 msgid "" "Remove the ``cpython/pytime.h`` header file, which only contained private " "functions. (Contributed by Victor Stinner in :gh:`106316`.)" msgstr "" +"移除只包含私有函式的 ``cpython/pytime.h`` 標頭檔。(由 Victor Stinner 於 :gh:" +"`106316` 貢獻。)" -#: ../../whatsnew/3.13.rst:2402 +#: ../../whatsnew/3.13.rst:2404 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:2405 +#: ../../whatsnew/3.13.rst:2407 msgid "" "Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END``. Replace both with the new macros " @@ -4557,15 +4590,15 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2412 +#: ../../whatsnew/3.13.rst:2414 msgid "Deprecated C APIs" msgstr "器用的 C API" -#: ../../whatsnew/3.13.rst:2414 +#: ../../whatsnew/3.13.rst:2416 msgid "Deprecate old Python initialization functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2416 +#: ../../whatsnew/3.13.rst:2418 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" @@ -4574,30 +4607,30 @@ msgstr "" ":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" "data:`!warnings.filters`。" -#: ../../whatsnew/3.13.rst:2418 +#: ../../whatsnew/3.13.rst:2420 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr ":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.exec_prefix`。" -#: ../../whatsnew/3.13.rst:2420 +#: ../../whatsnew/3.13.rst:2422 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" -#: ../../whatsnew/3.13.rst:2422 +#: ../../whatsnew/3.13.rst:2424 msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr ":c:func:`Py_GetPrefix`:請改用 :data:`sys.prefix`。" -#: ../../whatsnew/3.13.rst:2424 +#: ../../whatsnew/3.13.rst:2426 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramFullPath`:請改用 :data:`sys.executable`。" -#: ../../whatsnew/3.13.rst:2426 +#: ../../whatsnew/3.13.rst:2428 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。" -#: ../../whatsnew/3.13.rst:2428 +#: ../../whatsnew/3.13.rst:2430 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 msgid "" ":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" @@ -4606,32 +4639,32 @@ msgstr "" ":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:" "`PYTHONHOME` 環境變數。" -#: ../../whatsnew/3.13.rst:2432 +#: ../../whatsnew/3.13.rst:2434 msgid "(Contributed by Victor Stinner in :gh:`105145`.)" -msgstr "" +msgstr "(由 Victor Stinner 在 :gh:`105145` 中貢獻。)" -#: ../../whatsnew/3.13.rst:2434 +#: ../../whatsnew/3.13.rst:2436 msgid "" ":term:`Soft deprecate <soft deprecated>` the :c:func:`PyEval_GetBuiltins`, :" "c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " "return a :term:`borrowed reference`. (Soft deprecated as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2440 +#: ../../whatsnew/3.13.rst:2442 msgid "" "Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function, which is just " "an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " "by Victor Stinner in :gh:`105396`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2444 +#: ../../whatsnew/3.13.rst:2446 msgid "" ":term:`Soft deprecate <soft deprecated>` the :c:func:`PyModule_AddObject` " "function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" "`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2450 +#: ../../whatsnew/3.13.rst:2452 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 " @@ -4640,7 +4673,7 @@ msgid "" "`105156`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2457 +#: ../../whatsnew/3.13.rst:2459 msgid "" "Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" "`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " @@ -5017,56 +5050,56 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.13.rst:2477 +#: ../../whatsnew/3.13.rst:2479 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.13.rst:2479 +#: ../../whatsnew/3.13.rst:2481 msgid "" "``arm64-apple-ios`` and ``arm64-apple-ios-simulator`` are both now :pep:`11` " "tier 3 platforms. (:ref:`PEP 730 <whatsnew313-platform-support>` written and " "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2484 +#: ../../whatsnew/3.13.rst:2486 msgid "" "``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" "`11` tier 3 platforms. (:ref:`PEP 738 <whatsnew313-platform-support>` " "written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2489 +#: ../../whatsnew/3.13.rst:2491 msgid "" "``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " "Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2492 +#: ../../whatsnew/3.13.rst:2494 msgid "" "``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " "(Contributed by Brett Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2495 +#: ../../whatsnew/3.13.rst:2497 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:2498 +#: ../../whatsnew/3.13.rst:2500 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:2502 +#: ../../whatsnew/3.13.rst:2504 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:2506 +#: ../../whatsnew/3.13.rst:2508 msgid "" "CPython now bundles the `mimalloc library`_ by default. It is licensed under " "the MIT license; see :ref:`mimalloc license <mimalloc-license>`. The bundled " @@ -5074,28 +5107,28 @@ msgid "" "Dino Viehland in :gh:`109914`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2514 +#: ../../whatsnew/3.13.rst:2516 msgid "" "The :file:`configure` option :option:`--with-system-libmpdec` now defaults " "to ``yes``. The bundled copy of ``libmpdecimal`` will be removed in Python " "3.15." msgstr "" -#: ../../whatsnew/3.13.rst:2518 +#: ../../whatsnew/3.13.rst:2520 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 <debug-build>`. (Contributed by Victor Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2523 +#: ../../whatsnew/3.13.rst:2525 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:2527 +#: ../../whatsnew/3.13.rst:2529 msgid "" "The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " "``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." @@ -5105,27 +5138,27 @@ msgid "" "`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2536 +#: ../../whatsnew/3.13.rst:2538 msgid "Porting to Python 3.13" msgstr "移植至 Python 3.13" -#: ../../whatsnew/3.13.rst:2538 +#: ../../whatsnew/3.13.rst:2540 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.13.rst:2542 +#: ../../whatsnew/3.13.rst:2544 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.13.rst:2546 +#: ../../whatsnew/3.13.rst:2548 msgid "" ":ref:`PEP 667 <whatsnew313-locals-semantics>` introduces several changes to " "the semantics of :func:`locals` and :attr:`f_locals <frame.f_locals>`:" msgstr "" -#: ../../whatsnew/3.13.rst:2549 +#: ../../whatsnew/3.13.rst:2551 msgid "" "Calling :func:`locals` in an :term:`optimized scope` now produces an " "independent snapshot on each call, and hence no longer implicitly updates " @@ -5137,7 +5170,7 @@ msgid "" "scope. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2558 +#: ../../whatsnew/3.13.rst:2560 msgid "" "Calling :func:`locals` from a comprehension at module or class scope " "(including via ``exec`` or ``eval``) once more behaves as if the " @@ -5147,7 +5180,7 @@ msgid "" "implementing :pep:`709`. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2565 +#: ../../whatsnew/3.13.rst:2567 msgid "" "Accessing :attr:`FrameType.f_locals <frame.f_locals>` in an :term:`optimized " "scope` now returns a write-through proxy rather than a snapshot that gets " @@ -5156,7 +5189,7 @@ msgid "" "of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2571 +#: ../../whatsnew/3.13.rst:2573 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:" @@ -5164,14 +5197,14 @@ msgid "" "Serhiy Storchaka in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2577 +#: ../../whatsnew/3.13.rst:2579 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:2582 +#: ../../whatsnew/3.13.rst:2584 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 " @@ -5180,13 +5213,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2588 +#: ../../whatsnew/3.13.rst:2590 msgid "" ":class:`mailbox.Maildir` now ignores files with a leading dot (``.``). " "(Contributed by Zackery Spytz in :gh:`65559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2591 +#: ../../whatsnew/3.13.rst:2593 msgid "" ":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " "files and directories if a pattern that ends with \"``**``\" is given, " @@ -5194,25 +5227,25 @@ msgid "" "behavior and only match directories." msgstr "" -#: ../../whatsnew/3.13.rst:2596 +#: ../../whatsnew/3.13.rst:2598 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:2601 +#: ../../whatsnew/3.13.rst:2603 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:2608 +#: ../../whatsnew/3.13.rst:2610 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.13.rst:2610 +#: ../../whatsnew/3.13.rst:2612 msgid "" "``Python.h`` no longer includes the ``<ieeefp.h>`` standard header. It was " "included for the :c:func:`!finite` function which is now provided by the " @@ -5221,7 +5254,7 @@ msgid "" "`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2616 +#: ../../whatsnew/3.13.rst:2618 msgid "" "``Python.h`` no longer includes these standard header files: ``<time.h>``, " "``<sys/select.h>`` and ``<sys/time.h>``. If needed, they should now be " @@ -5232,7 +5265,7 @@ msgid "" "Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2624 +#: ../../whatsnew/3.13.rst:2626 msgid "" "On Windows, ``Python.h`` no longer includes the ``<stddef.h>`` standard " "header file. If needed, it should now be included explicitly. For example, " @@ -5242,7 +5275,7 @@ msgid "" "(Contributed by Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2631 +#: ../../whatsnew/3.13.rst:2633 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:`!" @@ -5250,18 +5283,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2636 +#: ../../whatsnew/3.13.rst:2638 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:2640 +#: ../../whatsnew/3.13.rst:2642 msgid "A ``tp_dealloc`` function that has the old macros, such as::" -msgstr "" +msgstr "有舊巨集的 ``tp_dealloc`` 函式,例如: ::" -#: ../../whatsnew/3.13.rst:2642 +#: ../../whatsnew/3.13.rst:2644 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5281,11 +5314,11 @@ msgstr "" " Py_TRASHCAN_SAFE_END\n" "}" -#: ../../whatsnew/3.13.rst:2651 +#: ../../whatsnew/3.13.rst:2653 msgid "should migrate to the new macros as follows::" -msgstr "" +msgstr "應該改為使用新的巨集,如下所示: ::" -#: ../../whatsnew/3.13.rst:2653 +#: ../../whatsnew/3.13.rst:2655 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5305,7 +5338,7 @@ msgstr "" " Py_TRASHCAN_END\n" "}" -#: ../../whatsnew/3.13.rst:2662 +#: ../../whatsnew/3.13.rst:2664 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 " @@ -5313,13 +5346,13 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2669 +#: ../../whatsnew/3.13.rst:2671 msgid "" ":ref:`PEP 667 <whatsnew313-locals-semantics>` introduces several changes to " "frame-related functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2672 +#: ../../whatsnew/3.13.rst:2674 msgid "" "The effects of mutating the dictionary returned from :c:func:" "`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " @@ -5333,7 +5366,7 @@ msgid "" "being used, so refer to the deprecation notice on the function for details." msgstr "" -#: ../../whatsnew/3.13.rst:2685 +#: ../../whatsnew/3.13.rst:2687 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 " @@ -5342,25 +5375,25 @@ msgid "" "`PyEval_GetFrameLocals` API." msgstr "" -#: ../../whatsnew/3.13.rst:2692 +#: ../../whatsnew/3.13.rst:2694 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:2697 +#: ../../whatsnew/3.13.rst:2699 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 <optimized scope>`." msgstr "" -#: ../../whatsnew/3.13.rst:2702 +#: ../../whatsnew/3.13.rst:2704 msgid "Regression Test Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2704 +#: ../../whatsnew/3.13.rst:2706 msgid "" "Python built with :file:`configure` :option:`--with-pydebug` now supports a :" "option:`-X presite=package.module <-X>` command-line option. If used, it " @@ -5369,9 +5402,13 @@ msgid "" "in :gh:`110769`.)" msgstr "" -#~ msgid "" -#~ "date and datetime adapter, date and timestamp converter: see the :mod:" -#~ "`sqlite3` documentation for suggested replacement recipes." -#~ msgstr "" -#~ "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 " -#~ "(converter):請參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" +#: ../../whatsnew/3.13.rst:2714 +msgid "Notable changes in 3.13.1" +msgstr "Python 3.13.1 中顯著的變更" + +#: ../../whatsnew/3.13.rst:2719 +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." +msgstr "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 511a0066bc..d928fca84e 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-10 00:13+0000\n" +"POT-Creation-Date: 2024-11-26 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2828,7 +2828,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:1982 msgid "" -"A new opcode, :opcode:`LOAD_CLASSDEREF`, has been added to fix a bug in the " +"A new opcode, :opcode:`!LOAD_CLASSDEREF`, has been added to fix a bug in the " "loading of free variables in class bodies that could be triggered by certain " "uses of :ref:`__prepare__ <prepare>`. (Contributed by Benjamin Peterson in :" "issue:`17853`.)" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 53d989f8b5..b63071a79e 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-11-26 00:14+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -3465,8 +3465,8 @@ msgstr "" #: ../../whatsnew/3.6.rst:2369 msgid "" -"The new :opcode:`FORMAT_VALUE` and :opcode:`BUILD_STRING` opcodes as part of " -"the :ref:`formatted string literal <whatsnew36-pep498>` implementation. " +"The new :opcode:`!FORMAT_VALUE` and :opcode:`BUILD_STRING` opcodes as part " +"of the :ref:`formatted string literal <whatsnew36-pep498>` implementation. " "(Contributed by Eric Smith in :issue:`25483` and Serhiy Storchaka in :issue:" "`27078`.)" msgstr "" @@ -3481,10 +3481,10 @@ msgstr "" #: ../../whatsnew/3.6.rst:2378 msgid "" "The function call opcodes have been heavily reworked for better performance " -"and simpler implementation. The :opcode:`MAKE_FUNCTION`, :opcode:" -"`CALL_FUNCTION`, :opcode:`CALL_FUNCTION_KW` and :opcode:" -"`BUILD_MAP_UNPACK_WITH_CALL` opcodes have been modified, the new :opcode:" -"`CALL_FUNCTION_EX` and :opcode:`BUILD_TUPLE_UNPACK_WITH_CALL` have been " +"and simpler implementation. The :opcode:`MAKE_FUNCTION`, :opcode:`!" +"CALL_FUNCTION`, :opcode:`!CALL_FUNCTION_KW` and :opcode:`!" +"BUILD_MAP_UNPACK_WITH_CALL` opcodes have been modified, the new :opcode:" +"`CALL_FUNCTION_EX` and :opcode:`!BUILD_TUPLE_UNPACK_WITH_CALL` have been " "added, and ``CALL_FUNCTION_VAR``, ``CALL_FUNCTION_VAR_KW`` and " "``MAKE_CLOSURE`` opcodes have been removed. (Contributed by Demur Rumed in :" "issue:`27095`, and Serhiy Storchaka in :issue:`27213`, :issue:`28257`.)" @@ -3492,7 +3492,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2389 msgid "" -"The new :opcode:`SETUP_ANNOTATIONS` and :opcode:`STORE_ANNOTATION` opcodes " +"The new :opcode:`SETUP_ANNOTATIONS` and :opcode:`!STORE_ANNOTATION` opcodes " "have been added to support the new :term:`variable annotation` syntax. " "(Contributed by Ivan Levkivskyi in :issue:`27985`.)" msgstr "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index a02c86b5b8..6e6f30678a 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-11-26 00:14+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3546,14 +3546,14 @@ msgstr "CPython 位元組碼變更" #: ../../whatsnew/3.7.rst:2479 msgid "" -"There are two new opcodes: :opcode:`LOAD_METHOD` and :opcode:`CALL_METHOD`. " +"There are two new opcodes: :opcode:`LOAD_METHOD` and :opcode:`!CALL_METHOD`. " "(Contributed by Yury Selivanov and INADA Naoki in :issue:`26110`.)" msgstr "" #: ../../whatsnew/3.7.rst:2482 msgid "" -"The :opcode:`STORE_ANNOTATION` opcode has been removed. (Contributed by Mark " -"Shannon in :issue:`32550`.)" +"The :opcode:`!STORE_ANNOTATION` opcode has been removed. (Contributed by " +"Mark Shannon in :issue:`32550`.)" msgstr "" #: ../../whatsnew/3.7.rst:2489 diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index ca437cad1c..a537637276 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-11-26 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1528,7 +1528,7 @@ msgstr "logging" #: ../../whatsnew/3.8.rst:939 msgid "" -"Added a *force* keyword argument to :func:`logging.basicConfig` When set to " +"Added a *force* keyword argument to :func:`logging.basicConfig`. When set to " "true, any existing handlers attached to the root logger are removed and " "closed before carrying out the configuration specified by the other " "arguments." @@ -3348,11 +3348,11 @@ msgstr "" #: ../../whatsnew/3.8.rst:2155 msgid "" -"Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`, :opcode:" -"`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes :opcode:" -"`ROT_FOUR`, :opcode:`BEGIN_FINALLY`, :opcode:`CALL_FINALLY` and :opcode:" -"`POP_FINALLY`. Changed the behavior of :opcode:`END_FINALLY` and :opcode:" -"`WITH_CLEANUP_START`." +"Removed opcodes :opcode:`!BREAK_LOOP`, :opcode:`!CONTINUE_LOOP`, :opcode:`!" +"SETUP_LOOP` and :opcode:`!SETUP_EXCEPT`. Added new opcodes :opcode:`!" +"ROT_FOUR`, :opcode:`!BEGIN_FINALLY`, :opcode:`!CALL_FINALLY` and :opcode:`!" +"POP_FINALLY`. Changed the behavior of :opcode:`!END_FINALLY` and :opcode:`!" +"WITH_CLEANUP_START`." msgstr "" #: ../../whatsnew/3.8.rst:2161